Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1915672ybb; Sat, 21 Mar 2020 08:32:12 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu+V6ROW3VwA/fHuGkMBKYF+dnJSskH8CbO2cPVYgYflxS5nCKfAjSgbjcEbaU0AnjthQ4X X-Received: by 2002:aca:d68a:: with SMTP id n132mr11347776oig.40.1584804732522; Sat, 21 Mar 2020 08:32:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584804732; cv=none; d=google.com; s=arc-20160816; b=Xtl4ZbvW516cAlECn7bPmloTdGR/0H45w6Qznxq/49E0l7VVoIqJjZp6xL1SHp5sTq H58baXJ677Vr5sTruTWsqkDFHk3jDbXl/dR2Hem2jG5tBZuwMfb+UFVIcdC402/JmQHZ y564Jk2xPaQfjE+JMAYqWLDczVq0wkF9DqDfQ3AAW72ytCQE8eQhRrYQzcssQGAN7Lza LJ5/WRVZvtrAAWuua/fWItXuy1cr0JTyhW3Pqz/ixuQML0kO263AzzsroJ9UxP3qq+Hw j6l818o0jm1/ehmZJDE9zQ2ogiSwLVOCY8L5xoLIt3xTijjEch+KNJGnVpN00o2Dez9J jm/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=V4CVeOMsq8MJeebb4x4PLGmc5DT1BRUWyHGLLHeHmyU=; b=H/G0dMyl7KioJ9MX1/xwdLY6bIk0q8SYumLxbdviRmucOq2D0uecxSMWe8n1GddtT/ ey2i7tzikZ/FvZDt4AiqgW6X9EotqLpeRS4YyE9ZUMtdmXlc4csINPt+ebgh7PxtjQ8q aUhMmai07UpL/IMgps4OkegnQyOHn8XecnjiLgAu7EPx8lh35aEYP7cwjTFrxtme1pcV nLRKd1xyBEuZoaPvwVYDMoK9sWwRDeaeK3KwmhUFrJ4g9fIHVVQPbbi9Gb0skpQH91Jq xCcVlTwLkU9AULG+/JTvtAj1az5Z/3N561KAfjt46c23bIPgit8VwdDP7kV8L/UmnEeV 83sg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f17si57310oov.44.2020.03.21.08.32.00; Sat, 21 Mar 2020 08:32:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727718AbgCUPao (ORCPT + 99 others); Sat, 21 Mar 2020 11:30:44 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:38886 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727028AbgCUPah (ORCPT ); Sat, 21 Mar 2020 11:30:37 -0400 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jFg52-0004xj-Bo; Sat, 21 Mar 2020 16:30:32 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id EF2421C22E5; Sat, 21 Mar 2020 16:30:31 +0100 (CET) Date: Sat, 21 Mar 2020 15:30:31 -0000 From: "tip-bot2 for Brian Gerst" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/entry] x86/entry: Drop asmlinkage from syscalls Cc: Brian Gerst , Thomas Gleixner , Dominik Brodowski , Andy Lutomirski , x86 , LKML In-Reply-To: <20200313195144.164260-18-brgerst@gmail.com> References: <20200313195144.164260-18-brgerst@gmail.com> MIME-Version: 1.0 Message-ID: <158480463166.28353.4814559802434057045.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/entry branch of tip: Commit-ID: 0f78ff17112d8b3469b805ff4ea9780cc1e5c93b Gitweb: https://git.kernel.org/tip/0f78ff17112d8b3469b805ff4ea9780cc1e5c93b Author: Brian Gerst AuthorDate: Fri, 13 Mar 2020 15:51:43 -04:00 Committer: Thomas Gleixner CommitterDate: Sat, 21 Mar 2020 16:03:25 +01:00 x86/entry: Drop asmlinkage from syscalls asmlinkage is no longer required since the syscall ABI is now fully under x86 architecture control. This makes the 32-bit native syscalls a bit more effecient by passing in regs via EAX instead of on the stack. Signed-off-by: Brian Gerst Signed-off-by: Thomas Gleixner Reviewed-by: Dominik Brodowski Reviewed-by: Andy Lutomirski Link: https://lkml.kernel.org/r/20200313195144.164260-18-brgerst@gmail.com --- arch/x86/entry/syscall_32.c | 2 +- arch/x86/entry/syscall_64.c | 2 +- arch/x86/entry/syscall_x32.c | 4 +-- arch/x86/include/asm/syscall.h | 2 +- arch/x86/include/asm/syscall_wrapper.h | 31 +++++++++++-------------- 5 files changed, 19 insertions(+), 22 deletions(-) diff --git a/arch/x86/entry/syscall_32.c b/arch/x86/entry/syscall_32.c index 097413c..86eb0d8 100644 --- a/arch/x86/entry/syscall_32.c +++ b/arch/x86/entry/syscall_32.c @@ -8,7 +8,7 @@ #include #include -#define __SYSCALL_I386(nr, sym) extern asmlinkage long __ia32_##sym(const struct pt_regs *); +#define __SYSCALL_I386(nr, sym) extern long __ia32_##sym(const struct pt_regs *); #include #undef __SYSCALL_I386 diff --git a/arch/x86/entry/syscall_64.c b/arch/x86/entry/syscall_64.c index 66d3e65..1594ec7 100644 --- a/arch/x86/entry/syscall_64.c +++ b/arch/x86/entry/syscall_64.c @@ -11,7 +11,7 @@ #define __SYSCALL_X32(nr, sym) #define __SYSCALL_COMMON(nr, sym) __SYSCALL_64(nr, sym) -#define __SYSCALL_64(nr, sym) extern asmlinkage long __x64_##sym(const struct pt_regs *); +#define __SYSCALL_64(nr, sym) extern long __x64_##sym(const struct pt_regs *); #include #undef __SYSCALL_64 diff --git a/arch/x86/entry/syscall_x32.c b/arch/x86/entry/syscall_x32.c index 2fb09ef..3d8d70d 100644 --- a/arch/x86/entry/syscall_x32.c +++ b/arch/x86/entry/syscall_x32.c @@ -10,8 +10,8 @@ #define __SYSCALL_64(nr, sym) -#define __SYSCALL_X32(nr, sym) extern asmlinkage long __x32_##sym(const struct pt_regs *); -#define __SYSCALL_COMMON(nr, sym) extern asmlinkage long __x64_##sym(const struct pt_regs *); +#define __SYSCALL_X32(nr, sym) extern long __x32_##sym(const struct pt_regs *); +#define __SYSCALL_COMMON(nr, sym) extern long __x64_##sym(const struct pt_regs *); #include #undef __SYSCALL_X32 #undef __SYSCALL_COMMON diff --git a/arch/x86/include/asm/syscall.h b/arch/x86/include/asm/syscall.h index e413c83..6435294 100644 --- a/arch/x86/include/asm/syscall.h +++ b/arch/x86/include/asm/syscall.h @@ -16,7 +16,7 @@ #include /* for TS_COMPAT */ #include -typedef asmlinkage long (*sys_call_ptr_t)(const struct pt_regs *); +typedef long (*sys_call_ptr_t)(const struct pt_regs *); extern const sys_call_ptr_t sys_call_table[]; #if defined(CONFIG_X86_32) diff --git a/arch/x86/include/asm/syscall_wrapper.h b/arch/x86/include/asm/syscall_wrapper.h index 5e13e2c..e10efa1 100644 --- a/arch/x86/include/asm/syscall_wrapper.h +++ b/arch/x86/include/asm/syscall_wrapper.h @@ -8,8 +8,8 @@ struct pt_regs; -extern asmlinkage long __x64_sys_ni_syscall(const struct pt_regs *regs); -extern asmlinkage long __ia32_sys_ni_syscall(const struct pt_regs *regs); +extern long __x64_sys_ni_syscall(const struct pt_regs *regs); +extern long __ia32_sys_ni_syscall(const struct pt_regs *regs); /* * Instead of the generic __SYSCALL_DEFINEx() definition, the x86 version takes @@ -66,22 +66,21 @@ extern asmlinkage long __ia32_sys_ni_syscall(const struct pt_regs *regs); ,,(unsigned int)regs->di,,(unsigned int)regs->bp) #define __SYS_STUB0(abi, name) \ - asmlinkage long __##abi##_##name(const struct pt_regs *regs); \ + long __##abi##_##name(const struct pt_regs *regs); \ ALLOW_ERROR_INJECTION(__##abi##_##name, ERRNO); \ - asmlinkage long __##abi##_##name(const struct pt_regs *regs) \ + long __##abi##_##name(const struct pt_regs *regs) \ __alias(__do_##name); #define __SYS_STUBx(abi, name, ...) \ - asmlinkage long __##abi##_##name(const struct pt_regs *regs); \ + long __##abi##_##name(const struct pt_regs *regs); \ ALLOW_ERROR_INJECTION(__##abi##_##name, ERRNO); \ - asmlinkage long __##abi##_##name(const struct pt_regs *regs) \ + long __##abi##_##name(const struct pt_regs *regs) \ { \ return __se_##name(__VA_ARGS__); \ } #define __COND_SYSCALL(abi, name) \ - asmlinkage __weak long \ - __##abi##_##name(const struct pt_regs *__unused) \ + __weak long __##abi##_##name(const struct pt_regs *__unused) \ { \ return sys_ni_syscall(); \ } @@ -192,11 +191,11 @@ extern asmlinkage long __ia32_sys_ni_syscall(const struct pt_regs *regs); * of them. */ #define COMPAT_SYSCALL_DEFINE0(name) \ - static asmlinkage long \ + static long \ __do_compat_sys_##name(const struct pt_regs *__unused); \ __IA32_COMPAT_SYS_STUB0(name) \ __X32_COMPAT_SYS_STUB0(name) \ - static asmlinkage long \ + static long \ __do_compat_sys_##name(const struct pt_regs *__unused) #define COMPAT_SYSCALL_DEFINEx(x, name, ...) \ @@ -248,12 +247,10 @@ extern asmlinkage long __ia32_sys_ni_syscall(const struct pt_regs *regs); */ #define SYSCALL_DEFINE0(sname) \ SYSCALL_METADATA(_##sname, 0); \ - static asmlinkage long \ - __do_sys_##sname(const struct pt_regs *__unused); \ + static long __do_sys_##sname(const struct pt_regs *__unused); \ __X64_SYS_STUB0(sname) \ __IA32_SYS_STUB0(sname) \ - static asmlinkage long \ - __do_sys_##sname(const struct pt_regs *__unused) + static long __do_sys_##sname(const struct pt_regs *__unused) #define COND_SYSCALL(name) \ __X64_COND_SYSCALL(name) \ @@ -268,8 +265,8 @@ extern asmlinkage long __ia32_sys_ni_syscall(const struct pt_regs *regs); * For VSYSCALLS, we need to declare these three syscalls with the new * pt_regs-based calling convention for in-kernel use. */ -asmlinkage long __x64_sys_getcpu(const struct pt_regs *regs); -asmlinkage long __x64_sys_gettimeofday(const struct pt_regs *regs); -asmlinkage long __x64_sys_time(const struct pt_regs *regs); +long __x64_sys_getcpu(const struct pt_regs *regs); +long __x64_sys_gettimeofday(const struct pt_regs *regs); +long __x64_sys_time(const struct pt_regs *regs); #endif /* _ASM_X86_SYSCALL_WRAPPER_H */