Received: by 10.192.245.15 with SMTP id i15csp1105165imn; Sun, 11 Mar 2018 01:48:13 -0800 (PST) X-Google-Smtp-Source: AG47ELtxypT2NVMG9iKj/ZJJkdPfVhge1Ml1h/3t61w5kPyaWzgXX3Im7/x6uc+G9F+1GVLsScpn X-Received: by 2002:a17:902:bc45:: with SMTP id t5-v6mr4448452plz.56.1520761693253; Sun, 11 Mar 2018 01:48:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520761693; cv=none; d=google.com; s=arc-20160816; b=KQJrQh7Ha9NySp1sOPZlHXxCWn9rVLrX0jKJsbjJydFh0ObvKPUgFPq8rDekkomqT+ KGJXnQ8D+VJQmhuxSkbGu93KNCC7OyMeZoVmoINqv09A0BsDDQlSOkWeJkQ1xsmaJJAe 8pbPJJYty5pTjkK8Jmdo6tDOSidFFu1vvTQEqf1fwrs6L0NWfpWjEGrb6li7T8KbRqTZ yg9FeBrtgPJlSOtXgUpPQwktPTum+H0S8n3gzPB67mo/upcDxctR/ybjgYF19sekq8La 3uOxem1wsHUwmNH4YCukIfZ6YJ13ABd4krHb7fccpEzLTdwmdTboBan/bNInGVQ3J3J7 bwHQ== 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 :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=0zCXHblnKgfFQFM9IQMhKpPkTV/CPEUAM5Tzy3iYtE8=; b=eLORbL9Z41iQ6JcQXNV2KabJiVSZeGZ74z/jQsrDASj9+c2GyEoQCoaBT9TtBekg63 fUDk71LdjQ7q6yxvzw1tCPXbMxgANV9Dvjl63tRdnX82+uNo+UpTs2D359uDeQ0BuLu9 Wt4CiXSM1jtQyRQbhoBaxfRj3TMhf86f/UeSFmi4zRFfShdU0iKtSRgR8CKCbNnvy5mG XSKyYljcpR3WnQqMnmoIeJCEEgBjmZlzuD9vnl9U2Y4Ywrkex/cPwVK5aYyHFeHJtd5n cwyy+GTIVHhicfqxtdeTieoJW0aVsEJv9vsUjX0qPmH1ZIPes39RI5UAxmg5YDaiYr2I Cw5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.co.uk header.s=amazon201209 header.b=cB5r4poO; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.co.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1-v6si4136157pld.236.2018.03.11.01.46.58; Sun, 11 Mar 2018 01:48:13 -0800 (PST) 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=@amazon.co.uk header.s=amazon201209 header.b=cB5r4poO; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.co.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932136AbeCKJnq (ORCPT + 99 others); Sun, 11 Mar 2018 05:43:46 -0400 Received: from smtp-fw-4101.amazon.com ([72.21.198.25]:26884 "EHLO smtp-fw-4101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932110AbeCKJno (ORCPT ); Sun, 11 Mar 2018 05:43:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.co.uk; i=@amazon.co.uk; q=dns/txt; s=amazon201209; t=1520761424; x=1552297424; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:mime-version: content-transfer-encoding; bh=0zCXHblnKgfFQFM9IQMhKpPkTV/CPEUAM5Tzy3iYtE8=; b=cB5r4poOXg+vgM9WY3DDBJoS6sKXaOj7sZX7KDeSGQ1/+nFU8fhpISNk YemwuUKNYM7xJ12q0qTjQvmrsqhfGNFKI/y3dp8VMz0pm5NnzwTjJFOSu NGYwty1Jn/EMO0f6AYGuHqCjAWddtJeTHE1ZSO6ZbSQRNxdkikzZo96/4 s=; X-IronPort-AV: E=Sophos;i="5.47,455,1515456000"; d="scan'208";a="711382997" Received: from iad6-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2b-8cc5d68b.us-west-2.amazon.com) ([10.124.125.6]) by smtp-border-fw-out-4101.iad4.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 11 Mar 2018 09:43:42 +0000 Received: from EX13MTAUEA001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-2b-8cc5d68b.us-west-2.amazon.com (8.14.7/8.14.7) with ESMTP id w2B9han3086575 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Sun, 11 Mar 2018 09:43:39 GMT Received: from EX13D02EUB002.ant.amazon.com (10.43.166.170) by EX13MTAUEA001.ant.amazon.com (10.43.61.82) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Sun, 11 Mar 2018 09:43:38 +0000 Received: from EX13D02EUB001.ant.amazon.com (10.43.166.150) by EX13D02EUB002.ant.amazon.com (10.43.166.170) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Sun, 11 Mar 2018 09:43:38 +0000 Received: from EX13D02EUB001.ant.amazon.com ([10.43.166.150]) by EX13D02EUB001.ant.amazon.com ([10.43.166.150]) with mapi id 15.00.1236.000; Sun, 11 Mar 2018 09:43:38 +0000 From: "Tautschnig, Michael" To: "x86@kernel.org" , "linux-api@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Jaswinder Singh , Andi Kleen Subject: [PATCH v2] x86: always use SYSCALL_DEFINE* Thread-Topic: [PATCH v2] x86: always use SYSCALL_DEFINE* Thread-Index: AQHTuR1t6+xAKmQrs0eoXQ4iLgB3kg== Date: Sun, 11 Mar 2018 09:43:37 +0000 Message-ID: References: <14A5C8D0-3F9D-486F-A20C-55849D70FC80@amazon.com> In-Reply-To: <14A5C8D0-3F9D-486F-A20C-55849D70FC80@amazon.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.43.164.12] Content-Type: text/plain; charset="us-ascii" Content-ID: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org All syscall arguments are passed in as types of the same byte size as unsigned long (width of full registers). Using a smaller type without a cast may result in losing bits of information. SYSCALL_DEFINE* introduce adequate type casts. All definitions of syscalls in x86 except for those patched here have already been using the appropriate SYSCALL_DEFINE*. Signed-off-by: Michael Tautschnig Cc: Thomas Gleixner Cc: Ingo Molnar Cc: H. Peter Anvin Cc: Jaswinder Singh Cc: Andi Kleen --- arch/x86/kernel/ioport.c | 3 ++- arch/x86/kernel/signal.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/ioport.c b/arch/x86/kernel/ioport.c index 2f72330..7db3d65 100644 --- a/arch/x86/kernel/ioport.c +++ b/arch/x86/kernel/ioport.c @@ -23,7 +23,8 @@ /* * this changes the io permissions bitmap in the current task. */ -asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn= _on) +SYSCALL_DEFINE3(ioperm, unsigned long, from, unsigned long, num, int, + turn_on) { struct thread_struct *t =3D ¤t->thread; struct tss_struct *tss; diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c index b9e00e8..40ba242 100644 --- a/arch/x86/kernel/signal.c +++ b/arch/x86/kernel/signal.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -601,7 +602,7 @@ static int x32_setup_rt_frame(struct ksignal *ksig, * Do a signal return; undo the signal stack. */ #ifdef CONFIG_X86_32 -asmlinkage unsigned long sys_sigreturn(void) +SYSCALL_DEFINE0(sigreturn) { struct pt_regs *regs =3D current_pt_regs(); struct sigframe __user *frame; @@ -633,7 +634,7 @@ asmlinkage unsigned long sys_sigreturn(void) } #endif /* CONFIG_X86_32 */ -asmlinkage long sys_rt_sigreturn(void) +SYSCALL_DEFINE0(rt_sigreturn) { struct pt_regs *regs =3D current_pt_regs(); struct rt_sigframe __user *frame; -- 2.7.3.AMZN Amazon Web Services UK Limited. Registered in England and Wales with regist= ration number 08650665 with its registered office at 1 Principal Place, Wor= ship Street, London, EC2A 2FA, United Kingdom.