Re: [PATCH v3 01/23] x86/elf: Check in_x32_syscall() in compat_arch_setup_additional_pages()

From: Thomas Gleixner
Date: Sat Jun 19 2021 - 16:44:09 EST


On Fri, Jun 11 2021 at 19:02, Dmitry Safonov wrote:
> Partly revert commit 3316ec8ccd34 ("x86/elf: Use e_machine to check for
> x32/ia32 in setup_additional_pages()") and commit 9a29a671902c ("elf:
> Expose ELF header on arch_setup_additional_pages()".
> Both patches did a good thing: removed usage of TIF_X32, but with
> a price of additional macros ARCH_SETUP_ADDITIONAL_PAGES() and ifdeffs.
>
> Instead, use in_x32_syscall() - the first thing load_elf_binary() does
> after parsing and checking new ELF binary. It's done that early after
> exec() that mmap() code already uses it straight away, which is needed
> to know which mmap_base to use (see arch_pick_mmap_layout()).
> Add comments to describe how it works.

I still have no idea what this is trying to solve. All you describe is
what this does.

Thanks,

tglx