Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1915028ybb; Sat, 21 Mar 2020 08:31:30 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuOnMLgKib7d/EIEap4CpEcJal7H5ImjUIvg3xely6ErFD1EVqgG5394zanLNmMhl+7uZrA X-Received: by 2002:a05:6830:1e25:: with SMTP id t5mr10894647otr.70.1584804690192; Sat, 21 Mar 2020 08:31:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584804690; cv=none; d=google.com; s=arc-20160816; b=dTZX8mzaXwremz7aZ+chzXD5VgiG3Ja/DnCdtsokYgkr7uuUVSZvaoPUQC2MLZfJsQ ZLkmso7XxF8tpDylkmy1oOPVsfs9YfJEGspW2toxp0WnUtEF6QhpVTn0Ho7UjF8ejac6 QErn+UoWG9UkkYzfeqPmXYF6dcG44X+dXH/k10mnwyt2k3z/QZwqvH3D7r/kq8TOcEun peVS739jO4RwuNwXu7WYm41Ih/A8emqGggNTPlC9awQkF5d/UUvndVf6AipUkknaJVku gGy33mFu2uQYCn6SyJ3KZQfJL92jokJT9c74ROUwKxUevxAYZfbVM7exTzQnamm9hO2h cCqg== 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=qhmDvz2yIG6lOwhOqCW2JhM8gry/sKOad4txAgBeT0E=; b=oy+So/ZHzv5VcduYcmC06SZh9dZkHFhB2aHp54L4aY4e2TT/JapzKGWyEv7gIaUj3m 3ftMGNM+oXwyU3OeEsz561y+Grv1ges5W4lQDvutP2WgfL2iXhAum02+5QNlaCu0oNdL +T0x8AmjOHyDgGrEdQ29LRh+FzMk+22XKzCmggI04Wi0BRsO5vsS5T35guUJ4JYhJHx3 PTTvVdHeGKr+HQiixdHnq57nMr8VZ4BMR0UQK8kmZUh6vngQnyPzDUfRxIaIMO6lr2JS D9a8cZNagJ9XtoBrDvYQZV1JesRUhkcUK7aohpKWLZL8PFaE9TgPy4bzymKaqqARNCtQ Nehw== 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 i21si5173401otk.100.2020.03.21.08.31.18; Sat, 21 Mar 2020 08:31:30 -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 S1727789AbgCUPas (ORCPT + 99 others); Sat, 21 Mar 2020 11:30:48 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:38932 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727684AbgCUPam (ORCPT ); Sat, 21 Mar 2020 11:30:42 -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 1jFg5A-0004zu-7r; Sat, 21 Mar 2020 16:30:40 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id D64B31C22E6; Sat, 21 Mar 2020 16:30:34 +0100 (CET) Date: Sat, 21 Mar 2020 15:30:34 -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/64: Add __SYSCALL_COMMON() Cc: Brian Gerst , Thomas Gleixner , x86 , LKML In-Reply-To: <20200313195144.164260-12-brgerst@gmail.com> References: <20200313195144.164260-12-brgerst@gmail.com> MIME-Version: 1.0 Message-ID: <158480463449.28353.8404279805273411879.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: 8210efcb153625d2bf4bb79875ddc78eee2aba3e Gitweb: https://git.kernel.org/tip/8210efcb153625d2bf4bb79875ddc78eee2aba3e Author: Brian Gerst AuthorDate: Fri, 13 Mar 2020 15:51:37 -04:00 Committer: Thomas Gleixner CommitterDate: Sat, 21 Mar 2020 16:03:22 +01:00 x86/entry/64: Add __SYSCALL_COMMON() Add a __SYSCALL_COMMON() macro to the syscall table, which simplifies syscalltbl.sh. Signed-off-by: Brian Gerst Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200313195144.164260-12-brgerst@gmail.com --- arch/x86/entry/syscall_64.c | 1 + arch/x86/entry/syscall_x32.c | 3 +++ arch/x86/entry/syscalls/syscalltbl.sh | 22 ++-------------------- arch/x86/um/sys_call_table_64.c | 3 +++ 4 files changed, 9 insertions(+), 20 deletions(-) diff --git a/arch/x86/entry/syscall_64.c b/arch/x86/entry/syscall_64.c index bce4821..03645f9 100644 --- a/arch/x86/entry/syscall_64.c +++ b/arch/x86/entry/syscall_64.c @@ -9,6 +9,7 @@ #include #define __SYSCALL_X32(nr, sym) +#define __SYSCALL_COMMON(nr, sym) __SYSCALL_64(nr, sym) #define __SYSCALL_64(nr, sym) extern asmlinkage long sym(const struct pt_regs *); #include diff --git a/arch/x86/entry/syscall_x32.c b/arch/x86/entry/syscall_x32.c index 21e306c..57a151a 100644 --- a/arch/x86/entry/syscall_x32.c +++ b/arch/x86/entry/syscall_x32.c @@ -11,10 +11,13 @@ #define __SYSCALL_64(nr, sym) #define __SYSCALL_X32(nr, sym) extern asmlinkage long sym(const struct pt_regs *); +#define __SYSCALL_COMMON(nr, sym) extern asmlinkage long sym(const struct pt_regs *); #include #undef __SYSCALL_X32 +#undef __SYSCALL_COMMON #define __SYSCALL_X32(nr, sym) [nr] = sym, +#define __SYSCALL_COMMON(nr, sym) [nr] = sym, asmlinkage const sys_call_ptr_t x32_sys_call_table[__NR_x32_syscall_max+1] = { /* diff --git a/arch/x86/entry/syscalls/syscalltbl.sh b/arch/x86/entry/syscalls/syscalltbl.sh index b0519dd..6106ed3 100644 --- a/arch/x86/entry/syscalls/syscalltbl.sh +++ b/arch/x86/entry/syscalls/syscalltbl.sh @@ -25,7 +25,7 @@ emit() { fi # For CONFIG_UML, we need to strip the __x64_sys prefix - if [ "$abi" = "64" -a "${entry}" != "${entry#__x64_sys}" ]; then + if [ "${entry}" != "${entry#__x64_sys}" ]; then umlentry="sys${entry#__x64_sys}" fi @@ -53,24 +53,6 @@ emit() { grep '^[0-9]' "$in" | sort -n | ( while read nr abi name entry compat; do abi=`echo "$abi" | tr '[a-z]' '[A-Z]'` - if [ "$abi" = "COMMON" -o "$abi" = "64" ]; then - emit 64 "$nr" "$entry" "$compat" - if [ "$abi" = "COMMON" ]; then - # COMMON means that this syscall exists in the same form for - # 64-bit and X32. - echo "#ifdef CONFIG_X86_X32_ABI" - emit X32 "$nr" "$entry" "$compat" - echo "#endif" - fi - elif [ "$abi" = "X32" ]; then - echo "#ifdef CONFIG_X86_X32_ABI" - emit X32 "$nr" "$entry" "$compat" - echo "#endif" - elif [ "$abi" = "I386" ]; then - emit "$abi" "$nr" "$entry" "$compat" - else - echo "Unknown abi $abi" >&2 - exit 1 - fi + emit "$abi" "$nr" "$entry" "$compat" done ) > "$out" diff --git a/arch/x86/um/sys_call_table_64.c b/arch/x86/um/sys_call_table_64.c index 7d057ea..2e8544d 100644 --- a/arch/x86/um/sys_call_table_64.c +++ b/arch/x86/um/sys_call_table_64.c @@ -36,6 +36,9 @@ #define stub_execveat sys_execveat #define stub_rt_sigreturn sys_rt_sigreturn +#define __SYSCALL_X32(nr, sym) +#define __SYSCALL_COMMON(nr, sym) __SYSCALL_64(nr, sym) + #define __SYSCALL_64(nr, sym) extern asmlinkage long sym(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) ; #include