Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1218437

Re: [RFC 24/30] x86/entry/32: Switch INT80 to the new C syscall path

From Brian Gerst <brgerst@gmail.com>
Newsgroups linux.kernel
Subject Re: [RFC 24/30] x86/entry/32: Switch INT80 to the new C syscall path
Date 2015-09-03 18:50 +0200
Message-ID <q4FS2-M8-17@gated-at.bofh.it> (permalink)
References <q42xj-3mq-3@gated-at.bofh.it> <q42xl-3mq-59@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Sep 1, 2015 at 6:41 PM, Andy Lutomirski <luto@kernel.org> wrote:
> Signed-off-by: Andy Lutomirski <luto@kernel.org>
> ---
>  arch/x86/entry/entry_32.S | 34 +++++++++++++---------------------
>  1 file changed, 13 insertions(+), 21 deletions(-)
>
> diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S
> index 36b6beb181f6..02881e528945 100644
> --- a/arch/x86/entry/entry_32.S
> +++ b/arch/x86/entry/entry_32.S
> @@ -153,13 +153,13 @@
>
>  #endif /* CONFIG_X86_32_LAZY_GS */
>
> -.macro SAVE_ALL
> +.macro SAVE_ALL pt_regs_ax=%eax
>         cld
>         PUSH_GS
>         pushl   %fs
>         pushl   %es
>         pushl   %ds
> -       pushl   %eax
> +       pushl   \pt_regs_ax
>         pushl   %ebp
>         pushl   %edi
>         pushl   %esi
> @@ -370,20 +370,17 @@ ENDPROC(entry_SYSENTER_32)
>         # system call handler stub
>  ENTRY(entry_INT80_32)
>         ASM_CLAC
> -       pushl   %eax                            # save orig_eax
> -       SAVE_ALL
> -       GET_THREAD_INFO(%ebp)
> -                                               # system call tracing in operation / emulation
> -       testl   $_TIF_WORK_SYSCALL_ENTRY, TI_flags(%ebp)
> -       jnz     syscall_trace_entry
> -       cmpl    $(NR_syscalls), %eax
> -       jae     syscall_badsys
> -syscall_call:
> -       call    *sys_call_table(, %eax, 4)
> -syscall_after_call:
> -       movl    %eax, PT_EAX(%esp)              # store the return value
> -syscall_exit:
> -       jmp     syscall_exit_work
> +       pushl   %eax                    /* pt_regs->orig_ax */
> +       SAVE_ALL pt_regs_ax=$-ENOSYS    /* save rest, load -ENOSYS into ax */
> +
> +       /*
> +        * User mode is traced as though IRQs are on, and the interrupt gate
> +        * turned them off.
> +        */
> +       TRACE_IRQS_OFF
> +
> +       movl    %esp, %eax
> +       call    do_int80_syscall_32
>
>  restore_all:
>         TRACE_IRQS_IRET
> @@ -491,11 +488,6 @@ syscall_fault:
>         jmp     resume_userspace
>  END(syscall_fault)
>
> -syscall_badsys:
> -       movl    $-ENOSYS, %eax
> -       jmp     syscall_after_call
> -END(syscall_badsys)
> -
>  sysenter_badsys:
>         movl    $-ENOSYS, %eax
>         jmp     sysenter_after_call
> --
> 2.4.3
>

