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

[Xen-devel] [PATCH RFC v1 60/74] xen/pvshim: set max_pages to the value of tot_pages



From: Roger Pau Monne <roger.pau@xxxxxxxxxx>

So that the guest is not able to deplete the memory pool of the shim
itself by trying to balloon up.

Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/pv/shim.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/arch/x86/pv/shim.c b/xen/arch/x86/pv/shim.c
index c24adacbc7..46f77362a7 100644
--- a/xen/arch/x86/pv/shim.c
+++ b/xen/arch/x86/pv/shim.c
@@ -195,6 +195,12 @@ void __init pv_shim_setup_dom(struct domain *d, 
l4_pgentry_t *l4start,
                             console_mfn, vphysmap);
         consoled_set_ring_addr(page);
     }
+
+    /*
+     * Set the max pages to the current number of pages to prevent the
+     * guest from depleting the shim memory pool.
+     */
+    d->max_pages = d->tot_pages;
 }
 
 static void write_start_info(struct domain *d)
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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