lib: sbi_hsm: Use csr_set to restore the MIP
authorNick Hu <nick.hu@sifive.com>
Tue, 17 Jan 2023 08:14:28 +0000 (16:14 +0800)
committerAnup Patel <anup@brainfault.org>
Wed, 8 Feb 2023 05:09:21 +0000 (10:39 +0530)
commit84d15f4f529c92d3f32fbc570c02f7d40e9e70cb
tree64289a8185500e0b15f662baefefa8b4b216923f
parent8050081f68b2b66f8937b15a6753ec6408c2fdee
lib: sbi_hsm: Use csr_set to restore the MIP

If we use the csr_write to restore the MIP, we may clear the SEIP.
In generic behavior of QEMU, if the pending bits of PLIC are set and we
clear the SEIP, the QEMU may not set it back immediately. It may cause
the interrupts won't be handled anymore until the new interrupts arrived
and QEMU set the bits back.

Signed-off-by: Nick Hu <nick.hu@sifive.com>
Signed-off-by: Jim Shu <jim.shu@sifive.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
lib/sbi/sbi_hsm.c