Skip to content

Commit 9be8459

Browse files
guoren83palmer-dabbelt
authored andcommitted
riscv: compat: Add COMPAT Kbuild skeletal support
Adds initial skeletal COMPAT Kbuild (Running 32bit U-mode on 64bit S-mode) support. - Setup kconfig & dummy functions for compiling. - Implement compat_start_thread by the way. Signed-off-by: Guo Ren <guoren@linux.alibaba.com> Signed-off-by: Guo Ren <guoren@kernel.org> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Tested-by: Heiko Stuebner <heiko@sntech.de> Link: https://lore.kernel.org/r/20220405071314.3225832-21-guoren@kernel.org Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent 4608c15 commit 9be8459

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

arch/riscv/Kconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ config RISCV
7676
select HAVE_ARCH_KGDB if !XIP_KERNEL
7777
select HAVE_ARCH_KGDB_QXFER_PKT
7878
select HAVE_ARCH_MMAP_RND_BITS if MMU
79+
select HAVE_ARCH_MMAP_RND_COMPAT_BITS if COMPAT
7980
select HAVE_ARCH_SECCOMP_FILTER
8081
select HAVE_ARCH_TRACEHOOK
8182
select HAVE_ARCH_TRANSPARENT_HUGEPAGE if 64BIT && MMU
@@ -127,12 +128,18 @@ config ARCH_MMAP_RND_BITS_MIN
127128
default 18 if 64BIT
128129
default 8
129130

131+
config ARCH_MMAP_RND_COMPAT_BITS_MIN
132+
default 8
133+
130134
# max bits determined by the following formula:
131135
# VA_BITS - PAGE_SHIFT - 3
132136
config ARCH_MMAP_RND_BITS_MAX
133137
default 24 if 64BIT # SV39 based
134138
default 17
135139

140+
config ARCH_MMAP_RND_COMPAT_BITS_MAX
141+
default 17
142+
136143
# set if we run in machine mode, cleared if we run in supervisor mode
137144
config RISCV_M_MODE
138145
bool
@@ -394,6 +401,18 @@ config CRASH_DUMP
394401

395402
For more details see Documentation/admin-guide/kdump/kdump.rst
396403

404+
config COMPAT
405+
bool "Kernel support for 32-bit U-mode"
406+
default 64BIT
407+
depends on 64BIT && MMU
408+
help
409+
This option enables support for a 32-bit U-mode running under a 64-bit
410+
kernel at S-mode. riscv32-specific components such as system calls,
411+
the user helper functions (vdso), signal rt_frame functions and the
412+
ptrace interface are handled appropriately by the kernel.
413+
414+
If you want to execute 32-bit userspace applications, say Y.
415+
397416
endmenu
398417

399418
menu "Boot options"

0 commit comments

Comments
 (0)