Skip to content

Commit

Permalink
riscv: Align on L1_CACHE_BYTES when STRICT_KERNEL_RWX is disabled
Browse files Browse the repository at this point in the history
Allows the sections to be aligned on smaller boundaries and
therefore results in a smaller kernel image size.

Signed-off-by: Sebastien Van Cauwenberghe <svancau at gmail.com>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
  • Loading branch information
Sebastien Van Cauwenberghe authored and geertu committed Jan 14, 2021
1 parent 48f239e commit d7894d2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/riscv/include/asm/set_memory.h
Expand Up @@ -32,14 +32,14 @@ bool kernel_page_present(struct page *page);

#endif /* __ASSEMBLY__ */

#ifdef CONFIG_ARCH_HAS_STRICT_KERNEL_RWX
#ifdef CONFIG_STRICT_KERNEL_RWX
#ifdef CONFIG_64BIT
#define SECTION_ALIGN (1 << 21)
#else
#define SECTION_ALIGN (1 << 22)
#endif
#else /* !CONFIG_ARCH_HAS_STRICT_KERNEL_RWX */
#else /* !CONFIG_STRICT_KERNEL_RWX */
#define SECTION_ALIGN L1_CACHE_BYTES
#endif /* CONFIG_ARCH_HAS_STRICT_KERNEL_RWX */
#endif /* CONFIG_STRICT_KERNEL_RWX */

#endif /* _ASM_RISCV_SET_MEMORY_H */

0 comments on commit d7894d2

Please sign in to comment.