All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Nareshkumar Gollakoti" <naresh.kumar.g@intel.com>,
	intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v5 4/7] drm/xe: dump GAM page fault report registers in devcoredump
Date: Fri, 23 Oct 2026 06:31:52 +0000	[thread overview]
Message-ID: <sashiko-outbox-182352@kernel.org> (raw)
In-Reply-To: <20261023060554.2643515-5-naresh.kumar.g@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] drm/xe: unsteered MCR read of GAMCTRL PF queue registers in devcoredump
--

commit 1da764eb534ebe0a6ed34a1262b84f79a5f87633
Author: Nareshkumar Gollakoti <naresh.kumar.g@intel.com>

drm/xe: dump GAM page fault report registers in devcoredump

This commit adds definitions for PAGE_FLTRPTQ_HEAD_GAMCTRL and
PAGE_FLTRPTQ_TAIL_GAMCTRL and captures them during devcoredump snapshots.
It also prints the captured values in the devcoredump output along with a
page fault notice when the head and tail registers differ.

> diff --git a/drivers/gpu/drm/xe/regs/xe_gt_regs.h b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> index e93895e0c731a..e9eb0bd04af10 100644
> --- a/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> +++ b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
> @@ -530,6 +530,9 @@
>  #define   LMEM_EN				REG_BIT(31)
>  #define   LMTT_DIR_PTR				REG_GENMASK(30, 0) /* in multiples of 64KB */
>  
> +#define PAGE_FLTRPTQ_HEAD_GAMCTRL		XE_REG(0xcf90)
> +#define PAGE_FLTRPTQ_TAIL_GAMCTRL		XE_REG(0xcf94)
> +
>  #define HALF_SLICE_CHICKEN5			XE_REG_MCR(0xe188, XE_REG_OPTION_MASKED)
>  #define   DISABLE_SAMPLE_G_PERFORMANCE		REG_BIT(0)
>  
> diff --git a/drivers/gpu/drm/xe/xe_devcoredump.c b/drivers/gpu/drm/xe/xe_devcoredump.c
> index 49a7c020a1615..8d59f80e2929f 100644
> --- a/drivers/gpu/drm/xe/xe_devcoredump.c
> +++ b/drivers/gpu/drm/xe/xe_devcoredump.c
> @@ -114,6 +114,11 @@ static const struct xe_reg_desc xe_dbg_media_gt_rpm_reglist[] = {
>  	XE_REG_DESC(RPM_GCD, "RPM_GCD"),
>  };
>  
> +static const struct xe_reg_desc xe_dbg_gam_pf_reglist[] = {
> +	XE_REG_DESC(PAGE_FLTRPTQ_HEAD_GAMCTRL, "PAGE_FLTRPTQ_HEAD_GAMCTRL"),
> +	XE_REG_DESC(PAGE_FLTRPTQ_TAIL_GAMCTRL, "PAGE_FLTRPTQ_TAIL_GAMCTRL"),
> +};

[Severity: Medium]
Should PAGE_FLTRPTQ_HEAD_GAMCTRL (0xcf90) and PAGE_FLTRPTQ_TAIL_GAMCTRL
(0xcf94) be defined as MCR registers with XE_REG_MCR() and captured via
steered MCR reads instead of raw xe_mmio_read32()?

In drivers/gpu/drm/xe/xe_gt_mcr.c, the 0x00C800 to 0x00CFFF GAM/GAMCTRL
range is listed in the INSTANCE0 steering tables across Xe platforms (such
as xehpc_instance0_steering_table, xelpg_instance0_steering_table,
xe2lpg_instance0_steering_table, xe3p_lpg_instance0_steering_table, and
xe3p_xpc_instance0_steering_table):

drivers/gpu/drm/xe/xe_gt_mcr.c:
	{ 0x00C800, 0x00CFFF },		/* GAMCTRL */

Because rw_with_mcr_steering() leaves the last-used group and instance
programmed in MCR_SELECTOR / MTL_MCR_SELECTOR (and on GRAPHICS_VERx100(xe)
>= 1270, MTL_MCR_SELECTOR is shared with GuC and serialized via
gt->mcr_lock and STEER_SEMAPHORE), reading these registers in
devcoredump_snapshot() -> xe_devcoredump_capture_gt_regs() ->
xe_dbg_gt_snapshot_capture() -> xe_dbg_reg_snapshot_capture_target() via
unsteered xe_mmio_read32() can race with concurrent MCR steering or target
a terminated non-(0, 0) GAMCTRL instance. When that happens, both reads
return 0x00000000 and xe_gam_pf_snapshot_print() will not print the page
fault message even if a fault occurred.

