提交 9c4e08a3 编写于 作者: M Mark Rutland 提交者: Will Deacon

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 <labbott@fedoraproject.org>
Acked-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
Reviewed-by: NSteve Capper <steve.capper@linaro.org>
Signed-off-by: NMark Rutland <mark.rutland@arm.com>
Signed-off-by: NWill Deacon <will.deacon@arm.com>
上级 cc5d2b3b
...@@ -258,6 +258,7 @@ static void __create_mapping(struct mm_struct *mm, pgd_t *pgd, ...@@ -258,6 +258,7 @@ static void __create_mapping(struct mm_struct *mm, pgd_t *pgd,
if (WARN_ON((phys ^ virt) & ~PAGE_MASK)) if (WARN_ON((phys ^ virt) & ~PAGE_MASK))
return; return;
phys &= PAGE_MASK;
addr = virt & PAGE_MASK; addr = virt & PAGE_MASK;
length = PAGE_ALIGN(size + (virt & ~PAGE_MASK)); length = PAGE_ALIGN(size + (virt & ~PAGE_MASK));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册