From patchwork Thu May 19 11:18:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 9127401 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C53C39F30C for ; Thu, 19 May 2016 12:02:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E755320212 for ; Thu, 19 May 2016 12:02:30 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 13537201C0 for ; Thu, 19 May 2016 12:02:30 +0000 (UTC) Received: from localhost ([::1]:49902 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3Mer-0001Xw-45 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 May 2016 08:02:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3LzN-0004f6-BG for qemu-devel@nongnu.org; Thu, 19 May 2016 07:19:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3LzH-0004Hb-Vn for qemu-devel@nongnu.org; Thu, 19 May 2016 07:19:36 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:35367) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3LzH-0004HR-Kd for qemu-devel@nongnu.org; Thu, 19 May 2016 07:19:31 -0400 Received: by mail-wm0-x241.google.com with SMTP id s63so5553662wme.2 for ; Thu, 19 May 2016 04:19:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=Sh9TMbwazPFxpKUVmxAjYgLyiTtoCE8T1PqwANbntB0=; b=E5ay9uP9eVUQ7a4R932ddHsY2KHwDVZOfq1TY1nZ3cDlCCHD6MGn4LVBVRlQAQ9kvs kCi5ZYxHDa/LSfrdjsFAkLVpyyr6/JExXGqSnwA5g1LP08CopAzV4Om+qQf3qw8OoS9U w5QGBf4mffaJGqhndbinRFlTK5dKMDRXPMuhPHdTjbo/omjlsq7NPionrnQhT+nK/5+h n4JIgITkim6ww0Jp+gWjMrDs2xl5SniyFzh9qW7dM5+KvqAgG69J4/FMijm3Frpuz8oE +gJn5pxJ8aqByanFWsvlCdrBhBQt9y3cR4gQbOI9vt+gB8n2ziTWLPFhCPAxLkrnFwQV 85xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=Sh9TMbwazPFxpKUVmxAjYgLyiTtoCE8T1PqwANbntB0=; b=K07VRe/iOyVks0bxY8jRxzv+OoCt3cN+XtNOO4LYIUfakFQ/AYuKPHZ8ocLkDCbA1c bw/dOXTAv+aZOxn5BbK0gRF6ck4B7A1bL1hb9hd6njZ91GPOCZFSSgbwJFfo/4X2URDk tvQVhfjI0JtZDQpl16eBrG5b5TAGdwn43ZLgAFzJND+O7zLg12LWAj81CRs3usVKaK7t 3vYzRp6UJfWrwtSHwwKgOtt980zrdv1WBg0kyuWWXHrqjD2DM5/DJZ/aDHUg4d024+2e f+TbhPDoyQnNaFgbUAWhn1V1zZ43H3POEePCrI30RSuz/Fi+tSDJ9+uz2i+Olsxhukx6 AETA== X-Gm-Message-State: AOPr4FVMp8DGAyhwTcGurDujmmuY2j8kOSyRotp2hUqYW3VS9+r1w6NBA7npIIMi650TvQ== X-Received: by 10.194.112.233 with SMTP id it9mr14070682wjb.22.1463656771136; Thu, 19 May 2016 04:19:31 -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 c7sm8374317wji.38.2016.05.19.04.19.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 May 2016 04:19:30 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 19 May 2016 13:18:36 +0200 Message-Id: <1463656726-35952-43-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1463656726-35952-1-git-send-email-pbonzini@redhat.com> References: <1463656726-35952-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PULL 42/52] dma: do not depend on kvm_enabled() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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/intc/xics_kvm.c | 2 +- hw/misc/pci-testdev.c | 1 + hw/ppc/e500plat.c | 1 + hw/ppc/spapr_hcall.c | 1 + hw/ppc/spapr_pci.c | 1 + hw/ppc/spapr_rtas.c | 1 + include/sysemu/dma.h | 5 +---- 8 files changed, 8 insertions(+), 5 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/intc/xics_kvm.c b/hw/intc/xics_kvm.c index b40292d..55fd801 100644 --- a/hw/intc/xics_kvm.c +++ b/hw/intc/xics_kvm.c @@ -31,7 +31,7 @@ #include "cpu.h" #include "hw/hw.h" #include "trace.h" -#include "linux/kvm.h" +#include "sysemu/kvm.h" #include "hw/ppc/spapr.h" #include "hw/ppc/xics.h" #include "kvm_ppc.h" 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_pci.c b/hw/ppc/spapr_pci.c index 573e635..e55b505 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -44,6 +44,7 @@ #include "hw/pci/pci_bus.h" #include "hw/ppc/spapr_drc.h" #include "sysemu/device_tree.h" +#include "sysemu/kvm.h" #include "hw/vfio/vfio.h" 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