All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 00/13] Introducing AMD x2APIC Virtualization (x2AVIC) support.
@ 2022-02-21  2:19 Suravee Suthikulpanit
  2022-02-21  2:19 ` [RFC PATCH 01/13] KVM: SVM: Add warning when encounter invalid APIC ID Suravee Suthikulpanit
                   ` (13 more replies)
  0 siblings, 14 replies; 42+ messages in thread
From: Suravee Suthikulpanit @ 2022-02-21  2:19 UTC (permalink / raw)
  To: linux-kernel, kvm
  Cc: pbonzini, seanjc, joro, jon.grimm, wei.huang2, terry.bowman,
	Suravee Suthikulpanit

Previously, with AVIC, guest needs to disable x2APIC capability and
can only run in APIC mode to activate hardware-accelerated interrupt
virtualization.  With x2AVIC, guest can run in x2APIC mode.
This feature is indicated by the CPUID Fn8000_000A EDX[14],
and it can be activated by setting bit 31 (enable AVIC) and
bit 30 (x2APIC mode) of VMCB offset 60h.

The mode of interrupt virtualization can dynamically change during runtime.
For example, when AVIC is enabled, the hypervisor currently keeps track of
the AVIC activation and set the VMCB bit 31 accordingly. With x2AVIC,
the guest OS can also switch between APIC and x2APIC modes during runtime.
The kvm_amd driver needs to also keep track and set the VMCB
bit 30 accordingly. 

Besides, for x2AVIC, kvm_amd driver needs to disable interception for the
x2APIC MSR range to allow AVIC hardware to virtualize register accesses.

Testing:
  * This series has been tested booting a Linux VM with x2APIC physical
    and logical modes upto 511 vCPUs.

Regards,
Suravee


Suravee Suthikulpanit (13):
  KVM: SVM: Add warning when encounter invalid APIC ID
  x86/cpufeatures: Introduce x2AVIC CPUID bit
  KVM: SVM: Detect X2APIC virtualization (x2AVIC) support
  KVM: SVM: Only call vcpu_(un)blocking when AVIC is enabled.
  KVM: SVM: Update max number of vCPUs supported for x2AVIC mode
  KVM: SVM: Add logic to determine x2APIC mode
  KVM: SVM: Update avic_kick_target_vcpus to support 32-bit APIC ID
  KVM: SVM: Do not update logical APIC ID table when in x2APIC mode
  KVM: SVM: Introduce helper function avic_get_apic_id
  KVM: SVM: Adding support for configuring x2APIC MSRs interception
  KVM: SVM: Add logic to switch between APIC and x2APIC virtualization
    mode
  KVM: SVM: Remove APICv inhibit reasone due to x2APIC
  KVM: SVM: Use fastpath x2apic IPI emulation when #vmexit with x2AVIC

 arch/x86/include/asm/cpufeatures.h |   1 +
 arch/x86/include/asm/svm.h         |  15 +-
 arch/x86/kvm/svm/avic.c            | 216 ++++++++++++++++++++++++++---
 arch/x86/kvm/svm/svm.c             | 102 ++++++++------
 arch/x86/kvm/svm/svm.h             |  13 +-
 arch/x86/kvm/x86.c                 |   3 +-
 arch/x86/kvm/x86.h                 |   1 +
 7 files changed, 281 insertions(+), 70 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2022-03-08  5:24 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-21  2:19 [RFC PATCH 00/13] Introducing AMD x2APIC Virtualization (x2AVIC) support Suravee Suthikulpanit
2022-02-21  2:19 ` [RFC PATCH 01/13] KVM: SVM: Add warning when encounter invalid APIC ID Suravee Suthikulpanit
2022-02-24 16:30   ` Maxim Levitsky
2022-02-21  2:19 ` [RFC PATCH 02/13] x86/cpufeatures: Introduce x2AVIC CPUID bit Suravee Suthikulpanit
2022-02-24 16:32   ` Maxim Levitsky
2022-02-21  2:19 ` [RFC PATCH 03/13] KVM: SVM: Detect X2APIC virtualization (x2AVIC) support Suravee Suthikulpanit
2022-02-24 16:52   ` Maxim Levitsky
2022-03-01  9:45     ` Suravee Suthikulpanit
2022-02-21  2:19 ` [RFC PATCH 04/13] KVM: SVM: Only call vcpu_(un)blocking when AVIC is enabled Suravee Suthikulpanit
2022-02-24 16:54   ` Maxim Levitsky
2022-03-01  9:59     ` Suravee Suthikulpanit
2022-02-21  2:19 ` [RFC PATCH 05/13] KVM: SVM: Update max number of vCPUs supported for x2AVIC mode Suravee Suthikulpanit
2022-02-24 17:18   ` Maxim Levitsky
2022-03-01 10:47     ` Suravee Suthikulpanit
2022-03-01 11:31       ` Maxim Levitsky
2022-02-21  2:19 ` [RFC PATCH 06/13] KVM: SVM: Add logic to determine x2APIC mode Suravee Suthikulpanit
2022-02-24 17:29   ` Maxim Levitsky
2022-03-03  2:12     ` Suthikulpanit, Suravee
2022-03-03 13:12     ` Suravee Suthikulpanit
2022-02-21  2:19 ` [RFC PATCH 07/13] KVM: SVM: Update avic_kick_target_vcpus to support 32-bit APIC ID Suravee Suthikulpanit
2022-02-24 17:35   ` Maxim Levitsky
2022-03-03 14:41     ` Suravee Suthikulpanit
2022-02-21  2:19 ` [RFC PATCH 08/13] KVM: SVM: Do not update logical APIC ID table when in x2APIC mode Suravee Suthikulpanit
2022-02-24 17:41   ` Maxim Levitsky
2022-03-08  5:24     ` Suthikulpanit, Suravee
2022-02-21  2:19 ` [RFC PATCH 09/13] KVM: SVM: Introduce helper function avic_get_apic_id Suravee Suthikulpanit
2022-02-24 19:46   ` Maxim Levitsky
2022-02-21  2:19 ` [RFC PATCH 10/13] KVM: SVM: Adding support for configuring x2APIC MSRs interception Suravee Suthikulpanit
2022-02-24 19:51   ` Maxim Levitsky
2022-03-07 10:14     ` Suthikulpanit, Suravee
2022-02-21  2:19 ` [RFC PATCH 11/13] KVM: SVM: Add logic to switch between APIC and x2APIC virtualization mode Suravee Suthikulpanit
2022-02-22  5:39   ` Suthikulpanit, Suravee
2022-02-24 20:03   ` Maxim Levitsky
2022-03-04 11:22     ` Suravee Suthikulpanit
2022-03-04 11:51       ` Maxim Levitsky
2022-02-21  2:19 ` [RFC PATCH 12/13] KVM: SVM: Remove APICv inhibit reasone due to x2APIC Suravee Suthikulpanit
2022-02-24 20:06   ` Maxim Levitsky
2022-03-01 14:02     ` Suravee Suthikulpanit
2022-02-21  2:19 ` [RFC PATCH 13/13] KVM: SVM: Use fastpath x2apic IPI emulation when #vmexit with x2AVIC Suravee Suthikulpanit
2022-02-24 20:12   ` Maxim Levitsky
2022-03-07  6:24     ` Suthikulpanit, Suravee
2022-02-22  5:37 ` [RFC PATCH 00/13] Introducing AMD x2APIC Virtualization (x2AVIC) support Suthikulpanit, Suravee

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.