From patchwork Wed Jul 29 17:49:11 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glauber Costa X-Patchwork-Id: 38203 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6THnbPi032673 for ; Wed, 29 Jul 2009 17:49:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751508AbZG2RtX (ORCPT ); Wed, 29 Jul 2009 13:49:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751493AbZG2RtX (ORCPT ); Wed, 29 Jul 2009 13:49:23 -0400 Received: from mx2.redhat.com ([66.187.237.31]:57762 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751441AbZG2RtV (ORCPT ); Wed, 29 Jul 2009 13:49:21 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n6THnMov032732 for ; Wed, 29 Jul 2009 13:49:22 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n6THnKCR027911; Wed, 29 Jul 2009 13:49:21 -0400 Received: from localhost.localdomain (virtlab1.virt.bos.redhat.com [10.16.72.21]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n6THnJhl017691; Wed, 29 Jul 2009 13:49:20 -0400 From: Glauber Costa To: kvm@vger.kernel.org Cc: avi@redhat.com Subject: [PATCH 1/9] use coalesced_mmio field from qemu upstream Date: Wed, 29 Jul 2009 13:49:11 -0400 Message-Id: <1248889759-25063-2-git-send-email-glommer@redhat.com> In-Reply-To: <1248889759-25063-1-git-send-email-glommer@redhat.com> References: <1248889759-25063-1-git-send-email-glommer@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org remove it from kvm_context too. Besides it all, helps catching any missing conversion Signed-off-by: Glauber Costa --- qemu-kvm.c | 14 ++++++-------- qemu-kvm.h | 2 -- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/qemu-kvm.c b/qemu-kvm.c index 352e4cd..8c36eac 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -976,9 +976,9 @@ again: post_kvm_run(kvm, env); #if defined(KVM_CAP_COALESCED_MMIO) - if (kvm->coalesced_mmio) { + if (kvm_state->coalesced_mmio) { struct kvm_coalesced_mmio_ring *ring = (void *)run + - kvm->coalesced_mmio * PAGE_SIZE; + kvm_state->coalesced_mmio * PAGE_SIZE; while (ring->first != ring->last) { kvm_mmio_write(kvm->opaque, ring->coalesced_mmio[ring->first].phys_addr, @@ -1113,11 +1113,11 @@ int kvm_inject_nmi(kvm_vcpu_context_t vcpu) int kvm_init_coalesced_mmio(kvm_context_t kvm) { int r = 0; - kvm->coalesced_mmio = 0; + kvm_state->coalesced_mmio = 0; #ifdef KVM_CAP_COALESCED_MMIO r = kvm_ioctl(kvm_state, KVM_CHECK_EXTENSION, KVM_CAP_COALESCED_MMIO); if (r > 0) { - kvm->coalesced_mmio = r; + kvm_state->coalesced_mmio = r; return 0; } #endif @@ -1127,11 +1127,10 @@ int kvm_init_coalesced_mmio(kvm_context_t kvm) int kvm_coalesce_mmio_region(target_phys_addr_t addr, ram_addr_t size) { #ifdef KVM_CAP_COALESCED_MMIO - kvm_context_t kvm = kvm_context; struct kvm_coalesced_mmio_zone zone; int r; - if (kvm->coalesced_mmio) { + if (kvm_state->coalesced_mmio) { zone.addr = addr; zone.size = size; @@ -1150,11 +1149,10 @@ int kvm_coalesce_mmio_region(target_phys_addr_t addr, ram_addr_t size) int kvm_uncoalesce_mmio_region(target_phys_addr_t addr, ram_addr_t size) { #ifdef KVM_CAP_COALESCED_MMIO - kvm_context_t kvm = kvm_context; struct kvm_coalesced_mmio_zone zone; int r; - if (kvm->coalesced_mmio) { + if (kvm_state->coalesced_mmio) { zone.addr = addr; zone.size = size; diff --git a/qemu-kvm.h b/qemu-kvm.h index 40a7a2f..8dfdf6b 100644 --- a/qemu-kvm.h +++ b/qemu-kvm.h @@ -61,8 +61,6 @@ struct kvm_context { int irqchip_inject_ioctl; /// do not create in-kernel pit if set int no_pit_creation; - /// in-kernel coalesced mmio - int coalesced_mmio; #ifdef KVM_CAP_IRQ_ROUTING struct kvm_irq_routing *irq_routes; int nr_allocated_irq_routes;