From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14FF9C4332F for ; Tue, 24 May 2022 14:42:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238280AbiEXOmC convert rfc822-to-8bit (ORCPT ); Tue, 24 May 2022 10:42:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235060AbiEXOl6 (ORCPT ); Tue, 24 May 2022 10:41:58 -0400 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92F394CD4A; Tue, 24 May 2022 07:41:52 -0700 (PDT) Received: from ip5b412258.dynamic.kabel-deutschland.de ([91.65.34.88] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ntVj5-0000Re-B6; Tue, 24 May 2022 16:41:35 +0200 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Guenter Roeck Cc: Guo Ren , Palmer Dabbelt , Arnd Bergmann , Greg Kroah-Hartman , Christoph Hellwig , linux-arch , Linux Kernel Mailing List , linux-riscv , linux-csky@vger.kernel.org, linux-s390 , sparclinux , linuxppc-dev , Parisc List , "open list:BROADCOM NVRAM DRIVER" , Linux ARM , the arch/x86 maintainers , Guo Ren Subject: Re: [PATCH V9 20/20] riscv: compat: Add COMPAT Kbuild skeletal support Date: Tue, 24 May 2022 16:41:34 +0200 Message-ID: <14633832.tv2OnDr8pf@diego> In-Reply-To: <20220523230039.GA238308@roeck-us.net> References: <20220322144003.2357128-1-guoren@kernel.org> <44686961.fMDQidcC6G@diego> <20220523230039.GA238308@roeck-us.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="iso-8859-1" Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org Am Dienstag, 24. Mai 2022, 01:00:39 CEST schrieb Guenter Roeck: > On Tue, May 24, 2022 at 12:40:06AM +0200, Heiko Stübner wrote: > > Hi Guenter, > > > > Am Montag, 23. Mai 2022, 18:18:47 CEST schrieb Guenter Roeck: > > > On 5/23/22 08:18, Guo Ren wrote: > > > > I tested Palmer's branch, it's okay: > > > > 8810d7feee5a (HEAD -> for-next, palmer/for-next) riscv: Don't output a > > > > bogus mmu-type on a no MMU kernel > > > > > > > > I also tested linux-next, it's okay: > > > > > > > > rv64_rootfs: > > > > # uname -a > > > > Linux buildroot 5.18.0-next-20220523 #7 SMP Mon May 23 11:15:17 EDT > > > > 2022 riscv64 GNU/Linux > > > > # > > > > > > That is is ok with one setup doesn't mean it is ok with > > > all setups. It is not ok with my root file system (from > > > https://github.com/groeck/linux-build-test/tree/master/rootfs/riscv64), > > > with qemu v6.2. > > > > That is very true that it shouldn't fail on any existing (qemu-)platform, > > but as I remember also testing Guo's series on both riscv32 and riscv64 > > qemu platforms in the past, I guess it would be really helpful to get more > > information about the failing platform you're experiencing so that we can > > find the source of the issue. > > > > As it looks like you both tested the same kernel source, I guess the only > > differences could be in the qemu-version, kernel config and rootfs. > > Is your rootfs something you can share or that can be rebuilt easily? > > > I provided a link to my root file system above. The link points to two > root file systems, for initrd (cpio archive) and for ext2. > I also mentioned above that I used qemu v6.2. And below I said > > > My root file system uses musl. > > I attached the buildroot configuration below. The buildroot version, > if I remember correctly, was 2021.02. > > Kernel configuration is basically defconfig. However, I do see one > detail that is possibly special in my configuration. > > # The latest kernel assumes SBI version 0.3, but that doesn't match qemu > # at least up to version 6.2 and results in hangup/crashes during reboot > # with sifive_u emulations. > enable_config "${defconfig}" CONFIG_RISCV_SBI_V01 > > Hope that helps, Actually it doesn't seem rootfs-specific at all. Merged was this v9, but the version I last tested was one of the earlier ones, so it looks like something really broke meanwhile. I tested both linux-next-20220524 and palmer's for-next on a very recent qemu - master from april if I remember correctly together with a Debian-based rootfs mounted as nfsroot inside qemu. With CONFIG_COMPAT=y (aka using defconfig directly) I get: [ 12.957612] VFS: Mounted root (nfs filesystem) on device 0:15. [ 12.967260] devtmpfs: mounted [ 13.101186] Freeing unused kernel image (initmem) memory: 2168K [ 13.110914] Run /sbin/init as init process [ 13.343810] Unable to handle kernel paging request at virtual address ff60007265776f78 [ 13.347271] Oops [#1] [ 13.347749] Modules linked in: [ 13.348689] CPU: 0 PID: 1 Comm: init Not tainted 5.18.0-next-20220524 #1 [ 13.349864] Hardware name: riscv-virtio,qemu (DT) [ 13.350706] epc : special_mapping_fault+0x4c/0x8e [ 13.351639] ra : __do_fault+0x28/0x11c [ 13.352311] epc : ffffffff801210e6 ra : ffffffff8011712a sp : ff2000000060bd10 [ 13.353276] gp : ffffffff810df030 tp : ff600000012a8000 t0 : ffffffff80008acc [ 13.354063] t1 : ffffffff80c001d8 t2 : ffffffff80c00258 s0 : ff2000000060bd20 [ 13.354886] s1 : ff2000000060bd68 a0 : ff600000013165f0 a1 : ff60000001ec2450 [ 13.355675] a2 : ff2000000060bd68 a3 : 0000000000000000 a4 : ff6000003f0337c8 [ 13.356822] a5 : ff60007265776f70 a6 : ff60000001ec2450 a7 : 0000000000000007 [ 13.357689] s2 : ff60000001ec2450 s3 : ff60000001ec2450 s4 : ff2000000060bd68 [ 13.358487] s5 : ff60000001ec2450 s6 : 0000000000000254 s7 : 000000000000000c [ 13.359305] s8 : 000000000000000f s9 : 000000000000000d s10: ff60000001e4c080 [ 13.360102] s11: 000000000000000d t3 : 00ffffffbbeab000 t4 : 000000006ffffdff [ 13.361557] t5 : 000000006ffffe35 t6 : 000000000000000a [ 13.362229] status: 0000000200000120 badaddr: ff60007265776f78 cause: 000000000000000d [ 13.363504] [] __do_fault+0x28/0x11c [ 13.364464] [] __handle_mm_fault+0x71c/0x9ea [ 13.365577] [] handle_mm_fault+0x82/0x136 [ 13.366275] [] do_page_fault+0x120/0x31c [ 13.366906] [] ret_from_exception+0x0/0xc [ 13.368763] ---[ end trace 0000000000000000 ]--- [ 13.368763] ---[ end trace 0000000000000000 ]--- [ 13.369598] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b [ 13.369933] SMP: stopping secondary CPUs Turning CONFIG_COMPAT off, results in the system booting normally again. Heiko > --- > BR2_riscv=y > BR2_TOOLCHAIN_BUILDROOT_MUSL=y > BR2_KERNEL_HEADERS_4_19=y > BR2_BINUTILS_VERSION_2_32_X=y > BR2_TARGET_RUN_TESTSCRIPT=y > BR2_SHUTDOWN_COMMAND_POWEROFF=y > BR2_SYSTEM_DHCP="eth0" > BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y > BR2_PACKAGE_STRACE=y > BR2_PACKAGE_I2C_TOOLS=y > BR2_PACKAGE_PCIUTILS=y > BR2_PACKAGE_DTC=y > BR2_PACKAGE_DTC_PROGRAMS=y > BR2_PACKAGE_IPROUTE2=y > BR2_TARGET_ROOTFS_BTRFS=y > BR2_TARGET_ROOTFS_CPIO=y > BR2_TARGET_ROOTFS_CPIO_GZIP=y > BR2_TARGET_ROOTFS_EXT2=y > BR2_TARGET_ROOTFS_EXT2_SIZE="16M" > BR2_TARGET_ROOTFS_EXT2_GZIP=y > BR2_TARGET_ROOTFS_ISO_GZIP=y > BR2_TARGET_ROOTFS_SQUASHFS=y > # BR2_TARGET_ROOTFS_TAR is not set > > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 91798C433EF for ; Tue, 24 May 2022 14:42:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gdqzNAT8jvvdAzHiOKwgB+0rKgDkonKu7DQC55epBFw=; b=xswZoe8Tha8hJa l0H1uclKplLjWsQrrUmDlAR3JpbtkugC0PPI96WZ3IutQ88X/YMJ3dDrnLUxCqQJiRI671QfBubAG Li5adK3u5o2xvfID79v/nlX+nfG3LjnuDSAvDAUh+5tZKdJcwHZuWt/1fzuL5edAUQG8efPrw9OOH k4ziMSI8l53IRlBy4c5egbdFBvRd/oW6/ZcIGy9VyaIpRCJECh3RdU58rJM5vVfuOKSa8J1+AuuWL jJpYHb+L0OTgfg0iLhEySuqbCpMhRVbem1pHuH8buIXx2DztDF+yhClKiUsB7U2rIYWCdKbp4vAbm MyFRl7JnpHgtBAcTuSag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ntVjV-008HyT-AM; Tue, 24 May 2022 14:42:01 +0000 Received: from gloria.sntech.de ([185.11.138.130]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ntVjS-008Hxq-2z; Tue, 24 May 2022 14:41:59 +0000 Received: from ip5b412258.dynamic.kabel-deutschland.de ([91.65.34.88] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ntVj5-0000Re-B6; Tue, 24 May 2022 16:41:35 +0200 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Guenter Roeck Cc: Guo Ren , Palmer Dabbelt , Arnd Bergmann , Greg Kroah-Hartman , Christoph Hellwig , linux-arch , Linux Kernel Mailing List , linux-riscv , linux-csky@vger.kernel.org, linux-s390 , sparclinux , linuxppc-dev , Parisc List , "open list:BROADCOM NVRAM DRIVER" , Linux ARM , the arch/x86 maintainers , Guo Ren Subject: Re: [PATCH V9 20/20] riscv: compat: Add COMPAT Kbuild skeletal support Date: Tue, 24 May 2022 16:41:34 +0200 Message-ID: <14633832.tv2OnDr8pf@diego> In-Reply-To: <20220523230039.GA238308@roeck-us.net> References: <20220322144003.2357128-1-guoren@kernel.org> <44686961.fMDQidcC6G@diego> <20220523230039.GA238308@roeck-us.net> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220524_074158_173325_5423825D X-CRM114-Status: GOOD ( 35.12 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Am Dienstag, 24. Mai 2022, 01:00:39 CEST schrieb Guenter Roeck: > On Tue, May 24, 2022 at 12:40:06AM +0200, Heiko St=FCbner wrote: > > Hi Guenter, > > = > > Am Montag, 23. Mai 2022, 18:18:47 CEST schrieb Guenter Roeck: > > > On 5/23/22 08:18, Guo Ren wrote: > > > > I tested Palmer's branch, it's okay: > > > > 8810d7feee5a (HEAD -> for-next, palmer/for-next) riscv: Don't outpu= t a > > > > bogus mmu-type on a no MMU kernel > > > > = > > > > I also tested linux-next, it's okay: > > > > = > > > > rv64_rootfs: > > > > # uname -a > > > > Linux buildroot 5.18.0-next-20220523 #7 SMP Mon May 23 11:15:17 EDT > > > > 2022 riscv64 GNU/Linux > > > > # > > > = > > > That is is ok with one setup doesn't mean it is ok with > > > all setups. It is not ok with my root file system (from > > > https://github.com/groeck/linux-build-test/tree/master/rootfs/riscv64= ), > > > with qemu v6.2. > > = > > That is very true that it shouldn't fail on any existing (qemu-)platfor= m, > > but as I remember also testing Guo's series on both riscv32 and riscv64 > > qemu platforms in the past, I guess it would be really helpful to get m= ore > > information about the failing platform you're experiencing so that we c= an > > find the source of the issue. > > = > > As it looks like you both tested the same kernel source, I guess the on= ly > > differences could be in the qemu-version, kernel config and rootfs. > > Is your rootfs something you can share or that can be rebuilt easily? > > = > I provided a link to my root file system above. The link points to two > root file systems, for initrd (cpio archive) and for ext2. > I also mentioned above that I used qemu v6.2. And below I said > = > > My root file system uses musl. > = > I attached the buildroot configuration below. The buildroot version, > if I remember correctly, was 2021.02. > = > Kernel configuration is basically defconfig. However, I do see one > detail that is possibly special in my configuration. > = > # The latest kernel assumes SBI version 0.3, but that doesn't match q= emu > # at least up to version 6.2 and results in hangup/crashes during reb= oot > # with sifive_u emulations. > enable_config "${defconfig}" CONFIG_RISCV_SBI_V01 > = > Hope that helps, Actually it doesn't seem rootfs-specific at all. Merged was this v9, but the version I last tested was one of the earlier ones, so it looks like something really broke meanwhile. I tested both linux-next-20220524 and palmer's for-next on a very recent qemu - master from april if I remember correctly together with a Debian-based rootfs mounted as nfsroot inside qemu. With CONFIG_COMPAT=3Dy (aka using defconfig directly) I get: [ 12.957612] VFS: Mounted root (nfs filesystem) on device 0:15. [ 12.967260] devtmpfs: mounted [ 13.101186] Freeing unused kernel image (initmem) memory: 2168K [ 13.110914] Run /sbin/init as init process [ 13.343810] Unable to handle kernel paging request at virtual address ff= 60007265776f78 [ 13.347271] Oops [#1] [ 13.347749] Modules linked in: [ 13.348689] CPU: 0 PID: 1 Comm: init Not tainted 5.18.0-next-20220524 #1 [ 13.349864] Hardware name: riscv-virtio,qemu (DT) [ 13.350706] epc : special_mapping_fault+0x4c/0x8e [ 13.351639] ra : __do_fault+0x28/0x11c [ 13.352311] epc : ffffffff801210e6 ra : ffffffff8011712a sp : ff20000000= 60bd10 [ 13.353276] gp : ffffffff810df030 tp : ff600000012a8000 t0 : ffffffff80= 008acc [ 13.354063] t1 : ffffffff80c001d8 t2 : ffffffff80c00258 s0 : ff20000000= 60bd20 [ 13.354886] s1 : ff2000000060bd68 a0 : ff600000013165f0 a1 : ff60000001= ec2450 [ 13.355675] a2 : ff2000000060bd68 a3 : 0000000000000000 a4 : ff6000003f= 0337c8 [ 13.356822] a5 : ff60007265776f70 a6 : ff60000001ec2450 a7 : 0000000000= 000007 [ 13.357689] s2 : ff60000001ec2450 s3 : ff60000001ec2450 s4 : ff20000000= 60bd68 [ 13.358487] s5 : ff60000001ec2450 s6 : 0000000000000254 s7 : 0000000000= 00000c [ 13.359305] s8 : 000000000000000f s9 : 000000000000000d s10: ff60000001= e4c080 [ 13.360102] s11: 000000000000000d t3 : 00ffffffbbeab000 t4 : 000000006f= fffdff [ 13.361557] t5 : 000000006ffffe35 t6 : 000000000000000a [ 13.362229] status: 0000000200000120 badaddr: ff60007265776f78 cause: 00= 0000000000000d [ 13.363504] [] __do_fault+0x28/0x11c [ 13.364464] [] __handle_mm_fault+0x71c/0x9ea [ 13.365577] [] handle_mm_fault+0x82/0x136 [ 13.366275] [] do_page_fault+0x120/0x31c [ 13.366906] [] ret_from_exception+0x0/0xc [ 13.368763] ---[ end trace 0000000000000000 ]--- [ 13.368763] ---[ end trace 0000000000000000 ]--- [ 13.369598] Kernel panic - not syncing: Attempted to kill init! exitcode= =3D0x0000000b [ 13.369933] SMP: stopping secondary CPUs Turning CONFIG_COMPAT off, results in the system booting normally again. Heiko > --- > BR2_riscv=3Dy > BR2_TOOLCHAIN_BUILDROOT_MUSL=3Dy > BR2_KERNEL_HEADERS_4_19=3Dy > BR2_BINUTILS_VERSION_2_32_X=3Dy > BR2_TARGET_RUN_TESTSCRIPT=3Dy > BR2_SHUTDOWN_COMMAND_POWEROFF=3Dy > BR2_SYSTEM_DHCP=3D"eth0" > BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=3Dy > BR2_PACKAGE_STRACE=3Dy > BR2_PACKAGE_I2C_TOOLS=3Dy > BR2_PACKAGE_PCIUTILS=3Dy > BR2_PACKAGE_DTC=3Dy > BR2_PACKAGE_DTC_PROGRAMS=3Dy > BR2_PACKAGE_IPROUTE2=3Dy > BR2_TARGET_ROOTFS_BTRFS=3Dy > BR2_TARGET_ROOTFS_CPIO=3Dy > BR2_TARGET_ROOTFS_CPIO_GZIP=3Dy > BR2_TARGET_ROOTFS_EXT2=3Dy > BR2_TARGET_ROOTFS_EXT2_SIZE=3D"16M" > BR2_TARGET_ROOTFS_EXT2_GZIP=3Dy > BR2_TARGET_ROOTFS_ISO_GZIP=3Dy > BR2_TARGET_ROOTFS_SQUASHFS=3Dy > # BR2_TARGET_ROOTFS_TAR is not set > = > = _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 623A8C433F5 for ; Tue, 24 May 2022 14:42:19 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4L6xk14gg2z3bsp for ; Wed, 25 May 2022 00:42:17 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=sntech.de (client-ip=185.11.138.130; helo=gloria.sntech.de; envelope-from=heiko@sntech.de; receiver=) Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4L6xjV24J9z3bk0 for ; Wed, 25 May 2022 00:41:47 +1000 (AEST) Received: from ip5b412258.dynamic.kabel-deutschland.de ([91.65.34.88] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ntVj5-0000Re-B6; Tue, 24 May 2022 16:41:35 +0200 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Guenter Roeck Subject: Re: [PATCH V9 20/20] riscv: compat: Add COMPAT Kbuild skeletal support Date: Tue, 24 May 2022 16:41:34 +0200 Message-ID: <14633832.tv2OnDr8pf@diego> In-Reply-To: <20220523230039.GA238308@roeck-us.net> References: <20220322144003.2357128-1-guoren@kernel.org> <44686961.fMDQidcC6G@diego> <20220523230039.GA238308@roeck-us.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch , linux-s390 , Guo Ren , Parisc List , Arnd Bergmann , Greg Kroah-Hartman , the arch/x86 maintainers , Linux Kernel Mailing List , linux-csky@vger.kernel.org, "open list:BROADCOM NVRAM DRIVER" , Palmer Dabbelt , sparclinux , Guo Ren , linux-riscv , linuxppc-dev , Christoph Hellwig , Linux ARM Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Am Dienstag, 24. Mai 2022, 01:00:39 CEST schrieb Guenter Roeck: > On Tue, May 24, 2022 at 12:40:06AM +0200, Heiko St=FCbner wrote: > > Hi Guenter, > >=20 > > Am Montag, 23. Mai 2022, 18:18:47 CEST schrieb Guenter Roeck: > > > On 5/23/22 08:18, Guo Ren wrote: > > > > I tested Palmer's branch, it's okay: > > > > 8810d7feee5a (HEAD -> for-next, palmer/for-next) riscv: Don't outpu= t a > > > > bogus mmu-type on a no MMU kernel > > > >=20 > > > > I also tested linux-next, it's okay: > > > >=20 > > > > rv64_rootfs: > > > > # uname -a > > > > Linux buildroot 5.18.0-next-20220523 #7 SMP Mon May 23 11:15:17 EDT > > > > 2022 riscv64 GNU/Linux > > > > # > > >=20 > > > That is is ok with one setup doesn't mean it is ok with > > > all setups. It is not ok with my root file system (from > > > https://github.com/groeck/linux-build-test/tree/master/rootfs/riscv64= ), > > > with qemu v6.2. > >=20 > > That is very true that it shouldn't fail on any existing (qemu-)platfor= m, > > but as I remember also testing Guo's series on both riscv32 and riscv64 > > qemu platforms in the past, I guess it would be really helpful to get m= ore > > information about the failing platform you're experiencing so that we c= an > > find the source of the issue. > >=20 > > As it looks like you both tested the same kernel source, I guess the on= ly > > differences could be in the qemu-version, kernel config and rootfs. > > Is your rootfs something you can share or that can be rebuilt easily? > >=20 > I provided a link to my root file system above. The link points to two > root file systems, for initrd (cpio archive) and for ext2. > I also mentioned above that I used qemu v6.2. And below I said >=20 > > My root file system uses musl. >=20 > I attached the buildroot configuration below. The buildroot version, > if I remember correctly, was 2021.02. >=20 > Kernel configuration is basically defconfig. However, I do see one > detail that is possibly special in my configuration. >=20 > # The latest kernel assumes SBI version 0.3, but that doesn't match q= emu > # at least up to version 6.2 and results in hangup/crashes during reb= oot > # with sifive_u emulations. > enable_config "${defconfig}" CONFIG_RISCV_SBI_V01 >=20 > Hope that helps, Actually it doesn't seem rootfs-specific at all. Merged was this v9, but the version I last tested was one of the earlier ones, so it looks like something really broke meanwhile. I tested both linux-next-20220524 and palmer's for-next on a very recent qemu - master from april if I remember correctly together with a Debian-based rootfs mounted as nfsroot inside qemu. With CONFIG_COMPAT=3Dy (aka using defconfig directly) I get: [ 12.957612] VFS: Mounted root (nfs filesystem) on device 0:15. [ 12.967260] devtmpfs: mounted [ 13.101186] Freeing unused kernel image (initmem) memory: 2168K [ 13.110914] Run /sbin/init as init process [ 13.343810] Unable to handle kernel paging request at virtual address ff= 60007265776f78 [ 13.347271] Oops [#1] [ 13.347749] Modules linked in: [ 13.348689] CPU: 0 PID: 1 Comm: init Not tainted 5.18.0-next-20220524 #1 [ 13.349864] Hardware name: riscv-virtio,qemu (DT) [ 13.350706] epc : special_mapping_fault+0x4c/0x8e [ 13.351639] ra : __do_fault+0x28/0x11c [ 13.352311] epc : ffffffff801210e6 ra : ffffffff8011712a sp : ff20000000= 60bd10 [ 13.353276] gp : ffffffff810df030 tp : ff600000012a8000 t0 : ffffffff80= 008acc [ 13.354063] t1 : ffffffff80c001d8 t2 : ffffffff80c00258 s0 : ff20000000= 60bd20 [ 13.354886] s1 : ff2000000060bd68 a0 : ff600000013165f0 a1 : ff60000001= ec2450 [ 13.355675] a2 : ff2000000060bd68 a3 : 0000000000000000 a4 : ff6000003f= 0337c8 [ 13.356822] a5 : ff60007265776f70 a6 : ff60000001ec2450 a7 : 0000000000= 000007 [ 13.357689] s2 : ff60000001ec2450 s3 : ff60000001ec2450 s4 : ff20000000= 60bd68 [ 13.358487] s5 : ff60000001ec2450 s6 : 0000000000000254 s7 : 0000000000= 00000c [ 13.359305] s8 : 000000000000000f s9 : 000000000000000d s10: ff60000001= e4c080 [ 13.360102] s11: 000000000000000d t3 : 00ffffffbbeab000 t4 : 000000006f= fffdff [ 13.361557] t5 : 000000006ffffe35 t6 : 000000000000000a [ 13.362229] status: 0000000200000120 badaddr: ff60007265776f78 cause: 00= 0000000000000d [ 13.363504] [] __do_fault+0x28/0x11c [ 13.364464] [] __handle_mm_fault+0x71c/0x9ea [ 13.365577] [] handle_mm_fault+0x82/0x136 [ 13.366275] [] do_page_fault+0x120/0x31c [ 13.366906] [] ret_from_exception+0x0/0xc [ 13.368763] ---[ end trace 0000000000000000 ]--- [ 13.368763] ---[ end trace 0000000000000000 ]--- [ 13.369598] Kernel panic - not syncing: Attempted to kill init! exitcode= =3D0x0000000b [ 13.369933] SMP: stopping secondary CPUs Turning CONFIG_COMPAT off, results in the system booting normally again. Heiko > --- > BR2_riscv=3Dy > BR2_TOOLCHAIN_BUILDROOT_MUSL=3Dy > BR2_KERNEL_HEADERS_4_19=3Dy > BR2_BINUTILS_VERSION_2_32_X=3Dy > BR2_TARGET_RUN_TESTSCRIPT=3Dy > BR2_SHUTDOWN_COMMAND_POWEROFF=3Dy > BR2_SYSTEM_DHCP=3D"eth0" > BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=3Dy > BR2_PACKAGE_STRACE=3Dy > BR2_PACKAGE_I2C_TOOLS=3Dy > BR2_PACKAGE_PCIUTILS=3Dy > BR2_PACKAGE_DTC=3Dy > BR2_PACKAGE_DTC_PROGRAMS=3Dy > BR2_PACKAGE_IPROUTE2=3Dy > BR2_TARGET_ROOTFS_BTRFS=3Dy > BR2_TARGET_ROOTFS_CPIO=3Dy > BR2_TARGET_ROOTFS_CPIO_GZIP=3Dy > BR2_TARGET_ROOTFS_EXT2=3Dy > BR2_TARGET_ROOTFS_EXT2_SIZE=3D"16M" > BR2_TARGET_ROOTFS_EXT2_GZIP=3Dy > BR2_TARGET_ROOTFS_ISO_GZIP=3Dy > BR2_TARGET_ROOTFS_SQUASHFS=3Dy > # BR2_TARGET_ROOTFS_TAR is not set >=20 >=20 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 60722C433EF for ; Tue, 24 May 2022 14:43:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=sD/7Y1SqvMe39+TBtGLWUX2MjWoZ4TJnycqGDzjliQk=; b=eZNIxoamUkfFa/ 2KE4UeQ8V1Yf+reW7+jNMVQapohbeU4/Dw89ypGW+ZjXyt5oWifxcrn0g+bOG5qNuul5Zjjinxp6J t1DbJipDuSmwIXjGKKSsFGIrHMbl9IZm5JucLmtlSToYRJsCbCrSG9Q7NYQwgIymJMspgE7o7Smw4 pTyd6u6M8NzxLmJ+iXwYDlJFQeTxbGtY1La+XhE0IeJJA84cCiHJw4XueCYZWs4FF/EQTLF9s2BL8 HeFW8Um8qr3rgUpvy6AyI/jAx+gPf37tAWpWjXgiD/05BGUjayuYm8nOtMlAAZG5X0PmKLOjZW4k/ DHzktuVQujcOiJIQ4Fww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ntVjX-008Hyg-0t; Tue, 24 May 2022 14:42:03 +0000 Received: from gloria.sntech.de ([185.11.138.130]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ntVjS-008Hxq-2z; Tue, 24 May 2022 14:41:59 +0000 Received: from ip5b412258.dynamic.kabel-deutschland.de ([91.65.34.88] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ntVj5-0000Re-B6; Tue, 24 May 2022 16:41:35 +0200 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Guenter Roeck Cc: Guo Ren , Palmer Dabbelt , Arnd Bergmann , Greg Kroah-Hartman , Christoph Hellwig , linux-arch , Linux Kernel Mailing List , linux-riscv , linux-csky@vger.kernel.org, linux-s390 , sparclinux , linuxppc-dev , Parisc List , "open list:BROADCOM NVRAM DRIVER" , Linux ARM , the arch/x86 maintainers , Guo Ren Subject: Re: [PATCH V9 20/20] riscv: compat: Add COMPAT Kbuild skeletal support Date: Tue, 24 May 2022 16:41:34 +0200 Message-ID: <14633832.tv2OnDr8pf@diego> In-Reply-To: <20220523230039.GA238308@roeck-us.net> References: <20220322144003.2357128-1-guoren@kernel.org> <44686961.fMDQidcC6G@diego> <20220523230039.GA238308@roeck-us.net> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220524_074158_173325_5423825D X-CRM114-Status: GOOD ( 35.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Am Dienstag, 24. Mai 2022, 01:00:39 CEST schrieb Guenter Roeck: > On Tue, May 24, 2022 at 12:40:06AM +0200, Heiko St=FCbner wrote: > > Hi Guenter, > > = > > Am Montag, 23. Mai 2022, 18:18:47 CEST schrieb Guenter Roeck: > > > On 5/23/22 08:18, Guo Ren wrote: > > > > I tested Palmer's branch, it's okay: > > > > 8810d7feee5a (HEAD -> for-next, palmer/for-next) riscv: Don't outpu= t a > > > > bogus mmu-type on a no MMU kernel > > > > = > > > > I also tested linux-next, it's okay: > > > > = > > > > rv64_rootfs: > > > > # uname -a > > > > Linux buildroot 5.18.0-next-20220523 #7 SMP Mon May 23 11:15:17 EDT > > > > 2022 riscv64 GNU/Linux > > > > # > > > = > > > That is is ok with one setup doesn't mean it is ok with > > > all setups. It is not ok with my root file system (from > > > https://github.com/groeck/linux-build-test/tree/master/rootfs/riscv64= ), > > > with qemu v6.2. > > = > > That is very true that it shouldn't fail on any existing (qemu-)platfor= m, > > but as I remember also testing Guo's series on both riscv32 and riscv64 > > qemu platforms in the past, I guess it would be really helpful to get m= ore > > information about the failing platform you're experiencing so that we c= an > > find the source of the issue. > > = > > As it looks like you both tested the same kernel source, I guess the on= ly > > differences could be in the qemu-version, kernel config and rootfs. > > Is your rootfs something you can share or that can be rebuilt easily? > > = > I provided a link to my root file system above. The link points to two > root file systems, for initrd (cpio archive) and for ext2. > I also mentioned above that I used qemu v6.2. And below I said > = > > My root file system uses musl. > = > I attached the buildroot configuration below. The buildroot version, > if I remember correctly, was 2021.02. > = > Kernel configuration is basically defconfig. However, I do see one > detail that is possibly special in my configuration. > = > # The latest kernel assumes SBI version 0.3, but that doesn't match q= emu > # at least up to version 6.2 and results in hangup/crashes during reb= oot > # with sifive_u emulations. > enable_config "${defconfig}" CONFIG_RISCV_SBI_V01 > = > Hope that helps, Actually it doesn't seem rootfs-specific at all. Merged was this v9, but the version I last tested was one of the earlier ones, so it looks like something really broke meanwhile. I tested both linux-next-20220524 and palmer's for-next on a very recent qemu - master from april if I remember correctly together with a Debian-based rootfs mounted as nfsroot inside qemu. With CONFIG_COMPAT=3Dy (aka using defconfig directly) I get: [ 12.957612] VFS: Mounted root (nfs filesystem) on device 0:15. [ 12.967260] devtmpfs: mounted [ 13.101186] Freeing unused kernel image (initmem) memory: 2168K [ 13.110914] Run /sbin/init as init process [ 13.343810] Unable to handle kernel paging request at virtual address ff= 60007265776f78 [ 13.347271] Oops [#1] [ 13.347749] Modules linked in: [ 13.348689] CPU: 0 PID: 1 Comm: init Not tainted 5.18.0-next-20220524 #1 [ 13.349864] Hardware name: riscv-virtio,qemu (DT) [ 13.350706] epc : special_mapping_fault+0x4c/0x8e [ 13.351639] ra : __do_fault+0x28/0x11c [ 13.352311] epc : ffffffff801210e6 ra : ffffffff8011712a sp : ff20000000= 60bd10 [ 13.353276] gp : ffffffff810df030 tp : ff600000012a8000 t0 : ffffffff80= 008acc [ 13.354063] t1 : ffffffff80c001d8 t2 : ffffffff80c00258 s0 : ff20000000= 60bd20 [ 13.354886] s1 : ff2000000060bd68 a0 : ff600000013165f0 a1 : ff60000001= ec2450 [ 13.355675] a2 : ff2000000060bd68 a3 : 0000000000000000 a4 : ff6000003f= 0337c8 [ 13.356822] a5 : ff60007265776f70 a6 : ff60000001ec2450 a7 : 0000000000= 000007 [ 13.357689] s2 : ff60000001ec2450 s3 : ff60000001ec2450 s4 : ff20000000= 60bd68 [ 13.358487] s5 : ff60000001ec2450 s6 : 0000000000000254 s7 : 0000000000= 00000c [ 13.359305] s8 : 000000000000000f s9 : 000000000000000d s10: ff60000001= e4c080 [ 13.360102] s11: 000000000000000d t3 : 00ffffffbbeab000 t4 : 000000006f= fffdff [ 13.361557] t5 : 000000006ffffe35 t6 : 000000000000000a [ 13.362229] status: 0000000200000120 badaddr: ff60007265776f78 cause: 00= 0000000000000d [ 13.363504] [] __do_fault+0x28/0x11c [ 13.364464] [] __handle_mm_fault+0x71c/0x9ea [ 13.365577] [] handle_mm_fault+0x82/0x136 [ 13.366275] [] do_page_fault+0x120/0x31c [ 13.366906] [] ret_from_exception+0x0/0xc [ 13.368763] ---[ end trace 0000000000000000 ]--- [ 13.368763] ---[ end trace 0000000000000000 ]--- [ 13.369598] Kernel panic - not syncing: Attempted to kill init! exitcode= =3D0x0000000b [ 13.369933] SMP: stopping secondary CPUs Turning CONFIG_COMPAT off, results in the system booting normally again. Heiko > --- > BR2_riscv=3Dy > BR2_TOOLCHAIN_BUILDROOT_MUSL=3Dy > BR2_KERNEL_HEADERS_4_19=3Dy > BR2_BINUTILS_VERSION_2_32_X=3Dy > BR2_TARGET_RUN_TESTSCRIPT=3Dy > BR2_SHUTDOWN_COMMAND_POWEROFF=3Dy > BR2_SYSTEM_DHCP=3D"eth0" > BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=3Dy > BR2_PACKAGE_STRACE=3Dy > BR2_PACKAGE_I2C_TOOLS=3Dy > BR2_PACKAGE_PCIUTILS=3Dy > BR2_PACKAGE_DTC=3Dy > BR2_PACKAGE_DTC_PROGRAMS=3Dy > BR2_PACKAGE_IPROUTE2=3Dy > BR2_TARGET_ROOTFS_BTRFS=3Dy > BR2_TARGET_ROOTFS_CPIO=3Dy > BR2_TARGET_ROOTFS_CPIO_GZIP=3Dy > BR2_TARGET_ROOTFS_EXT2=3Dy > BR2_TARGET_ROOTFS_EXT2_SIZE=3D"16M" > BR2_TARGET_ROOTFS_EXT2_GZIP=3Dy > BR2_TARGET_ROOTFS_ISO_GZIP=3Dy > BR2_TARGET_ROOTFS_SQUASHFS=3Dy > # BR2_TARGET_ROOTFS_TAR is not set > = > = _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel