arch-riscv: fix the wrong cause register setting
authorCui Jin <cuijin7@huawei.com>
Thu, 31 Dec 2020 08:17:35 +0000 (16:17 +0800)
committerCui Jin <cuijin7@huawei.com>
Wed, 6 Jan 2021 01:18:15 +0000 (01:18 +0000)
commit8c3658939df1ec0866fcc24935acafc19c18a2c3
tree5146d097e5364f5fb70145c75d8e6f66f5936e80
parent3059c6df5c3d6e951a4e85f2b83e2cfaa6a46bbb
arch-riscv: fix the wrong cause register setting

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>
src/arch/riscv/faults.cc