Message ID | 1ce85d9c7c9e9632393816cf19c902e0a3f411f1.1697731406.git.maciej.szmigiero@oracle.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v2] KVM: x86: Ignore MSR_AMD64_TW_CFG access | expand |
On Thu, 19 Oct 2023 18:06:57 +0200, Maciej S. Szmigiero wrote: > 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. > > [...] Applied to kvm-x86 misc, thanks! I added a paragraph at the end of the changelog to capture the gist of the discussion on why we agreed that having KVM eat MSR accesses is the least awful option. I also tagged this for stable. Paolo, holler if you want to grab this for v6.6 and I'll drop my copy. [1/1] KVM: x86: Ignore MSR_AMD64_TW_CFG access https://github.com/kvm-x86/linux/commit/2770d4722036 -- https://github.com/kvm-x86/linux/tree/next
diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h index 1d111350197f..8bcbebb56b8f 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h @@ -553,6 +553,7 @@ #define MSR_AMD64_CPUID_FN_1 0xc0011004 #define MSR_AMD64_LS_CFG 0xc0011020 #define MSR_AMD64_DC_CFG 0xc0011022 +#define MSR_AMD64_TW_CFG 0xc0011023 #define MSR_AMD64_DE_CFG 0xc0011029 #define MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT 1 diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 9f18b06bbda6..fd1b099b0964 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -3641,6 +3641,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) case MSR_AMD64_PATCH_LOADER: case MSR_AMD64_BU_CFG2: case MSR_AMD64_DC_CFG: + case MSR_AMD64_TW_CFG: case MSR_F15H_EX_CFG: break; @@ -4065,6 +4066,7 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) case MSR_AMD64_BU_CFG2: case MSR_IA32_PERF_CTL: case MSR_AMD64_DC_CFG: + case MSR_AMD64_TW_CFG: case MSR_F15H_EX_CFG: /* * Intel Sandy Bridge CPUs must support the RAPL (running average power