diff options
| -rw-r--r-- | hw/core/cpu-common.c | 12 | ||||
| -rw-r--r-- | include/hw/core/cpu.h | 1 | ||||
| -rw-r--r-- | system/cpus.c | 3 |
3 files changed, 2 insertions, 14 deletions
diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 259cf2a3c3..152abc9024 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -67,19 +67,9 @@ CPUState *cpu_create(const char *typename) return cpu; } -/* Resetting the IRQ comes from across the code base so we take the - * BQL here if we need to. cpu_interrupt assumes it is held.*/ void cpu_reset_interrupt(CPUState *cpu, int mask) { - bool need_lock = !bql_locked(); - - if (need_lock) { - bql_lock(); - } - cpu->interrupt_request &= ~mask; - if (need_lock) { - bql_unlock(); - } + qatomic_and(&cpu->interrupt_request, ~mask); } void cpu_exit(CPUState *cpu) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index b01a0cffd6..23bd02277f 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -495,7 +495,6 @@ struct CPUState { bool exit_request; int exclusive_context_count; uint32_t cflags_next_tb; - /* updates protected by BQL */ uint32_t interrupt_request; int singlestep_enabled; int64_t icount_budget; diff --git a/system/cpus.c b/system/cpus.c index 437848b5eb..9bfbe2b060 100644 --- a/system/cpus.c +++ b/system/cpus.c @@ -257,8 +257,7 @@ int64_t cpus_get_elapsed_ticks(void) void cpu_set_interrupt(CPUState *cpu, int mask) { /* Pairs with cpu_test_interrupt(). */ - qatomic_store_release(&cpu->interrupt_request, - cpu->interrupt_request | mask); + qatomic_or(&cpu->interrupt_request, mask); } void generic_handle_interrupt(CPUState *cpu, int mask) |