• Sean Christopherson's avatar
    KVM: x86: Pull the PGD's level from the MMU instead of recalculating it · 2a40b900
    Sean Christopherson authored
    Use the shadow_root_level from the current MMU as the root level for the
    PGD, i.e. for VMX's EPTP.  This eliminates the weird dependency between
    VMX and the MMU where both must independently calculate the same root
    level for things to work correctly.  Temporarily keep VMX's calculation
    of the level and use it to WARN if the incoming level diverges.
    
    Opportunistically refactor kvm_mmu_load_pgd() to avoid indentation hell,
    and rename a 'cr3' param in the load_mmu_pgd prototype that managed to
    survive the cr3 purge.
    
    No functional change intended.
    Signed-off-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
    Message-Id: <20200716034122.5998-6-sean.j.christopherson@intel.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    2a40b900
vmx.h 14.6 KB