[patch 06/48] KVM: VMX: Change cs reset state to be a data segment

From: Greg KH
Date: Fri Sep 04 2009 - 16:22:31 EST



2.6.27-stable review patch. If anyone has any objections, please let us know.

------------------
From: Avi Kivity <avi@xxxxxxxxxxxx>

(cherry picked from commit 5706be0dafd6f42852f85fbae292301dcad4ccec)

Real mode cs is a data segment, not a code segment.

Signed-off-by: Avi Kivity <avi@xxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
---
arch/x86/kvm/vmx.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -2036,6 +2036,7 @@ static int vmx_vcpu_reset(struct kvm_vcp

fx_init(&vmx->vcpu);

+ seg_setup(VCPU_SREG_CS);
/*
* GUEST_CS_BASE should really be 0xffff0000, but VT vm86 mode
* insists on having GUEST_CS_BASE == GUEST_CS_SELECTOR << 4. Sigh.
@@ -2047,8 +2048,6 @@ static int vmx_vcpu_reset(struct kvm_vcp
vmcs_write16(GUEST_CS_SELECTOR, vmx->vcpu.arch.sipi_vector << 8);
vmcs_writel(GUEST_CS_BASE, vmx->vcpu.arch.sipi_vector << 12);
}
- vmcs_write32(GUEST_CS_LIMIT, 0xffff);
- vmcs_write32(GUEST_CS_AR_BYTES, 0x9b);

seg_setup(VCPU_SREG_DS);
seg_setup(VCPU_SREG_ES);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/