From: Ashutosh Dixit <ashutosh.dixit@intel.com>
To: intel-xe@lists.freedesktop.org
Subject: [PATCH 3/4] drm/xe/oa: Add val arg to xe_oa_is_valid_config_reg
Date: Thu, 30 Apr 2026 09:14:58 -0700 [thread overview]
Message-ID: <20260430161459.2892545-4-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20260430161459.2892545-1-ashutosh.dixit@intel.com>
Add val arg to xe_oa_is_valid_config_reg so that register values can also
be verified, in addition to register address. Value verification is needed
to implement MERTOA Wa_14026779378.
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
drivers/gpu/drm/xe/xe_oa.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c
index 13458050907ad..7e1e8a86d19c0 100644
--- a/drivers/gpu/drm/xe/xe_oa.c
+++ b/drivers/gpu/drm/xe/xe_oa.c
@@ -2249,7 +2249,7 @@ static bool xe_oa_is_valid_mux_addr(struct xe_oa *oa, u32 addr)
return xe_oa_reg_in_range_table(addr, gen12_oa_mux_regs);
}
-static bool xe_oa_is_valid_config_reg_addr(struct xe_oa *oa, u32 addr)
+static bool xe_oa_is_valid_config_reg(struct xe_oa *oa, u32 addr, u32 val)
{
return xe_oa_is_valid_flex_addr(oa, addr) ||
xe_oa_is_valid_b_counter_addr(oa, addr) ||
@@ -2257,7 +2257,7 @@ static bool xe_oa_is_valid_config_reg_addr(struct xe_oa *oa, u32 addr)
}
static struct xe_oa_reg *
-xe_oa_alloc_regs(struct xe_oa *oa, bool (*is_valid)(struct xe_oa *oa, u32 addr),
+xe_oa_alloc_regs(struct xe_oa *oa, bool (*is_valid)(struct xe_oa *oa, u32 addr, u32 val),
u32 __user *regs, u32 n_regs)
{
struct xe_oa_reg *oa_regs;
@@ -2275,16 +2275,16 @@ xe_oa_alloc_regs(struct xe_oa *oa, bool (*is_valid)(struct xe_oa *oa, u32 addr),
if (err)
goto addr_err;
- if (!is_valid(oa, addr)) {
- drm_dbg(&oa->xe->drm, "Invalid oa_reg address: %X\n", addr);
- err = -EINVAL;
- goto addr_err;
- }
-
err = get_user(value, regs + 1);
if (err)
goto addr_err;
+ if (!is_valid(oa, addr, value)) {
+ drm_dbg(&oa->xe->drm, "Invalid oa_reg addr/value: %#x %#x\n", addr, value);
+ err = -EINVAL;
+ goto addr_err;
+ }
+
oa_regs[i].addr = XE_REG(addr);
oa_regs[i].value = value;
@@ -2383,7 +2383,7 @@ int xe_oa_add_config_ioctl(struct drm_device *dev, u64 data, struct drm_file *fi
memcpy(oa_config->uuid, arg->uuid, sizeof(arg->uuid));
oa_config->regs_len = arg->n_regs;
- regs = xe_oa_alloc_regs(oa, xe_oa_is_valid_config_reg_addr,
+ regs = xe_oa_alloc_regs(oa, xe_oa_is_valid_config_reg,
u64_to_user_ptr(arg->regs_ptr),
arg->n_regs);
if (IS_ERR(regs)) {
--
2.54.0
next prev parent reply other threads:[~2026-04-30 16:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-30 16:14 [PATCH 0/4] More MERTOA WA's Ashutosh Dixit
2026-04-30 16:14 ` [PATCH 1/4] drm/xe/oa: Refactor oa_unit_supports_oa_format Ashutosh Dixit
2026-04-30 16:14 ` [PATCH 2/4] drm/xe/oa: MERTOA Wa_14026746987 Ashutosh Dixit
2026-04-30 16:14 ` Ashutosh Dixit [this message]
2026-04-30 16:14 ` [PATCH 4/4] drm/xe/oa: MERTOA Wa_14026779378 Ashutosh Dixit
2026-04-30 17:21 ` ✓ CI.KUnit: success for More MERTOA WA's Patchwork
2026-04-30 18:16 ` ✓ Xe.CI.BAT: " Patchwork
2026-05-01 5: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=20260430161459.2892545-4-ashutosh.dixit@intel.com \
--to=ashutosh.dixit@intel.com \
--cc=intel-xe@lists.freedesktop.org \
/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