Loading arch/arm64/Kconfig.debug +24 −0 Original line number Diff line number Diff line Loading @@ -101,4 +101,28 @@ config KERNEL_TEXT_RDONLY performance impact. If unsure, say N. config DEBUG_RODATA bool "Make kernel text and rodata read-only" help If this is set, kernel text and rodata will be made read-only. This is to help catch accidental or malicious attempts to change the kernel's executable code. Additionally splits rodata from kernel text so it can be made explicitly non-executable. If in doubt, say Y config DEBUG_ALIGN_RODATA depends on DEBUG_RODATA && !ARM64_64K_PAGES bool "Align linker sections up to SECTION_SIZE" help If this option is enabled, sections that may potentially be marked as read only or non-executable will be aligned up to the section size of the kernel. This prevents sections from being split into pages and avoids a potential TLB penalty. The downside is an increase in alignment and potentially wasted space. Turn on this option if performance is more important than memory pressure. If in doubt, say N endmenu arch/arm64/include/asm/cacheflush.h +5 −0 Original line number Diff line number Diff line Loading @@ -160,6 +160,11 @@ int set_memory_ro(unsigned long addr, int numpages); int set_memory_rw(unsigned long addr, int numpages); int set_memory_x(unsigned long addr, int numpages); int set_memory_nx(unsigned long addr, int numpages); #ifdef CONFIG_DEBUG_RODATA void mark_rodata_ro(void); #endif #ifdef CONFIG_KERNEL_TEXT_RDONLY void set_kernel_text_ro(void); #else Loading arch/arm64/include/asm/efi.h +0 −2 Original line number Diff line number Diff line Loading @@ -6,10 +6,8 @@ #ifdef CONFIG_EFI extern void efi_init(void); extern void efi_idmap_init(void); #else #define efi_init() #define efi_idmap_init() #endif #define efi_call_virt(f, ...) \ Loading arch/arm64/include/asm/fixmap.h +5 −3 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ enum fixed_addresses { FIX_BTMAP_END = __end_of_permanent_fixed_addresses, FIX_BTMAP_BEGIN = FIX_BTMAP_END + TOTAL_FIX_BTMAPS - 1, FIX_TEXT_POKE0, __end_of_fixed_addresses }; Loading @@ -56,10 +57,11 @@ enum fixed_addresses { #define FIXMAP_PAGE_IO __pgprot(PROT_DEVICE_nGnRE) extern void __early_set_fixmap(enum fixed_addresses idx, phys_addr_t phys, pgprot_t flags); void __init early_fixmap_init(void); #define __set_fixmap __early_set_fixmap #define __early_set_fixmap __set_fixmap extern void __set_fixmap(enum fixed_addresses idx, phys_addr_t phys, pgprot_t prot); #include <asm-generic/fixmap.h> Loading arch/arm64/include/asm/irq.h +0 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,6 @@ #include <asm-generic/irq.h> extern void (*handle_arch_irq)(struct pt_regs *); extern void migrate_irqs(void); extern void set_handle_irq(void (*handle_irq)(struct pt_regs *)); Loading Loading
arch/arm64/Kconfig.debug +24 −0 Original line number Diff line number Diff line Loading @@ -101,4 +101,28 @@ config KERNEL_TEXT_RDONLY performance impact. If unsure, say N. config DEBUG_RODATA bool "Make kernel text and rodata read-only" help If this is set, kernel text and rodata will be made read-only. This is to help catch accidental or malicious attempts to change the kernel's executable code. Additionally splits rodata from kernel text so it can be made explicitly non-executable. If in doubt, say Y config DEBUG_ALIGN_RODATA depends on DEBUG_RODATA && !ARM64_64K_PAGES bool "Align linker sections up to SECTION_SIZE" help If this option is enabled, sections that may potentially be marked as read only or non-executable will be aligned up to the section size of the kernel. This prevents sections from being split into pages and avoids a potential TLB penalty. The downside is an increase in alignment and potentially wasted space. Turn on this option if performance is more important than memory pressure. If in doubt, say N endmenu
arch/arm64/include/asm/cacheflush.h +5 −0 Original line number Diff line number Diff line Loading @@ -160,6 +160,11 @@ int set_memory_ro(unsigned long addr, int numpages); int set_memory_rw(unsigned long addr, int numpages); int set_memory_x(unsigned long addr, int numpages); int set_memory_nx(unsigned long addr, int numpages); #ifdef CONFIG_DEBUG_RODATA void mark_rodata_ro(void); #endif #ifdef CONFIG_KERNEL_TEXT_RDONLY void set_kernel_text_ro(void); #else Loading
arch/arm64/include/asm/efi.h +0 −2 Original line number Diff line number Diff line Loading @@ -6,10 +6,8 @@ #ifdef CONFIG_EFI extern void efi_init(void); extern void efi_idmap_init(void); #else #define efi_init() #define efi_idmap_init() #endif #define efi_call_virt(f, ...) \ Loading
arch/arm64/include/asm/fixmap.h +5 −3 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ enum fixed_addresses { FIX_BTMAP_END = __end_of_permanent_fixed_addresses, FIX_BTMAP_BEGIN = FIX_BTMAP_END + TOTAL_FIX_BTMAPS - 1, FIX_TEXT_POKE0, __end_of_fixed_addresses }; Loading @@ -56,10 +57,11 @@ enum fixed_addresses { #define FIXMAP_PAGE_IO __pgprot(PROT_DEVICE_nGnRE) extern void __early_set_fixmap(enum fixed_addresses idx, phys_addr_t phys, pgprot_t flags); void __init early_fixmap_init(void); #define __set_fixmap __early_set_fixmap #define __early_set_fixmap __set_fixmap extern void __set_fixmap(enum fixed_addresses idx, phys_addr_t phys, pgprot_t prot); #include <asm-generic/fixmap.h> Loading
arch/arm64/include/asm/irq.h +0 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,6 @@ #include <asm-generic/irq.h> extern void (*handle_arch_irq)(struct pt_regs *); extern void migrate_irqs(void); extern void set_handle_irq(void (*handle_irq)(struct pt_regs *)); Loading