Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2102615ybh; Fri, 13 Mar 2020 12:54:01 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuR+U6tyUNLC9UvGFQV2K7ucElUz+Fx7hjemyMNBum0xuQV2Dq+cNMVKBB9pKpsGI92UzJV X-Received: by 2002:aca:ed4b:: with SMTP id l72mr7681887oih.95.1584129241834; Fri, 13 Mar 2020 12:54:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584129241; cv=none; d=google.com; s=arc-20160816; b=ovFAoHrHAkRpjlsFcv5oc7E4ufyzQbe5YFc+cSL7bFu2hcJ3Z1ktnai5zS3JS6oipX fTF9Nq7ewt5aerDoVn2WY75Sehz55aekZIfnKf4/tsVrOvNSn4GfoYc9GHPuF7KKF6fQ qCuh/a2yYUBg/Z7/HhZICeSXtbbpFXuIft2Ir56j33/K1oXdlbwBicoKEevYSM8xINWW AUAz/VywNbm02aVxx5AJVfejelfi7XRLdV+LrMW7K+XjtLWaJezv7y7Vc8VQ4NnAwk/m iXxj66bKqTU9G0Fl2GvC3iiCKbUkGOLHblmTIgMJcFmwJe6X/RIQrAE4XF7QfoYumfOA cO/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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=K9ou2grAHoRiRwhqAV4lvqbe3cCcX01SZvcbrB6jjJY=; b=0d1N+bNso5Q9sjBRMHdSWxYOUTqYNET2ACdXXenmbTe+2J841vo1kqOSTJ6k0iaKOb zYxq33dRTssZtEeTUkThnZtXrXXBWqGIJ+0ACn0wnwzDuR/wlRcb4+vbp0+GOBDtf76+ yCGpTNzFK4i0AWZlsYMOMLW+75frE3pYnsOk8jcrALsj4oINci81onLcJLPYB6QlYJMQ Fm0WNMc/bdCPQdH4szhEwihrwVKYjfPncgpsi8fub1waVXp9/uJWeLDgUovHEqNGs/fq ScNZm5QuyCC0KeplM9Zj3KIGtT7v9z6wBt5qJmhYSPnl4FzYDcX5GzjPb+7yWxsGlpuo xsOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UCbm2yN7; 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 g19si3035294otn.219.2020.03.13.12.53.49; Fri, 13 Mar 2020 12:54:01 -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=UCbm2yN7; 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 S1727604AbgCMTxH (ORCPT + 99 others); Fri, 13 Mar 2020 15:53:07 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:46109 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727386AbgCMTwS (ORCPT ); Fri, 13 Mar 2020 15:52:18 -0400 Received: by mail-qt1-f196.google.com with SMTP id t13so8605315qtn.13 for ; Fri, 13 Mar 2020 12:52:17 -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=K9ou2grAHoRiRwhqAV4lvqbe3cCcX01SZvcbrB6jjJY=; b=UCbm2yN7uaQejw2flDriMY/LSjTshDU5WtvJkOtSAGAbC7A514WKwV/ph3HqHRg9vS y49wYABqSd98f54S7oUT4HQkftM+0x9Y6UHjBgNpfeROvD1mFktzjxiGYmCGW7WQsmzG dql5X8lY2Gi5MxtEWD8XKDOLG7RX0A/OOxE4eBgMfgNWkYvzNRHf95zvRN5raW+wloJV CNrUXm28gzyG+lH8SufySBS+5DJfAzKcdtiz8Tw8j5kN/5N+j6fCWODlBNHh5KjNfGzF sLs0SwWAK7fNHP5pdaK2Ged8lVIrUsTs5bJOHPO6c7PQGbGQUlcFAHPFefyClWlnRiuK anXw== 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=K9ou2grAHoRiRwhqAV4lvqbe3cCcX01SZvcbrB6jjJY=; b=KLZbeDtG2clEznwNr5qaZ2WaH1k/FrE8jLUEBvzLKmK//71+Iq/2/MXBRmEOvESaH+ 6KXxMiWNcAoZQqHJ840N8bSi2t3Ph1OeuiCerKBNydHsFai/sd1i/OlR8BwEsZeOQ4ZV jXwYbMxnmsXCkWi1IIk6xV6dCV/lA1tM6ncGWk/77zuqy9eYI3ATmnRcU+iwXL2zebg1 lO4GZsEpgUOrWUbxA9xDPFheARpOD/BRjq6gRwBp/J0OUnU+WBRvGVje7ph0IdhVDxuM U6vpB5zFfG3L1NDKSp7n+oXR3tY/exCCHKDrO4c5jIRRP+XXt4cmODgxWw14XaVNJ58D GZKA== X-Gm-Message-State: ANhLgQ2kVHirdVvBAhHJeXH43w3lc2EInK/QCynXPDF2sZZjSSb8heOo 5yfDNqQDMWDONLLbLFzIDdCrU9Q= X-Received: by 2002:ac8:2bf8:: with SMTP id n53mr6768841qtn.1.1584129137251; Fri, 13 Mar 2020 12:52:17 -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.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2020 12:52:16 -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 06/18] x86-64: Move sys_ni_syscall stub to common.c Date: Fri, 13 Mar 2020 15:51:32 -0400 Message-Id: <20200313195144.164260-7-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 so it can be available to multiple syscall tables. Also directly return -ENOSYS instead of bouncing to the generic sys_ni_syscall(). Signed-off-by: Brian Gerst --- arch/x86/entry/common.c | 7 +++++++ arch/x86/entry/syscall_64.c | 7 ------- arch/x86/include/asm/syscall_wrapper.h | 3 +++ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c index ec167d8c41cb..c3a8e6513f74 100644 --- a/arch/x86/entry/common.c +++ b/arch/x86/entry/common.c @@ -439,3 +439,10 @@ __visible long do_fast_syscall_32(struct pt_regs *regs) #endif } #endif + +#ifdef CONFIG_X86_64 +SYSCALL_DEFINE0(ni_syscall) +{ + return -ENOSYS; +} +#endif diff --git a/arch/x86/entry/syscall_64.c b/arch/x86/entry/syscall_64.c index adf619a856e8..058dc1b73e96 100644 --- a/arch/x86/entry/syscall_64.c +++ b/arch/x86/entry/syscall_64.c @@ -8,13 +8,6 @@ #include #include -extern asmlinkage long sys_ni_syscall(void); - -SYSCALL_DEFINE0(ni_syscall) -{ - return sys_ni_syscall(); -} - #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 diff --git a/arch/x86/include/asm/syscall_wrapper.h b/arch/x86/include/asm/syscall_wrapper.h index 1d96ccebc0d2..0f126e40a464 100644 --- a/arch/x86/include/asm/syscall_wrapper.h +++ b/arch/x86/include/asm/syscall_wrapper.h @@ -8,6 +8,9 @@ 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); + /* Mapping of registers to parameters for syscalls on x86-64 and x32 */ #define SC_X86_64_REGS_TO_ARGS(x, ...) \ __MAP(x,__SC_ARGS \ -- 2.24.1