[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v6 06/11] xen, x86: factor out map and unmap from the memory_mapping DOMCTL



On 21/04/2014 14:44, Arianna Avanzini wrote:
#if P2M_AUDIT
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 4a1c129..1098600 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -32,6 +32,18 @@
  #include <asm/mem_sharing.h>
  #include <asm/page.h>    /* for pagetable_t */
+/* Map MMIO regions in the p2m: start_gfn and end_gfn is the range, inclusive
+ * of the end_gfn frame number, in the guest physical address space to map,
+ * starting from the machine frame number mfn. */
+int map_mmio_regions(struct domain *d,
+                     unsigned long start_gfn,
+                     unsigned long end_gfn,
+                     unsigned long mfn);
+int unmap_mmio_regions(struct domain *d,
+                       unsigned long start_gfn,
+                       unsigned long end_gfn,
+                       unsigned long mfn);
+
  extern bool_t opt_hap_1gb, opt_hap_2mb;
/*

Given that you are changing all of this, please please take the time to change these functions (and others in the series, where appropriate) to take parameters more like (struct domain *d, unsigned long gfn, unsigned long mfn, unsigned long count)

With a count parameter as opposed to a start/end pair, there can be no confusion regarding inclusive/exclusive ranges, or at which point to subtract 1. It will also resemble the information in the hypercall, and avoids needing to recalculate nr_mfns everywhere.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.