[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH stable-0.15 07/36] kvm: avoid reentring kvm_flush_co
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH stable-0.15 07/36] kvm: avoid reentring kvm_flush_coalesced_mmio_buffer() |
Date: |
Wed, 28 Mar 2012 14:52:10 +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>
(cherry picked from commit 1cae88b9f4121c9af0bf677435c6129e643280fd)
Signed-off-by: Bruce Rogers <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
kvm-all.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/kvm-all.c b/kvm-all.c
index cbc2532..26621d0 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.7
- [Qemu-devel] [PATCH stable-0.15 00/36] Preparing 0.15.2, Andreas Färber, 2012/03/28
- [Qemu-devel] [PATCH stable-0.15 01/36] ccid: Fix buffer overrun in handling of VSC_ATR message, Andreas Färber, 2012/03/28
- [Qemu-devel] [PATCH stable-0.15 13/36] Fix X86 CPU topology in KVM mode, Andreas Färber, 2012/03/28
- [Qemu-devel] [PATCH stable-0.15 07/36] kvm: avoid reentring kvm_flush_coalesced_mmio_buffer(),
Andreas Färber <=
- [Qemu-devel] [PATCH stable-0.15 10/36] ide: Fix off-by-one error in array index check, Andreas Färber, 2012/03/28
- [Qemu-devel] [PATCH stable-0.15 11/36] acl: Fix use after free in qemu_acl_reset(), Andreas Färber, 2012/03/28
- [Qemu-devel] [PATCH stable-0.15 09/36] block: Fix bdrv_open use after free, Andreas Färber, 2012/03/28
- [Qemu-devel] [PATCH stable-0.15 35/36] Add missing trace call to oslib-posix.c:qemu_vmalloc(), Andreas Färber, 2012/03/28
- [Qemu-devel] [PATCH stable-0.15 03/36] e1000: use MII status register for link up/down, Andreas Färber, 2012/03/28
- [Qemu-devel] [PATCH stable-0.15 02/36] qdev: Reset hot-plugged devices, Andreas Färber, 2012/03/28
- [Qemu-devel] [PATCH stable-0.15 04/36] e1000: Don't set the Capabilities List bit, Andreas Färber, 2012/03/28
- [Qemu-devel] [PATCH stable-0.15 16/36] vvfat: Fix potential buffer overflow, Andreas Färber, 2012/03/28
- [Qemu-devel] [PATCH stable-0.15 25/36] block: Fix vpc initialization of the Dynamic Disk Header, Andreas Färber, 2012/03/28
- [Qemu-devel] [PATCH stable-0.15 15/36] ac97: don't override the pci subsystem id, Andreas Färber, 2012/03/28