The riscv target incorrectly enabled semihosting always, whether the
user asked for it or not. Call semihosting_enabled() passing the
correct value to the is_userspace argument, which fixes this and also
handles the userspace=on argument. Because we do this at translate
time, we no longer need to check the privilege level in
riscv_cpu_do_interrupt().
Note that this is a behaviour change: we used to default to
semihosting being enabled, and now the user must pass
"-semihosting-config enable=on" if they want it.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
target/riscv/cpu_helper.c | 9 +++------
target/riscv/translate.c | 1 +
target/riscv/insn_trans/trans_privileged.c.inc | 3 ++-
3 files changed, 6 insertions(+), 7 deletions(-)