lib: sbi_trap: Set hstatus.GVA when going to HS-mode
authorVivian Wang <dramforever@live.com>
Thu, 4 Aug 2022 14:32:31 +0000 (22:32 +0800)
committerAnup Patel <anup@brainfault.org>
Mon, 22 Aug 2022 03:20:23 +0000 (08:50 +0530)
commita69eb6cc65a16f26455bfb5b7cab768ac891bc1d
tree6d677f435335bd5912494b704fac50f3971df5b3
parent5a0ca098f176fd5b84d311e82543a05aaab8cafb
lib: sbi_trap: Set hstatus.GVA when going to HS-mode

The privileged spec specifies that on a trap to HS-mode, hstatus.GVA
should be set to 1 if stval is written with a guest virtual address, and
to 0 otherwise. Implement this by setting hstatus.GVA to trap->gva when
redirecting traps to HS-mode.

Signed-off-by: Vivian Wang <dramforever@live.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
lib/sbi/sbi_trap.c