KVM: Fix segment descriptor loading
authorGleb Natapov <gleb@redhat.com>
Thu, 18 Feb 2010 10:15:01 +0000 (12:15 +0200)
committerMarcelo Tosatti <mtosatti@redhat.com>
Mon, 1 Mar 2010 15:36:14 +0000 (12:36 -0300)
commitc697518a861e6c43b92b848895f9926580ee63c3
tree23c0b9169dfe783bd4615795cd5495f369d42122
parent6f550484a15ea1b468665cdf59f020bf08ccb292
KVM: Fix segment descriptor loading

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.

Cc: stable@kernel.org (2.6.33, 2.6.32)
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/emulate.c
arch/x86/kvm/x86.c