From 7ceb984b60631d73116ffcb6538bde15e4014e4a Mon Sep 17 00:00:00 2001 From: Alistair Francis Date: Mon, 8 Mar 2021 13:22:46 -0500 Subject: [PATCH] target/riscv: Don't allow guest to write to htinst Backports e2eb5ca8f66c239f6194afda88cad455e42725ef --- qemu/target/riscv/csr.c | 1 - qemu/target/riscv/op_helper.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu/target/riscv/csr.c b/qemu/target/riscv/csr.c index 32be12e1..cf6f02ea 100644 --- a/qemu/target/riscv/csr.c +++ b/qemu/target/riscv/csr.c @@ -925,7 +925,6 @@ static int read_htinst(CPURISCVState *env, int csrno, target_ulong *val) static int write_htinst(CPURISCVState *env, int csrno, target_ulong val) { - env->htinst = val; return 0; } diff --git a/qemu/target/riscv/op_helper.c b/qemu/target/riscv/op_helper.c index 2219f994..c65223b9 100644 --- a/qemu/target/riscv/op_helper.c +++ b/qemu/target/riscv/op_helper.c @@ -22,6 +22,7 @@ #include "cpu.h" #include "exec/exec-all.h" #include "exec/helper-proto.h" +#include "exec/cpu_ldst.h" /* Exceptions processing helpers */ void QEMU_NORETURN riscv_raise_exception(CPURISCVState *env,