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 B7370C54E58 for ; Thu, 21 Mar 2024 20:16:41 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fdcQVIKTbqhdG+ZU7GBNZY8Hyd6xdY7DHi5dxkxUS/g=; b=rHJSwLRIRDYDog AAhTzsR5i2vxPn+PuQM0TJgwHSBxB2569eUbtXXmfmo41GlVXHxJYnjCQFiHxi+0F2kvrdxX+fU9c ierIjbWzoJ2Od4dYefv+YeSNzPsKylYw9OsJJY48r2A6d8AtIZhtvdpXUGphy9t5rb5o8R8T9mY3P zmlXhXapgvG+W/X6lg4hu9XKYTT0QcU7ZzabJEnIgqjor1J0Tc6uip6A6ah1P0kxf0bSjvHo3ejbQ l6D6ASVQMpdSKD6kLV81d56ysHMu3JN+TDkohpG9tySppi0lP/CSktRPaJjSCKlMpWQUT7DbbGnzr QUG7HaWYijiX8A4/qqSw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnOpt-00000004V8N-1fH2; Thu, 21 Mar 2024 20:16:25 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnOpq-00000004V7p-3lI8 for linux-arm-kernel@lists.infradead.org; Thu, 21 Mar 2024 20:16:24 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 60631CE14E7; Thu, 21 Mar 2024 20:16:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10044C433F1; Thu, 21 Mar 2024 20:16:17 +0000 (UTC) Date: Thu, 21 Mar 2024 20:16:15 +0000 From: Catalin Marinas To: Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, Will Deacon , James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu Subject: Re: [PATCH] arm64: Fix early handling of FEAT_E2H0 not being implemented Message-ID: References: <20240321115414.3169115-1-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240321115414.3169115-1-maz@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240321_131623_167427_DF817426 X-CRM114-Status: GOOD ( 17.69 ) 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="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Mar 21, 2024 at 11:54:14AM +0000, Marc Zyngier wrote: > Commit 3944382fa6f2 introduced checks for the FEAT_E2H0 not being > implemented. However, the check is absolutely wrong and makes a > point it testing a bit that is guaranteed to be zero. > > On top of that, the detection happens way too late, after the > init_el2_state has done its job. > > This went undetected because the HW this was tested on has E2H being > RAO/WI, and not RES1. However, the bug shows up when run as a nested > guest, where HCR_EL2.E2H is not necessarily set to 1. As a result, > booting the kernel in hVHE mode fails with timer accesses being > cought in a trap loop (which was fun to debug). > > Fix the check for ID_AA64MMFR4_EL1.E2H0, and set the HCR_EL2.E2H bit > early so that it can be checked by the rest of the init sequence. > > With this, hVHE works again in a NV environment that doesn't have > FEAT_E2H0. > > Fixes: 3944382fa6f2 ("arm64: Treat HCR_EL2.E2H as RES1 when ID_AA64MMFR4_EL1.E2H0 is negative") > Signed-off-by: Marc Zyngier Acked-by: Catalin Marinas I assume Oliver will take it, otherwise I can pick it up after -rc1 since I don't have the fixed commit in my tree. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel