From: sashiko-bot@kernel.org
To: "Satyanarayana K V P" <satyanarayana.k.v.p@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v8 07/10] drm/xe/pf: Align VF GGTT allocations to PAGE_SIZE
Date: Tue, 15 Sep 2026 07:27:17 +0000 [thread overview]
Message-ID: <20260915072717.899C01F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260915071159.51402-19-satyanarayana.k.v.p@intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Critical] xe: SR-IOV GGTT alignment allows memory isolation bypass
--
commit b273b43c9c7b2ba3519285921560775aacbe0985
Author: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
drm/xe/pf: Align VF GGTT allocations to PAGE_SIZE
This commit reduces the PF's alignment for VF GGTT partitions to the host
CPU PAGE_SIZE (4K) to allow finer-grained partitioning.
> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
> index 6947aeed458ed..91ec8e898e3b5 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
> @@ -441,9 +441,7 @@ static int pf_refresh_vf_cfg(struct xe_gt *gt, unsigned int vfid)
>
> static u64 pf_get_ggtt_alignment(struct xe_gt *gt)
> {
> - struct xe_device *xe = gt_to_xe(gt);
> -
> - return IS_DGFX(xe) && xe->info.vram_flags & XE_VRAM_FLAGS_NEED64K ? SZ_64K : SZ_4K;
> + return PAGE_SIZE;
[Severity: Critical]
Does this regression allow a VF to bypass SR-IOV memory isolation?
By unconditionally returning PAGE_SIZE, the PF provisions the VF's GGTT
partition with a base address (ggtt->start) that is only guaranteed to be
4K-aligned.
In the VF, the local drm_mm allocator is initialized with a start offset of 0,
meaning it aligns local offsets but not the absolute global GGTT address:
drivers/gpu/drm/xe/xe_ggtt.c:__xe_ggtt_init_early()
drm_mm_init(&ggtt->mm, 0, size);
When the VF maps a VRAM object, it requests a 64K-aligned local offset from
drm_mm:
drivers/gpu/drm/xe/xe_ggtt.c:__xe_ggtt_insert_bo_at()
if (xe_bo_is_vram(bo) && ggtt->flags & XE_GGTT_FLAGS_64K)
alignment = SZ_64K;
Because the global GGTT virtual address is local_offset + ggtt->start,
a 4K-aligned partition base offset produces a globally misaligned hardware
address.
Since the GPU's TLB masks the lower 16 bits of the virtual address for 64K
pages, will this misaligned absolute address cause the TLB entry to alias with
the preceding 4K-aligned memory range, potentially exposing another VF or PF's
memory?
> }
>
> static u64 pf_get_min_spare_ggtt(struct xe_gt *gt)
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260915071159.51402-12-satyanarayana.k.v.p@intel.com?part=7
next prev parent reply other threads:[~2026-09-15 7:27 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 7:11 [PATCH v8 00/10] KUnit test for VF provisioning error handling Satyanarayana K V P
2026-09-15 7:11 ` [PATCH v8 01/10] drm/xe/guc: Allow to replace xe_guc_mmio_send_recv() with KUNIT stub Satyanarayana K V P
2026-09-15 7:11 ` [PATCH v8 02/10] drm/xe/vf: Split submission config query helpers Satyanarayana K V P
2026-09-15 7:12 ` [PATCH v8 03/10] drm/xe/vf: Add bounds checking for queried context and doorbell counts Satyanarayana K V P
2026-09-15 11:12 ` Michal Wajdeczko
2026-09-15 7:12 ` [PATCH v8 04/10] drm/xe: Introduce helpers for VRAM alignment Satyanarayana K V P
2026-09-15 7:12 ` [PATCH v8 05/10] drm/xe/ggtt: Avoid integer overflow when validating VF GGTT range Satyanarayana K V P
2026-09-15 12:03 ` Michal Wajdeczko
2026-09-15 7:12 ` [PATCH v8 06/10] drm/xe/vf: Add bounds checking for queried GGTT base and size Satyanarayana K V P
2026-09-15 7:26 ` sashiko-bot
2026-09-15 7:12 ` [PATCH v8 07/10] drm/xe/pf: Align VF GGTT allocations to PAGE_SIZE Satyanarayana K V P
2026-09-15 7:27 ` sashiko-bot [this message]
2026-09-15 7:12 ` [PATCH v8 08/10] drm/xe/vf: Add alignment check for queried VRAM size Satyanarayana K V P
2026-09-15 7:12 ` [PATCH v8 09/10] drm/xe/ggtt: Add KUNIT stub for xe_ggtt_shift_nodes() Satyanarayana K V P
2026-09-15 7:12 ` [PATCH v8 10/10] drm/xe/tests: Add KUnit tests for VF provisioning error handling Satyanarayana K V P
2026-09-15 14:33 ` Michal Wajdeczko
2026-09-15 7:19 ` ✗ CI.checkpatch: warning for KUnit test for VF provisioning error handling (rev8) Patchwork
2026-09-15 7:21 ` ✓ CI.KUnit: success " Patchwork
2026-09-15 8:04 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-15 9:06 ` ✗ Xe.CI.FULL: failure " Patchwork
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=20260915072717.899C01F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=satyanarayana.k.v.p@intel.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.