[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/6] kvm: avoid reentring kvm_flush_coalesced_mmio_b
From: |
Marcelo Tosatti |
Subject: |
[Qemu-devel] [PATCH 3/6] kvm: avoid reentring kvm_flush_coalesced_mmio_buffer() |
Date: |
Thu, 27 Oct 2011 10:10:16 -0200 |
From: Avi Kivity <address@hidden>
mmio callbacks invoked by kvm_flush_coalesced_mmio_buffer() may
themselves indirectly call kvm_flush_coalesced_mmio_buffer().
Prevent reentering the function by checking a flag that indicates
we're processing coalesced mmio requests.
Signed-off-by: Avi Kivity <address@hidden>
---
kvm-all.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/kvm-all.c b/kvm-all.c
index e7faf5c..c09ddf7 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -64,6 +64,7 @@ struct KVMState
int vmfd;
int coalesced_mmio;
struct kvm_coalesced_mmio_ring *coalesced_mmio_ring;
+ bool coalesced_flush_in_progress;
int broken_set_mem_region;
int migration_log;
int vcpu_events;
@@ -876,6 +877,13 @@ static int kvm_handle_internal_error(CPUState *env, struct
kvm_run *run)
void kvm_flush_coalesced_mmio_buffer(void)
{
KVMState *s = kvm_state;
+
+ if (s->coalesced_flush_in_progress) {
+ return;
+ }
+
+ s->coalesced_flush_in_progress = true;
+
if (s->coalesced_mmio_ring) {
struct kvm_coalesced_mmio_ring *ring = s->coalesced_mmio_ring;
while (ring->first != ring->last) {
@@ -888,6 +896,8 @@ void kvm_flush_coalesced_mmio_buffer(void)
ring->first = (ring->first + 1) % KVM_COALESCED_MMIO_MAX;
}
}
+
+ s->coalesced_flush_in_progress = false;
}
static void do_kvm_cpu_synchronize_state(void *_env)
--
1.7.5.4
- [Qemu-devel] [PATCH 0/6] [PULL] qemu-kvm.git uq/master queue, Marcelo Tosatti, 2011/10/27
- [Qemu-devel] [PATCH 3/6] kvm: avoid reentring kvm_flush_coalesced_mmio_buffer(),
Marcelo Tosatti <=
- [Qemu-devel] [PATCH 1/6] kvm: Add tool for querying VMX capabilities, Marcelo Tosatti, 2011/10/27
- [Qemu-devel] [PATCH 6/6] i386: wire up MSR_IA32_MISC_ENABLE, Marcelo Tosatti, 2011/10/27
- [Qemu-devel] [PATCH 4/6] Revert "kvm: support TSC deadline MSR", Marcelo Tosatti, 2011/10/27
- [Qemu-devel] [PATCH 5/6] kvm: support TSC deadline MSR with subsection, Marcelo Tosatti, 2011/10/27
- [Qemu-devel] [PATCH 2/6] kvm: Add top-like kvm statistics script, Marcelo Tosatti, 2011/10/27
- Re: [Qemu-devel] [PATCH 0/6] [PULL] qemu-kvm.git uq/master queue, Anthony Liguori, 2011/10/31