All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lib: sbi: dbtr: Fix shared memory layout
@ 2025-05-27 18:27 Jesse Taube
  2025-05-28  3:15 ` Charlie Jenkins
  2025-06-04  3:35 ` Himanshu Chauhan
  0 siblings, 2 replies; 5+ messages in thread
From: Jesse Taube @ 2025-05-27 18:27 UTC (permalink / raw)
  To: opensbi; +Cc: Himanshu Chauhan, Anup Patel, Charlie Jenkins, Jesse Taube

The existing sbi_dbtr_shmem_entry has a size of 5 * XLEN with the final
entry being idx. This is in contrast to the SBI v3.0-rc7 Chapter 19.
Debug Triggers Extension [0] where idx and trig_state share the same
offset (0) in shared memory, with a total size of 4 * XLEN for all the
SBI calls.

Add union to match memory layout described in SBI.

[0] https://github.com/riscv-non-isa/riscv-sbi-doc/tree/v3.0-rc7/src/ext-debug-triggers.adoc

Fixes: 97f234f15c96 ("lib: sbi: Introduce the SBI debug triggers extension support")
Signed-off-by: Jesse Taube <jesse@rivosinc.com>
---
 include/sbi/sbi_dbtr.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/sbi/sbi_dbtr.h b/include/sbi/sbi_dbtr.h
index a8b3a02..8cb776c 100644
--- a/include/sbi/sbi_dbtr.h
+++ b/include/sbi/sbi_dbtr.h
@@ -91,8 +91,10 @@ struct sbi_dbtr_hart_triggers_state {
 
 /** SBI shared mem messages layout */
 struct sbi_dbtr_shmem_entry {
-	struct sbi_dbtr_data_msg data;
-	struct sbi_dbtr_id_msg id;
+	union {
+		struct sbi_dbtr_data_msg data;
+		struct sbi_dbtr_id_msg id;
+	};
 };
 
 #define SBI_DBTR_SHMEM_ALIGN_MASK	((__riscv_xlen / 8) - 1)
-- 
2.43.0


-- 
opensbi mailing list
opensbi@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-06-04 13:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-27 18:27 [PATCH] lib: sbi: dbtr: Fix shared memory layout Jesse Taube
2025-05-28  3:15 ` Charlie Jenkins
2025-05-28  4:17   ` Himanshu Chauhan
2025-06-04  3:35 ` Himanshu Chauhan
2025-06-04 13:37   ` Jesse Taube

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.