aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-03-20 12:40:40 -0400
committerAvi Kivity <avi@qumranet.com>2007-05-03 03:52:25 -0400
commit8cb5b0333250beb382624f626851a31f601b4830 (patch)
treef2406e4eb5c668f22eb4f53995c1928d9eebf42b /drivers/kvm
parentaac012245a59d78372dc66d292ba567367d86b60 (diff)
KVM: Workaround vmx inability to virtualize the reset state
The reset state has cs.selector == 0xf000 and cs.base == 0xffff0000, which aren't compatible with vm86 mode, which is used for real mode virtualization. When we create a vcpu, we set cs.base to 0xf0000, but if we get there by way of a reset, the values are inconsistent and vmx refuses to enter guest mode. Workaround by detecting the state and munging it appropriately. Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm')
-rw-r--r--drivers/kvm/vmx.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index 0d9bf0b36d37..aa7e2ba6fb5a 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -712,6 +712,8 @@ static void enter_rmode(struct kvm_vcpu *vcpu)
712 712
713 vmcs_write32(GUEST_CS_AR_BYTES, 0xf3); 713 vmcs_write32(GUEST_CS_AR_BYTES, 0xf3);
714 vmcs_write32(GUEST_CS_LIMIT, 0xffff); 714 vmcs_write32(GUEST_CS_LIMIT, 0xffff);
715 if (vmcs_readl(GUEST_CS_BASE) == 0xffff0000)
716 vmcs_writel(GUEST_CS_BASE, 0xf0000);
715 vmcs_write16(GUEST_CS_SELECTOR, vmcs_readl(GUEST_CS_BASE) >> 4); 717 vmcs_write16(GUEST_CS_SELECTOR, vmcs_readl(GUEST_CS_BASE) >> 4);
716 718
717 fix_rmode_seg(VCPU_SREG_ES, &vcpu->rmode.es); 719 fix_rmode_seg(VCPU_SREG_ES, &vcpu->rmode.es);