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 C525DCA1007 for ; Mon, 1 Sep 2025 17:01:06 +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=Nf0iEYuoy/f3YEAHd8aIcTjvCp6fnDRySrUJPkt8Z04=; b=iTC9pI6Hs9eZbn/yo6XPl59YSP FGjsKv+WVJT+/t2l1xn9dMQ4BCBV8uILcQXOZp5fYYca9e+AAi2MaaiTn+PP0EU5N6N/MKBfmjQC9 GaT0AFbcQt3B0zmas8h64fhrFpfK9uj8u6iU5P5PQoANhl2/BwXiJO1ibu/9vcAU+ueJiR++9rZ0P oY+L5GbAmbj5jR3R7s0INjt/SKZMcGzAXnYcaF2uxb4qyQ3AUISTCmu0vo4bs75CLuAfL79vmfcKz VpF+Ha2GR48bdbU53CXfiIHPJaKO7ShaBc7WkdAb5+TyLY8yE49MZ9XSl3dzG2RJoJrhoOP1H82/T 2AKZ9+Dg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1ut7tt-0000000DNGZ-0750; Mon, 01 Sep 2025 17:01:01 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1ut4a4-0000000Cgf0-3JIl for linux-arm-kernel@lists.infradead.org; Mon, 01 Sep 2025 13:28:20 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 062FE601D6; Mon, 1 Sep 2025 13:28:19 +0000 (UTC) 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) 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 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 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.