• Avi Kivity's avatar
    KVM: VMX: Fix delayed load of shared MSRs · 9ee73970
    Avi Kivity authored
    Shared MSRs (MSR_*STAR and related) are stored in both vmx->guest_msrs
    and in the CPU registers, but vmx_set_msr() only updated memory. Prior
    to 46199f33, this didn't matter, since we called vmx_load_host_state(),
    which scheduled a vmx_save_host_state(), which re-synchronized the CPU
    state, but now we don't, so the CPU state will not be synchronized until
    the next exit to host userspace.  This mostly affects nested vmx workloads,
    which play with these MSRs a lot.
    
    Fix by loading the MSR eagerly.
    Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
    9ee73970
vmx.c 206 KB