From patchwork Fri Apr 8 20:29:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 8786081 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 4B3769F36E for ; Fri, 8 Apr 2016 20:54:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8D6E1202B8 for ; Fri, 8 Apr 2016 20:54:36 +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 A3A9A2024D for ; Fri, 8 Apr 2016 20:54:35 +0000 (UTC) Received: from localhost ([::1]:58264 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aodQJ-0003Fj-5u for patchwork-qemu-devel@patchwork.kernel.org; Fri, 08 Apr 2016 16:54:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40093) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aod2U-0004oA-5M for qemu-devel@nongnu.org; Fri, 08 Apr 2016 16:29:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aod2Q-0002BM-Fj for qemu-devel@nongnu.org; Fri, 08 Apr 2016 16:29:58 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:34399) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aod2Q-0002BB-82 for qemu-devel@nongnu.org; Fri, 08 Apr 2016 16:29:54 -0400 Received: by mail-wm0-x242.google.com with SMTP id n3so6851888wmn.1 for ; Fri, 08 Apr 2016 13:29:54 -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=jPJ+tPZK19eZ7Xb4vVDNPrOULN163koO323oqH/4XCQ=; b=HdvFLFlxnSOL/BdIdjRHtaKlBwjQKJjK6xlJqs4v6B8ICslLTBCygs+eSlsARefZfI 8Cn9XGKlouIVT4VPau788l8mE5Hz+bpR8OZo3i6804okTzHZY+Qcw4LlBSkbg4oKq3h/ H5MMbW0AqNs1pQr82DWrb0uI72QmHGtmljnEsHjLn9nG7MInyD0KXg8o8bPGNkp1gIdQ F+5TQn5IAglYTThWnvjto6ruGRjnc3yMIc2fnVvkwxPzwvwFc4MjhMkP6gHWwOtTuwPd mywESIAqobIIrmem0Iut6OWRON+u/5cWq54nBV79NzQzxPnq17IY9yO/HplSHUX/e1Om G/oA== 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=jPJ+tPZK19eZ7Xb4vVDNPrOULN163koO323oqH/4XCQ=; b=ihX63p+v23V2jYKcEJy3wfHMhMhUv0eufSb9w5GO2cLl58VUqPij2GqicYA1TxgndB dxDLfG49hcmKqMaowbPwGUp20U0jxOTeGAJULFYjrEid7UdPwQTeWZ6xq3Hhn9Cw7WbF fOVC2snq9Irk0P5chyF/BBlKUMAzK3MjIupNc6d0zPzY1TzBtOm/aNq6JBskTnR8MNML cVvOLN2s3+GsDI8ZJ5vV4N77zJfe362I/XDvAqWU8WJ1+AHueCNIKKJgh6TupTMgEqZF VYTJQJf3VvuYYoCAnOY739Cvhz5k8tcloRFzOVtYwlERl/Z8am3YNNlnt5mmSBOPZNM3 UynA== X-Gm-Message-State: AD7BkJK+4isFryNor41ozfgOt3cC4ua9z2Dvff52i3P4o0f46SFFNAPYvLGVOaFlRTEZxA== X-Received: by 10.28.188.197 with SMTP id m188mr5496695wmf.92.1460147393725; Fri, 08 Apr 2016 13:29:53 -0700 (PDT) Received: from 640k.lan (94-39-141-76.adsl-ull.clienti.tiscali.it. [94.39.141.76]) by smtp.gmail.com with ESMTPSA id w10sm3849168wjz.9.2016.04.08.13.29.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Apr 2016 13:29:53 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 8 Apr 2016 22:29:00 +0200 Message-Id: <1460147350-7601-41-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1460147350-7601-1-git-send-email-pbonzini@redhat.com> References: <1460147350-7601-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::242 Subject: [Qemu-devel] [PATCH 40/50] 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/ppc/e500plat.c | 1 + hw/ppc/spapr_hcall.c | 1 + hw/ppc/spapr_rtas.c | 1 + include/sysemu/dma.h | 5 +---- 5 files changed, 5 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/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 2db2292..5352767 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 b0fbb9b..8a06f7a 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