Skip to contentSkip to conversation

drm/amd/ras: use dedicated memory as vf ras command buffer

PATCH Superseded YiPeng Chai 1 participant 1 message Feb 10

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/ras: use dedicated memory as vf ras command buffer

Use dedicated memory as vf ras command buffer.

---
 drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h   |  28 ++++-
 .../drm/amd/ras/ras_mgr/amdgpu_virt_ras_cmd.c | 114 ++++++++++++------
 .../drm/amd/ras/ras_mgr/amdgpu_virt_ras_cmd.h |   9 +-
 3 files changed, 107 insertions(+), 44 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h +22 -6
index c20d10263492..067832b5936c 100644
@@ -498,14 +498,30 @@ struct amd_sriov_ras_chk_criti {
 	uint32_t hit;
 };
 
+union amd_sriov_ras_host_push {
+	struct amd_sriov_ras_telemetry_error_count error_count;
+	struct amd_sriov_ras_cper_dump cper_dump;
+	struct amd_sriov_ras_chk_criti chk_criti;
+};
+
+#define AMD_SRIOV_UNIRAS_CMD_MAX_SIZE (PAGE_SIZE * 13)
+struct amd_sriov_uniras_shared_mem {
+	uint8_t blocks_ecc_buf[PAGE_SIZE];
+	uint8_t cmd_buf[AMD_SRIOV_UNIRAS_CMD_MAX_SIZE];
+};
+
 struct amdsriov_ras_telemetry {
 	struct amd_sriov_ras_telemetry_header header;
-
-	union {
-		struct amd_sriov_ras_telemetry_error_count error_count;
-		struct amd_sriov_ras_cper_dump cper_dump;
-		struct amd_sriov_ras_chk_criti chk_criti;
-	} body;
+	union amd_sriov_ras_host_push body;
+	struct amd_sriov_uniras_shared_mem uniras_shared_mem;
+
+	/* This is to prevent the size definition of the previous structure
+	 * from exceeding AMD_STROV_MSG.RAS_TELEMETRy_size_KB_V1.
+	 */
+	uint8_t reserved[AMD_SRIOV_MSG_RAS_TELEMETRY_SIZE_KB_V1 * 1024 -
+		sizeof(struct amd_sriov_ras_telemetry_header) -
+		sizeof(union amd_sriov_ras_host_push) -
+		sizeof(struct amd_sriov_uniras_shared_mem)];
 };
 
 /* version data stored in MAILBOX_MSGBUF_RCV_DW1 for future expansion */
drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_virt_ras_cmd.c +79 -35

192 lines not on this page · raw message

drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_virt_ras_cmd.h +6 -3
index 53b0f3f60103..001e4cfb823e 100644
@@ -30,11 +30,14 @@ struct remote_batch_trace_mgr {
 	struct ras_cmd_batch_trace_record_rsp  batch_trace;
 };
 
-struct vram_blocks_ecc {
-	struct amdgpu_bo *bo;
-	uint64_t mc_addr;
+struct amdgpu_virt_shared_mem {
+	uint64_t gpa;
 	void *cpu_addr;
 	uint32_t size;
+};
+
+struct vram_blocks_ecc {
+	struct amdgpu_virt_shared_mem shared_mem;
 	bool auto_update_actived;
 };
 
Signature · 1 line
2.43.0