From: sashiko-bot@kernel.org
To: "Muhammad Usama Anjum" <usama.anjum@arm.com>
Cc: linux-perf-users@vger.kernel.org, damon@lists.linux.dev,
bpf@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH RFC 01/11] mm: introduce hw_pte_t for PTE table storage
Date: Mon, 27 Jul 2026 16:58:23 +0000 [thread overview]
Message-ID: <20260727165824.0377C1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260727164715.2866609-2-usama.anjum@arm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The header `<linux/pgtable_types.h>` incorrectly assumes `<asm/page.h>` universally defines `pte_t` and architecture opt-ins, leading to missing types on x86 and a structural inclusion hazard for opting in.
--
--- Patch [1]: [PATCH RFC 01/11] mm: introduce hw_pte_t for PTE table storage ---
commit de503ea03294c1c9976ce045b5e820dbc0f34eba
Author: Muhammad Usama Anjum <usama.anjum@arm.com>
mm: introduce hw_pte_t for PTE table storage
This commit introduces hw_pte_t as a generic name for a PTE table element.
It defines it as an alias of pte_t by default, allowing architectures to
retain their existing representation until they opt in to a distinct type.
> diff --git a/include/linux/pgtable_types.h b/include/linux/pgtable_types.h
> new file mode 100644
> index 0000000000000..ed5dba42a4f8c
> --- /dev/null
> +++ b/include/linux/pgtable_types.h
> @@ -0,0 +1,11 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef _LINUX_PGTABLE_TYPES_H
> +#define _LINUX_PGTABLE_TYPES_H
> +
> +#include <asm/page.h>
> +
> +#ifndef __HAVE_ARCH_HW_PTE_T
> +#define hw_pte_t pte_t
> +#endif
[Severity: Medium]
Is <asm/page.h> guaranteed to define pte_t on all architectures before it is
used here?
On x86, pte_t is defined in <asm/pgtable_types.h>, which is not included by
<asm/page.h>. This means pte_t might not be defined when the default hw_pte_t
alias is created.
Could this also create an inclusion hazard for architectures opting in?
If x86 were to opt into hw_pte_t by defining __HAVE_ARCH_HW_PTE_T in
<asm/pgtable_types.h>, any files including <linux/pgtable_types.h> first would
incorrectly alias hw_pte_t to pte_t. When <asm/pgtable_types.h> is
subsequently included, its explicit definition of hw_pte_t would macro-expand
to a conflicting redefinition of pte_t, breaking the build.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260727164715.2866609-1-usama.anjum@arm.com?part=1
next prev parent reply other threads:[~2026-07-27 16:58 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 16:46 [PATCH RFC 00/11] mm: distinguish PTE table storage from PTE values Muhammad Usama Anjum
2026-07-27 16:46 ` [PATCH RFC 01/11] mm: introduce hw_pte_t for PTE table storage Muhammad Usama Anjum
2026-07-27 16:58 ` sashiko-bot [this message]
2026-07-27 16:46 ` [PATCH RFC 02/11] mm: make hw_pte_t visible to generic PTE interfaces Muhammad Usama Anjum
2026-07-27 16:46 ` [PATCH RFC 03/11] mm: name pointers to copied PTE values ptentp Muhammad Usama Anjum
2026-07-27 16:46 ` [PATCH RFC 04/11] mm: use hw_pte_t for generic PTE table storage Muhammad Usama Anjum
2026-07-27 16:46 ` [PATCH RFC 05/11] mm: convert PTE table entries in ptep_get() Muhammad Usama Anjum
2026-07-27 16:58 ` sashiko-bot
2026-07-27 16:46 ` [PATCH RFC 06/11] mm/kasan: use hw_pte_t for the early shadow PTE table Muhammad Usama Anjum
2026-07-27 16:46 ` [PATCH RFC 07/11] mm/mremap: use ptep_get() for the destination PTE Muhammad Usama Anjum
2026-07-27 16:46 ` [PATCH RFC 08/11] drm/i915: use hw_pte_t for PTE range callbacks Muhammad Usama Anjum
2026-07-27 16:47 ` [PATCH RFC 09/11] misc/sgi-gru: use ptep_get() for page-table reads Muhammad Usama Anjum
2026-07-27 17:09 ` sashiko-bot
2026-07-27 16:47 ` [PATCH RFC 10/11] parisc: use hw_pte_t for the data-break callback Muhammad Usama Anjum
2026-07-27 16:47 ` [PATCH RFC 11/11] xen: use hw_pte_t for PTE range callbacks Muhammad Usama Anjum
2026-07-27 17:06 ` 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=20260727165824.0377C1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=damon@lists.linux.dev \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=usama.anjum@arm.com \
/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.