From patchwork Wed May 26 23:46:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 448337 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp14631jac; Wed, 26 May 2021 16:56:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2dV2Jn++dvPVAaEg2A2RkHiOyTbFZ4eaoQ2qStY8pUgoJSj2IytWI+6nHNut7dJeQPVEC X-Received: by 2002:a37:7ac5:: with SMTP id v188mr673910qkc.193.1622073396885; Wed, 26 May 2021 16:56:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622073396; cv=none; d=google.com; s=arc-20160816; b=E/Hqma13Lu0xEhHjPLzEcClGbst3OpmKXKhg4Ud4Cr13e45Lrop6xMAKTgbysWP05l 84fx5B550b55yPk8fch6B6tt2GfZWI0W4aygkV17BIAqtaQq2EyRaLUZhj2LydJs7Lza Wk4qUL9Qubw0md235ycP/vWgkg5A2nHHVPnxjNFyPgOIwoaUkP1ckbL9kC9xiFVLEeKE tK/UZituagwfRrtM0VkbZzSxjivoD/ymjJ3q9FaEMBUHtJFsQv1v+I6S2DdgwhhEmmwT WerPyTBT075h7zj1pEhLtN5gzN5hdcPLlyJJW9kVGdkMUWMyhXJmWVijuFM32xcTSg0M Se/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=35fS2mEHUPwPaI8xH8/39rsUu1yuwzdz1o4w+eONAWI=; b=kFy9cAl+tAkINU6tMNvn9ao6BNo8GS0bCXhWtjs9ocC8L0QlouykuwGgFXCAOTSYUB 2AlkpMeVWd+TJk6ICSGEdrE0aGh4hK6p5c9P3/v4vjmtII94shTDABRPq0L1KJXXXrJH CHevvbpouc1yxKdlMQnWh6dDptXrAnaqY5Q/KVCSL7WgA0uczErIFMe8ecOjdsFr1MaG Lq78e7AUKksmzYbGFmmWjfIYZ03flSL7GEo/D8tO4SNiRo/aCeJ8a7OAEPWlUKwjgMDE y2FgnkzlFhwEP5W1jgywfXesM1YM1elGuPu/hF1K3yG6F/zNgB5IcQq2p8pU+z/VSI/8 lfjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D+smDHfv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a9si459255qto.11.2021.05.26.16.56.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 May 2021 16:56:36 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D+smDHfv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lm3O8-0006Vq-9q for patch@linaro.org; Wed, 26 May 2021 19:56:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34740) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lm3FI-0005c2-Ku for qemu-devel@nongnu.org; Wed, 26 May 2021 19:47:29 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:39662) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lm3F7-0004RH-4Z for qemu-devel@nongnu.org; Wed, 26 May 2021 19:47:28 -0400 Received: by mail-pj1-x1032.google.com with SMTP id o17-20020a17090a9f91b029015cef5b3c50so1243666pjp.4 for ; Wed, 26 May 2021 16:47:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=35fS2mEHUPwPaI8xH8/39rsUu1yuwzdz1o4w+eONAWI=; b=D+smDHfv1TjQyqs99zdornvb4hN7tGtGRI4F00mDXTi3DNwQlEUYv5ys6mmSrdsadL nd6xjlQ3dP/VSLLHA7QdqNJzjQv1UD5EqFEnHHbKifofTNWJLBUDMvO5bTNP5biBtUeU NITwalGZeCzl4jKmSMz4OmXZyVXZX/Mbwbv6ZobirxBt3Y9enPNVfKQaFIfAtoAf3ZPP HvFYP7QwENIJMm2FgSj/kdwOC/24yLhoNqfo0KRmLRHXp2JhmU/LnCycBqJ1XwtZkD48 OZlmcoZIegaB1JO3VjLPenKWZdR9B9ny3GXmkTP/yAxYl7MfOcRz018jWLfL2KZzAchQ P/Ug== 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=35fS2mEHUPwPaI8xH8/39rsUu1yuwzdz1o4w+eONAWI=; b=V98ub+IL1zDXcKd+5aOghUH6Yneo4AP5Gu0w+BAgNwssMTzOiM32hHhMY/iYqv012c t+jXTfe0STogsn3O5PsONvoIxagNT/Nqe/qsNjiqqSJT09mfU6wLrAWdiLu/ShX86jbH dIBl7sW5YvH8NltQdtMOm5JMfApUwYxsiwI0mQtEDureGYJ4uyhsELNuks//4skpGrLd DpOr8bScgrwd/AJE4ak5YBiTbSGmr+VhJ6drytjsROUh5rXPOFQMON8nZSfky31CNRki gb6xzHwzkjTg7ewdZCz0v8DVm4lfwCv/mIQNvvY1tLNnXIdYh9n9tfS32qO83fc/BrBJ fobw== X-Gm-Message-State: AOAM533BOqUAdEYI5AjA+Pv9Hw1CHuCFFk2hpbwA5stA7u5K9mWwQPIS wOxSuBExBT3tZ47mHd1hxJMGVKYaS5lYjw== X-Received: by 2002:a17:903:230b:b029:f4:b7cf:44aa with SMTP id d11-20020a170903230bb02900f4b7cf44aamr592078plh.31.1622072834302; Wed, 26 May 2021 16:47:14 -0700 (PDT) Received: from localhost.localdomain (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id g13sm285355pfi.18.2021.05.26.16.47.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 16:47:13 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 01/31] exec/memory_ldst_cached: Sort declarations Date: Wed, 26 May 2021 16:46:40 -0700 Message-Id: <20210526234710.125396-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210526234710.125396-1-richard.henderson@linaro.org> References: <20210526234710.125396-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé To ease the file review, sort the declarations by the size of the access (8, 16, 32). Simple code movement, no logical change. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20210518183655.1711377-2-philmd@redhat.com> Signed-off-by: Richard Henderson --- include/exec/memory_ldst_cached.h.inc | 46 +++++++++++++-------------- 1 file changed, 23 insertions(+), 23 deletions(-) -- 2.25.1 diff --git a/include/exec/memory_ldst_cached.h.inc b/include/exec/memory_ldst_cached.h.inc index 7bc8790d34..c33449d0cd 100644 --- a/include/exec/memory_ldst_cached.h.inc +++ b/include/exec/memory_ldst_cached.h.inc @@ -24,6 +24,18 @@ #define LD_P(size) \ glue(glue(ld, size), glue(ENDIANNESS, _p)) +static inline uint32_t ADDRESS_SPACE_LD_CACHED(uw)(MemoryRegionCache *cache, + hwaddr addr, MemTxAttrs attrs, MemTxResult *result) +{ + assert(addr < cache->len && 2 <= cache->len - addr); + fuzz_dma_read_cb(cache->xlat + addr, 2, cache->mrs.mr); + if (likely(cache->ptr)) { + return LD_P(uw)(cache->ptr + addr); + } else { + return ADDRESS_SPACE_LD_CACHED_SLOW(uw)(cache, addr, attrs, result); + } +} + static inline uint32_t ADDRESS_SPACE_LD_CACHED(l)(MemoryRegionCache *cache, hwaddr addr, MemTxAttrs attrs, MemTxResult *result) { @@ -48,18 +60,6 @@ static inline uint64_t ADDRESS_SPACE_LD_CACHED(q)(MemoryRegionCache *cache, } } -static inline uint32_t ADDRESS_SPACE_LD_CACHED(uw)(MemoryRegionCache *cache, - hwaddr addr, MemTxAttrs attrs, MemTxResult *result) -{ - assert(addr < cache->len && 2 <= cache->len - addr); - fuzz_dma_read_cb(cache->xlat + addr, 2, cache->mrs.mr); - if (likely(cache->ptr)) { - return LD_P(uw)(cache->ptr + addr); - } else { - return ADDRESS_SPACE_LD_CACHED_SLOW(uw)(cache, addr, attrs, result); - } -} - #undef ADDRESS_SPACE_LD_CACHED #undef ADDRESS_SPACE_LD_CACHED_SLOW #undef LD_P @@ -71,17 +71,6 @@ static inline uint32_t ADDRESS_SPACE_LD_CACHED(uw)(MemoryRegionCache *cache, #define ST_P(size) \ glue(glue(st, size), glue(ENDIANNESS, _p)) -static inline void ADDRESS_SPACE_ST_CACHED(l)(MemoryRegionCache *cache, - hwaddr addr, uint32_t val, MemTxAttrs attrs, MemTxResult *result) -{ - assert(addr < cache->len && 4 <= cache->len - addr); - if (likely(cache->ptr)) { - ST_P(l)(cache->ptr + addr, val); - } else { - ADDRESS_SPACE_ST_CACHED_SLOW(l)(cache, addr, val, attrs, result); - } -} - static inline void ADDRESS_SPACE_ST_CACHED(w)(MemoryRegionCache *cache, hwaddr addr, uint32_t val, MemTxAttrs attrs, MemTxResult *result) { @@ -93,6 +82,17 @@ static inline void ADDRESS_SPACE_ST_CACHED(w)(MemoryRegionCache *cache, } } +static inline void ADDRESS_SPACE_ST_CACHED(l)(MemoryRegionCache *cache, + hwaddr addr, uint32_t val, MemTxAttrs attrs, MemTxResult *result) +{ + assert(addr < cache->len && 4 <= cache->len - addr); + if (likely(cache->ptr)) { + ST_P(l)(cache->ptr + addr, val); + } else { + ADDRESS_SPACE_ST_CACHED_SLOW(l)(cache, addr, val, attrs, result); + } +} + static inline void ADDRESS_SPACE_ST_CACHED(q)(MemoryRegionCache *cache, hwaddr addr, uint64_t val, MemTxAttrs attrs, MemTxResult *result) {