Re: [PATCH V5 15/21] riscv: compat: Add hw capability check for elf

2022-02-02 Thread Guo Ren
On Wed, Feb 2, 2022 at 3:52 PM Christoph Hellwig wrote: > > On Tue, Feb 01, 2022 at 11:05:39PM +0800, guo...@kernel.org wrote: > > +bool compat_elf_check_arch(Elf32_Ehdr *hdr) > > +{ > > + if (compat_mode_support && (hdr->e_machine == EM_RISCV)) > > + return true; > > + else >

Re: [PATCH V5 15/21] riscv: compat: Add hw capability check for elf

2022-02-01 Thread Christoph Hellwig
On Tue, Feb 01, 2022 at 11:05:39PM +0800, guo...@kernel.org wrote: > +bool compat_elf_check_arch(Elf32_Ehdr *hdr) > +{ > + if (compat_mode_support && (hdr->e_machine == EM_RISCV)) > + return true; > + else > + return false; > +} This can be simplified to: r

Re: [PATCH V5 15/21] riscv: compat: Add hw capability check for elf

2022-02-01 Thread Guo Ren
On Tue, Feb 1, 2022 at 11:07 PM wrote: > > From: Guo Ren > > 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 > > Signed-off-by: Guo Ren > Signed-off-by: Guo Ren > Cc: Arnd Bergmann >

[PATCH V5 15/21] riscv: compat: Add hw capability check for elf

2022-02-01 Thread guoren
From: Guo Ren 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 Signed-off-by: Guo Ren Signed-off-by: Guo Ren Cc: Arnd Bergmann Cc: Christoph Hellwig --- arch/riscv/include/asm/elf.h |