Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp295137imu; Mon, 19 Nov 2018 22:44:32 -0800 (PST) X-Google-Smtp-Source: AFSGD/XyQaQ+he92roL18ESdhX4oBy0ib6bC04n+go9C4IRWATrTOO+GY8kDer7cxh61+ucg7uQA X-Received: by 2002:a17:902:887:: with SMTP id 7mr971889pll.164.1542696272272; Mon, 19 Nov 2018 22:44:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542696272; cv=none; d=google.com; s=arc-20160816; b=MiJwEH31LKsrZpBSQ1CnQl2PqeLgT6P+FCPwlGSGEELyxgnu6OO+sRqFfneKpdQ6rw tn3/CfGykb6Sf01yzL5W18ipLMTXaNe/jOPv36i8zKpDJqI6Wi+I8jBIOQD/6mduxbpS TKsEc+E95eCsGA7OMUmKp7TWc47yU9MBxVQTQ0iKaxWFLhqUuXfHVOAJiRQge2q761im zb4e+99KQek74jZanNKl26/5HItd9q/Y/mM/76SnHYdACUGdLMEg3BGrp8c9jsGLhYoq zkb5Z4K9bsSvvhyLoPGp5n1ZZ3L9GBliPefW6XlqZIfKOBkE8J7vs07uhbwiadwyU/jI 7uaA== 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=JLe0vHfmoqtCyZ5txdsfsOS6gzKRYIMzVK3kdH4JNM0=; b=IO19ShZc0aFXJEfVTmB4td0MNfkctDKJ/Cw4UHc4zyjRpmuqiBjbWG93KdDw+IBKdo DO+i9NgFmpcfXqqIqDAQpzUMXrfyRJ43Q4CFNWUqDVQ/wqjqLXetZ7mvdlSNPE1lhm5h kj2SmnfC0mGpqpQLe9yhs54902VnJwdOA3uARbHuTGPx7KRHl3wkHryKMa+HHPbHKu+U vvCdbhkgv5GZcROc02Wv7bdhwKp3cUDCf8ZiZZvDkKvGk7CANFSkIjmICPgVuDki6k9t yrDjyMD2nnvUVkeppgsVuiylOVD1Ac/qMUKf1Xhv/l00cENjCjyVeSUJmjCPo5NrcJOE YCBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RseZA7eG; 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 x9si43330505pge.76.2018.11.19.22.44.16; Mon, 19 Nov 2018 22:44:32 -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=RseZA7eG; 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 S1731632AbeKTRJu (ORCPT + 99 others); Tue, 20 Nov 2018 12:09:50 -0500 Received: from mail-it1-f195.google.com ([209.85.166.195]:56264 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728703AbeKTRJu (ORCPT ); Tue, 20 Nov 2018 12:09:50 -0500 Received: by mail-it1-f195.google.com with SMTP id o19so1818140itg.5 for ; Mon, 19 Nov 2018 22:42:20 -0800 (PST) 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=JLe0vHfmoqtCyZ5txdsfsOS6gzKRYIMzVK3kdH4JNM0=; b=RseZA7eGWURaXAjaCT4AaNorCFWlXXzdhDxROWqiMEiWFevE+dzqQr4Vji0hORKE0l eK8C65QsQ9HUAgZAh/7T1J/4RBBUPqTmRRe22wfuG77i8TCWicVSOP5vSeg+5RdL+oQk Bt2dgclJQVVcHwr67ThCNSQZGjo3xxwCQvhTw= 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=JLe0vHfmoqtCyZ5txdsfsOS6gzKRYIMzVK3kdH4JNM0=; b=MSecCyL1tJ/WS5HG/G4s+GqXQJXtGsnyVOTdgCcVTrUsskKfKvxrLjMX01f7QJTM5d 35I9qz8O5qjeE2W7ThC7mAy6X1Ns8HSdk/SfjrT0BRLucGrv6UjE97h3G06JpMjNeXsz HiqrVhlz1atnvON8bnXkU3SQkEbKF+aeGymyry2z5Jl4hVHBvK7Uj/GnNjobSqpY4kW9 zEWf6J7XetzzCq7eFmDhvB8noV9u1bCgq+yHZ1NciZtGhjm7S6Pt2dWW4U/+N81yKInH fP6HEpJJvSDMH1OH/bn7ElkOR6bkxUkb/aZlUhLL1L7Q5qUAgLXyp67nLmIHW6QkbCKt eUMQ== X-Gm-Message-State: AGRZ1gKdVilScwbTqffS+45AE2i10UyqysxzrJYzR6d+SrjM8jgAlwv1 Nvd6xAOVDfYbWj9wpFYKPxHuYKgsxJhCQmyRm+ASFA== X-Received: by 2002:a05:660c:a1a:: with SMTP id e26mr1097947itk.83.1542696140027; Mon, 19 Nov 2018 22:42:20 -0800 (PST) MIME-Version: 1.0 References: <1542262461-29024-1-git-send-email-firoz.khan@linaro.org> <1542262461-29024-2-git-send-email-firoz.khan@linaro.org> In-Reply-To: From: Firoz Khan Date: Tue, 20 Nov 2018 12:12:08 +0530 Message-ID: Subject: Re: [PATCH v2 1/5] mips: add __NR_syscalls along with __NR_Linux_syscalls To: Arnd Bergmann Cc: Ralf Baechle , Paul Burton , James Hogan , "open list:RALINK MIPS ARCHITECTURE" , Thomas Gleixner , Greg Kroah-Hartman , Philippe Ombredanne , Kate Stewart , y2038 Mailman List , Linux Kernel Mailing List , Linux-Arch , 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 Arnd, On Mon, 19 Nov 2018 at 21:22, Arnd Bergmann wrote: > > On Thu, Nov 15, 2018 at 7:14 AM Firoz Khan wrote: > > > > The 2nd option will be the recommended one. For that, I > > added the __NR_syscalls macro in uapi/asm/unistd.h along > > with __NR_Linux_syscalls. The macro __NR_syscalls also > > added 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. We also need to enclose > > this macro with #ifdef __KERNEL__ to avoid side effects. > > I fear this doesn't work the way you hoped: > > > --- a/arch/mips/include/uapi/asm/unistd.h > > +++ b/arch/mips/include/uapi/asm/unistd.h > > @@ -391,16 +391,19 @@ > > #define __NR_rseq (__NR_Linux + 367) > > #define __NR_io_pgetevents (__NR_Linux + 368) > > > > +#ifdef __KERNEL__ > > +#define __NR_syscalls 368 > > +#endif > > We now have three different definitions of __NR_syscalls, > one for each ABI. User space previously saw the correct > one (now it doesn't see any, but that's ok). > > > /* > > * Offset of the last Linux o32 flavoured syscall > > */ > > -#define __NR_Linux_syscalls 368 > > +#define __NR_Linux_syscalls __NR_syscalls > > so this part part again is ok. > > > #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ > > > > #define __NR_O32_Linux 4000 > > -#define __NR_O32_Linux_syscalls 368 > > +#define __NR_O32_Linux_syscalls __NR_syscalls > > but this part is not: Now __NR_O32_Linux_syscalls is defined > to __NR_syscalls, which may be one of the three values. > Any usage of __NR_O32_Linux_syscalls in a 64-bit kernel > is then clearly wrong. > > > #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ > > > > #define __NR_N32_Linux 6000 > > -#define __NR_N32_Linux_syscalls 332 > > +#define __NR_N32_Linux_syscalls __NR_syscalls > > Same for this one. Thanks for the feedback. Will address all the comments. Firoz > > Arnd