struct xen_machphys_mfn_list xmml;
l3_pgentry_t l3e;
l2_pgentry_t l2e;
- unsigned long v;
+ unsigned long v, limit;
xen_pfn_t mfn, last_mfn;
unsigned int i;
long rc = 0;
break;
+ case XENMEM_machphys_compat_mfn_list:
+ if ( copy_from_guest(&xmml, arg, 1) )
+ return -EFAULT;
+
+ limit = (unsigned long)(compat_machine_to_phys_mapping + max_page);
+ if ( limit > RDWR_COMPAT_MPT_VIRT_END )
+ limit = RDWR_COMPAT_MPT_VIRT_END;
+ for ( i = 0, v = RDWR_COMPAT_MPT_VIRT_START, last_mfn = 0;
+ (i != xmml.max_extents) && (v < limit);
+ i++, v += 1 << L2_PAGETABLE_SHIFT )
+ {
+ l2e = compat_idle_pg_table_l2[l2_table_offset(v)];
+ if ( l2e_get_flags(l2e) & _PAGE_PRESENT )
+ mfn = l2e_get_pfn(l2e);
+ else
+ mfn = last_mfn;
+ ASSERT(mfn);
+ if ( copy_to_guest_offset(xmml.extent_start, i, &mfn, 1) )
+ return -EFAULT;
+ last_mfn = mfn;
+ }
+
+ xmml.nr_extents = i;
+ if ( __copy_to_guest(arg, &xmml, 1) )
+ rc = -EFAULT;
+
+ break;
+
case XENMEM_get_sharing_freed_pages:
return mem_sharing_get_nr_saved_mfns();
typedef struct xen_machphys_mfn_list xen_machphys_mfn_list_t;
DEFINE_XEN_GUEST_HANDLE(xen_machphys_mfn_list_t);
+/*
+ * For a compat caller, this is identical to XENMEM_machphys_mfn_list.
+ *
+ * For a non compat caller, this functions similarly to
+ * XENMEM_machphys_mfn_list, but returns the mfns making up the compatibility
+ * m2p table.
+ */
+#define XENMEM_machphys_compat_mfn_list 25
+
/*
* Returns the location in virtual address space of the machine_to_phys
* mapping table. Architectures which do not have a m2p table, or which do not
#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
+/* Next available subop number is 26 */
+
#endif /* __XEN_PUBLIC_MEMORY_H__ */
/*