From nobody Thu Oct 30 19:00:06 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=arm.com Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1761320287827693.5698716692714; Fri, 24 Oct 2025 08:38:07 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1150563.1481686 (Exim 4.92) (envelope-from ) id 1vCJrO-0004ZU-DJ; Fri, 24 Oct 2025 15:37:46 +0000 Received: by outflank-mailman (output) from mailman id 1150563.1481686; Fri, 24 Oct 2025 15:37:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vCJrO-0004ZJ-AJ; Fri, 24 Oct 2025 15:37:46 +0000 Received: by outflank-mailman (input) for mailman id 1150563; Fri, 24 Oct 2025 15:37:45 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vCJrN-0003nv-Iu for xen-devel@lists.xenproject.org; Fri, 24 Oct 2025 15:37:45 +0000 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by se1-gles-flk1.inumbo.com (Halon) with ESMTP id 6214e1ff-b0ef-11f0-980a-7dc792cee155; Fri, 24 Oct 2025 17:37:44 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 789161515; Fri, 24 Oct 2025 08:37:35 -0700 (PDT) Received: from e134099.cambridge.arm.com (e134099.arm.com [10.1.198.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 21B953F63F; Fri, 24 Oct 2025 08:37:42 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 6214e1ff-b0ef-11f0-980a-7dc792cee155 From: Harry Ramsey To: xen-devel@lists.xenproject.org Cc: luca.fancellu@arm.com, Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk Subject: [PATCH 3/3] arm: Implement ioremap_attr for MPU Date: Fri, 24 Oct 2025 16:37:19 +0100 Message-ID: <20251024153719.408806-4-harry.ramsey@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251024153719.408806-1-harry.ramsey@arm.com> References: <20251024153719.408806-1-harry.ramsey@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1761320288944158500 Content-Type: text/plain; charset="utf-8" Implement the function `ioremap_attr` for MPU systems. Signed-off-by: Harry Ramsey --- xen/arch/arm/mpu/mm.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c index c5128244b7..3570ce6b27 100644 --- a/xen/arch/arm/mpu/mm.c +++ b/xen/arch/arm/mpu/mm.c @@ -475,8 +475,13 @@ void free_init_memory(void) =20 void __iomem *ioremap_attr(paddr_t start, size_t len, unsigned int flags) { - BUG_ON("unimplemented"); - return NULL; + paddr_t start_pg =3D round_pgdown(start); + paddr_t end_pg =3D round_pgup(start_pg + len); + if ( xen_mpumap_update(start_pg, end_pg, flags) ) + return NULL; + + /* Mapped or already mapped */ + return maddr_to_virt(start_pg); } =20 /* --=20 2.43.0