misa_csr_t::unlogged_write() re-gates EXT_ZAAMO and EXT_ZALRSC whenever software writes misa, so the base atomics correctly become illegal once misa.A is cleared. EXT_ZABHA and EXT_ZACAS should be added to that list I believe.
A byte or halfword AMO, or a compare-and-swap, therefore keeps executing after misa.A reads zero.
I cannot share the test (its long ) but these are the relevant prints.
misa before 0x8000000000141101 A=1
misa after 0x8000000000141100 A=0
control OK: misa.A really is clear
amoadd.b returned 0x0000000000000000, cell is now 0x0000000000000001
BUG: amoadd.b executed with misa.A clear
exit=1
while the expected (I believe) should be "IllegalInstruction (mcause = 2)".
misa_csr_t::unlogged_write()re-gatesEXT_ZAAMOandEXT_ZALRSCwhenever software writesmisa, so the base atomics correctly become illegal oncemisa.Ais cleared.EXT_ZABHAandEXT_ZACASshould be added to that list I believe.A byte or halfword AMO, or a compare-and-swap, therefore keeps executing after
misa.Areads zero.I cannot share the test (its long ) but these are the relevant prints.
while the expected (I believe) should be "
IllegalInstruction(mcause = 2)".