Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp861165imm; Fri, 3 Aug 2018 12:55:45 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfGdSJ/vD5pWEC4PcMitXJ5ZKK5WG4ngqgtVGCOtg7y5IkZJJdWWNhRNashtLruRuWNZFWN X-Received: by 2002:a17:902:7287:: with SMTP id d7-v6mr4805691pll.54.1533326145365; Fri, 03 Aug 2018 12:55:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533326145; cv=none; d=google.com; s=arc-20160816; b=ewBDmV+n6SaLWH/bduIXsVecfqWqIwxFgv1QKsVxPCX5XrHVPteL5YAnYBgqgnY7RY 4wQSeG4hFBbzbjZgLUfRcjnkS4VsEffVO4Mhrv+iBy7OYZFw5tNp+jTZRl/Me+hvvBqI RwRFfQSap1+Fs6Yi807g2aAiZ0e62GWC1fVGnDCcbLpn2Ne4edOxhTA78PpOxBHPMFZV RVRR6p2yCn+Kcyu4iNsl7a9Pi9RhUVM1ugpoRSFnRAJOqmY7N+RLhXQwvC2Q6Tx0j2x7 VUc9F1y1f1Wgo5UQoslOiznp57tdk/3Uwup2iheX34nVSSLBrIbWmYSQJicBYFVEEB8j u2Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:from:cc:message-id:date:subject :dkim-signature:arc-authentication-results; bh=kr2WIKWjltYKKeiWNz/qHd0TfxApzo4+dkEqZRgG4+M=; b=w8pkpV3G9DpAcYzh6bHgNeO/xzlMcIqiYHqYHYr/01jAvCxW8P6ErHjTvp1k4Z9vlb EPOTA00UA+IRWf9W6b2CcHowaYRppWKiTyfrv6zAXe2LA+yy0HFxnQHeKEVEFmzPMQjf npTqfhagBcAV6By0DA/g9WUjvVSoiClZQp6u13gtmUwDtp2LnBAdta9pjxRlAuTpTTlT qrkD80apAR5WkWLwmuPgpH7AfcNl6TUcP5HrtK/tSN4nI1GtrQo/DPeL1dtnliA/hscV s18opuBHh6bgcgg1d+0rjDrVytTFK6pYufa1MtJOyRpQG1xdVl+OO9uVFNap/yHkU5tp 6yIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=l0KFxh5X; 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 t8-v6si5475283pgl.620.2018.08.03.12.55.30; Fri, 03 Aug 2018 12:55:45 -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=l0KFxh5X; 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 S1731932AbeHCVw0 (ORCPT + 99 others); Fri, 3 Aug 2018 17:52:26 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:43270 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729792AbeHCVw0 (ORCPT ); Fri, 3 Aug 2018 17:52:26 -0400 Received: by mail-pf1-f195.google.com with SMTP id j26-v6so3767257pfi.10 for ; Fri, 03 Aug 2018 12:54:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=subject:date:message-id:cc:from:to; bh=kr2WIKWjltYKKeiWNz/qHd0TfxApzo4+dkEqZRgG4+M=; b=l0KFxh5XtNC978qfzCSdEyRiSH8+50JLmtn5SF8+XHfIVLGdVSS7ykZsG/rs1Q5uY/ i0/3/Wc2kRKSeAB9aHQ6LV8J1oYOFbkmAu5yRp8BP85YJlWuzopgVwIvBjGP6L7JJ5Ic GjfJZwbEervLhLjR10+yfBS4UYO+PUtB04nsnDiPTQIaj0szrYnelK1vtZ6nxI5M4hLf GDoALrUNSCCXO/vPxdbQhAipNY4Hc11AQHFV8iFGaHBZo/Ep6kdEjQ0BtL3skyOshFjx 685hebAlHiltsazcdkOQkd9m9nh0z9mwYimvwPs5asqTZ4a5lXvzKgi2LbF5tYv9B8Xd trZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:date:message-id:cc:from:to; bh=kr2WIKWjltYKKeiWNz/qHd0TfxApzo4+dkEqZRgG4+M=; b=JPENSP7R/rXgkJ4vbKPYZzmJLTd7Hw2P7tMgcSJN73OrqWT8wVlm7UzWlwL0GELwVn U5lTFlGgcQMIJTwpJeljB0FsbS3stI19TpKGO/D2CbiVm3mZmM8y3Z1v39Ubr3pyJgb+ gWiM6mDLHttGUDzkqqUMqp70OZd548cOeObueB2HJGbj5YTHxXzmSk3yli2ySiR25FCw noF/4aW5nUFMnXlSRh6Hy36QEMIntogzLhJw7jLX96NgJ0nAwJyXuJauTQutoHRLE7RC IjEU56nQqbQYwTk8QdR5IJGkLVOhCF1iEzl/LKTivRkAT2OUPsklsdrbCHiCo1K5GVMl rI1Q== X-Gm-Message-State: AOUpUlF+T9RRBrjT9mJUNwlbjikDu9HQXut1CXNxJb8pbyAFY6doWnzO HpYkZEvikGqfr57iL9wGxJeteQ== X-Received: by 2002:a63:5055:: with SMTP id q21-v6mr4884719pgl.397.1533326082616; Fri, 03 Aug 2018 12:54:42 -0700 (PDT) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id t30-v6sm11917502pgm.81.2018.08.03.12.54.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Aug 2018 12:54:41 -0700 (PDT) Subject: [PATCH] RISC-V: Don't use a global include guard for uapi/asm/syscalls.h Date: Fri, 3 Aug 2018 12:53:44 -0700 Message-Id: <20180803195344.22271-1-palmer@sifive.com> X-Mailer: git-send-email 2.16.4 Cc: Palmer Dabbelt , aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Marcus Comstedt From: Palmer Dabbelt To: linux-riscv@lists.infradead.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/uapi/asm/syscalls.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/arch/riscv/include/uapi/asm/syscalls.h b/arch/riscv/include/uapi/asm/syscalls.h index 818655b0d535..882a6aa09a33 100644 --- a/arch/riscv/include/uapi/asm/syscalls.h +++ b/arch/riscv/include/uapi/asm/syscalls.h @@ -1,10 +1,11 @@ -/* 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 +21,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