drivers/gpu/drm/xe: Don't whitelist OA registers unconditionally
v2 cover drivers/gpu/drm/xe: Don't whitelist OA registers unconditionally
Backport of the following series to Linux 6.18.y:
https://lore.kernel.org/intel-xe/[email protected]/
v2: Fix upstream commit sha's (Sasha Levin)
Ashutosh Dixit (10):
drm/xe/rtp: Refactor OAG MMIO trigger register whitelisting drm/xe/rtp: Add RING_FORCE_TO_NONPRIV_DENY to OA whitelists drm/xe/rtp: Maintain OA whitelists separately
drm/xe/rtp: Keep track of non-OA nonpriv slots drm/xe/rtp: Generalize whitelist_apply_to_hwe
drm/xe/rtp: Save OA nonpriv registers to register save/restore lists drm/xe/rtp: Toggle 'deny' bit to (de-)whitelist OA regs drm/xe/rtp: (De-)whitelist OA registers for all hwe's for a gt drm/xe/oa: (De-)whitelist OA registers on OA stream open/release drm/xe/rtp: Ensure locking/ref counting for OA whitelists
drivers/gpu/drm/xe/xe_gt_debugfs.c | 4 +- drivers/gpu/drm/xe/xe_hw_engine.c | 2 + drivers/gpu/drm/xe/xe_hw_engine_types.h | 8 ++ drivers/gpu/drm/xe/xe_oa.c | 7 ++ drivers/gpu/drm/xe/xe_oa_types.h | 3 + drivers/gpu/drm/xe/xe_reg_whitelist.c | 119 +++++++++++++++++++----- drivers/gpu/drm/xe/xe_reg_whitelist.h | 4 + 7 files changed, 124 insertions(+), 23 deletions(-)
Signature · 1 line
2.54.0
PATCH v2 1/10 drm/xe/rtp: Refactor OAG MMIO trigger register whitelisting
[ Upstream commit ed455775c5a68b75e5f6ad6c8e0e3e9c98fd3f64 ]
Minor refactor of OAG MMIO trigger register whitelisting for code reuse with OAM MMIO trigger register whitelisting.
--- drivers/gpu/drm/xe/xe_reg_whitelist.c | 29 ++++++++++++--------------- 1 file changed, 13 insertions(+), 16 deletions(-)
drivers/gpu/drm/xe/xe_reg_whitelist.c +13 -16
@@ -66,27 +66,24 @@ static const struct xe_rtp_entry_sr register_whitelist[] = { ENGINE_CLASS(RENDER)), XE_RTP_ACTIONS(WHITELIST(CSBE_DEBUG_STATUS(RENDER_RING_BASE), 0)) }, - {XE_RTP_NAME ("oa_reg_render" ), + +#define WHITELIST_OA_MMIO_TRG (trg, status, head) \ + WHITELIST(trg, RING_FORCE_TO_NONPRIV_ACCESS_RW), \ + WHITELIST(status, RING_FORCE_TO_NONPRIV_ACCESS_RD), \ + WHITELIST(head, RING_FORCE_TO_NONPRIV_ACCESS_RD | RING_FORCE_TO_NONPRIV_RANGE_4) + +#define WHITELIST_OAG_MMIO_TRG \ + WHITELIST_OA_MMIO_TRG(OAG_MMIOTRIGGER, OAG_OASTATUS, OAG_OAHEADPTR) + + {XE_RTP_NAME ("oag_mmio_trg_rcs" ),XE_RTP_RULES (GRAPHICS_VERSION_RANGE (1200 ,XE_RTP_END_VERSION_UNDEFINED ),ENGINE_CLASS (RENDER )), -XE_RTP_ACTIONS (WHITELIST (OAG_MMIOTRIGGER , -RING_FORCE_TO_NONPRIV_ACCESS_RW ), -WHITELIST (OAG_OASTATUS , -RING_FORCE_TO_NONPRIV_ACCESS_RD ), -WHITELIST (OAG_OAHEADPTR , -RING_FORCE_TO_NONPRIV_ACCESS_RD | -RING_FORCE_TO_NONPRIV_RANGE_4 )) +XE_RTP_ACTIONS (WHITELIST_OAG_MMIO_TRG ) }, - { XE_RTP_NAME("oa_reg_compute"), + { XE_RTP_NAME("oag_mmio_trg_ccs"),XE_RTP_RULES (GRAPHICS_VERSION_RANGE (1200 ,XE_RTP_END_VERSION_UNDEFINED ),ENGINE_CLASS (COMPUTE )), -XE_RTP_ACTIONS (WHITELIST (OAG_MMIOTRIGGER , -RING_FORCE_TO_NONPRIV_ACCESS_RW ), -WHITELIST (OAG_OASTATUS , -RING_FORCE_TO_NONPRIV_ACCESS_RD ), -WHITELIST (OAG_OAHEADPTR , -RING_FORCE_TO_NONPRIV_ACCESS_RD | -RING_FORCE_TO_NONPRIV_RANGE_4 )) +XE_RTP_ACTIONS (WHITELIST_OAG_MMIO_TRG ) }, };
Signature · 1 line
2.54.0
PATCH v2 2/10 drm/xe/rtp: Add RING_FORCE_TO_NONPRIV_DENY to OA whitelists
In reply to Ashutosh Dixit[ Upstream commit e70086a3a06d276b4a5d9a2c51c9330c6cf72780 ]
Unconditionally whitelisting OA registers is a security violation. Set RING_FORCE_TO_NONPRIV_DENY bit in OA nonpriv slots, so that OA registers don't get whitelisted by default after probe, gt reset, resume and engine reset.
--- drivers/gpu/drm/xe/xe_reg_whitelist.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/xe/xe_reg_whitelist.c +5 -3
@@ -67,10 +67,12 @@ static const struct xe_rtp_entry_sr register_whitelist[] = { XE_RTP_ACTIONS(WHITELIST(CSBE_DEBUG_STATUS(RENDER_RING_BASE), 0)) }, +#define WHITELIST_DENY (r, f) WHITELIST(r, (f) | RING_FORCE_TO_NONPRIV_DENY) +#define WHITELIST_OA_MMIO_TRG (trg, status, head) \ - WHITELIST(trg, RING_FORCE_TO_NONPRIV_ACCESS_RW), \ - WHITELIST(status, RING_FORCE_TO_NONPRIV_ACCESS_RD), \ - WHITELIST(head, RING_FORCE_TO_NONPRIV_ACCESS_RD | RING_FORCE_TO_NONPRIV_RANGE_4) + WHITELIST_DENY(trg, RING_FORCE_TO_NONPRIV_ACCESS_RW), \ + WHITELIST_DENY(status, RING_FORCE_TO_NONPRIV_ACCESS_RD), \ + WHITELIST_DENY(head, RING_FORCE_TO_NONPRIV_ACCESS_RD | RING_FORCE_TO_NONPRIV_RANGE_4)#define WHITELIST_OAG_MMIO_TRG \ WHITELIST_OA_MMIO_TRG(OAG_MMIOTRIGGER, OAG_OASTATUS, OAG_OAHEADPTR)
Signature · 1 line
2.54.0
PATCH v2 3/10 drm/xe/rtp: Maintain OA whitelists separately
In reply to Ashutosh Dixit[ Upstream commit 31e2437561621b4867c08efc890bf629d017df03 ]
Contains minor modification of the above commit because of changed API.
OA registers are dynamically whitelisted (and again dewhitelisted) on OA stream open/close. Maintaining OA whitelists separately from non-OA register whitlists simplifies this management of OA register whitelisting/dewhitelisting.
--- drivers/gpu/drm/xe/xe_gt_debugfs.c | 4 +++- drivers/gpu/drm/xe/xe_hw_engine.c | 2 ++ drivers/gpu/drm/xe/xe_hw_engine_types.h | 8 ++++++++ drivers/gpu/drm/xe/xe_reg_whitelist.c | 6 ++++++ 4 files changed, 19 insertions(+), 1 deletion(-)
drivers/gpu/drm/xe/xe_gt_debugfs.c +3 -1
@@ -174,8 +174,10 @@ static int register_save_restore(struct xe_gt *gt, struct drm_printer *p)drm_printf (p,"\n" );drm_printf (p,"Whitelist\n" ); -for_each_hw_engine (hwe, gt, id) +for_each_hw_engine (hwe, gt, id) {xe_reg_whitelist_dump (&hwe->reg_whitelist, p); +xe_reg_whitelist_dump (&hwe->oa_whitelist, p); + }xe_pm_runtime_put (gt_to_xe (gt));
drivers/gpu/drm/xe/xe_hw_engine.c +2 -0
@@ -565,6 +565,8 @@ static void hw_engine_init_early(struct xe_gt *gt, struct xe_hw_engine *hwe,hw_engine_setup_default_state (hwe);xe_reg_sr_init (&hwe->reg_whitelist, hwe->name,gt_to_xe (gt)); +xe_reg_sr_init (&hwe->oa_whitelist, hwe->name,gt_to_xe (gt)); +xe_reg_sr_init (&hwe->oa_sr, hwe->name,gt_to_xe (gt));xe_reg_whitelist_process_engine (hwe); }
drivers/gpu/drm/xe/xe_hw_engine_types.h +8 -0
@@ -128,6 +128,14 @@ struct xe_hw_engine {* @reg_whitelist: table with registers to be whitelisted */ struct xe_reg_sr reg_whitelist; +/** +* @oa_whitelist: oa registers to be whitelisted +*/ +struct xe_reg_sr oa_whitelist; +/** +* @oa_sr: oa nonpriv whitelist registers, changed on oa stream open/close +*/ +struct xe_reg_sr oa_sr;/** * @reg_lrc: LRC workaround registers */
drivers/gpu/drm/xe/xe_reg_whitelist.c +6 -0
@@ -66,6 +66,9 @@ static const struct xe_rtp_entry_sr register_whitelist[] = { ENGINE_CLASS(RENDER)),XE_RTP_ACTIONS (WHITELIST (CSBE_DEBUG_STATUS (RENDER_RING_BASE ),0 )) }, +}; + +static const struct xe_rtp_entry_sr oa_whitelist[] = { #define WHITELIST_DENY(r, f) WHITELIST(r, (f) | RING_FORCE_TO_NONPRIV_DENY)
@@ -138,6 +141,9 @@ void xe_reg_whitelist_process_engine(struct xe_hw_engine *hwe)xe_rtp_process_to_sr (&ctx, register_whitelist,ARRAY_SIZE (register_whitelist), &hwe->reg_whitelist);whitelist_apply_to_hwe (hwe); + +xe_rtp_process_to_sr (&ctx, oa_whitelist,ARRAY_SIZE (oa_whitelist), + &hwe->oa_whitelist); }/**
Signature · 1 line
2.54.0
PATCH v2 4/10 drm/xe/rtp: Keep track of non-OA nonpriv slots
In reply to Ashutosh Dixit[ Upstream commit 60d49ea28bb190a640bd8dc3f4c946e0811a948c ]
In order to dynamically whitelist/dewhitelist OA registers on OA stream open/close, we need to keep track of nonpriv slots occupied by non-OA register whitelists.
--- drivers/gpu/drm/xe/xe_reg_whitelist.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/xe/xe_reg_whitelist.c +5 -2
@@ -92,7 +92,7 @@ static const struct xe_rtp_entry_sr oa_whitelist[] = { }, }; -static void whitelist_apply_to_hwe (struct xe_hw_engine *hwe) +static int whitelist_apply_to_hwe (struct xe_hw_engine *hwe) {struct xe_reg_sr *sr = &hwe->reg_whitelist;struct xe_reg_sr_entry *entry;
@@ -124,6 +124,8 @@ static void whitelist_apply_to_hwe(struct xe_hw_engine *hwe) slot++; } + +return slot; }/**
@@ -137,10 +139,11 @@ static void whitelist_apply_to_hwe(struct xe_hw_engine *hwe)void xe_reg_whitelist_process_engine (struct xe_hw_engine *hwe) {struct xe_rtp_process_ctx ctx =XE_RTP_PROCESS_CTX_INITIALIZER (hwe); +int first_oa_slot;xe_rtp_process_to_sr (&ctx, register_whitelist,ARRAY_SIZE (register_whitelist), &hwe->reg_whitelist); -whitelist_apply_to_hwe (hwe); + first_oa_slot =whitelist_apply_to_hwe (hwe);xe_rtp_process_to_sr (&ctx, oa_whitelist,ARRAY_SIZE (oa_whitelist), &hwe->oa_whitelist);
Signature · 1 line
2.54.0
PATCH v2 5/10 drm/xe/rtp: Generalize whitelist_apply_to_hwe
In reply to Ashutosh Dixit[ Upstream commit 4fe2844b0f0c7cdc45ca4c4c62ca56b7f26c514c ]
Generalize whitelist_apply_to_hwe to construct both non-OA and OA whitelist nonpriv registers.
--- drivers/gpu/drm/xe/xe_reg_whitelist.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/gpu/drm/xe/xe_reg_whitelist.c +6 -5
@@ -92,9 +92,10 @@ static const struct xe_rtp_entry_sr oa_whitelist[] = { }, }; -static int whitelist_apply_to_hwe (struct xe_hw_engine *hwe) +static int whitelist_apply_to_hwe (struct xe_hw_engine *hwe,struct xe_reg_sr *in, +struct xe_reg_sr *out,int first_slot) { -struct xe_reg_sr *sr = &hwe->reg_whitelist; +struct xe_reg_sr *sr = in;struct xe_reg_sr_entry *entry;struct drm_printer p;unsigned long reg;
@@ -103,7 +104,7 @@ static int whitelist_apply_to_hwe(struct xe_hw_engine *hwe)xe_gt_dbg (hwe->gt,"Add %s whitelist to engine\n" , sr->name); p =xe_gt_dbg_printer (hwe->gt); - slot =0 ; + slot = first_slot;xa_for_each (&sr->xa, reg, entry) {struct xe_reg_sr_entry hwe_entry = { .reg =RING_FORCE_TO_NONPRIV (hwe->mmio_base, slot),
@@ -120,7 +121,7 @@ static int whitelist_apply_to_hwe(struct xe_hw_engine *hwe) }xe_reg_whitelist_print_entry (&p,0 , reg, entry); -xe_reg_sr_add (&hwe->reg_sr, &hwe_entry, hwe->gt); +xe_reg_sr_add (out, &hwe_entry, hwe->gt); slot++; }
@@ -143,7 +144,7 @@ void xe_reg_whitelist_process_engine(struct xe_hw_engine *hwe)xe_rtp_process_to_sr (&ctx, register_whitelist,ARRAY_SIZE (register_whitelist), &hwe->reg_whitelist); - first_oa_slot =whitelist_apply_to_hwe (hwe); + first_oa_slot =whitelist_apply_to_hwe (hwe, &hwe->reg_whitelist, &hwe->reg_sr,0 );xe_rtp_process_to_sr (&ctx, oa_whitelist,ARRAY_SIZE (oa_whitelist), &hwe->oa_whitelist);
Signature · 1 line
2.54.0
PATCH v2 6/10 drm/xe/rtp: Save OA nonpriv registers to register save/restore lists
In reply to Ashutosh Dixit[ Upstream commit a19a83721a28ccaddace846da70da5c53d7dd052 ]
Now we can save OA whitelisting nonpriv registers to register save/restore lists. OA nonpriv registers are saved to both hwe->oa_sr as well as hwe->reg_sr.
During probe, resume and gt-reset flows KMD will apply hwe->reg_sr, ensuring OA registers are de-whitelisted after these events. For engine-reset, hwe->reg_sr is registered with GuC and GuC will apply these registers, ensuring OA registers are de-whitelisted after engine resets.
hwe->oa_sr is used for whitelisting or de-whitelisting OA registers during OA operation, by toggling the 'deny' bit on oa stream open/close.
--- drivers/gpu/drm/xe/xe_reg_whitelist.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/gpu/drm/xe/xe_reg_whitelist.c +11 -0
@@ -148,6 +148,17 @@ void xe_reg_whitelist_process_engine(struct xe_hw_engine *hwe)xe_rtp_process_to_sr (&ctx, oa_whitelist,ARRAY_SIZE (oa_whitelist), &hwe->oa_whitelist); +/* +* Save oa nonpriv registers to hwe->oa_sr, from which oa registers are whitelisted +* or de-whitelisted, by toggling the 'deny' bit on oa stream open/close +*/ +whitelist_apply_to_hwe (hwe, &hwe->oa_whitelist, &hwe->oa_sr, first_oa_slot); + +/* +* Also save oa nonpriv registers to hwe->reg_sr, to ensure oa registers are not +* whitelisted by default after probe, gt reset, resume and engine reset +*/ +whitelist_apply_to_hwe (hwe, &hwe->oa_whitelist, &hwe->reg_sr, first_oa_slot); }/**
Signature · 1 line
2.54.0
PATCH v2 7/10 drm/xe/rtp: Toggle 'deny' bit to (de-)whitelist OA regs
In reply to Ashutosh Dixit[ Upstream commit b422babd77fac2c96b92db484050e460899bddaf ]
Whitelist or de-whitelist OA registers by setting or resetting the 'deny' bit in OA nonpriv registers and writing new register values to HW.
--- drivers/gpu/drm/xe/xe_reg_whitelist.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/gpu/drm/xe/xe_reg_whitelist.c +15 -0
@@ -161,6 +161,21 @@ void xe_reg_whitelist_process_engine(struct xe_hw_engine *hwe)whitelist_apply_to_hwe (hwe, &hwe->oa_whitelist, &hwe->reg_sr, first_oa_slot); } +__maybe_unused static void __whitelist_oa_regs (struct xe_hw_engine *hwe,bool whitelist) +{ +struct xe_reg_sr_entry *entry; +unsigned long reg; + +xa_for_each (&hwe->oa_sr.xa, reg, entry) { +if (whitelist) + entry->set_bits &= ~RING_FORCE_TO_NONPRIV_DENY ; +else + entry->set_bits |=RING_FORCE_TO_NONPRIV_DENY ; + } + +xe_reg_sr_apply_mmio (&hwe->oa_sr, hwe->gt); +} +/** * xe_reg_whitelist_print_entry - print one whitelist entry * @p: DRM printer
Signature · 1 line
2.54.0
PATCH v2 8/10 drm/xe/rtp: (De-)whitelist OA registers for all hwe's for a gt
In reply to Ashutosh Dixit[ Upstream commit ebba7ce65252a4ab0e3794ff14854df2afca5c08 ]
Whitelist or de-whitelist OA registers for all hwe's on the gt on which the OA stream is opened. This simplifies the case where an oa unit has 0 attached hwe's (but which monitors OA events on the associated GT).
--- drivers/gpu/drm/xe/xe_reg_whitelist.c | 34 +++++++++++++++++++++++++-- drivers/gpu/drm/xe/xe_reg_whitelist.h | 4 ++++ 2 files changed, 36 insertions(+), 2 deletions(-)
drivers/gpu/drm/xe/xe_reg_whitelist.c +32 -2
@@ -9,7 +9,7 @@#include "regs/xe_gt_regs.h" #include "regs/xe_oa_regs.h" #include "regs/xe_regs.h" -#include "xe_gt_types.h" +#include "xe_gt.h" #include "xe_gt_printk.h" #include "xe_platform_types.h" #include "xe_reg_sr.h"
@@ -161,7 +161,7 @@ void xe_reg_whitelist_process_engine(struct xe_hw_engine *hwe)whitelist_apply_to_hwe (hwe, &hwe->oa_whitelist, &hwe->reg_sr, first_oa_slot); } -__maybe_unused static void __whitelist_oa_regs (struct xe_hw_engine *hwe,bool whitelist) +static void __whitelist_oa_regs (struct xe_hw_engine *hwe,bool whitelist) {struct xe_reg_sr_entry *entry;unsigned long reg;
@@ -176,6 +176,36 @@ __maybe_unused static void __whitelist_oa_regs(struct xe_hw_engine *hwe, bool whxe_reg_sr_apply_mmio (&hwe->oa_sr, hwe->gt); } +/** +* xe_reg_whitelist_oa_regs - whitelist oa registers for gt +* @gt: gt to whitelist oa registers for +* +* Whitelist OA registers by resetting RING_FORCE_TO_NONPRIV_DENY +*/ +void xe_reg_whitelist_oa_regs (struct xe_gt *gt) +{ +struct xe_hw_engine *hwe; +enum xe_hw_engine_id id; + +for_each_hw_engine (hwe, gt, id) +__whitelist_oa_regs (hwe, true); +} + +/** +* xe_reg_dewhitelist_oa_regs - dewhitelist oa registers for gt +* @gt: gt to dewhitelist oa registers for +* +* Dewhitelist OA registers by setting RING_FORCE_TO_NONPRIV_DENY +*/ +void xe_reg_dewhitelist_oa_regs (struct xe_gt *gt) +{ +struct xe_hw_engine *hwe; +enum xe_hw_engine_id id; + +for_each_hw_engine (hwe, gt, id) +__whitelist_oa_regs (hwe, false); +} +/** * xe_reg_whitelist_print_entry - print one whitelist entry * @p: DRM printer
drivers/gpu/drm/xe/xe_reg_whitelist.h +4 -0
@@ -9,12 +9,16 @@#include <linux/types.h> struct drm_printer ; +struct xe_gt ;struct xe_hw_engine ;struct xe_reg_sr ;struct xe_reg_sr_entry ;void xe_reg_whitelist_process_engine (struct xe_hw_engine *hwe); +void xe_reg_whitelist_oa_regs (struct xe_gt *gt); +void xe_reg_dewhitelist_oa_regs (struct xe_gt *gt); +void xe_reg_whitelist_print_entry (struct drm_printer *p,unsigned int indent,u32 reg,struct xe_reg_sr_entry *entry);
Signature · 1 line
2.54.0
PATCH v2 9/10 drm/xe/oa: (De-)whitelist OA registers on OA stream open/release
In reply to Ashutosh Dixit[ Upstream commit 63ddb3ad08ff4e89c108499dfec5e9be5ddc25c9 ]
Whitelist OA registers on stream open and de-whitelist on stream close/release. Whitelisting is only done when 'stream->sample' is true. 'stream->sample' is only true when (a) xe_observation_paranoid is set to false by system admin, or (b) the process is perfmon_capable(). This therefore enforces the OA register whitelisting security requirements.
--- drivers/gpu/drm/xe/xe_oa.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/xe/xe_oa.c +7 -0
@@ -35,6 +35,7 @@#include "xe_oa.h" #include "xe_observation.h" #include "xe_pm.h" +#include "xe_reg_whitelist.h" #include "xe_sched_job.h" #include "xe_sriov.h" #include "xe_sync.h"
@@ -863,6 +864,9 @@ static void xe_oa_stream_destroy(struct xe_oa_stream *stream)mutex_destroy (&stream->stream_lock); +if (stream->sample) +xe_reg_dewhitelist_oa_regs (stream->gt); +xe_oa_disable_metric_set (stream);xe_exec_queue_put (stream->k_exec_q);
@@ -1887,6 +1891,9 @@ static int xe_oa_stream_open_ioctl_locked(struct xe_oa *oa, goto err_disable; } +if (stream->sample) +xe_reg_whitelist_oa_regs (stream->gt); +/* Hold a reference on the drm device till stream_fd is released */ drm_dev_get (&stream->oa->xe->drm);
Signature · 1 line
2.54.0
PATCH v2 10/10 drm/xe/rtp: Ensure locking/ref counting for OA whitelists
In reply to Ashutosh Dixit[ Upstream commit ef78e2a22f72c892fd6663f0760abd208d49a3e2 ]
Since multiple OA streams might be open in parallel on a gt, ensure that proper locking is in place. Also ensure that OA registers are whitelisted when the first OA stream is open and de-whitelisted after the last OA stream is closed.
--- drivers/gpu/drm/xe/xe_oa_types.h | 3 +++ drivers/gpu/drm/xe/xe_reg_whitelist.c | 10 ++++++++++ 2 files changed, 13 insertions(+)
drivers/gpu/drm/xe/xe_oa_types.h +3 -0
@@ -125,6 +125,9 @@ struct xe_oa_gt {/** @oa_unit: array of oa_units */ struct xe_oa_unit *oa_unit; + +/** @whitelist_count: number of open streams for which oa registers are whitelisted */ +u32 whitelist_count; };/**
drivers/gpu/drm/xe/xe_reg_whitelist.c +10 -0
@@ -9,6 +9,7 @@#include "regs/xe_gt_regs.h" #include "regs/xe_oa_regs.h" #include "regs/xe_regs.h" +#include "xe_assert.h" #include "xe_gt.h" #include "xe_gt_printk.h" #include "xe_platform_types.h"
@@ -187,6 +188,10 @@ void xe_reg_whitelist_oa_regs(struct xe_gt *gt)struct xe_hw_engine *hwe;enum xe_hw_engine_id id; +lockdep_assert_held (>->oa.gt_lock); +if (gt->oa.whitelist_count++) +return ; +for_each_hw_engine (hwe, gt, id)__whitelist_oa_regs (hwe, true); }
@@ -202,6 +207,11 @@ void xe_reg_dewhitelist_oa_regs(struct xe_gt *gt)struct xe_hw_engine *hwe;enum xe_hw_engine_id id; +lockdep_assert_held (>->oa.gt_lock); +xe_assert (gt_to_xe (gt), gt->oa.whitelist_count); +if (--gt->oa.whitelist_count) +return ; +for_each_hw_engine (hwe, gt, id)__whitelist_oa_regs (hwe, false); }
Signature · 1 line
2.54.0
Quoted 5 lines · Ashutosh Dixit
Backport of the following series to Linux 6.18.y:
https://lore.kernel.org/intel-xe/[email protected]/
v2: Fix upstream commit sha's (Sasha Levin)
Queued the series for 6.18, thanks.
Signature · 2 lines
Thanks, Sasha