Re: [PATCH v2 03/10] drm/xe/oa: Stop whitelisting OAM registers on non Xe2/Xe3

[email protected]
Newsgroups org.freedesktop.lists.intel-xe
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Removing media version 13.00 from the software whitelist silently revokes necessary Read/Write (RW) access to the OAM SAG MMIO trigger and access to SAG registers on VCS/VECS engines, breaking OA functionality.
--

--- Patch [3]: [PATCH v2 03/10] drm/xe/oa: Stop whitelisting OAM registers on non Xe2/Xe3 ---
commit 3ab34d9500af1c2740344cccab6db3fb8ba384d6
Author: Matt Roper <[email protected]>

drm/xe/oa: Stop whitelisting OAM registers on non Xe2/Xe3

This commit updates the media version range for OAM register whitelisting
on VCS and VECS engines, changing the start version from 1300 to 1301. The
commit relies on the hardware's built-in whitelist to automatically grant
read-only access for media version 13.00.

> diff --git a/drivers/gpu/drm/xe/xe_reg_whitelist.c b/drivers/gpu/drm/xe/xe_reg_whitelist.c
> index b0ad89a5ad4fc..457702de53e45 100644
> --- a/drivers/gpu/drm/xe/xe_reg_whitelist.c
> +++ b/drivers/gpu/drm/xe/xe_reg_whitelist.c
[ ... ]
> @@ -128,14 +128,14 @@ static const struct xe_rtp_entry_sr register_whitelist[] = {
>  				   RING_FORCE_TO_NONPRIV_RANGE_4))
>  	},
>  	{ XE_RTP_NAME("oam_mmio_trg_vcs"),
> -	  XE_RTP_RULES(MEDIA_VERSION_RANGE(1300, XE_RTP_END_VERSION_UNDEFINED),
> +	  XE_RTP_RULES(MEDIA_VERSION_RANGE(1301, 3099),
>  		       ENGINE_CLASS(VIDEO_DECODE)),
>  	  XE_RTP_ACTIONS(WHITELIST(OAM_MMIO_TRG(XE_OAM_SAG_BASE_ADJ),
>  				   RING_FORCE_TO_NONPRIV_ACCESS_RW),

[Severity: High]
Does removing media version 13.00 from the software whitelist break userspace
write access to the OAM SAG MMIO trigger?

The commit message notes that the hardware's built-in whitelist grants
read-only access automatically. However, the software whitelist explicitly
grants Read/Write (RW) access to OAM_MMIO_TRG(XE_OAM_SAG_BASE_ADJ) via
RING_FORCE_TO_NONPRIV_ACCESS_RW, which is required to write to the trigger.

Additionally, because the SAG registers physically belong to the GSC engine,
will the VCS/VECS hardware built-in whitelist actually cover them? If not,
dropping version 13.00 from the software whitelist might cause privilege
violations when userspace tools monitor performance on Xe_LPM (13.00) platforms.

>  			 WHITELIST_OAM_MMIO_TRG)
>  	},
>  	{ XE_RTP_NAME("oam_mmio_trg_vecs"),
> -	  XE_RTP_RULES(MEDIA_VERSION_RANGE(1300, XE_RTP_END_VERSION_UNDEFINED),
> +	  XE_RTP_RULES(MEDIA_VERSION_RANGE(1301, 3099),
>  		       ENGINE_CLASS(VIDEO_ENHANCE)),
>  	  XE_RTP_ACTIONS(WHITELIST(OAM_MMIO_TRG(XE_OAM_SAG_BASE_ADJ),
>  				   RING_FORCE_TO_NONPRIV_ACCESS_RW),

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.