Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2140427imm; Tue, 2 Oct 2018 22:10:21 -0700 (PDT) X-Google-Smtp-Source: ACcGV62vJosA6kQleh761tz7brk3mJM4YvY6x/MpP6pGmWeS8i+tMiceGoRcehS1cFFbubk5g+vT X-Received: by 2002:a17:902:8e81:: with SMTP id bg1-v6mr20064688plb.129.1538543421375; Tue, 02 Oct 2018 22:10:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538543421; cv=none; d=google.com; s=arc-20160816; b=gpcoNWtndTCZs0RbxiPSUn+kW6hklTqmMclfAvaybKG8OU1XoolhL8c5z63cXFny1W LOsbBexbFggx3LljbQ/b2ZfVcIIYnqqYTHHR+fq3JtKFxiW8ZXQ4V7uf6TqUoYie9d7P /RMTugXgVlEnT9Xmv8cePxv7SH8pE6rwG+r1ivveBw+SRe5eFayVTc8U2+H8ve7tnUNK ulsr+BNDKRBGQRzea5QjaFUeLR7qRTd2w5wACcE3R+lRZG5Wj7MovCBy8ZRLotpr2FtS k/vRsB34wdt+kOSWfQBGQ6BvgYSZWzkK7fuFyV3zbltO3uzbKhl+H3cQvsbGNcnQE84o eEUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=anJ+xPI0MAtYmnpqO3Wk+YZTmvHEdCMXtPWmZZegg1c=; b=U2IE3BsmhS2oPqmIb9sCv+JYf56F2jafYVtuQD3eML2RrMk89TtrkmK4kSuhdr0ppB 6sAsTWNVg9N8/CfrAThDgyy4XG39rC8rZCLRYlRph+mjUy1cmUQEIqY0C3Zcu7apIv63 MYLeMMYkdWz6pzpoUglEwDPAy3rGTN5b5PHxWIwUujS8qjp5+mD7zL34FASCcBymCu79 YaSx9UJPnQlj+LIkIqVQ+I3YoP7/Y8pg797WYajYPkNMLJafFIOG4kD+fbYvKWA7jUVP BH6nQZVVffr021lH5t3GY/Q+HHGjAFacoa+yPArk+TzKzcAhWhV5x+Ger7phHJ7qJlhT Vl2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=E0nlAxgZ; 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 gn7si269553plb.264.2018.10.02.22.10.06; Tue, 02 Oct 2018 22:10:21 -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=@linaro.org header.s=google header.b=E0nlAxgZ; 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 S1726679AbeJCL4i (ORCPT + 99 others); Wed, 3 Oct 2018 07:56:38 -0400 Received: from mail-yw1-f68.google.com ([209.85.161.68]:47045 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726394AbeJCL4h (ORCPT ); Wed, 3 Oct 2018 07:56:37 -0400 Received: by mail-yw1-f68.google.com with SMTP id j202-v6so1776068ywa.13 for ; Tue, 02 Oct 2018 22:09:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=anJ+xPI0MAtYmnpqO3Wk+YZTmvHEdCMXtPWmZZegg1c=; b=E0nlAxgZaGV6Cul+dUBp6paSP2xeEqmtJGak6fTcSXBkPdtVPlsIiyCplctVSebHL6 Dr2wV9f6K0dn/g+yfr44vLZjTrGMkhCcYD0zyG62C5kqvUnbeoo1wAK6XcejSqkHKA7j 9N4LW5WH2kLp1D/iYCBzvLmyTKgM0OtrZ3lhs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=anJ+xPI0MAtYmnpqO3Wk+YZTmvHEdCMXtPWmZZegg1c=; b=RG9nbvLFSt0NiTeLqMkpEuobWqQugff2l+0fmDQSy2VbXoCGRcOQgcjuMW5F/lG092 V3DKXiMIh+AWeHdok7nsg9V4SiXdsD6z/xkOXGnWM696bJ+rNRo3KyPHxa58jSnUEBbX 7JryMezrWblItua69jOR7Ijx1mONPQepZeZ1XSsafHqEOhvhqiL6+XB5e1JHevFpwmQF JDRs7wNLEF56iW+TA40bf/PUFwj66W4xOvMA35MY+fq168I5f47nytlCCPkInU6/R7Xe LbLfjOHDyRsLfZxT4prRl1jq6FdOvPiUs1MU9npismBdCmieMeomeIxRFl9Jf6HK0fje SAhA== X-Gm-Message-State: ABuFfogo122+0W9/gdRFesS6kJigEkdkdq7CQMqPkayZeCPNucynTi38 J66xe52wpMbJMZDrBmTodv2KoJ0kYM4s0FSnvGbI5Q== X-Received: by 2002:a81:9849:: with SMTP id p70-v6mr5390762ywg.175.1538543391738; Tue, 02 Oct 2018 22:09:51 -0700 (PDT) MIME-Version: 1.0 References: <1533792466-4227-1-git-send-email-firoz.khan@linaro.org> <1533792466-4227-2-git-send-email-firoz.khan@linaro.org> <89533601-366f-ebf4-dc31-996bc649bc51@xilinx.com> In-Reply-To: <89533601-366f-ebf4-dc31-996bc649bc51@xilinx.com> From: Firoz Khan Date: Wed, 3 Oct 2018 10:39:40 +0530 Message-ID: Subject: Re: [PATCH 1/3] microblaze: Replace NR_syscalls macro from asm/unistd.h To: Michal Simek Cc: Greg Kroah-Hartman , Philippe Ombredanne , Thomas Gleixner , Kate Stewart , y2038 Mailman List , Linux Kernel Mailing List , Linux-Arch , Arnd Bergmann , Deepa Dinamani , Marcin Juszkiewicz Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Michal, On Tue, 2 Oct 2018 at 12:37, Michal Simek wrote: > > On 18.9.2018 08:37, Firoz Khan wrote: > > On 9 August 2018 at 12:18, Michal Simek wrote: > >> On 9.8.2018 07:27, Firoz Khan wrote: > >>> __NR_syscalls macro holds the number of system call exist in this > >>> architecture. This macro is currently the part of asm/unistd.h file. > >>> We have change the value of __NR_syscalls, if we add or delete a > >>> system call. > >>> > >>> One of the patch in this patch series has a script which will > >>> generate a uapi header based on syscall.tbl file. The syscall.tbl > >>> file contains the number of system call information. So we have > >>> two option to update __NR_syscalls value. > >>> > >>> 1. Update __NR_syscalls in asm/unistd.h manually by counting the > >>> no.of system calls. No need to update __NR_syscalls untill > >>> we either add a new system call or delete an existing system > >>> call. > >>> > >>> 2. We can keep this feature it above mentioned script, that'll > >>> count the number of syscalls and keep it in a generated file. > >>> In this case we don't need to explicitly update __NR_syscalls > >>> in asm/unistd.h file. > >>> > >>> The 2nd option will be the recommended one. For that, I moved the > >>> NR_syscalls macro from asm/unistd.h to uapi/asm/unistd.h. The macro > >>> name also changed form NR_syscalls to __NR_syscalls for making the > >>> name convention same across all architecture. While __NR_syscalls > >>> isn't strictly part of the uapi, having it as part of the generated > >>> header to simplifies the implementation. > >> > >> This macro was in unistd.h in past but it was moved out because it was > >> causing problem with strace. > >> > >> commit 40c2702a02b755e0183b702778331b351f3be20c > >> Author: Michal Simek > >> AuthorDate: Mon Jul 8 09:50:24 2013 +0200 > >> Commit: Michal Simek > >> CommitDate: Wed Jul 10 07:32:09 2013 +0200 > >> > >> microblaze: Move __NR_syscalls from uapi > >> > >> > >> That's why I don't think this is the right thing to do. > >> I have grepped strace and glibc and none is using this macro that's why > >> I think it shouldn't be exported via uapi. > > > > > > Thanks for you reply :) > > Sorry for the delayed response :( > > > > I would like to keep __NR_syscalls macro to uapi header in order to simplify > > the system call table generation script. Otherwise the __NR_syscalls > > macro need to update manually. That become a problem. > > > > Please check the below implementation in uapi file make sense? > > It is an easy workaround to leave __NR_syscalls macro in uapi/asm/unistd.h > > and enclose it in #ifdef __KERNEL__ > > > > ... > > ... > > #define __NR_pkey_free 397 > > #define __NR_statx 398 > > > > #ifdef __KERNEL__ > > #define __NR_syscalls 399 > > #endif > > ... > > ... > > This should be fine. Thanks for the confirmation! - Firoz > > M