From nobody Mon Dec 15 21:47:51 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 02E70B672; Thu, 6 Feb 2025 00:39:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738802369; cv=none; b=DHC58P3PQ9ycObUc8GuQSQoU3AesfSgFQmLoFamOwO13UFndAFvQ+hXxaTKyAx09siAQGyAsKwIJTWo4tvlj2ggl5lE1u/oExCNxQPfrwmRDc5eh9mnqhlzN9c6qQTjl78uytvn8cjZfvs9OfZ+7mulP5bkzkAsu7M7a0+QdwPI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738802369; c=relaxed/simple; bh=dSSyBXccQbzzqU9ow0bKyliJTGRZAtxTLvrCXZNNAa4=; h=Date:From:To:Subject:Cc:MIME-Version:Message-ID:Content-Type; b=sxS1EBCbPSCwWWIOqjDucTkNhxFkdTVm92JoY5vscYe7ac5/SnOl/j1SBsaNRGYhqD33sxRdBre+V7EoOVyTyognWsiyD7xqYiyk5v3BFAs13KTk2wa2sJlehwMmv6m5xjh+oOcM3Fhauj42Zd5+5i/AUGW6nplVcbOfQKcNj3E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=OSV4l1mt; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=/KJZS2aU; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="OSV4l1mt"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="/KJZS2aU" Date: Thu, 06 Feb 2025 00:39:22 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1738802365; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Byo077Hg3W7wtTTe8y9nW+rnNGEnTJlmN8DzLq/ojxc=; b=OSV4l1mtVueamIDPP76s4CfnkVPk8VytGZ7vQDMxd8gzpFy+uOlHber8LelQ+/SSNS4o9d XNUB1IDSq68BbUx/EYhzVG5Tbw81J6YEJ2sT0IBCRYvojp3AYMqJx1KFkFRK8bvpxu+WQp VE3JiQYllyTmhQ003YoocFz1EUVPhwJmcmT3Ql4EQEr/T1PWYssCzfLmF7nNYqRKlyFOPT 8jRtxrNArpaQVl3efgYLeTZd58uY3G3r8bsacvs7YmvsiPMoh/0xvgeSAgYSMk8EKhNpdn qwINnk58MwXcIX0PvNQoLytvUkDQjdHEbHWFNUG6emF/rxbGReoLzdZIzt7e8g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1738802365; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Byo077Hg3W7wtTTe8y9nW+rnNGEnTJlmN8DzLq/ojxc=; b=/KJZS2aUH5tgKCFgxSmUCjABH32IRpYz6u/yR/vfSNHucKI9KDs9uIqEL5Uwbyq+oyTJQQ eu3oTX18CiVUNMAA== From: "tip-bot2 for Maciej Wieczor-Retman" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/mm] x86: Compare physical instead of virtual PGD addresses Cc: "Maciej Wieczor-Retman" , Dave Hansen , x86@kernel.org, linux-kernel@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <173880236261.10177.14147520520179813519.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/mm branch of tip: Commit-ID: 63887c9f02030afd042c125052ad60680f7c21b2 Gitweb: https://git.kernel.org/tip/63887c9f02030afd042c125052ad60680= f7c21b2 Author: Maciej Wieczor-Retman AuthorDate: Tue, 04 Feb 2025 18:33:50 +01:00 Committer: Dave Hansen CommitterDate: Wed, 05 Feb 2025 16:23:17 -08:00 x86: Compare physical instead of virtual PGD addresses This is a preparatory patch for when pointers have tags in their upper address bits. But it's a harmless change on its own. The mm->pgd virtual address may be tagged because it came out of the allocator at some point. The __va(read_cr3_pa()) address will never be tagged (the tag bits are all 1's). A direct pointer value comparison would fail if one is tagged and the other is not. To fix this, just compare the physical addresses which are never affected by tagging. [ dhansen: subject and changelog munging ] Signed-off-by: Maciej Wieczor-Retman Signed-off-by: Dave Hansen Link: https://lore.kernel.org/all/fde443d0e67f76a51e7ab4e96647705840f53ddb.= 1738686764.git.maciej.wieczor-retman%40intel.com --- arch/x86/mm/tlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index 6cf881a..ffc25b3 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -1325,7 +1325,7 @@ bool nmi_uaccess_okay(void) if (loaded_mm !=3D current_mm) return false; =20 - VM_WARN_ON_ONCE(current_mm->pgd !=3D __va(read_cr3_pa())); + VM_WARN_ON_ONCE(__pa(current_mm->pgd) !=3D read_cr3_pa()); =20 return true; }