riscv: Implement thread_struct whitelist for hardened usercopy
[linux-2.6-microblaze.git] / arch / riscv / Kconfig
index 18ec0f9..1af859b 100644 (file)
@@ -26,8 +26,8 @@ config RISCV
        select ARCH_HAS_KCOV
        select ARCH_HAS_MMIOWB
        select ARCH_HAS_PTE_SPECIAL
-       select ARCH_HAS_SET_DIRECT_MAP
-       select ARCH_HAS_SET_MEMORY
+       select ARCH_HAS_SET_DIRECT_MAP if MMU
+       select ARCH_HAS_SET_MEMORY if MMU
        select ARCH_HAS_STRICT_KERNEL_RWX if MMU && !XIP_KERNEL
        select ARCH_HAS_STRICT_MODULE_RWX if MMU && !XIP_KERNEL
        select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
@@ -65,11 +65,15 @@ config RISCV
        select HAVE_ARCH_JUMP_LABEL_RELATIVE if !XIP_KERNEL
        select HAVE_ARCH_KASAN if MMU && 64BIT
        select HAVE_ARCH_KASAN_VMALLOC if MMU && 64BIT
+       select HAVE_ARCH_KFENCE if MMU && 64BIT
        select HAVE_ARCH_KGDB if !XIP_KERNEL
        select HAVE_ARCH_KGDB_QXFER_PKT
        select HAVE_ARCH_MMAP_RND_BITS if MMU
        select HAVE_ARCH_SECCOMP_FILTER
        select HAVE_ARCH_TRACEHOOK
+       select HAVE_ARCH_TRANSPARENT_HUGEPAGE if 64BIT && MMU
+       select HAVE_ARCH_THREAD_STRUCT_WHITELIST
+       select HAVE_ARCH_VMAP_STACK if MMU && 64BIT
        select HAVE_ASM_MODVERSIONS
        select HAVE_CONTEXT_TRACKING
        select HAVE_DEBUG_KMEMLEAK
@@ -83,11 +87,14 @@ config RISCV
        select HAVE_KPROBES if !XIP_KERNEL
        select HAVE_KPROBES_ON_FTRACE if !XIP_KERNEL
        select HAVE_KRETPROBES if !XIP_KERNEL
+       select HAVE_MOVE_PMD
+       select HAVE_MOVE_PUD
        select HAVE_PCI
        select HAVE_PERF_EVENTS
        select HAVE_PERF_REGS
        select HAVE_PERF_USER_STACK_DUMP
        select HAVE_REGS_AND_STACK_ACCESS_API
+       select HAVE_FUNCTION_ARG_ACCESS_API
        select HAVE_STACKPROTECTOR
        select HAVE_SYSCALL_TRACEPOINTS
        select IRQ_DOMAIN
@@ -104,6 +111,7 @@ config RISCV
        select SYSCTL_EXCEPTION_TRACE
        select THREAD_INFO_IN_TASK
        select UACCESS_MEMCPY if !MMU
+       select ZONE_DMA32 if 64BIT
 
 config ARCH_MMAP_RND_BITS_MIN
        default 18 if 64BIT
@@ -133,10 +141,6 @@ config MMU
          Select if you want MMU-based virtualised addressing space
          support by paged memory management. If unsure, say 'Y'.
 
-config ZONE_DMA32
-       bool
-       default y if 64BIT
-
 config VA_BITS
        int
        default 32 if 32BIT
@@ -332,7 +336,7 @@ config NODES_SHIFT
        int "Maximum NUMA Nodes (as a power of 2)"
        range 1 10
        default "2"
-       depends on NEED_MULTIPLE_NODES
+       depends on NUMA
        help
          Specify the maximum number of NUMA Nodes available on the target
          system.  Increases memory reserved to accommodate various tables.
@@ -491,13 +495,8 @@ config STACKPROTECTOR_PER_TASK
        def_bool y
        depends on STACKPROTECTOR && CC_HAVE_STACKPROTECTOR_TLS
 
-config PHYS_RAM_BASE_FIXED
-       bool "Explicitly specified physical RAM address"
-       default n
-
 config PHYS_RAM_BASE
        hex "Platform Physical RAM address"
-       depends on PHYS_RAM_BASE_FIXED
        default "0x80000000"
        help
          This is the physical address of RAM in the system. It has to be
@@ -510,7 +509,6 @@ config XIP_KERNEL
        # This prevents XIP from being enabled by all{yes,mod}config, which
        # fail to build since XIP doesn't support large kernels.
        depends on !COMPILE_TEST
-       select PHYS_RAM_BASE_FIXED
        help
          Execute-In-Place allows the kernel to run from non-volatile storage
          directly addressable by the CPU, such as NOR flash. This saves RAM