linux/arch/x86
Ravi Bangoria b7e4be0a22 KVM: SEV-ES: Delegate LBR virtualization to the processor
As documented in APM[1], LBR Virtualization must be enabled for SEV-ES
guests. Although KVM currently enforces LBRV for SEV-ES guests, there
are multiple issues with it:

o MSR_IA32_DEBUGCTLMSR is still intercepted. Since MSR_IA32_DEBUGCTLMSR
  interception is used to dynamically toggle LBRV for performance reasons,
  this can be fatal for SEV-ES guests. For ex SEV-ES guest on Zen3:

  [guest ~]# wrmsr 0x1d9 0x4
  KVM: entry failed, hardware error 0xffffffff
  EAX=00000004 EBX=00000000 ECX=000001d9 EDX=00000000

  Fix this by never intercepting MSR_IA32_DEBUGCTLMSR for SEV-ES guests.
  No additional save/restore logic is required since MSR_IA32_DEBUGCTLMSR
  is of swap type A.

o KVM will disable LBRV if userspace sets MSR_IA32_DEBUGCTLMSR before the
  VMSA is encrypted. Fix this by moving LBRV enablement code post VMSA
  encryption.

[1]: AMD64 Architecture Programmer's Manual Pub. 40332, Rev. 4.07 - June
     2023, Vol 2, 15.35.2 Enabling SEV-ES.
     https://bugzilla.kernel.org/attachment.cgi?id=304653

Fixes: 376c6d2850 ("KVM: SVM: Provide support for SEV-ES vCPU creation/loading")
Co-developed-by: Nikunj A Dadhania <nikunj@amd.com>
Signed-off-by: Nikunj A Dadhania <nikunj@amd.com>
Signed-off-by: Ravi Bangoria <ravi.bangoria@amd.com>
Message-ID: <20240531044644.768-4-ravi.bangoria@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-06-03 13:07:18 -04:00
..
boot x86/efistub: Add missing boot_params for mixed mode compat entry 2024-03-26 08:45:27 +01:00
coco x86/cc: Add cc_platform_set/_clear() helpers 2024-04-04 10:40:27 +02:00
configs x86/config: Fix warning for 'make ARCH=x86_64 tinyconfig' 2024-03-21 10:09:41 +01:00
crypto
entry x86/mm: Remove broken vsyscall emulation code from the page fault code 2024-05-01 09:41:43 +02:00
events * Clean up SVM's enter/exit assembly code so that it can be compiled 2024-04-20 11:10:51 -07:00
hyperv hyperv-fixes for v6.9-rc4 2024-04-11 16:23:56 -07:00
ia32
include KVM: VMX: Enumerate EPT Violation #VE support in /proc/cpuinfo 2024-05-23 12:28:49 -04:00
kernel Merge tag 'loongarch-kvm-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson into HEAD 2024-05-10 13:20:18 -04:00
kvm KVM: SEV-ES: Delegate LBR virtualization to the processor 2024-06-03 13:07:18 -04:00
lib x86/retpolines: Enable the default thunk warning only on relevant configs 2024-04-17 18:02:05 +02:00
math-emu
mm x86/mm: Remove broken vsyscall emulation code from the page fault code 2024-05-01 09:41:43 +02:00
net bpf, x86: Fix PROBE_MEM runtime load check 2024-04-26 09:45:18 -07:00
pci
platform xen: branch for v6.9-rc1 2024-03-19 08:48:09 -07:00
power - Kuan-Wei Chiu has developed the well-named series "lib min_heap: Min 2024-03-14 18:03:09 -07:00
purgatory
ras
realmode
tools
um
video
virt x86/sev: Add callback to apply RMP table fixups for kexec 2024-04-29 11:21:09 +02:00
xen x86/xen: return a sane initial apic id when running as PV guest 2024-05-02 19:18:44 +02:00
.gitignore
Kbuild x86/build: Use obj-y to descend into arch/x86/virt/ 2024-03-30 10:41:49 +01:00
Kconfig cpu: Ignore "mitigations" kernel parameter if CPU_MITIGATIONS=n 2024-04-25 15:47:39 +02:00
Kconfig.assembler
Kconfig.cpu
Kconfig.debug
Makefile x86/build: Use obj-y to descend into arch/x86/virt/ 2024-03-30 10:41:49 +01:00
Makefile.postlink
Makefile.um
Makefile_32.cpu