The most significant bit should be set based on interrupt or exception. I assume in current RV64 implementation the bit should be 63rd, rather than 31st. This causes interrupt handler to get invalid cause code. Minor bug is for the mpie is suppossed to be set to the value of old mie. The fix is verified in FS. Jira Issue: https://gem5.atlassian.net/browse/GEM5-858 Change-Id: I1cc166c254b35f5c1acb3f5774c43149c61cc37a Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38755 Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Maintainer: Jason Lowe-Power <power.jg@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>