/* * Common bits between 4K and 64K pages in a linux-style PTE. * Additional bits may be defined in pgtable-hash64-*.h *
*/ #define H_PTE_NONE_MASK _PAGE_HPTEFLAGS
/* Bits to set in a PMD/PUD/PGD entry valid bit*/ #define HASH_PMD_VAL_BITS (0x8000000000000000UL) #define HASH_PUD_VAL_BITS (0x8000000000000000UL) #define HASH_PGD_VAL_BITS (0x8000000000000000UL)
/* * Size of EA range mapped by our pagetables.
*/ #define H_PGTABLE_EADDR_SIZE (H_PTE_INDEX_SIZE + H_PMD_INDEX_SIZE + \
H_PUD_INDEX_SIZE + H_PGD_INDEX_SIZE + PAGE_SHIFT) #define H_PGTABLE_RANGE (ASM_CONST(1) << H_PGTABLE_EADDR_SIZE) /* * Top 2 bits are ignored in page table walk.
*/ #define EA_MASK (~(0xcUL << 60))
/* * We store the slot details in the second half of page table. * Increase the pud level table so that hugetlb ptes can be stored * at pud level.
*/ #ifdefined(CONFIG_HUGETLB_PAGE) && defined(CONFIG_PPC_64K_PAGES) #define H_PUD_CACHE_INDEX (H_PUD_INDEX_SIZE + 1) #else #define H_PUD_CACHE_INDEX (H_PUD_INDEX_SIZE) #endif
if (IS_ENABLED(CONFIG_PPC_4K_PAGES) && huge) { unsignedint psize = get_slice_psize(mm, addr); int nb, i;
if (psize == MMU_PAGE_16M)
nb = SZ_16M / PMD_SIZE; elseif (psize == MMU_PAGE_16G)
nb = SZ_16G / PUD_SIZE; else
nb = 1;
WARN_ON_ONCE(nb == 1); /* Should never happen */
for (i = 1; i < nb; i++)
hash__pte_update_one(ptep + i, clr, set);
} /* huge pages use the old page table lock */ if (!huge)
assert_pte_locked(mm, addr);
if (old & H_PAGE_HASHPTE)
hpte_need_flush(mm, addr, ptep, old, huge);
return old;
}
/* Set the dirty and/or accessed bits atomically in a linux PTE, this * function doesn't need to flush the hash entry
*/ staticinlinevoid hash__ptep_set_access_flags(pte_t *ptep, pte_t entry)
{
__be64 old, tmp, val, mask;
/* This low level function performs the actual PTE insertion * Setting the PTE depends on the MMU type and other factors. It's * an horrible mess that I'm not going to try to clean up now but * I'm keeping it in one place rather than spread around
*/ staticinlinevoid hash__set_pte_at(struct mm_struct *mm, unsignedlong addr,
pte_t *ptep, pte_t pte, int percpu)
{ /* * Anything else just stores the PTE normally. That covers all 64-bit * cases, and 32-bit non-hash with 32-bit PTEs.
*/
*ptep = pte;
}
int hash__create_section_mapping(unsignedlong start, unsignedlong end, int nid, pgprot_t prot); int hash__remove_section_mapping(unsignedlong start, unsignedlong end);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.