Skip to content

Commit 8f1589d

Browse files
aprzywaravikivity
authored andcommitted
KVM: ignore AMDs HWCR register access to set the FFDIS bit
Linux tries to disable the flush filter on all AMD K8 CPUs. Since KVM does not handle the needed MSR, the injected #GP will panic the Linux kernel. Ignore setting of the HWCR.FFDIS bit in this MSR to let Linux boot with an AMD K8 family guest CPU. Signed-off-by: Andre Przywara <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
1 parent 894a9c5 commit 8f1589d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

arch/x86/kvm/svm.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2137,7 +2137,6 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data)
21372137
break;
21382138
case MSR_VM_CR:
21392139
case MSR_VM_IGNNE:
2140-
case MSR_K7_HWCR:
21412140
pr_unimpl(vcpu, "unimplemented wrmsr: 0x%x data 0x%llx\n", ecx, data);
21422141
break;
21432142
default:

arch/x86/kvm/x86.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,14 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data)
833833
case MSR_EFER:
834834
set_efer(vcpu, data);
835835
break;
836+
case MSR_K7_HWCR:
837+
data &= ~(u64)0x40; /* ignore flush filter disable */
838+
if (data != 0) {
839+
pr_unimpl(vcpu, "unimplemented HWCR wrmsr: 0x%llx\n",
840+
data);
841+
return 1;
842+
}
843+
break;
836844
case MSR_IA32_DEBUGCTLMSR:
837845
if (!data) {
838846
/* We support the non-activated case already */

0 commit comments

Comments
 (0)