qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 5/8] kvm: Switch to unlocked PIO


From: Paolo Bonzini
Subject: [Qemu-devel] [PATCH 5/8] kvm: Switch to unlocked PIO
Date: Wed, 18 Mar 2015 14:21:46 +0100

From: Jan Kiszka <address@hidden>

Do not take the BQL before dispatching PIO requests of KVM VCPUs.
Instead, call the unlocked version of address_space_rw. This enables
completely BQL-free PIO handling in KVM mode for upcoming devices with
fine-grained locking.

Signed-off-by: Jan Kiszka <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
 kvm-all.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/kvm-all.c b/kvm-all.c
index 8da1deb..2848e5b 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1647,8 +1647,8 @@ static void kvm_handle_io(uint16_t port, void *data, int 
direction, int size,
     uint8_t *ptr = data;
 
     for (i = 0; i < count; i++) {
-        address_space_rw(&address_space_io, port, ptr, size,
-                         direction == KVM_EXIT_IO_OUT);
+        address_space_rw_unlocked(&address_space_io, port, ptr, size,
+                                  direction == KVM_EXIT_IO_OUT);
         ptr += size;
     }
 }
@@ -1804,13 +1804,11 @@ int kvm_cpu_exec(CPUState *cpu)
         switch (run->exit_reason) {
         case KVM_EXIT_IO:
             DPRINTF("handle_io\n");
-            qemu_mutex_lock_iothread();
             kvm_handle_io(run->io.port,
                           (uint8_t *)run + run->io.data_offset,
                           run->io.direction,
                           run->io.size,
                           run->io.count);
-            qemu_mutex_unlock_iothread();
             ret = 0;
             break;
         case KVM_EXIT_MMIO:
-- 
2.3.0





reply via email to

[Prev in Thread] Current Thread [Next in Thread]