1# SPDX-License-Identifier: GPL-2.0
2
3menu "UML-specific options"
4
5config UML
6	bool
7	default y
8	select ARCH_HAS_CPU_FINALIZE_INIT
9	select ARCH_HAS_FORTIFY_SOURCE
10	select ARCH_HAS_GCOV_PROFILE_ALL
11	select ARCH_HAS_KCOV
12	select ARCH_HAS_STRNCPY_FROM_USER
13	select ARCH_HAS_STRNLEN_USER
14	select HAVE_ARCH_AUDITSYSCALL
15	select HAVE_ARCH_KASAN if X86_64
16	select HAVE_ARCH_KASAN_VMALLOC if HAVE_ARCH_KASAN
17	select HAVE_ARCH_SECCOMP_FILTER
18	select HAVE_ASM_MODVERSIONS
19	select HAVE_UID16
20	select HAVE_DEBUG_KMEMLEAK
21	select HAVE_DEBUG_BUGVERBOSE
22	select HAVE_PAGE_SIZE_4KB
23	select NO_DMA if !UML_DMA_EMULATION
24	select OF_EARLY_FLATTREE if OF
25	select GENERIC_IRQ_SHOW
26	select GENERIC_CPU_DEVICES
27	select HAVE_GCC_PLUGINS
28	select ARCH_SUPPORTS_LTO_CLANG
29	select ARCH_SUPPORTS_LTO_CLANG_THIN
30	select TRACE_IRQFLAGS_SUPPORT
31	select TTY # Needed for line.c
32	select HAVE_ARCH_VMAP_STACK
33	select HAVE_RUST
34	select ARCH_HAS_UBSAN
35
36config MMU
37	bool
38	default y
39
40config UML_DMA_EMULATION
41	bool
42
43config NO_IOMEM
44	bool "disable IOMEM" if EXPERT
45	depends on !INDIRECT_IOMEM
46	default y
47
48config UML_IOMEM_EMULATION
49	bool
50	select INDIRECT_IOMEM
51	select HAS_IOPORT
52	select GENERIC_PCI_IOMAP
53	select GENERIC_IOMAP
54	select NO_GENERIC_PCI_IOPORT_MAP
55
56config NO_IOPORT_MAP
57	def_bool !UML_IOMEM_EMULATION
58
59config ISA
60	bool
61
62config SBUS
63	bool
64
65config LOCKDEP_SUPPORT
66	bool
67	default y
68
69config STACKTRACE_SUPPORT
70	bool
71	default y
72	select STACKTRACE
73
74config GENERIC_CALIBRATE_DELAY
75	bool
76	default y
77
78config HZ
79	int
80	default 100
81
82config NR_CPUS
83	int
84	range 1 1
85	default 1
86
87config ARCH_HAS_CACHE_LINE_SIZE
88	def_bool y
89
90source "arch/$(HEADER_ARCH)/um/Kconfig"
91
92config MAY_HAVE_RUNTIME_DEPS
93	bool
94
95config STATIC_LINK
96	bool "Force a static link"
97	depends on CC_CAN_LINK_STATIC_NO_RUNTIME_DEPS || !MAY_HAVE_RUNTIME_DEPS
98	help
99	  This option gives you the ability to force a static link of UML.
100	  Normally, UML is linked as a shared binary.  This is inconvenient for
101	  use in a chroot jail.  So, if you intend to run UML inside a chroot,
102	  you probably want to say Y here.
103	  Additionally, this option enables using higher memory spaces (up to
104	  2.75G) for UML.
105
106	  NOTE: This option is incompatible with some networking features which
107	  depend on features that require being dynamically loaded (like NSS).
108
109config LD_SCRIPT_STATIC
110	bool
111	default y
112	depends on STATIC_LINK
113
114config LD_SCRIPT_DYN
115	bool
116	default y
117	depends on !LD_SCRIPT_STATIC
118
119config LD_SCRIPT_DYN_RPATH
120	bool "set rpath in the binary" if EXPERT
121	default y
122	depends on LD_SCRIPT_DYN
123	help
124	  Add /lib (and /lib64 for 64-bit) to the linux binary's rpath
125	  explicitly.
126
127	  You may need to turn this off if compiling for nix systems
128	  that have their libraries in random /nix directories and
129	  might otherwise unexpected use libraries from /lib or /lib64
130	  instead of the desired ones.
131
132config HOSTFS
133	tristate "Host filesystem"
134	help
135	  While the User-Mode Linux port uses its own root file system for
136	  booting and normal file access, this module lets the UML user
137	  access files stored on the host.  It does not require any
138	  network connection between the Host and UML.  An example use of
139	  this might be:
140
141	  mount none /tmp/fromhost -t hostfs -o /tmp/umlshare
142
143	  where /tmp/fromhost is an empty directory inside UML and
144	  /tmp/umlshare is a directory on the host with files the UML user
145	  wishes to access.
146
147	  For more information, see
148	  <http://user-mode-linux.sourceforge.net/hostfs.html>.
149
150	  If you'd like to be able to work with files stored on the host,
151	  say Y or M here; otherwise say N.
152
153config MCONSOLE
154	bool "Management console"
155	depends on PROC_FS
156	default y
157	help
158	  The user mode linux management console is a low-level interface to
159	  the kernel, somewhat like the i386 SysRq interface.  Since there is
160	  a full-blown operating system running under every user mode linux
161	  instance, there is much greater flexibility possible than with the
162	  SysRq mechanism.
163
164	  If you answer 'Y' to this option, to use this feature, you need the
165	  mconsole client (called uml_mconsole) which is present in CVS in
166	  2.4.5-9um and later (path /tools/mconsole), and is also in the
167	  distribution RPM package in 2.4.6 and later.
168
169	  It is safe to say 'Y' here.
170
171config MAGIC_SYSRQ
172	bool "Magic SysRq key"
173	depends on MCONSOLE
174	help
175	  If you say Y here, you will have some control over the system even
176	  if the system crashes for example during kernel debugging (e.g., you
177	  will be able to flush the buffer cache to disk, reboot the system
178	  immediately or dump some status information). A key for each of the
179	  possible requests is provided.
180
181	  This is the feature normally accomplished by pressing a key
182	  while holding SysRq (Alt+PrintScreen).
183
184	  On UML, this is accomplished by sending a "sysrq" command with
185	  mconsole, followed by the letter for the requested command.
186
187	  The keys are documented in <file:Documentation/admin-guide/sysrq.rst>. Don't say Y
188	  unless you really know what this hack does.
189
190config KERNEL_STACK_ORDER
191	int "Kernel stack size order"
192	default 2 if 64BIT
193	range 2 10 if 64BIT
194	default 1 if !64BIT
195	help
196	  This option determines the size of UML kernel stacks.  They will
197	  be 1 << order pages.  The default is OK unless you're running Valgrind
198	  on UML, in which case, set this to 3.
199	  It is possible to reduce the stack to 1 for 64BIT and 0 for 32BIT on
200	  older (pre-2017) CPUs. It is not recommended on newer CPUs due to the
201	  increase in the size of the state which needs to be saved when handling
202	  signals.
203
204config MMAPPER
205	tristate "iomem emulation driver"
206	help
207	  This driver allows a host file to be used as emulated IO memory inside
208	  UML.
209
210config PGTABLE_LEVELS
211	int
212	default 3 if 3_LEVEL_PGTABLES
213	default 2
214
215config UML_TIME_TRAVEL_SUPPORT
216	bool
217	prompt "Support time-travel mode (e.g. for test execution)"
218	# inf-cpu mode is incompatible with the benchmarking
219	depends on !RAID6_PQ_BENCHMARK
220	depends on !SMP
221	help
222	  Enable this option to support time travel inside the UML instance.
223
224	  After enabling this option, two modes are accessible at runtime
225	  (selected by the kernel command line), see the kernel's command-
226	  line help for more details.
227
228	  It is safe to say Y, but you probably don't need this.
229
230config KASAN_SHADOW_OFFSET
231	hex
232	depends on KASAN
233	default 0x100000000000
234	help
235	  This is the offset at which the ~16TB of shadow memory is
236	  mapped and used by KASAN for memory debugging. This can be any
237	  address that has at least KASAN_SHADOW_SIZE (total address space divided
238	  by 8) amount of space so that the KASAN shadow memory does not conflict
239	  with anything. The default is 0x100000000000, which works even if mem is
240	  set to a large value. On low-memory systems, try 0x7fff8000, as it fits
241	  into the immediate of most instructions, improving performance.
242
243endmenu
244
245source "arch/um/drivers/Kconfig"
246
247config ARCH_SUSPEND_POSSIBLE
248	def_bool y
249
250menu "Power management options"
251
252source "kernel/power/Kconfig"
253
254endmenu
255