• Jan H. Schönherr's avatar
    KVM: nVMX: Fix handling of lmsw instruction · e1d39b17
    Jan H. Schönherr authored
    The decision whether or not to exit from L2 to L1 on an lmsw instruction is
    based on bogus values: instead of using the information encoded within the
    exit qualification, it uses the data also used for the mov-to-cr
    instruction, which boils down to using whatever is in %eax at that point.
    
    Use the correct values instead.
    
    Without this fix, an L1 may not get notified when a 32-bit Linux L2
    switches its secondary CPUs to protected mode; the L1 is only notified on
    the next modification of CR0. This short time window poses a problem, when
    there is some other reason to exit to L1 in between. Then, L2 will be
    resumed in real mode and chaos ensues.
    Signed-off-by: default avatarJan H. Schönherr <jschoenh@amazon.de>
    Reviewed-by: default avatarWanpeng Li <wanpeng.li@hotmail.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    e1d39b17
vmx.c 329 KB