• Paul Mackerras's avatar
    KVM: PPC: Book3S HV: Don't rely on host's page size information · 8dc6cca5
    Paul Mackerras authored
    This removes the dependence of KVM on the mmu_psize_defs array (which
    stores information about hardware support for various page sizes) and
    the things derived from it, chiefly hpte_page_sizes[], hpte_page_size(),
    hpte_actual_page_size() and get_sllp_encoding().  We also no longer
    rely on the mmu_slb_size variable or the MMU_FTR_1T_SEGMENTS feature
    bit.
    
    The reason for doing this is so we can support a HPT guest on a radix
    host.  In a radix host, the mmu_psize_defs array contains information
    about page sizes supported by the MMU in radix mode rather than the
    page sizes supported by the MMU in HPT mode.  Similarly, mmu_slb_size
    and the MMU_FTR_1T_SEGMENTS bit are not set.
    
    Instead we hard-code knowledge of the behaviour of the HPT MMU in the
    POWER7, POWER8 and POWER9 processors (which are the only processors
    supported by HV KVM) - specifically the encoding of the LP fields in
    the HPT and SLB entries, and the fact that they have 32 SLB entries
    and support 1TB segments.
    Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
    8dc6cca5
book3s_hv.c 111 KB