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 A5C8ECA0FFF for ; Mon, 1 Sep 2025 17:42:40 +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=HTMAHOY7CekD0uSloWLAHQhIBiSuruC9ouz8hZTGULY=; b=jVk2kiLggaqVky8rrNscmb2W+N KXruBj8FXPZlbv5BAKbShgjWebxkqN3LKToycarn4sW83FZz+8SW09n/MfTip7+e/ezyiEG/n8dVO oRu7hcXcJJ5TZmbP6er1gzhRiwO5Jd/FjczkkUJGmFIqD3jcwhhJXDTECRGIeo1O04HeBvJFDDY5+ fzddn6CjMkB5sU8NhGeNMnSU55/CWe/pSchTfnmVD5lqoZd2B2hC0CldH83c4VPuLRykMTbSM4uwM IRwu1Y6vkai22dGAHMe/0TF1cKStqjRyp5XF1HCQEBbO0hem9lMT9j1PeRxfgO5Vbv8Dsczr2HlFK vB+xKyXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1ut8Y7-0000000DUHl-24LL; Mon, 01 Sep 2025 17:42:35 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1ut5U2-0000000CpiF-0T4p for linux-arm-kernel@lists.infradead.org; Mon, 01 Sep 2025 14:26:10 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 8A1E6601EA; Mon, 1 Sep 2025 14:26:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3AB0CC4CEF0; Mon, 1 Sep 2025 14:26:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756736769; bh=0WO6REd4oQvsCY4rMsXYlUrit5wokYp9C49/smrjrtE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=q4DAY7ABYkSzdE831zYkR8TEHHcXStCW1kAf5cjAQADJD6wQFfX6pj4vyhO2smCS+ UjNdQ6hRjwqaSAtQ4VM0yJmlpeNJHcu8bgOg8/k1PnQlTFbxqGGKSU6zyK7wxJPNsv XOkNkvF/vuJ2Q1ihQqpWo3NbOw+sMHcn4u9/v7AhkHBTJemR2HdWTJOV6qCtJBiroH IAf6YiPlifnl/9q6qSImEeiTpUfBzk5wzELx5t5dZtM6GAyFMssvhSqugYx0mWFYgl iXaUfp4fTcJA3lXwLozHZ6UoL6laDnmbu2GVgcrjkhSNpZ+Jt0t9/nvV+ScraR/EM7 rV3R4xx28LUfg== 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 1ut5Ty-00000002HzM-3soH; Mon, 01 Sep 2025 14:26:07 +0000 Date: Mon, 01 Sep 2025 15:26:06 +0100 Message-ID: <86wm6ickqp.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, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, gyutrange , stable@vger.kernel.org, DongHa Lee , Daehyeon Ko <4ncient@example.com>, Geonha Lee , Hyungyu Oh , Jaewon Yang Subject: Re: [PATCH] KVM: arm64: nested: Fix VA sign extension in VNCR/TLBI paths In-Reply-To: <20250901141551.57981-1-wlsrbwjd7232@gmail.com> References: <20250901141551.57981-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, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, wlsrbwjd643@naver.com, stable@vger.kernel.org, gap-dev@example.com, 4ncient@example.com, leegn4a@example.com, dqpc_lover@example.com, r4mbb1@example.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 15:15:51 +0100, Gyujeong Jin wrote: > > From: gyutrange > > VNCR/TLBI VA reconstruction currently uses bit 48 as the sign bit, > but for 48-bit virtual addresses the correct sign bit is bit 47. No, that's not the case. Bit 55 is used at all times to determine which half of the address space a VA gets resolved from. > Using 48 can mis-canonicalize addresses in the negative half and may > cause missed invalidations. > > Although VNCR_EL2 encodes other architectural fields (RESS, BADDR; > see Arm ARM D24.2.206), sign_extend64() interprets its second argument > as the index of the sign bit. Passing 48 prevents propagation of the > canonical sign bit for 48-bit VAs. > > Impact: > - Incorrect canonicalization of VAs with bit47=1 No. We are not trying to make the VA canonical. > - Potential stale VNCR pseudo-TLB entries after TLBI or MMU notifier No. The pseudo TLB is never created the first place. > - Possible incorrect translation/permissions or DoS when combined > with other issues Please explain, as "other issues" is not a valid argument. Thanks, M. -- Without deviation from the norm, progress is not possible.