xref: /openbmc/linux/arch/arm64/Kconfig.debug (revision 890f0b0d)
1# SPDX-License-Identifier: GPL-2.0-only
2
3config PID_IN_CONTEXTIDR
4	bool "Write the current PID to the CONTEXTIDR register"
5	help
6	  Enabling this option causes the kernel to write the current PID to
7	  the CONTEXTIDR register, at the expense of some additional
8	  instructions during context switch. Say Y here only if you are
9	  planning to use hardware trace tools with this kernel.
10
11config ARM64_RANDOMIZE_TEXT_OFFSET
12	bool "Randomize TEXT_OFFSET at build time"
13	help
14	  Say Y here if you want the image load offset (AKA TEXT_OFFSET)
15	  of the kernel to be randomized at build-time. When selected,
16	  this option will cause TEXT_OFFSET to be randomized upon any
17	  build of the kernel, and the offset will be reflected in the
18	  text_offset field of the resulting Image. This can be used to
19	  fuzz-test bootloaders which respect text_offset.
20
21	  This option is intended for bootloader and/or kernel testing
22	  only. Bootloaders must make no assumptions regarding the value
23	  of TEXT_OFFSET and platforms must not require a specific
24	  value.
25
26config DEBUG_WX
27	bool "Warn on W+X mappings at boot"
28	select PTDUMP_CORE
29	---help---
30	  Generate a warning if any W+X mappings are found at boot.
31
32	  This is useful for discovering cases where the kernel is leaving
33	  W+X mappings after applying NX, as such mappings are a security risk.
34	  This check also includes UXN, which should be set on all kernel
35	  mappings.
36
37	  Look for a message in dmesg output like this:
38
39	    arm64/mm: Checked W+X mappings: passed, no W+X pages found.
40
41	  or like this, if the check failed:
42
43	    arm64/mm: Checked W+X mappings: FAILED, <N> W+X pages found.
44
45	  Note that even if the check fails, your kernel is possibly
46	  still fine, as W+X mappings are not a security hole in
47	  themselves, what they do is that they make the exploitation
48	  of other unfixed kernel bugs easier.
49
50	  There is no runtime or memory usage effect of this option
51	  once the kernel has booted up - it's a one time check.
52
53	  If in doubt, say "Y".
54
55config DEBUG_ALIGN_RODATA
56	depends on STRICT_KERNEL_RWX
57	bool "Align linker sections up to SECTION_SIZE"
58	help
59	  If this option is enabled, sections that may potentially be marked as
60	  read only or non-executable will be aligned up to the section size of
61	  the kernel. This prevents sections from being split into pages and
62	  avoids a potential TLB penalty. The downside is an increase in
63	  alignment and potentially wasted space. Turn on this option if
64	  performance is more important than memory pressure.
65
66	  If in doubt, say N.
67
68config DEBUG_EFI
69	depends on EFI && DEBUG_INFO
70	bool "UEFI debugging"
71	help
72	  Enable this option to include EFI specific debugging features into
73	  the kernel that are only useful when using a debug build of the
74	  UEFI firmware
75
76config ARM64_RELOC_TEST
77	depends on m
78	tristate "Relocation testing module"
79
80source "drivers/hwtracing/coresight/Kconfig"
81