2019-05-19 12:07:45 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
2017-07-11 01:08:08 +00:00
|
|
|
#
|
|
|
|
# For a description of the syntax of this configuration file,
|
2019-06-12 17:52:48 +00:00
|
|
|
# see Documentation/kbuild/kconfig-language.rst.
|
2017-07-11 01:08:08 +00:00
|
|
|
#
|
|
|
|
|
2018-04-27 06:38:23 +00:00
|
|
|
config 64BIT
|
|
|
|
bool
|
|
|
|
|
|
|
|
config 32BIT
|
|
|
|
bool
|
|
|
|
|
2017-07-11 01:08:08 +00:00
|
|
|
config RISCV
|
|
|
|
def_bool y
|
2020-06-09 14:14:48 +00:00
|
|
|
select ARCH_CLOCKSOURCE_INIT
|
2020-06-05 05:15:10 +00:00
|
|
|
select ARCH_SUPPORTS_ATOMIC_RMW
|
2020-12-15 03:10:30 +00:00
|
|
|
select ARCH_SUPPORTS_DEBUG_PAGEALLOC if MMU
|
2020-11-13 06:42:23 +00:00
|
|
|
select ARCH_STACKWALK
|
2019-06-13 07:09:03 +00:00
|
|
|
select ARCH_HAS_BINFMT_FLAT
|
2020-07-14 21:26:11 +00:00
|
|
|
select ARCH_HAS_DEBUG_VM_PGTABLE
|
2020-06-04 20:55:14 +00:00
|
|
|
select ARCH_HAS_DEBUG_VIRTUAL if MMU
|
2020-06-03 23:03:55 +00:00
|
|
|
select ARCH_HAS_DEBUG_WX
|
2021-02-25 07:03:03 +00:00
|
|
|
select ARCH_HAS_FORTIFY_SOURCE
|
2020-06-04 20:55:14 +00:00
|
|
|
select ARCH_HAS_GCOV_PROFILE_ALL
|
|
|
|
select ARCH_HAS_GIGANTIC_PAGE
|
2020-06-26 12:40:56 +00:00
|
|
|
select ARCH_HAS_KCOV
|
2020-06-04 20:55:14 +00:00
|
|
|
select ARCH_HAS_MMIOWB
|
|
|
|
select ARCH_HAS_PTE_SPECIAL
|
|
|
|
select ARCH_HAS_SET_DIRECT_MAP
|
|
|
|
select ARCH_HAS_SET_MEMORY
|
|
|
|
select ARCH_HAS_STRICT_KERNEL_RWX if MMU
|
2021-03-07 02:24:46 +00:00
|
|
|
select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
|
2020-06-23 05:36:59 +00:00
|
|
|
select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
|
|
|
|
select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
|
2020-06-04 20:55:14 +00:00
|
|
|
select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
|
2017-07-11 01:08:08 +00:00
|
|
|
select ARCH_WANT_FRAME_POINTERS
|
2020-06-04 20:55:14 +00:00
|
|
|
select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
|
2017-07-11 01:08:08 +00:00
|
|
|
select CLONE_BACKWARDS
|
2020-09-14 16:56:30 +00:00
|
|
|
select CLINT_TIMER if !MMU
|
2017-07-11 01:08:08 +00:00
|
|
|
select COMMON_CLK
|
2020-06-04 20:55:14 +00:00
|
|
|
select EDAC_SUPPORT
|
|
|
|
select GENERIC_ARCH_TOPOLOGY if SMP
|
|
|
|
select GENERIC_ATOMIC64 if !64BIT
|
2021-03-07 02:24:46 +00:00
|
|
|
select GENERIC_CLOCKEVENTS_BROADCAST if SMP
|
2020-09-17 22:37:11 +00:00
|
|
|
select GENERIC_EARLY_IOREMAP
|
2020-06-09 14:14:48 +00:00
|
|
|
select GENERIC_GETTIMEOFDAY if HAVE_GENERIC_VDSO
|
2020-06-04 20:55:14 +00:00
|
|
|
select GENERIC_IOREMAP
|
|
|
|
select GENERIC_IRQ_MULTI_HANDLER
|
2017-07-11 01:08:08 +00:00
|
|
|
select GENERIC_IRQ_SHOW
|
2020-07-09 18:51:17 +00:00
|
|
|
select GENERIC_LIB_DEVMEM_IS_ALLOWED
|
2017-07-11 01:08:08 +00:00
|
|
|
select GENERIC_PCI_IOMAP
|
2020-06-04 20:55:14 +00:00
|
|
|
select GENERIC_PTDUMP if MMU
|
2018-12-04 10:29:51 +00:00
|
|
|
select GENERIC_SCHED_CLOCK
|
2020-06-04 20:55:14 +00:00
|
|
|
select GENERIC_SMP_IDLE_THREAD
|
2019-10-28 12:10:41 +00:00
|
|
|
select GENERIC_STRNCPY_FROM_USER if MMU
|
|
|
|
select GENERIC_STRNLEN_USER if MMU
|
2020-06-09 14:14:48 +00:00
|
|
|
select GENERIC_TIME_VSYSCALL if MMU && 64BIT
|
2020-06-01 09:15:40 +00:00
|
|
|
select HANDLE_DOMAIN_IRQ
|
2018-10-29 10:48:53 +00:00
|
|
|
select HAVE_ARCH_AUDITSYSCALL
|
2020-07-14 07:40:44 +00:00
|
|
|
select HAVE_ARCH_JUMP_LABEL
|
|
|
|
select HAVE_ARCH_JUMP_LABEL_RELATIVE
|
2020-06-04 20:55:14 +00:00
|
|
|
select HAVE_ARCH_KASAN if MMU && 64BIT
|
2021-01-16 05:58:35 +00:00
|
|
|
select HAVE_ARCH_KASAN_VMALLOC if MMU && 64BIT
|
2020-06-04 20:55:14 +00:00
|
|
|
select HAVE_ARCH_KGDB
|
|
|
|
select HAVE_ARCH_KGDB_QXFER_PKT
|
|
|
|
select HAVE_ARCH_MMAP_RND_BITS if MMU
|
2019-10-05 00:12:22 +00:00
|
|
|
select HAVE_ARCH_SECCOMP_FILTER
|
2020-06-04 20:55:14 +00:00
|
|
|
select HAVE_ARCH_TRACEHOOK
|
2019-08-19 05:54:20 +00:00
|
|
|
select HAVE_ASM_MODVERSIONS
|
2020-06-24 09:03:16 +00:00
|
|
|
select HAVE_CONTEXT_TRACKING
|
2020-06-27 10:50:50 +00:00
|
|
|
select HAVE_DEBUG_KMEMLEAK
|
2019-10-28 12:10:41 +00:00
|
|
|
select HAVE_DMA_CONTIGUOUS if MMU
|
2020-06-04 20:55:14 +00:00
|
|
|
select HAVE_EBPF_JIT if MMU
|
2020-12-17 16:01:45 +00:00
|
|
|
select HAVE_FUNCTION_ERROR_INJECTION
|
RISC-V: Add futex support.
Here is an attempt to add the missing futex support. I started with the MIPS
version of futex.h and modified it until I got it working. I tested it on
a HiFive Unleashed running Fedora Core 29 using the fc29 4.15 version of the
kernel. This was tested against the glibc testsuite, where it fixes 14 nptl
related testsuite failures. That unfortunately only tests the cmpxchg support,
so I also used the testcase at the end of
https://lwn.net/Articles/148830/
which tests the atomic_op functionality, except that it doesn't verify that
the operations are atomic, which they obviously are. This testcase runs
successfully with the patch and fails without it.
I'm not a kernel expert, so there could be details I got wrong here. I wasn't
sure about the memory model support, so I used aqrl which seemed safest, and
didn't add fences which seemed unnecessary. I'm not sure about the copyright
statements, I left in Ralf Baechle's line because I started with his code.
Checkpatch reports some style problems, but it is the same style as the MIPS
futex.h, and the uses of ENOSYS appear correct even though it complains about
them. I don't know if any of that matters.
This patch was tested on qemu with the glibc nptl/tst-cond-except
testcase, and the wake_op testcase from above.
Signed-off-by: Jim Wilson <jimw@sifive.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
2018-10-16 21:42:59 +00:00
|
|
|
select HAVE_FUTEX_CMPXCHG if FUTEX
|
2020-06-26 12:40:56 +00:00
|
|
|
select HAVE_GCC_PLUGINS
|
2020-06-09 14:14:48 +00:00
|
|
|
select HAVE_GENERIC_VDSO if MMU && 64BIT
|
2020-10-28 04:28:42 +00:00
|
|
|
select HAVE_IRQ_TIME_ACCOUNTING
|
2020-12-17 16:01:42 +00:00
|
|
|
select HAVE_KPROBES
|
2020-12-17 16:01:43 +00:00
|
|
|
select HAVE_KPROBES_ON_FTRACE
|
2020-12-17 16:01:42 +00:00
|
|
|
select HAVE_KRETPROBES
|
2020-06-04 20:55:14 +00:00
|
|
|
select HAVE_PCI
|
2018-04-19 23:27:49 +00:00
|
|
|
select HAVE_PERF_EVENTS
|
2019-09-05 03:46:35 +00:00
|
|
|
select HAVE_PERF_REGS
|
|
|
|
select HAVE_PERF_USER_STACK_DUMP
|
2020-12-17 16:01:37 +00:00
|
|
|
select HAVE_REGS_AND_STACK_ACCESS_API
|
2020-07-10 16:19:57 +00:00
|
|
|
select HAVE_STACKPROTECTOR
|
2018-12-06 15:26:35 +00:00
|
|
|
select HAVE_SYSCALL_TRACEPOINTS
|
2017-07-11 01:08:08 +00:00
|
|
|
select IRQ_DOMAIN
|
|
|
|
select MODULES_USE_ELF_RELA if MODULES
|
RISC-V: Support MODULE_SECTIONS mechanism on RV32
This patch supports dynamic generate got and plt sections mechanism on
rv32. It contains the modification as follows:
- Always enable MODULE_SECTIONS (both rv64 and rv32)
- Change the fixed size type.
This patch had been tested by following modules:
btrfs 6795991 0 - Live 0xa544b000
test_static_keys 17304 0 - Live 0xa28be000
zstd_compress 1198986 1 btrfs, Live 0xa2a25000
zstd_decompress 608112 1 btrfs, Live 0xa24e7000
lzo 8787 0 - Live 0xa2049000
xor 27461 1 btrfs, Live 0xa2041000
zram 78849 0 - Live 0xa2276000
netdevsim 55909 0 - Live 0xa202d000
tun 211534 0 - Live 0xa21b5000
fuse 566049 0 - Live 0xa25fb000
nfs_layout_flexfiles 192597 0 - Live 0xa229b000
ramoops 74895 0 - Live 0xa2019000
xfs 3973221 0 - Live 0xa507f000
libcrc32c 3053 2 btrfs,xfs, Live 0xa34af000
lzo_compress 17302 2 btrfs,lzo, Live 0xa347d000
lzo_decompress 7178 2 btrfs,lzo, Live 0xa3451000
raid6_pq 142086 1 btrfs, Live 0xa33a4000
reed_solomon 31022 1 ramoops, Live 0xa31eb000
test_bitmap 3734 0 - Live 0xa31af000
test_bpf 1588736 0 - Live 0xa2c11000
test_kmod 41161 0 - Live 0xa29f8000
test_module 1356 0 - Live 0xa299e000
test_printf 6024 0 [permanent], Live 0xa2971000
test_static_key_base 5797 1 test_static_keys, Live 0xa2931000
test_user_copy 4382 0 - Live 0xa28c9000
xxhash 70501 2 zstd_compress,zstd_decompress, Live 0xa2055000
Signed-off-by: Zong Li <zong@andestech.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
2018-12-07 09:02:16 +00:00
|
|
|
select MODULE_SECTIONS if MODULES
|
2020-06-04 20:55:14 +00:00
|
|
|
select OF
|
|
|
|
select OF_EARLY_FLATTREE
|
|
|
|
select OF_IRQ
|
2018-11-15 19:05:33 +00:00
|
|
|
select PCI_DOMAINS_GENERIC if PCI
|
2018-11-15 19:05:32 +00:00
|
|
|
select PCI_MSI if PCI
|
2020-06-01 09:15:43 +00:00
|
|
|
select RISCV_INTC
|
2020-08-17 12:42:50 +00:00
|
|
|
select RISCV_TIMER if RISCV_SBI
|
2019-08-28 21:40:54 +00:00
|
|
|
select SPARSEMEM_STATIC if 32BIT
|
2020-06-04 20:55:14 +00:00
|
|
|
select SPARSE_IRQ
|
|
|
|
select SYSCTL_EXCEPTION_TRACE
|
|
|
|
select THREAD_INFO_IN_TASK
|
2020-09-07 05:58:22 +00:00
|
|
|
select UACCESS_MEMCPY if !MMU
|
2019-09-23 22:39:21 +00:00
|
|
|
|
|
|
|
config ARCH_MMAP_RND_BITS_MIN
|
|
|
|
default 18 if 64BIT
|
|
|
|
default 8
|
|
|
|
|
|
|
|
# max bits determined by the following formula:
|
|
|
|
# VA_BITS - PAGE_SHIFT - 3
|
|
|
|
config ARCH_MMAP_RND_BITS_MAX
|
|
|
|
default 24 if 64BIT # SV39 based
|
|
|
|
default 17
|
2017-07-11 01:08:08 +00:00
|
|
|
|
2019-10-28 12:10:32 +00:00
|
|
|
# set if we run in machine mode, cleared if we run in supervisor mode
|
|
|
|
config RISCV_M_MODE
|
|
|
|
bool
|
2019-10-28 12:10:41 +00:00
|
|
|
default !MMU
|
2019-10-28 12:10:32 +00:00
|
|
|
|
2019-10-28 12:10:33 +00:00
|
|
|
# set if we are running in S-mode and can use SBI calls
|
|
|
|
config RISCV_SBI
|
|
|
|
bool
|
|
|
|
depends on !RISCV_M_MODE
|
|
|
|
default y
|
|
|
|
|
2017-07-11 01:08:08 +00:00
|
|
|
config MMU
|
2019-10-28 12:10:41 +00:00
|
|
|
bool "MMU-based Paged Memory Management Support"
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
Select if you want MMU-based virtualised addressing space
|
|
|
|
support by paged memory management. If unsure, say 'Y'.
|
2017-07-11 01:08:08 +00:00
|
|
|
|
2018-01-16 08:37:50 +00:00
|
|
|
config ZONE_DMA32
|
|
|
|
bool
|
2018-04-27 06:41:09 +00:00
|
|
|
default y if 64BIT
|
2018-01-16 08:37:50 +00:00
|
|
|
|
2019-08-28 21:40:54 +00:00
|
|
|
config VA_BITS
|
|
|
|
int
|
|
|
|
default 32 if 32BIT
|
|
|
|
default 39 if 64BIT
|
|
|
|
|
|
|
|
config PA_BITS
|
|
|
|
int
|
|
|
|
default 34 if 32BIT
|
|
|
|
default 56 if 64BIT
|
|
|
|
|
2017-07-11 01:08:08 +00:00
|
|
|
config PAGE_OFFSET
|
|
|
|
hex
|
2021-01-11 23:45:04 +00:00
|
|
|
default 0xC0000000 if 32BIT && MAXPHYSMEM_1GB
|
2019-10-28 12:10:41 +00:00
|
|
|
default 0x80000000 if 64BIT && !MMU
|
2017-07-11 01:08:08 +00:00
|
|
|
default 0xffffffff80000000 if 64BIT && MAXPHYSMEM_2GB
|
|
|
|
default 0xffffffe000000000 if 64BIT && MAXPHYSMEM_128GB
|
|
|
|
|
2019-08-28 21:40:54 +00:00
|
|
|
config ARCH_FLATMEM_ENABLE
|
2020-11-19 00:38:29 +00:00
|
|
|
def_bool !NUMA
|
2019-08-28 21:40:54 +00:00
|
|
|
|
|
|
|
config ARCH_SPARSEMEM_ENABLE
|
|
|
|
def_bool y
|
2020-02-12 10:34:24 +00:00
|
|
|
depends on MMU
|
2019-08-28 21:40:54 +00:00
|
|
|
select SPARSEMEM_VMEMMAP_ENABLE
|
|
|
|
|
|
|
|
config ARCH_SELECT_MEMORY_MODEL
|
|
|
|
def_bool ARCH_SPARSEMEM_ENABLE
|
|
|
|
|
2019-05-26 12:50:38 +00:00
|
|
|
config ARCH_WANT_GENERAL_HUGETLB
|
|
|
|
def_bool y
|
|
|
|
|
2020-12-17 16:01:44 +00:00
|
|
|
config ARCH_SUPPORTS_UPROBES
|
|
|
|
def_bool y
|
|
|
|
|
2019-05-26 12:50:38 +00:00
|
|
|
config SYS_SUPPORTS_HUGETLBFS
|
2020-05-11 02:19:58 +00:00
|
|
|
depends on MMU
|
2019-05-26 12:50:38 +00:00
|
|
|
def_bool y
|
|
|
|
|
2017-07-11 01:08:08 +00:00
|
|
|
config STACKTRACE_SUPPORT
|
|
|
|
def_bool y
|
|
|
|
|
2017-12-18 09:52:48 +00:00
|
|
|
config TRACE_IRQFLAGS_SUPPORT
|
|
|
|
def_bool y
|
|
|
|
|
2017-07-11 01:08:08 +00:00
|
|
|
config GENERIC_BUG
|
|
|
|
def_bool y
|
|
|
|
depends on BUG
|
|
|
|
select GENERIC_BUG_RELATIVE_POINTERS if 64BIT
|
|
|
|
|
|
|
|
config GENERIC_BUG_RELATIVE_POINTERS
|
|
|
|
bool
|
|
|
|
|
|
|
|
config GENERIC_CALIBRATE_DELAY
|
|
|
|
def_bool y
|
|
|
|
|
|
|
|
config GENERIC_CSUM
|
|
|
|
def_bool y
|
|
|
|
|
|
|
|
config GENERIC_HWEIGHT
|
|
|
|
def_bool y
|
|
|
|
|
2019-01-07 15:27:01 +00:00
|
|
|
config FIX_EARLYCON_MEM
|
2019-12-17 11:15:16 +00:00
|
|
|
def_bool MMU
|
2019-01-07 15:27:01 +00:00
|
|
|
|
2017-07-11 01:08:08 +00:00
|
|
|
config PGTABLE_LEVELS
|
|
|
|
int
|
|
|
|
default 3 if 64BIT
|
|
|
|
default 2
|
|
|
|
|
2020-06-27 13:57:08 +00:00
|
|
|
config LOCKDEP_SUPPORT
|
|
|
|
def_bool y
|
|
|
|
|
2019-06-17 19:29:48 +00:00
|
|
|
source "arch/riscv/Kconfig.socs"
|
|
|
|
|
2017-07-11 01:08:08 +00:00
|
|
|
menu "Platform type"
|
|
|
|
|
|
|
|
choice
|
|
|
|
prompt "Base ISA"
|
|
|
|
default ARCH_RV64I
|
|
|
|
help
|
2019-01-08 19:45:57 +00:00
|
|
|
This selects the base ISA that this kernel will target and must match
|
2017-07-11 01:08:08 +00:00
|
|
|
the target platform.
|
|
|
|
|
|
|
|
config ARCH_RV32I
|
|
|
|
bool "RV32I"
|
|
|
|
select 32BIT
|
2018-04-11 07:50:17 +00:00
|
|
|
select GENERIC_LIB_ASHLDI3
|
|
|
|
select GENERIC_LIB_ASHRDI3
|
|
|
|
select GENERIC_LIB_LSHRDI3
|
2018-06-25 08:49:38 +00:00
|
|
|
select GENERIC_LIB_UCMPDI2
|
2019-10-28 12:10:41 +00:00
|
|
|
select MMU
|
2017-07-11 01:08:08 +00:00
|
|
|
|
|
|
|
config ARCH_RV64I
|
|
|
|
bool "RV64I"
|
|
|
|
select 64BIT
|
2019-11-08 12:22:27 +00:00
|
|
|
select ARCH_SUPPORTS_INT128 if CC_HAS_INT128 && GCC_VERSION >= 50000
|
2019-10-28 12:10:41 +00:00
|
|
|
select HAVE_DYNAMIC_FTRACE if MMU
|
|
|
|
select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
|
2020-06-04 20:55:14 +00:00
|
|
|
select HAVE_FTRACE_MCOUNT_RECORD
|
|
|
|
select HAVE_FUNCTION_GRAPH_TRACER
|
|
|
|
select HAVE_FUNCTION_TRACER
|
2019-10-28 12:10:41 +00:00
|
|
|
select SWIOTLB if MMU
|
2017-07-11 01:08:08 +00:00
|
|
|
|
|
|
|
endchoice
|
|
|
|
|
|
|
|
# We must be able to map all physical memory into the kernel, but the compiler
|
|
|
|
# is still a bit more efficient when generating code if it's setup in a manner
|
|
|
|
# such that it can only map 2GiB of memory.
|
|
|
|
choice
|
|
|
|
prompt "Kernel Code Model"
|
|
|
|
default CMODEL_MEDLOW if 32BIT
|
|
|
|
default CMODEL_MEDANY if 64BIT
|
|
|
|
|
|
|
|
config CMODEL_MEDLOW
|
|
|
|
bool "medium low code model"
|
|
|
|
config CMODEL_MEDANY
|
|
|
|
bool "medium any code model"
|
|
|
|
endchoice
|
|
|
|
|
2018-03-15 08:50:41 +00:00
|
|
|
config MODULE_SECTIONS
|
|
|
|
bool
|
|
|
|
select HAVE_MOD_ARCH_SPECIFIC
|
|
|
|
|
2017-07-11 01:08:08 +00:00
|
|
|
choice
|
|
|
|
prompt "Maximum Physical Memory"
|
2021-01-11 23:45:04 +00:00
|
|
|
default MAXPHYSMEM_1GB if 32BIT
|
2017-07-11 01:08:08 +00:00
|
|
|
default MAXPHYSMEM_2GB if 64BIT && CMODEL_MEDLOW
|
|
|
|
default MAXPHYSMEM_128GB if 64BIT && CMODEL_MEDANY
|
|
|
|
|
2021-01-11 23:45:04 +00:00
|
|
|
config MAXPHYSMEM_1GB
|
2021-01-29 19:00:38 +00:00
|
|
|
depends on 32BIT
|
2021-01-11 23:45:04 +00:00
|
|
|
bool "1GiB"
|
2017-07-11 01:08:08 +00:00
|
|
|
config MAXPHYSMEM_2GB
|
2021-01-29 19:00:38 +00:00
|
|
|
depends on 64BIT && CMODEL_MEDLOW
|
2017-07-11 01:08:08 +00:00
|
|
|
bool "2GiB"
|
|
|
|
config MAXPHYSMEM_128GB
|
|
|
|
depends on 64BIT && CMODEL_MEDANY
|
|
|
|
bool "128GiB"
|
|
|
|
endchoice
|
|
|
|
|
|
|
|
|
|
|
|
config SMP
|
|
|
|
bool "Symmetric Multi-Processing"
|
|
|
|
help
|
|
|
|
This enables support for systems with more than one CPU. If
|
|
|
|
you say N here, the kernel will run on single and
|
|
|
|
multiprocessor machines, but will use only one CPU of a
|
|
|
|
multiprocessor machine. If you say Y here, the kernel will run
|
|
|
|
on many, but not all, single processor machines. On a single
|
|
|
|
processor machine, the kernel will run faster if you say N
|
|
|
|
here.
|
|
|
|
|
|
|
|
If you don't know what to do here, say N.
|
|
|
|
|
|
|
|
config NR_CPUS
|
|
|
|
int "Maximum number of CPUs (2-32)"
|
|
|
|
range 2 32
|
|
|
|
depends on SMP
|
|
|
|
default "8"
|
|
|
|
|
2020-03-18 01:11:44 +00:00
|
|
|
config HOTPLUG_CPU
|
|
|
|
bool "Support for hot-pluggable CPUs"
|
|
|
|
depends on SMP
|
|
|
|
select GENERIC_IRQ_MIGRATION
|
|
|
|
help
|
|
|
|
|
|
|
|
Say Y here to experiment with turning CPUs off and on. CPUs
|
|
|
|
can be controlled through /sys/devices/system/cpu.
|
|
|
|
|
|
|
|
Say N if you want to disable CPU hotplug.
|
|
|
|
|
2017-07-11 01:08:08 +00:00
|
|
|
choice
|
|
|
|
prompt "CPU Tuning"
|
|
|
|
default TUNE_GENERIC
|
|
|
|
|
|
|
|
config TUNE_GENERIC
|
|
|
|
bool "generic"
|
|
|
|
|
|
|
|
endchoice
|
|
|
|
|
2020-11-19 00:38:29 +00:00
|
|
|
# Common NUMA Features
|
|
|
|
config NUMA
|
|
|
|
bool "NUMA Memory Allocation and Scheduler Support"
|
2021-02-26 20:21:15 +00:00
|
|
|
depends on SMP
|
2020-11-19 00:38:29 +00:00
|
|
|
select GENERIC_ARCH_NUMA
|
|
|
|
select OF_NUMA
|
|
|
|
select ARCH_SUPPORTS_NUMA_BALANCING
|
|
|
|
help
|
|
|
|
Enable NUMA (Non-Uniform Memory Access) support.
|
|
|
|
|
|
|
|
The kernel will try to allocate memory used by a CPU on the
|
|
|
|
local memory of the CPU and add some more NUMA awareness to the kernel.
|
|
|
|
|
|
|
|
config NODES_SHIFT
|
|
|
|
int "Maximum NUMA Nodes (as a power of 2)"
|
|
|
|
range 1 10
|
|
|
|
default "2"
|
|
|
|
depends on NEED_MULTIPLE_NODES
|
|
|
|
help
|
|
|
|
Specify the maximum number of NUMA Nodes available on the target
|
|
|
|
system. Increases memory reserved to accommodate various tables.
|
|
|
|
|
|
|
|
config USE_PERCPU_NUMA_NODE_ID
|
|
|
|
def_bool y
|
|
|
|
depends on NUMA
|
|
|
|
|
|
|
|
config NEED_PER_CPU_EMBED_FIRST_CHUNK
|
|
|
|
def_bool y
|
|
|
|
depends on NUMA
|
|
|
|
|
2017-07-11 01:08:08 +00:00
|
|
|
config RISCV_ISA_C
|
|
|
|
bool "Emit compressed instructions when building Linux"
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
Adds "C" to the ISA subsets that the toolchain is allowed to emit
|
|
|
|
when building Linux, which results in compressed instructions in the
|
|
|
|
Linux binary.
|
|
|
|
|
|
|
|
If you don't know what to do here, say Y.
|
|
|
|
|
2018-04-19 23:27:49 +00:00
|
|
|
menu "supported PMU type"
|
|
|
|
depends on PERF_EVENTS
|
|
|
|
|
|
|
|
config RISCV_BASE_PMU
|
|
|
|
bool "Base Performance Monitoring Unit"
|
|
|
|
def_bool y
|
|
|
|
help
|
|
|
|
A base PMU that serves as a reference implementation and has limited
|
|
|
|
feature of perf. It can run on any RISC-V machines so serves as the
|
|
|
|
fallback, but this option can also be disable to reduce kernel size.
|
|
|
|
|
|
|
|
endmenu
|
|
|
|
|
2018-10-09 02:18:33 +00:00
|
|
|
config FPU
|
|
|
|
bool "FPU support"
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
Say N here if you want to disable all floating-point related procedure
|
|
|
|
in the kernel.
|
|
|
|
|
|
|
|
If you don't know what to do here, say Y.
|
|
|
|
|
2017-07-11 01:08:08 +00:00
|
|
|
endmenu
|
|
|
|
|
2018-09-19 22:48:15 +00:00
|
|
|
menu "Kernel features"
|
2017-07-11 01:08:08 +00:00
|
|
|
|
|
|
|
source "kernel/Kconfig.hz"
|
|
|
|
|
2020-03-18 01:11:37 +00:00
|
|
|
config RISCV_SBI_V01
|
|
|
|
bool "SBI v0.1 support"
|
|
|
|
default y
|
|
|
|
depends on RISCV_SBI
|
|
|
|
help
|
|
|
|
This config allows kernel to use SBI v0.1 APIs. This will be
|
|
|
|
deprecated in future once legacy M-mode software are no longer in use.
|
2017-07-11 01:08:08 +00:00
|
|
|
endmenu
|
|
|
|
|
2018-09-19 22:48:15 +00:00
|
|
|
menu "Boot options"
|
|
|
|
|
2018-11-18 00:06:56 +00:00
|
|
|
config CMDLINE
|
|
|
|
string "Built-in kernel command line"
|
2018-09-19 22:48:15 +00:00
|
|
|
help
|
2018-11-18 00:06:56 +00:00
|
|
|
For most platforms, the arguments for the kernel's command line
|
|
|
|
are provided at run-time, during boot. However, there are cases
|
|
|
|
where either no arguments are being provided or the provided
|
|
|
|
arguments are insufficient or even invalid.
|
2018-09-19 22:48:15 +00:00
|
|
|
|
2018-11-18 00:06:56 +00:00
|
|
|
When that occurs, it is possible to define a built-in command
|
|
|
|
line here and choose how the kernel should use it later on.
|
2018-09-19 22:48:15 +00:00
|
|
|
|
2018-11-18 00:06:56 +00:00
|
|
|
choice
|
|
|
|
prompt "Built-in command line usage" if CMDLINE != ""
|
|
|
|
default CMDLINE_FALLBACK
|
|
|
|
help
|
|
|
|
Choose how the kernel will handle the provided built-in command
|
|
|
|
line.
|
2018-09-19 22:48:15 +00:00
|
|
|
|
2018-11-18 00:06:56 +00:00
|
|
|
config CMDLINE_FALLBACK
|
|
|
|
bool "Use bootloader kernel arguments if available"
|
2018-09-19 22:48:15 +00:00
|
|
|
help
|
2018-11-18 00:06:56 +00:00
|
|
|
Use the built-in command line as fallback in case we get nothing
|
|
|
|
during boot. This is the default behaviour.
|
|
|
|
|
|
|
|
config CMDLINE_EXTEND
|
|
|
|
bool "Extend bootloader kernel arguments"
|
|
|
|
help
|
|
|
|
The command-line arguments provided during boot will be
|
|
|
|
appended to the built-in command line. This is useful in
|
|
|
|
cases where the provided arguments are insufficient and
|
|
|
|
you don't want to or cannot modify them.
|
|
|
|
|
2018-09-19 22:48:15 +00:00
|
|
|
|
|
|
|
config CMDLINE_FORCE
|
2018-11-18 00:06:56 +00:00
|
|
|
bool "Always use the default kernel command string"
|
2018-09-19 22:48:15 +00:00
|
|
|
help
|
2018-11-18 00:06:56 +00:00
|
|
|
Always use the built-in command line, even if we get one during
|
|
|
|
boot. This is useful in case you need to override the provided
|
|
|
|
command line on systems where you don't have or want control
|
|
|
|
over it.
|
2018-09-19 22:48:15 +00:00
|
|
|
|
2018-11-18 00:06:56 +00:00
|
|
|
endchoice
|
2018-09-19 22:48:15 +00:00
|
|
|
|
2020-09-17 22:37:14 +00:00
|
|
|
config EFI_STUB
|
|
|
|
bool
|
|
|
|
|
|
|
|
config EFI
|
|
|
|
bool "UEFI runtime support"
|
|
|
|
depends on OF
|
|
|
|
select LIBFDT
|
|
|
|
select UCS2_STRING
|
|
|
|
select EFI_PARAMS_FROM_FDT
|
|
|
|
select EFI_STUB
|
|
|
|
select EFI_GENERIC_STUB
|
2020-09-17 22:37:15 +00:00
|
|
|
select EFI_RUNTIME_WRAPPERS
|
2020-09-17 22:37:14 +00:00
|
|
|
select RISCV_ISA_C
|
2020-09-17 22:37:15 +00:00
|
|
|
depends on MMU
|
2020-09-17 22:37:14 +00:00
|
|
|
default y
|
|
|
|
help
|
|
|
|
This option provides support for runtime services provided
|
|
|
|
by UEFI firmware (such as non-volatile variables, realtime
|
|
|
|
clock, and platform reset). A UEFI stub is also provided to
|
|
|
|
allow the kernel to be booted as an EFI application. This
|
|
|
|
is only useful on systems that have UEFI firmware.
|
|
|
|
|
riscv: Enable per-task stack canaries
This enables the use of per-task stack canary values if GCC has
support for emitting the stack canary reference relative to the
value of tp, which holds the task struct pointer in the riscv
kernel.
After compare arm64 and x86 implementations, seems arm64's is more
flexible and readable. The key point is how gcc get the offset of
stack_canary from gs/el0_sp.
x86: Use a fix offset from gs, not flexible.
struct fixed_percpu_data {
/*
* GCC hardcodes the stack canary as %gs:40. Since the
* irq_stack is the object at %gs:0, we reserve the bottom
* 48 bytes of the irq stack for the canary.
*/
char gs_base[40]; // :(
unsigned long stack_canary;
};
arm64: Use -mstack-protector-guard-offset & guard-reg
gcc options:
-mstack-protector-guard=sysreg
-mstack-protector-guard-reg=sp_el0
-mstack-protector-guard-offset=xxx
riscv: Use -mstack-protector-guard-offset & guard-reg
gcc options:
-mstack-protector-guard=tls
-mstack-protector-guard-reg=tp
-mstack-protector-guard-offset=xxx
GCC's implementation has been merged:
commit c931e8d5a96463427040b0d11f9c4352ac22b2b0
Author: Cooper Qu <cooper.qu@linux.alibaba.com>
Date: Mon Jul 13 16:15:08 2020 +0800
RISC-V: Add support for TLS stack protector canary access
In the end, these codes are inserted by gcc before return:
* 0xffffffe00020b396 <+120>: ld a5,1008(tp) # 0x3f0
* 0xffffffe00020b39a <+124>: xor a5,a5,a4
* 0xffffffe00020b39c <+126>: mv a0,s5
* 0xffffffe00020b39e <+128>: bnez a5,0xffffffe00020b61c <_do_fork+766>
0xffffffe00020b3a2 <+132>: ld ra,136(sp)
0xffffffe00020b3a4 <+134>: ld s0,128(sp)
0xffffffe00020b3a6 <+136>: ld s1,120(sp)
0xffffffe00020b3a8 <+138>: ld s2,112(sp)
0xffffffe00020b3aa <+140>: ld s3,104(sp)
0xffffffe00020b3ac <+142>: ld s4,96(sp)
0xffffffe00020b3ae <+144>: ld s5,88(sp)
0xffffffe00020b3b0 <+146>: ld s6,80(sp)
0xffffffe00020b3b2 <+148>: ld s7,72(sp)
0xffffffe00020b3b4 <+150>: addi sp,sp,144
0xffffffe00020b3b6 <+152>: ret
...
* 0xffffffe00020b61c <+766>: auipc ra,0x7f8
* 0xffffffe00020b620 <+770>: jalr -1764(ra) # 0xffffffe000a02f38 <__stack_chk_fail>
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Signed-off-by: Cooper Qu <cooper.qu@linux.alibaba.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
2020-12-17 16:29:18 +00:00
|
|
|
config CC_HAVE_STACKPROTECTOR_TLS
|
|
|
|
def_bool $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=tp -mstack-protector-guard-offset=0)
|
|
|
|
|
|
|
|
config STACKPROTECTOR_PER_TASK
|
|
|
|
def_bool y
|
|
|
|
depends on STACKPROTECTOR && CC_HAVE_STACKPROTECTOR_TLS
|
|
|
|
|
2018-09-19 22:48:15 +00:00
|
|
|
endmenu
|
|
|
|
|
2020-04-14 04:43:24 +00:00
|
|
|
config BUILTIN_DTB
|
|
|
|
def_bool n
|
|
|
|
depends on OF
|
|
|
|
|
2017-07-11 01:08:08 +00:00
|
|
|
menu "Power management options"
|
|
|
|
|
2018-12-11 11:01:04 +00:00
|
|
|
source "kernel/power/Kconfig"
|
2017-07-11 01:08:08 +00:00
|
|
|
|
|
|
|
endmenu
|
2020-09-17 22:37:14 +00:00
|
|
|
|
|
|
|
source "drivers/firmware/Kconfig"
|