diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2013-03-19 16:30:26 +0100 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2013-03-20 17:34:55 -0300 |
commit | 04b66839d312d3bdaff77f265eb7305347fa1fb7 (patch) | |
tree | 8346919907a907179af7511232f05bef2c59c6bf /arch/x86/kvm/vmx.c | |
parent | 4918c6ca6838658b71d3ce75e1a4373195ac8d40 (diff) | |
download | lwn-04b66839d312d3bdaff77f265eb7305347fa1fb7.tar.gz lwn-04b66839d312d3bdaff77f265eb7305347fa1fb7.zip |
KVM: x86: correctly initialize the CS base on reset
The CS base was initialized to 0 on VMX (wrong, but usually overridden
by userspace before starting) or 0xf0000 on SVM. The correct value is
0xffff0000, and VMX is able to emulate it now, so use it.
Reviewed-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r-- | arch/x86/kvm/vmx.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index ad978a6c282e..03f574641852 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -4113,6 +4113,7 @@ static void vmx_vcpu_reset(struct kvm_vcpu *vcpu) seg_setup(VCPU_SREG_CS); vmcs_write16(GUEST_CS_SELECTOR, 0xf000); + vmcs_write32(GUEST_CS_BASE, 0xffff0000); seg_setup(VCPU_SREG_DS); seg_setup(VCPU_SREG_ES); |