From nobody Mon Mar 23 19:50:47 2026 Received: from mail-wr1-f74.google.com (mail-wr1-f74.google.com [209.85.221.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 985F835F5E2 for ; Mon, 23 Mar 2026 14:25:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774275916; cv=none; b=czAjQ4nm9H6Ttum1t0oDiPKVMZlKqVEr8T7qYCXqF9GZwJgDmqQZgrQ/DjPTVlmAvW/5d419/RvS09AVrrEsampfH3BGqII9meoPuZGf2MCbinqVbh69H/pXdHDIlVj/g1Ekl6b+ahS5vGNfTYuNONBce4QrhD3I/WNAMFvSFJQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774275916; c=relaxed/simple; bh=c4ziZG1QNgdELBlufA4p3XIMqT156MY+MLHSBBzyyuU=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=Tqfg2bhJV/0jY/rKU+VuMVbjlCGWHuf0RPKLD3veI869rWI8mlH7D2n6yxKpzP2kf2E9kcznnO9vXTw3nQ1MYXZbHQol4RvUEbp5+qMhhPKiEMDOuiSOTqOJZQ5kNgEGiym8ZQdg+kJnLmw01G9DDLZPPPrf8RRjrZRiXdNwOg0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=mNncipyq; arc=none smtp.client-ip=209.85.221.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="mNncipyq" Received: by mail-wr1-f74.google.com with SMTP id ffacd0b85a97d-439bab2d095so3175391f8f.3 for ; Mon, 23 Mar 2026 07:25:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1774275913; x=1774880713; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=s+bK9jZ7vTm7oGWlqkE16yrkEGEe7oSAyYs+Qzsniac=; b=mNncipyqrYPziiUPNDaBbp3dnjGE3UeWlv2OSYrr+8sARHA1DI5HXH9oYMZTEkEqNz dBSZ9lr9oJuX+HSPdxqRR1fjcRhTX8BeCyDlxXk2n7KjOFSmeX2xjyE3z73VQkPHr5gY UcGrT7XQgsTA3Cq3kBLNMNmCJLv1XGipt03zC79Pbo7vswnLsSNYrggZvic9oLTqmXCj HfNek/g0IBQcrHr/1qxF+LJpsbIqBsFmpifjmP+bHwOGRRiIfBK81pkI16G7hvd+RJrj n3/cZPK5Fo10yywNhhQcANB7Gd+MhoeT0hIfLo1hwWtoRbuw+DHWxi+qOLU59xe3lpor Mf9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774275913; x=1774880713; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=s+bK9jZ7vTm7oGWlqkE16yrkEGEe7oSAyYs+Qzsniac=; b=p1ZPqmeqt84sggKX4Ea9/rOzO4gQn5ZBW/OX88SubWk/0dncpSq+jxg20K/D5zGcZJ G3qrwSDPfkuIt70AN2Mqzu/jh8nvIYJpYdiaBMrTbG33eDcMRvfrXJBWyIy8qFWfmk+Z JWSp4uxFqX4GPxWzF/J8bZMztuBaPkS9g5TVb6RGxdVtaZIpsSrYku3EAEgiknTL6fdX scth8aehquFHYl9LdXvszkJbKIBV+s3yYnOo/OB7wVp8H8BQQyfp4mK6v0wg5GV9/kro pqWO9ccsEbxKACanIXYCAQ8QN4bFFuB610X0HLAsdgmtrKWULioZVIYctctoj5C4aKG5 GIxg== X-Gm-Message-State: AOJu0Yz/u5FXY9hhIp4QJnyFzdGEnypoMrcRYvrDlxwmElWL7UIUuB5K IyKvJs6mcs9boOLcuOwvnSAoqMe0+eVXPq3+3qnx+Y7enDMUhGlrqrXiCX6ys3UJcI7nzsB3XO1 cLICMF4Xhv8KMkA== X-Received: from wrpa8.prod.google.com ([2002:adf:eec8:0:b0:43b:44e1:22ff]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6000:1a8d:b0:43b:5765:96a9 with SMTP id ffacd0b85a97d-43b6424fca9mr18284105f8f.24.1774275912456; Mon, 23 Mar 2026 07:25:12 -0700 (PDT) Date: Mon, 23 Mar 2026 14:25:07 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAEJNwWkC/32NXQ7CIBCEr9Lss2u62B/1yXuYxiCslKSFBhqia bi72AP4+E1mvtkgcrAc4VptEDjZaL0rIA4VqFE6w2h1YRC16OoTES5GPyYbV1R+ntmtKJgv/bn vVNsKKLMl8Mu+d+V9KDyWsg+f/SHRL/0jS4SEDcuWng1JzXwz3puJj6UAQ875C2RN8+axAAAA X-Change-Id: 20260311-pgd_list-comment-2ee97876c552 X-Mailer: b4 0.14.3 Message-ID: <20260323-pgd_list-comment-v2-1-77ccf2dc77e8@google.com> Subject: [PATCH v2] x86: update comment about pgd_list From: Brendan Jackman To: Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org, Brendan Jackman Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable This venerable comment got detached from its context when the code moved in commit 394158559d4c ("x86: move all the pgd_list handling to one place"). Put it back next to its context. It was originally on pgd_list_add() but it actually describes pgd_list so put it there. While moving it, update it to strip away stale and superfluous info. pageattr.c doesn't exist any more. pgd_list is now required for all x86 architectures. Also be slightly more precise about what PGDs are in this list. Signed-off-by: Brendan Jackman --- Changes in v2: - Moved it next to pgd_list instead of back to old location - Strip away stale bits from the comment - Added note about PGDs that _aren't_ in this list - Link to v1: https://lore.kernel.org/r/20260311-pgd_list-comment-v1-1-4ea5= 1b41adee@google.com --- arch/x86/mm/fault.c | 6 ++++++ arch/x86/mm/pgtable.c | 11 ----------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index f0e77e0844820..cf7144d386b87 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -169,6 +169,12 @@ is_prefetch(struct pt_regs *regs, unsigned long error_= code, unsigned long addr) } =20 DEFINE_SPINLOCK(pgd_lock); +/* + * List of all process' PGD pages (excluding init_mm and some other special + * system-wide PGDs); for kernel addresses the lower level pages are mostly + * shared but the PGD itself is local to each mm. This list is mainly used= to + * keep those in sync. + */ LIST_HEAD(pgd_list); =20 #ifdef CONFIG_X86_32 diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c index 2e5ecfdce73c3..2a84fdeca8874 100644 --- a/arch/x86/mm/pgtable.c +++ b/arch/x86/mm/pgtable.c @@ -99,17 +99,6 @@ static void pgd_dtor(pgd_t *pgd) spin_unlock(&pgd_lock); } =20 -/* - * List of all pgd's needed for non-PAE so it can invalidate entries - * in both cached and uncached pgd's; not needed for PAE since the - * kernel pmd is shared. If PAE were not to share the pmd a similar - * tactic would be needed. This is essentially codepath-based locking - * against pageattr.c; it is the unique case in which a valid change - * of kernel pagetables can't be lazily synchronized by vmalloc faults. - * vmalloc faults work because attached pagetables are never freed. - * -- nyc - */ - #ifdef CONFIG_X86_PAE /* * In PAE mode, we need to do a cr3 reload (=3Dtlb flush) when --- base-commit: 2ca26dad836fb4cd18694ef85af7a71d2878b239 change-id: 20260311-pgd_list-comment-2ee97876c552 Best regards, --=20 Brendan Jackman