summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNitin A Kamble <nitin.a.kamble@intel.com>2007-05-17 15:50:34 +0300
committerAvi Kivity <avi@qumranet.com>2007-07-16 12:05:41 +0300
commitb3f37707b05e9ce82d5bec660e9d0b15452ee9a0 (patch)
treea4d210f6449be292cfd9171c3e3e972ff2773234
parentcd2276a795b013d1416c96b38eec90a66cdd10c4 (diff)
downloadlinux-3.10-b3f37707b05e9ce82d5bec660e9d0b15452ee9a0.tar.gz
linux-3.10-b3f37707b05e9ce82d5bec660e9d0b15452ee9a0.tar.bz2
linux-3.10-b3f37707b05e9ce82d5bec660e9d0b15452ee9a0.zip
KVM: VMX: Handle #SS faults from real mode
Instructions with address size override prefix opcode 0x67 Cause the #SS fault with 0 error code in VM86 mode. Forward them to the emulator. Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
-rw-r--r--drivers/kvm/vmx.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index c4c553588a2..a05bfa08587 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -1488,7 +1488,11 @@ static int handle_rmode_exception(struct kvm_vcpu *vcpu,
if (!vcpu->rmode.active)
return 0;
- if (vec == GP_VECTOR && err_code == 0)
+ /*
+ * Instruction with address size override prefix opcode 0x67
+ * Cause the #SS fault with 0 error code in VM86 mode.
+ */
+ if (((vec == GP_VECTOR) || (vec == SS_VECTOR)) && err_code == 0)
if (emulate_instruction(vcpu, NULL, 0, 0) == EMULATE_DONE)
return 1;
return 0;