• Jim Mattson's avatar
    KVM: Synthesize G bit for all segments. · 80112c89
    Jim Mattson authored
    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: default avatarJim Mattson <jmattson@vmware.com>
    Signed-off-by: default avatarAlok N Kataria <akataria@vmware.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    80112c89
svm.c 113 KB