Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2101638ybh; Fri, 13 Mar 2020 12:53:03 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsVeYGo4e/i884VfP8eTRKe5BKT4d/QyrlcavSr3YKOZ3KCdHOOz+5CbLEXQ6glKDzjUqiC X-Received: by 2002:a9d:2f26:: with SMTP id h35mr11897213otb.246.1584129183562; Fri, 13 Mar 2020 12:53:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584129183; cv=none; d=google.com; s=arc-20160816; b=Y0eGe8iEjVM9PsoSCya7+uBdW9tQHlSky0Qt7yqvK57GIwfvI+psE8GSR00somZwMV QXDyMrBkW+xAxK49rLrberjbfN56B6vZBGZcMGQdWLkJksltOXnEvVqqB+CgViBnz3Z3 1pbF9JZv7ScZAA2SrgM1AwamrjL8rzu7U0fqYuVRh+P/tjrUbsd1zKKun0IR52YYaqAf 1U8c8JYlS/+jojEoG9MK9WDEy9nz6Ii9BMTQcgyYLWcEFRqj5tZWY2HVk8qtFlbx3m9N n4nOm7DvRtp9Y+gax/JPPVD0q6zYbskTmNf7u1gwWfHM7BNrRa8V/Zsdwa6zejsdeafb uxaw== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=avGZMSb1iKPVA/GqEJwtJuNvc7eOmE5dr3Lq8Ilmmas=; b=lVSSuKmWufCd4DkSySRSCVO+nNEZgStERL4BmGwJucQJP5FU5cU8aapfmVK4JCJCyz LdifebxC+0dnTy3d/DoebwU4FOai6VctABkh2s76K067yhKCJmeeqejVmY3G8SSPukty s7ZN/WIFokW4KjgdyTkZM8+n8p/1nF4XiIIu39NlUc5XE5qBRQO+x1K6H9yGpxiuOWSo iDqO28VN6TniLu8HXa3pcm64/3R5N/vdIZbl5qmKVkc/7WolNhyx9kaMxot/vu6lp5xL jKD6WhQItbkTe0XxHMQYzrTIouJDLAInlzC7bZ1mt319UGRRiMnFzU8sw3PsIXXfMZX+ cGrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="f9J5/iM3"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a64si5235766oif.256.2020.03.13.12.52.51; Fri, 13 Mar 2020 12:53:03 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="f9J5/iM3"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727433AbgCMTwW (ORCPT + 99 others); Fri, 13 Mar 2020 15:52:22 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:43350 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727360AbgCMTwU (ORCPT ); Fri, 13 Mar 2020 15:52:20 -0400 Received: by mail-qk1-f193.google.com with SMTP id x1so9844005qkx.10 for ; Fri, 13 Mar 2020 12:52:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=avGZMSb1iKPVA/GqEJwtJuNvc7eOmE5dr3Lq8Ilmmas=; b=f9J5/iM3PgfIkqO/AiGdyq4Gu9JzJCDiT5ITcoEngsbfougYp3zQP0qR6uuFds017n +RPptc79ZAM02I6n4Q0uULlk+Dx8DoI7AD5yUkWTvQPVaZRTg0Ba79FfI+ahmWTTHCrT 86Dxswo/ZIZPMOW6HFh9qYBWP91MoaRtwCX/qhU1xsPzZZQse3lAv+v412+zpIpSOSTr U7XEXz+Hby76Q4ba39iFSwg6zRagZ6H233bi6zK8q2vN3bqKRL4VpNbtQe1PG1ncbyaj fP0/J+zk4Y8uHiyYZGPAWP+7cYQSBj9b8xK/0577Mhax69Wf33QwynEQEjBMSc5CcArv CaVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=avGZMSb1iKPVA/GqEJwtJuNvc7eOmE5dr3Lq8Ilmmas=; b=ukIS8X+CWXlD0pUs3qMmr3vYP7nDAEy9yrxIvPSJIUJVh90yCMA68ZjbeGr+30t4T3 Gfc5RrAsskf+tdsErIA4YUxaAqJulnK/2/WCKLFi5FhW5STrX4J3o5dTVdoipCZQmmN/ GeNC+vanI4hlYz8bPTKTd+OBd2QLksMjFQkyBkqKCWNvVGeVQrUtKz4hNm2rjgW9cTQA QCObm+uSLFOxOEiE6tXME7aPG6kYK62aDFaTbWsuDEuNaM8v8EOnpHoP6BZfLffqc9W+ FpuzuU7yvfZkYstE1hnYKWC3BZjin8ymdtDKy5HkHg/K07XMx+5d/GCXbrCVv+Iv4/2r AE4Q== X-Gm-Message-State: ANhLgQ3kSSCR3bMEivmaW5lxntux56MV6CN2Q+j6T+1NiAIOKasxTY/k Rvzx4C85Jbqqi9PJdAlzLKNj0jU= X-Received: by 2002:a37:b045:: with SMTP id z66mr12729420qke.297.1584129138588; Fri, 13 Mar 2020 12:52:18 -0700 (PDT) Received: from localhost.localdomain (174-084-153-250.res.spectrum.com. [174.84.153.250]) by smtp.gmail.com with ESMTPSA id i28sm31475599qtc.57.2020.03.13.12.52.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2020 12:52:18 -0700 (PDT) From: Brian Gerst To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , Andy Lutomirski , Dominik Brodowski , Brian Gerst Subject: [PATCH v4 07/18] x86-64: Split X32 syscall table into its own file Date: Fri, 13 Mar 2020 15:51:33 -0400 Message-Id: <20200313195144.164260-8-brgerst@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200313195144.164260-1-brgerst@gmail.com> References: <20200313195144.164260-1-brgerst@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since X32 has its own syscall table now, move it to a separate file. Signed-off-by: Brian Gerst --- arch/x86/entry/Makefile | 1 + arch/x86/entry/syscall_64.c | 27 ++------------------------- arch/x86/entry/syscall_x32.c | 26 ++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 25 deletions(-) create mode 100644 arch/x86/entry/syscall_x32.c diff --git a/arch/x86/entry/Makefile b/arch/x86/entry/Makefile index 06fc70cf5433..85eb381259c2 100644 --- a/arch/x86/entry/Makefile +++ b/arch/x86/entry/Makefile @@ -14,4 +14,5 @@ obj-y += vdso/ obj-y += vsyscall/ obj-$(CONFIG_IA32_EMULATION) += entry_64_compat.o syscall_32.o +obj-$(CONFIG_X86_X32_ABI) += syscall_x32.o diff --git a/arch/x86/entry/syscall_64.c b/arch/x86/entry/syscall_64.c index 058dc1b73e96..efb85c6dce13 100644 --- a/arch/x86/entry/syscall_64.c +++ b/arch/x86/entry/syscall_64.c @@ -8,14 +8,13 @@ #include #include +#define __SYSCALL_X32(nr, sym, qual) + #define __SYSCALL_64(nr, sym, qual) extern asmlinkage long sym(const struct pt_regs *); -#define __SYSCALL_X32(nr, sym, qual) __SYSCALL_64(nr, sym, qual) #include #undef __SYSCALL_64 -#undef __SYSCALL_X32 #define __SYSCALL_64(nr, sym, qual) [nr] = sym, -#define __SYSCALL_X32(nr, sym, qual) asmlinkage const sys_call_ptr_t sys_call_table[__NR_syscall_max+1] = { /* @@ -25,25 +24,3 @@ asmlinkage const sys_call_ptr_t sys_call_table[__NR_syscall_max+1] = { [0 ... __NR_syscall_max] = &__x64_sys_ni_syscall, #include }; - -#undef __SYSCALL_64 -#undef __SYSCALL_X32 - -#ifdef CONFIG_X86_X32_ABI - -#define __SYSCALL_64(nr, sym, qual) -#define __SYSCALL_X32(nr, sym, qual) [nr] = sym, - -asmlinkage const sys_call_ptr_t x32_sys_call_table[__NR_syscall_x32_max+1] = { - /* - * Smells like a compiler bug -- it doesn't work - * when the & below is removed. - */ - [0 ... __NR_syscall_x32_max] = &__x64_sys_ni_syscall, -#include -}; - -#undef __SYSCALL_64 -#undef __SYSCALL_X32 - -#endif diff --git a/arch/x86/entry/syscall_x32.c b/arch/x86/entry/syscall_x32.c new file mode 100644 index 000000000000..d144ced7f582 --- /dev/null +++ b/arch/x86/entry/syscall_x32.c @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0 +/* System call table for x32 ABI. */ + +#include +#include +#include +#include +#include +#include + +#define __SYSCALL_64(nr, sym, qual) + +#define __SYSCALL_X32(nr, sym, qual) extern asmlinkage long sym(const struct pt_regs *); +#include +#undef __SYSCALL_X32 + +#define __SYSCALL_X32(nr, sym, qual) [nr] = sym, + +asmlinkage const sys_call_ptr_t x32_sys_call_table[__NR_syscall_x32_max+1] = { + /* + * Smells like a compiler bug -- it doesn't work + * when the & below is removed. + */ + [0 ... __NR_syscall_x32_max] = &__x64_sys_ni_syscall, +#include +}; -- 2.24.1