Skip to contentSkip to conversation

VF: Avoid reading inaccessible registers

PATCH Superseded Marcin Bernatowicz 3 participants 6 messages Dec 10, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover VF: Avoid reading inaccessible registers

From VF-level some registers are not accessible. Don't check for flat ccs from VF-level, also don't use Wa_22019338487 for VF.

v2: Updated description for has_flat_ccs flag setting on VF
when disabled in BIOS. (Matt)
Reworked workaround ommision on VF to use the RTP mechanism. (Matt)

Cc Adam Miszczak <[email protected]>
Cc Jakub Kolakowski <[email protected]>
Cc Lucas De Marchi <[email protected]>
Cc Lukasz Laguna <[email protected]>
Cc Matt Roper <[email protected]>
Cc Michal Wajdeczko <[email protected]>
Cc Michal Winiarski <[email protected]>
Cc Narasimha C V <[email protected]>
Cc Piotr Piorkowski <[email protected]>
Cc Satyanarayana K V P <[email protected]>
Cc Tomasz Lis <[email protected]>

Jakub Kolakowski (1):
drm/xe/vf: Don't check has flat ccs in bios on VF

Marcin Bernatowicz (2):
drm/xe/rtp: Add match helper to omit SR-IOV VF device drm/xe/vf: Don't apply Wa_22019338487 for VF

 drivers/gpu/drm/xe/xe_device.c     |  2 +-
 drivers/gpu/drm/xe/xe_rtp.c        |  5 +++++
 drivers/gpu/drm/xe/xe_rtp.h        | 11 +++++++++++
 drivers/gpu/drm/xe/xe_wa_oob.rules |  2 +-
 4 files changed, 18 insertions(+), 2 deletions(-)
Signature · 1 line
2.31.1
#1 lore raw

PATCH v2 1/3 drm/xe/vf: Don't check has flat ccs in bios on VF

From: Jakub Kolakowski <[email protected]>

Don't check for flat ccs from VF-level as VF does not have direct access to the register.

If the BIOS disables FlatCCS support (a use-case that will nearly never be used) and the has_flat_ccs flag is set, there shouldn't be any functional impact. The hardware will drop writes to the CCS region, and reads from the CCS region will always return 0.
For the native case, the flag is disabled if the BIOS disables it to avoid unnecessary overhead in buffer object (BO) creation and migration.

Cc Adam Miszczak <[email protected]>
Cc Jakub Kolakowski <[email protected]>
Cc Lukasz Laguna <[email protected]>
Cc Marcin Bernatowicz <[email protected]>
Cc Michal Wajdeczko <[email protected]>
Cc Michal Winiarski <[email protected]>
Cc Narasimha C V <[email protected]>
Cc Piotr Piorkowski <[email protected]>
Cc Satyanarayana K V P <[email protected]>
Cc Tomasz Lis <[email protected]>
Cc Matt Roper <[email protected]>
---
 drivers/gpu/drm/xe/xe_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/xe/xe_device.c +1 -1
index 56d4ffb650da..ec0ea9c914b4 100644
@@ -604,7 +604,7 @@ static int probe_has_flat_ccs(struct xe_device *xe)
 	u32 reg;
 
 	/* Always enabled/disabled, no runtime check to do */
-	if (GRAPHICS_VER(xe) < 20 || !xe->info.has_flat_ccs)
+	if (GRAPHICS_VER(xe) < 20 || !xe->info.has_flat_ccs || IS_SRIOV_VF(xe))
 		return 0;
 
 	gt = xe_root_mmio_gt(xe);
Signature · 1 line
2.31.1
#2 lore raw

PATCH v2 2/3 drm/xe/rtp: Add match helper to omit SR-IOV VF device

In reply to Marcin Bernatowicz

Add a match helper that allows the application of a workaround when the device is not an SR-IOV VF (Virtual Function) device.

Cc Adam Miszczak <[email protected]>
Cc Jakub Kolakowski <[email protected]>
Cc Lucas De Marchi <[email protected]>
Cc Lukasz Laguna <[email protected]>
Cc Matt Roper <[email protected]>
Cc Michal Wajdeczko <[email protected]>
Cc Michal Winiarski <[email protected]>
Cc Narasimha C V <[email protected]>
Cc Piotr Piorkowski <[email protected]>
Cc Satyanarayana K V P <[email protected]>
Cc Tomasz Lis <[email protected]>
---
 drivers/gpu/drm/xe/xe_rtp.c |  5 +++++
 drivers/gpu/drm/xe/xe_rtp.h | 11 +++++++++++
 2 files changed, 16 insertions(+)
drivers/gpu/drm/xe/xe_rtp.c +5 -0
index b13d4d62f0b1..7a1c78fdfc92 100644
@@ -340,3 +340,8 @@ bool xe_rtp_match_first_gslice_fused_off(const struct xe_gt *gt,
 	return dss >= dss_per_gslice;
 }
 