Even with the subsequent patch in the series ("drm/xe: capture L3 node
status registers in devcoredump") adding XE_REG_DESC_MCR() and updating
xe_dbg_reg_snapshot_capture_target() to call xe_gt_mcr_unicast_read_any()
for MCR descriptors, PAGE_FLTRPTQ_HEAD_GAMCTRL and
PAGE_FLTRPTQ_TAIL_GAMCTRL remain defined with XE_REG() and XE_REG_DESC(),
so they still bypass xe_gt_mcr_unicast_read_any().

Additionally, on Xe3p+ platforms where xe_guc_using_main_gamctrl_queues()
is true (GT_VER(gt) >= 35), xe_guc_upload() switches hardware and GuC to
the unicast Main GAMCTRL queues:

drivers/gpu/drm/xe/xe_guc.c:xe_guc_upload() {
	if (xe_guc_using_main_gamctrl_queues(guc))
		xe_mmio_write32(&gt->mmio, MAIN_GAMCTRL_MODE, MAIN_GAMCTRL_QUEUE_SELECT);
}

On those platforms, are 0xcf90 and 0xcf94 still the active page fault
reporting queue registers to capture in xe_devcoredump_capture_gt_regs()?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261023060554.2643515-1-naresh.kumar.g@intel.com?part=4

  reply	other threads:[~2026-10-23  6:32 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-23  6:05 [PATCH v5 0/7] drm/xe: Capture additional HW register state in devcoredump Nareshkumar Gollakoti
2026-10-23  6:05 ` [PATCH v5 1/7] drm/xe/devcoredump: Capture GT fuse registers " Nareshkumar Gollakoti
2026-10-23 13:27   ` Upadhyay, Tejas
2026-10-23  6:05 ` [PATCH v5 2/7] drm/xe/devcoredump: Add GuC register snapshot to devcoredump Nareshkumar Gollakoti
2026-10-26  6:35   ` Upadhyay, Tejas
2026-10-23  6:05 ` [PATCH v5 3/7] drm/xe/guc: Print register addresses in capture snapshot output Nareshkumar Gollakoti
2026-10-23 13:14   ` Upadhyay, Tejas
2026-10-26  6:37   ` Upadhyay, Tejas
2026-10-23  6:05 ` [PATCH v5 4/7] drm/xe: dump GAM page fault report registers in devcoredump Nareshkumar Gollakoti
2026-10-23  6:31   ` sashiko-bot [this message]
2026-10-26  6:48   ` Upadhyay, Tejas
2026-10-23  6:05 ` [PATCH v5 5/7] drm/xe/guc: add TDL, SLICE gfx registers to capture list Nareshkumar Gollakoti
2026-10-26  6:55   ` Upadhyay, Tejas
2026-10-23  6:05 ` [PATCH v5 6/7] drm/xe: capture L3 node status registers in devcoredump Nareshkumar Gollakoti
2026-10-23  6:24   ` sashiko-bot
2026-10-23  6:05 ` [PATCH v5 7/7] drm/xe/guc: capture additional engine state registers Nareshkumar Gollakoti
2026-10-23  6:26   ` sashiko-bot
2026-10-26  9:15   ` Upadhyay, Tejas
2026-10-23  6:14 ` ✗ CI.checkpatch: warning for drm/xe: Capture additional HW register state in devcoredump (rev6) Patchwork
2026-10-23  6:16 ` ✓ CI.KUnit: success " Patchwork
2026-10-23  6:56 ` ✓ Xe.CI.BAT: " Patchwork
2026-10-23  8:26 ` ✗ Xe.CI.FULL: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2026-10-22 13:29 [PATCH v5 0/7] drm/xe: Capture additional HW register state in devcoredump Nareshkumar Gollakoti
2026-10-22 13:29 ` [PATCH v5 4/7] drm/xe: dump GAM page fault report registers " Nareshkumar Gollakoti

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=sashiko-outbox-182352@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=naresh.kumar.g@intel.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.