[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 09/47] target/riscv: Use QEMU_IOTHREAD_LOCK_GUARD in riscv_cpu_upd
From: |
Richard Henderson |
Subject: |
[PULL 09/47] target/riscv: Use QEMU_IOTHREAD_LOCK_GUARD in riscv_cpu_update_mip |
Date: |
Thu, 29 Dec 2022 16:01:43 -0800 |
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/riscv/cpu_helper.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
index 278d163803..241d06bab8 100644
--- a/target/riscv/cpu_helper.c
+++ b/target/riscv/cpu_helper.c
@@ -610,7 +610,6 @@ uint64_t riscv_cpu_update_mip(RISCVCPU *cpu, uint64_t mask,
uint64_t value)
CPURISCVState *env = &cpu->env;
CPUState *cs = CPU(cpu);
uint64_t gein, vsgein = 0, vstip = 0, old = env->mip;
- bool locked = false;
if (riscv_cpu_virt_enabled(env)) {
gein = get_field(env->hstatus, HSTATUS_VGEIN);
@@ -621,10 +620,7 @@ uint64_t riscv_cpu_update_mip(RISCVCPU *cpu, uint64_t
mask, uint64_t value)
mask = ((mask == MIP_VSTIP) && env->vstime_irq) ? 0 : mask;
vstip = env->vstime_irq ? MIP_VSTIP : 0;
- if (!qemu_mutex_iothread_locked()) {
- locked = true;
- qemu_mutex_lock_iothread();
- }
+ QEMU_IOTHREAD_LOCK_GUARD();
env->mip = (env->mip & ~mask) | (value & mask);
@@ -634,10 +630,6 @@ uint64_t riscv_cpu_update_mip(RISCVCPU *cpu, uint64_t
mask, uint64_t value)
cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD);
}
- if (locked) {
- qemu_mutex_unlock_iothread();
- }
-
return old;
}
--
2.34.1
- [PULL 00/47] tcg patch queue, Richard Henderson, 2022/12/29
- [PULL 02/47] meson: Move CONFIG_TCG_INTERPRETER to config_host, Richard Henderson, 2022/12/29
- [PULL 05/47] qemu/main-loop: Introduce QEMU_IOTHREAD_LOCK_GUARD, Richard Henderson, 2022/12/29
- [PULL 06/47] hw/mips: Use QEMU_IOTHREAD_LOCK_GUARD in cpu_mips_irq_request, Richard Henderson, 2022/12/29
- [PULL 04/47] tcg: Cleanup trailing whitespace, Richard Henderson, 2022/12/29
- [PULL 09/47] target/riscv: Use QEMU_IOTHREAD_LOCK_GUARD in riscv_cpu_update_mip,
Richard Henderson <=
- [PULL 03/47] tcg/s390x: Fix coding style, Richard Henderson, 2022/12/29
- [PULL 01/47] tcg: convert tcg/README to rst, Richard Henderson, 2022/12/29
- [PULL 07/47] target/ppc: Use QEMU_IOTHREAD_LOCK_GUARD in ppc_maybe_interrupt, Richard Henderson, 2022/12/29
- [PULL 15/47] tcg: Fix tcg_reg_alloc_dup*, Richard Henderson, 2022/12/29
- [PULL 08/47] target/ppc: Use QEMU_IOTHREAD_LOCK_GUARD in cpu_interrupt_exittb, Richard Henderson, 2022/12/29
- [PULL 11/47] accel/tcg: Use QEMU_IOTHREAD_LOCK_GUARD in io_readx/io_writex, Richard Henderson, 2022/12/29
- [PULL 12/47] tcg: Tidy tcg_reg_alloc_op, Richard Henderson, 2022/12/29
- [PULL 13/47] tcg: Remove TCG_TARGET_STACK_GROWSUP, Richard Henderson, 2022/12/29
- [PULL 10/47] hw/ppc: Use QEMU_IOTHREAD_LOCK_GUARD in ppc_set_irq, Richard Henderson, 2022/12/29
- [PULL 16/47] tcg: Centralize updates to reg_to_temp, Richard Henderson, 2022/12/29