arch-riscv: fix incorrect interrupt checking logic
authorCui Jin <cuijin7@huawei.com>
Wed, 13 Jan 2021 02:36:56 +0000 (10:36 +0800)
committerCui Jin <cuijin7@huawei.com>
Mon, 18 Jan 2021 01:46:40 +0000 (01:46 +0000)
commite8b37cc5034100616e1d33cc14ce5be45db65eb6
treef8d2aeae1df4f941dba05aac7087d2ef0f8dbe96
parent3a8df68388d4e4bd1b9d6061c4bb5e41d12c3aeb
arch-riscv: fix incorrect interrupt checking logic

Whether global interrupt enabling or not is not simply decided by
xIE bit in mstatus, it also depends on current privilige level.
All level lower/higher than current should be disabled/enabled
regardless of the xIE bit. xIE bit is only control the enabling
of interrupt in current privilige level.

The fix is verified in FS.

Jira Issue: https://gem5.atlassian.net/browse/GEM5-883

Change-Id: I37f83ab77af2efbf1da9b81845828d322e49bf5f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39035
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Ayaz Akram <yazakram@ucdavis.edu>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/riscv/interrupts.hh