diff options
author | Avi Kivity <avi@qumranet.com> | 2007-06-20 04:20:04 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-07-16 05:05:48 -0400 |
commit | 75880a01124c6aa5d428bdc14163039a87618be1 (patch) | |
tree | 3ab4e4fd920380aeec0cfc378eaa434f24f8bbde | |
parent | a3c870bdce4d34332ebdba7eb9969592c4c6b243 (diff) |
KVM: VMX: Reinitialize the real-mode tss when entering real mode
Protected mode code may have corrupted the real-mode tss, so re-initialize
it when switching to real mode.
Signed-off-by: Avi Kivity <avi@qumranet.com>
-rw-r--r-- | drivers/kvm/vmx.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index b47ddccc7d7a..42a916379ce2 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c | |||
@@ -31,6 +31,8 @@ | |||
31 | MODULE_AUTHOR("Qumranet"); | 31 | MODULE_AUTHOR("Qumranet"); |
32 | MODULE_LICENSE("GPL"); | 32 | MODULE_LICENSE("GPL"); |
33 | 33 | ||
34 | static int init_rmode_tss(struct kvm *kvm); | ||
35 | |||
34 | static DEFINE_PER_CPU(struct vmcs *, vmxarea); | 36 | static DEFINE_PER_CPU(struct vmcs *, vmxarea); |
35 | static DEFINE_PER_CPU(struct vmcs *, current_vmcs); | 37 | static DEFINE_PER_CPU(struct vmcs *, current_vmcs); |
36 | 38 | ||
@@ -951,6 +953,8 @@ static void enter_rmode(struct kvm_vcpu *vcpu) | |||
951 | fix_rmode_seg(VCPU_SREG_DS, &vcpu->rmode.ds); | 953 | fix_rmode_seg(VCPU_SREG_DS, &vcpu->rmode.ds); |
952 | fix_rmode_seg(VCPU_SREG_GS, &vcpu->rmode.gs); | 954 | fix_rmode_seg(VCPU_SREG_GS, &vcpu->rmode.gs); |
953 | fix_rmode_seg(VCPU_SREG_FS, &vcpu->rmode.fs); | 955 | fix_rmode_seg(VCPU_SREG_FS, &vcpu->rmode.fs); |
956 | |||
957 | init_rmode_tss(vcpu->kvm); | ||
954 | } | 958 | } |
955 | 959 | ||
956 | #ifdef CONFIG_X86_64 | 960 | #ifdef CONFIG_X86_64 |