From nobody Fri Nov 14 19:42:35 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761675936; cv=none; d=zohomail.com; s=zohoarc; b=Cy/MIhENZhhlE9pma/iNPPgNUOIWaNYtalJuq5vbWnt2qBgktcrml8Tt5eiIdrOBtESETyMcmlKjBE1QLv71m9+QykliimdmskLZSwP2HYKAsCn9iAoCq9cxKKcZt7JXFrLhO6yJAz0Jagr8AmUHy2wIQFp2E4FpGVY9jmxR/Wo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761675936; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Bb8ct1msdop66cfNc5jZbjnVVPLBi3asYT3AOca3j1U=; b=RFAtlx/47+P8YJchuSS1ombFLu3VCUnwqBF1YUKrX75XxTIITgPgQO5xYtcxlnj4XArRnyO4XR41USuC5Ne/8qCyfHQ5oHp+NChxwebhoDWtsHXuFn56WqlL2wSZhFBwsH05VUPIYDaF1q/EVvvTUXKV4ObkyVAp+nkn/eXKVyA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761675936756117.7588379021737; Tue, 28 Oct 2025 11:25:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vDoN8-0008Kv-9s; Tue, 28 Oct 2025 14:24:42 -0400 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 1vDoN5-0008GY-DB for qemu-devel@nongnu.org; Tue, 28 Oct 2025 14:24:39 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vDoN0-0002ze-Ez for qemu-devel@nongnu.org; Tue, 28 Oct 2025 14:24:38 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4770c2cd96fso24743235e9.3 for ; Tue, 28 Oct 2025 11:24:32 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429952da645sm20772209f8f.30.2025.10.28.11.24.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 28 Oct 2025 11:24:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761675870; x=1762280670; darn=nongnu.org; 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=Bb8ct1msdop66cfNc5jZbjnVVPLBi3asYT3AOca3j1U=; b=nFVDC9ORWdMuMwYyt+KPwMjVwQ6c46l6pCu+M7fUW0/dkIuwxKhwa16anwWBBbVAHK zf9SN/k/Tw/ZOLwtUPOlmjK8kkwBBE7kZ1m0DnjQXEjjAud8CwNyhGoGSFYiWxd3Eh4a Gc1eDdXSAb66vvT6xd/FzZN5FVijLinkgg7b1fZ6n+3OUNgFUjWs5sZGiBBkr0hXt3o5 t3229y8OKIFbPNFYtu0Hbt7gjZmVLbkBBBiqiRca8N5hJO/17rK1wwKDZk1Dx4dJ38AY 9/mgVMnmxrwUn2S/AP624bMi8PfOwnaX4BDXXVVg1zVyITJsXA0TL3qjLmcscWoqJtyJ rDUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761675870; x=1762280670; 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=Bb8ct1msdop66cfNc5jZbjnVVPLBi3asYT3AOca3j1U=; b=cLS92MaHCm81YqryMJ49+iOFLoF49XeGynPg6TY94/n6p8KMsO8ID+C3cU0MSrulht D+O1vsNtfWWH11ROiNpjlYZcjqFezxL77ArGmEU7Pdt3IGG73xy+UP2jO7Is6MxZkJSz UIH0GOkEt/p+Fi7CNBvw/+acuXOzf5cMgBsmubmiikS5IEpG175rNadXou1y5QGn/NZc +tMXm5MGx1gnXJ8nAm9shdHqgjQ9j7XASKuR8tTNUOnLDONFPqh7Tt7Vzrmx1sM4+prz sOa4xjsvOiGhudYfCO7u0ncaOnA/9fFJHLYvQZ7HJuZ1NExAvKYCp9BJm1SiEd/LH4nK 85JA== X-Gm-Message-State: AOJu0Yw2N1vYy/qCfMULMiIawiJN9CwYjRV3PoO+I58lPkxtCemvMQxt K24Hb9HUxK/2nbFY7tP2H+D5GCkV+PobqPwFBjRX+8IGOhU038pfSSk5RdxMGdGOWKRBfLRViF9 nIMA0H6w= X-Gm-Gg: ASbGncvLdWxk8xdqB8HLfMW4Th2pWVPNOFK/tnx01pvLR2HJQnWlgDaqziMS68P4l6g q8RXVQt42T818WzSBk6zuhqYQYqq5dZKmJhOWsC7f8FBVsbPNbpgyvR5fGgwh3VFpT2vizSP0sy Nrez3Cr75FEiIUlf5ZvGF1KwheIzswuJIa3/pY3ttkmbkfUxw3TGAs3tI+a/vOG2a1ZrtWyXhtE QdnRCSDFnagNa4wmuYvsf6+eyMUUNCEKJHQWWGpl7fvr+iwPUR1/YjQIVZqUqEIibrwJcjOvecP fpMPFA24B1iJa3gX1KW3CXZfLH6rrcNfc/xcROphMKXi2Nt18ZVQLOOJPrxZV3kgclA9gvDy2Y3 CBLtt7yKnvBCVAaUtkzNvJW4b8ILC1Xawoo7Tn7Wq5XwWolZILbePj/EjAaVTrJ0EH8z3PJdyhr KaFPXm2vsdllPnnzKL+aN9Bc6PXp0g8gRZ3rgjB0zbN8PyNfOqTQ== X-Google-Smtp-Source: AGHT+IHGtrcGFoBqbOWM/Z4ZKtNkpIoAicr60V8rp7HbelNRNEGwujVNu0ILye4Zuu0pu6nn0bXufg== X-Received: by 2002:a05:6000:2507:b0:3eb:d906:e553 with SMTP id ffacd0b85a97d-429aefda844mr13371f8f.55.1761675870517; Tue, 28 Oct 2025 11:24:30 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, qemu-block@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-arm@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , Paolo Bonzini , Peter Xu , David Hildenbrand Subject: [PATCH v3 11/25] system/memory: Introduce memory_region_get_address() Date: Tue, 28 Oct 2025 19:12:45 +0100 Message-ID: <20251028181300.41475-12-philmd@linaro.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251028181300.41475-1-philmd@linaro.org> References: <20251028181300.41475-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761675940635158500 MemoryRegion::addr is private data of MemoryRegion. Introduce memory_region_get_address() to get it, similar to memory_region_set_address() to set it. Suggested-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Peter Xu Reviewed-by: David Hildenbrand Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- include/system/memory.h | 7 +++++++ system/memory.c | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/include/system/memory.h b/include/system/memory.h index 45de6946812..d2a5850a360 100644 --- a/include/system/memory.h +++ b/include/system/memory.h @@ -2481,6 +2481,13 @@ void memory_region_set_enabled(MemoryRegion *mr, boo= l enabled); */ void memory_region_set_address(MemoryRegion *mr, hwaddr addr); =20 +/** + * memory_region_get_address: Get the base address of a memory region + * + * @mr: the region to be queried + */ +hwaddr memory_region_get_address(const MemoryRegion *mr); + /* * memory_region_set_size: dynamically update the size of a region. * diff --git a/system/memory.c b/system/memory.c index d1c060b2b50..f48b586122d 100644 --- a/system/memory.c +++ b/system/memory.c @@ -2777,6 +2777,11 @@ void memory_region_set_address(MemoryRegion *mr, hwa= ddr addr) } } =20 +hwaddr memory_region_get_address(const MemoryRegion *mr) +{ + return mr->addr; +} + void memory_region_set_alias_offset(MemoryRegion *mr, hwaddr offset) { assert(mr->alias); --=20 2.51.0