Commit e393cf40 authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Catalin Marinas

arm64/mmu: align alloc_init_pte prototype with pmd/pud versions

Align the function prototype of alloc_init_pte() with its pmd and pud
counterparts by replacing the pfn parameter with the equivalent physical
address.
Reviewed-by: default avatarMark Rutland <mark.rutland@arm.com>
Tested-by: default avatarMark Rutland <mark.rutland@arm.com>
Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 2ebe088b
...@@ -107,7 +107,7 @@ static bool pgattr_change_is_safe(u64 old, u64 new) ...@@ -107,7 +107,7 @@ static bool pgattr_change_is_safe(u64 old, u64 new)
} }
static void alloc_init_pte(pmd_t *pmd, unsigned long addr, static void alloc_init_pte(pmd_t *pmd, unsigned long addr,
unsigned long end, unsigned long pfn, unsigned long end, phys_addr_t phys,
pgprot_t prot, pgprot_t prot,
phys_addr_t (*pgtable_alloc)(void)) phys_addr_t (*pgtable_alloc)(void))
{ {
...@@ -128,8 +128,7 @@ static void alloc_init_pte(pmd_t *pmd, unsigned long addr, ...@@ -128,8 +128,7 @@ static void alloc_init_pte(pmd_t *pmd, unsigned long addr,
do { do {
pte_t old_pte = *pte; pte_t old_pte = *pte;
set_pte(pte, pfn_pte(pfn, prot)); set_pte(pte, pfn_pte(__phys_to_pfn(phys), prot));
pfn++;
/* /*
* After the PTE entry has been populated once, we * After the PTE entry has been populated once, we
...@@ -137,6 +136,7 @@ static void alloc_init_pte(pmd_t *pmd, unsigned long addr, ...@@ -137,6 +136,7 @@ static void alloc_init_pte(pmd_t *pmd, unsigned long addr,
*/ */
BUG_ON(!pgattr_change_is_safe(pte_val(old_pte), pte_val(*pte))); BUG_ON(!pgattr_change_is_safe(pte_val(old_pte), pte_val(*pte)));
phys += PAGE_SIZE;
} while (pte++, addr += PAGE_SIZE, addr != end); } while (pte++, addr += PAGE_SIZE, addr != end);
pte_clear_fixmap(); pte_clear_fixmap();
...@@ -182,7 +182,7 @@ static void alloc_init_pmd(pud_t *pud, unsigned long addr, unsigned long end, ...@@ -182,7 +182,7 @@ static void alloc_init_pmd(pud_t *pud, unsigned long addr, unsigned long end,
BUG_ON(!pgattr_change_is_safe(pmd_val(old_pmd), BUG_ON(!pgattr_change_is_safe(pmd_val(old_pmd),
pmd_val(*pmd))); pmd_val(*pmd)));
} else { } else {
alloc_init_pte(pmd, addr, next, __phys_to_pfn(phys), alloc_init_pte(pmd, addr, next, phys,
prot, pgtable_alloc); prot, pgtable_alloc);
BUG_ON(pmd_val(old_pmd) != 0 && BUG_ON(pmd_val(old_pmd) != 0 &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment