crashk_res.end - crashk_res.start + 1);
#endif
#endif
-
- if (!xen_feature(XENFEAT_auto_translated_physmap))
- phys_to_machine_mapping =
- (unsigned long *)xen_start_info->mfn_list;
}
/*
VMASST_TYPE_writable_pagetables));
memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data));
+ pre_setup_arch_hook();
early_cpu_init();
#ifdef CONFIG_SMP
prefill_possible_map();
rd_doload = ((RAMDISK_FLAGS & RAMDISK_LOAD_FLAG) != 0);
#endif
- setup_xen_features();
-
ARCH_SETUP
if (efi_enabled)
efi_init();
extern void failsafe_callback(void);
extern void nmi(void);
-unsigned long *machine_to_phys_mapping;
+unsigned long *machine_to_phys_mapping = (void *)MACH2PHYS_VIRT_START;
EXPORT_SYMBOL(machine_to_phys_mapping);
unsigned int machine_to_phys_order;
EXPORT_SYMBOL(machine_to_phys_order);
-void __init machine_specific_arch_setup(void)
+void __init pre_setup_arch_hook(void)
{
- int ret;
struct xen_machphys_mapping mapping;
unsigned long machine_to_phys_nr_ents;
struct xen_platform_parameters pp;
+
+ init_mm.pgd = swapper_pg_dir = (pgd_t *)xen_start_info->pt_base;
+
+ setup_xen_features();
+
+ if (HYPERVISOR_xen_version(XENVER_platform_parameters, &pp) == 0)
+ set_fixaddr_top(pp.virt_start);
+
+ if (HYPERVISOR_memory_op(XENMEM_machphys_mapping, &mapping) == 0) {
+ machine_to_phys_mapping = (unsigned long *)mapping.v_start;
+ machine_to_phys_nr_ents = mapping.max_mfn + 1;
+ } else
+ machine_to_phys_nr_ents = MACH2PHYS_NR_ENTRIES;
+ machine_to_phys_order = fls(machine_to_phys_nr_ents - 1);
+
+ if (!xen_feature(XENFEAT_auto_translated_physmap))
+ phys_to_machine_mapping =
+ (unsigned long *)xen_start_info->mfn_list;
+}
+
+void __init machine_specific_arch_setup(void)
+{
+ int ret;
static struct callback_register __initdata event = {
.type = CALLBACKTYPE_event,
.address = { __KERNEL_CS, (unsigned long)hypervisor_callback },
HYPERVISOR_nmi_op(XENNMI_register_callback, &cb);
}
#endif
-
- if (HYPERVISOR_xen_version(XENVER_platform_parameters, &pp) == 0)
- set_fixaddr_top(pp.virt_start);
-
- machine_to_phys_mapping = (unsigned long *)MACH2PHYS_VIRT_START;
- machine_to_phys_nr_ents = MACH2PHYS_NR_ENTRIES;
- if (HYPERVISOR_memory_op(XENMEM_machphys_mapping, &mapping) == 0) {
- machine_to_phys_mapping = (unsigned long *)mapping.v_start;
- machine_to_phys_nr_ents = mapping.max_mfn + 1;
- }
- while ((1UL << machine_to_phys_order) < machine_to_phys_nr_ents )
- machine_to_phys_order++;
}