Skip to contentSkip to conversation

drm/i915: Define and use GuC and CTB TLB invalidation routines

PATCH Superseded Jonathan Cavitt 1 participant 3 messages Oct 10, 2023

Subsystems (2)

v10 of 17 Superseded Latest is v17 →

lore
Share & tools
lore
#0 lore raw

v10 cover drm/i915: Define and use GuC and CTB TLB invalidation routines

Implement GuC-based TLB invalidations and use them on MTL.

v2:
- Add missing supporting patches.

v3:
- Split suspend/resume changes and multi-gt support into separate patches.
- Only perform GuC TLB invalidation functions when supported.
- Move intel_guc_is_enabled check function to usage location.
- Address comments.

v4:
- Change conditions for GuC-based tlb invalidation support to a pci tag that's only active for MTL.
- Address some FIXMEs and formatting issues.
- Move suspend/resume changes to helper functions in intel_gt.h
- Improve comment for ct_handle_event change.
- Use cleaner if-else conditions.
- Address comments.

v5:
- Reintroduce missing change to selftest msleep duration
- Move suspend/resume loops from intel_gt.h to intel_tlb.c, making them no longer static inlines.
- Remove superfluous blocking and error checks.
- Move ct_handle_event exception to general case in ct_process_request.
- Explain usage of xa_alloc_cyclic_irq.
- Modify explanation of purpose of OUTSTANDING_GUC_TIMEOUT_PERIOD macro.
- Explain purpose of performing tlb invalidation twice in intel_gt_tlb_resume_all.

v6:
- Add this cover letter.
- Fix explanation of purpose of OUTSTANDING_GUC_TIMEOUT_PERIOD macro again.
- s/pci tags/pci flags
- Enable GuC TLB Invalidations separately from adding the flags to do so.

v7:
- Eliminate pci terminology from patches.
- Order new device info flag correctly.
- Run gen8_ggtt_invalidate in more cases, specifically when GuC-based TLB invalidation is not supported.
- Use intel_uncore_write_fw instead of intel_uncore_write during guc_ggtt_invalidate.
- Remove duplicate request message clear in ct_process_request.
- Remove faulty tag from series.

v8:
- Simplify cover letter contents.
- Fix miscellaneous formatting and typos.
- Reorder device info flags and defines.
- Reword commit message.
- Rename TLB invalidation enums and functions.
- Add comments explaining confusing points.
- Add helper function getting expected delay of CT buffer.
- Simplify intel_guc_tlb_invalidation_done by passing computed values.
- Remove helper functions for tlb suspend and resume.
- Move tlb suspend and resume paths to uc.
- Split suspend/resume and wedged into two patches.
- Clarify purpose of sleep change in tlb selftest.

v9:
- Explain complexity of GuC TLB invalidations as required for range-based TLB invalidations, which will be platformed later.
- Fix CHECKPATCH issues.
- Explain intel_guc_is_ready tlb invalidation skip in intel_gt_invalidate_tlb_full.
- Reword comment for unlocked xa_for_each loop in intel_guc_submission_reset.
- Report all errors in init_tlb_lookup.
- Remove debug message from fini_tlb_lookup.
- Use standardized interface for intel_guc_tlb_invalidation_done
- Remove spurious changes.
- Move wake_up_all_tlb_invalidate on wedge to correct patch.

v10:
- Add lock to tlb_lookup on guc submission reset.
- Add comment about why timeout increased from 10 ms to 20 ms by default in gt_tlb selftest.
- Remove spurious changes.

Jonathan Cavitt (6):
drm/i915: Add GuC TLB Invalidation device info flags drm/i915/guc: Add CT size delay helper
drm/i915: No TLB invalidation on suspended GT drm/i915: No TLB invalidation on wedged GT drm/i915/gt: Increase sleep in gt_tlb selftest sanitycheck drm/i915: Enable GuC TLB invalidations for MTL

Prathap Kumar Valsan (1):
drm/i915: Define and use GuC and CTB TLB invalidation routines

 drivers/gpu/drm/i915/gt/intel_ggtt.c          |  34 ++-
 drivers/gpu/drm/i915/gt/intel_tlb.c           |  16 +-
 drivers/gpu/drm/i915/gt/selftest_tlb.c        |  11 +-
 .../gpu/drm/i915/gt/uc/abi/guc_actions_abi.h  |  33 +++
 drivers/gpu/drm/i915/gt/uc/intel_guc.h        |  23 ++
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c     |   4 +
 drivers/gpu/drm/i915/gt/uc/intel_guc_ct.h     |  13 ++
 drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h   |   1 +
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c | 211 +++++++++++++++++-
 drivers/gpu/drm/i915/gt/uc/intel_uc.c         |   7 +
 drivers/gpu/drm/i915/i915_drv.h               |   2 +
 drivers/gpu/drm/i915/i915_pci.c               |   1 +
 drivers/gpu/drm/i915/intel_device_info.h      |   1 +
 13 files changed, 343 insertions(+), 14 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH v10 1/7 drm/i915: Add GuC TLB Invalidation device info flags

