summaryrefslogtreecommitdiff
path: root/lib/sbi/sbi_expected_trap.S
AgeCommit message (Collapse)Author
2025-12-26lib: sbi: expected trap must always clear MPRVDeepak Gupta
Expected trap must always clear MPRV. Currently it doesn't. There is a security issue here where if firmware was doing ld/st with MPRV=1 and since there would be a expected trap, opensbi will continue to run as MPRV=1. Security impact is DoS where opensbi will just keep trapping. Signed-off-by: Deepak Gupta <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
2024-03-19lib: sbi: Remove epc from struct sbi_trap_infoSamuel Holland
In the only places this value is used, it duplicates mepc from struct sbi_trap_regs. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2022-10-23lib: sbi: Fix typo in commentYu Chien Peter Lin
%s/is is/is Signed-off-by: Yu Chien Peter Lin <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2022-08-22lib: sbi_trap: Save mstatus[h].GVA in trap->gvaVivian Wang
The machine mode GVA field is available if the hypervisor extension is implemented, and indicates if mtval is a guest virtual address. Add a gva field to sbi_trap_info for this, and in __sbi_expected_trap_hext, save mstatus[h].GVA to it, so that gva indicates if tval is a guest virtual address. If the hypervisor extension is not implemented, always set gva to 0. Signed-off-by: Vivian Wang <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2020-05-10lib: Rename unprivileged trap handlerAtish Patra
Unprivileged trap handler can be reused for any cases where the executing code expects a trap. Rename it to "expected" trap handler as it will be used in other cases in future. Signed-off-by: Atish Patra <[email protected]> Tested-by: Jonathan Balkind <[email protected]> Reviewed-by: Anup Patel <[email protected]>