[PATCH 7/9] drm/xe/vf: Don't use register based TLB invalidation if VF

Michal Wajdeczko michal.wajdeczko at intel.com
Wed Jun 19 23:25:53 UTC 2024



On 20.06.2024 01:13, Matthew Brost wrote:
> On Wed, Jun 19, 2024 at 11:45:55PM +0200, Michal Wajdeczko wrote:
>> VF drivers can only use GuC-based TLB invalidation, as they don't
>> have access to the related registers. However, VFs shouldn't need
>> any explicit TLB invalidation before enabling CTB communication,
>> as there will be an implicit GGTT TLB invalidation issued by the
>> GuC itself as part of MMIO-based action handling.
>>
> 
> Does assigning / removing a new GGTT mapping on a VF involve a MMIO
> action?

if we are adding new GGTT mapping _before_ CTB is ready, then we likely
doing that just to enable the CTB, which is MMIO action, that has
implicit TLB invalidation, or we did this to prepare our data long
before starting GuC, in which case we don't care until we enable CTB,
which is prev case, as we need CTB to create contexts and submit WLs

if we remove any GGTT mappings than likely we already pass the probe
phase and have CTB available

IMO, even in native mode we should also only rely on GuC CTB actions or
implicit TLB invalidation performed by GuC (unless we are running in
execlist mode)

> 
> Not touching registers on VF itself makes sense though.
> 
> Matt
> 
>> Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
>> ---
>>  drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
>> index 23d397a246a8..e1f1ccb01143 100644
>> --- a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
>> +++ b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
>> @@ -13,6 +13,7 @@
>>  #include "xe_guc.h"
>>  #include "xe_guc_ct.h"
>>  #include "xe_mmio.h"
>> +#include "xe_sriov.h"
>>  #include "xe_trace.h"
>>  #include "regs/xe_guc_regs.h"
>>  
>> @@ -249,6 +250,9 @@ int xe_gt_tlb_invalidation_ggtt(struct xe_gt *gt)
>>  
>>  		xe_gt_tlb_invalidation_wait(gt, seqno);
>>  	} else if (xe_device_uc_enabled(xe) && !xe_device_wedged(xe)) {
>> +		if (IS_SRIOV_VF(xe))
>> +			return 0;
>> +
>>  		xe_gt_WARN_ON(gt, xe_force_wake_get(gt_to_fw(gt), XE_FW_GT));
>>  		if (xe->info.platform == XE_PVC || GRAPHICS_VER(xe) >= 20) {
>>  			xe_mmio_write32(gt, PVC_GUC_TLB_INV_DESC1,
>> -- 
>> 2.43.0
>>


More information about the Intel-xe mailing list