]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: Synthesize G bit for all segments.
authorJim Mattson <jmattson@vmware.com>
Tue, 8 Jul 2014 04:17:41 +0000 (09:47 +0530)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 11 Jul 2014 07:11:56 +0000 (09:11 +0200)
commit359d8f0a68eb03c90596356e231ce6c6cd22903b
tree9c63de8801dd4e3c3522a2c85f8a85d6421f351e
parentc45f07387cff201d2bfd111c06dcb845561324a6
KVM: Synthesize G bit for all segments.

We have noticed that qemu-kvm hangs early in the BIOS when runnning nested
under some versions of VMware ESXi.

The problem we believe is because KVM assumes that the platform preserves
the 'G' but for any segment register. The SVM specification itemizes the
segment attribute bits that are observed by the CPU, but the (G)ranularity bit
is not one of the bits itemized, for any segment. Though current AMD CPUs keep
track of the (G)ranularity bit for all segment registers other than CS, the
specification does not require it. VMware's virtual CPU may not track the
(G)ranularity bit for any segment register.

Since kvm already synthesizes the (G)ranularity bit for the CS segment. It
should do so for all segments. The patch below does that, and helps get rid of
the hangs. Patch applies on top of Linus' tree.

Signed-off-by: Jim Mattson <jmattson@vmware.com>
Signed-off-by: Alok N Kataria <akataria@vmware.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm.c