+bool xe_rtp_match_not_sriov_vf(const struct xe_gt *gt,
+			       const struct xe_hw_engine *hwe)
+{
+	return !IS_SRIOV_VF(gt_to_xe(gt));
+}
drivers/gpu/drm/xe/xe_rtp.h +11 -0
index 827d932b6908..7dea10d732d7 100644
@@ -476,4 +476,15 @@ bool xe_rtp_match_first_render_or_compute(const struct xe_gt *gt,
 bool xe_rtp_match_first_gslice_fused_off(const struct xe_gt *gt,
 					 const struct xe_hw_engine *hwe);
 
+/*
+ * xe_rtp_match_not_sriov_vf - Match when not on SR-IOV VF device
+ *
+ * @gt: GT structure
+ * @hwe: Engine instance
+ *
+ * Returns: true if device is not VF, false otherwise.
+ */
+bool xe_rtp_match_not_sriov_vf(const struct xe_gt *gt,
+			       const struct xe_hw_engine *hwe);
+
 #endif
Signature · 1 line
2.31.1
#3 lore raw

PATCH v2 3/3 drm/xe/vf: Don't apply Wa_22019338487 for VF

In reply to Marcin Bernatowicz

Don't use Wa_22019338487 for VF.

Cc Adam Miszczak <[email protected]>
Cc Jakub Kolakowski <[email protected]>
Cc Lucas De Marchi <[email protected]>
Cc Lukasz Laguna <[email protected]>
Cc Matt Roper <[email protected]>
Cc Michal Wajdeczko <[email protected]>
Cc Michal Winiarski <[email protected]>
Cc Narasimha C V <[email protected]>
Cc Piotr Piorkowski <[email protected]>
Cc Satyanarayana K V P <[email protected]>
Cc Tomasz Lis <[email protected]>
---
 drivers/gpu/drm/xe/xe_wa_oob.rules | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/xe/xe_wa_oob.rules +1 -1
index 3ed12a85cc60..40438c3d9b72 100644
@@ -34,7 +34,7 @@
 		GRAPHICS_VERSION(2004)
 22019338487	MEDIA_VERSION(2000)
 		GRAPHICS_VERSION(2001)
-		MEDIA_VERSION(3000), MEDIA_STEP(A0, B0)
+		MEDIA_VERSION(3000), MEDIA_STEP(A0, B0), FUNC(xe_rtp_match_not_sriov_vf)
 22019338487_display	PLATFORM(LUNARLAKE)
 16023588340	GRAPHICS_VERSION(2001)
 14019789679	GRAPHICS_VERSION(1255)
Signature · 1 line
2.31.1
#4 lore raw

✗ Fi.CI.BUILD: failure for VF: Avoid reading inaccessible registers

In reply to Marcin Bernatowicz
== Series Details ==

== Series Details ==

Series: VF: Avoid reading inaccessible registers
URL : https://patchwork.freedesktop.org/series/142361/
State : failure

== Summary ==

Applying: drm/xe/vf: Don't check has flat ccs in bios on VF Patch failed at 0001 drm/xe/vf: Don't check has flat ccs in bios on VF When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".

#5 lore raw
In reply to Marcin Bernatowicz
Quoted 6 lines · Marcin Bernatowicz

From VF-level some registers are not accessible. Don't check for flat ccs from VF-level, also don't use Wa_22019338487 for VF.

v2: Updated description for has_flat_ccs flag setting on VF
when disabled in BIOS. (Matt)
Reworked workaround ommision on VF to use the RTP mechanism. (Matt)

I think you might have sent this to the wrong mailing list? This looks like it should probably be on intel-xe rather than igt-dev.

Matt

Quoted 29 lines
Cc Adam Miszczak <[email protected]>
Cc Jakub Kolakowski <[email protected]>
Cc Lucas De Marchi <[email protected]>
Cc Lukasz Laguna <[email protected]>
Cc Matt Roper <[email protected]>
Cc Michal Wajdeczko <[email protected]>
Cc Michal Winiarski <[email protected]>
Cc Narasimha C V <[email protected]>
Cc Piotr Piorkowski <[email protected]>
Cc Satyanarayana K V P <[email protected]>
Cc Tomasz Lis <[email protected]>

Jakub Kolakowski (1):
drm/xe/vf: Don't check has flat ccs in bios on VF

Marcin Bernatowicz (2):
drm/xe/rtp: Add match helper to omit SR-IOV VF device drm/xe/vf: Don't apply Wa_22019338487 for VF

 drivers/gpu/drm/xe/xe_device.c     |  2 +-
 drivers/gpu/drm/xe/xe_rtp.c        |  5 +++++
 drivers/gpu/drm/xe/xe_rtp.h        | 11 +++++++++++
 drivers/gpu/drm/xe/xe_wa_oob.rules |  2 +-
 4 files changed, 18 insertions(+), 2 deletions(-)
Signature · 1 line
2.31.1
Signature · 4 lines
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation