From patchwork Tue Sep 3 16:08:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 172845 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp79174ily; Tue, 3 Sep 2019 09:28:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqzEWVJ9me9pTmTxvHlZLS5+ke+XiLFTODB3qBI/InbyG8P7+ITZZC0vDfNaV+uRXOXI4iZD X-Received: by 2002:a17:906:a294:: with SMTP id i20mr3346319ejz.179.1567528081649; Tue, 03 Sep 2019 09:28:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567528081; cv=none; d=google.com; s=arc-20160816; b=HTf5UPjgo5bKWXCrqYm6VWDxH1a70VfwJXumA0gcthRpglw+FfdKW2aijXPUQMNVd4 u8fJpXWSN7qs6QZBInX+zw/+JHlImXFhaHgtNuQK42eW0meBwdkzn8EJUhF0lRSj6aVB gz8HWQFcAwR/Kxc+N5eCLQ0a1pkamVsl7fNpy18v6NWfTkQZLd5DL3SaCnCetBSGaJb9 bJKI8jEzUqwsj9xIqvjClo0XujSkYiITiFaSsV7GOJkQ1+9HxrIReZElz6MEE/uzhtjK PEtN+f/fxx221gKqWpa23Ppp7s7MNfWJdDcx6UODcftIcXARuBr0EdAORPcElOIscb7J HPBg== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=hEBkbukp46MQLuIak3k/srHenY77lib8xqS0D+g3MQI=; b=a5HdIQEr4SMENfDqdoCVkLMPDTW8ejwn6lKm8uEus3+Ukb/n6xdSAYK4TswDa1RV2m 3RIa2b/RFisqEeMfXHxJYr7m5fsoIiBLojYt62wyXOOLhC7k+1mnikJfVumEjatEH6ov 8RW1oEOUs1E9UVDHRkImGRQdtZRb5wueRD9U7w0Zm5Pdohis6w5nC+mw/0r5TbBh5suG JUYdVOouIqB5UZBjP9Z2Exb3p4s/oopr6rEeapirLB2MtZKYIjVpDC7Oq6bghRUo8SV7 rSvBXN4VEw8tKhRrGwCy6pfxJkO9DhXOeJzAxF+H3GyaqsCaOA0ZNRJ2i8FZKEpH4b1f yM1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=D4VBPsbe; 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 x19si5776150edm.147.2019.09.03.09.28.01 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Sep 2019 09:28:01 -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=D4VBPsbe; 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]:48914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5Bey-00044v-2K for patch@linaro.org; Tue, 03 Sep 2019 12:28:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37172) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5BMr-00015h-Lg for qemu-devel@nongnu.org; Tue, 03 Sep 2019 12:09:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i5BMq-0003iU-3h for qemu-devel@nongnu.org; Tue, 03 Sep 2019 12:09:17 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:33813) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i5BMp-0003hz-TK for qemu-devel@nongnu.org; Tue, 03 Sep 2019 12:09:16 -0400 Received: by mail-pl1-x642.google.com with SMTP id d3so8112757plr.1 for ; Tue, 03 Sep 2019 09:09: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=hEBkbukp46MQLuIak3k/srHenY77lib8xqS0D+g3MQI=; b=D4VBPsberkhOzauz4I5xkp4jHGriPcsPPuKanSFsxJtx4LCERZpEzUntr7na0hpqKh V75P4urhzhUEJzopzxJut51cCtHMikvwbVsB5Lkg/2QkEYABfqRGI1j2bn+J3CG9CSHH OUs9GeQjF1k6olDXiYhWUeBE8VKsUmhQ5go/hCbKE6goUtkiljUNvlFKSFLdzxotMAYg MlUnwKyKzNkzf+iYsAX3qpLGy8ptNRkWL8GogTLhfHlV7mr4O3LHfWtXbq8hXndRPVrl Kb9C/v3n2tLaq3Hqcu5fiyPUWQvTlJThOrX/dq1F+eihRMr+0JrOEP4x+Sm1dF1RQawh h6bw== 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=hEBkbukp46MQLuIak3k/srHenY77lib8xqS0D+g3MQI=; b=UMNqIT3wg5MGJOM90QgGaasGKmIjXy5r3W7GlyYRDtuBJwX555r4dm5U/yv5efTd6b 2y78l6/veHRkOka0Ik5lifwTNxOpG3Dyta0LAeVexJUl9258y42YQ9QXEhr0CKxhUyph qAmGlVy7k0LSvDrUPvaIdtPKo+rpRW78rT1F1YFQuioM68dC4IXdSeQ0HWu7iXOe4lUo GQrdbrilapY50QVhu1vbtRgS5SVpMTpR4oNLXfdCgfvsuxL3VXkp+CwnmyAuFkgP7Mot ysqDPa9NflhEE7ZAfg60fi6ajlf+cEQx15MbaVpPK3s+Xe0kIFeBg0yk5Sms7e9MW4wA nfng== X-Gm-Message-State: APjAAAWub9vJVn5+JJcyW+lV0+sLfEsGwFOob8/tcfVfdfAr/1ueZDrC tunBYNdv1sWCr+kgIqtgQUBq3gP+kb8= X-Received: by 2002:a17:902:860b:: with SMTP id f11mr35652811plo.48.1567526950872; Tue, 03 Sep 2019 09:09:10 -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.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2019 09:09:10 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 3 Sep 2019 09:08:30 -0700 Message-Id: <20190903160858.5296-9-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> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::642 Subject: [Qemu-devel] [PATCH 08/36] exec: Access MemoryRegion with MemOp 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 The memory_region_dispatch_{read|write} operand "unsigned size" is being converted into a "MemOp op". Convert interfaces by using no-op size_memop. After all interfaces are converted, size_memop will be implemented and the memory_region_dispatch_{read|write} operand "unsigned size" will be converted into a "MemOp op". As size_memop is a no-op, this patch does not change any behaviour. Signed-off-by: Tony Nguyen Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <3b042deef0a60dd49ae2320ece92120ba6027f2b.1566466906.git.tony.nguyen@bt.com> Signed-off-by: Richard Henderson --- exec.c | 6 ++++-- memory_ldst.inc.c | 18 +++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) -- 2.17.1 diff --git a/exec.c b/exec.c index 1df966d17a..cc9697fe1b 100644 --- a/exec.c +++ b/exec.c @@ -3364,7 +3364,8 @@ static MemTxResult flatview_write_continue(FlatView *fv, hwaddr addr, /* XXX: could force current_cpu to NULL to avoid potential bugs */ val = ldn_p(buf, l); - result |= memory_region_dispatch_write(mr, addr1, val, l, attrs); + result |= memory_region_dispatch_write(mr, addr1, val, + size_memop(l), attrs); } else { /* RAM case */ ptr = qemu_ram_ptr_length(mr->ram_block, addr1, &l, false); @@ -3425,7 +3426,8 @@ MemTxResult flatview_read_continue(FlatView *fv, hwaddr addr, /* I/O case */ release_lock |= prepare_mmio_access(mr); l = memory_access_size(mr, l, addr1); - result |= memory_region_dispatch_read(mr, addr1, &val, l, attrs); + result |= memory_region_dispatch_read(mr, addr1, &val, + size_memop(l), attrs); stn_p(buf, l, val); } else { /* RAM case */ diff --git a/memory_ldst.inc.c b/memory_ldst.inc.c index acf865b900..1e8a2fc3ba 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, 4, attrs); + r = memory_region_dispatch_read(mr, addr1, &val, size_memop(4), 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, 8, attrs); + r = memory_region_dispatch_read(mr, addr1, &val, size_memop(8), 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, 1, attrs); + r = memory_region_dispatch_read(mr, addr1, &val, size_memop(1), 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, 2, attrs); + r = memory_region_dispatch_read(mr, addr1, &val, size_memop(2), 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, 4, attrs); + r = memory_region_dispatch_write(mr, addr1, val, size_memop(4), 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, 4, attrs); + r = memory_region_dispatch_write(mr, addr1, val, size_memop(4), 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, 1, attrs); + r = memory_region_dispatch_write(mr, addr1, val, size_memop(1), 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, 2, attrs); + r = memory_region_dispatch_write(mr, addr1, val, size_memop(2), 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, 8, attrs); + r = memory_region_dispatch_write(mr, addr1, val, size_memop(8), attrs); } else { /* RAM case */ ptr = qemu_map_ram_ptr(mr->ram_block, addr1);