From patchwork Mon Feb 18 11:35:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 158594 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2384473jaa; Mon, 18 Feb 2019 03:38:08 -0800 (PST) X-Google-Smtp-Source: AHgI3Ian5bKmo1/V4DNa/5HFuwuGzcfJBBgN2P/qZwS4nYRQeJwmD/85NK/N34RWO0QSePA4hLiY X-Received: by 2002:a81:4ccb:: with SMTP id z194mr18484698ywa.65.1550489888152; Mon, 18 Feb 2019 03:38:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550489888; cv=none; d=google.com; s=arc-20160816; b=MkdYebk1Xp0xfR6GdFLqD8NodV/XE5lZWZ897cDN/m2beeYDRkqaruNSky+TenZRg3 5ggucmSFGdYHgZE4g7hwq5cgORTtgJRDuYX65Fwh7aMuywyQ2bTpL8YH5mQvL3zMQULX aT4sLIaBJaRyupveOjfzH9M/eBxVf2vbpnYb7ZVYew4+W7UbNMxcy+8K6Q/o3MWaERBR 7lmilB1WvZtxZtSw5X8r9TmFhXPo5pCvdgkuqK3M0yEYXKrynW9QhLnSrkzC4aYDMNIm BcgdyTjIeqbluJIEZmWR7mDzmRUv7NXMNEo/fpCdxn/g02JIajAiEcLRKG+Uy895+ev1 2fXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from; bh=G6ztCpdYXUQL7uvpm+BkZOVBrzvW+nZWDRDkv8d+sGA=; b=PIIWKyb0g2H2/sTYi0EBUYljkkgZep0B/LXTMLrpZDnzhinqnf8LDSeH2NJ2rRAis2 Z0riP2iwGJbPiA7PvLb1+r4+vaZm7KFGV4zXXDWG5Zb/kKYJeDOKB3T9pdF/f8PDD4Km StqlolSNFXWQ7D21TPr2nQk6KBRrgiDeFQi6ZUWuq4Jy+CWf3RXGunQAo2I/RZ9maoYA dj2tz4asSVMrdIKd3pE0zkRktACj40k99AoFbQryk4lw9GH0sVftAwK8YmVX4vGw3c1p j9fvIn05f7BvmsCPm0h8hGJG0LSeU6vRQ1RkMJG6/+JonEPVFKYrNqkvJnfbFQjuDOXh e9qQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id q6si7510773ywq.199.2019.02.18.03.38.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Feb 2019 03:38:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1gvhDl-00027C-Mf; Mon, 18 Feb 2019 11:36:25 +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 1gvhDk-000268-T0 for xen-devel@lists.xenproject.org; Mon, 18 Feb 2019 11:36:24 +0000 X-Inumbo-ID: 6baf4484-3371-11e9-a443-affc41b004c2 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 6baf4484-3371-11e9-a443-affc41b004c2; Mon, 18 Feb 2019 11:36:24 +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 1A1CC16A3; Mon, 18 Feb 2019 03:36:24 -0800 (PST) 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 D3B303F915; Mon, 18 Feb 2019 03:36:16 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 18 Feb 2019 11:35:57 +0000 Message-Id: <20190218113600.9540-7-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190218113600.9540-1-julien.grall@arm.com> References: <20190218113600.9540-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH for-next 6/9] 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: sstabellini@kernel.org, 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_Pau_Monn=C3=A9?= MIME-Version: 1.0 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 --- 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 key[TB_KEY_SIZE], if ( !mfn_valid(_mfn(mfn)) ) continue; - if ( is_xen_fixed_mfn(mfn) ) + if ( is_xen_fixed_mfn(_mfn(mfn)) ) continue; /* skip Xen */ if ( (mfn >= 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 5684a13557..5de3686d85 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 *status) *status = 0; pg = mfn_to_page(mfn); - if ( is_xen_fixed_mfn(mfn_x(mfn)) ) + if ( is_xen_fixed_mfn(mfn) ) { *status = 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 #define is_xen_fixed_mfn(mfn) \ - ((pfn_to_paddr(mfn) >= virt_to_maddr(&_start)) && \ - (pfn_to_paddr(mfn) <= virt_to_maddr(&_end))) + ((mfn_to_maddr(mfn) >= virt_to_maddr(&_start)) && \ + (mfn_to_maddr(mfn) <= virt_to_maddr(&_end))) #define page_get_owner(_p) (_p)->v.inuse.domain #define page_set_owner(_p,_d) ((_p)->v.inuse.domain = (_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) >= __pa(&_stext)) && \ - (((mfn) << PAGE_SHIFT) <= __pa(&__2M_rwdata_end))) + (((mfn_to_maddr(mfn)) >= __pa(&_stext)) && \ + ((mfn_to_maddr(mfn)) <= __pa(&__2M_rwdata_end))) #define PRtype_info "016lx"/* should only be used for printk's */