• Sean Christopherson's avatar
    KVM: nVMX: Rename nested.vmcs01_* fields to nested.pre_vmenter_* · 5d76b1f8
    Sean Christopherson authored
    Rename the fields in struct nested_vmx used to snapshot pre-VM-Enter
    values to reflect that they can hold L2's values when restoring nested
    state, e.g. if userspace restores MSRs before nested state.  As crazy as
    it seems, restoring MSRs before nested state actually works (because KVM
    goes out if it's way to make it work), even though the initial MSR writes
    will hit vmcs01 despite holding L2 values.
    
    Add a related comment to vmx_enter_smm() to call out that using the
    common VM-Exit and VM-Enter helpers to emulate SMI and RSM is wrong and
    broken.  The few MSRs that have snapshots _could_ be fixed by taking a
    snapshot prior to the forced VM-Exit instead of at forced VM-Enter, but
    that's just the tip of the iceberg as the rather long list of MSRs that
    aren't snapshotted (hello, VM-Exit MSR load list) can't be handled this
    way.
    Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
    Message-Id: <20220614215831.3762138-4-seanjc@google.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    5d76b1f8
vmx.c 240 KB