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 E59CCC19776 for ; Fri, 28 Feb 2025 10:32:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=p4OQhE0Z9A+uhMViDYZDzVf+LSvrQLnNUXYLXlkj2/4=; b=CXQSXobXaZT6DVP7mRPR/KWhWk UtwcPeqkH3s8GhIqxQ96/dg0nl3x3pkhVnAHFBEe+qHnowfACiPP9LbvGxPVLd2TIpGyKtkHJjzGm xJditwIp7vMUP0PzU9cNicmR2VdEIOc4+oE6Pb99BLZEus/6LF56Vyo633VxREohcqYumTIlSZpUp DG6E5Vny1Sn5/2l5E0bdw+62KliZ1kpP/DZpp2OER+Eze1HxwfuAyJYIXrsmsYSoF7uasGM/LDq47 AHqVcEY0iABiw4PokGxMB6L7q/tK5p5khnNnMm+a+K7gcFy6pqb2w30M7JSoUs8TB0AOFnn0skBk8 BivRqUHA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tnxfg-0000000Ac2Q-29Nn; Fri, 28 Feb 2025 10:32:44 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tnxU3-0000000AZVp-0F3j for linux-arm-kernel@lists.infradead.org; Fri, 28 Feb 2025 10:20:43 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 288B460008; Fri, 28 Feb 2025 10:20:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5DA8AC4CED6; Fri, 28 Feb 2025 10:20:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1740738041; bh=DlrJyqGlbTlAASX6CvC8BEd+irS6odxJiqxBLjq07Z0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=jcg1g2AHGiEdiXGgfXC0+bi/U+Jxfj958eyETbbOIqfm/WKA8ONpbhGOQgjwFRVKD ld3jt349EQ1hHerN/1TqqaJh1YK1v5G9po0XxavY3T8iIR2T7T+zLzz5gfFqUI/P+5 wFj6M1rcqBRO5N6jrGgxTcAoynImxWDvsyxB3DdOqd7lHhRaTKSCOMlQEd//8EjHmv Lip1nMdJA8UDoaq8jlc+ZHBvP2vwXoEkoEe7lqQpQ6JSSJIYw1x4Q33q9Dqf1G5Wu+ aAKZwOU42Kx1V618QDAdd1R/vblhD7qDN463jlvCrG76mTAIUAWC0SRJAO+Hhh3a4N Q0p1tV9YxGcAA== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tnxTz-0090Qy-66; Fri, 28 Feb 2025 10:20:39 +0000 Date: Fri, 28 Feb 2025 10:20:38 +0000 Message-ID: <86v7supdzd.wl-maz@kernel.org> From: Marc Zyngier To: Mark Rutland Cc: Leo Yan , linux-arm-kernel@lists.infradead.org, ahmed.genidi@arm.com, ben.horgan@arm.com, catalin.marinas@arm.com, kvmarm@lists.linux.dev, oliver.upton@linux.dev, will@kernel.org Subject: Re: [PATCH 1/2] KVM: arm64: Initialize HCR_EL2.E2H early In-Reply-To: References: <20250227180526.1204723-1-mark.rutland@arm.com> <20250227180526.1204723-2-mark.rutland@arm.com> <20250228092955.GC2157064@e132581.arm.com> <86y0xqpfpj.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.4 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: mark.rutland@arm.com, leo.yan@arm.com, linux-arm-kernel@lists.infradead.org, ahmed.genidi@arm.com, ben.horgan@arm.com, catalin.marinas@arm.com, kvmarm@lists.linux.dev, oliver.upton@linux.dev, will@kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 28 Feb 2025 09:52:50 +0000, Mark Rutland wrote: > > On Fri, Feb 28, 2025 at 09:43:20AM +0000, Marc Zyngier wrote: > > On Fri, 28 Feb 2025 09:29:55 +0000, > > Leo Yan wrote: > > > > > > Hi Mark, > > > > > > On Thu, Feb 27, 2025 at 06:05:25PM +0000, Mark Rutland wrote: > > > > > > [...] > > > > > > > +.macro init_el2_hcr val > > > > + mov_q x0, \val > > > > + > > > > + /* > > > > + * Compliant CPUs advertise their VHE-onlyness with > > > > + * ID_AA64MMFR4_EL1.E2H0 < 0. On such CPUs HCR_EL2.E2H is RES1, but it > > > > + * can reset into an UNKNOWN state and might not read as 1 until it has > > > > + * been initialized explicitly. > > > > > > For ID_AA64MMFR4_EL1.E2H0 < 0 case, the code actually clears the > > > HCR_EL2.E2H bit. > > > > > > Hence, the comment should be corrected as: "... it can reset into an > > > UNKNOWN state and might not read as 0 until it has been initialized > > > explicitly". > > > > The comment is just fine. It is the code that is wrong, as it avoids > > setting E2H when E2H0 < 0 while we want the exact opposite behaviour. > > > > As a result, 'b.lt' really should be a 'b.ge'. Or the original code > > kept as is. > > Ugh, yes. I got confused and got the condition backwards. > > Either works. Using 'b.ge' is closer to my intention -- I found the > 'tbz' of the sign bit somewhat surprising and that needed a longer line > after the lable name changed. > > Would you like me to respin, or would you be hapy to fix up when > applying? I can fix it on the fly, but it needs retesting, as I don't understand how things could work in this state. Thanks, M. -- Without deviation from the norm, progress is not possible.