Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp61970imu; Thu, 3 Jan 2019 14:06:34 -0800 (PST) X-Google-Smtp-Source: ALg8bN4GFU8L96lYKgHKmdaTLvk9uQoNSGxXEv2qNlfgtD/ptVLjsEv6lqHm/05ZcfyriZ05mOyA X-Received: by 2002:a63:9d05:: with SMTP id i5mr17130929pgd.98.1546553194299; Thu, 03 Jan 2019 14:06:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546553194; cv=none; d=google.com; s=arc-20160816; b=jPdeOJbH86LDLOxPC8h/j9TZuJA9cZHqo2uXm5aEIZDlmhSQ/Yfmj7LwGImGBcpF0d Bk8cFA/LI7FiBo9NxgN1I9xjjLVU36oGFMHoTfcVtfEwrdF1PgbEnYq0KFPMFbJ0XXvF lhXK5b+RJsg3cNXW6eGoSYCAKXADcR/lcSHa7dphn9P5QrYm9lQFLjrAd0TXYhfv3aoY dZ0jAulwRoVIc6FnSW45lKf3khZs7Kx2W9jiBrQ6XmhKXKN64cfvggZjTz3volsqzQMM aOHYvZIPp5Kb1G6osQgTfF1YDj3bzFRB5pqvjvVXOtDlaINXYeVnRlbi8zuEvNqLoJhx zKKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=0bH3X0J6XzJKEHd3IWPV5Bt2LeIi1ts8ZcW3nL9dsFI=; b=Ow6uUw00ZY1ozbr6Mj+MJhftbXmB4UWSa7HZzQi7/O55b6t8Th+ckxzDVnEXOJhm39 Q4p2jfjPpMpaADmdCK90qJbH3vq60MLlTVXgolmEEHJGZGLLwzwero2U3jrwY1RCnGYS gfg6tD9eqri7AnrLV1GCcbqnoSbdinKUSwI1i5M2vus0WIZxT/mikHa6Y1UULVBZ5rim zmCQbCAo4tVIKm42AW8yHluib62gya3uIcLgfY11+sWVOm/lzgnOAlmf/Mm5B0KzeBoh yiRFAajpgJUq65Bcad5kHJYV4MQ7NWz5vphqAT5SQqyCNkDzaCvtrmXlonxrfH4WvH4o 0N4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fHY1ctvu; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y20si3374766pgi.50.2019.01.03.14.06.05; Thu, 03 Jan 2019 14:06:34 -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=@linaro.org header.s=google header.b=fHY1ctvu; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732175AbfACPlH (ORCPT + 99 others); Thu, 3 Jan 2019 10:41:07 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:42319 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732153AbfACPlG (ORCPT ); Thu, 3 Jan 2019 10:41:06 -0500 Received: by mail-pf1-f195.google.com with SMTP id 64so16845170pfr.9 for ; Thu, 03 Jan 2019 07:41:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0bH3X0J6XzJKEHd3IWPV5Bt2LeIi1ts8ZcW3nL9dsFI=; b=fHY1ctvuiaGSd8UW+EECMkQmbER0XrC799xUDx4r4OArQJImxYlGI9hDLmCzAqcAFc LCOgU5W5YQiIkwIBK8+0w/UJ9s7nPqmOODHa0pMp39VsATUXItaR43pRotTLlijWPnQF CiK+bNB4/zPIZspcj4QJo8YJZrHHwqj+Mg9zs= 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; bh=0bH3X0J6XzJKEHd3IWPV5Bt2LeIi1ts8ZcW3nL9dsFI=; b=rZgFrSVvZz7TUQMtuHSGIhu4E7hx6F26SeNeXSbpuZsKiq3x5WGpzFulZAUk/vZRpW Va34wD2818HvbQ1vTZMkUDppahGy7G/ecKbLPd/taKNoJI7FTtqkj/gy/1nWf0322A0P HagvNVgOudAR8BGIUYh6XYFrhJcub7z35PayXfwBKeBKtdcyMhfg0znjZ7mNN1vvZCtK Cv9M2vdf4ayXo+Pcf0bnOo0kKHeXYtGfxLRglFIDVwjUVW+WdeAWpWyQ3qv9vblqRsFc /Euh/kGnnoNPnOy2PCyGuXwIgE1k+V409ow3EwsLMeI+NbIY1hhgYESzbuvk+Rlrng8B FJ8g== X-Gm-Message-State: AJcUukcDCEiOy0Dox2WAMxf00wp/ewctkprT1caB2TZolwynUliqIND8 As1W/s7LqK+byDb0zpgJSBD7Rg== X-Received: by 2002:a63:77ce:: with SMTP id s197mr17289837pgc.89.1546530065375; Thu, 03 Jan 2019 07:41:05 -0800 (PST) Received: from qualcomm-HP-ZBook-14-G2.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id w10sm66155494pgi.81.2019.01.03.07.41.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Jan 2019 07:41:04 -0800 (PST) From: Firoz Khan To: Catalin Marinas , Will Deacon , Stefan Agner , Mathieu Desnoyers , Russell King , linux-arm-kernel@lists.infradead.org, Greg Kroah-Hartman , Philippe Ombredanne , Thomas Gleixner , Kate Stewart Cc: y2038@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, arnd@arndb.de, deepa.kernel@gmail.com, marcin.juszkiewicz@linaro.org, firoz.khan@linaro.org Subject: [PATCH 2/3] arm64: assign __NR_*_Linux_syscalls generated by the scripts Date: Thu, 3 Jan 2019 21:10:24 +0530 Message-Id: <1546530025-26014-3-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1546530025-26014-1-git-send-email-firoz.khan@linaro.org> References: <1546530025-26014-1-git-send-email-firoz.khan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Assign the generated values - __NR_C32_Linux_syscalls and __NR_64_Linux_syscalls instead of __NR_compat_syscalls and __NR_syscalls respectively. It is better than hard coding it. One of the patch in the patch series will generate the headers and calculate the total number of syscalls that can be assigned. Otherwise the hard coded values need to be changed whenever we either add a new system call or delete a existing system call. Signed-off-by: Firoz Khan --- arch/arm64/include/asm/unistd.h | 10 ++++++---- arch/arm64/kernel/sys.c | 4 ++-- arch/arm64/kernel/sys32.c | 4 ++-- arch/arm64/kernel/syscall.c | 4 ++-- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h index b13ca091..fca2186 100644 --- a/arch/arm64/include/asm/unistd.h +++ b/arch/arm64/include/asm/unistd.h @@ -13,6 +13,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + +#include +#include + #ifdef CONFIG_COMPAT #define __ARCH_WANT_COMPAT_STAT64 #define __ARCH_WANT_SYS_GETHOSTNAME @@ -42,14 +46,12 @@ #define __ARM_NR_COMPAT_BASE 0x0f0000 #define __ARM_NR_compat_cacheflush (__ARM_NR_COMPAT_BASE+2) #define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE+5) - -#define __NR_compat_syscalls 399 #endif #define __ARCH_WANT_SYS_CLONE +#define __ARCH_WANT_RENAMEAT +#define __ARCH_WANT_NEW_STAT #ifndef __COMPAT_SYSCALL_NR #include #endif - -#define NR_syscalls (__NR_syscalls) diff --git a/arch/arm64/kernel/sys.c b/arch/arm64/kernel/sys.c index b44065f..f4ee0f5 100644 --- a/arch/arm64/kernel/sys.c +++ b/arch/arm64/kernel/sys.c @@ -62,7 +62,7 @@ #undef __SYSCALL #define __SYSCALL(nr, sym) [nr] = (syscall_fn_t)__arm64_##sym, -const syscall_fn_t sys_call_table[__NR_syscalls] = { - [0 ... __NR_syscalls - 1] = (syscall_fn_t)sys_ni_syscall, +const syscall_fn_t sys_call_table[__NR_64_Linux_syscalls] = { + [0 ... __NR_64_Linux_syscalls - 1] = (syscall_fn_t)sys_ni_syscall, #include }; diff --git a/arch/arm64/kernel/sys32.c b/arch/arm64/kernel/sys32.c index 0f8bcb7..772eaf2 100644 --- a/arch/arm64/kernel/sys32.c +++ b/arch/arm64/kernel/sys32.c @@ -143,7 +143,7 @@ #undef __SYSCALL #define __SYSCALL(nr, sym) [nr] = (syscall_fn_t)__arm64_##sym, -const syscall_fn_t compat_sys_call_table[__NR_compat_syscalls] = { - [0 ... __NR_compat_syscalls - 1] = (syscall_fn_t)sys_ni_syscall, +const syscall_fn_t compat_sys_call_table[__NR_C32_Linux_syscalls] = { + [0 ... __NR_C32_Linux_syscalls - 1] = (syscall_fn_t)sys_ni_syscall, #include }; diff --git a/arch/arm64/kernel/syscall.c b/arch/arm64/kernel/syscall.c index 032d223..4e50b1a 100644 --- a/arch/arm64/kernel/syscall.c +++ b/arch/arm64/kernel/syscall.c @@ -127,13 +127,13 @@ static inline void sve_user_discard(void) asmlinkage void el0_svc_handler(struct pt_regs *regs) { sve_user_discard(); - el0_svc_common(regs, regs->regs[8], __NR_syscalls, sys_call_table); + el0_svc_common(regs, regs->regs[8], __NR_64_Linux_syscalls, sys_call_table); } #ifdef CONFIG_COMPAT asmlinkage void el0_svc_compat_handler(struct pt_regs *regs) { - el0_svc_common(regs, regs->regs[7], __NR_compat_syscalls, + el0_svc_common(regs, regs->regs[7], __NR_C32_Linux_syscalls, compat_sys_call_table); } #endif -- 1.9.1