Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4109861imm; Mon, 6 Aug 2018 17:12:44 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdvyZx/yJgTnxj78duBixgesH1f8VYue8wCYjtFUP3uGgzLHfg795W3CF3QTYS4LRwSPGL+ X-Received: by 2002:a62:cac5:: with SMTP id y66-v6mr19114896pfk.187.1533600764777; Mon, 06 Aug 2018 17:12:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533600764; cv=none; d=google.com; s=arc-20160816; b=cmVDOP0Ev5XC9mIgLDw0GrNEJNZ5QPeWbG7Fvma+5LeYv1KniWHNhkmmD6rS+JB7ql uvFsBrpn3d22PNfajaxJB/ZCKbA9K+FXN/qKTRA70Yv5GrSNO4CYWEbFRfSXXZZ0+sNm gV5RtYXlX+xY44cscd8bxVBxhh+XjLhagFI+WZf9kvinKG6zL5ICnwJN8Lg0+KvXKGpT HDrVOBTCejwMSOdoE0q7eXRnTVAQEfnuLUyLmaCGYScuPDDOXHgwTMdaqNjd/Emjr21S F2cp6TMZSok2hDDrnfouGiGxfEOkksWFnYOZTC+WTyAKF6FS98pNpHmNJfheYfJ7qqhT 29Bw== 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:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature :arc-authentication-results; bh=WYh3TP+aFTuH38RANMbVqr3t10nTvi/WqpwHfU67tRU=; b=gSlNLhITb91oIsLD3MiIfgnhde3LgriBL4RtGSEeK00XK/JtmDwTGy4qAg6EEqYBhY PkRToNvSR1FYoI7Ceyy4nyDwZHDzj50klylzyEVkkcI3QsGr1K/hqFdDOF7aXuKW5xsn qRGuLQ+xFHk+gy9x9dc0VbVtGybh4C9AmKnKzq+5NRdgXFGognGdgljn08J8/73VHpTy BsApeeQrwp8LxsVKWOmwn1AovBeG0yeJ2YRMjI5rHuka+GZG77mOcXqeTEVkE6sO4EkI t2w5Vhe9enIxH5gIAhspCQ7ogP+6FPezigik1u4PyvmX2hjh/n9YbXtHlUBLseuE2opS uCeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=kHOfrFF4; 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 f10-v6si14094158pgj.397.2018.08.06.17.12.29; Mon, 06 Aug 2018 17:12:44 -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=@sifive.com header.s=google header.b=kHOfrFF4; 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 S1732250AbeHGCWp (ORCPT + 99 others); Mon, 6 Aug 2018 22:22:45 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:39767 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731092AbeHGCWp (ORCPT ); Mon, 6 Aug 2018 22:22:45 -0400 Received: by mail-pg1-f196.google.com with SMTP id a11-v6so6930678pgw.6 for ; Mon, 06 Aug 2018 17:11:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=WYh3TP+aFTuH38RANMbVqr3t10nTvi/WqpwHfU67tRU=; b=kHOfrFF4jOLctRShVDXXOnzmjiTgrj95sDTYu937QWczj//NVSovHvAunm/N8ho22e 6m2LurYF0z0i+mU6AJK6+jBWx7cI0u92zchch174gg68oPo6bFfz6p+gYsarC/wNeDUu 4/yDcVZQIMZMM3asFGp7sQW6rJbdqb3p5Rxe+2O35A0uLad7eQb8HPGRhgaXFnOAmJvP CvvUU1rxmmg79oNCJbEStQfupqvQR82HFAwVe7KINAqAuwnH2Wo/Kbz0hVyIPkkOwgQY SrbwEiq70rr4dQLi28gMT3eY0k2tb0wuUM/4JnBR3RQy10niJGmgxtKG7fi2rgJJKFeX q6oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=WYh3TP+aFTuH38RANMbVqr3t10nTvi/WqpwHfU67tRU=; b=erfWkEfJFA89VBIu5kQoVl/r1Hlt+5xtEaf+LLWq82bnY8+h1Yf+1k7hV4inU68EiZ YtIw/0XSQO6z9ZPxgHuRPUnBfLXVsl/9i3VxiHkzbEugNaVRAyRom3Fl55Oo0tXohvmv SAX3Ikst+f5VJIRO14RQy+6CGTI/bF7RyVp0bLOJUkRRgleW2Qr1wSbSqvLc0Rbz7Gni XQusrg2e6cpo/v0Vhz4XtBsQ6zlI1bzVa2dhJibpJ5Sd04CpzlIYqlN/W/O2hoRx3+SZ /XvMyEgR5y7vXxtUI6hZcHXTj4R3pVMdK9so/HMCXXBpP9t4b0oNAvTGWxn0mgV6aWRY hvHg== X-Gm-Message-State: AOUpUlFmD+c3llpMY2Jn3XGZUtVgzx56MUwnvD8tXXtc3iUylfm1ChH/ RG76W4RwJjAlgwT9CrT8F9aZWPOatTI= X-Received: by 2002:a63:704f:: with SMTP id a15-v6mr16357084pgn.443.1533600672086; Mon, 06 Aug 2018 17:11:12 -0700 (PDT) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id y3-v6sm30698908pfi.24.2018.08.06.17.11.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Aug 2018 17:11:10 -0700 (PDT) Date: Mon, 06 Aug 2018 17:11:10 -0700 (PDT) X-Google-Original-Date: Mon, 06 Aug 2018 16:55:28 PDT (-0700) Subject: Re: [PATCH v2] RISC-V: Don't use a global include guard for uapi/asm/syscalls.h In-Reply-To: CC: linux-riscv@lists.infradead.org, Christoph Hellwig , aou@eecs.berkeley.edu, Arnd Bergmann , tklauser@distanz.ch, linux-kernel@vger.kernel.org, marcus@mc.pp.se From: Palmer Dabbelt To: rdunlap@infradead.org Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 06 Aug 2018 14:00:53 PDT (-0700), rdunlap@infradead.org wrote: > 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 Thanks. I'm not going to spin a v3 unless there's more feedback, but I'll include it in the PR. > >> + * 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