From nobody Thu Oct 23 00:42:56 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 1687750860201725.2855157528511; Sun, 25 Jun 2023 20:41:00 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.555073.866773 (Exim 4.92) (envelope-from ) id 1qDd5T-0007Th-Cv; Mon, 26 Jun 2023 03:40:23 +0000 Received: by outflank-mailman (output) from mailman id 555073.866773; Mon, 26 Jun 2023 03:40:23 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qDd5T-0007QM-0R; Mon, 26 Jun 2023 03:40:23 +0000 Received: by outflank-mailman (input) for mailman id 555073; Mon, 26 Jun 2023 03:40:21 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qDd1L-0007ej-Vr for xen-devel@lists.xenproject.org; Mon, 26 Jun 2023 03:36:07 +0000 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by se1-gles-sth1.inumbo.com (Halon) with ESMTP id 95a48964-13d2-11ee-b237-6b7b168915f2; Mon, 26 Jun 2023 05:36:07 +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 BBB071FB; Sun, 25 Jun 2023 20:36:50 -0700 (PDT) Received: from a011292.shanghai.arm.com (a011292.shanghai.arm.com [10.169.190.94]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id F381B3F64C; Sun, 25 Jun 2023 20:36:03 -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: 95a48964-13d2-11ee-b237-6b7b168915f2 From: Penny Zheng To: xen-devel@lists.xenproject.org Cc: Penny Zheng , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk , Penny Zheng , Wei Chen Subject: [PATCH v3 19/52] xen/arm: switch to use ioremap_xxx in common file Date: Mon, 26 Jun 2023 11:34:10 +0800 Message-Id: <20230626033443.2943270-20-Penny.Zheng@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230626033443.2943270-1-Penny.Zheng@arm.com> References: <20230626033443.2943270-1-Penny.Zheng@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1687750862166100001 Content-Type: text/plain; charset="utf-8" In arm, with the introduction of MPU system, VMAP scheme, taking advantage of virtual translation, will become a MMU-only feature. So we want to avoid using direct access to all vmap-related functions, like __vmap(), in common files, and switch to use more generic eoremap_xxx instead. Then later, we also just need to implement MPU version of ioremap_xxx. Signed-off-by: Penny Zheng Signed-off-by: Wei Chen --- v3: - new commit --- xen/arch/arm/kernel.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c index d13ef0330b..30f8bc5923 100644 --- a/xen/arch/arm/kernel.c +++ b/xen/arch/arm/kernel.c @@ -172,7 +172,6 @@ static __init int kernel_decompress(struct bootmodule *= mod, uint32_t offset) unsigned int kernel_order_out; paddr_t output_size; struct page_info *pages; - mfn_t mfn; int i; paddr_t addr =3D mod->start; paddr_t size =3D mod->size; @@ -209,13 +208,18 @@ static __init int kernel_decompress(struct bootmodule= *mod, uint32_t offset) iounmap(input); return -ENOMEM; } - mfn =3D page_to_mfn(pages); - output =3D __vmap(&mfn, 1 << kernel_order_out, 1, 1, PAGE_HYPERVISOR, = VMAP_DEFAULT); + output =3D ioremap_cache(page_to_maddr(pages), + pfn_to_paddr(1UL << kernel_order_out)); + if ( output =3D=3D NULL ) + { + iounmap(output); + return -EFAULT; + } =20 rc =3D perform_gunzip(output, input, size); clean_dcache_va_range(output, output_size); iounmap(input); - vunmap(output); + iounmap(output); =20 if ( rc ) { --=20 2.25.1