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 B02D8340DB9; Mon, 1 Sep 2025 14:26:09 +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=1756736769; cv=none; b=p+fX6QM6HxylPf7p2XTDPR81nfVFNa//bviUE7dNxyZ8qB020ISPTlYitMRa9Bt+m/Q7KFCuY1LpF0XVkeM1tjVLL/UslGLzMjJ5fM0d3m6lKT6JW5+f6a63zrdoIurirGVxQesHeM7tdhLNqbRXJBebfRdbk1S/GIxYJeYViig= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756736769; c=relaxed/simple; bh=0WO6REd4oQvsCY4rMsXYlUrit5wokYp9C49/smrjrtE=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=TovSVA/mPvDDxOobPEgRteJfV0KX1nd/UtpyXPkVRo6QNcX+bnu/IW2tKcgrGl3IvhwSZdpipwmuR4opQpwLYQkuFB060ZWsoIsl30Z0OkOKscDwhTg7+hoS8n+P6HiPHRCcgKgCH0PdT5hEOFMvxJbz51w7DXYV3dCNmYyV4dk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=q4DAY7AB; 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="q4DAY7AB" 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) Precedence: bulk X-Mailing-List: kvm@vger.kernel.org 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, 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 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.