1UL << (PAGE_SHIFT + 32)) )
e = min(HYPERVISOR_VIRT_END - DIRECTMAP_VIRT_START,
1UL << (PAGE_SHIFT + 32));
-#define reloc_size ((__pa(&_end) + mask) & ~mask)
+#define reloc_size ((__pa(__2M_rwdata_end) + mask) & ~mask)
/* Is the region suitable for relocating Xen? */
if ( !xen_phys_start && e <= limit )
{
if ( !xen_phys_start )
panic("Not enough memory to relocate Xen.");
- reserve_e820_ram(&boot_e820, __pa(&_start), __pa(&_end));
+
+ /* This needs to remain in sync with xen_in_range(). */
+ reserve_e820_ram(&boot_e820, __pa(_stext), __pa(__2M_rwdata_end));
/* Late kexec reservation (dynamic start address). */
kexec_reserve_area(&boot_e820);
/* S3 resume code (and other real mode trampoline code) */
xen_regions[region_s3].s = bootsym_phys(trampoline_start);
xen_regions[region_s3].e = bootsym_phys(trampoline_end);
+
+ /*
+ * This needs to remain in sync with the uses of the same symbols in
+ * - __start_xen() (above)
+ * - is_xen_fixed_mfn()
+ * - tboot_shutdown()
+ */
+
/* hypervisor .text + .rodata */
xen_regions[region_ro].s = __pa(&_stext);
xen_regions[region_ro].e = __pa(&__2M_rodata_end);
if ( !mfn_valid(_mfn(mfn)) )
continue;
- if ( (mfn << PAGE_SHIFT) < __pa(&_end) )
+ if ( is_xen_fixed_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
if ( shutdown_type == TB_SHUTDOWN_S3 )
{
/*
- * Xen regions for tboot to MAC
+ * Xen regions for tboot to MAC. This needs to remain in sync with
+ * xen_in_range().
*/
g_tboot_shared->num_mac_regions = 3;
/* S3 resume code (and other real mode trampoline code) */
}
ASSERT(__image_base__ > XEN_VIRT_START ||
- _end <= XEN_VIRT_END - NR_CPUS * PAGE_SIZE,
+ __2M_rwdata_end <= XEN_VIRT_END - NR_CPUS * PAGE_SIZE,
"Xen image overlaps stubs area")
#ifdef CONFIG_KEXEC
#define is_xen_heap_mfn(mfn) \
(__mfn_valid(mfn) && is_xen_heap_page(__mfn_to_page(mfn)))
#define is_xen_fixed_mfn(mfn) \
- ((((mfn) << PAGE_SHIFT) >= __pa(&_start)) && \
- (((mfn) << PAGE_SHIFT) <= __pa(&_end)))
+ ((((mfn) << PAGE_SHIFT) >= __pa(&_stext)) && \
+ (((mfn) << PAGE_SHIFT) <= __pa(&__2M_rwdata_end)))
#define PRtype_info "016lx"/* should only be used for printk's */