target/riscv: raise exception to HS-mode at get_physical_address
commit33a9a57d2c31ec9ed68858911dc490b5de15f342
authorYifei Jiang <jiangyifei@huawei.com>
Wed, 14 Oct 2020 10:17:28 +0000 (14 18:17 +0800)
committerAlistair Francis <alistair.francis@wdc.com>
Thu, 22 Oct 2020 19:00:22 +0000 (22 12:00 -0700)
tree8bd77284ba8e8e1ab3e09089040d24f4f25cbc55
parent38bc4e34f29b913d28a8d2abcf2bf74a4a4a816e
target/riscv: raise exception to HS-mode at get_physical_address

VS-stage translation at get_physical_address needs to translate pte
address by G-stage translation. But the G-stage translation error
can not be distinguished from VS-stage translation error in
riscv_cpu_tlb_fill. On migration, destination needs to rebuild pte,
and this G-stage translation error must be handled by HS-mode. So
introduce TRANSLATE_STAGE2_FAIL so that riscv_cpu_tlb_fill could
distinguish and raise it to HS-mode.

Signed-off-by: Yifei Jiang <jiangyifei@huawei.com>
Signed-off-by: Yipeng Yin <yinyipeng1@huawei.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 20201014101728.848-1-jiangyifei@huawei.com
[ Change by AF:
 - Clarify the fault_pte_addr shift
]
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/cpu.h
target/riscv/cpu_helper.c