Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3968399imm; Mon, 6 Aug 2018 14:02:43 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzIG7DMYviCZinl5pV6pmO2sWkN9aUIA5uvBO7PozZmUow9PCM2gSYsO5ceqsFOJ0yK93Ve X-Received: by 2002:a62:d113:: with SMTP id z19-v6mr273274pfg.98.1533589363291; Mon, 06 Aug 2018 14:02:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533589363; cv=none; d=google.com; s=arc-20160816; b=yHg16PrjYao57vY9+XiRyeUNWSLa7VVj+cIaMv8qRImtkJpQEHVSK3nMcUQBkDF5xQ hzdb6MXK5S3Ak9YVxofuRL3o6bLVFHYyxhtWW2di2K9JRyLqm5qe0Z1brUm2+hSqEezz uqRQWBm990pbjj9pWOcqFLwARYw1TkH3+KSjpG3Syw5nXk9315YF18dlhTIgeRjfsxC/ Gd3uNHezL1AgvCAwj3hLtHK8RCDnG/s4iFtvxiYfDy+I/Temn70u8wGJL4iWtA2m/IJq qTzhGnXdT48aFRTQv7RlWg8x2SFWNhXoj4v/sjLhbIWojZK9YuE7MQynQ6gEQvI8Z+ql 1Mvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=c7RNYEEpwHcnRB3SHJ0doUBOAYB0Ktoxvs9rsjiA7Kc=; b=VSw6fln7YV8iIUi1/b9OlLmp16fFoE6kfUcPVev++VUvWUvhgN+0xLWSD0rKVy7GND Ns1bVDOSuXM5LcaJrrc5U9CU0OMi8RLya4lpUMEx1sazk5KiJRRUsuN4Dl5QZkUkvwq5 FXk2RkXgCnIrzN+83UzQpi5FDWhnNECg/DVqiOr7PJRK49GjD4EHj1TLy9BIGL43Ilxs XLatutavaTzbb859LBZVmASV6Py9jedNmS87kMVi/6yynUxQao2EPnAJrUY5+5nWPyC1 OskdjdqsHIk2LcRvQEu1uEy0esZ04Zm5X+qwyobmpyt/KUwVA4ntVdYY546hR34+xBkq GCCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=TeZhn0SN; 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 t24-v6si10386165plr.240.2018.08.06.14.02.27; Mon, 06 Aug 2018 14:02:43 -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=@infradead.org header.s=bombadil.20170209 header.b=TeZhn0SN; 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 S1732600AbeHFXLr (ORCPT + 99 others); Mon, 6 Aug 2018 19:11:47 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:55760 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728948AbeHFXLr (ORCPT ); Mon, 6 Aug 2018 19:11:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=c7RNYEEpwHcnRB3SHJ0doUBOAYB0Ktoxvs9rsjiA7Kc=; b=TeZhn0SN4eeVdQ2a9xecyktIs JNtGPXnq6NrJ2Br6aiiWHJUrbocDWtPVu+JQcwWVuPrEdI9BzvNt7E7mBRp3DXsndhqgL0BcmxOGs gDzLQJXn5oTIjOd8hwNVnOar/B3PGfFpu1mYHPyaspPKXO+POzfTp0c8BbHIe6i4UpKG1v+pAG4w8 DFeq5hoApfhoX0iPIOdkJUT5LgN8qcgZrJ/3/FcTlQ1zexoMcRM0BhH+qppt4oDcreBuTg4i898Nw xKMDaRKVTZVob5k6F7WAEelfH8FClEDZuWsx9+gnHAYBl3uLTUECoIxoFZVfCtMc4z8TnwWsU4vrg 2NV5hAYew==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fmmcY-00059k-MI; Mon, 06 Aug 2018 21:00:54 +0000 Subject: Re: [PATCH v2] RISC-V: Don't use a global include guard for uapi/asm/syscalls.h To: Palmer Dabbelt , linux-riscv@lists.infradead.org, Christoph Hellwig Cc: aou@eecs.berkeley.edu, Arnd Bergmann , tklauser@distanz.ch, linux-kernel@vger.kernel.org, Marcus Comstedt References: <20180804085438.GA15840@infradead.org> <20180806204258.22280-1-palmer@sifive.com> <20180806204258.22280-2-palmer@sifive.com> From: Randy Dunlap Message-ID: Date: Mon, 6 Aug 2018 14:00:53 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180806204258.22280-2-palmer@sifive.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/06/2018 01:42 PM, 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 > --- > 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..508be1780323 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 to .. be .. included > + * 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 like that one :) > + * __SYSCALL. > + */ > > /* > * Allows the instruction cache to be flushed from userspace. Despite RISC-V -- ~Randy