From nobody Mon Feb 9 18:46:32 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1640260584; cv=none; d=zohomail.com; s=zohoarc; b=CCy1FM1PhaPx91xEL0F+S4p/bQO4SkT1Q1bqgH7q4vRkFVmShgVwSA4VJQqzludzoi5zZ2lqSNMrSLn8uS8G3o8rdaDdLqXMImYGukhlDygz6o87PvEF3iJgVLIck+v6AAN517+E/4tMolx1f02b53+vdYNZ5auQ86uUhLX+E6s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1640260584; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=DFluRvBp6z9QVaCBe8Ue+D5WXYJ9sfHm6PVL8XfDVUM=; b=HgC/gkTysYbl42NBVOdz8hd+wyankpBYIZEmbdsfrMc7z41TOLnWIWmkvFe9ZR5UmYR0Z8zfNvaPlrbKzPwKnLColeLwcpuV+65Cmwx8cQKYS1LKlgkNORlMa+VEDQ8CUP6+zUNm90maSa58cqMltlwk9hdqtPaDCqX/urgHTXo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1640260584926643.2608644472712; Thu, 23 Dec 2021 03:56:24 -0800 (PST) Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-312-TtnVU5dyOyGBmZaDWzdT9w-1; Thu, 23 Dec 2021 06:56:22 -0500 Received: by mail-wm1-f69.google.com with SMTP id a203-20020a1c7fd4000000b0034574187420so4541348wmd.5 for ; Thu, 23 Dec 2021 03:56:22 -0800 (PST) Return-Path: Return-Path: Received: from x1w.. (33.red-193-152-124.dynamicip.rima-tde.net. [193.152.124.33]) by smtp.gmail.com with ESMTPSA id g1sm4915702wri.103.2021.12.23.03.56.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Dec 2021 03:56:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640260583; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DFluRvBp6z9QVaCBe8Ue+D5WXYJ9sfHm6PVL8XfDVUM=; b=abFA4vOijpyeHy3mJHCOkOexoaX5x1+g57l9UWu8d49YbaAD8BAaLblk+XFfUzg8a4nXZ4 FMEgcAPvgyOf6FGRSwEhuMSMDKaZlr04GUd81dWOawFnE3FM2gWfH9j+6jEJaPSbOPR+Kr KOFcdk5mR3RMsEj60Z96TX6qYC0vd8s= X-MC-Unique: TtnVU5dyOyGBmZaDWzdT9w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DFluRvBp6z9QVaCBe8Ue+D5WXYJ9sfHm6PVL8XfDVUM=; b=TKA6Zm7LTtr2C/0idTcjawniT3ap85wG+itEVmZ/8UfBN1ZndX0UVqDGbyOfJhwCZO AosqVtSbxHObD7oc2eTP/Qzp1mGMLFQ+ldgnnQPQTahSCURRUNnhyVBeRP/gLYmY8bAw 4FkBAxYx7qFRHQlp0sRf9FftewyRSj0H1LG5NWHZNkgE75y5gO/LPM4YvIkhSMZLrO5s sFDhTUBTz0K9NCmIyGvNWdLzz0/bqqVAfTqc7w7EBTNt5X6kqASJCVlQYSicUGJaM5QF YxU+3jmxZ73HUcICjHCykYnwMfCDwpqkKQANh1YhIo2SgJr9xZBdoZ/IcL4R7DaRpEcH PCbg== X-Gm-Message-State: AOAM531F58JhKiA82+k+PFNqAS2Q9I164kyL4glc2qCbvr8fdVsuwEa0 M0xyDtSLf1UO3JyxzmOvrAxGXlWpOFDpdbMrv7mcdVE3YO+2HsYov0YwtxnDgI+DpG0Mn4gtHoA Cx1VY1yNIDLY7gA== X-Received: by 2002:a05:600c:24c:: with SMTP id 12mr1498466wmj.191.1640260581478; Thu, 23 Dec 2021 03:56:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJxBokRYK6ALM3HGg1JCXxCJgsw/1xEQICWEVfpoFNmRzR/YDKv4JTspeT2MSnEe13aTG1tZmQ== X-Received: by 2002:a05:600c:24c:: with SMTP id 12mr1498440wmj.191.1640260581327; Thu, 23 Dec 2021 03:56:21 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Joel Stanley , Richard Henderson , qemu-block@nongnu.org, Jason Wang , Keith Busch , "Michael S. Tsirkin" , Fam Zheng , Alistair Francis , David Hildenbrand , Eduardo Habkost , Havard Skinnemoen , Sven Schnelle , Tyrone Ting , Gerd Hoffmann , Peter Maydell , Beniamino Galvani , Daniel Henrique Barboza , Dmitry Fleytman , John Snow , Bin Meng , Greg Kurz , Eric Auger , Mark Cave-Ayland , "Edgar E. Iglesias" , Andrew Jeffery , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Andrew Baumann , Hannes Reinecke , Paolo Bonzini , Peter Xu , qemu-arm@nongnu.org, Klaus Jensen , Stefan Weil , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Jan Kiszka , David Gibson , Li Qiang , "Edgar E . Iglesias" , Stefan Hajnoczi Subject: [PATCH v2 01/23] dma: Let dma_memory_valid() take MemTxAttrs argument Date: Thu, 23 Dec 2021 12:55:32 +0100 Message-Id: <20211223115554.3155328-2-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211223115554.3155328-1-philmd@redhat.com> References: <20211223115554.3155328-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1640260587709100001 Let devices specify transaction attributes when calling dma_memory_valid(). Reviewed-by: Richard Henderson Reviewed-by: Li Qiang Reviewed-by: Edgar E. Iglesias Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Stefan Hajnoczi Message-Id: <20210702092439.989969-2-philmd@redhat.com> --- 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 4bea87f39cc..4c45f1579fa 100644 --- a/include/hw/ppc/spapr_vio.h +++ b/include/hw/ppc/spapr_vio.h @@ -91,7 +91,7 @@ static inline void spapr_vio_irq_pulse(SpaprVioDevice *de= v) 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_UNSPECI= FIED); } =20 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 3201e7901db..296f3b57c9c 100644 --- a/include/sysemu/dma.h +++ b/include/sysemu/dma.h @@ -73,11 +73,11 @@ static inline void dma_barrier(AddressSpace *as, DMADir= ection 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 =3D=3D DMA_DIRECTION_FROM_DEVICE, - MEMTXATTRS_UNSPECIFIED); + attrs); } =20 static inline MemTxResult dma_memory_rw_relaxed(AddressSpace *as, --=20 2.33.1