From patchwork Sat Jun 19 17:26:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 463875 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp1017956jao; Sat, 19 Jun 2021 10:27:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyE8sSgM4DypMoQq3EMBWyCZj8FHKZdF5GOthRneylqyNCIdHSYnRR13THB+LozTvaXE4BJ X-Received: by 2002:a02:335c:: with SMTP id k28mr8952824jak.4.1624123666511; Sat, 19 Jun 2021 10:27:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624123666; cv=none; d=google.com; s=arc-20160816; b=YHog7WYbSwePd+YLMyh96veH8TlIjRTYe4VlGmGnoJA9pV/psrtSQSKryAKRGbdeGp xppwXm37c2TOJILCfPVwFsWXNlbVOT/UKI4QUcg8yJgBoelaaMIol4A75Cf11dUELb4l WGHft+33leMy1pvsWbsUjss/krn0pwtuS3u6xyKLC+wH1WceJsNwj4BXx76ud2Pg9tlc 8rETbPxbJfCbOkTVf/Win8ILJAqxCcSDENJPVyzOQH1e4iZi0xSPEYyZJqEL1x3p4FKD 9SsMwBScZvPVdOPv07PWzfsNtptjjjQYyp+3ZNv0x6qjfWSXxhliAahbnlpYF3kkqFi7 KEjQ== 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=LWmu+dTNMI/txdqEE+yhKRacDvD3OHPjYjOyiCQwuBU=; b=W5CrMV2y5JKC6zARI36naWJsFba1GoXCPfZJqkXIPxpszT8WSJH4sA+Irh1G3rK/8y k3kvpmV2aMwIM/6gbeNkmC/FeVHnsIRG61n2SFC0//VMhYCTuzdGE6EqZLo36bYhsHjO Eeg+Q7ZYIiUt8aAjZ0o2/S+f0D5x42fL2xQ6olU3FR+Kn9nMipe3XA7khzDAJGJafpjO ehEuVPVI8qWfEhWZErryNUvoOZEvduZjUaMfmOMBDATMLRlyl8yfWRJOlzp3U9URepIn 5dj/aLo/0LOIB34vltqcYyqkEly53JfNkiHWyTMVMjut7l+Pkm/GtkUAIDcKlzMO5jXK x09A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Pe1bii0h; 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 r6si6015541ilm.57.2021.06.19.10.27.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 19 Jun 2021 10:27:46 -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=Pe1bii0h; 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]:33356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1luekz-0003YS-To for patch@linaro.org; Sat, 19 Jun 2021 13:27:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55352) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luejq-0003QR-Oe for qemu-devel@nongnu.org; Sat, 19 Jun 2021 13:26:34 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:35826) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1luejo-0003ZX-VC for qemu-devel@nongnu.org; Sat, 19 Jun 2021 13:26:34 -0400 Received: by mail-pl1-x634.google.com with SMTP id x19so6305368pln.2 for ; Sat, 19 Jun 2021 10:26:32 -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=LWmu+dTNMI/txdqEE+yhKRacDvD3OHPjYjOyiCQwuBU=; b=Pe1bii0hzAhdzwxZvdgGicTQVdxn9y1NX/fJyGjWNCeWLSkaBeu6NKCw4YLgXxMsCC 35gORmYnhmODWDuEKIFOS4qbR1bnHygtE0FZgTu8AOK/TEgb3zkMo2VQ6NI8TsQQroxV 4v1eNrX1vyZRKbyHg7kY8igTPuzmJmFI+r7s5RjgM4usN0Jx8Ah9GXk8/zU92RtRrlyn d1dYusNiGkzG0+WWnfQpK9oZJgvr10imvlXTnbqZybESLn+eNEZqqksHRhqGSt0kGl+U XhfVUTWa6neaAck1d0jYtJ4uOAC2bWA4WNlae1YXUm1s9F15VJm5XoTN5yickoDDfqAW 63HA== 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=LWmu+dTNMI/txdqEE+yhKRacDvD3OHPjYjOyiCQwuBU=; b=q/bUXvtZJ7QtJMlOD2mzXKT0Hojx+xmWsXA+ELvk4CACqV9mWkDwsrXfH6WYwrluMK bsPeue1dMZCWhySOrQ2tWDXfUI5ndwXq4NBzeNfS2DnXwRE68EPLEv75C/zu/ZwWDPir GV11HY5Fc3ZNcFenFZzvmZ2NtWV25UF1UizRsAo8Znq2acRI9EsMhnLWfjscg+jq+VS6 FQHBk3h/YsbbuPAyFphN/tq3V4S//awgXp8AlmXh7FkFVHroSLuUAH2sd4cloJqnVRT4 t4or+NxijQzXMVSIT2u1Mvf+1KiAAASr+FFX9FKsB6dwXqbV1/TbBqvaYP7qcsIDaY0G 6jTA== X-Gm-Message-State: AOAM533TWSQ78og+Ej/h6wOQKa/ibdpchPFBJDDbIQpbH1EHqBw6SznO X+a5J9htxTTd+Gj/Ry4qorR8CwhAs/7zGg== X-Received: by 2002:a17:90b:4c44:: with SMTP id np4mr17625046pjb.121.1624123591786; Sat, 19 Jun 2021 10:26:31 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id co18sm2084241pjb.37.2021.06.19.10.26.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Jun 2021 10:26:31 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 06/15] softmmu/memory: Inline memory_region_dispatch_read1 Date: Sat, 19 Jun 2021 10:26:17 -0700 Message-Id: <20210619172626.875885-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210619172626.875885-1-richard.henderson@linaro.org> References: <20210619172626.875885-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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: alex.bennee@linaro.org, pbonzini@redhat.com, mark.cave-ayland@ilande.co.uk, f4bug@amsat.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Inline the body into the only caller of this function. Signed-off-by: Richard Henderson --- softmmu/memory.c | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-) -- 2.25.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/softmmu/memory.c b/softmmu/memory.c index f0161515e9..744c5a80bd 100644 --- a/softmmu/memory.c +++ b/softmmu/memory.c @@ -1408,29 +1408,6 @@ bool memory_region_access_valid(MemoryRegion *mr, return true; } -static MemTxResult memory_region_dispatch_read1(MemoryRegion *mr, - hwaddr addr, - uint64_t *pval, - unsigned size, - MemTxAttrs attrs) -{ - *pval = 0; - - if (mr->ops->read) { - return access_with_adjusted_size(addr, pval, size, - mr->ops->impl.min_access_size, - mr->ops->impl.max_access_size, - memory_region_read_accessor, - mr, attrs); - } else { - return access_with_adjusted_size(addr, pval, size, - mr->ops->impl.min_access_size, - mr->ops->impl.max_access_size, - memory_region_read_with_attrs_accessor, - mr, attrs); - } -} - MemTxResult memory_region_dispatch_read(MemoryRegion *mr, hwaddr addr, uint64_t *pval, @@ -1445,7 +1422,20 @@ MemTxResult memory_region_dispatch_read(MemoryRegion *mr, return MEMTX_DECODE_ERROR; } - r = memory_region_dispatch_read1(mr, addr, pval, size, attrs); + *pval = 0; + if (mr->ops->read) { + r = access_with_adjusted_size(addr, pval, size, + mr->ops->impl.min_access_size, + mr->ops->impl.max_access_size, + memory_region_read_accessor, + mr, attrs); + } else { + r = access_with_adjusted_size(addr, pval, size, + mr->ops->impl.min_access_size, + mr->ops->impl.max_access_size, + memory_region_read_with_attrs_accessor, + mr, attrs); + } adjust_endianness(mr, pval, op); return r; }