From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: <himanshu.girotra@intel.com>
Cc: <matthew.d.roper@intel.com>, <x.wang@intel.com>,
<igt-dev@lists.freedesktop.org>, <nishit.sharma@intel.com>
Subject: Re: [PATCH v2 i-g-t] lib/intel_pat: Cache PAT config for unprivileged processes
Date: Thu, 05 Mar 2026 05:57:21 -0800 [thread overview]
Message-ID: <87ms0m5qgu.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20260305122548.28328-1-himanshu.girotra@intel.com>
On Thu, 05 Mar 2026 04:25:48 -0800, <himanshu.girotra@intel.com> wrote:
>
> diff --git a/lib/intel_pat.c b/lib/intel_pat.c
> index 8660a2515..1dcb84cc6 100644
> --- a/lib/intel_pat.c
> +++ b/lib/intel_pat.c
> @@ -6,6 +6,7 @@
> #include <fcntl.h>
> #include "igt.h"
> #include "intel_pat.h"
> +#include "xe/xe_query.h"
>
> /**
> * xe_get_pat_sw_config - Helper to read PAT (Page Attribute Table) software configuration
> @@ -99,17 +100,18 @@ static void intel_get_pat_idx(int fd, struct intel_pat_cache *pat)
> uint16_t dev_id;
>
> /*
> - * For Xe driver, query the kernel's PAT software configuration
> - * via debugfs. The kernel is the authoritative source for PAT
> - * indices, accounting for platform-specific workarounds
> - * (e.g. Wa_16023588340) at runtime.
> + * For Xe, use the PAT cache stored in struct xe_device.
> + * xe_device_get() populates the cache while still root; forked
> + * children that inherit the xe_device can use it post-drop_root().
> */
> if (is_xe_device(fd)) {
> - int32_t parsed = xe_get_pat_sw_config(fd, pat);
> + struct xe_device *xe_dev = xe_device_get(fd);
>
> - igt_assert_f(parsed > 0,
> - "Failed to get PAT sw_config from debugfs (parsed=%d)\n",
> - parsed);
> + igt_assert_f(xe_dev->pat_cached,
> + "PAT not cached in xe_device for fd %d -- "
> + "was xe_device_get() called before igt_drop_root()?\n",
> + fd);
Maybe change this print too since we are doing xe_device_get() right above.
> + *pat = xe_dev->pat_cache;
> return;
> }
>
prev parent reply other threads:[~2026-03-05 13:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-05 12:25 [PATCH v2 i-g-t] lib/intel_pat: Cache PAT config for unprivileged processes himanshu.girotra
2026-03-05 13:23 ` Zbigniew Kempczyński
2026-03-05 13:48 ` Dixit, Ashutosh
2026-03-05 13:57 ` Dixit, Ashutosh [this message]
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=87ms0m5qgu.wl-ashutosh.dixit@intel.com \
--to=ashutosh.dixit@intel.com \
--cc=himanshu.girotra@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=matthew.d.roper@intel.com \
--cc=nishit.sharma@intel.com \
--cc=x.wang@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.