[RFC PATCH 7/9] ARM64: mm: HugeTLB support.
Will Deacon
will.deacon at arm.com
Wed May 1 07:42:38 EDT 2013
Hi Steve,
On Tue, Apr 30, 2013 at 05:30:46PM +0100, Steve Capper wrote:
> Add huge page support to ARM64, different huge page sizes are
> supported depending on the size of normal pages:
>
> PAGE_SIZE is 4K:
> 2MB - (pmds) these can be allocated at any time.
> 1024MB - (puds) usually allocated on bootup with the command line
> with something like: hugepagesz=1G hugepages=6
>
> PAGE_SIZE is 64K:
> 512MB - (pmds), usually allocated on bootup via command line.
[...]
> diff --git a/arch/arm64/include/asm/pgtable-hwdef.h b/arch/arm64/include/asm/pgtable-hwdef.h
> index 75fd13d..c3cac68 100644
> --- a/arch/arm64/include/asm/pgtable-hwdef.h
> +++ b/arch/arm64/include/asm/pgtable-hwdef.h
> @@ -53,6 +53,7 @@
> #define PTE_TYPE_MASK (_AT(pteval_t, 3) << 0)
> #define PTE_TYPE_FAULT (_AT(pteval_t, 0) << 0)
> #define PTE_TYPE_PAGE (_AT(pteval_t, 3) << 0)
> +#define PTE_TYPE_HUGEPAGE (_AT(pmdval_t, 1) << 0)
This breaks PROT_NONE mappings, where you get:
pte = pte_mkhuge(pte_modify(pte, newprot));
The pte_modify will clear the valid bit and set the prot_none bit (in order
to create a present, faulting entry) but then your pte_mkhuge will come in
and clobber that with a valid block entry.
Will
More information about the linux-arm-kernel
mailing list