]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
KVM: VMX: Restore tss even on x86_64
authorAvi Kivity <avi@qumranet.com>
Sun, 16 Mar 2008 16:48:26 +0000 (18:48 +0200)
committerAvi Kivity <avi@qumranet.com>
Tue, 25 Mar 2008 08:22:16 +0000 (10:22 +0200)
The vmx hardware state restore restores the tss selector and base address, but
not its length.  Usually, this does not matter since most of the tss contents
is within the default length of 0x67.  However, if a process is using ioperm()
to grant itself I/O port permissions, an additional bitmap within the tss,
but outside the default length is consulted.  The effect is that the process
will receive a SIGSEGV instead of transparently accessing the port.

Fix by restoring the tss length.  Note that i386 had this working already.

Closes bugzilla 10246.

Signed-off-by: Avi Kivity <avi@qumranet.com>
arch/x86/kvm/vmx.c

index 94ea724638fda63b87ec248c2c3b40783ad93e08..f2df03c12f163f3d3ad71e240a880fdd17935eb4 100644 (file)
@@ -349,8 +349,6 @@ static void update_exception_bitmap(struct kvm_vcpu *vcpu)
 
 static void reload_tss(void)
 {
-#ifndef CONFIG_X86_64
-
        /*
         * VT restores TR but not its size.  Useless.
         */
@@ -361,7 +359,6 @@ static void reload_tss(void)
        descs = (void *)gdt.base;
        descs[GDT_ENTRY_TSS].type = 9; /* available TSS */
        load_TR_desc();
-#endif
 }
 
 static void load_transition_efer(struct vcpu_vmx *vmx)