* [PATCH] arm64: consistently use p?d_set_huge
@ 2016-03-22 10:11 Mark Rutland
2016-03-24 16:33 ` Catalin Marinas
0 siblings, 1 reply; 2+ messages in thread
From: Mark Rutland @ 2016-03-22 10:11 UTC (permalink / raw)
To: linux-arm-kernel
Commit 324420bf91f60582 ("arm64: add support for ioremap() block
mappings") added new p?d_set_huge functions which do the hard work to
generate and set a correct block entry.
These differ from open-coded huge page creation in the early page table
code by explicitly setting the P?D_TYPE_SECT bits (which are implicitly
retained by mv_sect_prot() for any valid prot), but are otherwise
identical (and cannot fail on arm64).
For simplicity and consistency, make use of these in the initial page
table creation code.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
---
arch/arm64/mm/mmu.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index d2d8b8c..f3e5c74 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -211,8 +211,7 @@ static void alloc_init_pmd(pud_t *pud, unsigned long addr, unsigned long end,
if (((addr | next | phys) & ~SECTION_MASK) == 0 &&
block_mappings_allowed(pgtable_alloc)) {
pmd_t old_pmd =*pmd;
- set_pmd(pmd, __pmd(phys |
- pgprot_val(mk_sect_prot(prot))));
+ pmd_set_huge(pmd, phys, prot);
/*
* Check for previous table entries created during
* boot (__create_page_tables) and flush them.
@@ -272,8 +271,7 @@ static void alloc_init_pud(pgd_t *pgd, unsigned long addr, unsigned long end,
if (use_1G_block(addr, next, phys) &&
block_mappings_allowed(pgtable_alloc)) {
pud_t old_pud = *pud;
- set_pud(pud, __pud(phys |
- pgprot_val(mk_sect_prot(prot))));
+ pud_set_huge(pud, phys, prot);
/*
* If we have an old value for a pud, it will
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] arm64: consistently use p?d_set_huge
2016-03-22 10:11 [PATCH] arm64: consistently use p?d_set_huge Mark Rutland
@ 2016-03-24 16:33 ` Catalin Marinas
0 siblings, 0 replies; 2+ messages in thread
From: Catalin Marinas @ 2016-03-24 16:33 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Mar 22, 2016 at 10:11:45AM +0000, Mark Rutland wrote:
> Commit 324420bf91f60582 ("arm64: add support for ioremap() block
> mappings") added new p?d_set_huge functions which do the hard work to
> generate and set a correct block entry.
>
> These differ from open-coded huge page creation in the early page table
> code by explicitly setting the P?D_TYPE_SECT bits (which are implicitly
> retained by mv_sect_prot() for any valid prot), but are otherwise
> identical (and cannot fail on arm64).
>
> For simplicity and consistency, make use of these in the initial page
> table creation code.
>
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
Applied. Thanks.
--
Catalin
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-03-24 16:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-22 10:11 [PATCH] arm64: consistently use p?d_set_huge Mark Rutland
2016-03-24 16:33 ` Catalin Marinas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).