From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 81D8A2C9D for ; Sun, 9 Jan 2022 12:58:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 851E2C36AED; Sun, 9 Jan 2022 12:58:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1641733102; bh=AWQgXlavyPt2CPbhhZna9wMYGhSB95KVcO0k8/Mhzmo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WXeVbzAIKzN3pNVRLmXLM2MWQLa1x9eJVBUi1oXVA7puBsXd1ZhtdIITc4/Seoev1 bHwbHIiTf1l7D47fOwbxN08qv9iGvmYPxo/KSfeD5wqCW2JVCantp95ikHHaiH4gfV L+7vck7C2l4EwODEIZFzBhJMLpiBfzpJG0bOI60Q= Date: Sun, 9 Jan 2022 13:58:19 +0100 From: Greg Kroah-Hartman To: Nathan Chancellor Cc: Sasha Levin , Catalin Marinas , Will Deacon , Mark Rutland , Marc Zyngier , Nick Desaulniers , linux-arm-kernel@lists.infradead.org, stable@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH RFC 4.9 0/5] Fix booting arm64 big endian with QEMU 5.0.0+ Message-ID: References: <20220107194335.3090066-1-nathan@kernel.org> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220107194335.3090066-1-nathan@kernel.org> On Fri, Jan 07, 2022 at 12:43:30PM -0700, Nathan Chancellor wrote: > Hello everyone, > > After upgrading the version of QEMU used in our CI from 4.2.0 to 6.2.0, > I noticed that our 4.9 arm64 big endian builds stopped booting properly. > This is not something that is clang specific, I could reproduce it with > GCC 8.3.0 (the rootfs is at [1]). > > $ make -skj"$(nproc)" ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- distclean defconfig > > $ scripts/config -e CPU_BIG_ENDIAN > > $ make -skj"$(nproc)" ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- olddefconfig Image.gz > > $ qemu-system-aarch64 \ > -initrd rootfs.cpio \ > -append 'console=ttyAMA0 earlycon' \ > -cpu max \ > -machine virt,gic-version=max \ > -machine virtualization=true \ > -display none \ > -kernel arch/arm64/boot/Image.gz \ > -m 512m \ > -nodefaults \ > -serial mon:stdio > [ 0.000000] Booting Linux on physical CPU 0x0 > [ 0.000000] Linux version 4.9.296 (nathan@archlinux-ax161) (gcc version 8.3.0 (Debian 8.3.0-2) ) #1 SMP PREEMPT Fri Jan 7 19:10:49 UTC 2022 > ... > [ 0.773924] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b > [ 0.773924] > [ 0.776016] CPU: 0 PID: 1 Comm: init Not tainted 4.9.296 #1 > [ 0.776149] Hardware name: linux,dummy-virt (DT) > [ 0.776375] Call trace: > [ 0.777063] [] dump_backtrace+0x0/0x1b0 > [ 0.777293] [] show_stack+0x14/0x20 > [ 0.777420] [] dump_stack+0x98/0xb8 > [ 0.777555] [] panic+0x11c/0x278 > [ 0.777684] [] do_exit+0x940/0x970 > [ 0.777816] [] do_group_exit+0x38/0xa0 > [ 0.777974] [] get_signal+0xb8/0x678 > [ 0.778111] [] do_signal+0xd8/0x9b0 > [ 0.778248] [] do_notify_resume+0x8c/0xa8 > [ 0.778392] [] work_pending+0x8/0x10 > [ 0.778790] Kernel Offset: disabled > [ 0.778891] Memory Limit: none > [ 0.779241] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b > > I ended up bisecting QEMU down to cd3f80aba0 ("target/arm: Enable > ARMv8.1-VHE in -cpu max") [2], which did not seem obviously broken. I > noticed that our 4.14 builds were fine so I ended up doing a reverse > bisect down to commit ec347012bbec ("arm64: sysreg: Move to use > definitions for all the SCTLR bits"). Getting that change to apply > cleanly involved applying the three other arm64 patches in this series > and making it build properly required the BUILD_BUG_ON header split > (including bug.h might have been sufficient but I did not want to risk > any further breakage). I searched through mainline to see if there were > any fixes commits that I missed and I did not find any. > > I am not sure if this series would be acceptable in 4.9, hence the RFC > tag. If not, I am happy to just spin down our boot tests of arm64 big > endian on 4.9, which is not a super valuable target, but I figured I > would send the series and let others decide! > > [1]: https://github.com/ClangBuiltLinux/boot-utils/tree/6cfa15992d375dfb874ca0677abdaebfba4f74e6/images/arm64be > [2]: https://gitlab.com/qemu-project/qemu/-/commit/cd3f80aba0c559a6291f7c3e686422b15381f6b7 Seems sane, having build coverage for 4.9 for the next year is always good to keep going. I'll queue these up now, thanks! greg k-h