While bisecting a boot failure on the 32-bit native kernel I came
across this build error:
arch/x86/built-in.o: In function `syscall_trace_entry':
/home/bgerst/kernel/linux/arch/x86/entry/entry_32.S:468: undefined
reference to `syscall_call'
/home/bgerst/kernel/linux/arch/x86/entry/entry_32.S:469: undefined
reference to `syscall_exit'

--
Brian Gerst
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC 00/30] x86: Rewrite all syscall entries except native 64-bit Andy Lutomirski <luto@kernel.org> - 2015-09-02 00:50 +0200
  [RFC 15/30] x86/entry/64/compat: Set up full pt_regs for all compat syscalls Andy Lutomirski <luto@kernel.org> - 2015-09-02 00:50 +0200
  [RFC 21/30] x86/vdso/compat: Wire up SYSENTER and SYSCSALL for compat userspace Andy Lutomirski <luto@kernel.org> - 2015-09-02 00:50 +0200
  [RFC 26/30] x86/asm: Remove thread_info.sysenter_return Andy Lutomirski <luto@kernel.org> - 2015-09-02 00:50 +0200
  [RFC 27/30] x86/entry: Remove unnecessary IRQ twiddling in fast 32-bit syscalls Andy Lutomirski <luto@kernel.org> - 2015-09-02 00:50 +0200
  [RFC 11/30] x86/vdso/32: Save extra registers in the INT80 vsyscall path Andy Lutomirski <luto@kernel.org> - 2015-09-02 00:50 +0200
  [RFC 25/30] x86/entry/32: Re-implement SYSENTER using the new C path Andy Lutomirski <luto@kernel.org> - 2015-09-02 00:50 +0200
  [RFC 30/30] x86/entry: Micro-optimize compat fast syscall arg fetch Andy Lutomirski <luto@kernel.org> - 2015-09-02 00:50 +0200
  [RFC 14/30] x86/entry/64/compat: Remove most of the fast system call machinery Andy Lutomirski <luto@kernel.org> - 2015-09-02 00:50 +0200
  [RFC 20/30] x86/entry: Add C code for fast system call entries Andy Lutomirski <luto@kernel.org> - 2015-09-02 00:50 +0200
  [RFC 04/30] x86/entry: Move lockdep_sys_exit to prepare_exit_to_usermode Andy Lutomirski <luto@kernel.org> - 2015-09-02 00:50 +0200
  [RFC 13/30] x86/entry/64/compat: Remove audit optimizations Andy Lutomirski <luto@kernel.org> - 2015-09-02 00:50 +0200
  [RFC 06/30] x86/sched/64: Don't save flags on context switch (reinstated) Andy Lutomirski <luto@kernel.org> - 2015-09-02 00:50 +0200
  [RFC 22/30] x86/entry/compat: Implement opportunistic SYSRETL for compat syscalls Andy Lutomirski <luto@kernel.org> - 2015-09-02 00:50 +0200
  [RFC 16/30] x86/entry/syscalls: Move syscall table declarations into asm/syscalls.h Andy Lutomirski <luto@kernel.org> - 2015-09-02 00:50 +0200
  [RFC 18/30] x86/entry: Add do_syscall_32, a C function to do 32-bit syscalls Andy Lutomirski <luto@kernel.org> - 2015-09-02 00:50 +0200
  [RFC 28/30] x86/entry: Make irqs_disabled checks in exit code depend on lockdep Andy Lutomirski <luto@kernel.org> - 2015-09-02 00:50 +0200
  [RFC 19/30] x86/entry/64/compat: Migrate the body of the syscall entry to C Andy Lutomirski <luto@kernel.org> - 2015-09-02 00:50 +0200
  [RFC 23/30] x86/entry/32: Open-code return tracking from fork and kthreads Andy Lutomirski <luto@kernel.org> - 2015-09-02 00:50 +0200
  [RFC 01/30] selftests/x86: Add a test for vDSO unwinding Andy Lutomirski <luto@kernel.org> - 2015-09-02 00:50 +0200
  [RFC 24/30] x86/entry/32: Switch INT80 to the new C syscall path Andy Lutomirski <luto@kernel.org> - 2015-09-02 00:50 +0200
    Re: [RFC 24/30] x86/entry/32: Switch INT80 to the new C syscall path Brian Gerst <brgerst@gmail.com> - 2015-09-03 18:50 +0200
      Re: [RFC 24/30] x86/entry/32: Switch INT80 to the new C syscall path Andy Lutomirski <luto@amacapital.net> - 2015-09-03 19:30 +0200
  [RFC 29/30] x86/entry: Force inlining of 32-bit syscall code Andy Lutomirski <luto@kernel.org> - 2015-09-02 00:50 +0200
  [RFC 17/30] x86/syscalls: Give sys_call_ptr_t a useful type Andy Lutomirski <luto@kernel.org> - 2015-09-02 00:50 +0200
  [RFC 03/30] x86/entry/64/compat: Fix SYSENTER's NT flag before user memory access Andy Lutomirski <luto@kernel.org> - 2015-09-02 01:00 +0200
  [RFC 05/30] x86/entry/64/compat: After SYSENTER, move STI after the NT fixup Andy Lutomirski <luto@kernel.org> - 2015-09-02 01:00 +0200
  [RFC 08/30] x86/asm: Re-add manual CFI infrastructure Andy Lutomirski <luto@kernel.org> - 2015-09-02 01:00 +0200
  [RFC 10/30] x86/vdso: Replace hex int80 CFI annotations with gas directives Andy Lutomirski <luto@kernel.org> - 2015-09-02 01:00 +0200
  [RFC 02/30] selftests/x86: Add a test for syscall restart and arg modification Andy Lutomirski <luto@kernel.org> - 2015-09-02 01:00 +0200
  [RFC 09/30] x86/vdso: Define BUILD_VDSO while building and emit .eh_frame in asm Andy Lutomirski <luto@kernel.org> - 2015-09-02 01:00 +0200
  Re: [RFC 00/30] x86: Rewrite all syscall entries except native 64-bit Brian Gerst <brgerst@gmail.com> - 2015-09-03 07:30 +0200
    Re: [RFC 00/30] x86: Rewrite all syscall entries except native 64-bit Andy Lutomirski <luto@amacapital.net> - 2015-09-03 19:20 +0200

csiph-web