Abner Chang
e6042aec1b
BaseLib:Fix RISC-V Supervisor mode (S-Mode) trap handler reentry issue.
...
While RISC-V hart is trapped into S-Mode, the S-Mode interrupt
CSR (SIE) is disabled by RISC-V hart. However the (SIE) is enabled
again by RestoreTPL, this causes the second S-Mode trap is triggered
by the machine mode (M-Mode)timer interrupt redirection. The SRET
instruction clear Supervisor Previous Privilege (SPP) to zero
(User mode) in the second S-Mode interrupt according to the RISC-V
spec. Above brings hart to the user mode (U-Mode) when execute
SRET in the nested S-Mode interrupt handler because SPP is set to
User Mode in the second interrupt. Afterward, system runs in U-Mode
and any accesses to S-Mode CSR causes the invalid instruction exception.
Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Abner Chang <abner.chang@hpe.com>
Acked-by: Liming Gao <liming.gao@intel.com>
2020-08-12 04:01:39 +00:00
..
2020-05-07 03:17:15 +00:00
2020-07-15 05:25:21 +00:00
2020-05-07 03:17:15 +00:00
2020-07-15 05:25:21 +00:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2020-05-07 03:17:15 +00:00
2020-08-12 04:01:39 +00:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2020-08-06 20:20:40 +00:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2020-06-24 05:46:27 +00:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2020-05-07 03:17:15 +00:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2020-06-16 09:14:17 +00:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-11-14 01:32:15 +00:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2020-05-07 03:17:15 +00:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2020-07-15 05:25:21 +00:00
2020-05-07 03:17:15 +00:00
2019-04-09 10:58:13 -07:00
2019-08-13 17:16:14 +08:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2020-02-10 22:30:07 +00:00
2020-02-10 22:30:07 +00:00
2019-09-02 12:17:56 +08:00
2020-02-10 22:30:07 +00:00
2020-02-10 22:30:07 +00:00
2020-01-10 03:25:59 +00:00
2020-02-10 22:30:07 +00:00
2020-04-03 17:09:12 +00:00
2020-02-10 22:30:07 +00:00
2020-02-10 22:30:07 +00:00
2019-04-09 10:58:13 -07:00
2020-02-10 22:30:07 +00:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-28 09:40:12 +08:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2020-02-10 22:30:07 +00:00
2019-04-09 10:58:13 -07:00
2020-02-10 22:30:07 +00:00
2020-02-10 22:30:07 +00:00
2020-02-10 22:30:07 +00:00
2020-02-10 22:30:07 +00:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2020-01-10 03:25:59 +00:00
2020-01-10 03:25:59 +00:00
2020-01-10 03:25:59 +00:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-11-04 08:52:57 +08:00
2019-11-20 15:03:24 +00:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2019-04-09 10:58:13 -07:00
2020-01-10 03:25:59 +00:00
2019-04-09 10:58:13 -07:00
2020-04-15 01:13:04 +00:00
2019-04-09 10:58:13 -07:00