From nobody Thu Apr 25 13:48:49 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1557242210; cv=none; d=zoho.com; s=zohoarc; b=H9AfleKskA9VAYlP/7VDiZXNRzqeZfLDBhsEPn83kNuy5Vrq3ZtzZ//5DWhvnJllY9fdscAHULznAcJ+Eur2Bnl+h/EZVOIOlHq/4aNAKx69wkt0hLjASraQPQb1aMwAa0osag4zmj8kK2tYwxlpM4axFVMAdVikyVzgEEy/QQY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557242210; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=V41zxAloM9tfD+wZ0aHgs323ArobYLItLUYUwOfc7Vw=; b=mDucOWvYV6bm3ZP2lxHWDZidZjrVyRSBDomVjl1XaHRZmEWk/jhEVmFMVHbNLDy8Qr6C8w7hCELjEuEOyYZVpU5HwuXy3x0RFy3eO8Xxdi3VSVzi5Wp4vbQZdOH+cyyGyDLzh6WIEVOvlr996vCp4XnA7fxQ4BRAFpwGPfbp3uk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1557242210508665.862708274539; Tue, 7 May 2019 08:16:50 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hO1oZ-0007Sv-Ta; Tue, 07 May 2019 15:15:31 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hO1oY-0007Rh-KY for xen-devel@lists.xenproject.org; Tue, 07 May 2019 15:15:30 +0000 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id f35238f3-70da-11e9-843c-bc764e045a96; Tue, 07 May 2019 15:15:29 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B86A5168F; Tue, 7 May 2019 08:15:29 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5CFFF3F90E; Tue, 7 May 2019 08:15:28 -0700 (PDT) X-Inumbo-ID: f35238f3-70da-11e9-843c-bc764e045a96 From: Julien Grall To: xen-devel@lists.xenproject.org Date: Tue, 7 May 2019 16:14:54 +0100 Message-Id: <20190507151458.29350-11-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190507151458.29350-1-julien.grall@arm.com> References: <20190507151458.29350-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 10/14] xen: Remove mfn_to_gmfn macro X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Wei Liu , Andrew Cooper , Julien Grall , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" On x86, mfn_to_gmfn can be replaced with mfn_to_gfn. On Arm, there are no more call to mfn_to_gmfn, so the helper can be dropped. At the same time rework a comment in Arm code that does not make sense. Signed-off-by: Julien Grall Acked-by: Jan Beulich Acked-by: Stefano Stabellini --- Changes in v2: - Add Jan's and Stefano's acked-by --- xen/drivers/passthrough/iommu.c | 7 +++---- xen/include/asm-arm/mm.h | 4 +--- xen/include/asm-x86/mm.h | 5 ----- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iomm= u.c index dbb64b13bc..054f71b919 100644 --- a/xen/drivers/passthrough/iommu.c +++ b/xen/drivers/passthrough/iommu.c @@ -195,8 +195,8 @@ void __hwdom_init iommu_hwdom_init(struct domain *d) =20 page_list_for_each ( page, &d->page_list ) { - unsigned long mfn =3D mfn_x(page_to_mfn(page)); - unsigned long dfn =3D mfn_to_gmfn(d, mfn); + mfn_t mfn =3D page_to_mfn(page); + dfn_t dfn =3D _dfn(gfn_x(mfn_to_gfn(d, mfn))); unsigned int mapping =3D IOMMUF_readable; int ret; =20 @@ -205,8 +205,7 @@ void __hwdom_init iommu_hwdom_init(struct domain *d) =3D=3D PGT_writable_page) ) mapping |=3D IOMMUF_writable; =20 - ret =3D iommu_map(d, _dfn(dfn), _mfn(mfn), 0, mapping, - &flush_flags); + ret =3D iommu_map(d, dfn, mfn, 0, mapping, &flush_flags); =20 if ( !rc ) rc =3D ret; diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h index a9c8352b94..a9cb98a6c7 100644 --- a/xen/include/asm-arm/mm.h +++ b/xen/include/asm-arm/mm.h @@ -321,10 +321,8 @@ struct page_info *get_page_from_gva(struct vcpu *v, va= ddr_t va, #define SHARED_M2P_ENTRY (~0UL - 1UL) #define SHARED_M2P(_e) ((_e) =3D=3D SHARED_M2P_ENTRY) =20 -/* Xen always owns P2M on ARM */ +/* We don't have a M2P on Arm */ #define set_gpfn_from_mfn(mfn, pfn) do { (void) (mfn), (void)(pfn); } whil= e (0) -#define mfn_to_gmfn(_d, mfn) (mfn) - =20 /* Arch-specific portion of memory_op hypercall. */ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg); diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h index 6f76f004ab..717378730b 100644 --- a/xen/include/asm-x86/mm.h +++ b/xen/include/asm-x86/mm.h @@ -506,11 +506,6 @@ extern struct rangeset *mmio_ro_ranges; =20 #define get_gpfn_from_mfn(mfn) (machine_to_phys_mapping[(mfn)]) =20 -#define mfn_to_gmfn(_d, mfn) \ - ( (paging_mode_translate(_d)) \ - ? get_gpfn_from_mfn(mfn) \ - : (mfn) ) - #define compat_pfn_to_cr3(pfn) (((unsigned)(pfn) << 12) | ((unsigned)(pfn)= >> 20)) #define compat_cr3_to_pfn(cr3) (((unsigned)(cr3) >> 12) | ((unsigned)(cr3)= << 20)) =20 --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel