1
0
Fork 0
alistair23-linux/arch
Dmitry Safonov a846446b19 x86/compat: Adjust in_compat_syscall() to generic code under !COMPAT
The result of in_compat_syscall() can be pictured as:

x86 platform:
    ---------------------------------------------------
    |  Arch\syscall  |  64-bit  |   ia32   |   x32    |
    |-------------------------------------------------|
    |     x86_64     |  false   |   true   |   true   |
    |-------------------------------------------------|
    |      i686      |          |  <true>  |          |
    ---------------------------------------------------

Other platforms:
    -------------------------------------------
    |  Arch\syscall  |  64-bit  |   compat    |
    |-----------------------------------------|
    |     64-bit     |  false   |    true     |
    |-----------------------------------------|
    |    32-bit(?)   |          |   <false>   |
    -------------------------------------------

As seen, the result of in_compat_syscall() on generic 32-bit platform
differs from i686.

There is no reason for in_compat_syscall() == true on native i686.  It also
easy to misread code if the result on native 32-bit platform differs
between arches.

Because of that non arch-specific code has many places with:
    if (IS_ENABLED(CONFIG_COMPAT) && in_compat_syscall())
in different variations.

It looks-like the only non-x86 code which uses in_compat_syscall() not
under CONFIG_COMPAT guard is in amd/amdkfd. But according to the commit
a18069c132 ("amdkfd: Disable support for 32-bit user processes"), it
actually should be disabled on native i686.

Rename in_compat_syscall() to in_32bit_syscall() for x86-specific code
and make in_compat_syscall() false under !CONFIG_COMPAT.

A follow on patch will clean up generic users which were forced to check
IS_ENABLED(CONFIG_COMPAT) with in_compat_syscall().

Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Andy Lutomirski <luto@kernel.org>
Cc: Dmitry Safonov <0x7f454c46@gmail.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-efi@vger.kernel.org
Cc: netdev@vger.kernel.org
Link: https://lkml.kernel.org/r/20181012134253.23266-2-dima@arista.com
2018-11-01 12:59:25 +01:00
..
alpha alpha: switch to NO_BOOTMEM 2018-10-26 16:25:20 -07:00
arc Devicetree updates for 4.20: 2018-10-26 12:09:58 -07:00
arm Merge branch 'akpm' (patches from Andrew) 2018-10-26 19:33:41 -07:00
arm64 Merge branch 'akpm' (patches from Andrew) 2018-10-26 19:33:41 -07:00
c6x Devicetree updates for 4.20: 2018-10-26 12:09:58 -07:00
h8300 Devicetree updates for 4.20: 2018-10-26 12:09:58 -07:00
hexagon hexagon: switch to NO_BOOTMEM 2018-10-26 16:25:20 -07:00
ia64 mm: make memmap_init a proper function 2018-10-26 16:26:35 -07:00
m68k powerpc updates for 4.20 2018-10-26 14:36:21 -07:00
microblaze Devicetree updates for 4.20: 2018-10-26 12:09:58 -07:00
mips Merge branch 'akpm' (patches from Andrew) 2018-10-26 19:33:41 -07:00
nds32 Devicetree updates for 4.20: 2018-10-26 12:09:58 -07:00
nios2 Merge branch 'akpm' (patches from Andrew) 2018-10-26 19:33:41 -07:00
openrisc Devicetree updates for 4.20: 2018-10-26 12:09:58 -07:00
parisc hugetlb: introduce generic version of huge_ptep_get 2018-10-26 16:26:34 -07:00
powerpc Merge branch 'akpm' (patches from Andrew) 2018-10-26 19:33:41 -07:00
riscv RISC-V Patches for the 4.20 Merge Window, Part 1 2018-10-25 18:01:29 -07:00
s390 sched: loadavg: consolidate LOAD_INT, LOAD_FRAC, CALC_LOAD 2018-10-26 16:26:32 -07:00
sh Merge branch 'akpm' (patches from Andrew) 2018-10-26 19:33:41 -07:00
sparc Merge branch 'akpm' (patches from Andrew) 2018-10-26 19:33:41 -07:00
um um: switch to NO_BOOTMEM 2018-10-26 16:25:20 -07:00
unicore32 unicore32: switch to NO_BOOTMEM 2018-10-26 16:25:20 -07:00
x86 x86/compat: Adjust in_compat_syscall() to generic code under !COMPAT 2018-11-01 12:59:25 +01:00
xtensa Merge branch 'akpm' (patches from Andrew) 2018-10-26 19:33:41 -07:00
.gitignore
Kconfig jump_label: Implement generic support for relative references 2018-09-27 17:56:47 +02:00