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 9C6A7C433F5 for ; Mon, 14 Feb 2022 16:27:20 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:Subject:Cc:To:From :Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6ktrWdpROn2phJttUxUPvqo+D30rQvYPwHaimq80WPU=; b=sxwlVgScWpRixYhfo4djbkY3cJ EmyT9x0B5UiXHQa5KsPdpFFW8WJRgHLv0Zt9D1bXquZYCorzVlU08p4O9qaCCPle0pcX6BosCYLx2 /tlx9vPTWc+cUV2vW7KpLnWiHx7mx696oS32nGaFHc6LorJoABQ1ZoYXUDCcERf01z6UnJwXDcK89 qkNXkoYJ+qNxCbz2HUP0ZNfs7WGjq0w1B20EUdRw7iIs6+2x2Fmia+2n4X4sqBDhM3VxrNH2UtKum xDxhoIkrZR05A2OCqDCQ/lBbrk3KTf1UR1i8Oo2CSjczhKLexPvFtrtQA3ZVJy7xm1/vYUQahEnfC 8sPrgqGA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nJeB1-00G0Au-Ry; Mon, 14 Feb 2022 16:26:11 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nJeAx-00G0AM-IZ for linux-arm-kernel@lists.infradead.org; Mon, 14 Feb 2022 16:26:09 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CB053B80E03; Mon, 14 Feb 2022 16:26:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78588C340E9; Mon, 14 Feb 2022 16:26:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644855964; bh=DjL8MBhYKguY6LK9fYhbYcEqfMd46yFzeU2/Ht1HkWQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=baoK1QbqOZc1JfQNHdyR+1uUoUSN2aFjV9dB9QVkp0//eYyh7HZbNj1i/rjDjeBhi KIyh95W5xqtXeETN4qZ/JKUx4hPDxKmDMqeMIOimJ8mnUCRS9gstC4lce/Dy226hGz w2iNcKSScBnwJWnrTTEmNP7S6UzmF0PwDMKYaW6975gJLn7o/t/hEyiBLqTfZ+8oaC zXRqzhj6H6WlLuZdroLJYPYA2WCOTqwXmq+bd7yqjv1M7ilwJjXBWMHsrpSb1Ai6lo bIHS5JfPvhenqU8TkUJWXjd7paZCYfkrFTJLudFFdx7+fThey+5+BNRafFCEt8UP6m kApizrAsBSW6g== Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nJeAs-007pQm-1G; Mon, 14 Feb 2022 16:26:02 +0000 MIME-Version: 1.0 Date: Mon, 14 Feb 2022 16:26:01 +0000 From: Marc Zyngier To: Mark Rutland Cc: Joakim Tjernlund , linux-arm-kernel@lists.infradead.org Subject: Re: Buggy branch in __init_el2_gicv3? In-Reply-To: References: User-Agent: Roundcube Webmail/1.4.13 Message-ID: X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: mark.rutland@arm.com, Joakim.Tjernlund@infinera.com, linux-arm-kernel@lists.infradead.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220214_082607_816376_73DF2ED4 X-CRM114-Status: GOOD ( 14.67 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2022-02-14 14:56, Mark Rutland wrote: > On Mon, Feb 14, 2022 at 12:34:12PM +0000, Joakim Tjernlund wrote: >> In init_el2_state calls __init_el2_gicv3 which looks: >> >> /* GICv3 system register access */ >> .macro __init_el2_gicv3 >> mrs x0, id_aa64pfr0_el1 >> ubfx x0, x0, #ID_AA64PFR0_GIC_SHIFT, #4 >> cbz x0, .Lskip_gicv3_\@ >> >> mrs_s x0, SYS_ICC_SRE_EL2 >> orr x0, x0, #ICC_SRE_EL2_SRE // Set ICC_SRE_EL2.SRE==1 >> orr x0, x0, #ICC_SRE_EL2_ENABLE // Set ICC_SRE_EL2.Enable==1 >> msr_s SYS_ICC_SRE_EL2, x0 >> isb // Make sure SRE is now set >> mrs_s x0, SYS_ICC_SRE_EL2 // Read SRE back, >> tbz x0, #0, 1f >> // tbz x0, #0, .Lskip_gicv3_\@ // and check that it sticks >> msr_s SYS_ICH_HCR_EL2, xzr // Reset ICC_HCR_EL2 to defaults >> .Lskip_gicv3_\@: >> .endm >> >> Note the tbz x0, #0, 1f, this instruction causes my A53 CPU to >> jump far out of the macro and make the >> CPU go into EL0, failing with an exception a bit later. I believe the >> 1f is a bug and if I replace it with >> tbz x0, #0, .Lskip_gicv3_\@ >> the CPU continue too boot. > > You're right, that should be targetting `.Lskip_gicv3_\@`. It looks > like that > was left behind in commit: > > 114945d84a30a5fe ("arm64: Fix labels in el2_setup macros") > > Marc? Yup, that's a glaring bug. My bad. Thanks for pointing that out. Joakim, can you please write a patch and cc me? Cheers, M. -- Jazz is not dead. It just smells funny... _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel