From: Julien Grall <julien.grall@arm.com> To: xen-devel@lists.xenproject.org Cc: "Stefano Stabellini" <sstabellini@kernel.org>, "Wei Liu" <wl@xen.org>, "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>, "George Dunlap" <George.Dunlap@eu.citrix.com>, "Shane Wang" <shane.wang@intel.com>, "Ian Jackson" <ian.jackson@eu.citrix.com>, "George Dunlap" <george.dunlap@citrix.com>, "Tim Deegan" <tim@xen.org>, "Julien Grall" <julien.grall@arm.com>, "Jan Beulich" <jbeulich@suse.com>, "Andrew Cooper" <andrew.cooper3@citrix.com>, "Gang Wei" <gang.wei@intel.com>, "Roger Pau Monné" <roger.pau@citrix.com> Subject: [PATCH v3 05/14] xen: Convert is_xen_fixed_mfn to use typesafe MFN Date: Mon, 3 Jun 2019 17:03:41 +0100 [thread overview] Message-ID: <20190603160350.29806-6-julien.grall@arm.com> (raw) In-Reply-To: <20190603160350.29806-1-julien.grall@arm.com> No functional changes. Signed-off-by: Julien Grall <julien.grall@arm.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> Acked-by: Stefano Stabellini <sstabellini@kernel.org> Reviewed-by: George Dunlap <george.dunlap@citrix.com> --- 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 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 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 *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 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) >= __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 */ -- 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
WARNING: multiple messages have this Message-ID (diff)
From: Julien Grall <julien.grall@arm.com> To: xen-devel@lists.xenproject.org Cc: "Stefano Stabellini" <sstabellini@kernel.org>, "Wei Liu" <wl@xen.org>, "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>, "George Dunlap" <George.Dunlap@eu.citrix.com>, "Shane Wang" <shane.wang@intel.com>, "Ian Jackson" <ian.jackson@eu.citrix.com>, "George Dunlap" <george.dunlap@citrix.com>, "Tim Deegan" <tim@xen.org>, "Julien Grall" <julien.grall@arm.com>, "Jan Beulich" <jbeulich@suse.com>, "Andrew Cooper" <andrew.cooper3@citrix.com>, "Gang Wei" <gang.wei@intel.com>, "Roger Pau Monné" <roger.pau@citrix.com> Subject: [Xen-devel] [PATCH v3 05/14] xen: Convert is_xen_fixed_mfn to use typesafe MFN Date: Mon, 3 Jun 2019 17:03:41 +0100 [thread overview] Message-ID: <20190603160350.29806-6-julien.grall@arm.com> (raw) Message-ID: <20190603160341.BsPwX66ANktUcnhZxjlnh2D-cAlSzgIfLA9_fFWOkUM@z> (raw) In-Reply-To: <20190603160350.29806-1-julien.grall@arm.com> No functional changes. Signed-off-by: Julien Grall <julien.grall@arm.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> Acked-by: Stefano Stabellini <sstabellini@kernel.org> Reviewed-by: George Dunlap <george.dunlap@citrix.com> --- 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 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 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 *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 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) >= __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 */ -- 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2019-06-03 16:04 UTC|newest] Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-06-03 16:03 [PATCH v3 00/14] xen/arm: Properly disable M2P on Arm Julien Grall 2019-06-03 16:03 ` [Xen-devel] " Julien Grall 2019-06-03 16:03 ` [PATCH v3 01/14] xen/x86: Make mfn_to_gfn typesafe Julien Grall 2019-06-03 16:03 ` [Xen-devel] " Julien Grall 2019-06-04 16:06 ` Jan Beulich 2019-07-29 12:13 ` Julien Grall 2019-08-19 13:50 ` George Dunlap 2019-06-03 16:03 ` [PATCH v3 02/14] xen/x86: Use mfn_to_gfn rather than mfn_to_gmfn Julien Grall 2019-06-03 16:03 ` [Xen-devel] " Julien Grall 2019-06-03 16:03 ` [PATCH v3 03/14] xen/grant-table: Make arch specific macros typesafe Julien Grall 2019-06-03 16:03 ` [Xen-devel] " Julien Grall 2019-06-03 16:03 ` [PATCH v3 04/14] xen: Convert hotplug page function to use typesafe MFN Julien Grall 2019-06-03 16:03 ` [Xen-devel] " Julien Grall 2019-06-03 16:03 ` Julien Grall [this message] 2019-06-03 16:03 ` [Xen-devel] [PATCH v3 05/14] xen: Convert is_xen_fixed_mfn " Julien Grall 2019-06-03 16:03 ` [PATCH v3 06/14] xen: Convert is_xen_heap_mfn " Julien Grall 2019-06-03 16:03 ` [Xen-devel] " Julien Grall 2019-06-03 16:03 ` [PATCH v3 07/14] xen: Introduce HAS_M2P config and use to protect mfn_to_gmfn call Julien Grall 2019-06-03 16:03 ` [Xen-devel] " Julien Grall 2019-06-04 16:14 ` Jan Beulich 2019-06-04 16:22 ` Julien Grall 2019-06-05 7:14 ` Jan Beulich 2019-06-05 9:35 ` Julien Grall 2019-06-05 10:10 ` Jan Beulich 2019-07-29 12:08 ` Julien Grall 2019-06-03 16:03 ` [PATCH v3 08/14] xen: Remove mfn_to_gmfn macro Julien Grall 2019-06-03 16:03 ` [Xen-devel] " Julien Grall 2019-06-03 16:03 ` [PATCH v3 09/14] xen/x86: mm: Re-implement set_gpfn_from_mfn() as a static inline function Julien Grall 2019-06-03 16:03 ` [Xen-devel] " Julien Grall 2019-06-04 16:21 ` Jan Beulich 2019-06-04 16:23 ` Julien Grall 2019-06-05 7:18 ` Jan Beulich 2019-06-03 16:03 ` [PATCH v3 10/14] xen/x86: pv: Convert update_intpte() to use typesafe MFN Julien Grall 2019-06-03 16:03 ` [Xen-devel] " Julien Grall 2019-06-03 16:03 ` [PATCH v3 11/14] xen/x86: p2m: Remove duplicate error message in p2m_pt_audit_p2m() Julien Grall 2019-06-03 16:03 ` [Xen-devel] " Julien Grall 2019-06-05 10:43 ` Jan Beulich 2019-06-05 10:44 ` Julien Grall 2019-06-03 16:03 ` [PATCH v3 12/14] xen/x86: p2m: Rework printk format in audit_p2m() Julien Grall 2019-06-03 16:03 ` [Xen-devel] " Julien Grall 2019-06-03 16:03 ` [PATCH v3 13/14] xen/mm: Convert {s, g}et_gpfn_from_mfn() to use typesafe MFN Julien Grall 2019-06-03 16:03 ` [Xen-devel] " Julien Grall 2019-06-05 11:01 ` Jan Beulich 2019-06-05 11:03 ` Julien Grall 2019-06-03 16:03 ` [PATCH v3 14/14] xen/mm: Provide dummy M2P-related helpers when !CONFIG_HAVE_M2P Julien Grall 2019-06-03 16:03 ` [Xen-devel] " Julien Grall 2019-06-05 11:07 ` Jan Beulich 2019-06-05 11:17 ` Julien Grall
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190603160350.29806-6-julien.grall@arm.com \ --to=julien.grall@arm.com \ --cc=George.Dunlap@eu.citrix.com \ --cc=andrew.cooper3@citrix.com \ --cc=gang.wei@intel.com \ --cc=george.dunlap@citrix.com \ --cc=ian.jackson@eu.citrix.com \ --cc=jbeulich@suse.com \ --cc=konrad.wilk@oracle.com \ --cc=roger.pau@citrix.com \ --cc=shane.wang@intel.com \ --cc=sstabellini@kernel.org \ --cc=tim@xen.org \ --cc=wl@xen.org \ --cc=xen-devel@lists.xenproject.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.