[PATCH] riscv: Make sifive_test finisher 4 bytes

Hesham Almatary hesham.almatary at cl.cam.ac.uk
Tue Sep 15 07:09:17 UTC 2020


QEMU is now stricter with MMIO sizes and accesses. uintptr_t on RV64
is 8 bytes and generates an sd instruction that Store/AMO faults
because sifive_test MMIO expects 4 bytes accesses.
---
 bsps/riscv/riscv/start/bsp_fatal_halt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bsps/riscv/riscv/start/bsp_fatal_halt.c b/bsps/riscv/riscv/start/bsp_fatal_halt.c
index af9e2ac7c6..348fa4f8f4 100644
--- a/bsps/riscv/riscv/start/bsp_fatal_halt.c
+++ b/bsps/riscv/riscv/start/bsp_fatal_halt.c
@@ -35,7 +35,7 @@ void _CPU_Fatal_halt(uint32_t source, uint32_t error)
 {
   const char *fdt;
   int node;
-  volatile uintptr_t *sifive_test;
+  volatile uint32_t *sifive_test;
 
 #if RISCV_ENABLE_HTIF_SUPPORT != 0
   htif_poweroff();
-- 
2.25.1



More information about the devel mailing list