]> xenbits.xensource.com Git - pvdrivers/win/xenbus.git/commitdiff
Add Order parameter to MemoryDecreaseReservation()...
authorPaul Durrant <paul.durrant@citrix.com>
Wed, 31 Jan 2018 11:40:27 +0000 (11:40 +0000)
committerPaul Durrant <paul.durrant@citrix.com>
Wed, 31 Jan 2018 15:04:34 +0000 (15:04 +0000)
...and MemoryPopulatePhysmap()

Stop hard-coding the page order to 0 and allow the caller to specify it.
Also add a couple of #defines for 4k and 2M page orders.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
include/xen.h
src/xen/memory.c
src/xenbus/balloon.c

index e7956f0c18afbb8c5740325b646000e2515fcdc2..98b0748324fea1e68e677654527081d371054a70 100644 (file)
@@ -126,10 +126,14 @@ MemoryAddToPhysmap(
     IN  ULONG_PTR   Offset
     );
 
+#define PAGE_ORDER_4K   0
+#define PAGE_ORDER_2M   9
+
 __checkReturn
 XEN_API
 ULONG
 MemoryDecreaseReservation(
+    IN  ULONG       Order,
     IN  ULONG       Count,
     IN  PPFN_NUMBER PfnArray
     );
@@ -138,6 +142,7 @@ __checkReturn
 XEN_API
 ULONG
 MemoryPopulatePhysmap(
+    IN  ULONG       Order,
     IN  ULONG       Count,
     IN  PPFN_NUMBER PfnArray
     );
index 9b555ec28f735d99c9b89bfd78a978dfdadc2487..5cdbe9d2d75294cf33b4e19b36250a1bd1e3d91c 100644 (file)
@@ -84,6 +84,7 @@ __checkReturn
 XEN_API
 ULONG
 MemoryDecreaseReservation(
+    IN  ULONG                       Order,
     IN  ULONG                       Count,
     IN  PPFN_NUMBER                 PfnArray
     )
@@ -92,7 +93,7 @@ MemoryDecreaseReservation(
     LONG_PTR                        rc;
 
     set_xen_guest_handle(op.extent_start, PfnArray);
-    op.extent_order = 0;
+    op.extent_order = Order;
     op.mem_flags = 0;
     op.domid = DOMID_SELF;
     op.nr_extents = Count;
@@ -106,6 +107,7 @@ __checkReturn
 XEN_API
 ULONG
 MemoryPopulatePhysmap(
+    IN  ULONG                       Order,
     IN  ULONG                       Count,
     IN  PPFN_NUMBER                 PfnArray
     )
@@ -114,7 +116,7 @@ MemoryPopulatePhysmap(
     LONG_PTR                        rc;
 
     set_xen_guest_handle(op.extent_start, PfnArray);
-    op.extent_order = 0;
+    op.extent_order = Order;
     op.mem_flags = 0;
     op.domid = DOMID_SELF;
     op.nr_extents = Count;
index f987096ef9bd76fa3852528bbf773b6c39fd325f..6f3767cb96dd7571f5c6722365f9e1cd8bc9fbe6 100644 (file)
@@ -340,17 +340,17 @@ BalloonPopulatePhysmap(
     IN  PPFN_NUMBER PfnArray
     )
 {
-    LARGE_INTEGER           Start;
-    LARGE_INTEGER           End;
-    ULONGLONG               TimeDelta;
-    ULONGLONG               Rate;
-    ULONG                   Count;
+    LARGE_INTEGER   Start;
+    LARGE_INTEGER   End;
+    ULONGLONG       TimeDelta;
+    ULONGLONG       Rate;
+    ULONG           Count;
 
     ASSERT(Requested != 0);
 
     KeQuerySystemTime(&Start);
 
-    Count = MemoryPopulatePhysmap(Requested, PfnArray);
+    Count = MemoryPopulatePhysmap(Requested, PAGE_ORDER_4K, PfnArray);
 
     KeQuerySystemTime(&End);
     TimeDelta = __max(((End.QuadPart - Start.QuadPart) / 10000ull), 1);
@@ -427,17 +427,17 @@ BalloonDecreaseReservation(
     IN  PPFN_NUMBER PfnArray
     )
 {
-    LARGE_INTEGER           Start;
-    LARGE_INTEGER           End;
-    ULONGLONG               TimeDelta;
-    ULONGLONG               Rate;
-    ULONG                   Count;
+    LARGE_INTEGER   Start;
+    LARGE_INTEGER   End;
+    ULONGLONG       TimeDelta;
+    ULONGLONG       Rate;
+    ULONG           Count;
 
     ASSERT(Requested != 0);
 
     KeQuerySystemTime(&Start);
 
-    Count = MemoryDecreaseReservation(Requested, PfnArray);
+    Count = MemoryDecreaseReservation(Requested, PAGE_ORDER_4K, PfnArray);
 
     KeQuerySystemTime(&End);
     TimeDelta = __max(((End.QuadPart - Start.QuadPart) / 10000ull), 1);