From patchwork Wed Apr 21 05:57:24 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshiaki Tamura X-Patchwork-Id: 93821 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3L62Lmq005310 for ; Wed, 21 Apr 2010 06:02:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752349Ab0DUGCZ (ORCPT ); Wed, 21 Apr 2010 02:02:25 -0400 Received: from sh.osrg.net ([192.16.179.4]:58795 "EHLO sh.osrg.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752228Ab0DUGCI (ORCPT ); Wed, 21 Apr 2010 02:02:08 -0400 Received: from fs.osrg.net (postfix@fs.osrg.net [10.0.0.12]) by sh.osrg.net (8.14.3/8.14.3/OSRG-NET) with ESMTP id o3L61Qhd004086; Wed, 21 Apr 2010 15:01:27 +0900 Received: from localhost (hype-wd0.osrg.net [10.72.1.16]) by fs.osrg.net (Postfix) with ESMTP id 556053E0300; Wed, 21 Apr 2010 15:01:25 +0900 (JST) From: Yoshiaki Tamura To: kvm@vger.kernel.org, qemu-devel@nongnu.org Cc: avi@redhat.com, aliguori@us.ibm.com, mtosatti@redhat.com, ohmura.kei@lab.ntt.co.jp, yoshikawa.takuya@oss.ntt.co.jp, Yoshiaki Tamura Subject: [RFC PATCH 19/20] Insert do_event_tap() to virtio-{blk, net}, comment out assert() on cpu_single_env temporally. Date: Wed, 21 Apr 2010 14:57:24 +0900 Message-Id: <1271829445-5328-20-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> X-Mailer: git-send-email 1.7.0.31.g1df487 In-Reply-To: <1271829445-5328-1-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> References: <1271829445-5328-1-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> X-Dispatcher: imput version 20070423(IM149) Lines: 75 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 21 Apr 2010 06:02:48 +0000 (UTC) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (sh.osrg.net [192.16.179.4]); Wed, 21 Apr 2010 15:01:27 +0900 (JST) X-Virus-Scanned: clamav-milter 0.95.3 at sh X-Virus-Status: Clean Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c index b80402d..1dd1c31 100644 --- a/hw/virtio-blk.c +++ b/hw/virtio-blk.c @@ -327,6 +327,8 @@ static void virtio_blk_handle_output(VirtIODevice *vdev, VirtQueue *vq) .old_bs = NULL, }; + do_event_tap(); + while ((req = virtio_blk_get_request(s))) { virtio_blk_handle_request(req, &mrb); } diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 5c0093e..1a32bf3 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c @@ -667,6 +667,8 @@ static void virtio_net_handle_tx(VirtIODevice *vdev, VirtQueue *vq) { VirtIONet *n = to_virtio_net(vdev); + do_event_tap(); + if (n->tx_timer_active) { virtio_queue_set_notification(vq, 1); qemu_del_timer(n->tx_timer); diff --git a/qemu-kvm.c b/qemu-kvm.c index 1414f49..769bc95 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -935,8 +935,12 @@ int kvm_run(CPUState *env) post_kvm_run(kvm, env); + /* TODO: we need to prevent tapping events that derived from the + * same VMEXIT. This needs more info from the kernel. */ #if defined(KVM_CAP_COALESCED_MMIO) if (kvm_state->coalesced_mmio) { + /* prevent from tapping events while handling coalesced_mmio */ + event_tap_suspend(); struct kvm_coalesced_mmio_ring *ring = (void *) run + kvm_state->coalesced_mmio * PAGE_SIZE; while (ring->first != ring->last) { @@ -946,6 +950,7 @@ int kvm_run(CPUState *env) smp_wmb(); ring->first = (ring->first + 1) % KVM_COALESCED_MMIO_MAX; } + event_tap_resume(); } #endif @@ -1770,7 +1775,7 @@ static void resume_all_threads(void) { CPUState *penv = first_cpu; - assert(!cpu_single_env); + /* assert(!cpu_single_env); */ while (penv) { penv->stop = 0;