Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp124267imm; Fri, 10 Aug 2018 08:36:20 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyW+ftie6yJQ31hFsX0kDnXIVxAIQlCaSBUMQtRdwDBSqK+FyP0orYPbhix213Avqkb/Gmg X-Received: by 2002:a62:464f:: with SMTP id t76-v6mr7612518pfa.118.1533915380728; Fri, 10 Aug 2018 08:36:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533915380; cv=none; d=google.com; s=arc-20160816; b=JLEkTplryXFSR/yEe0cL2gc0o7Lpv4LyEysJ+/N9jDEG3r596wsp5jXHShxp9K5abi BYGWMxYIOWOOxwiQp82WrgeHOB6C5f2yZl7KDcj5ni/af78/ak0SxYlGvlRPdbYARhUJ MiBOk6Ml539+01uIBvf7u3fZ99HjsTDq60XZwtrm/KL+JB/7EgQUVeetpzhwSQTGbBgA kvtnoNczeu0sH1ENebBopHCaT7hM06RkZXEKTI/wGjj85nMP8PemBknTurcmRQiQV3sT Mykb/RhoY33q/ghMluWwLF/bRcA/m9U3g2hyl1IajyqGygTfqoYsPqX5eIrOImlBN0PH Fi3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=VKSr1XWQ/gAPkObZAAA6FEmoXD0MAQE+StNOKXjfFdA=; b=wVN0UKlajFlOcAmJhgj3OyKRpFLulWZNmSDkZFPDH/R8SD838Q3dFgT79jptH/ezqv 4hPEOMdM9kaiaSdjeUctPhAAwNHEr6mjscBxXLx/g1F7oomNg7zgljUs45dCpJJN5f0x HwBvutKvfmcygzFE9YPs9B0Bh3vxoc2UX2gh61sgeMECvdK3FPNbAmhTlyeH13wTI6S5 ABGQfVt0jgA3eBt0dzbo4Do1/u3fmYhaOnhVwhVFqUGVTTdOq9WU/0pOMLh0c/VOwsqu wt+bSWkdaT62m9IZRdFuHae0XpxqZzQvI0/7bWAkjX0n0nqJdRux5wSsCeybMBgCAFAp rtMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=q9sFyPLD; 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 j33-v6si10564194pgm.584.2018.08.10.08.36.05; Fri, 10 Aug 2018 08:36:20 -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=fail header.i=@gmail.com header.s=20161025 header.b=q9sFyPLD; 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 S1728253AbeHJQhz (ORCPT + 99 others); Fri, 10 Aug 2018 12:37:55 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:42038 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727432AbeHJQhy (ORCPT ); Fri, 10 Aug 2018 12:37:54 -0400 Received: by mail-pg1-f196.google.com with SMTP id y4-v6so4456883pgp.9 for ; Fri, 10 Aug 2018 07:07:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=VKSr1XWQ/gAPkObZAAA6FEmoXD0MAQE+StNOKXjfFdA=; b=q9sFyPLDo3efRcuOHXEWdqBD5khAdbnb50KpNc3bWz823BGkVTU+STmkHwhefb5ivj pwKe7edQCfc/8ZOM73CGU0c7l2rE+wzNDI3Cou2G0OmHQPS8CV+iFRI8Oy1LlZt+10VX rGm9oMPIaT1S8V5zIX4z8UI8mm5RanfrF+xN8uWSx64bp5/GMCfRhckNp2x6rOJkt+uL 7hPVdC/pVh1A1HfzBBqv/yhL12dNGO+rW49tXH3RDAouI26KgzrINOpRZ0JMTS3bE8Af SAttkjFHMWy/HFCzj8DIjdlOj4MUpQ6et71Rmcv9T8pqnlrh6AqWjXZxAD2ahsypKxZL h5mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=VKSr1XWQ/gAPkObZAAA6FEmoXD0MAQE+StNOKXjfFdA=; b=hh3Vgtv6IqtjuoiBSFeN+bVZ3WSObn40dO1tO3Ww8CCJDM7shjoEjUrthbr+b1SzRh bDkyYUc6J8JBJhNwXh9rCTaO6ToRtyT2q2yeFRrmUR81F+e2w+DQ9DtNOTN5TXzNu3ET qUdi11CoHn1Z3OM3j2QiZmZ+wp7omsNSEe4lRWVhmRa3icq7ChyDd4tqTsfTUeKqxsWR Q9BDZJSC3GUsWvrsOHWO1ALuu1bPaUHjWf8EiAA5HLZhrijw3E/5L0/LQjbfhMvLU1Sr n2Ixm0yjpnOEYWMkF2EVkf8kfBL586FxoW1dKj7lvXWMSgKIAViZB/NQLurK7YjTNirp zI9A== X-Gm-Message-State: AOUpUlG/RXQog2lGQvUaiPydK6+M2+HZPyCqnxny4LjDyUA8aivTesMa pMUGt4lGuWss2HQhJhjIlI8= X-Received: by 2002:a63:d04f:: with SMTP id s15-v6mr6848842pgi.42.1533910070792; Fri, 10 Aug 2018 07:07:50 -0700 (PDT) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by smtp.gmail.com with ESMTPSA id w72-v6sm18171316pfa.26.2018.08.10.07.07.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 07:07:50 -0700 (PDT) Date: Fri, 10 Aug 2018 07:07:49 -0700 From: Guenter Roeck To: Palmer Dabbelt Cc: Christoph Hellwig , aou@eecs.berkeley.edu, tklauser@distanz.ch, Arnd Bergmann , Andrew Waterman , linux@dominikbrodowski.net, dan.carpenter@oracle.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Marcus Comstedt Subject: Re: [PATCH v3 2/2] RISC-V: Don't use a global include guard for uapi/asm/syscalls.h Message-ID: <20180810140749.GB13061@roeck-us.net> References: <20180809221952.24260-1-palmer@sifive.com> <20180809221952.24260-3-palmer@sifive.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180809221952.24260-3-palmer@sifive.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 09, 2018 at 03:19:52PM -0700, Palmer Dabbelt wrote: > This file is expected to be included multiple times in the same file in > order to allow the __SYSCALL macro to generate system call tables. With > a global include guard we end up missing __NR_riscv_flush_icache in the > syscall table, which results in icache flushes that escape the vDSO call > to not actually do anything. > > The fix is to move to per-#define include guards, which allows the > system call tables to actually be populated. Thanks to Macrus Comstedt > for finding and fixing the bug! > > I also went ahead and fixed the SPDX header to use a //-style comment, > which I've been told is the canonical way to do it. > > Cc: Marcus Comstedt > Signed-off-by: Palmer Dabbelt Tested-by: Guenter Roeck > --- > arch/riscv/include/asm/unistd.h | 5 +++++ > arch/riscv/include/uapi/asm/syscalls.h | 15 +++++++++------ > 2 files changed, 14 insertions(+), 6 deletions(-) > > diff --git a/arch/riscv/include/asm/unistd.h b/arch/riscv/include/asm/unistd.h > index 080fb28061de..0caea01d5cca 100644 > --- a/arch/riscv/include/asm/unistd.h > +++ b/arch/riscv/include/asm/unistd.h > @@ -11,6 +11,11 @@ > * GNU General Public License for more details. > */ > > +/* > + * There is explicitly no include guard here because this file is expected to > + * be included multiple times. See uapi/asm/syscalls.h for more info. > + */ > + > #define __ARCH_WANT_SYS_CLONE > #include > #include > diff --git a/arch/riscv/include/uapi/asm/syscalls.h b/arch/riscv/include/uapi/asm/syscalls.h > index 818655b0d535..690beb002d1d 100644 > --- a/arch/riscv/include/uapi/asm/syscalls.h > +++ b/arch/riscv/include/uapi/asm/syscalls.h > @@ -1,10 +1,13 @@ > -/* SPDX-License-Identifier: GPL-2.0 */ > +// SPDX-License-Identifier: GPL-2.0 > /* > - * Copyright (C) 2017 SiFive > + * Copyright (C) 2017-2018 SiFive > */ > > -#ifndef _ASM__UAPI__SYSCALLS_H > -#define _ASM__UAPI__SYSCALLS_H > +/* > + * There is explicitly no include guard here because this file is expected to > + * be included multiple times in order to define the syscall macros via > + * __SYSCALL. > + */ > > /* > * Allows the instruction cache to be flushed from userspace. Despite RISC-V > @@ -20,7 +23,7 @@ > * caller. We don't currently do anything with the address range, that's just > * in there for forwards compatibility. > */ > +#ifndef __NR_riscv_flush_icache > #define __NR_riscv_flush_icache (__NR_arch_specific_syscall + 15) > -__SYSCALL(__NR_riscv_flush_icache, sys_riscv_flush_icache) > - > #endif > +__SYSCALL(__NR_riscv_flush_icache, sys_riscv_flush_icache) > -- > 2.16.4 >