This helps debugging in the guest kernels, as then MFNs there can then be range checked based on the reported value. Signed-off-by: Jan Beulich --- 2010-01-27.orig/xen/arch/x86/mm.c 2010-01-06 11:22:26.000000000 +0100 +++ 2010-01-27/xen/arch/x86/mm.c 2010-02-03 13:29:46.000000000 +0100 @@ -4457,12 +4457,14 @@ long arch_memory_op(int op, XEN_GUEST_HA case XENMEM_machphys_mapping: { - static const struct xen_machphys_mapping mapping = { + struct xen_machphys_mapping mapping = { .v_start = MACH2PHYS_VIRT_START, .v_end = MACH2PHYS_VIRT_END, .max_mfn = MACH2PHYS_NR_ENTRIES - 1 }; + if ( !mem_hotplug ) + mapping.max_mfn = max_page - 1; if ( copy_to_guest(arg, &mapping, 1) ) return -EFAULT;