From patchwork Tue Sep 3 16:08:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 172839 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp71299ily; Tue, 3 Sep 2019 09:21:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxcDtA6m89JRCrzgHWOiSxpH/t+zrgg/EulRnIxMU7e0Xr5h44u/RpSdqPwzPwX7e9mnhrF X-Received: by 2002:a50:f418:: with SMTP id r24mr19402083edm.248.1567527716373; Tue, 03 Sep 2019 09:21:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567527716; cv=none; d=google.com; s=arc-20160816; b=wYSpM5WduPFBzcgARN4G1d954WTPTlfO/y9xxr2sYiMNnmEF2RtqW64aB573FBK/3T Wh5uEuq/ziEbOXLXFu8PDebmFd/oXi2cuK4Fvhl4JbitZdWnEOmw8npmFOnbYZSt89z8 ESgAYv6slH6mWqzM/EnGVEZv+LPOYete+C0gHwSYmZeJ2NyqfVm+3BDBAOPNmr1iA9zS wMCPfClGocoAPng8jVgetBPD7beE7EgmLGTX3P3xAcnfiN8SNhmxFAx+z3OcL/XQZH7S pND79rqLSveL06PWkNe5DrKFYsx1sqfMvo2qautTQPwqoWpNU8kGR4R5T+bvb5XsloXn Ugmw== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=QUELZke21EDjOzUmfr5OazuxTZ4XzsbULsMXR7XqLTU=; b=PJL0puHuX+tdi385mRGdQd+6T4poLUujbbYKuYGpHqD0/pFbHjf90lQEW1B7BxlZf4 JZenjCsbkLF3ipN8LcG4Ywff5Q8vxRfuwmjk/LAanOqhhTr+31FAitn+e+UmKuWm5v// o+PxQzWH5N/hL0roTQGV5hRD/9vaxeoMExax1cHNYsqgUB3EjPBN4RRqP4Hau0PQgQ2F AqoAkAPN6m37d3L9gKc8yYwR+ut2mLENuH1q77gAmvG/flSFOff545O1QbiYQI4E4jqQ TD3VHcnsEjNs0iBPFGZjaadTJqe8T/boGyEzG/M3zqh7NjA0NrUzQqKdfK0NJxu1+ZR5 j7og== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="MkB/qnYw"; 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=fail (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 w58si5975811edw.353.2019.09.03.09.21.56 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Sep 2019 09:21:56 -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=fail header.i=@linaro.org header.s=google header.b="MkB/qnYw"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:48742 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5BZ4-0004C7-Hg for patch@linaro.org; Tue, 03 Sep 2019 12:21:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37201) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5BMt-00019W-UU for qemu-devel@nongnu.org; Tue, 03 Sep 2019 12:09:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i5BMs-0003kO-Jv for qemu-devel@nongnu.org; Tue, 03 Sep 2019 12:09:19 -0400 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:41993) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i5BMs-0003jx-Ds for qemu-devel@nongnu.org; Tue, 03 Sep 2019 12:09:18 -0400 Received: by mail-pf1-x442.google.com with SMTP id w22so2621911pfi.9 for ; Tue, 03 Sep 2019 09:09:18 -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; bh=QUELZke21EDjOzUmfr5OazuxTZ4XzsbULsMXR7XqLTU=; b=MkB/qnYwcNb1A3DbtngTrGDuMb1dg3P3HdBv5CiD9Y7Tm/AlDGmznXhyuhmEazheAo QDqg7UyjyLsCYMYHTH9iLl0RULQuFJrwbq1Vpgn1U6x7fRiAjC2IcEsGiwdxr5XWf33r P1OcQ7qwTMxSoRkigFmcxLfZ6aCiQ1/KenzYMjL0uZqa7onQWsdG25CzBKIfV6PaVJ4Q iO3W3MNaWyOr/Y1nGMHawxsU7fAmu+sWVX7PK7Moq9xq8L1zcjHsGen8xC805yCJbmI4 4KoJn2h6KrYMUxSmEmYpga5VboznpkB9piJHapJQqzm1HyPC7z+sinSlhGikABWWp+0/ bbdA== 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; bh=QUELZke21EDjOzUmfr5OazuxTZ4XzsbULsMXR7XqLTU=; b=aVc0zMZwIClVUhv1m78/Jf8/rNcJsm/Anr4jjXnUlF9yGaGzjq1aqgb6jFgGlTu34j grtPaYbyz+1d70Y7TAaJjEsNw0lZpdATD1VVtU3LOOhvjO1vOs36xSYhXHpGeUDj9zYE Z77U4YPlktC45xeWV1loLrpND+l2GTVrTa4iun4k+ElhmFIfsPylf+XHp67rtjTIcpY5 zpUpbdSY3Eo0659NycTSoqCBJcdYMeXCa++UD6Mis9jc4Lf3GaTVqv+CWJSMmHhitBNQ K2wjjgziCUx5CSNDhESQwux9CVK1sTASnUAAAStsEUdM9Le4ei4EwLFKQSdN1PH4p/DQ u4iA== X-Gm-Message-State: APjAAAWxFyQ93KAPznTR31tRrt/SjOg48ecC6/yPkRl4MC0GMfqnZjyL ICwoI0jW/rzC4htca+Unp246tl604jw= X-Received: by 2002:a17:90a:f98e:: with SMTP id cq14mr66101pjb.52.1567526957129; Tue, 03 Sep 2019 09:09:17 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id 127sm28089711pfy.56.2019.09.03.09.09.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2019 09:09:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 3 Sep 2019 09:08:35 -0700 Message-Id: <20190903160858.5296-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190903160858.5296-1-richard.henderson@linaro.org> References: <20190903160858.5296-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::442 Subject: [Qemu-devel] [PATCH 13/36] exec: Hard code size with MO_{8|16|32|64} 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, Tony Nguyen Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Tony Nguyen Temporarily no-op size_memop was introduced to aid the conversion of memory_region_dispatch_{read|write} operand "unsigned size" into "MemOp op". Now size_memop is implemented, again hard coded size but with MO_{8|16|32|64}. This is more expressive and avoids size_memop calls. Signed-off-by: Tony Nguyen Reviewed-by: Richard Henderson Message-Id: <99f69701cad294db638f84abebc58115e1b9de9a.1566466906.git.tony.nguyen@bt.com> Signed-off-by: Richard Henderson --- memory_ldst.inc.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) -- 2.17.1 diff --git a/memory_ldst.inc.c b/memory_ldst.inc.c index 1e8a2fc3ba..de658c40c4 100644 --- a/memory_ldst.inc.c +++ b/memory_ldst.inc.c @@ -38,7 +38,7 @@ static inline uint32_t glue(address_space_ldl_internal, SUFFIX)(ARG1_DECL, release_lock |= prepare_mmio_access(mr); /* I/O case */ - r = memory_region_dispatch_read(mr, addr1, &val, size_memop(4), attrs); + r = memory_region_dispatch_read(mr, addr1, &val, MO_32, attrs); #if defined(TARGET_WORDS_BIGENDIAN) if (endian == DEVICE_LITTLE_ENDIAN) { val = bswap32(val); @@ -114,7 +114,7 @@ static inline uint64_t glue(address_space_ldq_internal, SUFFIX)(ARG1_DECL, release_lock |= prepare_mmio_access(mr); /* I/O case */ - r = memory_region_dispatch_read(mr, addr1, &val, size_memop(8), attrs); + r = memory_region_dispatch_read(mr, addr1, &val, MO_64, attrs); #if defined(TARGET_WORDS_BIGENDIAN) if (endian == DEVICE_LITTLE_ENDIAN) { val = bswap64(val); @@ -188,7 +188,7 @@ uint32_t glue(address_space_ldub, SUFFIX)(ARG1_DECL, release_lock |= prepare_mmio_access(mr); /* I/O case */ - r = memory_region_dispatch_read(mr, addr1, &val, size_memop(1), attrs); + r = memory_region_dispatch_read(mr, addr1, &val, MO_8, attrs); } else { /* RAM case */ ptr = qemu_map_ram_ptr(mr->ram_block, addr1); @@ -224,7 +224,7 @@ static inline uint32_t glue(address_space_lduw_internal, SUFFIX)(ARG1_DECL, release_lock |= prepare_mmio_access(mr); /* I/O case */ - r = memory_region_dispatch_read(mr, addr1, &val, size_memop(2), attrs); + r = memory_region_dispatch_read(mr, addr1, &val, MO_16, attrs); #if defined(TARGET_WORDS_BIGENDIAN) if (endian == DEVICE_LITTLE_ENDIAN) { val = bswap16(val); @@ -300,7 +300,7 @@ void glue(address_space_stl_notdirty, SUFFIX)(ARG1_DECL, if (l < 4 || !memory_access_is_direct(mr, true)) { release_lock |= prepare_mmio_access(mr); - r = memory_region_dispatch_write(mr, addr1, val, size_memop(4), attrs); + r = memory_region_dispatch_write(mr, addr1, val, MO_32, attrs); } else { ptr = qemu_map_ram_ptr(mr->ram_block, addr1); stl_p(ptr, val); @@ -346,7 +346,7 @@ static inline void glue(address_space_stl_internal, SUFFIX)(ARG1_DECL, val = bswap32(val); } #endif - r = memory_region_dispatch_write(mr, addr1, val, size_memop(4), attrs); + r = memory_region_dispatch_write(mr, addr1, val, MO_32, attrs); } else { /* RAM case */ ptr = qemu_map_ram_ptr(mr->ram_block, addr1); @@ -408,7 +408,7 @@ void glue(address_space_stb, SUFFIX)(ARG1_DECL, mr = TRANSLATE(addr, &addr1, &l, true, attrs); if (!memory_access_is_direct(mr, true)) { release_lock |= prepare_mmio_access(mr); - r = memory_region_dispatch_write(mr, addr1, val, size_memop(1), attrs); + r = memory_region_dispatch_write(mr, addr1, val, MO_8, attrs); } else { /* RAM case */ ptr = qemu_map_ram_ptr(mr->ram_block, addr1); @@ -451,7 +451,7 @@ static inline void glue(address_space_stw_internal, SUFFIX)(ARG1_DECL, val = bswap16(val); } #endif - r = memory_region_dispatch_write(mr, addr1, val, size_memop(2), attrs); + r = memory_region_dispatch_write(mr, addr1, val, MO_16, attrs); } else { /* RAM case */ ptr = qemu_map_ram_ptr(mr->ram_block, addr1); @@ -524,7 +524,7 @@ static void glue(address_space_stq_internal, SUFFIX)(ARG1_DECL, val = bswap64(val); } #endif - r = memory_region_dispatch_write(mr, addr1, val, size_memop(8), attrs); + r = memory_region_dispatch_write(mr, addr1, val, MO_64, attrs); } else { /* RAM case */ ptr = qemu_map_ram_ptr(mr->ram_block, addr1);