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