From patchwork Sun Sep 30 08:13:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 147858 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp2667055lji; Sun, 30 Sep 2018 02:03:13 -0700 (PDT) X-Google-Smtp-Source: ACcGV62MU5UBfBL3MSctul5vX9iuwysTf+W6aN3B8C7nzG1QsxJYkUsoBmqVdrmBJogRqdl1ML/y X-Received: by 2002:aed:2253:: with SMTP id o19-v6mr4668887qtc.72.1538298193471; Sun, 30 Sep 2018 02:03:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538298193; cv=none; d=google.com; s=arc-20160816; b=FrjAK8CMkmH7u/qcY3//2Mk8v1PYKFnXyTgHv2k+biIv/CnLzxNBH6OB5I1buRp/Ql xKXYrophX4r4UZ6VSG8oUR6kYt4qp7t4wHfp4QudtV1+bBuXXmcq362zH1QfhyLLrZl6 5lgIjQfxuydT5ZqxBVGBNvexUI8y1208gZbX7v9j+ajuT605v4UrAfAjtFElRVVSgVgK cn/OLnpk5FvAXqA6oUAJNKMyXwJvSOx+eVN/lYi+9BKWcf41DHWYxgpRawtgDqGjdcVz QLQaiI+ZIsJOib36MYVWLV/lS1vRjQlBR0oQCwBV+6OCQQhh6h5N81hDEQ79mlHmX9Pg qJMA== 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=s7Bu+uzW3BicMDf2fX0cUiMAdEB7LDlujFfBaRPQ7XI=; b=GfIY8GuGJdLgavmzQvctMdtLN2k8W/CS3F3/LL09YHrxsLtCq1ciGbcCG/IVJfh5u1 4wq7na8okPPn5MC3w4ds80c8BT8uNDhFXE4wY1C/l7KU3zP+am4Www/JVdxKbj7nPcIW qtEThEFd1n9HWohjBYx2T+zfziFI6IQ+XSEzHwV5nokqktAnyPDMRZ8WjmuTOm3YSXhn HHg6ANln06e0UEKgXLb7S6dleT1y8P+1IWyuD6cFDc7BpZyqB3JQPn/J1irFCyjKugB1 0sdolGjdzbvUVbj/xRmeGYj0y9MSHYNPtYkkkn2OlThmB5GTc2Fp3TKbZ4IUSdmTG7Mw Cshw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=GXazReh3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id r4-v6si2182699qvn.102.2018.09.30.02.03.13 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 30 Sep 2018 02:03:13 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=GXazReh3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:54498 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6XdB-0008FN-0Q for patch@linaro.org; Sun, 30 Sep 2018 05:03:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41920) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6WsI-0003Bv-Sb for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:14:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6WsC-0001I8-QB for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:14:43 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:34835) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g6WsC-0001Ee-0q for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:14:40 -0400 Received: by mail-wm1-x32a.google.com with SMTP id o18-v6so5779308wmc.0 for ; Sun, 30 Sep 2018 01:14:38 -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; bh=s7Bu+uzW3BicMDf2fX0cUiMAdEB7LDlujFfBaRPQ7XI=; b=GXazReh38DBoPheP5z0wtJ2eQr7My+9yMYDaJSaiXsvnhwDQLfu/18qw66HTrSsA59 t4l6bCpbEFlfUQtl6YONd+mecJHUkuBOBLLwBnlcdUBqumqFVApqPoF0m8uTIIF7zkhs 4t/ZDOKojea0tHvf01eBd0Shu32n1ekPq2AC9cveyqv70OwOVOzKLZuURc0myP3ZHKrK WOmYNBS+QcKvIn2j/oHSabNr6OHXaRCJvm5BvqapRx5Ctsp2UZSoNd5CHxpkm7H2YnIk h41sDGFUzG2o6KEDd55DC8f5j3WJrYZzRukiElur1lIrAPhZh3kDOvEbzhT4Tu1WMkv+ OCnA== 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; bh=s7Bu+uzW3BicMDf2fX0cUiMAdEB7LDlujFfBaRPQ7XI=; b=XO9bYQMNuMrGcZ/ODE/SNIxJrz/HoCLraeDYGetF6bUImbvfIwwDzLL65O/va6NSTl s227LS9/VdKy/IwEYfZ7iBTYiH5YwOrvWtO+YwtZ0ZZrw28/yuDd6SVEOv2eMm1iRjqQ Y5iJd1DWHNWlJAaUskOZsrSbFyDuInsg3Lx5QQIROIB2KYG6vk2NJ0aq1F0TRP/q9G0O Cl7l1gputc6JaC+OiaGDj79MsODZZw4ndc5f5l1RBowgXVm+kEtGEb5S1zZeRLoY2KJg hVywemfDfKx9KSBdOPasOEiXWzAXj5wqs73rz9KVBhx9BeljNOQSDHjsHYOcaz2lLqzV /sOg== X-Gm-Message-State: ABuFfogmZOUTpl14pm5xhD2An0v9r/NKtNrRuyKF5Np1Y6/wKN5mXBdp nq7brz9lz1hT7SCIO9PpvGKWFixO X-Received: by 2002:a1c:2dc5:: with SMTP id t188-v6mr5708090wmt.94.1538295276844; Sun, 30 Sep 2018 01:14:36 -0700 (PDT) Received: from 640k.lan (94-36-187-248.adsl-ull.clienti.tiscali.it. [94.36.187.248]) by smtp.gmail.com with ESMTPSA id u76-v6sm11369194wmd.10.2018.09.30.01.14.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Sep 2018 01:14:36 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sun, 30 Sep 2018 10:13:13 +0200 Message-Id: <1538295197-23704-76-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1538295197-23704-1-git-send-email-pbonzini@redhat.com> References: <1538295197-23704-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32a Subject: [Qemu-devel] [PULL 75/79] memory: Remove old_mmio accessors X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell Now that all the users of old_mmio MemoryRegion accessors have been converted, we can remove the core code support. Signed-off-by: Peter Maydell Message-Id: <20180824170422.5783-2-peter.maydell@linaro.org> Based-on: <20180802174042.29234-1-peter.maydell@linaro.org> Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- docs/devel/memory.txt | 2 -- include/exec/memory.h | 5 ---- memory.c | 63 ++------------------------------------------------- 3 files changed, 2 insertions(+), 68 deletions(-) -- 1.8.3.1 diff --git a/docs/devel/memory.txt b/docs/devel/memory.txt index c1dee12..4fff0d5 100644 --- a/docs/devel/memory.txt +++ b/docs/devel/memory.txt @@ -342,5 +342,3 @@ various constraints can be supplied to control how these callbacks are called: - .impl.unaligned specifies that the *implementation* supports unaligned accesses; if false, unaligned accesses will be emulated by two aligned accesses. - - .old_mmio eases the porting of code that was formerly using - cpu_register_io_memory(). It should not be used in new code. diff --git a/include/exec/memory.h b/include/exec/memory.h index e78a9a4..3a427aa 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -201,11 +201,6 @@ struct MemoryRegionOps { */ bool unaligned; } impl; - - /* If .read and .write are not present, old_mmio may be used for - * backwards compatibility with old mmio registration - */ - const MemoryRegionMmio old_mmio; }; enum IOMMUMemoryRegionAttr { diff --git a/memory.c b/memory.c index b96aec7..d852f11 100644 --- a/memory.c +++ b/memory.c @@ -423,32 +423,6 @@ static int get_cpu_index(void) return -1; } -static MemTxResult memory_region_oldmmio_read_accessor(MemoryRegion *mr, - hwaddr addr, - uint64_t *value, - unsigned size, - signed shift, - uint64_t mask, - MemTxAttrs attrs) -{ - uint64_t tmp; - - tmp = mr->ops->old_mmio.read[ctz32(size)](mr->opaque, addr); - if (mr->subpage) { - trace_memory_region_subpage_read(get_cpu_index(), mr, addr, tmp, size); - } else if (mr == &io_mem_notdirty) { - /* Accesses to code which has previously been translated into a TB show - * up in the MMIO path, as accesses to the io_mem_notdirty - * MemoryRegion. */ - trace_memory_region_tb_read(get_cpu_index(), addr, tmp, size); - } else if (TRACE_MEMORY_REGION_OPS_READ_ENABLED) { - hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr); - trace_memory_region_ops_read(get_cpu_index(), mr, abs_addr, tmp, size); - } - memory_region_shift_read_access(value, shift, mask, tmp); - return MEMTX_OK; -} - static MemTxResult memory_region_read_accessor(MemoryRegion *mr, hwaddr addr, uint64_t *value, @@ -502,31 +476,6 @@ static MemTxResult memory_region_read_with_attrs_accessor(MemoryRegion *mr, return r; } -static MemTxResult memory_region_oldmmio_write_accessor(MemoryRegion *mr, - hwaddr addr, - uint64_t *value, - unsigned size, - signed shift, - uint64_t mask, - MemTxAttrs attrs) -{ - uint64_t tmp = memory_region_shift_write_access(value, shift, mask); - - if (mr->subpage) { - trace_memory_region_subpage_write(get_cpu_index(), mr, addr, tmp, size); - } else if (mr == &io_mem_notdirty) { - /* Accesses to code which has previously been translated into a TB show - * up in the MMIO path, as accesses to the io_mem_notdirty - * MemoryRegion. */ - trace_memory_region_tb_write(get_cpu_index(), addr, tmp, size); - } else if (TRACE_MEMORY_REGION_OPS_WRITE_ENABLED) { - hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr); - trace_memory_region_ops_write(get_cpu_index(), mr, abs_addr, tmp, size); - } - mr->ops->old_mmio.write[ctz32(size)](mr->opaque, addr, tmp); - return MEMTX_OK; -} - static MemTxResult memory_region_write_accessor(MemoryRegion *mr, hwaddr addr, uint64_t *value, @@ -1418,16 +1367,12 @@ static MemTxResult memory_region_dispatch_read1(MemoryRegion *mr, mr->ops->impl.max_access_size, memory_region_read_accessor, mr, attrs); - } else if (mr->ops->read_with_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); - } else { - return access_with_adjusted_size(addr, pval, size, 1, 4, - memory_region_oldmmio_read_accessor, - mr, attrs); } } @@ -1499,17 +1444,13 @@ MemTxResult memory_region_dispatch_write(MemoryRegion *mr, mr->ops->impl.max_access_size, memory_region_write_accessor, mr, attrs); - } else if (mr->ops->write_with_attrs) { + } else { return access_with_adjusted_size(addr, &data, size, mr->ops->impl.min_access_size, mr->ops->impl.max_access_size, memory_region_write_with_attrs_accessor, mr, attrs); - } else { - return access_with_adjusted_size(addr, &data, size, 1, 4, - memory_region_oldmmio_write_accessor, - mr, attrs); } }