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