aboutsummaryrefslogtreecommitdiff
path: root/target/i386/whpx-all.c
diff options
context:
space:
mode:
authorJustin Terry (VM) <juterry@microsoft.com>2018-06-05 22:15:27 +0000
committerPaolo Bonzini <pbonzini@redhat.com>2018-06-28 19:05:36 +0200
commite1753a7e1d8174f5861367504c5cea5fbcd85953 (patch)
tree4551c614550fc84eebbdb3e862debd51b274e73d /target/i386/whpx-all.c
parente7d99825f018cf4e658c3eb10c0163e75e653a23 (diff)
downloadqemu-e1753a7e1d8174f5861367504c5cea5fbcd85953.zip
qemu-e1753a7e1d8174f5861367504c5cea5fbcd85953.tar.gz
qemu-e1753a7e1d8174f5861367504c5cea5fbcd85953.tar.bz2
WHPX workaround bug in OSVW handling
Adds a workaround to an incorrect value setting CPUID Fn8000_0001_ECX[bit 9 OSVW] = 1. This can cause a guest linux kernel to panic when an issue to rdmsr C001_0140h returns 0. Disabling this feature correctly allows the guest to boot without accessing the osv workarounds. Signed-off-by: Justin Terry (VM) <juterry@microsoft.com> Message-Id: <20180605221500.21674-1-juterry@microsoft.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target/i386/whpx-all.c')
-rw-r--r--target/i386/whpx-all.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/target/i386/whpx-all.c b/target/i386/whpx-all.c
index 6b42096..99501ba 100644
--- a/target/i386/whpx-all.c
+++ b/target/i386/whpx-all.c
@@ -964,6 +964,16 @@ static int whpx_vcpu_run(CPUState *cpu)
rdx = vcpu->exit_ctx.CpuidAccess.DefaultResultRdx;
rbx = vcpu->exit_ctx.CpuidAccess.DefaultResultRbx;
break;
+ case 0x80000001:
+ rax = vcpu->exit_ctx.CpuidAccess.DefaultResultRax;
+ /* Remove any support of OSVW */
+ rcx =
+ vcpu->exit_ctx.CpuidAccess.DefaultResultRcx &
+ ~CPUID_EXT3_OSVW;
+
+ rdx = vcpu->exit_ctx.CpuidAccess.DefaultResultRdx;
+ rbx = vcpu->exit_ctx.CpuidAccess.DefaultResultRbx;
+ break;
default:
rax = vcpu->exit_ctx.CpuidAccess.DefaultResultRax;
rcx = vcpu->exit_ctx.CpuidAccess.DefaultResultRcx;
@@ -1382,12 +1392,13 @@ static int whpx_accel_init(MachineState *ms)
goto error;
}
- UINT32 cpuidExitList[] = {1};
+ UINT32 cpuidExitList[] = {1, 0x80000001};
hr = whp_dispatch.WHvSetPartitionProperty(
whpx->partition,
WHvPartitionPropertyCodeCpuidExitList,
cpuidExitList,
RTL_NUMBER_OF(cpuidExitList) * sizeof(UINT32));
+
if (FAILED(hr)) {
error_report("WHPX: Failed to set partition CpuidExitList hr=%08lx",
hr);