Add device info flags for if GuC TLB Invalidation is enabled.

---
 drivers/gpu/drm/i915/i915_drv.h          | 2 ++
 drivers/gpu/drm/i915/intel_device_info.h | 1 +
 2 files changed, 3 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +2 -0
index cb60fc9cf8737..6a2a78c61f212 100644
@@ -794,6 +794,8 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,
 #define HAS_GUC_DEPRIVILEGE(i915) \
 	(INTEL_INFO(i915)->has_guc_deprivilege)
 
+#define HAS_GUC_TLB_INVALIDATION(i915)	(INTEL_INFO(i915)->has_guc_tlb_invalidation)
+
 #define HAS_3D_PIPELINE(i915)	(INTEL_INFO(i915)->has_3d_pipeline)
 
 #define HAS_ONE_EU_PER_FUSE_BIT(i915)	(INTEL_INFO(i915)->has_one_eu_per_fuse_bit)
drivers/gpu/drm/i915/intel_device_info.h +1 -0
index 39817490b13fd..eba2f0b919c87 100644
@@ -153,6 +153,7 @@ enum intel_ppgtt_type {
 	func(has_heci_pxp); \
 	func(has_heci_gscfi); \
 	func(has_guc_deprivilege); \
+	func(has_guc_tlb_invalidation); \
 	func(has_l3_ccs_read); \
 	func(has_l3_dpf); \
 	func(has_llc); \
Signature · 1 line
2.25.1
#2 lore raw

Re: [Intel-gfx] [PATCH dii-client v10 1/7] drm/i915: Add GuC TLB Invalidation device info flags

-----Original Message-----
From: Cavitt, Jonathan <[email protected]>
Sent: Tuesday, October 10, 2023 8:01 AM
To: [email protected]
Cc: Gupta, saurabhg <[email protected]>; Cavitt, Jonathan <[email protected]>; [email protected]; Iddamsetty, Aravind <[email protected]>; Yang, Fei <[email protected]>; Shyti, Andi <[email protected]>; Harrison, John C <[email protected]>; Das, Nirmoy <[email protected]>; Krzysztofik, Janusz <[email protected]>; Roper, Matthew D <[email protected]>; [email protected]; [email protected]
Subject: [PATCH dii-client v10 1/7] drm/i915: Add GuC TLB Invalidation device info flags

Quoted 2 lines

Add device info flags for if GuC TLB Invalidation is enabled.

Sorry! I jumped the gun! I'll send the proper version shortly! -Jonathan Cavitt

Quoted 36 lines
---
 drivers/gpu/drm/i915/i915_drv.h          | 2 ++
 drivers/gpu/drm/i915/intel_device_info.h | 1 +
 2 files changed, 3 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +2 -0
index cb60fc9cf8737..6a2a78c61f212 100644
@@ -794,6 +794,8 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,
 #define HAS_GUC_DEPRIVILEGE(i915) \
 	(INTEL_INFO(i915)->has_guc_deprivilege)
 
+#define HAS_GUC_TLB_INVALIDATION(i915)	(INTEL_INFO(i915)->has_guc_tlb_invalidation)
+
 #define HAS_3D_PIPELINE(i915)	(INTEL_INFO(i915)->has_3d_pipeline)
 
 #define HAS_ONE_EU_PER_FUSE_BIT(i915)	(INTEL_INFO(i915)->has_one_eu_per_fuse_bit)
drivers/gpu/drm/i915/intel_device_info.h +1 -0
index 39817490b13fd..eba2f0b919c87 100644
@@ -153,6 +153,7 @@ enum intel_ppgtt_type {
 	func(has_heci_pxp); \
 	func(has_heci_gscfi); \
 	func(has_guc_deprivilege); \
+	func(has_guc_tlb_invalidation); \
 	func(has_l3_ccs_read); \
 	func(has_l3_dpf); \
 	func(has_llc); \
Signature · 1 line
2.25.1