• D
    KVM: x86/mmu: Derive shadow MMU page role from parent · 2e65e842
    David Matlack 提交于
    Instead of computing the shadow page role from scratch for every new
    page, derive most of the information from the parent shadow page.  This
    eliminates the dependency on the vCPU root role to allocate shadow page
    tables, and reduces the number of parameters to kvm_mmu_get_page().
    
    Preemptively split out the role calculation to a separate function for
    use in a following commit.
    
    Note that when calculating the MMU root role, we can take
    @role.passthrough, @role.direct, and @role.access directly from
    @vcpu->arch.mmu->root_role. Only @role.level and @role.quadrant still
    must be overridden for PAE page directories, when shadowing 32-bit
    guest page tables with PAE page tables.
    
    No functional change intended.
    Reviewed-by: NPeter Xu <peterx@redhat.com>
    Signed-off-by: NDavid Matlack <dmatlack@google.com>
    Message-Id: <20220516232138.1783324-5-dmatlack@google.com>
    Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
    2e65e842
mmu.c 175.7 KB