Commit 598a790f authored by Jim Mattson's avatar Jim Mattson Committed by Sean Christopherson

KVM: x86: Allow HWCR.McStatusWrEn to be cleared once set

When HWCR is set to 0, store 0 in vcpu->arch.msr_hwcr.

Fixes: 191c8137 ("x86/kvm: Implement HWCR support")
Signed-off-by: default avatarJim Mattson <jmattson@google.com>
Link: https://lore.kernel.org/r/20230929230246.1954854-2-jmattson@google.comSigned-off-by: default avatarSean Christopherson <seanjc@google.com>
parent 5d6d6a7d
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment