xref: /linux/arch/arm64/Kconfig.debug (revision 37744feebc086908fd89760650f458ab19071750)
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_EFI
56	depends on EFI && DEBUG_INFO
57	bool "UEFI debugging"
58	help
59	  Enable this option to include EFI specific debugging features into
60	  the kernel that are only useful when using a debug build of the
61	  UEFI firmware
62
63config ARM64_RELOC_TEST
64	depends on m
65	tristate "Relocation testing module"
66
67source "drivers/hwtracing/coresight/Kconfig"
68