]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86 emulator: Fix segment loading in VM86
authorKevin Wolf <kwolf@redhat.com>
Thu, 11 Apr 2013 12:06:03 +0000 (14:06 +0200)
committerGleb Natapov <gleb@redhat.com>
Thu, 11 Apr 2013 12:53:06 +0000 (15:53 +0300)
commit2401580a742917f4755ef04c36e2a8dedf7a6f78
treea2c732ab388cdfd679c76c8b0ac7d6c69455d1e8
parent40461574f033e0935ebb0def8a83810fb20278bd
KVM: x86 emulator: Fix segment loading in VM86

This fixes a regression introduced in commit e2e26f350 ("KVM: x86
emulator: Leave segment limit and attributs alone in real mode").

The mentioned commit changed the segment descriptors for both real mode
and VM86 to only update the segment base instead of creating a
completely new descriptor with limit 0xffff so that unreal mode keeps
working across a segment register reload.

This leads to an invalid segment descriptor in the eyes of VMX, which
seems to be okay for real mode because KVM will fix it up before the
next VM entry or emulate the state, but it doesn't do this if the guest
is in VM86, so we end up with:

  KVM: entry failed, hardware error 0x80000021

Fix this by effectively reverting commit e2e26f350 for VM86 and leaving
it only in place for real mode, which is where it's really needed.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
arch/x86/kvm/emulate.c