]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - arch/x86/kvm/svm.c
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)
commit80112c89ed872c725e7dc39ccf6c37d1a585e161
tree9c63de8801dd4e3c3522a2c85f8a85d6421f351e
parentc2d2c21bff27617ff2ada064f7b70079a2123364
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