From nobody Sun May 19 09:08:41 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1589734229; cv=none; d=zohomail.com; s=zohoarc; b=ioR+eDpkA5XwwYmpwT9+DIxvujW0mKxroMAu3li67IpBlUu933FCeYj2mmaPd2yC9hjEinWHIPtuxKEsrCjLWZSoOkkVuVkfeGktoDGcIaKw98zBxTTf3ThoagOmd4GTUgUEkvZcGO3Q1O1JUGg8KVQofpsZGB62JKEB+LbzqIQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589734229; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=WSFyr6f19aP4N4MMJJARifgNu7cVe5tnytMgFa4vhLY=; b=WAisgK4fFYicbICjmyGDzQrQRKyV+EZXVx+B0MowqaPO8WNXHCX/bww8e0nW+ikV2cW4Tbe9HwJKUT8fZKGhlf3tGXag8zMZh9SobdU2WPDnmzwI384CXjeo/tx8kQpP+3Eha09r63PrT+4v+kh3vybrTnEgOc+Wz91C/TEASwk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1589734229042403.42250916067167; Sun, 17 May 2020 09:50:29 -0700 (PDT) Received: from localhost ([::1]:60862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaMUc-0007LQ-Os for importer@patchew.org; Sun, 17 May 2020 12:50:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56608) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaMSe-0004sM-Av for qemu-devel@nongnu.org; Sun, 17 May 2020 12:48:24 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:40497) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jaMSd-0005HW-JS for qemu-devel@nongnu.org; Sun, 17 May 2020 12:48:24 -0400 Received: by mail-wr1-x442.google.com with SMTP id e16so9018700wra.7 for ; Sun, 17 May 2020 09:48:23 -0700 (PDT) Received: from localhost.localdomain (17.red-88-21-202.staticip.rima-tde.net. [88.21.202.17]) by smtp.gmail.com with ESMTPSA id o15sm10430850wrw.65.2020.05.17.09.48.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 May 2020 09:48:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WSFyr6f19aP4N4MMJJARifgNu7cVe5tnytMgFa4vhLY=; b=UT1o6FLei9qlcG76bYpsBJuPrt6ali5KqjJzqRDXUmn2WjfJUbgxClrFtWHj91XEUy pD3pzoITte0xz6pcRZvgZtiJF9O7zukGAJ2itL7KjS6bxb11vMFa5a8LASMP6UZ6E5s/ 2tp+ZMjVGDv0DZjuRhXsGxZXgNI/evWk7e4xI75DxB5J+tAtAHyNb+finXFqhY/4v2Im wciozO51Qq7MddEsllHWyqs0BDm4NjRyxI3EfDkQ2VZDWIhVFL0UXmLK4bxsbSarjkvc q6Si3KPqirSDlPtgewlX00f1+IifBbCquOWGyEKYudnpSAK/KtJBKLQjQBox826cFWTC 9dXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=WSFyr6f19aP4N4MMJJARifgNu7cVe5tnytMgFa4vhLY=; b=BPXlhY23n9mMCELwteQqlNEA2cOUsyyKJ/BJu7qhDye+3y5+EdDPfY6DftGiJzxvsk IRBLXeaxvVRZ5NKfkruSwWpmKu+auMRrD7M6MAA+d5ocug6SGNGDUKrZVPZW6Vc4obgH TZezxGT7gGYR0vYgxfLKC0fiwN5hgoufa8MDZGnsyCJeuVjcqhPrMpfc+lPNZ7rJHd65 6rqROxLIHQAWScRoimPV3DoKPFO3nMU3fsdK9CD1m/lKag0NgU4S041D2mr3bdeUuXlu Vv+Rr3so28ZwwuqgoJsTA6fd4WgoTRMudmfMoFP+5Vjn3qWhOgePm+6q12I+T3ZSrfVX m6yw== X-Gm-Message-State: AOAM531tpXygJzfFydkC7T0sqGSnUz70bYSxmux/OYhnKrzY2ZREm7sl MFfRRYy/dw+q9sWgc2g+gqDv0xXR+Rg= X-Google-Smtp-Source: ABdhPJyGFdANutwPQmAOLxx0Sir10l0caiJki0HJzOE9hOPo2ido+3IF0P8oN/ICDp5i16KYx4dy8w== X-Received: by 2002:adf:b30f:: with SMTP id j15mr16175825wrd.394.1589734101902; Sun, 17 May 2020 09:48:21 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 1/2] exec/memory: Let address_space_read/write_cached() propagate MemTxResult Date: Sun, 17 May 2020 18:48:16 +0200 Message-Id: <20200517164817.5371-2-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200517164817.5371-1-f4bug@amsat.org> References: <20200517164817.5371-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::442; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x442.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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 , Li Zhijian , "Michael S. Tsirkin" , Alexey Kardashevskiy , Jason Wang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Xu , Tony Nguyen , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Both address_space_read_cached_slow() and address_space_write_cached_slow() return a MemTxResult type. Do not discard it, return it to the caller. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/exec/memory.h | 19 +++++++++++-------- exec.c | 16 ++++++++-------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index e000bd2f97..5e8c009169 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -2343,10 +2343,11 @@ void *qemu_map_ram_ptr(RAMBlock *ram_block, ram_add= r_t addr); =20 /* Internal functions, part of the implementation of address_space_read_ca= ched * and address_space_write_cached. */ -void address_space_read_cached_slow(MemoryRegionCache *cache, - hwaddr addr, void *buf, hwaddr len); -void address_space_write_cached_slow(MemoryRegionCache *cache, - hwaddr addr, const void *buf, hwaddr = len); +MemTxResult address_space_read_cached_slow(MemoryRegionCache *cache, + hwaddr addr, void *buf, hwaddr = len); +MemTxResult address_space_write_cached_slow(MemoryRegionCache *cache, + hwaddr addr, const void *buf, + hwaddr len); =20 static inline bool memory_access_is_direct(MemoryRegion *mr, bool is_write) { @@ -2411,15 +2412,16 @@ MemTxResult address_space_read(AddressSpace *as, hw= addr addr, * @buf: buffer with the data transferred * @len: length of the data transferred */ -static inline void +static inline MemTxResult address_space_read_cached(MemoryRegionCache *cache, hwaddr addr, void *buf, hwaddr len) { assert(addr < cache->len && len <=3D cache->len - addr); if (likely(cache->ptr)) { memcpy(buf, cache->ptr + addr, len); + return MEMTX_OK; } else { - address_space_read_cached_slow(cache, addr, buf, len); + return address_space_read_cached_slow(cache, addr, buf, len); } } =20 @@ -2431,15 +2433,16 @@ address_space_read_cached(MemoryRegionCache *cache,= hwaddr addr, * @buf: buffer with the data transferred * @len: length of the data transferred */ -static inline void +static inline MemTxResult address_space_write_cached(MemoryRegionCache *cache, hwaddr addr, const void *buf, hwaddr len) { assert(addr < cache->len && len <=3D cache->len - addr); if (likely(cache->ptr)) { memcpy(cache->ptr + addr, buf, len); + return MEMTX_OK; } else { - address_space_write_cached_slow(cache, addr, buf, len); + return address_space_write_cached_slow(cache, addr, buf, len); } } =20 diff --git a/exec.c b/exec.c index 5162f0d12f..877b51cc5c 100644 --- a/exec.c +++ b/exec.c @@ -3716,7 +3716,7 @@ static inline MemoryRegion *address_space_translate_c= ached( /* Called from RCU critical section. address_space_read_cached uses this * out of line function when the target is an MMIO or IOMMU region. */ -void +MemTxResult address_space_read_cached_slow(MemoryRegionCache *cache, hwaddr addr, void *buf, hwaddr len) { @@ -3726,15 +3726,15 @@ address_space_read_cached_slow(MemoryRegionCache *c= ache, hwaddr addr, l =3D len; mr =3D address_space_translate_cached(cache, addr, &addr1, &l, false, MEMTXATTRS_UNSPECIFIED); - flatview_read_continue(cache->fv, - addr, MEMTXATTRS_UNSPECIFIED, buf, len, - addr1, l, mr); + return flatview_read_continue(cache->fv, + addr, MEMTXATTRS_UNSPECIFIED, buf, len, + addr1, l, mr); } =20 /* Called from RCU critical section. address_space_write_cached uses this * out of line function when the target is an MMIO or IOMMU region. */ -void +MemTxResult address_space_write_cached_slow(MemoryRegionCache *cache, hwaddr addr, const void *buf, hwaddr len) { @@ -3744,9 +3744,9 @@ address_space_write_cached_slow(MemoryRegionCache *ca= che, hwaddr addr, l =3D len; mr =3D address_space_translate_cached(cache, addr, &addr1, &l, true, MEMTXATTRS_UNSPECIFIED); - flatview_write_continue(cache->fv, - addr, MEMTXATTRS_UNSPECIFIED, buf, len, - addr1, l, mr); + return flatview_write_continue(cache->fv, + addr, MEMTXATTRS_UNSPECIFIED, buf, len, + addr1, l, mr); } =20 #define ARG1_DECL MemoryRegionCache *cache --=20 2.21.3 From nobody Sun May 19 09:08:41 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1589734306; cv=none; d=zohomail.com; s=zohoarc; b=KFIYTbdP2TUTj9l6DUSJlWu2hR7IrcG5NkWofTRotymHGIjbOHB+7W3kIqAlZKXukmCt8btLxg2fa6IWhoClrHn7lBfCGI0nmHGw14A/v+Hwxo6uSR3TO3Lz9Tfmm+Q84kQdY1zuuHml1avmB2787i/5PLktOWkPFJG+q5YG+Ys= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589734306; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=wqvkP7hBd0qvNzQ7dvdtdyC9QFe/20kKIVV38CfyUS4=; b=B/ElBU8GK5Pl40Fm8rcZGhhiF1ZBc9d5WWKorUEj5E+SeNzAYlv4kZRxhodzx7BZ4GwuFGcV2vFztZyxf/1JvmRKsPTxBgbRhQi5GOx4IgxxAOQgHhvoelwpEpbKjpRMwmqELutwrJrBnD2k4s4N+uh1mZOaoEjm+XvobiYfHTU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1589734306970209.40172141153016; Sun, 17 May 2020 09:51:46 -0700 (PDT) Received: from localhost ([::1]:36676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaMVt-0000i1-PR for importer@patchew.org; Sun, 17 May 2020 12:51:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56614) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaMSg-0004wa-5H for qemu-devel@nongnu.org; Sun, 17 May 2020 12:48:26 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:36601) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jaMSf-0005Hd-Af for qemu-devel@nongnu.org; Sun, 17 May 2020 12:48:25 -0400 Received: by mail-wm1-x343.google.com with SMTP id u188so7703574wmu.1 for ; Sun, 17 May 2020 09:48:24 -0700 (PDT) Received: from localhost.localdomain (17.red-88-21-202.staticip.rima-tde.net. [88.21.202.17]) by smtp.gmail.com with ESMTPSA id o15sm10430850wrw.65.2020.05.17.09.48.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 May 2020 09:48:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wqvkP7hBd0qvNzQ7dvdtdyC9QFe/20kKIVV38CfyUS4=; b=GUU/i3Mp0NWrChcbFFDe/PDkfkxcgGbQb5B+W53oeu3/vmys/pHnrH5uRIwgfqy3X4 04GL4EaXi9pyhjVoUPtfQiubL56+vCNjWP8u0gmm4cMPNVEkJhf3W+B8l44h5uCrcjMu RpaazYUKtGFpJ8FT8jGrST5MyjyoX7MEYyCbbG+aciuTJiUpUkeHhaJx9jGDBxB4toT0 foG0aaqbQ1eZuPs8lwYiElD7P8Nvt59WD+B4tIW/PSP8kzRV/7EXaMh+W2ZDuxypwiOi mHCihTcuu3Q5DWaR0cByur6bjVjMJKSLEZ07VnLy+M80rgBzLLq5bqusYCv3KTZaoUdS XVpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=wqvkP7hBd0qvNzQ7dvdtdyC9QFe/20kKIVV38CfyUS4=; b=sRPz5sVAGP89/fHNHFiy9qNFJRjQngJJMOyztpBJxP+HfASqyzm8yLURIfBiW7BLxb UsqBI5YrpbscJrpNef8cnhnFp9CYVcRmeDCVObphNN3FOAnt8QVB1cmHxxWCK0A9T+8j f4D2Qm/45VdwGEfo6UitEr+rSyCsq3E+RmOXbNa2NeQnT9C4S+RSKkn54EzfQsm8h9aw FraSLkULK0ybVez6UJuUq+kgASl2HzbSyDhVvgIXSMHFiDEDkAfvg7y8/T81Pw/I08PS SzPiAMGbKT07iOtMiniRZJ6zcF4juJpyI8J3wm63uWbojjIcNlpL625/q9WaBr1rXdu5 1huA== X-Gm-Message-State: AOAM531N0Kuvbh43eMLXgUg0Gby1o++RkwSNay+4acr+OB8oNz+S96Jy VnZqUX5eJVxyha4mZiwvMclr2OIPar4= X-Google-Smtp-Source: ABdhPJxWosc3icSYP0MMsyhiM9KF79iNmK3MPK6OUJEADu7/Fa0JayRae0o0BkBLfSpsxwVGtUqWJg== X-Received: by 2002:a1c:a557:: with SMTP id o84mr15379723wme.165.1589734103631; Sun, 17 May 2020 09:48:23 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [RFC PATCH 2/2] exec/memory: Emit warning when MemTxResult is ignored Date: Sun, 17 May 2020 18:48:17 +0200 Message-Id: <20200517164817.5371-3-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200517164817.5371-1-f4bug@amsat.org> References: <20200517164817.5371-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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 , Li Zhijian , "Michael S. Tsirkin" , Alexey Kardashevskiy , Jason Wang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Xu , Tony Nguyen , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) When a function from the memory subsystem return a MemTxResult to indicate that the transaction failed, this return value must not be ignored by the caller. Mark all these functions with the QEMU_WARN_UNUSED_RESULT attribute, to prevent users to ignore possible failed transactions. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- RFC because it doesn't build. But before going thru each caller, let's talk on the list if this change makes sense. --- include/exec/memory.h | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 5e8c009169..95668d1628 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -161,12 +161,14 @@ struct MemoryRegionOps { hwaddr addr, uint64_t *data, unsigned size, - MemTxAttrs attrs); + MemTxAttrs attrs) + QEMU_WARN_UNUSED_RESULT; MemTxResult (*write_with_attrs)(void *opaque, hwaddr addr, uint64_t data, unsigned size, - MemTxAttrs attrs); + MemTxAttrs attrs) + QEMU_WARN_UNUSED_RESULT; =20 enum device_endian endianness; /* Guest-visible constraints: */ @@ -1989,7 +1991,8 @@ MemTxResult memory_region_dispatch_read(MemoryRegion = *mr, hwaddr addr, uint64_t *pval, MemOp op, - MemTxAttrs attrs); + MemTxAttrs attrs) + QEMU_WARN_UNUSED_RESULT; /** * memory_region_dispatch_write: perform a write directly to the specified * MemoryRegion. @@ -2004,7 +2007,8 @@ MemTxResult memory_region_dispatch_write(MemoryRegion= *mr, hwaddr addr, uint64_t data, MemOp op, - MemTxAttrs attrs); + MemTxAttrs attrs) + QEMU_WARN_UNUSED_RESULT; =20 /** * address_space_init: initializes an address space @@ -2053,7 +2057,8 @@ void address_space_remove_listeners(AddressSpace *as); */ MemTxResult address_space_rw(AddressSpace *as, hwaddr addr, MemTxAttrs attrs, void *buf, - hwaddr len, bool is_write); + hwaddr len, bool is_write) + QEMU_WARN_UNUSED_RESULT; =20 /** * address_space_write: write to address space. @@ -2070,7 +2075,8 @@ MemTxResult address_space_rw(AddressSpace *as, hwaddr= addr, */ MemTxResult address_space_write(AddressSpace *as, hwaddr addr, MemTxAttrs attrs, - const void *buf, hwaddr len); + const void *buf, hwaddr len) + QEMU_WARN_UNUSED_RESULT; =20 /** * address_space_write_rom: write to address space, including ROM. @@ -2096,7 +2102,8 @@ MemTxResult address_space_write(AddressSpace *as, hwa= ddr addr, */ MemTxResult address_space_write_rom(AddressSpace *as, hwaddr addr, MemTxAttrs attrs, - const void *buf, hwaddr len); + const void *buf, hwaddr len) + QEMU_WARN_UNUSED_RESULT; =20 /* address_space_ld*: load from an address space * address_space_st*: store to an address space @@ -2334,20 +2341,24 @@ void address_space_unmap(AddressSpace *as, void *bu= ffer, hwaddr len, =20 /* Internal functions, part of the implementation of address_space_read. = */ MemTxResult address_space_read_full(AddressSpace *as, hwaddr addr, - MemTxAttrs attrs, void *buf, hwaddr le= n); + MemTxAttrs attrs, void *buf, hwaddr le= n) + QEMU_WARN_UNUSED_RESULT; MemTxResult flatview_read_continue(FlatView *fv, hwaddr addr, MemTxAttrs attrs, void *buf, hwaddr len, hwaddr addr1, hwaddr l, - MemoryRegion *mr); + MemoryRegion *mr) + QEMU_WARN_UNUSED_RESULT; void *qemu_map_ram_ptr(RAMBlock *ram_block, ram_addr_t addr); =20 /* Internal functions, part of the implementation of address_space_read_ca= ched * and address_space_write_cached. */ MemTxResult address_space_read_cached_slow(MemoryRegionCache *cache, - hwaddr addr, void *buf, hwaddr = len); + hwaddr addr, void *buf, hwaddr = len) + QEMU_WARN_UNUSED_RESULT; MemTxResult address_space_write_cached_slow(MemoryRegionCache *cache, hwaddr addr, const void *buf, - hwaddr len); + hwaddr len) + QEMU_WARN_UNUSED_RESULT; =20 static inline bool memory_access_is_direct(MemoryRegion *mr, bool is_write) { @@ -2373,7 +2384,7 @@ static inline bool memory_access_is_direct(MemoryRegi= on *mr, bool is_write) * @buf: buffer with the data transferred * @len: length of the data transferred */ -static inline __attribute__((__always_inline__)) +static inline __attribute__((__always_inline__)) QEMU_WARN_UNUSED_RESULT MemTxResult address_space_read(AddressSpace *as, hwaddr addr, MemTxAttrs attrs, void *buf, hwaddr len) @@ -2412,7 +2423,7 @@ MemTxResult address_space_read(AddressSpace *as, hwad= dr addr, * @buf: buffer with the data transferred * @len: length of the data transferred */ -static inline MemTxResult +static inline MemTxResult QEMU_WARN_UNUSED_RESULT address_space_read_cached(MemoryRegionCache *cache, hwaddr addr, void *buf, hwaddr len) { @@ -2433,7 +2444,7 @@ address_space_read_cached(MemoryRegionCache *cache, h= waddr addr, * @buf: buffer with the data transferred * @len: length of the data transferred */ -static inline MemTxResult +static inline MemTxResult QEMU_WARN_UNUSED_RESULT address_space_write_cached(MemoryRegionCache *cache, hwaddr addr, const void *buf, hwaddr len) { --=20 2.21.3