From: labbott@redhat.com (Laura Abbott)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: mm: use correct mapping granularity under DEBUG_RODATA
Date: Mon, 16 Nov 2015 15:14:16 -0800 [thread overview]
Message-ID: <564A6348.5040200@redhat.com> (raw)
In-Reply-To: <1447669094-31076-1-git-send-email-ard.biesheuvel@linaro.org>
On 11/16/2015 02:18 AM, Ard Biesheuvel wrote:
> When booting a 64k pages kernel that is built with CONFIG_DEBUG_RODATA
> and resides at an offset that is not a multiple of 512 MB, the rounding
> that occurs in __map_memblock() and fixup_executable() results in
> incorrect regions being mapped.
>
> The following snippet from /sys/kernel/debug/kernel_page_tables shows
> how, when the kernel is loaded 2 MB above the base of DRAM at 0x40000000,
> the first 2 MB of memory (which may be inaccessible from non-secure EL1
> or just reserved by the firmware) is inadvertently mapped into the end of
> the module region.
>
> ---[ Modules start ]---
> 0xfffffdffffe00000-0xfffffe0000000000 2M RW NX ... UXN MEM/NORMAL
> ---[ Modules end ]---
> ---[ Kernel Mapping ]---
> 0xfffffe0000000000-0xfffffe0000090000 576K RW NX ... UXN MEM/NORMAL
> 0xfffffe0000090000-0xfffffe0000200000 1472K ro x ... UXN MEM/NORMAL
> 0xfffffe0000200000-0xfffffe0000800000 6M ro x ... UXN MEM/NORMAL
> 0xfffffe0000800000-0xfffffe0000810000 64K ro x ... UXN MEM/NORMAL
> 0xfffffe0000810000-0xfffffe0000a00000 1984K RW NX ... UXN MEM/NORMAL
> 0xfffffe0000a00000-0xfffffe00ffe00000 4084M RW NX ... UXN MEM/NORMAL
>
> The same issue is likely to occur on 16k pages kernels whose load
> address is not a multiple of 32 MB (i.e., SECTION_SIZE). So round to
> SWAPPER_BLOCK_SIZE instead of SECTION_SIZE.
>
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Laura Abbott <labbott@redhat.com>
Thanks,
Laura
next prev parent reply other threads:[~2015-11-16 23:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-16 10:18 [PATCH] arm64: mm: use correct mapping granularity under DEBUG_RODATA Ard Biesheuvel
2015-11-16 11:57 ` Mark Rutland
2015-11-16 12:00 ` Ard Biesheuvel
2015-11-16 12:16 ` Mark Rutland
2015-11-16 12:18 ` Ard Biesheuvel
2015-11-17 11:11 ` Catalin Marinas
2015-11-17 11:14 ` Ard Biesheuvel
2015-11-16 23:14 ` Laura Abbott [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-01-28 8:54 Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=564A6348.5040200@redhat.com \
--to=labbott@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).