Commit c483b90ccd for qemu.org
commit c483b90ccd9b8cb3c7445c1b8f0dfbb5e03a6e5f
Author: Frank Chang <frank.chang@sifive.com>
Date: Thu May 28 14:00:07 2026 +0800
target/riscv: Reorder Smrnmi CPU fields above CPU reset line
Smrnmi CPU fields introduced by commit: #5db557f should be reset when
the CPU resets, so move these fields above the CPU reset line.
Fixes: 5db557f82bff ("target/riscv: Add Smrnmi CSRs")
Signed-off-by: Frank Chang <frank.chang@sifive.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20260528060007.717307-1-frank.chang@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index febd905389..eec5acea5f 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -491,6 +491,15 @@ struct CPUArchState {
uint64_t hstateen[SMSTATEEN_MAX_COUNT];
uint64_t sstateen[SMSTATEEN_MAX_COUNT];
uint64_t henvcfg;
+
+ /* RNMI */
+ uint64_t mnscratch;
+ uint64_t mnepc;
+ uint64_t mncause; /* mncause without bit XLEN-1 set to 1 */
+ uint64_t mnstatus;
+ uint64_t rnmip;
+ uint64_t rnmi_irqvec;
+ uint64_t rnmi_excpvec;
#endif
/* Fields from here on are preserved across CPU reset. */
@@ -509,15 +518,6 @@ struct CPUArchState {
uint64_t kvm_timer_state;
uint64_t kvm_timer_frequency;
#endif /* CONFIG_KVM */
-
- /* RNMI */
- uint64_t mnscratch;
- uint64_t mnepc;
- uint64_t mncause; /* mncause without bit XLEN-1 set to 1 */
- uint64_t mnstatus;
- uint64_t rnmip;
- uint64_t rnmi_irqvec;
- uint64_t rnmi_excpvec;
};
/*