All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: "Kiryl Shutsemau (Meta)" <kas@kernel.org>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Andy Lutomirski <luto@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Rick Edgecombe <rick.p.edgecombe@intel.com>
Cc: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	Peter Xu <peterx@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"David Hildenbrand (Arm)" <david@kernel.org>,
	"Mike Rapoport (Microsoft)" <rppt@kernel.org>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	Andrew Donnellan <andrew+kernel@donnellan.id.au>,
	Rohan McLure <rmclure@linux.ibm.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Tejun Heo <tj@kernel.org>,
	"Jose A. Perez de Azpillaga" <azpijr@gmail.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	kernel-team@meta.com
Subject: Re: [PATCH] x86/mm: Define the zapped-entry checks only with CONFIG_DEBUG_VM
Date: Mon, 2 Nov 2026 13:12:47 -0800	[thread overview]
Message-ID: <b04316eb-a2f8-4587-9392-e673c7bd2fc8@intel.com> (raw)
In-Reply-To: <20261102144001.342837-1-kas@kernel.org>

On 11/2/26 06:39, Kiryl Shutsemau (Meta) wrote:
...
> +#ifdef CONFIG_DEBUG_VM
>  void arch_check_zapped_pte(struct vm_area_struct *vma, pte_t pte)
>  {
>  	/*
> @@ -823,3 +824,4 @@ void arch_check_zapped_pud(struct vm_area_struct *vma, pud_t pud)
>  	/* See note in arch_check_zapped_pte() */
>  	VM_WARN_ON_ONCE(!(vma->vm_flags & VM_SHADOW_STACK) && pud_shstk(pud));
>  }
> +#endif

So all these #ifdefs are because VM_SHADOW_STACK, a *constant* is not
available? That's unfortunate.

I dislike doing this gunk with macros, but I'd take that over new
#ifdefs. Or, settle the "does the arch provide these debug functions?"
at Kconfig time with an ARCH_HAS_FOO option. That could even be driven
from the x86 side with:

	select ARCH_HAS_CHECK_ZAPPED_PTE if DEBUG_VM

Or, put them in a new header. They're only used in memory.c, so what's
keeping them in pgtable.h? Another header could reference
VM_SHADOW_STACK. No?

Or, heck, I'm not that attached to these checks. Let's just kill them.

But I really don't like the new #ifdefs. It would be about my fifth
favorite way to fix this.


  parent reply	other threads:[~2026-11-02 21:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02 14:39 [PATCH] x86/mm: Define the zapped-entry checks only with CONFIG_DEBUG_VM Kiryl Shutsemau (Meta)
2026-11-02 16:09 ` Jose A. Perez de Azpillaga
2026-11-02 16:53 ` Edgecombe, Rick P
2026-11-02 17:32   ` Kiryl Shutsemau
2026-11-02 19:07     ` Edgecombe, Rick P
2026-11-02 21:12 ` Dave Hansen [this message]
2026-11-03 10:13   ` Kiryl Shutsemau
2026-11-03 15:50     ` Edgecombe, Rick P
2026-11-05 11:55       ` Kiryl Shutsemau
2026-11-04 10:13     ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b04316eb-a2f8-4587-9392-e673c7bd2fc8@intel.com \
    --to=dave.hansen@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=andrew+kernel@donnellan.id.au \
    --cc=azpijr@gmail.com \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=david@kernel.org \
    --cc=hpa@zytor.com \
    --cc=kas@kernel.org \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=pasha.tatashin@soleen.com \
    --cc=peterx@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rick.p.edgecombe@intel.com \
    --cc=rmclure@linux.ibm.com \
    --cc=rppt@kernel.org \
    --cc=tglx@kernel.org \
    --cc=tj@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.