From nobody Tue Feb 10 10:58:54 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=1559577917; cv=none; d=zoho.com; s=zohoarc; b=UM++2N3h/iWA7WxkNZH0nPjOm/a/XS6WvcnJkptpl6YXYTtpcZQlBvCwWFnQdgEaH8IJvqogNJl7ExPriZLCaSP0yz6sijlcoNsHs1TVq9l1xlXEphma+u8Y1sic4coWwKJU4AqGrWJ7zP67aYRRy4jYCNh9C0w7ZyKwZCzZpiY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559577917; 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=9I6SG1Dz3HCvviVDoowGPpTpX8L5XhdKvTHABn47KpA=; b=dIoelhHuG4+uoYBNIYbCO7ppMQZo+2pQTUoIFyYuaPJ0ocl8wNjZq3GZOOC41nH2doYu+3sqf6jnUH4V8M9kfA3DHRv86Jyc+vS6KmmqgP0rSTkTTAJsYWx80o1bQpgZ/pvwqYPX9NQ+2cpWDhOErvOfVq50irAObynxUBcNFL0= 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 1559577917529166.88586732135468; Mon, 3 Jun 2019 09:05:17 -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 1hXpRT-0001xO-91; Mon, 03 Jun 2019 16:04:11 +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 1hXpRS-0001wq-D7 for xen-devel@lists.xenproject.org; Mon, 03 Jun 2019 16:04:10 +0000 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 3886b10a-8619-11e9-892c-875838fe41ea; Mon, 03 Jun 2019 16:04:09 +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 0929515AB; Mon, 3 Jun 2019 09:04:09 -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 A268F3F246; Mon, 3 Jun 2019 09:04:06 -0700 (PDT) X-Inumbo-ID: 3886b10a-8619-11e9-892c-875838fe41ea From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 3 Jun 2019 17:03:41 +0100 Message-Id: <20190603160350.29806-6-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 05/14] xen: Convert is_xen_fixed_mfn to use typesafe MFN 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 , Konrad Rzeszutek Wilk , George Dunlap , Shane Wang , Ian Jackson , George Dunlap , Tim Deegan , Julien Grall , Jan Beulich , Andrew Cooper , Gang Wei , =?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" No functional changes. Signed-off-by: Julien Grall Reviewed-by: Jan Beulich Acked-by: Stefano Stabellini Reviewed-by: George Dunlap --- Changes in v3: - Add George's reviewed-by Changes in v2: - Add Jan's reviewed-by - Add Stefano's acked-by --- xen/arch/x86/tboot.c | 2 +- xen/common/page_alloc.c | 2 +- xen/include/asm-arm/mm.h | 4 ++-- xen/include/asm-x86/mm.h | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/tboot.c b/xen/arch/x86/tboot.c index f3fdee4d39..30d159cc62 100644 --- a/xen/arch/x86/tboot.c +++ b/xen/arch/x86/tboot.c @@ -280,7 +280,7 @@ static void tboot_gen_xenheap_integrity(const uint8_t k= ey[TB_KEY_SIZE], =20 if ( !mfn_valid(_mfn(mfn)) ) continue; - if ( is_xen_fixed_mfn(mfn) ) + if ( is_xen_fixed_mfn(_mfn(mfn)) ) continue; /* skip Xen */ if ( (mfn >=3D PFN_DOWN(g_tboot_shared->tboot_base - 3 * PAGE_SIZE= )) && (mfn < PFN_UP(g_tboot_shared->tboot_base diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 7075e084b4..71e24dbb2d 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -1572,7 +1572,7 @@ int offline_page(mfn_t mfn, int broken, uint32_t *sta= tus) *status =3D 0; pg =3D mfn_to_page(mfn); =20 - if ( is_xen_fixed_mfn(mfn_x(mfn)) ) + if ( is_xen_fixed_mfn(mfn) ) { *status =3D PG_OFFLINE_XENPAGE | PG_OFFLINE_FAILED | (DOMID_XEN << PG_OFFLINE_OWNER_SHIFT); diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h index 7b6aaf5e3f..b56018aace 100644 --- a/xen/include/asm-arm/mm.h +++ b/xen/include/asm-arm/mm.h @@ -151,8 +151,8 @@ extern vaddr_t xenheap_virt_start; #endif =20 #define is_xen_fixed_mfn(mfn) \ - ((pfn_to_paddr(mfn) >=3D virt_to_maddr(&_start)) && \ - (pfn_to_paddr(mfn) <=3D virt_to_maddr(&_end))) + ((mfn_to_maddr(mfn) >=3D virt_to_maddr(&_start)) && \ + (mfn_to_maddr(mfn) <=3D virt_to_maddr(&_end))) =20 #define page_get_owner(_p) (_p)->v.inuse.domain #define page_set_owner(_p,_d) ((_p)->v.inuse.domain =3D (_d)) diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h index c72e329506..0d954e1bd8 100644 --- a/xen/include/asm-x86/mm.h +++ b/xen/include/asm-x86/mm.h @@ -280,8 +280,8 @@ struct page_info #define is_xen_heap_mfn(mfn) \ (__mfn_valid(mfn) && is_xen_heap_page(mfn_to_page(_mfn(mfn)))) #define is_xen_fixed_mfn(mfn) \ - ((((mfn) << PAGE_SHIFT) >=3D __pa(&_stext)) && \ - (((mfn) << PAGE_SHIFT) <=3D __pa(&__2M_rwdata_end))) + (((mfn_to_maddr(mfn)) >=3D __pa(&_stext)) && \ + ((mfn_to_maddr(mfn)) <=3D __pa(&__2M_rwdata_end))) =20 #define PRtype_info "016lx"/* should only be used for printk's */ =20 --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel