riscv: compat: Add hw capability check for elf
authorGuo Ren <guoren@linux.alibaba.com>
Tue, 5 Apr 2022 07:13:09 +0000 (15:13 +0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Tue, 26 Apr 2022 20:36:47 +0000 (13:36 -0700)
commitf4b395e6f1a588ed6c9a30474e58cf6b27b65783
treea629aefc95eb698e8e479698acb9fdb90f028fe0
parent87309e1082481bb78a9fbea6ed6784d979ff93c9
riscv: compat: Add hw capability check for elf

Detect hardware COMPAT (32bit U-mode) capability in rv64. If not
support COMPAT mode in hw, compat_elf_check_arch would return
false by compat_binfmt_elf.c

Add CLASS to enhance (compat_)elf_check_arch to distinguish
32BIT/64BIT elf.

Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Signed-off-by: Guo Ren <guoren@kernel.org>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20220405071314.3225832-16-guoren@kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/elf.h
arch/riscv/kernel/process.c