KVM: Fix segment descriptor loading
authorGleb Natapov <gleb@redhat.com>
Fri, 19 Mar 2010 14:47:34 +0000 (15:47 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 26 Apr 2010 14:41:20 +0000 (07:41 -0700)
commit78ce64a384f12bcd4cbfc1de3db4e53c592fc5a8
tree461e12e956082c34de1c59ca01cb0d3cf7d84ccf
parentad66f35eaafb1026d96a6231761d3be3f58edec8
KVM: Fix segment descriptor loading

commit c697518a861e6c43b92b848895f9926580ee63c3 upstream

Add proper error and permission checking. This patch also change task
switching code to load segment selectors before segment descriptors, like
SDM requires, otherwise permission checking during segment descriptor
loading will be incorrect.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/emulate.c
arch/x86/kvm/x86.c