[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 30/36] cpus-common: assert BQL nesting within cpu-exc
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 30/36] cpus-common: assert BQL nesting within cpu-exclusive sections |
Date: |
Tue, 20 Aug 2019 08:59:49 +0200 |
From: Roman Kagan <address@hidden>
Assert that the cpu-exclusive sections are never entered/left with the
BQL taken.
Signed-off-by: Roman Kagan <address@hidden>
Message-Id: <address@hidden>
---
cpus-common.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/cpus-common.c b/cpus-common.c
index 023cfeb..9aa75fe 100644
--- a/cpus-common.c
+++ b/cpus-common.c
@@ -174,6 +174,7 @@ void start_exclusive(void)
CPUState *other_cpu;
int running_cpus;
+ assert(!qemu_mutex_iothread_locked());
qemu_mutex_lock(&qemu_cpu_list_lock);
exclusive_idle();
@@ -205,6 +206,7 @@ void start_exclusive(void)
/* Finish an exclusive operation. */
void end_exclusive(void)
{
+ assert(!qemu_mutex_iothread_locked());
qemu_mutex_lock(&qemu_cpu_list_lock);
atomic_set(&pending_cpus, 0);
qemu_cond_broadcast(&exclusive_resume);
@@ -214,6 +216,7 @@ void end_exclusive(void)
/* Wait for exclusive ops to finish, and begin cpu execution. */
void cpu_exec_start(CPUState *cpu)
{
+ assert(!qemu_mutex_iothread_locked());
atomic_set(&cpu->running, true);
/* Write cpu->running before reading pending_cpus. */
@@ -255,6 +258,7 @@ void cpu_exec_start(CPUState *cpu)
/* Mark cpu as not executing, and release pending exclusive ops. */
void cpu_exec_end(CPUState *cpu)
{
+ assert(!qemu_mutex_iothread_locked());
atomic_set(&cpu->running, false);
/* Write cpu->running before reading pending_cpus. */
--
1.8.3.1
- [Qemu-devel] [PULL 07/36] configure: Define target access alignment in configure, (continued)
- [Qemu-devel] [PULL 07/36] configure: Define target access alignment in configure, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 06/36] memory: assert on out of scope notification, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 08/36] block: fix NetBSD qemu-iotests failure, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 10/36] target-i386: kvm: 'kvm_get_supported_msrs' cleanup, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 11/36] test-throttle: Fix uninitialized use of burst_length, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 09/36] 9p: simplify source file selection, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 13/36] i386/kvm: initialize struct at full before ioctl call, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 21/36] replay: add missing fix for internal function, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 24/36] replay: fix replay shutdown, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 22/36] replay: document development rules, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 30/36] cpus-common: assert BQL nesting within cpu-exclusive sections,
Paolo Bonzini <=
- [Qemu-devel] [PULL 31/36] kvm: vmxcap: Enhance with latest features, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 16/36] mc146818rtc: Remove reset notifiers, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 15/36] memory: fix race between TCG and accesses to dirty bitmap, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 17/36] timer: Remove reset notifiers, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 12/36] tests: Fix uninitialized byte in test_visitor_in_fuzz, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 14/36] target/i386: Return 'indefinite integer value' for invalid SSE fp->int conversions, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 19/36] timer: last, remove last bits of last, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 20/36] kconfig: do not select VMMOUSE, Paolo Bonzini, 2019/08/20
- [Qemu-devel] [PULL 18/36] replay: Remove host_clock_last, Paolo Bonzini, 2019/08/20