From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57932) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2Ka3-0002WX-FC for qemu-devel@nongnu.org; Mon, 16 May 2016 11:37:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2KZy-0006kH-BL for qemu-devel@nongnu.org; Mon, 16 May 2016 11:37:15 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:34489) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2KZx-0006jm-Jt for qemu-devel@nongnu.org; Mon, 16 May 2016 11:37:10 -0400 Received: by mail-wm0-x242.google.com with SMTP id n129so18907961wmn.1 for ; Mon, 16 May 2016 08:37:09 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-252-58.clienti.tiscali.it. [78.12.252.58]) by smtp.gmail.com with ESMTPSA id lf9sm34386875wjc.44.2016.05.16.08.37.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 May 2016 08:37:08 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Mon, 16 May 2016 17:36:12 +0200 Message-Id: <1463412982-6681-41-git-send-email-pbonzini@redhat.com> In-Reply-To: <1463412982-6681-1-git-send-email-pbonzini@redhat.com> References: <1463412982-6681-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 40/50] dma: do not depend on kvm_enabled() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Memory barriers are needed also by Xen and, when the ioeventfd bugs are fixed, by TCG as well. sysemu/kvm.h is not anymore needed in sysemu/dma.h, move it to the actual users. Signed-off-by: Paolo Bonzini --- hw/intc/arm_gicv2m.c | 1 + hw/misc/pci-testdev.c | 1 + hw/ppc/e500plat.c | 1 + hw/ppc/spapr_hcall.c | 1 + hw/ppc/spapr_rtas.c | 1 + include/sysemu/dma.h | 5 +---- 6 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/intc/arm_gicv2m.c b/hw/intc/arm_gicv2m.c index e8b5177..589d315 100644 --- a/hw/intc/arm_gicv2m.c +++ b/hw/intc/arm_gicv2m.c @@ -29,6 +29,7 @@ #include "qapi/error.h" #include "hw/sysbus.h" #include "hw/pci/msi.h" +#include "sysemu/kvm.h" #define TYPE_ARM_GICV2M "arm-gicv2m" #define ARM_GICV2M(obj) OBJECT_CHECK(ARMGICv2mState, (obj), TYPE_ARM_GICV2M) diff --git a/hw/misc/pci-testdev.c b/hw/misc/pci-testdev.c index 2f2e989..7d59902 100644 --- a/hw/misc/pci-testdev.c +++ b/hw/misc/pci-testdev.c @@ -21,6 +21,7 @@ #include "hw/hw.h" #include "hw/pci/pci.h" #include "qemu/event_notifier.h" +#include "sysemu/kvm.h" typedef struct PCITestDevHdr { uint8_t test; diff --git a/hw/ppc/e500plat.c b/hw/ppc/e500plat.c index b00565c..94b4545 100644 --- a/hw/ppc/e500plat.c +++ b/hw/ppc/e500plat.c @@ -14,6 +14,7 @@ #include "e500.h" #include "hw/boards.h" #include "sysemu/device_tree.h" +#include "sysemu/kvm.h" #include "hw/pci/pci.h" #include "hw/ppc/openpic.h" #include "kvm_ppc.h" diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index 8f40602..4426a50 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc/spapr_hcall.c @@ -7,6 +7,7 @@ #include "mmu-hash64.h" #include "cpu-models.h" #include "trace.h" +#include "sysemu/kvm.h" #include "kvm_ppc.h" struct SPRSyncState { diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c index f073258..580829e 100644 --- a/hw/ppc/spapr_rtas.c +++ b/hw/ppc/spapr_rtas.c @@ -31,6 +31,7 @@ #include "hw/qdev.h" #include "sysemu/device_tree.h" #include "sysemu/cpus.h" +#include "sysemu/kvm.h" #include "hw/ppc/spapr.h" #include "hw/ppc/spapr_vio.h" diff --git a/include/sysemu/dma.h b/include/sysemu/dma.h index 0f7cd4d..d6e96a4 100644 --- a/include/sysemu/dma.h +++ b/include/sysemu/dma.h @@ -15,7 +15,6 @@ #include "hw/hw.h" #include "block/block.h" #include "block/accounting.h" -#include "sysemu/kvm.h" typedef struct ScatterGatherEntry ScatterGatherEntry; @@ -67,9 +66,7 @@ static inline void dma_barrier(AddressSpace *as, DMADirection dir) * use lighter barriers based on the direction of the * transfer, the DMA context, etc... */ - if (kvm_enabled()) { - smp_mb(); - } + smp_mb(); } /* Checks that the given range of addresses is valid for DMA. This is -- 1.8.3.1