From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Matt Roper <matthew.d.roper@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Subject: Re: [PATCH v2 00/10] Start fixing OA whitelist mistakes
Date: Mon, 13 Apr 2026 21:25:31 -0700 [thread overview]
Message-ID: <87340y88xw.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20260408-oa-whitelist-cleanup-v2-0-db4a06aae8b0@intel.com>
On Wed, 08 Apr 2026 16:42:59 -0700, Matt Roper wrote:
>
Hi Matt,
> There are a number of mistakes in the OA register whitelists:
> - Unlimited upper bounds (never allowed for whitelists entries!)
> - Whitelisting registers that userspace already has access to
> - Whitelisting registers that userspace is not intended to ever need
> access to
>
> This series addresses the first two bullets and partially addresses the
> third. For registers that weren't supposed to be exposed in the first
> place, there are still some cases where we're exposing registers that we
> really shouldn't be, or exposing them on engines that we shouldn't be,
> but we need to confirm that no legitimate userspace has started
> (mis)using them before making further changes so that we won't cause a
> regression.
>
> This series also partially unmacro-izes some of the OA entries since the
> several layers of C macros were obfuscating exactly what was/wasn't
> being whitelisted and making it harder to audit for mistakes.
Thanks for these patches, but at a high level, this series does *not* align
with how we are planning to solve this problem (according to how we have
been asked to do it by our architects). So changes in this series are
simulatenously excessive, and also don't do the job.
So our plan here is as follows:
1. No (or zero) OA registers will be whitlisted by default (after module
probe).
2. OA registers will be whitelisted only when
/proc/sys/dev/xe/observation_paranoid is 0. This file is 1 by default
and sudo is needed to set it to 0. This means that OA registers will be
whitelisted only with an explicit permission from root (or system admin,
who is the final arbiter of system security).
So that is the plan. We have just started this work and will send these
patches when they are ready. We will also send patches for previous stable
kernels if needed. Any help/patches for this work are also welcome :-)
Regarding *this* series, my plan is to include patches from this series as
needed, but after we have sent out the paranoid whitlisting series (or
include them in the same series).
But I don't want to take this series as is. If we implement the plan
mentioned above, we don't have to finely control which registers are
exposed, the precise product versions they are exposes for etc. All this
will just increase maintenance overhead, whereas system admin control of
whitelisting makes such fine tuning unnecessary. My current thinking is
also to retain the current macros.
Having cursorily looked at this series, the following patches are making
sense to me:
> drm/xe/oa: Stop whitelisting OAG_OASTATUS
> drm/xe: Add WHITELIST_RO macro
> drm/xe: Enable all FORCE_TO_NONPRIV registers
But we'll have more clarity after the paranoid whitelisting work shapes up
a little bit more (also I haven't looked at all the patches closely yet).
I also had some similar patches lying around (waiting for us to make
progress on paranoid whitelisting) and I just sent them out here:
https://patchwork.freedesktop.org/series/164832/
Thanks.
--
Ashutosh
>
> v2:
> - Continue to whitelist OAGSAG's trigger since we've been allowing
> userspace to access it on the "wrong" engine. Hardware only expects
> the GSC engine to access this instance, so it doesn't automatically
> grant VCS/VECS access.
> - Eliminate whitelisting of OASTARTTRIG_COUNTER; this has never been a
> valid register for userspace to have access to and was only
> accidentally included due to improper use of a RANGE_4 flag.
> - Consolidate oam_mmio_trg_vcs and oam_mmio_trg_vecs into a single
> entry with a custom match function.
> - Eliminate some layers of C macros to make it clear which registers
> we're actually referencing.
>
> --
> 2.52.0
>
> ---
> Matt Roper (10):
> drm/xe/oa: Stop whitelisting non-SAG MMIO_TRG registers on non-DG2
> drm/xe/oa: Stop whitelisting OAG_OASTATUS
> drm/xe/oa: Stop whitelisting OAM registers on non Xe2/Xe3
> drm/xe/oa: Stop whitelisting OAG registers after Xe3
> drm/xe: Add WHITELIST_RO macro
> drm/xe/oa: Consolidate RTP entries for OAM whitelist
> drm/xe/oa: Consolidate RTP entries for OAG whitelist
> drm/xe/oa: Consolidate RTP entries for OA MERT
> drm/xe: Enable all FORCE_TO_NONPRIV registers
> drm/xe/oa: Stop whitelisting OASTARTTRIG_COUNTER
>
> drivers/gpu/drm/xe/regs/xe_engine_regs.h | 7 +-
> drivers/gpu/drm/xe/xe_reg_whitelist.c | 115 ++++++++++++++++++-------------
> 2 files changed, 74 insertions(+), 48 deletions(-)
> ---
> base-commit: 9e217a8df7b2f298a2fd850e29f970b7360dc77b
> change-id: 20260407-oa-whitelist-cleanup-21baae7fbb78
>
> Best regards,
> --
> Matt Roper
> Graphics Software Engineer
> Linux GPU Platform Enablement
> Intel Corporation
>
next prev parent reply other threads:[~2026-04-14 4:25 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-08 23:42 [PATCH v2 00/10] Start fixing OA whitelist mistakes Matt Roper
2026-04-08 23:43 ` [PATCH v2 01/10] drm/xe/oa: Stop whitelisting non-SAG MMIO_TRG registers on non-DG2 Matt Roper
2026-04-08 23:43 ` [PATCH v2 02/10] drm/xe/oa: Stop whitelisting OAG_OASTATUS Matt Roper
2026-04-08 23:43 ` [PATCH v2 03/10] drm/xe/oa: Stop whitelisting OAM registers on non Xe2/Xe3 Matt Roper
2026-04-08 23:43 ` [PATCH v2 04/10] drm/xe/oa: Stop whitelisting OAG registers after Xe3 Matt Roper
2026-04-08 23:43 ` [PATCH v2 05/10] drm/xe: Add WHITELIST_RO macro Matt Roper
2026-04-08 23:43 ` [PATCH v2 06/10] drm/xe/oa: Consolidate RTP entries for OAM whitelist Matt Roper
2026-04-08 23:43 ` [PATCH v2 07/10] drm/xe/oa: Consolidate RTP entries for OAG whitelist Matt Roper
2026-04-08 23:43 ` [PATCH v2 08/10] drm/xe/oa: Consolidate RTP entries for OA MERT Matt Roper
2026-04-08 23:43 ` [PATCH v2 09/10] drm/xe: Enable all FORCE_TO_NONPRIV registers Matt Roper
2026-04-08 23:43 ` [PATCH v2 10/10] drm/xe/oa: Stop whitelisting OASTARTTRIG_COUNTER Matt Roper
2026-04-08 23:50 ` ✗ CI.checkpatch: warning for Start fixing OA whitelist mistakes (rev3) Patchwork
2026-04-08 23:51 ` ✗ CI.KUnit: failure " Patchwork
2026-04-09 20:49 ` ✗ CI.checkpatch: warning for Start fixing OA whitelist mistakes (rev4) Patchwork
2026-04-09 20:50 ` ✗ CI.KUnit: failure " Patchwork
2026-04-10 16:35 ` ✗ CI.checkpatch: warning for Start fixing OA whitelist mistakes (rev5) Patchwork
2026-04-10 16:37 ` ✓ CI.KUnit: success " Patchwork
2026-04-10 17:13 ` ✓ Xe.CI.BAT: " Patchwork
2026-04-11 4:30 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-04-14 4:25 ` Dixit, Ashutosh [this message]
2026-04-14 14:11 ` [PATCH v2 00/10] Start fixing OA whitelist mistakes Matt Roper
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=87340y88xw.wl-ashutosh.dixit@intel.com \
--to=ashutosh.dixit@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.d.roper@intel.com \
--cc=umesh.nerlige.ramappa@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox