diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2007-11-19 04:21:45 -0500 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 10:53:06 -0500 |
commit | 15b00f32d53f31fe194b17ca0384a37756b55be2 (patch) | |
tree | 2555b34389c6a4a3c24569201b6504794b566d5d /drivers/kvm/vmx.c | |
parent | 54f1585a8d0131bc3993902d4441f4049daed0d5 (diff) |
KVM: VMX: Force seg.base == (seg.sel << 4) in real mode
Ensure that segment.base == segment.selector << 4 when entering the real
mode on Intel so that the CPU will not bark at us. This fixes some old
protected mode demo from http://www.x86.org/articles/pmbasics/tspec_a1_doc.htm.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/vmx.c')
-rw-r--r-- | drivers/kvm/vmx.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index 0c082faaa6db..b4c0bdce7b34 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c | |||
@@ -1165,7 +1165,8 @@ static void fix_rmode_seg(int seg, struct kvm_save_segment *save) | |||
1165 | save->base = vmcs_readl(sf->base); | 1165 | save->base = vmcs_readl(sf->base); |
1166 | save->limit = vmcs_read32(sf->limit); | 1166 | save->limit = vmcs_read32(sf->limit); |
1167 | save->ar = vmcs_read32(sf->ar_bytes); | 1167 | save->ar = vmcs_read32(sf->ar_bytes); |
1168 | vmcs_write16(sf->selector, vmcs_readl(sf->base) >> 4); | 1168 | vmcs_write16(sf->selector, save->base >> 4); |
1169 | vmcs_write32(sf->base, save->base & 0xfffff); | ||
1169 | vmcs_write32(sf->limit, 0xffff); | 1170 | vmcs_write32(sf->limit, 0xffff); |
1170 | vmcs_write32(sf->ar_bytes, 0xf3); | 1171 | vmcs_write32(sf->ar_bytes, 0xf3); |
1171 | } | 1172 | } |