All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Muhammad Usama Anjum" <usama.anjum@arm.com>
Cc: intel-gfx@lists.freedesktop.org, bpf@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-perf-users@vger.kernel.org, damon@lists.linux.dev,
	linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH v3 9/9] xen: use hw_pte_t for PTE range callbacks
Date: Tue, 22 Sep 2026 17:30:09 +0000	[thread overview]
Message-ID: <20260922173009.52F491F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260922-pte0-v3-9-5670b8cb9059@arm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] xen: missing hw_pte_t conversion for x86 Xen callbacks
--

commit cf1ba61f002ea6950852250dfd8d5d0a5b979c23
Author: Muhammad Usama Anjum <usama.anjum@arm.com>

xen: use hw_pte_t for PTE range callbacks

This commit updates Xen callbacks to use the hw_pte_t pointer type, matching
the updated generic PTE range and remapping helpers. It maintains software
PTE values as pte_t to support architectures that select the distinct
hw_pte_t wrapper.

>     Generic PTE range and remapping helpers now pass pointers to PTE table
>     storage as hw_pte_t *. Update the Xen callbacks to match those interfaces.
>     
>     Keep software PTE values as pte_t and continue to access them through the
>     existing PTE helpers. This is required when Xen is built for an
>     architecture that selects the distinct hw_pte_t wrapper.
>     
>     Reviewed-by: Juergen Gross <jgross@suse.com>
>     Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>

[Severity: Low]
Were some x86-specific Xen callbacks missed in this conversion?

Looking at the source, these two callbacks appear to still use the old
pte_t * type signature instead of hw_pte_t *:

arch/x86/xen/grant-table.c:gnttab_apply()
arch/x86/xen/mmu_pv.c:remap_area_pfn_pte_fn()

While this currently compiles because x86 aliases hw_pte_t to pte_t, it looks
like it violates the generic API contract since they are passed to
apply_to_page_range(). Could this cause a build or CFI failure if x86
ever opts into ARCH_HAS_HW_PTE_T?

> diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c
> index 1dcc4675580ed..b013bcad99b5b 100644
> --- a/drivers/xen/gntdev.c
> +++ b/drivers/xen/gntdev.c
> @@ -301,7 +301,7 @@ void gntdev_put_map(struct gntdev_priv *priv, struct gntdev_grant_map *map)
>  
>  /* ------------------------------------------------------------------ */
>  
> -static int find_grant_ptes(pte_t *pte, unsigned long addr, void *data)
> +static int find_grant_ptes(hw_pte_t *pte, unsigned long addr, void *data)
>  {
>  	struct gntdev_grant_map *map = data;

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260922-pte0-v3-0-5670b8cb9059@arm.com?part=9

  reply	other threads:[~2026-09-22 17:30 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22 17:12 [PATCH v3 0/9] mm: distinguish HW PTE pointers from SW PTE value pointers Muhammad Usama Anjum
2026-09-22 17:12 ` [PATCH v3 1/9] mm: introduce hw_pte_t for PTE table storage Muhammad Usama Anjum
2026-09-22 17:20   ` sashiko-bot
2026-09-30  4:13   ` Anshuman Khandual
2026-09-30 15:27   ` Zi Yan
2026-09-22 17:12 ` [PATCH v3 2/9] mm: rename pointers to software PTE values as ptentp Muhammad Usama Anjum
2026-09-22 17:21   ` sashiko-bot
2026-09-30  4:20   ` Anshuman Khandual
2026-09-22 17:12 ` [PATCH v3 3/9] mm: use hw_pte_t for generic PTE table storage Muhammad Usama Anjum
2026-09-22 17:27   ` sashiko-bot
2026-09-30  4:35   ` Anshuman Khandual
2026-09-30 17:40     ` Muhammad Usama Anjum
2026-10-01 11:25       ` David Hildenbrand (Arm)
2026-10-01 11:26   ` David Hildenbrand (Arm)
2026-09-22 17:12 ` [PATCH v3 4/9] mm: convert PTE table entries in ptep_get() Muhammad Usama Anjum
2026-09-22 17:25   ` sashiko-bot
2026-09-30  5:10   ` Anshuman Khandual
2026-09-30 17:46     ` Muhammad Usama Anjum
2026-10-01 11:27   ` David Hildenbrand (Arm)
2026-09-22 17:12 ` [PATCH v3 5/9] mm: convert PTE table entry to pte Muhammad Usama Anjum
2026-09-22 17:19   ` sashiko-bot
2026-10-01 11:17   ` David Hildenbrand (Arm)
2026-10-02 14:57     ` Muhammad Usama Anjum
2026-09-22 17:12 ` [PATCH v3 6/9] mm: add hw_pte_val for HW PTE storage Muhammad Usama Anjum
2026-09-22 17:22   ` sashiko-bot
2026-10-01 11:19   ` David Hildenbrand (Arm)
2026-10-02 14:59     ` Muhammad Usama Anjum
2026-09-22 17:12 ` [PATCH v3 7/9] mm/kasan: use hw_pte_t for the early shadow PTE table Muhammad Usama Anjum
2026-09-22 17:21   ` sashiko-bot
2026-10-01 11:20   ` David Hildenbrand (Arm)
2026-09-22 17:12 ` [PATCH v3 8/9] drm/i915: use hw_pte_t for PTE range callbacks Muhammad Usama Anjum
2026-09-22 17:23   ` sashiko-bot
2026-10-01 11:21   ` David Hildenbrand (Arm)
2026-09-22 17:12 ` [PATCH v3 9/9] xen: " Muhammad Usama Anjum
2026-09-22 17:30   ` sashiko-bot [this message]
2026-10-01 11:22   ` David Hildenbrand (Arm)
2026-09-23 23:16 ` ✗ Fi.CI.BUILD: failure for mm: distinguish HW PTE pointers from SW PTE value pointers Patchwork
2026-09-28  7:09 ` [PATCH v3 0/9] " Alexander Gordeev

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=20260922173009.52F491F000FF@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=intel-gfx@lists.freedesktop.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux-trace-kernel@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.