Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp2189927rwb; Thu, 27 Jul 2023 03:39:56 -0700 (PDT) X-Google-Smtp-Source: APBJJlFSKmzUz0vWyEkh6kcBQ1DX+bdupUEjHTrdvumJi25QX3IsZMym6Id1iVYHAuTrvq8hQEgj X-Received: by 2002:a05:6a00:2da1:b0:67c:db:c2f4 with SMTP id fb33-20020a056a002da100b0067c00dbc2f4mr3081949pfb.4.1690454395820; Thu, 27 Jul 2023 03:39:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690454395; cv=none; d=google.com; s=arc-20160816; b=QD94PfBUi+0dprMwrSBXCbGaKRW7qPYsOMelA45+SWw5EV+MRuIZQKDcSoYRi7ptFX 80/XW1zWXhwoR4c88Nas7vxhu9KIUTe5pl31+cfcMgM43yxGKfTsjvkKQiuUkm1TuhXk U09mOUTH6lbertAY+aa+Ng+reTEmtHClgqGw5yileOTZnrh8eiPsUSssVWRUkWS/kTH4 yrAwphJ2zYBB/9zQOX6xqEVEzcM+duAr5Ub5U7j+5DK2R4fuvoNtpX83ecaENclAenXQ npvufPpsqB4e8GOhHenhrrmVLMMk0PnxV/f0aJ236YREfrV1kKGQmW2uICG21XQAQy6v kYig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=9i29dzxyaOrDJzMqeeVMwIB9S9fUSO1TUY0wLaT4SUo=; fh=iTqYmcOKlEP6ToTt5X7+p43JlyH2Cc1Du2IbpscK9dY=; b=aZDb9p7MpsLlm6M82VIzxFnwrXKaRvWmNY1UR+qUh/gFPziIVboEUIAZJ+1gSD9L0d wAD6C/nFGG9fhAbKlvLZ//GacKreozclEGoIY+1Mws+uGmWF4CDxSuOzlrnL4vz/Mm5L KMvsOlfDh4PvouEGIeH0hryYPRfC/XZkpbf5jDlNEAeaXq7uqSHTAuLpgnVbonDAYEfo 3EDMQ9gN2iEzWtEtHztbKBbDPbgPbtkIJ+k9YGpB2/Wymv8Y3LxyF8OKUvEMeiMoiDjh FOnSyLmz63HkKoOgJQGHKEHPNDPkxK9gP5cpgxVgkCE7FJuOiVahV42ASKSqS49QVBMq 3BPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfromscratch.org header.s=cert4 header.b=Z8mNShnF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=linuxfromscratch.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t63-20020a638142000000b00563fc0ccc20si1058785pgd.818.2023.07.27.03.39.43; Thu, 27 Jul 2023 03:39:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfromscratch.org header.s=cert4 header.b=Z8mNShnF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=linuxfromscratch.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234390AbjG0J2z (ORCPT + 99 others); Thu, 27 Jul 2023 05:28:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234689AbjG0J2R (ORCPT ); Thu, 27 Jul 2023 05:28:17 -0400 Received: from rivendell.linuxfromscratch.org (rivendell.linuxfromscratch.org [208.118.68.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EDACE8690; Thu, 27 Jul 2023 02:19:16 -0700 (PDT) Received: from [192.168.124.11] (unknown [113.140.29.10]) by rivendell.linuxfromscratch.org (Postfix) with ESMTPSA id 872301C1E3F; Thu, 27 Jul 2023 09:19:08 +0000 (GMT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 1.0.0 at rivendell.linuxfromscratch.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfromscratch.org; s=cert4; t=1690449554; bh=U3/iZtufbRk45Ts76eay7OLdIEe1IdvlvMnUnVReqh8=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Z8mNShnFzFCDa+6T09xC9x+L74plUnIJhzVb1nZjZltH+qoaU6mGqmSzxrWpErjEt k6ofcrPoVjzWt+bV2neqteEUYWxIRtl/Ti4h4tWpD0mXNPlZEPuaywC/g0Y/GX4fKs ninbuE0bT73eHjVHFeH8zpFw2aDSSoypWL63nXR9behxJgfKWyEoNN/Hha8E9SKiQn 6IP8Y4r5O9LWZrsDguAo2XpyMgSr7ZYAI4tAQ1g+nwNoZ1a2+mdnk7SONgJp/Wut8I gJ7ItS39IunM9F5YA20b712clPIe/5mqVq5JRUZfOoMdQidYarE7g8jB5tjV9qzU1y qNvD0LcqdTV/w== Message-ID: Subject: Re: [PATCH v3 0/8] Add Sipeed Lichee Pi 4A RISC-V board support From: Xi Ruoyao To: Jisheng Zhang Cc: Conor Dooley , Thomas Gleixner , Marc Zyngier , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Palmer Dabbelt , Paul Walmsley , Albert Ou , Daniel Lezcano , Guo Ren , Fu Wei , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org Date: Thu, 27 Jul 2023 17:18:51 +0800 In-Reply-To: <4986b92f1a5aa303a529c6004aaedd2184c3ccf7.camel@linuxfromscratch.org> References: <20230617161529.2092-1-jszhang@kernel.org> <20230725-unheard-dingy-42f0fafe7216@wendy> <3e0994dab495920ac590dc28d6b9d9765abe0c7e.camel@linuxfromscratch.org> <866eab3e30a18c50742a75d62aee223fdc7e3cee.camel@linuxfromscratch.org> <4986b92f1a5aa303a529c6004aaedd2184c3ccf7.camel@linuxfromscratch.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2023-07-27 at 08:54 +0800, Xi Ruoyao wrote: > On Thu, 2023-07-27 at 08:14 +0800, Xi Ruoyao wrote: > > On Wed, 2023-07-26 at 23:00 +0800, Jisheng Zhang wrote: > > > which dts r u using? see below. > > >=20 > > > >=20 > > > > Or maybe my toolchain (GCC 13.1.0, Binutils-2.40, with no patches) = can > > > > miscompile the kernel? > >=20 > > /* snip */ > >=20 > > > > Boot HART ID=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 : 0 > > > > Boot HART Domain=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 : root > > > > Boot HART Priv Version=C2=A0=C2=A0=C2=A0 : v1.11 > > > > Boot HART Base ISA=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 : rv64= imafdcvx > > >=20 > > > what? I don't think the mainline dts provide v and x.=20 > >=20 > > I copied the compiled arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dtb > > into /boot and loaded it with u-boot "load" command onto 0x46000000, an= d > > passed this address to the booti command. > >=20 > > But maybe I've copied the wrong file or made some other mistake... I'll > > recheck. >=20 > Hmm, and if I read OpenSBI code correctly, this line reflects the > content of the misa CSR, not the DT riscv,isa value. >=20 > The log of successful boot provided by Drew also contains > "rv64imafdcvx": >=20 > https://gist.github.com/pdp7/23259595a7570f1f11086d286e16dfb6 I tried a __show_reg call before the panic: [ 0.012953] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.5.0-rc3 #7 [ 0.012967] Hardware name: Sipeed Lichee Pi 4A (DT) [ 0.012976] epc : ffffffff80c84a60 ra : 0000000000000000 sp : ffffffff80= 04dfee [ 0.012988] gp : 0000000200000120 tp : ffffffff80c03d20 t0 : ffffffff80= 002d6c [ 0.012997] t1 : ffffffff8004dfee t2 : ffffffff8004dfe6 s0 : ffffffff80= c03d20 [ 0.013005] s1 : ffffffff80c966f0 a0 : ffffffff80c98140 a1 : 2000000000= 000000 [ 0.013012] a2 : 0000000000000043 a3 : 203a656c6f736e6f a4 : ffffffff80= c03def [ 0.013021] a5 : ffffffff80dcb4a0 a6 : 0000000000000001 a7 : 0000000000= 000014 [ 0.013030] s2 : 000000000000000a s3 : 0000000000000000 s4 : 0000000000= 000000 [ 0.013036] s5 : ffffffd9fef69740 s6 : 0000000000000008 s7 : 0000000000= 000032 [ 0.013046] s8 : 0000000000000002 s9 : ffffffff80c03df0 s10: ffffffff80= dcb4e8 [ 0.013056] s11: ffffffff80dc7c80 t3 : ffffffff80c03d48 t4 : ffffffff80= dcb2f0 [ 0.013064] t5 : ffffffff80c84a60 t6 : ffffffff80c10b98 [ 0.013071] status: 0000000000000000 badaddr: 0000000000000001 cause: ff= ffffff80dcb4f7 [ 0.013082] Kernel panic - not syncing: unexpected interrupt cause I compared these with System.map and the result seems completely erratic (for example, sp is out of init_stack, and gp is not __global_pointer$).