x86/entry: Convert INT 0x80 emulation to IDTENTRY
authorThomas Gleixner <tglx@linutronix.de>
Mon, 4 Dec 2023 08:31:39 +0000 (11:31 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Dec 2023 17:39:05 +0000 (18:39 +0100)
commitd5f999317e83efc07b8a7d26f9556b1271a6d373
tree765fbfd652e2f1b005e0af77638cadaa323d9179
parentb8ec27ae221eee458b15b700706db311474ac619
x86/entry: Convert INT 0x80 emulation to IDTENTRY

[ upstream commit be5341eb0d43b1e754799498bd2e8756cc167a41 ]

There is no real reason to have a separate ASM entry point implementation
for the legacy INT 0x80 syscall emulation on 64-bit.

IDTENTRY provides all the functionality needed with the only difference
that it does not:

  - save the syscall number (AX) into pt_regs::orig_ax
  - set pt_regs::ax to -ENOSYS

Both can be done safely in the C code of an IDTENTRY before invoking any of
the syscall related functions which depend on this convention.

Aside of ASM code reduction this prepares for detecting and handling a
local APIC injected vector 0x80.

[ kirill.shutemov: More verbose comments ]
Suggested-by: Linus Torvalds <torvalds@linuxfoundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Borislav Petkov (AMD) <bp@alien8.de>
Cc: <stable@vger.kernel.org> # v6.0+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/entry/common.c
arch/x86/entry/entry_64_compat.S
arch/x86/include/asm/idtentry.h
arch/x86/include/asm/proto.h
arch/x86/kernel/idt.c
arch/x86/xen/enlighten_pv.c
arch/x86/xen/xen-asm.S