android_kernel_motorola_sm6225/arch/x86
Maciej S. Szmigiero 2d6cb4cb7f KVM: x86: Ignore MSR_AMD64_TW_CFG access
commit 2770d4722036d6bd24bcb78e9cd7f6e572077d03 upstream.

Hyper-V enabled Windows Server 2022 KVM VM cannot be started on Zen1 Ryzen
since it crashes at boot with SYSTEM_THREAD_EXCEPTION_NOT_HANDLED +
STATUS_PRIVILEGED_INSTRUCTION (in other words, because of an unexpected #GP
in the guest kernel).

This is because Windows tries to set bit 8 in MSR_AMD64_TW_CFG and can't
handle receiving a #GP when doing so.

Give this MSR the same treatment that commit 2e32b71906
("x86, kvm: Add MSR_AMD64_BU_CFG2 to the list of ignored MSRs") gave
MSR_AMD64_BU_CFG2 under justification that this MSR is baremetal-relevant
only.
Although apparently it was then needed for Linux guests, not Windows as in
this case.

With this change, the aforementioned guest setup is able to finish booting
successfully.

This issue can be reproduced either on a Summit Ridge Ryzen (with
just "-cpu host") or on a Naples EPYC (with "-cpu host,stepping=1" since
EPYC is ordinarily stepping 2).

Alternatively, userspace could solve the problem by using MSR filters, but
forcing every userspace to define a filter isn't very friendly and doesn't
add much, if any, value.  The only potential hiccup is if one of these
"baremetal-only" MSRs ever requires actual emulation and/or has F/M/S
specific behavior.  But if that happens, then KVM can still punt *that*
handling to userspace since userspace MSR filters "win" over KVM's default
handling.

Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/1ce85d9c7c9e9632393816cf19c902e0a3f411f1.1697731406.git.maciej.szmigiero@oracle.com
[sean: call out MSR filtering alternative]
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-11-28 16:46:34 +00:00
..
boot x86/boot: Wrap literal addresses in absolute_pointer() 2023-06-09 10:24:02 +02:00
configs x86/defconfig: Enable CONFIG_USB_XHCI_HCD=y 2020-09-23 12:11:02 +02:00
crypto crypto: x86/crc32c - fix building with clang ias 2021-01-23 15:49:55 +01:00
entry x86/mm: Fix VDSO and VVAR placement on 5-level paging machines 2023-08-16 18:13:00 +02:00
events perf/x86/intel/uncore: Fix reference count leak in hswep_has_limit_sbox() 2023-01-18 11:30:05 +01:00
hyperv x86/hyperv: Fix NULL deref in set_hv_tscchange_cb() if Hyper-V setup fails 2021-11-26 11:36:23 +01:00
ia32 binfmt: Move install_exec_creds after setup_new_exec to match binfmt_elf 2023-01-18 11:30:42 +01:00
include KVM: x86: Ignore MSR_AMD64_TW_CFG access 2023-11-28 16:46:34 +00:00
kernel x86: Fix .brk attribute in linker script 2023-11-08 11:22:19 +01:00
kvm KVM: x86: Ignore MSR_AMD64_TW_CFG access 2023-11-28 16:46:34 +00:00
lib x86/asm: Fix an assembler warning with current binutils 2023-02-06 07:49:44 +01:00
math-emu x86: math-emu: Fix up 'cmp' insn for clang ias 2020-07-29 10:16:54 +02:00
mm x86/mm: Drop the 4 MB restriction on minimal NUMA node memory size 2023-11-28 16:46:31 +00:00
net bpf: Introduce BPF nospec instruction for mitigating Spectre v4 2021-09-22 11:47:58 +02:00
oprofile
pci x86/PCI: Add quirk for AMD XHCI controller that loses MSI-X state in D3hot 2023-04-20 12:04:40 +02:00
platform x86/olpc: fix 'logical not is only applied to the left hand side' 2022-08-25 11:15:27 +02:00
power x86/pm: Add enumeration check before spec MSRs save/restore setup 2022-12-08 11:18:34 +01:00
purgatory x86/purgatory: remove PGO flags 2023-06-28 10:15:27 +02:00
ras
realmode x86/64/mm: Map all kernel memory into trampoline_pgd 2021-12-08 08:50:14 +01:00
tools x86/tools: Fix objdump version check again 2021-08-26 08:36:39 -04:00
um x86: um: vdso: Add '%rcx' and '%r11' to the syscall clobber list 2023-03-11 16:31:58 +01:00
video
xen x86/xen: Fix secondary processors' FPU initialization 2023-08-08 19:49:19 +02:00
.gitignore
Kbuild
Kconfig x86/speculation: Add Kconfig option for GDS 2023-08-08 19:49:19 +02:00
Kconfig.cpu
Kconfig.debug
Makefile x86/build: Propagate $(CLANG_FLAGS) to $(REALMODE_FLAGS) 2021-05-22 10:59:15 +02:00
Makefile.um
Makefile_32.cpu