diff options
author | Jim Mattson <jmattson@google.com> | 2023-09-30 02:02:44 +0300 |
---|---|---|
committer | Sean Christopherson <seanjc@google.com> | 2023-10-09 22:36:15 +0300 |
commit | 598a790fc20f06e5582c939a4c5864ff1105c477 (patch) | |
tree | d46e9a93aa1ce00e0b11d64570b89bdba413e297 /arch/x86/kvm | |
parent | 5d6d6a7d7e66a98bb3432478d226c68c219aaba3 (diff) | |
download | linux-598a790fc20f06e5582c939a4c5864ff1105c477.tar.xz |
KVM: x86: Allow HWCR.McStatusWrEn to be cleared once set
When HWCR is set to 0, store 0 in vcpu->arch.msr_hwcr.
Fixes: 191c8137a939 ("x86/kvm: Implement HWCR support")
Signed-off-by: Jim Mattson <jmattson@google.com>
Link: https://lore.kernel.org/r/20230929230246.1954854-2-jmattson@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/x86.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 42b33ef997a5..6f4534046803 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -3791,12 +3791,11 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) data &= ~(u64)0x8; /* ignore TLB cache disable */ /* Handle McStatusWrEn */ - if (data == BIT_ULL(18)) { - vcpu->arch.msr_hwcr = data; - } else if (data != 0) { + if (data & ~BIT_ULL(18)) { kvm_pr_unimpl_wrmsr(vcpu, msr, data); return 1; } + vcpu->arch.msr_hwcr = data; break; case MSR_FAM10H_MMIO_CONF_BASE: if (data != 0) { |