RISC-V: add a spin_shadow_stack declaration
[linux-block.git] / arch / riscv / Kconfig
1 # SPDX-License-Identifier: GPL-2.0-only
2 #
3 # For a description of the syntax of this configuration file,
4 # see Documentation/kbuild/kconfig-language.rst.
5 #
6
7 config 64BIT
8         bool
9
10 config 32BIT
11         bool
12
13 config RISCV
14         def_bool y
15         select ARCH_CLOCKSOURCE_INIT
16         select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION
17         select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2
18         select ARCH_ENABLE_THP_MIGRATION if TRANSPARENT_HUGEPAGE
19         select ARCH_HAS_BINFMT_FLAT
20         select ARCH_HAS_CURRENT_STACK_POINTER
21         select ARCH_HAS_DEBUG_VIRTUAL if MMU
22         select ARCH_HAS_DEBUG_VM_PGTABLE
23         select ARCH_HAS_DEBUG_WX
24         select ARCH_HAS_FORTIFY_SOURCE
25         select ARCH_HAS_GCOV_PROFILE_ALL
26         select ARCH_HAS_GIGANTIC_PAGE
27         select ARCH_HAS_KCOV
28         select ARCH_HAS_MMIOWB
29         select ARCH_HAS_PMEM_API
30         select ARCH_HAS_PTE_SPECIAL
31         select ARCH_HAS_SET_DIRECT_MAP if MMU
32         select ARCH_HAS_SET_MEMORY if MMU
33         select ARCH_HAS_STRICT_KERNEL_RWX if MMU && !XIP_KERNEL
34         select ARCH_HAS_STRICT_MODULE_RWX if MMU && !XIP_KERNEL
35         select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
36         select ARCH_HAS_UBSAN_SANITIZE_ALL
37         select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
38         select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
39         select ARCH_STACKWALK
40         select ARCH_SUPPORTS_ATOMIC_RMW
41         select ARCH_SUPPORTS_DEBUG_PAGEALLOC if MMU
42         select ARCH_SUPPORTS_HUGETLBFS if MMU
43         select ARCH_SUPPORTS_PAGE_TABLE_CHECK if MMU
44         select ARCH_USE_MEMTEST
45         select ARCH_USE_QUEUED_RWLOCKS
46         select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
47         select ARCH_WANT_FRAME_POINTERS
48         select ARCH_WANT_GENERAL_HUGETLB
49         select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP
50         select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
51         select ARCH_WANT_LD_ORPHAN_WARN if !XIP_KERNEL
52         select ARCH_WANTS_THP_SWAP if HAVE_ARCH_TRANSPARENT_HUGEPAGE
53         select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU
54         select BUILDTIME_TABLE_SORT if MMU
55         select CLINT_TIMER if !MMU
56         select CLONE_BACKWARDS
57         select COMMON_CLK
58         select CPU_PM if CPU_IDLE
59         select EDAC_SUPPORT
60         select GENERIC_ARCH_TOPOLOGY
61         select GENERIC_ATOMIC64 if !64BIT
62         select GENERIC_CLOCKEVENTS_BROADCAST if SMP
63         select GENERIC_EARLY_IOREMAP
64         select GENERIC_GETTIMEOFDAY if HAVE_GENERIC_VDSO
65         select GENERIC_IDLE_POLL_SETUP
66         select GENERIC_IOREMAP if MMU
67         select GENERIC_IRQ_MULTI_HANDLER
68         select GENERIC_IRQ_SHOW
69         select GENERIC_IRQ_SHOW_LEVEL
70         select GENERIC_LIB_DEVMEM_IS_ALLOWED
71         select GENERIC_PCI_IOMAP
72         select GENERIC_PTDUMP if MMU
73         select GENERIC_SCHED_CLOCK
74         select GENERIC_SMP_IDLE_THREAD
75         select GENERIC_TIME_VSYSCALL if MMU && 64BIT
76         select GENERIC_VDSO_TIME_NS if HAVE_GENERIC_VDSO
77         select HARDIRQS_SW_RESEND
78         select HAVE_ARCH_AUDITSYSCALL
79         select HAVE_ARCH_HUGE_VMALLOC if HAVE_ARCH_HUGE_VMAP
80         select HAVE_ARCH_HUGE_VMAP if MMU && 64BIT && !XIP_KERNEL
81         select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
82         select HAVE_ARCH_JUMP_LABEL_RELATIVE if !XIP_KERNEL
83         select HAVE_ARCH_KASAN if MMU && 64BIT
84         select HAVE_ARCH_KASAN_VMALLOC if MMU && 64BIT
85         select HAVE_ARCH_KFENCE if MMU && 64BIT
86         select HAVE_ARCH_KGDB if !XIP_KERNEL
87         select HAVE_ARCH_KGDB_QXFER_PKT
88         select HAVE_ARCH_MMAP_RND_BITS if MMU
89         select HAVE_ARCH_MMAP_RND_COMPAT_BITS if COMPAT
90         select HAVE_ARCH_SECCOMP_FILTER
91         select HAVE_ARCH_THREAD_STRUCT_WHITELIST
92         select HAVE_ARCH_TRACEHOOK
93         select HAVE_ARCH_TRANSPARENT_HUGEPAGE if 64BIT && MMU
94         select HAVE_ARCH_VMAP_STACK if MMU && 64BIT
95         select HAVE_ASM_MODVERSIONS
96         select HAVE_CONTEXT_TRACKING_USER
97         select HAVE_DEBUG_KMEMLEAK
98         select HAVE_DMA_CONTIGUOUS if MMU
99         select HAVE_EBPF_JIT if MMU
100         select HAVE_FUNCTION_ARG_ACCESS_API
101         select HAVE_FUNCTION_ERROR_INJECTION
102         select HAVE_GCC_PLUGINS
103         select HAVE_GENERIC_VDSO if MMU && 64BIT
104         select HAVE_IRQ_TIME_ACCOUNTING
105         select HAVE_KPROBES if !XIP_KERNEL
106         select HAVE_KPROBES_ON_FTRACE if !XIP_KERNEL
107         select HAVE_KRETPROBES if !XIP_KERNEL
108         select HAVE_RETHOOK if !XIP_KERNEL
109         select HAVE_MOVE_PMD
110         select HAVE_MOVE_PUD
111         select HAVE_PCI
112         select HAVE_PERF_EVENTS
113         select HAVE_PERF_REGS
114         select HAVE_PERF_USER_STACK_DUMP
115         select HAVE_POSIX_CPU_TIMERS_TASK_WORK
116         select HAVE_REGS_AND_STACK_ACCESS_API
117         select HAVE_RSEQ
118         select HAVE_STACKPROTECTOR
119         select HAVE_SYSCALL_TRACEPOINTS
120         select IRQ_DOMAIN
121         select IRQ_FORCED_THREADING
122         select MODULES_USE_ELF_RELA if MODULES
123         select MODULE_SECTIONS if MODULES
124         select OF
125         select OF_DMA_DEFAULT_COHERENT
126         select OF_EARLY_FLATTREE
127         select OF_IRQ
128         select PCI_DOMAINS_GENERIC if PCI
129         select PCI_MSI if PCI
130         select RISCV_INTC
131         select RISCV_TIMER if RISCV_SBI
132         select SIFIVE_PLIC
133         select SPARSE_IRQ
134         select SYSCTL_EXCEPTION_TRACE
135         select THREAD_INFO_IN_TASK
136         select TRACE_IRQFLAGS_SUPPORT
137         select UACCESS_MEMCPY if !MMU
138         select ZONE_DMA32 if 64BIT
139         select HAVE_DYNAMIC_FTRACE if !XIP_KERNEL && MMU && $(cc-option,-fpatchable-function-entry=8)
140         select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
141         select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL
142         select HAVE_FUNCTION_GRAPH_TRACER
143         select HAVE_FUNCTION_TRACER if !XIP_KERNEL && !PREEMPTION
144
145 config ARCH_MMAP_RND_BITS_MIN
146         default 18 if 64BIT
147         default 8
148
149 config ARCH_MMAP_RND_COMPAT_BITS_MIN
150         default 8
151
152 # max bits determined by the following formula:
153 #  VA_BITS - PAGE_SHIFT - 3
154 config ARCH_MMAP_RND_BITS_MAX
155         default 24 if 64BIT # SV39 based
156         default 17
157
158 config ARCH_MMAP_RND_COMPAT_BITS_MAX
159         default 17
160
161 # set if we run in machine mode, cleared if we run in supervisor mode
162 config RISCV_M_MODE
163         bool
164         default !MMU
165
166 # set if we are running in S-mode and can use SBI calls
167 config RISCV_SBI
168         bool
169         depends on !RISCV_M_MODE
170         default y
171
172 config MMU
173         bool "MMU-based Paged Memory Management Support"
174         default y
175         help
176           Select if you want MMU-based virtualised addressing space
177           support by paged memory management. If unsure, say 'Y'.
178
179 config PAGE_OFFSET
180         hex
181         default 0xC0000000 if 32BIT
182         default 0x80000000 if 64BIT && !MMU
183         default 0xff60000000000000 if 64BIT
184
185 config KASAN_SHADOW_OFFSET
186         hex
187         depends on KASAN_GENERIC
188         default 0xdfffffff00000000 if 64BIT
189         default 0xffffffff if 32BIT
190
191 config ARCH_FLATMEM_ENABLE
192         def_bool !NUMA
193
194 config ARCH_SPARSEMEM_ENABLE
195         def_bool y
196         depends on MMU
197         select SPARSEMEM_STATIC if 32BIT && SPARSEMEM
198         select SPARSEMEM_VMEMMAP_ENABLE if 64BIT
199
200 config ARCH_SELECT_MEMORY_MODEL
201         def_bool ARCH_SPARSEMEM_ENABLE
202
203 config ARCH_SUPPORTS_UPROBES
204         def_bool y
205
206 config STACKTRACE_SUPPORT
207         def_bool y
208
209 config GENERIC_BUG
210         def_bool y
211         depends on BUG
212         select GENERIC_BUG_RELATIVE_POINTERS if 64BIT
213
214 config GENERIC_BUG_RELATIVE_POINTERS
215         bool
216
217 config GENERIC_CALIBRATE_DELAY
218         def_bool y
219
220 config GENERIC_CSUM
221         def_bool y
222
223 config GENERIC_HWEIGHT
224         def_bool y
225
226 config FIX_EARLYCON_MEM
227         def_bool MMU
228
229 config PGTABLE_LEVELS
230         int
231         default 5 if 64BIT
232         default 2
233
234 config LOCKDEP_SUPPORT
235         def_bool y
236
237 config RISCV_DMA_NONCOHERENT
238         bool
239         select ARCH_HAS_DMA_PREP_COHERENT
240         select ARCH_HAS_SETUP_DMA_OPS
241         select ARCH_HAS_SYNC_DMA_FOR_CPU
242         select ARCH_HAS_SYNC_DMA_FOR_DEVICE
243         select DMA_DIRECT_REMAP
244
245 config AS_HAS_INSN
246         def_bool $(as-instr,.insn r 51$(comma) 0$(comma) 0$(comma) t0$(comma) t0$(comma) zero)
247
248 source "arch/riscv/Kconfig.socs"
249 source "arch/riscv/Kconfig.erratas"
250
251 menu "Platform type"
252
253 config NONPORTABLE
254         bool "Allow configurations that result in non-portable kernels"
255         help
256           RISC-V kernel binaries are compatible between all known systems
257           whenever possible, but there are some use cases that can only be
258           satisfied by configurations that result in kernel binaries that are
259           not portable between systems.
260
261           Selecting N does not guarantee kernels will be portable to all known
262           systems.  Selecting any of the options guarded by NONPORTABLE will
263           result in kernel binaries that are unlikely to be portable between
264           systems.
265
266           If unsure, say N.
267
268 choice
269         prompt "Base ISA"
270         default ARCH_RV64I
271         help
272           This selects the base ISA that this kernel will target and must match
273           the target platform.
274
275 config ARCH_RV32I
276         bool "RV32I"
277         depends on NONPORTABLE
278         select 32BIT
279         select GENERIC_LIB_ASHLDI3
280         select GENERIC_LIB_ASHRDI3
281         select GENERIC_LIB_LSHRDI3
282         select GENERIC_LIB_UCMPDI2
283         select MMU
284
285 config ARCH_RV64I
286         bool "RV64I"
287         select 64BIT
288         select ARCH_SUPPORTS_INT128 if CC_HAS_INT128
289         select SWIOTLB if MMU
290
291 endchoice
292
293 # We must be able to map all physical memory into the kernel, but the compiler
294 # is still a bit more efficient when generating code if it's setup in a manner
295 # such that it can only map 2GiB of memory.
296 choice
297         prompt "Kernel Code Model"
298         default CMODEL_MEDLOW if 32BIT
299         default CMODEL_MEDANY if 64BIT
300
301         config CMODEL_MEDLOW
302                 bool "medium low code model"
303         config CMODEL_MEDANY
304                 bool "medium any code model"
305 endchoice
306
307 config MODULE_SECTIONS
308         bool
309         select HAVE_MOD_ARCH_SPECIFIC
310
311 config SMP
312         bool "Symmetric Multi-Processing"
313         help
314           This enables support for systems with more than one CPU.  If
315           you say N here, the kernel will run on single and
316           multiprocessor machines, but will use only one CPU of a
317           multiprocessor machine. If you say Y here, the kernel will run
318           on many, but not all, single processor machines. On a single
319           processor machine, the kernel will run faster if you say N
320           here.
321
322           If you don't know what to do here, say N.
323
324 config NR_CPUS
325         int "Maximum number of CPUs (2-512)"
326         depends on SMP
327         range 2 512 if !RISCV_SBI_V01
328         range 2 32 if RISCV_SBI_V01 && 32BIT
329         range 2 64 if RISCV_SBI_V01 && 64BIT
330         default "32" if 32BIT
331         default "64" if 64BIT
332
333 config HOTPLUG_CPU
334         bool "Support for hot-pluggable CPUs"
335         depends on SMP
336         select GENERIC_IRQ_MIGRATION
337         help
338
339           Say Y here to experiment with turning CPUs off and on.  CPUs
340           can be controlled through /sys/devices/system/cpu.
341
342           Say N if you want to disable CPU hotplug.
343
344 choice
345         prompt "CPU Tuning"
346         default TUNE_GENERIC
347
348 config TUNE_GENERIC
349         bool "generic"
350
351 endchoice
352
353 # Common NUMA Features
354 config NUMA
355         bool "NUMA Memory Allocation and Scheduler Support"
356         depends on SMP && MMU
357         select ARCH_SUPPORTS_NUMA_BALANCING
358         select GENERIC_ARCH_NUMA
359         select NEED_PER_CPU_EMBED_FIRST_CHUNK
360         select OF_NUMA
361         select USE_PERCPU_NUMA_NODE_ID
362         help
363           Enable NUMA (Non-Uniform Memory Access) support.
364
365           The kernel will try to allocate memory used by a CPU on the
366           local memory of the CPU and add some more NUMA awareness to the kernel.
367
368 config NODES_SHIFT
369         int "Maximum NUMA Nodes (as a power of 2)"
370         range 1 10
371         default "2"
372         depends on NUMA
373         help
374           Specify the maximum number of NUMA Nodes available on the target
375           system.  Increases memory reserved to accommodate various tables.
376
377 config RISCV_ALTERNATIVE
378         bool
379         depends on !XIP_KERNEL
380         help
381           This Kconfig allows the kernel to automatically patch the
382           errata required by the execution platform at run time. The
383           code patching is performed once in the boot stages. It means
384           that the overhead from this mechanism is just taken once.
385
386 config RISCV_ALTERNATIVE_EARLY
387         bool
388         depends on RISCV_ALTERNATIVE
389         help
390           Allows early patching of the kernel for special errata
391
392 config RISCV_ISA_C
393         bool "Emit compressed instructions when building Linux"
394         default y
395         help
396           Adds "C" to the ISA subsets that the toolchain is allowed to emit
397           when building Linux, which results in compressed instructions in the
398           Linux binary.
399
400           If you don't know what to do here, say Y.
401
402 config RISCV_ISA_SVPBMT
403         bool "SVPBMT extension support"
404         depends on 64BIT && MMU
405         depends on !XIP_KERNEL
406         default y
407         select RISCV_ALTERNATIVE
408         help
409            Adds support to dynamically detect the presence of the SVPBMT
410            ISA-extension (Supervisor-mode: page-based memory types) and
411            enable its usage.
412
413            The memory type for a page contains a combination of attributes
414            that indicate the cacheability, idempotency, and ordering
415            properties for access to that page.
416
417            The SVPBMT extension is only available on 64Bit cpus.
418
419            If you don't know what to do here, say Y.
420
421 config TOOLCHAIN_HAS_ZBB
422         bool
423         default y
424         depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zbb)
425         depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zbb)
426         depends on LLD_VERSION >= 150000 || LD_VERSION >= 23900
427         depends on AS_IS_GNU
428
429 config RISCV_ISA_ZBB
430         bool "Zbb extension support for bit manipulation instructions"
431         depends on TOOLCHAIN_HAS_ZBB
432         depends on !XIP_KERNEL && MMU
433         select RISCV_ALTERNATIVE
434         default y
435         help
436            Adds support to dynamically detect the presence of the ZBB
437            extension (basic bit manipulation) and enable its usage.
438
439            The Zbb extension provides instructions to accelerate a number
440            of bit-specific operations (count bit population, sign extending,
441            bitrotation, etc).
442
443            If you don't know what to do here, say Y.
444
445 config RISCV_ISA_ZICBOM
446         bool "Zicbom extension support for non-coherent DMA operation"
447         depends on !XIP_KERNEL && MMU
448         default y
449         select RISCV_ALTERNATIVE
450         select RISCV_DMA_NONCOHERENT
451         help
452            Adds support to dynamically detect the presence of the ZICBOM
453            extension (Cache Block Management Operations) and enable its
454            usage.
455
456            The Zicbom extension can be used to handle for example
457            non-coherent DMA support on devices that need it.
458
459            If you don't know what to do here, say Y.
460
461 config TOOLCHAIN_HAS_ZIHINTPAUSE
462         bool
463         default y
464         depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zihintpause)
465         depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zihintpause)
466         depends on LLD_VERSION >= 150000 || LD_VERSION >= 23600
467
468 config FPU
469         bool "FPU support"
470         default y
471         help
472           Say N here if you want to disable all floating-point related procedure
473           in the kernel.
474
475           If you don't know what to do here, say Y.
476
477 endmenu # "Platform type"
478
479 menu "Kernel features"
480
481 source "kernel/Kconfig.hz"
482
483 config RISCV_SBI_V01
484         bool "SBI v0.1 support"
485         depends on RISCV_SBI
486         help
487           This config allows kernel to use SBI v0.1 APIs. This will be
488           deprecated in future once legacy M-mode software are no longer in use.
489
490 config RISCV_BOOT_SPINWAIT
491         bool "Spinwait booting method"
492         depends on SMP
493         default y if RISCV_SBI_V01 || RISCV_M_MODE
494         help
495           This enables support for booting Linux via spinwait method. In the
496           spinwait method, all cores randomly jump to Linux. One of the cores
497           gets chosen via lottery and all other keep spinning on a percpu
498           variable. This method cannot support CPU hotplug and sparse hartid
499           scheme. It should be only enabled for M-mode Linux or platforms relying
500           on older firmware without SBI HSM extension. All other platforms should
501           rely on ordered booting via SBI HSM extension which gets chosen
502           dynamically at runtime if the firmware supports it.
503
504           Since spinwait is incompatible with sparse hart IDs, it requires
505           NR_CPUS be large enough to contain the physical hart ID of the first
506           hart to enter Linux.
507
508           If unsure what to do here, say N.
509
510 config KEXEC
511         bool "Kexec system call"
512         depends on MMU
513         select HOTPLUG_CPU if SMP
514         select KEXEC_CORE
515         help
516           kexec is a system call that implements the ability to shutdown your
517           current kernel, and to start another kernel. It is like a reboot
518           but it is independent of the system firmware. And like a reboot
519           you can start any kernel with it, not just Linux.
520
521           The name comes from the similarity to the exec system call.
522
523 config KEXEC_FILE
524         bool "kexec file based systmem call"
525         depends on 64BIT && MMU
526         select HAVE_IMA_KEXEC if IMA
527         select KEXEC_CORE
528         select KEXEC_ELF
529         help
530           This is new version of kexec system call. This system call is
531           file based and takes file descriptors as system call argument
532           for kernel and initramfs as opposed to list of segments as
533           accepted by previous system call.
534
535           If you don't know what to do here, say Y.
536
537 config ARCH_HAS_KEXEC_PURGATORY
538         def_bool KEXEC_FILE
539         depends on CRYPTO=y
540         depends on CRYPTO_SHA256=y
541
542 config CRASH_DUMP
543         bool "Build kdump crash kernel"
544         help
545           Generate crash dump after being started by kexec. This should
546           be normally only set in special crash dump kernels which are
547           loaded in the main kernel with kexec-tools into a specially
548           reserved region and then later executed after a crash by
549           kdump/kexec.
550
551           For more details see Documentation/admin-guide/kdump/kdump.rst
552
553 config COMPAT
554         bool "Kernel support for 32-bit U-mode"
555         default 64BIT
556         depends on 64BIT && MMU
557         help
558           This option enables support for a 32-bit U-mode running under a 64-bit
559           kernel at S-mode. riscv32-specific components such as system calls,
560           the user helper functions (vdso), signal rt_frame functions and the
561           ptrace interface are handled appropriately by the kernel.
562
563           If you want to execute 32-bit userspace applications, say Y.
564
565 endmenu # "Kernel features"
566
567 menu "Boot options"
568
569 config CMDLINE
570         string "Built-in kernel command line"
571         help
572           For most platforms, the arguments for the kernel's command line
573           are provided at run-time, during boot. However, there are cases
574           where either no arguments are being provided or the provided
575           arguments are insufficient or even invalid.
576
577           When that occurs, it is possible to define a built-in command
578           line here and choose how the kernel should use it later on.
579
580 choice
581         prompt "Built-in command line usage" if CMDLINE != ""
582         default CMDLINE_FALLBACK
583         help
584           Choose how the kernel will handle the provided built-in command
585           line.
586
587 config CMDLINE_FALLBACK
588         bool "Use bootloader kernel arguments if available"
589         help
590           Use the built-in command line as fallback in case we get nothing
591           during boot. This is the default behaviour.
592
593 config CMDLINE_EXTEND
594         bool "Extend bootloader kernel arguments"
595         help
596           The command-line arguments provided during boot will be
597           appended to the built-in command line. This is useful in
598           cases where the provided arguments are insufficient and
599           you don't want to or cannot modify them.
600
601 config CMDLINE_FORCE
602         bool "Always use the default kernel command string"
603         help
604           Always use the built-in command line, even if we get one during
605           boot. This is useful in case you need to override the provided
606           command line on systems where you don't have or want control
607           over it.
608
609 endchoice
610
611 config EFI_STUB
612         bool
613
614 config EFI
615         bool "UEFI runtime support"
616         depends on OF && !XIP_KERNEL
617         depends on MMU
618         default y
619         select EFI_GENERIC_STUB
620         select EFI_PARAMS_FROM_FDT
621         select EFI_RUNTIME_WRAPPERS
622         select EFI_STUB
623         select LIBFDT
624         select RISCV_ISA_C
625         select UCS2_STRING
626         help
627           This option provides support for runtime services provided
628           by UEFI firmware (such as non-volatile variables, realtime
629           clock, and platform reset). A UEFI stub is also provided to
630           allow the kernel to be booted as an EFI application. This
631           is only useful on systems that have UEFI firmware.
632
633 config CC_HAVE_STACKPROTECTOR_TLS
634         def_bool $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=tp -mstack-protector-guard-offset=0)
635
636 config STACKPROTECTOR_PER_TASK
637         def_bool y
638         depends on !RANDSTRUCT
639         depends on STACKPROTECTOR && CC_HAVE_STACKPROTECTOR_TLS
640
641 config PHYS_RAM_BASE_FIXED
642         bool "Explicitly specified physical RAM address"
643         depends on NONPORTABLE
644         default n
645
646 config PHYS_RAM_BASE
647         hex "Platform Physical RAM address"
648         depends on PHYS_RAM_BASE_FIXED
649         default "0x80000000"
650         help
651           This is the physical address of RAM in the system. It has to be
652           explicitly specified to run early relocations of read-write data
653           from flash to RAM.
654
655 config XIP_KERNEL
656         bool "Kernel Execute-In-Place from ROM"
657         depends on MMU && SPARSEMEM && NONPORTABLE
658         # This prevents XIP from being enabled by all{yes,mod}config, which
659         # fail to build since XIP doesn't support large kernels.
660         depends on !COMPILE_TEST
661         select PHYS_RAM_BASE_FIXED
662         help
663           Execute-In-Place allows the kernel to run from non-volatile storage
664           directly addressable by the CPU, such as NOR flash. This saves RAM
665           space since the text section of the kernel is not loaded from flash
666           to RAM.  Read-write sections, such as the data section and stack,
667           are still copied to RAM.  The XIP kernel is not compressed since
668           it has to run directly from flash, so it will take more space to
669           store it.  The flash address used to link the kernel object files,
670           and for storing it, is configuration dependent. Therefore, if you
671           say Y here, you must know the proper physical address where to
672           store the kernel image depending on your own flash memory usage.
673
674           Also note that the make target becomes "make xipImage" rather than
675           "make zImage" or "make Image".  The final kernel binary to put in
676           ROM memory will be arch/riscv/boot/xipImage.
677
678           SPARSEMEM is required because the kernel text and rodata that are
679           flash resident are not backed by memmap, then any attempt to get
680           a struct page on those regions will trigger a fault.
681
682           If unsure, say N.
683
684 config XIP_PHYS_ADDR
685         hex "XIP Kernel Physical Location"
686         depends on XIP_KERNEL
687         default "0x21000000"
688         help
689           This is the physical address in your flash memory the kernel will
690           be linked for and stored to.  This address is dependent on your
691           own flash usage.
692
693 endmenu # "Boot options"
694
695 config BUILTIN_DTB
696         bool
697         depends on OF && NONPORTABLE
698         default y if XIP_KERNEL
699
700 config PORTABLE
701         bool
702         default !NONPORTABLE
703         select EFI
704         select MMU
705         select OF
706
707 menu "Power management options"
708
709 source "kernel/power/Kconfig"
710
711 endmenu # "Power management options"
712
713 menu "CPU Power Management"
714
715 source "drivers/cpuidle/Kconfig"
716
717 source "drivers/cpufreq/Kconfig"
718
719 endmenu # "CPU Power Management"
720
721 source "arch/riscv/kvm/Kconfig"