From nobody Fri Apr 26 06:03:25 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=1557242205; cv=none; d=zoho.com; s=zohoarc; b=gHsoeyovDy0NiiOPr1HdBYjY2A2o0RfaTCfKWrrCw+5ya+Z1N7lihgRt5J2oz8vK5MK7gOtaw1kOhBlteuk2iNnRfTBO9Ukm0NnCWj4ozoIoRshe7/Jf5wASZrG4p1Bl+fmJgWzA0mO43F2So0hzV6S6efIx8eRy6L6blhk/0VA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557242205; 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=2dyr9eAQpdHVeXG+OlaeiKcumRIFOcnZQiA32I1R9XM=; b=QWXNC5CP6l5OYVPfUA7Ztkf6V8V72HcLQGvh19FnQEPXQJui9qSOUpAmkdEHNx34kKdfPVzr88Dh6fMyZdQm6J/DJgs2fgktvvKRmCqLLvCGWxEfgkpBduSxcNPkSGf3MCLICIbc8liskFwZqhSHeW1bfAIAm671zenvHqx684E= 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 1557242205094734.8978199615478; Tue, 7 May 2019 08:16:45 -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 1hO1oT-0007OC-5Z; Tue, 07 May 2019 15:15:25 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hO1oS-0007NN-IZ for xen-devel@lists.xenproject.org; Tue, 07 May 2019 15:15:24 +0000 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id ef840d39-70da-11e9-843c-bc764e045a96; Tue, 07 May 2019 15:15:23 +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 63E2F15AD; Tue, 7 May 2019 08:15:23 -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 2C5923F5AF; Tue, 7 May 2019 08:15:21 -0700 (PDT) X-Inumbo-ID: ef840d39-70da-11e9-843c-bc764e045a96 From: Julien Grall To: xen-devel@lists.xenproject.org Date: Tue, 7 May 2019 16:14:51 +0100 Message-Id: <20190507151458.29350-8-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 07/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 , 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 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 f445f7daec..b4067ae202 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -1584,7 +1584,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 6faa563167..f124f57964 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