From patchwork Sat Dec 17 15:24:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 634846 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp1413581pvb; Sat, 17 Dec 2022 07:25:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf57Enpg206LhbrWhlMR8CCv4WPR7iU46fmmXsmjaEBlYIZXe3hzusnJ7JY0BKF4P8w5XXo1 X-Received: by 2002:a05:6214:186d:b0:4c7:b0f:6751 with SMTP id eh13-20020a056214186d00b004c70b0f6751mr44747843qvb.4.1671290733909; Sat, 17 Dec 2022 07:25:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671290733; cv=none; d=google.com; s=arc-20160816; b=zybLiY9KXgrL5Vq1hDAyGDixkaxIQTw3ZbappG75yxXq2jRKvK3guTy0XgR9eLMh1I ww+dWgApd/ZwMw5YQ0z5+8j71W3WGHL5pY7TVp0fbf2OA7Af4MV24UvkKMDJtixMGh1m O9dFPbutMzsh1Vaa1godTnO6Q70g3FdJVDerGd0NcnoEgxG1Fsxie/ILFaAMWoDrIo44 18izHIEkoYmLfpiZ573ZWCOBPHvi1FhX3etR1AXmi88iLh9j0yf2kHxUYfV7VVE7HB03 mCSkZwEL6uC24inXipSlDOi/ThUUbkNHyhxCePhN2SmbYXDB8Ttm5QgTE+2yCwvxo2Ie Shbg== 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=1e1FU0aKLX/Wox+fFOeQyUefxVtLx/iUwvcr67HGk04=; b=nYccmV+1fkzAHNbcJoGMpiNIdR4xBhD08luicUn2SOgzC/JuDYI1k87tH5dxZ0slMB pSGaRvM7yRBe2A9jqAdLMDykV4w/IIZ3XeFPlmyGpvyqdWGmEmxRaRBaIwHtFHFwWIzG YV4NwtcDs7lLCSkXvGw3J0WppV3AJDKVb6OXhwkd4SQaPqxOMN9RB7QmjJvAG3R0zT0/ BY+oZlAXLVJEzoVyLtVQGEhuOiTSRKPeAcy3tDfjx53fzwqcQxsAqH4WC4ukAqyCGbdE QKdVdT5SGCfUlOAtzIjuechAjv3RCHF5N4wkzAQg+O0y8HFhjuRrNWNIUFXMBRwndBIx DYyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TT1kpYQ7; 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=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f14-20020a05620a408e00b006fc57bff3d6si2408318qko.449.2022.12.17.07.25.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 17 Dec 2022 07:25:33 -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=@linaro.org header.s=google header.b=TT1kpYQ7; 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=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6Z3k-0003OJ-UC; Sat, 17 Dec 2022 10:25: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 1p6Z3j-0003NX-3z for qemu-devel@nongnu.org; Sat, 17 Dec 2022 10:25:07 -0500 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6Z3h-0005NK-Fi for qemu-devel@nongnu.org; Sat, 17 Dec 2022 10:25:06 -0500 Received: by mail-ej1-x635.google.com with SMTP id x22so12471435ejs.11 for ; Sat, 17 Dec 2022 07:25:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1e1FU0aKLX/Wox+fFOeQyUefxVtLx/iUwvcr67HGk04=; b=TT1kpYQ7q4riX6ORm/KG5TWUOXTRtJ5kCfAslzTQuZinHAYhh1pYP37n6H1Vm/MsnC jwrpE5ArHSvimmvTlI7ttGoXCJNLP4OapfI/KvOP9zfVpEzC6G7L8lpjlPimLVhb4/Yn UCAjB2wESg8aZbGffQ6XrDDF0xv09AtY+0qXOIlGZX7wzZkgvkr5nzjmAcynUpIsGZic Gdmbwh43CQr1GdoM1k4SiCouFvgI9qh5dQS/X7y0TmDlBXuS/YC0SKsSmkWT7NLiftCY hIe68tpcmM7fkwOkvqLoKm8Ak65c+Fd/Lgy6B8N27/7S4X9WkIAvJv265a0MRLwvWosj 11fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1e1FU0aKLX/Wox+fFOeQyUefxVtLx/iUwvcr67HGk04=; b=Y7VODphqqgOAhlolwTqbHK4ILzRQwNaTZXxju8Kliza2hScvS6N1vRpj6H8XnYT2pJ I94Px4kCGo4ZRorLkjGzh2esqRNCWcmlSLv6D/OxJhjd1TCPfpGBNgSINrxdlhDCwdd1 mbKC9/7Kl/X24y2aLvFdIMWcgD2sygTFI81kz1RgXXIddKjNpCGt3g/Az6FJ4WgBfGZG E0nRI4fV22yglAC7D8KrvPAkmQyHmEpdg1eYvvlWp+eODmnssWs82QR/J6ZQsc9PPERA CV8xcS4gsrzjdIOJYJyHH9d0PSJaMpV8O+BNMxywP9mEf1tme6sYiNUb6VLA+IAgtN5t wSuA== X-Gm-Message-State: AFqh2koI7ECQynt37l8nRw+82TAtj9tx3ngIqVnIvCiqzYTDC1pBBL6S pu4nRJdCYTeshFpMgH6AYiTQgRbjLXNQB8UN9LI= X-Received: by 2002:a17:907:8b89:b0:7c9:6e0e:1428 with SMTP id tb9-20020a1709078b8900b007c96e0e1428mr9329800ejc.47.1671290703991; Sat, 17 Dec 2022 07:25:03 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id q13-20020a1709064c8d00b007c0c91eae04sm2108592eju.151.2022.12.17.07.25.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 17 Dec 2022 07:25:03 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , Paolo Bonzini , Peter Xu , Matthew Rosato , Halil Pasic , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , David Hildenbrand , Christian Borntraeger , Thomas Huth , Eric Farman , Ilya Leoshkevich Subject: [PATCH v2 1/5] exec/memory: Expose memory_region_access_valid() Date: Sat, 17 Dec 2022 16:24:50 +0100 Message-Id: <20221217152454.96388-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221217152454.96388-1-philmd@linaro.org> References: <20221217152454.96388-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=philmd@linaro.org; helo=mail-ej1-x635.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=unavailable 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 Instead of having hardware device poking into memory internal API, expose memory_region_access_valid(). Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Eric Farman Reviewed-by: Thomas Huth --- hw/s390x/s390-pci-inst.c | 2 +- include/exec/memory-internal.h | 4 ---- include/exec/memory.h | 4 ++++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c index 66e764f901..35db7777e4 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" 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.