From nobody Mon Feb 9 20:10:00 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1639839093; cv=none; d=zohomail.com; s=zohoarc; b=l/8kIYKygVsZhk2z31j0VbB1rJZL7tSxMWwHFDO6WsFZp29oMLKS+q+yZQLFrD89xY+Ecu8Ecb7e/8Xee6QSh5QpnHJsZWh3lZFWGo6UVimo+LTRexdokn3BT/g2PmDbr5G1J4pdxUAfwdKp6i0M+4yC2bT86+k1aW7OwcPUTWM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639839093; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=Z0wxGg120YyeF7AD5AshLrhx/8IEHK5hXeX4znVMwbA=; b=FL/fV6ADeCer4BDvHjk2B7yzOEFV4wWwrtHqDoTT3c2Ux75IyKduT9v5qWdOWAz4ddimxLl0hr4P6eJ6qFXe2OrrNOcv9HoHDo4vm+Zgq3lmmx3TT3VHVpmLWyGLMCV/gmmAxdCBg13klYZ9JjeKrRxH5LlvXh0j2CbjKmwQvfg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1639839093543583.0491157633159; Sat, 18 Dec 2021 06:51:33 -0800 (PST) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-277-A86pDIsKPOKUnN9VvPWnsg-1; Sat, 18 Dec 2021 09:51:29 -0500 Received: by mail-wr1-f70.google.com with SMTP id l13-20020adfbd8d000000b001a23a990dbfso1495106wrh.5 for ; Sat, 18 Dec 2021 06:51:29 -0800 (PST) Return-Path: Return-Path: Received: from x1w.. (174.red-83-50-185.dynamicip.rima-tde.net. [83.50.185.174]) by smtp.gmail.com with ESMTPSA id o64sm10566299wme.28.2021.12.18.06.51.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Dec 2021 06:51:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639839092; 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=Z0wxGg120YyeF7AD5AshLrhx/8IEHK5hXeX4znVMwbA=; b=FwM9MmGZrsbf/A0zSa+oD58I8Yk6zNKOTiz5/dWG8vPm94/eyj8oN8St68CShrXDM626xX kGIQ3vDYh5bEEfWl20Ay12AFx0tCilSN4JxVlLs1U7hftTw1bpOAVFBPIo8Qp9fbPbsiq5 Xx+2zbXhHrVKGB0lhnZInHlubFLxSmY= X-MC-Unique: A86pDIsKPOKUnN9VvPWnsg-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=Z0wxGg120YyeF7AD5AshLrhx/8IEHK5hXeX4znVMwbA=; b=ewUoMtqZzwsxq7N+A2mEMiJp5OgNsFz9Ecy2wyCr2fRnu3jgRMjqti7O8gsN/zHysc 6IySsKvl+DOBHY3ESx2GK2e/b79etwpf+i97T/x6mF4vlUAz9iKXMfTUcuvbMctKAK60 BpNCztOSJms4+UJtXcSo6RqMDYF037Tm+VJP5lNieABtTfZYDRtlfklLdFvsnyzXG1oa 1C5RGmZDyopF86/7vjSvPkKBoZmaDQXXg+32uMMnWr2n+VYpXzuSZ8+aBi2xw3mTnubD iwyxqW1cA0CusW8ylZOIbXcmlIxLNFwhDQl42LDquO9cjKaJg9TRXC318Ork8dqbhJ3D Jx6A== X-Gm-Message-State: AOAM530g5fztIjH3XQEY/itG2sfIgIevv4bub1h4CqGSY+JOgh7CIV5B nAh+euSOt84eIUf1xzWY7uUv7Dpxl21romqyoU4Bkma4YRg5udzqy2zeQPqyJnWClcBS23SdGxt ZghO099tlTbusDA== X-Received: by 2002:a5d:460d:: with SMTP id t13mr6667411wrq.44.1639839088222; Sat, 18 Dec 2021 06:51:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTUALNby17VArSwVhgi2Rd5e5bePTtubSqB/nhxUQypN3GuJLWE13uk2WnAO47OERY/aFYUg== X-Received: by 2002:a5d:460d:: with SMTP id t13mr6667399wrq.44.1639839088080; Sat, 18 Dec 2021 06:51:28 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , David Hildenbrand , "Michael S. Tsirkin" , qemu-ppc@nongnu.org, Peter Xu , Alexander Bulekov , Qiuhao Li , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Li Qiang , Greg Kurz , Paolo Bonzini , Gerd Hoffmann , David Gibson , Daniel Henrique Barboza , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 3/4] dma: Let st*_dma() propagate MemTxResult Date: Sat, 18 Dec 2021 15:51:10 +0100 Message-Id: <20211218145111.1540114-4-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211218145111.1540114-1-philmd@redhat.com> References: <20211218145111.1540114-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: 1639839094910100001 dma_memory_write() returns a MemTxResult type. Do not discard it, return it to the caller. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Richard Henderson --- include/sysemu/dma.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/sysemu/dma.h b/include/sysemu/dma.h index b711d390a4f..191cf0b271a 100644 --- a/include/sysemu/dma.h +++ b/include/sysemu/dma.h @@ -249,13 +249,13 @@ static inline void dma_memory_unmap(AddressSpace *as, dma_memory_read(as, addr, &val, (_bits) / 8, attrs); \ return _end##_bits##_to_cpu(val); \ } \ - static inline void st##_sname##_##_end##_dma(AddressSpace *as, \ - dma_addr_t addr, \ - uint##_bits##_t val, \ - MemTxAttrs attrs) \ - { \ - val =3D cpu_to_##_end##_bits(val); \ - dma_memory_write(as, addr, &val, (_bits) / 8, attrs); \ + static inline MemTxResult st##_sname##_##_end##_dma(AddressSpace *as, \ + dma_addr_t addr, \ + uint##_bits##_t va= l, \ + MemTxAttrs attrs) \ + { \ + val =3D cpu_to_##_end##_bits(val); \ + return dma_memory_write(as, addr, &val, (_bits) / 8, attrs); \ } =20 static inline uint8_t ldub_dma(AddressSpace *as, dma_addr_t addr, MemTxAtt= rs attrs) @@ -266,10 +266,10 @@ static inline uint8_t ldub_dma(AddressSpace *as, dma_= addr_t addr, MemTxAttrs att return val; } =20 -static inline void stb_dma(AddressSpace *as, dma_addr_t addr, - uint8_t val, MemTxAttrs attrs) +static inline MemTxResult stb_dma(AddressSpace *as, dma_addr_t addr, + uint8_t val, MemTxAttrs attrs) { - dma_memory_write(as, addr, &val, 1, attrs); + return dma_memory_write(as, addr, &val, 1, attrs); } =20 DEFINE_LDST_DMA(uw, w, 16, le); --=20 2.33.1