Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2906080imu; Mon, 19 Nov 2018 07:54:11 -0800 (PST) X-Google-Smtp-Source: AJdET5fEbm0L2ptjwwdpcC7xbSis9/KLlqtLUh+/S7LfWPPnmrMlicfmJ6iK57M4tj3qpr/WAyvu X-Received: by 2002:a17:902:107:: with SMTP id 7-v6mr23139438plb.267.1542642851547; Mon, 19 Nov 2018 07:54:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542642851; cv=none; d=google.com; s=arc-20160816; b=LQykLdmy152KrIqDLqWz0mpR+SO24czFNMK/2dP52VZGP9H5HxqgY8cIV58BdtHsOY CmQi4X4hlrBIrt0r9iS4StfTfGAxSygPNa/PjLexOhK3EikXupKzOfxY4DHXvyFJJ2+r uKH6dWdFDkDDc3nT1vRgTU+29xMZz4zQ+sFNzwxqpqP9QLuGztueXkp8YgbQVOpWQzBG 0lH8LGct0uQGmCZT89jKH7WnVxWtCnhVmKns0/cGEp/JhQPsioFnPQqaXCNEQ4XGGneY SZrh+bhqadoElmsJdq8Q0/xFQmgenx4P9bZb32JLmBOKgiYnd2wtfrYOAcSEbec2QFVr LH7w== 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; bh=o+5bJn4B66njPBzARi8LUL9emGuyKZAzXJwIQjlDvtM=; b=gGYbNubfMYwSkLW+a3cZuiHU21QtXha0kqVjZXa/q1e7KNAWC/Baawiw6qwoJp6RmP yej+QmwsiQ6LyEAnlWtCaoMW+55Or0X1f/o39W51w5mSShu5sXlMuGTah5hJ+ETCuOnQ ovmtgNIW3JREI0XUktpFoTr2XE6DDEXAF1TwxNxTvRzuvVHjkmDEliJwZBwSjyanjZE+ nDxVaqSxMUXKD1VEoKX9RXVd7e8OdmKb01M8kcDkU8JHqC8xLTjAehWhkGMM18DOpio/ 7LHaGZDNAF1LjBMSEeFbD4YlJJBGBZv/dSdChrOS7FSs++pHQsRgUK736OZPp/O8/j3z IMhA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7si22402117pgv.499.2018.11.19.07.53.57; Mon, 19 Nov 2018 07:54:11 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729910AbeKTCQB (ORCPT + 99 others); Mon, 19 Nov 2018 21:16:01 -0500 Received: from mail-qk1-f194.google.com ([209.85.222.194]:41081 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729762AbeKTCQB (ORCPT ); Mon, 19 Nov 2018 21:16:01 -0500 Received: by mail-qk1-f194.google.com with SMTP id 189so49304113qkj.8; Mon, 19 Nov 2018 07:52:02 -0800 (PST) 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=o+5bJn4B66njPBzARi8LUL9emGuyKZAzXJwIQjlDvtM=; b=lBeuZt+b4+fODvHY8iGs0U4C4EIwr4Lm9tMlPin/V7HgBrvtq34amWwfcT6bAP6ybC eECS8GYuWJFes6cgMdgO0DNgq/FcpdZ8g7uNFP0rPiw5C3Mi7A1FbGfun/DBAGZ0PFUh KxhyGsmvcBvGYfOtIZuT9O95NVbX+ny4aCtlZgkauSaV2WIeoziFOMkXh1tQTSQT6t1u a/FeIlQ51k/Lse8jQHgj6U+yVII+GzhrHCwwcMRIcPMeyC9uVxmajAXQoMMVKKXCb+UZ f+dgnXN2m69KvXEhGTyGGYnyZU6ShCVf4UxWE27eQjqt49wWhWMQkkkGKts+n0T39Gj2 cHSw== X-Gm-Message-State: AGRZ1gIvZ/q8TwZl2i4uuux6WCiNlZhX860X8/xSSxXfhwAKfcqYbUQZ LsgdirbZDLtRe8toUM2RbpR3rFZ3mXEP/8fOO5g= X-Received: by 2002:a0c:dc0f:: with SMTP id s15mr21441655qvk.40.1542642721554; Mon, 19 Nov 2018 07:52:01 -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: <1542262461-29024-2-git-send-email-firoz.khan@linaro.org> From: Arnd Bergmann Date: Mon, 19 Nov 2018 16:51:44 +0100 Message-ID: Subject: Re: [PATCH v2 1/5] mips: add __NR_syscalls along with __NR_Linux_syscalls To: Firoz Khan Cc: Ralf Baechle , Paul Burton , James Hogan , "open list:RALINK MIPS ARCHITECTURE" , Thomas Gleixner , gregkh , 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 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. Arnd