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 3A3471CDFCA; Mon, 1 Sep 2025 13:28:18 +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=1756733300; cv=none; b=ubolxBCfzVBKsbHL/aZyJf/eYD5chkPib+lrlkIp6uDC7aaxsC/Zu5L/QQP42IAdMkmV3zH9/9BXxGWE4TYy857+U/ntRm9+W4pvbrIeCNFLLv+fVMwLPHgx/1pDVgemxlowZKFPbx9rSETgkNVkOcEIqWcY97xgzrVLiaD9aeY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756733300; c=relaxed/simple; bh=Zij+aiPmhHbsz6ba8gUa8QWGp81pVIPzIJsYgiGdtnI=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=o+NleZfzVn/usWRfaOzIKB5DZiJnv7KC5QvLtT5YRhl1vix/ymU76kWThG9KQJcNR9rDESpZCpfG0nIINkp/f0jYrWAaQq6op2JP9z0m11zlhFU4YAMKxvj2VF+JMsjC4f0IkNvR3Qei+0OhAVaVPQD9t/IyPkfOAGBBo1u/tCM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ca6rdAH3; 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="ca6rdAH3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD465C4CEF0; Mon, 1 Sep 2025 13:28:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756733298; bh=Zij+aiPmhHbsz6ba8gUa8QWGp81pVIPzIJsYgiGdtnI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ca6rdAH3pva2fovuGbIWfgXcx484jiVI7RZ6LdQTXP3H/8arYoZnXfvhfyD3AwCX2 byss9qUQQXj2N0KlPj724lbgQdUFYASUmt7ZtyTLmrp7GdvFB30FTxIFF5HbU5BOTZ lf6Rmk0QyBDFb6nLiOmYxoBbpjE8YX092ZJOFU5V49SHy8zZH/CJf7WrhB/DdV2Zts qHb7Gz7B9S+zJeflg+ZjaGPe9ihXFcsiH1xDCk1gz5EBpJhiXyyfvLtFZ4x/ZAqerW lD+Anfs4T61RDNgDj646O1IQUHKx63m85easozpSlGHJiKh27LrVGZwnmzRAKYJWNw Xn/lVC3odT8dQ== 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.98.2) (envelope-from ) id 1ut4a0-00000002Gdt-2tvq; Mon, 01 Sep 2025 13:28:16 +0000 Date: Mon, 01 Sep 2025 14:28:16 +0100 Message-ID: <86zfbecnf3.wl-maz@kernel.org> From: Marc Zyngier To: Gyujeong Jin Cc: oliver.upton@linux.dev, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, gyutrange Subject: Re: [PATCH] KVM: arm64: nested: Fix VA sign extension in VNCR/TLBI paths In-Reply-To: <20250901124520.54259-1-wlsrbwjd7232@gmail.com> References: <20250901124520.54259-1-wlsrbwjd7232@gmail.com> 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: wlsrbwjd7232@gmail.com, oliver.upton@linux.dev, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, wlsrbwjd643@naver.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Mon, 01 Sep 2025 13:45:20 +0100, Gyujeong Jin wrote: > > From: gyutrange > > Signed-off-by: gyutrange Where is the commit message? > --- > arch/arm64/kvm/nested.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm64/kvm/nested.c b/arch/arm64/kvm/nested.c > index 77db81bae86f..eaa6dd9da086 100644 > --- a/arch/arm64/kvm/nested.c > +++ b/arch/arm64/kvm/nested.c > @@ -1169,7 +1169,7 @@ int kvm_vcpu_allocate_vncr_tlb(struct kvm_vcpu *vcpu) > > static u64 read_vncr_el2(struct kvm_vcpu *vcpu) > { > - return (u64)sign_extend64(__vcpu_sys_reg(vcpu, VNCR_EL2), 48); > + return (u64)sign_extend64(__vcpu_sys_reg(vcpu, VNCR_EL2), 47); > } > This code is not there for sign extension of the VA. It is there for the propagation of bit 48 (yes, bit 48, not a typo) in RESS and the top bits of BADDR. D24.2.206 has all the details for this. Furthermore, we already check that the VA is canonical at the point of establishing the translation (see the references to R_YYVYV and I_THCZK in the S1 PTW code), and don't install a TLB in that case. But maybe you have spotted something I didn't, so some explanations would be very welcome. Thanks, M. -- Without deviation from the norm, progress is not possible.