[PATCH 1/2] drm/xe/guc: Unblock GuC buffer cache for all modes

Lucas De Marchi lucas.demarchi at intel.com
Tue May 13 20:57:00 UTC 2025


On Mon, May 12, 2025 at 03:11:52PM -0700, Matthew Brost wrote:
>On Tue, May 13, 2025 at 12:00:17AM +0200, Michal Wajdeczko wrote:
>> Today we were using GuC buffer cache only in the PF mode, but
>> shortly we will want to use it also in native and VF mode.
>>
>> Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
>> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>
>
>Should we mark these patches as fixes? A malicious user could consume
>all the VRAM on the device by changing wedged mode via debugfs enough
>times...

allowing the user hang the entire gpu by setting wedged_mode and then
saying it's a malicious user that could consume the entire vram
is odd. The entire gpu already belongs to that user by letting it play
with wedged_mode. We can backport it, but given it's wedged_mode and via
debugfs only, I don't think it's super important.

I took a look on what it'd be needed to go back to 6.12 and it would
require not only 696bfdf273ea ("drm/xe/guc: Introduce the GuC Buffer Cache"),
but also 5994018ecffc ("drm/xe/guc: Fix sizeof(32) typo") and
ae8b507fb8bb ("drm/xe/sa: Allow creating suballocator with custom guard
size") and even that may not be sufficient. It's a lot of new feature to
backport and with a chance of introducing a real bug when doing so. It's
a snowball and IMO not worth it.

Lucas De Marchi

>
>Reviewed-by: Matthew Brost <matthew.brost at intel.com>
>
>> ---
>>  drivers/gpu/drm/xe/xe_guc.c     | 4 ++++
>>  drivers/gpu/drm/xe/xe_guc_buf.c | 4 ----
>>  2 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c
>> index bac5471a1a78..350434a8b953 100644
>> --- a/drivers/gpu/drm/xe/xe_guc.c
>> +++ b/drivers/gpu/drm/xe/xe_guc.c
>> @@ -710,6 +710,10 @@ static int vf_guc_init_post_hwconfig(struct xe_guc *guc)
>>  	if (err)
>>  		return err;
>>
>> +	err = xe_guc_buf_cache_init(&guc->buf);
>> +	if (err)
>> +		return err;
>> +
>>  	/* XXX xe_guc_db_mgr_init not needed for now */
>>
>>  	return 0;
>> diff --git a/drivers/gpu/drm/xe/xe_guc_buf.c b/drivers/gpu/drm/xe/xe_guc_buf.c
>> index 0193c94dd6a0..14a07dca48e7 100644
>> --- a/drivers/gpu/drm/xe/xe_guc_buf.c
>> +++ b/drivers/gpu/drm/xe/xe_guc_buf.c
>> @@ -37,10 +37,6 @@ int xe_guc_buf_cache_init(struct xe_guc_buf_cache *cache)
>>  	struct xe_gt *gt = cache_to_gt(cache);
>>  	struct xe_sa_manager *sam;
>>
>> -	/* XXX: currently it's useful only for the PF actions */
>> -	if (!IS_SRIOV_PF(gt_to_xe(gt)))
>> -		return 0;
>> -
>>  	sam = __xe_sa_bo_manager_init(gt_to_tile(gt), SZ_8K, 0, sizeof(u32));
>>  	if (IS_ERR(sam))
>>  		return PTR_ERR(sam);
>> --
>> 2.47.1
>>


More information about the Intel-xe mailing list