projects/linux·blob master · refs

306 lines · 8.6 KiB

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