Skip to content

Commit 9c4e08a

Browse files
mrutland-armwildea01
authored andcommitted
arm64: mm: allow sections for unaligned bases
Callees of __create_mapping may decide to create section mappings if sufficient low bits of the physical and virtual addresses they were passed are zero. While __create_mapping rounds the virtual base address down, it does not similarly round the physical base address down, and hence non-zero bits in the physical address can prevent use of a section mapping, even where a whole next-level table would be used instead. Round down the physical base address in __create_mapping to enable all callees to always create section mappings when such a mapping is possible. Cc: Laura Abbott <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Acked-by: Catalin Marinas <[email protected]> Reviewed-by: Steve Capper <[email protected]> Signed-off-by: Mark Rutland <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent cc5d2b3 commit 9c4e08a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/arm64/mm/mmu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ static void __create_mapping(struct mm_struct *mm, pgd_t *pgd,
258258
if (WARN_ON((phys ^ virt) & ~PAGE_MASK))
259259
return;
260260

261+
phys &= PAGE_MASK;
261262
addr = virt & PAGE_MASK;
262263
length = PAGE_ALIGN(size + (virt & ~PAGE_MASK));
263264

0 commit comments

Comments
 (0)