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 D63B91DB13A for ; Wed, 2 Apr 2025 11:30:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743593430; cv=none; b=lCC36YYrRTcaCWhRCIQ3v5ZXXCbJ8KR5/158OkG0elApjgJmyM/ClayhFWaRQrhkXby2CeVsZrgdPr/KzuEAkeqAcnBsOTBwTl7IFRNCjSdgt1LrxByjv7RYTeu5DbeijMMt5xXg1Z4FwjH/8xm0xq8YpCyUoakiho31iuTSG48= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743593430; c=relaxed/simple; bh=GhTrSEsErhH6pB3nIT3w8gqGJIivwansEbSybEt8mGo=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=nVgUhWLNY53juMOQzFLiUNsRfeyMdLulnJBdCvOIvZBDi88ZoIZ1Z3nkVZ7xo2Wtes/HmYand+YPwQhJo3rXGS3wnD8u11nC1QeYEy7TXCYcERlKH2cwMA7VAVFKkMKpXAhiC9V1eROXnp8WLePMD8mALIxjtO0nkj3A+hog/hU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tczS/hPZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tczS/hPZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 483A7C4CEDD; Wed, 2 Apr 2025 11:30:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1743593430; bh=GhTrSEsErhH6pB3nIT3w8gqGJIivwansEbSybEt8mGo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=tczS/hPZ2d9M2doPrVb9tQH8+lXRRFwDhEVnk00O+GoAVjktpz4va0cJt4vuw2lCy oF9rK4/XLRT3ivwLDsdJNsF39v0yAccuwaoODDWnxb5r/OKRWb2nksXhgdmqzuEhUi yYzRVi+f8BkzU2vV1MX6L2QVKUFBDHfRcNTS9lH1+l6vp3t01hgNmoXBtd5DGG2J+s oLWaE1upZR5zFrXwGaEKWs0NzOJsYRswKH/xYl3COIcpFDR9p7yWYVPWuROD7es9oM r5pYI76NMVqm8TcEWVxiHtjbhH2eqCBz0FKXw6AmCnAXG82CLwrwJJND0uTInasrjc 1PoWoxddoENSg== Received: from sofa.misterjones.org ([185.219.108.64] helo=lobster-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 1tzwId-001dQt-UK; Wed, 02 Apr 2025 12:30:28 +0100 Date: Wed, 02 Apr 2025 12:30:29 +0100 Message-ID: <87h636ztpm.wl-maz@kernel.org> From: Marc Zyngier To: Oliver Upton Cc: kvmarm@lists.linux.dev, Joey Gouly , Suzuki K Poulose , Jiaqi Yan Subject: Re: [PATCH 1/3] KVM: arm64: Only read HPFAR_EL2 when value is architecturally valid In-Reply-To: <87iknmzudz.wl-maz@kernel.org> References: <20250401224234.2906739-1-oliver.upton@linux.dev> <20250401224234.2906739-2-oliver.upton@linux.dev> <87iknmzudz.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/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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: oliver.upton@linux.dev, kvmarm@lists.linux.dev, joey.gouly@arm.com, suzuki.poulose@arm.com, jiaqiyan@google.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Wed, 02 Apr 2025 12:15:52 +0100, Marc Zyngier wrote: > > On Tue, 01 Apr 2025 23:42:32 +0100, > Oliver Upton wrote: > > > > KVM's logic for deciding when HPFAR_EL2 is UNKNOWN doesn't align with > > the architecture. Most notably, KVM assumes HPFAR_EL2 contains the > > faulting IPA even in the case of an SEA. > > > > Align the logic with the architecture rather than attempting to > > paraphrase it. Additionally, take the opportunity to improve the > > language around ARM erratum #834220 such that it actually describes the > > bug. > > > > Signed-off-by: Oliver Upton > > --- > > arch/arm64/include/asm/esr.h | 1 + > > arch/arm64/kvm/hyp/include/hyp/fault.h | 46 ++++++++++++++++---------- > > 2 files changed, 29 insertions(+), 18 deletions(-) > > > > diff --git a/arch/arm64/include/asm/esr.h b/arch/arm64/include/asm/esr.h > > index d1b1a33f9a8b..7b096ed87360 100644 > > --- a/arch/arm64/include/asm/esr.h > > +++ b/arch/arm64/include/asm/esr.h > > @@ -121,6 +121,7 @@ > > #define ESR_ELx_FSC_SEA_TTW(n) (0x14 + (n)) > > #define ESR_ELx_FSC_SECC (0x18) > > #define ESR_ELx_FSC_SECC_TTW(n) (0x1c + (n)) > > +#define ESR_ELx_FSC_ADDRESS (0x00) > > I think this should probably read "ADDRESS_SIZE", rather than just > "ADDRESS". Actually, we have #define ESR_ELx_FSC_ADDRSZ (0x00) since 61e30b9eef7f ("KVM: arm64: nv: Implement nested Stage-2 page table walk logic") It just isn't at the expected spot. M. -- Jazz isn't dead. It just smells funny.