From mboxrd@z Thu Jan 1 00:00:00 1970 From: lauraa@codeaurora.org (Laura Abbott) Date: Tue, 8 Oct 2013 18:31:30 -0700 Subject: [RFC PATCH 3/5] arm: align init, text, rodata to PMD_SIZE if CONFIG_STRICT_MEMORY_RWX is set In-Reply-To: <1381282292-25251-1-git-send-email-lauraa@codeaurora.org> References: <1381282292-25251-1-git-send-email-lauraa@codeaurora.org> Message-ID: <1381282292-25251-4-git-send-email-lauraa@codeaurora.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org From: Larry Bassel Init code, text, rodata and data need different permissions and so they need to be on different pages. The kernel 1-to-1 mapping is constructed using section size pages to improve TLB performance and this should not be changed (to 4K pages). Therefore ensure that each of these regions starts on a PMD_SIZE boundary. SECTION_SIZE is not enough as everything is mapped first and then cleared later and remapped. Signed-off-by: Larry Bassel Signed-off-by: Laura Abbott --- arch/arm/kernel/vmlinux.lds.S | 22 +++++++++++++++++++++- 1 files changed, 21 insertions(+), 1 deletions(-) diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index 7bcee5c..c06e915 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S @@ -8,6 +8,9 @@ #include #include #include +#ifdef CONFIG_STRICT_MEMORY_RWX +#include +#endif #define PROC_INFO \ . = ALIGN(4); \ @@ -90,6 +93,9 @@ SECTIONS _text = .; HEAD_TEXT } +#ifdef CONFIG_STRICT_MEMORY_RWX + . = ALIGN(1<