On 03/09/2015 10:10 AM, David Vrabel wrote:
Memory hotplug doesn't work with PV guests because:
a) The p2m cannot be expanded to cover the new sections.
b) add_memory() builds page tables for the new sections which means
the new pages must have valid p2m entries (or a BUG occurs).
Is this due to recent p2m rework?
-boris
So, in PV guests, clamp the target to the current (== maximum) number
of pages and do not try to hotplug any memory.
Signed-off-by: David Vrabel <david.vra...@citrix.com>
---
Cc: Daniel Kiper <daniel.ki...@oracle.com>
---
drivers/xen/balloon.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index 0b52d92..4158196 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -225,6 +225,19 @@ static enum bp_state reserve_additional_memory(long credit)
u64 hotplug_start_paddr;
unsigned long balloon_hotplug = credit;
+ /*
+ * Memory hotplug doesn't work with PV guests because:
+ *
+ * a) The p2m cannot be expanded to cover the new sections.
+ *
+ * b) add_memory() builds page tables for the new sections
+ * which means they must be fully populated in advance.
+ */
+ if (xen_pv_domain()) {
+ balloon_stats.target_pages = balloon_stats.current_pages;
+ return BP_DONE;
+ }
+
hotplug_start_paddr = PFN_PHYS(SECTION_ALIGN_UP(max_pfn));
balloon_hotplug = round_up(balloon_hotplug, PAGES_PER_SECTION);
nid = memory_add_physaddr_to_nid(hotplug_start_paddr);
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel