Rename LOAD_ARGS32 to RESTORE_REGS32 to match other RESTORE_* macros.
The "ARGS" part was misleading anyway - we are restoring registers,
not arguments.

Similarly, rename [retint_]restore_args to [retint_]restore_c_regs:
at these labels, we restore registers clobbered by C ABI;
rename int_restore_rest to int_restore_extra_regs.

Signed-off-by: Denys Vlasenko <dvlas...@redhat.com>
CC: Linus Torvalds <torva...@linux-foundation.org>
CC: Oleg Nesterov <o...@redhat.com>
CC: Borislav Petkov <b...@alien8.de>
CC: "H. Peter Anvin" <h...@zytor.com>
CC: Andy Lutomirski <l...@amacapital.net>
CC: Frederic Weisbecker <fweis...@gmail.com>
CC: X86 ML <x...@kernel.org>
CC: Alexei Starovoitov <a...@plumgrid.com>
CC: Will Drewry <w...@chromium.org>
CC: Kees Cook <keesc...@chromium.org>
CC: linux-kernel@vger.kernel.org
---
 arch/x86/ia32/ia32entry.S  | 10 +++++-----
 arch/x86/kernel/entry_64.S | 16 ++++++++--------
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
index e99f8a5..9f4c877 100644
--- a/arch/x86/ia32/ia32entry.S
+++ b/arch/x86/ia32/ia32entry.S
@@ -51,7 +51,7 @@
        .endm
 
        /*
-        * Reload arg registers from stack in case ptrace changed them.
+        * Reload registers from stack in case ptrace changed them.
         * We don't reload %eax because syscall_trace_enter() returned
         * the %rax value we should see.  Instead, we just truncate that
         * value to 32 bits again as we did on entry from user mode.
@@ -60,7 +60,7 @@
         * If it's -1 to make us punt the syscall, then (u32)-1 is still
         * an appropriately invalid value.
         */
-       .macro LOAD_ARGS32 _r9=0
+       .macro RESTORE_REGS32 _r9=0
        .if \_r9
        movl R9(%rsp),%r9d
        .endif
@@ -263,7 +263,7 @@ sysenter_tracesys:
        movq    $-ENOSYS,RAX(%rsp)/* ptrace can change this for a bad syscall */
        movq    %rsp,%rdi        /* &pt_regs -> arg1 */
        call    syscall_trace_enter
-       LOAD_ARGS32  /* reload args from stack in case ptrace changed it */
+       RESTORE_REGS32  /* reload regs from stack in case ptrace changed it */
        RESTORE_EXTRA_REGS
        cmpq    $(IA32_NR_syscalls-1),%rax
        ja      int_ret_from_sys_call /* sysenter_tracesys has set RAX(%rsp) */
@@ -380,7 +380,7 @@ cstar_tracesys:
        movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */
        movq %rsp,%rdi        /* &pt_regs -> arg1 */
        call syscall_trace_enter
-       LOAD_ARGS32 1   /* reload args from stack in case ptrace changed it */
+       RESTORE_REGS32 1        /* reload regs from stack in case ptrace 
changed it */
        RESTORE_EXTRA_REGS
        xchgl %ebp,%r9d
        cmpq $(IA32_NR_syscalls-1),%rax
@@ -458,7 +458,7 @@ ia32_tracesys:
        movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */
        movq %rsp,%rdi        /* &pt_regs -> arg1 */
        call syscall_trace_enter
-       LOAD_ARGS32     /* reload args from stack in case ptrace changed it */
+       RESTORE_REGS32  /* reload args from stack in case ptrace changed it */
        RESTORE_EXTRA_REGS
        cmpq $(IA32_NR_syscalls-1),%rax
        ja  int_ret_from_sys_call       /* ia32_tracesys has set RAX(%rsp) */
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index a15bef6..c9259f4 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -62,7 +62,7 @@
 
 
 #ifndef CONFIG_PREEMPT
-#define retint_kernel retint_restore_args
+#define retint_kernel retint_restore_c_regs
 #endif
 
 #ifdef CONFIG_PARAVIRT
@@ -481,7 +481,7 @@ int_check_syscall_exit_work:
        call syscall_trace_leave
        popq_cfi %rdi
        andl $~(_TIF_WORK_SYSCALL_EXIT|_TIF_SYSCALL_EMU),%edi
-       jmp int_restore_rest
+       jmp int_restore_extra_regs
 
 int_signal:
        testl $_TIF_DO_NOTIFY_MASK,%edx
@@ -490,7 +490,7 @@ int_signal:
        xorl %esi,%esi          # oldset -> arg2
        call do_notify_resume
 1:     movl $_TIF_WORK_MASK,%edi
-int_restore_rest:
+int_restore_extra_regs:
        RESTORE_EXTRA_REGS
        DISABLE_INTERRUPTS(CLBR_NONE)
        TRACE_IRQS_OFF
@@ -757,15 +757,15 @@ retint_swapgs:            /* return to user-space */
        DISABLE_INTERRUPTS(CLBR_ANY)
        TRACE_IRQS_IRETQ
        SWAPGS
-       jmp restore_args
+       jmp restore_c_regs
 
-retint_restore_args:   /* return to kernel space */
+retint_restore_c_regs: /* return to kernel space */
        DISABLE_INTERRUPTS(CLBR_ANY)
        /*
         * The iretq could re-enable interrupts:
         */
        TRACE_IRQS_IRETQ
-restore_args:
+restore_c_regs:
        RESTORE_C_REGS
        REMOVE_PT_GPREGS_FROM_STACK 8
 
@@ -854,9 +854,9 @@ retint_signal:
        /* rcx:  threadinfo. interrupts off. */
 ENTRY(retint_kernel)
        cmpl $0,PER_CPU_VAR(__preempt_count)
-       jnz  retint_restore_args
+       jnz  retint_restore_c_regs
        bt   $9,EFLAGS(%rsp)    /* interrupts off? */
-       jnc  retint_restore_args
+       jnc  retint_restore_c_regs
        call preempt_schedule_irq
        jmp exit_intr
 #endif
-- 
1.8.1.4

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

Reply via email to