Commit 5dc83262 authored by Avi Kivity's avatar Avi Kivity

KVM: VMX: Restore tss even on x86_64

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: default avatarAvi Kivity <avi@qumranet.com>
parent a4083c92
...@@ -349,8 +349,6 @@ static void update_exception_bitmap(struct kvm_vcpu *vcpu) ...@@ -349,8 +349,6 @@ static void update_exception_bitmap(struct kvm_vcpu *vcpu)
static void reload_tss(void) static void reload_tss(void)
{ {
#ifndef CONFIG_X86_64
/* /*
* VT restores TR but not its size. Useless. * VT restores TR but not its size. Useless.
*/ */
...@@ -361,7 +359,6 @@ static void reload_tss(void) ...@@ -361,7 +359,6 @@ static void reload_tss(void)
descs = (void *)gdt.base; descs = (void *)gdt.base;
descs[GDT_ENTRY_TSS].type = 9; /* available TSS */ descs[GDT_ENTRY_TSS].type = 9; /* available TSS */
load_TR_desc(); load_TR_desc();
#endif
} }
static void load_transition_efer(struct vcpu_vmx *vmx) static void load_transition_efer(struct vcpu_vmx *vmx)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment