Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp365957ybl; Wed, 11 Dec 2019 00:45:07 -0800 (PST) X-Google-Smtp-Source: APXvYqxqNUKkmz2sZeaPcaXBadE7qOcp4Lc71Tw6YB+bxfGy0cVuxZv1rNCOt/iWCCGLB26eUh2N X-Received: by 2002:aca:d502:: with SMTP id m2mr1831101oig.41.1576053907009; Wed, 11 Dec 2019 00:45:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576053907; cv=none; d=google.com; s=arc-20160816; b=z/c0A3MAdaxCcs25bx0lFtjkaUVmvpK325LId785Cz3XGLzh3E0E8DMmK+WLQcPnE8 fQ8EcvkFHum4npJkajX+Um4BnxUGItBACN+lTJuB6Ahmi7ZhZxz4K0zyEFX4VhqOtWRN 9oXfC3drWtFXpsUJCK9GcepOhak6dBJfb3MuyBpVRCeBcYw2PrcAUkrqXUh7cjLRuiYS YGKN5f8T2b/wpd1tGeaxGQb0AHdBglVj5xw9OAxra2XFjtAM0TvMAn/tPbxZLCENyF6j l+oI/UpxLy3k1BIQDDv+0TR1uMMyKImtK3sSZtR2fyIN7i/SG1h2xs3Jw2e7tN8hQZHl /k0A== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=kQeuS19F3KEdXprKaRD06DcqpTfUguGJp+E8RkyDNtI=; b=o0NtiYHSAzU43nsLoeOcFAfWKUFpL4KKX9yudmzVI01gFABNZHoJngiAbNpgKidzBy N4iZoaylo5LGRdFELwvVwiA2w2eCUo0r9ZxtuIRFf1HgMGJIDZtyP6bBF+7b8b/PMZMg 5MEDCCa9aYxn6Q3B/OWBpopkLPXFrOmd89kQowmnebAWV+bN3AY2FonmGSMBaaof+lVa 90Y9AeDULyvjnp3kMuHeAt9fX4BkiORdjdlcGWGOf8YFNxZHaWQhoSJ+VlAi28Mm/LzJ ko4XMQiGMg3e6e2G+fU/XdYtCAdn/r71CDLILGR0QIxShbkhPVR1RnvkfHaG7KK6fSzd bMGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="VY1fSL/r"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j16si648886otp.316.2019.12.11.00.44.54; Wed, 11 Dec 2019 00:45:06 -0800 (PST) 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=@gmail.com header.s=20161025 header.b="VY1fSL/r"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728277AbfLKInL (ORCPT + 99 others); Wed, 11 Dec 2019 03:43:11 -0500 Received: from mail-qv1-f68.google.com ([209.85.219.68]:42178 "EHLO mail-qv1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725973AbfLKInL (ORCPT ); Wed, 11 Dec 2019 03:43:11 -0500 Received: by mail-qv1-f68.google.com with SMTP id q19so5388402qvy.9 for ; Wed, 11 Dec 2019 00:43:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=kQeuS19F3KEdXprKaRD06DcqpTfUguGJp+E8RkyDNtI=; b=VY1fSL/r1auTchjXjG0GETcmGWwfB6GldDBRZEGQMdCt01QI+QDkI5MX4VcXg7L7wO 66TA7vnLMgNXMvyBNu2p7xpoM5a1z0pNR9tqxuMfwdJS01Q2hoGyGEhqwhX/5Ad0GFbw ULfKzKKfXzAtKfcrL+k3sOKWghQew0fgrir9DFyL8L0dyWjJADv4wo0bB+LQmh+IfYjc Prc7AYw3r9RECIRa0RpTe1NWrtp52LD7UGVwNT5fdFDr4GXlQmwnyQDghOVnPwPFDHEc TrrhNe281AuSSH6gWug9aKmokDALzvt8A84ynyoX27sQS+4FoaAtjzxC7nvUOM8m9lKO GFYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=kQeuS19F3KEdXprKaRD06DcqpTfUguGJp+E8RkyDNtI=; b=fvuvbeAW7DeX9KRNX+DsOvcWY9RPA4MivRpX+UKpXFytOs8wtWdEkMHA+FYT0QsXO3 rt1Yl3vqM68z8JLlAqjZQQ6nnuBf0GNTeS2LonNdb1ITXA7DhzPYPeckNaH3Pvo0QmrA m3b0FOpECxpQbJ7uXE1xFg86f7aP2KW+tNZiEyqrE17U9hbQoJfmTclKykqnYy+OSN0F IYpzbVWgVCJI2GdImW4X6CEeeRC2qHhXnQ7V1Suki+XB2zjptiAkI0L15hF2RTbinp5b 4bTWn/HltCOyoBsPMcxwiEvmMMuvfW+OGAlqHSNaWVbTszXpgHrXwPUj5nugJ5YaHd3z hZmg== X-Gm-Message-State: APjAAAXmIaVcSBq8uoJyhxzzbCtkLZ6zmhITcu4m/sS9aV0sMeoK3BUz 3af2ZHbj7BJswwTz7AK8zqo1wghUnisddMptKIQ= X-Received: by 2002:a05:6214:108a:: with SMTP id o10mr1831132qvr.246.1576053790054; Wed, 11 Dec 2019 00:43:10 -0800 (PST) MIME-Version: 1.0 References: <20191028121043.22934-1-hch@lst.de> <20191031155222.GA7270@lst.de> In-Reply-To: From: Greentime Hu Date: Wed, 11 Dec 2019 16:42:33 +0800 Message-ID: Subject: Re: RISC-V nommu support v6 To: Paul Walmsley Cc: Christoph Hellwig , Palmer Dabbelt , Damien Le Moal , linux-riscv@lists.infradead.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Paul Walmsley =E6=96=BC 2019=E5=B9=B411=E6=9C=88= 23=E6=97=A5 =E9=80=B1=E5=85=AD =E4=B8=8A=E5=8D=8810:24=E5=AF=AB=E9=81=93=EF= =BC=9A > > On Thu, 31 Oct 2019, Christoph Hellwig wrote: > > > On Wed, Oct 30, 2019 at 01:21:21PM -0700, Paul Walmsley wrote: > > > I tried building this series from your git branch mentioned above, an= d > > > booted it with a buildroot userspace built from your custom buildroot > > > tree. Am seeing some segmentation faults from userspace (below). > > > > > > Am still planning to merge your patches. > > > > > > But I'm wondering whether you are seeing these segmentation faults al= so? > > > Or is it something that might be specific to my test setup? > > > > I just built a fresh image using make -j4 with that report and it works > > perfectly fine with my tree. > > Another colleague just gave this a quick test, following your instruction= s > as I did. He encountered the same segmentation faulting issue. Might be > worth taking a look at this once v5.5-rc1 is released. Could be a > userspace issue, though. Hi Christoph, I think it should be replaced with this macro for cores without S-mode. diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S index 9bca97ffb67a..5c8b24bf4e4e 100644 --- a/arch/riscv/kernel/head.S +++ b/arch/riscv/kernel/head.S @@ -248,7 +248,7 @@ ENTRY(reset_regs) li t4, 0 li t5, 0 li t6, 0 - csrw sscratch, 0 + csrw CSR_SCRATCH, 0 #ifdef CONFIG_FPU csrr t0, CSR_MISA