[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 3/9] Allow to use pause_all_vcpus from VCPU conte
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [PATCH v3 3/9] Allow to use pause_all_vcpus from VCPU context |
Date: |
Tue, 14 Feb 2012 16:13:09 +0100 |
In order to perform critical manipulations on the VM state in the
context of a VCPU, specifically code patching, stopping and resuming of
all VCPUs may be necessary. resume_all_vcpus is already compatible, now
enable pause_all_vcpus for this use case by stopping the calling context
before starting to wait for the whole gang.
CC: Paolo Bonzini <address@hidden>
Signed-off-by: Jan Kiszka <address@hidden>
---
cpus.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/cpus.c b/cpus.c
index 4e65894..290daa8 100644
--- a/cpus.c
+++ b/cpus.c
@@ -870,6 +870,18 @@ void pause_all_vcpus(void)
penv = penv->next_cpu;
}
+ if (!qemu_thread_is_self(&io_thread)) {
+ cpu_stop_current();
+ if (!kvm_enabled()) {
+ while (penv) {
+ penv->stop = 0;
+ penv->stopped = 1;
+ penv = penv->next_cpu;
+ }
+ return;
+ }
+ }
+
while (!all_vcpus_paused()) {
qemu_cond_wait(&qemu_pause_cond, &qemu_global_mutex);
penv = first_cpu;
--
1.7.3.4
- [Qemu-devel] [PATCH v3 5/9] kvmvapic: Add option ROM, (continued)
- [Qemu-devel] [PATCH v3 5/9] kvmvapic: Add option ROM, Jan Kiszka, 2012/02/14
- [Qemu-devel] [PATCH v3 8/9] optionsrom: Reserve space for checksum, Jan Kiszka, 2012/02/14
- [Qemu-devel] [PATCH v3 1/9] kvm: Set cpu_single_env only once, Jan Kiszka, 2012/02/14
- [Qemu-devel] [PATCH v3 6/9] kvmvapic: Introduce TPR access optimization for Windows guests, Jan Kiszka, 2012/02/14
- [Qemu-devel] [PATCH v3 4/9] target-i386: Add infrastructure for reporting TPR MMIO accesses, Jan Kiszka, 2012/02/14
- [Qemu-devel] [PATCH v3 7/9] kvmvapic: Simplify mp/up_set_tpr, Jan Kiszka, 2012/02/14
- [Qemu-devel] [PATCH v3 9/9] kvmvapic: Use optionrom helpers, Jan Kiszka, 2012/02/14
- [Qemu-devel] [PATCH v3 3/9] Allow to use pause_all_vcpus from VCPU context,
Jan Kiszka <=