From patchwork Fri Sep 4 15:44:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 306143 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70E64C433E2 for ; Fri, 4 Sep 2020 15:49:01 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 34A5D206E7 for ; Fri, 4 Sep 2020 15:49:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 34A5D206E7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:56856 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kEDxU-0008Gh-CT for qemu-devel@archiver.kernel.org; Fri, 04 Sep 2020 11:49:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55764) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEDu9-0001mj-3B for qemu-devel@nongnu.org; Fri, 04 Sep 2020 11:45:34 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:47981 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kEDu7-0007dO-5e for qemu-devel@nongnu.org; Fri, 04 Sep 2020 11:45:32 -0400 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-566-oPozlDBnMQ-BHpZupHXqTg-1; Fri, 04 Sep 2020 11:45:29 -0400 X-MC-Unique: oPozlDBnMQ-BHpZupHXqTg-1 Received: by mail-wr1-f69.google.com with SMTP id 33so2445182wrk.12 for ; Fri, 04 Sep 2020 08:45:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=88VzwaD6NZkIeGp94pbPYvLyI6pXPU6GwCC8RqSJAfo=; b=LghF+o5tol75AECYEXfQdl1e4MkaI6K2RgwRCL1DSLItxYIfih4WxogC+Ibs0YYEhl /7WFXvRepWxhkGAxpNENKQ6F3LNZcONOF9rvRpVfKDgAVuv+XJojNFfPglGJzaraDjsx CqXdUyBj/VeYpzfN37xgu9HDqddcMWt8L/i0JQxL6E19d7tFmDyPSl82xNPz9Rkc2GIp VFciYpl9uCa4ozxWbZK9PPZRq5epJUrMxbwTwubwDXwk58eoHCq134YscTskxGlVS+CS ISMw3GPjimI9XZVG9rwuT21LXE4beuDI6ETlc4gwEbweiyoe+b7ovQtzVBbAW1M4YOda /sUg== X-Gm-Message-State: AOAM531jYdoLblexlt2qrMB5+EW37L1c9BPbHioIRXqVQFDsJiF9IPon H0QL2eqQSLajxruInK7AYG1LVtcqvhOa504Ua8iZ19P8qKZqUZZTYKJf4IAsO2VywV0tYXq1eXv eXPXaDQPAc7w943w= X-Received: by 2002:a05:600c:ce:: with SMTP id u14mr8537727wmm.137.1599234327831; Fri, 04 Sep 2020 08:45:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyilkRW5eMWPpxwBYcqKhgCNwVWDAI895kp0huJC9lWBKdvi74Ba4SYKpGEMSGFUL3gca1tkw== X-Received: by 2002:a05:600c:ce:: with SMTP id u14mr8537693wmm.137.1599234327664; Fri, 04 Sep 2020 08:45:27 -0700 (PDT) Received: from localhost.localdomain (50.red-83-52-54.dynamicip.rima-tde.net. [83.52.54.50]) by smtp.gmail.com with ESMTPSA id f1sm12061964wrt.20.2020.09.04.08.45.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Sep 2020 08:45:27 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Paolo Bonzini Subject: [PATCH 08/13] dma: Let dma_memory_valid() take MemTxAttrs argument Date: Fri, 4 Sep 2020 17:44:34 +0200 Message-Id: <20200904154439.643272-9-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200904154439.643272-1-philmd@redhat.com> References: <20200904154439.643272-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=205.139.110.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/04 01:57:12 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Jason Wang , Mark Cave-Ayland , Peter Xu , Gerd Hoffmann , "Edgar E. Iglesias" , qemu-block@nongnu.org, Joel Stanley , David Gibson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Alistair Francis , Beniamino Galvani , Eric Auger , qemu-arm@nongnu.org, Jan Kiszka , =?utf-8?q?C=C3=A9dric_Le_Goater?= , John Snow , Richard Henderson , Andrew Jeffery , Laszlo Ersek , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Andrew Baumann , qemu-ppc@nongnu.org, Peter Chubb Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Let devices specify transaction attributes when calling dma_memory_valid(). Signed-off-by: Philippe Mathieu-Daudé --- include/hw/ppc/spapr_vio.h | 2 +- include/sysemu/dma.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/hw/ppc/spapr_vio.h b/include/hw/ppc/spapr_vio.h index bed7df60e35..f134f6cf574 100644 --- a/include/hw/ppc/spapr_vio.h +++ b/include/hw/ppc/spapr_vio.h @@ -96,7 +96,7 @@ static inline void spapr_vio_irq_pulse(SpaprVioDevice *dev) static inline bool spapr_vio_dma_valid(SpaprVioDevice *dev, uint64_t taddr, uint32_t size, DMADirection dir) { - return dma_memory_valid(&dev->as, taddr, size, dir); + return dma_memory_valid(&dev->as, taddr, size, dir, MEMTXATTRS_UNSPECIFIED); } static inline int spapr_vio_dma_read(SpaprVioDevice *dev, uint64_t taddr, diff --git a/include/sysemu/dma.h b/include/sysemu/dma.h index f4ade067a46..b322aa5947b 100644 --- a/include/sysemu/dma.h +++ b/include/sysemu/dma.h @@ -73,11 +73,11 @@ static inline void dma_barrier(AddressSpace *as, DMADirection dir) * dma_memory_{read,write}() and check for errors */ static inline bool dma_memory_valid(AddressSpace *as, dma_addr_t addr, dma_addr_t len, - DMADirection dir) + DMADirection dir, MemTxAttrs attrs) { return address_space_access_valid(as, addr, len, dir == DMA_DIRECTION_FROM_DEVICE, - MEMTXATTRS_UNSPECIFIED); + attrs); } static inline MemTxResult dma_memory_rw_relaxed(AddressSpace *as,