Files
gem5/src/arch/riscv
Jui-Min Lee afd3e17f17 arch-riscv: Fix WFI race condition
Current WFI implementation always put the CPU to sleep even if there's
an pending interrupt. This might cause issue because an interrupt might
happen just before the WFI is executed, and there might not be any
further interrupts to wake the CPU up, so the CPU sleeps indefinitely.

In this CL, we ensure the CPU sleeps only if there's no pending
interrupt at all, regardless whether the interrupt is masked or not. We
intentionally check for masked interrupt as well because a masked
interrupt is also able to wake the CPU up if it occurs after WFI. This
will make the behavior consistent no matter the interrupt comes before
or after WFI.

Change-Id: I74dbc01fed52652101675f1ae8e481b77c932088
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62251
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
2022-08-11 02:36:11 +00:00
..
2022-08-11 02:36:11 +00:00
2022-06-20 04:03:52 +00:00
2022-07-21 06:40:59 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2021-09-03 16:54:56 +00:00
2022-06-20 04:03:52 +00:00
2021-07-01 19:08:24 +00:00
2022-06-20 04:04:05 +00:00
2022-07-08 00:08:01 +00:00
2022-06-20 04:03:52 +00:00
2021-07-01 19:08:24 +00:00
2021-09-09 15:01:38 +00:00
2021-07-01 19:08:24 +00:00