From nobody Thu Nov 6 01:10:28 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1538298255709824.4646836014373; Sun, 30 Sep 2018 02:04:15 -0700 (PDT) Received: from localhost ([::1]:54501 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6Xe6-0000No-JJ for importer@patchew.org; Sun, 30 Sep 2018 05:04:10 -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) 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) 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-Google-Smtp-Source: ACcGV62zLF8ywrPgpakvfD5g53jQ9wIGX2AK4nEClXJpYMkxbIBHctOOEfvlGQKx5lO6bQo+wbCqRg== X-Received: by 2002:a1c:2dc5:: with SMTP id t188-v6mr5708090wmt.94.1538295276844; 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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(-) 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 thes= e 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; }; =20 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; } =20 -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 =3D mr->ops->old_mmio.read[ctz32(size)](mr->opaque, addr); - if (mr->subpage) { - trace_memory_region_subpage_read(get_cpu_index(), mr, addr, tmp, s= ize); - } else if (mr =3D=3D &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 =3D memory_region_to_absolute_addr(mr, addr); - trace_memory_region_ops_read(get_cpu_index(), mr, abs_addr, tmp, s= ize); - } - 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_acces= sor(MemoryRegion *mr, return r; } =20 -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 =3D 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 =3D=3D &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 =3D 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(Mem= oryRegion *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_acc= essor, mr, attrs); - } else { - return access_with_adjusted_size(addr, pval, size, 1, 4, - memory_region_oldmmio_read_access= or, - mr, attrs); } } =20 @@ -1499,17 +1444,13 @@ MemTxResult memory_region_dispatch_write(MemoryRegi= on *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_acces= sor, mr, attrs); - } else { - return access_with_adjusted_size(addr, &data, size, 1, 4, - memory_region_oldmmio_write_acces= sor, - mr, attrs); } } =20 --=20 1.8.3.1