From nobody Mon Feb 9 22:39:02 2026 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=1559577919; cv=none; d=zoho.com; s=zohoarc; b=PD5RK8JQnfg7F+ipixOdF1aZhk110zmIun7UwpYcRzUWmsg+s4tRUA94TJOyyAl9U27d8bC3v9doZ+flUhph9aVJS6MHJM2JzZ0H1jyPwdQpFVe1xXhfJhbmPJdH9i1aDZZJJB3PhGIE+IkKq8l/Nn/+nSnT2VH/n5uYKm0yMy0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559577919; 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=W8dVUen859rvTnW85eLoUyZ3y5qV9X78UsQLAtY/K0g=; b=NUK21VKXRoeEBwIMI8P1+dXNqyjv4i2lPwZVcgrdgeZSCRXIIV/EnjbX/kaIwSyvKVbzUVzrTw/Biz/wCjEgYKDDBZTOd/VgoxUL09AGRtIi6eQC9daLCdhrZvFZrgM8f0Z7Qg/UDaVKgk9waG2IuXlgHcQ/rqywNF26Xy7cGLQ= 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 1559577919728919.82055251246; Mon, 3 Jun 2019 09:05:19 -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 1hXpRa-00024D-HX; Mon, 03 Jun 2019 16:04:18 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hXpRY-00022Q-TZ for xen-devel@lists.xenproject.org; Mon, 03 Jun 2019 16:04:16 +0000 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 3c5c76b6-8619-11e9-beeb-03b514b6ce83; Mon, 03 Jun 2019 16:04:15 +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 74798A78; Mon, 3 Jun 2019 09:04:15 -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 1DDA33F246; Mon, 3 Jun 2019 09:04:13 -0700 (PDT) X-Inumbo-ID: 3c5c76b6-8619-11e9-beeb-03b514b6ce83 From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 3 Jun 2019 17:03:44 +0100 Message-Id: <20190603160350.29806-9-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190603160350.29806-1-julien.grall@arm.com> References: <20190603160350.29806-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH v3 08/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 43174176c2..ad4309fde5 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 e420d88137..bf90916077 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