From nobody Tue Feb 10 05:27:06 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1599131339; cv=none; d=zohomail.com; s=zohoarc; b=K7xnTijOusIv7SdOXgTTUU2HeEd8QtaaDvBd7+V7DUoq30bJiemr1AJmuthiohT9VbhFKYFWx0LpT6UqBLrlYXfY5Ss0N30lN7jypMQeDCWLVmO5AQHr9cQPgTMKQoQnFOczvLYoqDa2SC9vTj3bcjTkXlwn2FpIIRs/SPwgdbA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599131339; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=lI0QOKOjsBIQPb4JR9+p08dzOczCwGubAvEgxznc7/Q=; b=kLVR1aBHdivtmIZs4NgwluJjlJkvbnVHhjDW8IuO8c34UEz2GDkQTIJ6sJlP/FkGn1mQxsCuZdYbdaQFHBORtSmug7fr2g0xe/umYPgcjly0o7cLWaVNCGl9JYOip+Uu1MG2FM4bu0wzejGdoob8zZfTZJkdzu0p40cWM8NLpnM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1599131339163701.0896890694937; Thu, 3 Sep 2020 04:08:59 -0700 (PDT) Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-227-M8KiX_4_PYacTqD6l6XHeQ-1; Thu, 03 Sep 2020 07:08:56 -0400 Received: by mail-wm1-f69.google.com with SMTP id a5so842428wmj.5 for ; Thu, 03 Sep 2020 04:08:55 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (50.red-83-52-54.dynamicip.rima-tde.net. [83.52.54.50]) by smtp.gmail.com with ESMTPSA id t4sm3818792wre.30.2020.09.03.04.08.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 04:08:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599131338; 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=lI0QOKOjsBIQPb4JR9+p08dzOczCwGubAvEgxznc7/Q=; b=bx3bZeD3DMZcM8jQz/VcD+6Ybu2XztmXliSYSAZYQG0t+XjGVQ1Gi4MUbxS82/hlLlA8lY gm5DBos4XTftYr3zaS377YlTXaX6gkEyAbB39GyVJjFQhdedEBJRloxtHutPJrohZMAnWX 0QzmIj4IV9mi4OB6cA0knqNUDzEK1MA= X-MC-Unique: M8KiX_4_PYacTqD6l6XHeQ-1 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=lI0QOKOjsBIQPb4JR9+p08dzOczCwGubAvEgxznc7/Q=; b=YAYyDmcp9O7eMws7fhonjkKZt/GqkC7k5dmkCMZRKfT7rLjA1RxVyGmpn3bQI/GdpC a/L7jUikky6yxntqfCg4K3pn4Dl1nG34Jd8i2Xhgl+UBKsxztzoG+Wkr8+LWxxC2742Y j7LnhHRuyyKcAkWwhgxkJpK3Ubnkly/V4jY4of06zKDpQoDNwo37U4gI6hT/3pS31EEh tnslu6Z2Kel9mEyU3WMnppoIQjv8LRazZKUOXexB9oKpb5XZhSp6r/SnNi6YxacPdNuO QQSaezS4tZJxOkVAlRiHE5NR9u5wwyY5lf0atljKCbh/OAWfAbG45TCmM8M07A44jM/f zT1g== X-Gm-Message-State: AOAM533vmsyIzQjJejObY6EZ827R4d7eH6CvRuRgJAskRqZSCSwc3Mf0 1aRdS180/cf+9p9yMXkAvYLhS2KanDkewot8NE8eav7MRAnlNKVmQE2r6DkkiWxdoIpJ3f9A0kw Pri0afsgspG8HZw== X-Received: by 2002:adf:ec45:: with SMTP id w5mr1930581wrn.357.1599131333634; Thu, 03 Sep 2020 04:08:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaXFm4w5Ohr2LN1cJuuhu1+mwP3obhIRDWIm7OWCaGpOEFgAjMzMv//oNv4qxMSNAwt007WA== X-Received: by 2002:adf:ec45:: with SMTP id w5mr1930521wrn.357.1599131333398; Thu, 03 Sep 2020 04:08:53 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: John Snow , Gerd Hoffmann , Li Qiang , "Michael S. Tsirkin" , "Edgar E. Iglesias" , Eduardo Habkost , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jan Kiszka , Emanuele Giuseppe Esposito , Eric Auger , Peter Chubb , Beniamino Galvani , Robert Foley , Paolo Bonzini , "Emilio G . Cota" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jason Wang , Andrew Baumann , Laszlo Ersek , Klaus Jensen , Stefan Hajnoczi , Tony Nguyen , Peter Xu , qemu-arm@nongnu.org, Prasad J Pandit , qemu-block@nongnu.org, Alistair Francis , Andrew Jeffery , Alexander Bulekov , Marcel Apfelbaum , "Edgar E . Iglesias" , Joel Stanley , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Peter Maydell , qemu-ppc@nongnu.org, Mark Cave-Ayland , David Gibson , Richard Henderson Subject: [PATCH 03/12] dma: Let dma_memory_set() take MemTxAttrs argument Date: Thu, 3 Sep 2020 13:08:22 +0200 Message-Id: <20200903110831.353476-4-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200903110831.353476-1-philmd@redhat.com> References: <20200903110831.353476-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.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/ppc/spapr_vio.h | 3 ++- include/sysemu/dma.h | 3 ++- dma-helpers.c | 6 +++--- hw/nvram/fw_cfg.c | 3 ++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/include/hw/ppc/spapr_vio.h b/include/hw/ppc/spapr_vio.h index f134f6cf574..6e5c0840248 100644 --- a/include/hw/ppc/spapr_vio.h +++ b/include/hw/ppc/spapr_vio.h @@ -116,7 +116,8 @@ static inline int spapr_vio_dma_write(SpaprVioDevice *d= ev, uint64_t taddr, static inline int spapr_vio_dma_set(SpaprVioDevice *dev, uint64_t taddr, uint8_t c, uint32_t size) { - return (dma_memory_set(&dev->as, taddr, c, size) !=3D 0) ? + return (dma_memory_set(&dev->as, taddr, + c, size, MEMTXATTRS_UNSPECIFIED) !=3D 0) ? H_DEST_PARM : H_SUCCESS; } =20 diff --git a/include/sysemu/dma.h b/include/sysemu/dma.h index fe3999dba59..34f957cc278 100644 --- a/include/sysemu/dma.h +++ b/include/sysemu/dma.h @@ -123,7 +123,8 @@ static inline int dma_memory_write(AddressSpace *as, dm= a_addr_t addr, DMA_DIRECTION_FROM_DEVICE); } =20 -int dma_memory_set(AddressSpace *as, dma_addr_t addr, uint8_t c, dma_addr_= t len); +int dma_memory_set(AddressSpace *as, dma_addr_t addr, + uint8_t c, dma_addr_t len, MemTxAttrs attrs); =20 static inline void *dma_memory_map(AddressSpace *as, dma_addr_t addr, dma_addr_t *len, diff --git a/dma-helpers.c b/dma-helpers.c index 41ef24a63b6..49d66716469 100644 --- a/dma-helpers.c +++ b/dma-helpers.c @@ -18,7 +18,8 @@ =20 /* #define DEBUG_IOMMU */ =20 -int dma_memory_set(AddressSpace *as, dma_addr_t addr, uint8_t c, dma_addr_= t len) +int dma_memory_set(AddressSpace *as, dma_addr_t addr, + uint8_t c, dma_addr_t len, MemTxAttrs attrs) { dma_barrier(as, DMA_DIRECTION_FROM_DEVICE); =20 @@ -30,8 +31,7 @@ int dma_memory_set(AddressSpace *as, dma_addr_t addr, uin= t8_t c, dma_addr_t len) memset(fillbuf, c, FILLBUF_SIZE); while (len > 0) { l =3D len < FILLBUF_SIZE ? len : FILLBUF_SIZE; - error |=3D address_space_write(as, addr, MEMTXATTRS_UNSPECIFIED, - fillbuf, l); + error |=3D address_space_write(as, addr, attrs, fillbuf, l); len -=3D l; addr +=3D l; } diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index f3a4728288e..a15de06a10c 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -397,7 +397,8 @@ static void fw_cfg_dma_transfer(FWCfgState *s) * tested before. */ if (read) { - if (dma_memory_set(s->dma_as, dma.address, 0, len)) { + if (dma_memory_set(s->dma_as, dma.address, 0, len, + MEMTXATTRS_UNSPECIFIED)) { dma.control |=3D FW_CFG_DMA_CTL_ERROR; } } --=20 2.26.2