Skip to content

Commit 598a790

Browse files
jsmattsonjrsean-jc
authored andcommitted
KVM: x86: Allow HWCR.McStatusWrEn to be cleared once set
When HWCR is set to 0, store 0 in vcpu->arch.msr_hwcr. Fixes: 191c813 ("x86/kvm: Implement HWCR support") Signed-off-by: Jim Mattson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
1 parent 5d6d6a7 commit 598a790

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

arch/x86/kvm/x86.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3791,12 +3791,11 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
37913791
data &= ~(u64)0x8; /* ignore TLB cache disable */
37923792

37933793
/* Handle McStatusWrEn */
3794-
if (data == BIT_ULL(18)) {
3795-
vcpu->arch.msr_hwcr = data;
3796-
} else if (data != 0) {
3794+
if (data & ~BIT_ULL(18)) {
37973795
kvm_pr_unimpl_wrmsr(vcpu, msr, data);
37983796
return 1;
37993797
}
3798+
vcpu->arch.msr_hwcr = data;
38003799
break;
38013800
case MSR_FAM10H_MMIO_CONF_BASE:
38023801
if (data != 0) {

0 commit comments

Comments
 (0)