From patchwork Fri Jan 6 08:28:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 639686 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp660056pvb; Fri, 6 Jan 2023 00:34:01 -0800 (PST) X-Google-Smtp-Source: AMrXdXvOEFoPavVFxwDiE4oEkCSvRHm9gKiRZI8VIMccxtQlKu/CLJhYGiZiMuKr6M4HJsv/OXki X-Received: by 2002:a0c:f906:0:b0:531:be1a:89af with SMTP id v6-20020a0cf906000000b00531be1a89afmr29547304qvn.6.1672994041345; Fri, 06 Jan 2023 00:34:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672994041; cv=none; d=google.com; s=arc-20160816; b=Q96k8xIvxqkFiC1lwSDEkJe8jNWFoQGGXElt3WS31ZhT7U1+XRip8xJ6BEog0ErOxQ wRxs0OqfHCLezTpk2VPeyC/eH8mZnGJEKwUd68IQuYMKznsB2+wMb7U3OVNoEdVOoTkx OclwCnynvvMn94vimyk7VDxKsDX+K9FJjmb40c2xRQmiA3vPx0CLP5u8/uE+3K/FlF+4 il1aYTsXJ7m3hKvdM+TQpRWpv9UY+VsjRmn4Ee3GaPaC1zaWiGptjZEmEBJkKI4ltVp2 9LxDK/dN00qKulwd+tP+l9KvujSnN1riPl3NOsOvhT77akf8d29+NpUfsAtpnF1yzvvH 32eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=Xl/kPsma4+CokXD027GgAKWxG1Cp4Q3btDYha9T9ayI=; b=YEWObLnAnxh2TQqR9qlR8/fXt/EaDEBtn5LauMbGv9SeYCmG06QLIDX2XAzmKabBAN ziIwl+4IpnhLDKtFY8UTAe6O/6eHKTOvwvJLorFlKrKHhl0h4I/XU8NUQkTEOWFa9S35 m18ZH5GGsjOmszT2Vq1N0SrWX89bpYKfljMEpsr4H7/NCzW0PlatKq4hzLW9Sa5U+G9C 1YnXPGj5M0ouXCYOlDRUvTOSPrLVFrp2QnICnFxYuLKhEmcqpDCqy+2+OTb1pf30cUey xNwQZfIjBk1uxldl9cXzGMO7nrTcAPftOnLrNhY+//zczDGbTbX8WyAg7p7H+46JGkgR 5BDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YdjABc7u; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c9-20020a056214224900b004ad311da286si252302qvc.280.2023.01.06.00.34.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Jan 2023 00:34:01 -0800 (PST) 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=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YdjABc7u; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDi68-0002XC-O2; Fri, 06 Jan 2023 03:29:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDi67-0002X0-60 for qemu-devel@nongnu.org; Fri, 06 Jan 2023 03:29:07 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDi65-0005VB-Fl for qemu-devel@nongnu.org; Fri, 06 Jan 2023 03:29:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672993744; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Xl/kPsma4+CokXD027GgAKWxG1Cp4Q3btDYha9T9ayI=; b=YdjABc7uQ8x9lJR7aShyNC6mLBp4dGds9YoC/AYI9Hdh5406l5MHOeLo68YKkOUaghnGnS V3p3FkPyspyWHA3/O4ILdedUM0MDfdZAdFGXdgoDwtoqhP5ODxouAdmYZqHyk+zXmkNwfn HqzLikdx40yB87E/mwazaaRXDXsriJk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-475-abkVrsUKMc-LIQeczTJrTQ-1; Fri, 06 Jan 2023 03:29:02 -0500 X-MC-Unique: abkVrsUKMc-LIQeczTJrTQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7B0C9183B3C8; Fri, 6 Jan 2023 08:29:02 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.37]) by smtp.corp.redhat.com (Postfix) with ESMTP id 71357492B06; Fri, 6 Jan 2023 08:29:01 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Cc: Nikita Ivanov Subject: [PULL 04/15] exec/memory: Expose memory_region_access_valid() Date: Fri, 6 Jan 2023 09:28:42 +0100 Message-Id: <20230106082853.31787-5-thuth@redhat.com> In-Reply-To: <20230106082853.31787-1-thuth@redhat.com> References: <20230106082853.31787-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Instead of having hardware device poking into memory internal API, expose memory_region_access_valid(). Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20221217152454.96388-2-philmd@linaro.org> Reviewed-by: Eric Farman Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Signed-off-by: Thomas Huth --- include/exec/memory-internal.h | 4 ---- include/exec/memory.h | 4 ++++ hw/s390x/s390-pci-inst.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h index 9fcc2af25c..100c1237ac 100644 --- a/include/exec/memory-internal.h +++ b/include/exec/memory-internal.h @@ -38,10 +38,6 @@ void flatview_unref(FlatView *view); extern const MemoryRegionOps unassigned_mem_ops; -bool memory_region_access_valid(MemoryRegion *mr, hwaddr addr, - unsigned size, bool is_write, - MemTxAttrs attrs); - void flatview_add_to_dispatch(FlatView *fv, MemoryRegionSection *section); AddressSpaceDispatch *address_space_dispatch_new(FlatView *fv); void address_space_dispatch_compact(AddressSpaceDispatch *d); diff --git a/include/exec/memory.h b/include/exec/memory.h index 91f8a2395a..c37ffdbcd1 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -2442,6 +2442,10 @@ void memory_global_dirty_log_stop(unsigned int flags); void mtree_info(bool flatview, bool dispatch_tree, bool owner, bool disabled); +bool memory_region_access_valid(MemoryRegion *mr, hwaddr addr, + unsigned size, bool is_write, + MemTxAttrs attrs); + /** * memory_region_dispatch_read: perform a read directly to the specified * MemoryRegion. diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c index 9abe95130c..2eee5db7e1 100644 --- a/hw/s390x/s390-pci-inst.c +++ b/hw/s390x/s390-pci-inst.c @@ -13,7 +13,7 @@ #include "qemu/osdep.h" #include "exec/memop.h" -#include "exec/memory-internal.h" +#include "exec/memory.h" #include "qemu/error-report.h" #include "sysemu/hw_accel.h" #include "hw/s390x/s390-pci-inst.h"