@@ -2743,6 +2743,12 @@ static RISCVException rmw_mip(CPURISCVState *env, int csrno,
uint64_t rval;
RISCVException ret;
+ /* The xip CSR appears hardwired to zero in CLIC mode. */
+ if (riscv_clic_is_clic_mode(env)) {
+ *ret_val = 0;
+ return RISCV_EXCP_NONE;
+ }
+
ret = rmw_mip64(env, csrno, &rval, new_val, wr_mask);
if (ret_val) {
*ret_val = rval;
@@ -3294,6 +3300,12 @@ static RISCVException rmw_sip64(CPURISCVState *env, int csrno,
}
ret = rmw_vsip64(env, CSR_VSIP, ret_val, new_val, wr_mask);
} else {
+ /* The xip CSR appears hardwired to zero in CLIC mode. */
+ if (riscv_clic_is_clic_mode(env)) {
+ *ret_val = 0;
+ return RISCV_EXCP_NONE;
+ }
+
ret = rmw_mvip64(env, csrno, ret_val, new_val, wr_mask & mask);
}