]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/x86/xen/mmu.c
Merge branches 'upstream/core', 'upstream/xenfs' and 'upstream/evtchn' into upstream...
[karo-tx-linux.git] / arch / x86 / xen / mmu.c
index 276c67bba5aa6948e1aab8f0ca331cf63bf412fb..790af908284e56424ce3c3b0c851b53eb1443b63 100644 (file)
@@ -2034,6 +2034,20 @@ static __init void xen_map_identity_early(pmd_t *pmd, unsigned long max_pfn)
        set_page_prot(pmd, PAGE_KERNEL_RO);
 }
 
+void __init xen_setup_machphys_mapping(void)
+{
+       struct xen_machphys_mapping mapping;
+       unsigned long machine_to_phys_nr_ents;
+
+       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);
+}
+
 #ifdef CONFIG_X86_64
 static void convert_pfn_mfn(void *v)
 {