Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2792156imm; Thu, 9 Aug 2018 21:12:44 -0700 (PDT) X-Google-Smtp-Source: AA+uWPw8k3qOZFFv+X9jBu8S8s0o9okauEere1f7VudBLtGtZHlys6LAckWNjpwuNVTT3aV6Oq4Y X-Received: by 2002:a63:5fc1:: with SMTP id t184-v6mr4544980pgb.183.1533874364790; Thu, 09 Aug 2018 21:12:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533874364; cv=none; d=google.com; s=arc-20160816; b=iarxuC6IdWnCcO3yccAoTI6D0wapv9PIp2ayMbdNmw9uLMTxcyjq2ZBW1LrRMbWoMZ Q0Y0Kc6v6jwwtR8sA7t2sm3E1FwxOJI/DbWSxXSwGGWuPGSTOvxqkRy/nmaq7xslkH/4 nmpoiFrKLGc64+MEZ7t7Ty9x9NkcSJ255jrk5FB/0K0k2C8dEskk22f+0kzqSRdd5s3g WMfIUlpsq9FHSZzW1beER0vibJhsN0v9RD3v+01OIKURLOMivlai5kraKL8oDiznYNf3 7OcKpRs1C4/75gjeXaaqvzy9FISwYJxjHphFBjZ5d372lVGHp7z/CnWg2Za60rPiLZAg 71AA== 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=1Rzv+HTJJBNXaZgrdJsIg6qus31JjJa/Xum3kfG0GPU=; b=IAFCmBd2z8M+Pc858TbLrMbEQFcn4g07YRMgNri0wHBjDHbUsnzvoJf6MUC4PurVfO qhqu3oDA4hahySe864pOz0Z6EFyxrxguQtW8yBR+z+5wVeOgwCakqg40O81dsKVfk8Xu 1rCruOYOUs4FuPVx89OeB97SEjwcAmuIW5UauP8QJpvlYhgKl8dX1y98VNJplRjdm3Qu K068nSTUpCzb/HJjuE8oidPkpHuxmdzcNWL/kVrYzpqq3LeCHCCxJIVZdP1gemZlX+ln 6GWydbZDS+ZADvLc6GSDYs5Y2q9BDyumMCG2MHwxPR4vEcYzLEeW/sHNgRt/XMQt3JXt V4PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ZL85tJLz; 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 t80-v6si9669230pfk.228.2018.08.09.21.12.29; Thu, 09 Aug 2018 21: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=fail header.i=@gmail.com header.s=20161025 header.b=ZL85tJLz; 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 S1727054AbeHJGjk (ORCPT + 99 others); Fri, 10 Aug 2018 02:39:40 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:45138 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725725AbeHJGjj (ORCPT ); Fri, 10 Aug 2018 02:39:39 -0400 Received: by mail-pg1-f196.google.com with SMTP id f1-v6so3746999pgq.12 for ; Thu, 09 Aug 2018 21:11:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=1Rzv+HTJJBNXaZgrdJsIg6qus31JjJa/Xum3kfG0GPU=; b=ZL85tJLzhzjcscjjtC6kVHnIkk/9AIzza8Svd9IL2H5NP46FxG2lSvksJpVJ6FemNC bpb0i9lopwW/KFtfuByJQn1rlqFeW49DoXtjRbw1QhxQI31WnshNLQLiTPrZXSM1Xsvr Wn6SVi3qgIbbQ5dOejC6JxINoFoo7wZLa6feu+GBcq1f9s/mzlBru7XpDqPC9q+TWNbL 2UrjoKDUrTz0H+2oJZwNOhLcnDrkXpj+17aOq/OYvyQlI7UBmrXlz0D/Q/pCdA61AZan CYHkp+ptbuU7la7x76fnuZRIgfuTEOSdGZAs0L/USVlkVyKJZT8pndVtQ2JLjSshUZ5K enxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=1Rzv+HTJJBNXaZgrdJsIg6qus31JjJa/Xum3kfG0GPU=; b=nwQY6WZ01aHlScTTaUmMXBmz7sDUPzOfbR+sGqcGByFDXVIL5axankoVUmTIv7XJLs toF+bAOxOAOa0xwrsYXIuq3u1muKiBYymY2atE0Dpuj05FwjYyyWa9OzkCmLrE+bzlWe Nl9t4Ul5vCMoulZXqwFxMHfxaShpaNDfK1B8VNARFWBL3xZY9epkgmxqsNLo1rRk2CMz oyrvcYnfNPbUEzxpiK4TstwG+ijfRyPUW3nd+HePJ/PTjDp+AENNcKCIN3qlUgJV37jR SoXZELhYUNCUQmu2MuvokTudtaXmGORfZcD99QecdNZU6UlR3JBFPCv76G7queF3ZAAM qZwA== X-Gm-Message-State: AOUpUlE1aPUyDKXhdY+W6PTV8rdWgJEQkkz1cgwmgx5THybod5GpVIiI sLmuGG0rSAZmM8HfBUahoV8= X-Received: by 2002:a65:5545:: with SMTP id t5-v6mr4729917pgr.157.1533874296960; Thu, 09 Aug 2018 21:11:36 -0700 (PDT) Received: from server.roeck-us.net (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by smtp.gmail.com with ESMTPSA id g5-v6sm14673612pfc.77.2018.08.09.21.11.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Aug 2018 21:11:35 -0700 (PDT) Subject: Re: [PATCH v2 2/2] RISC-V: Don't use a global include guard for uapi/asm/syscalls.h To: Palmer Dabbelt Cc: Christoph Hellwig , aou@eecs.berkeley.edu, Arnd Bergmann , tklauser@distanz.ch, Andrew Waterman , dan.carpenter@oracle.com, linux@dominikbrodowski.net, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, marcus@mc.pp.se References: From: Guenter Roeck Message-ID: <988c739c-a275-c018-2502-08f817b2f818@roeck-us.net> Date: Thu, 9 Aug 2018 21:11:34 -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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/09/2018 08:59 PM, Palmer Dabbelt wrote: > On Thu, 09 Aug 2018 19:40:55 PDT (-0700), linux@roeck-us.net wrote: >> On 08/09/2018 06:03 PM, Palmer Dabbelt wrote: >>> On Thu, 09 Aug 2018 14:24:22 PDT (-0700), linux@roeck-us.net wrote: >>>> On Thu, Aug 09, 2018 at 01:25:24PM -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 >>>> >>>> [Compile-]Tested-by: Guenter Roeck >>>> >>>> on top of linux-next after reverting the version of the patch there. >>>> >>>> I also tried to run the resulting image (defconfig) with qemu (built >>>> from https://github.com/riscv/riscv-qemu.git), but that still doesn't >>>> work. I assume there are still some patches missing ? >>> >>> Do you have the PLIC patches?  They'll be necessary to make this all work, and there's a v4 out now that when combined with for-next should get you to userspace. >>> >>>     https://lore.kernel.org/lkml/20180809075602.989-1-hch@lst.de/T/#u >>> >> Yes, after merging that branch on top of linux-next I can boot into Linux. >> If I add my "riscv: Drop setup_initrd" patch as well, I can boot using >> initrd, otherwise I have to use virtio-blk-device. > > Awesome!  If you patch isn't on for-next then I must have missed it, do you mind sending me a pointer?  I can't find any references in my email. > Hmm ... weird. I don't find it either. Maybe I sent it only in my dreams. I'll send it out for review. Guenter >>> Also, what is your methodology?  I follow >>> >>>     https://wiki.qemu.org/Documentation/Platforms/RISCV >>> >>> and could could natively compile and run hello world with an earlier version of Christoph's patch set, which is really only cosmetically different than the v4. I use qemu's master branch as well, which when I tried was exactly 3.0.0-rc3. >>> >> >> That doesn't work for me, possibly because I don't specify a bbl >> image with -kernel but vmlinux (using -bios for the bbl image). >> I use branch qemu-for-upstream of https://github.com/riscv/riscv-qemu.git. >> >> Guenter >