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

[xen staging] x86/pv-shim: correctly ignore empty onlining requests



commit 9272225ca72801fd9fa5b268a2d1c5adebd19cd9
Author:     Igor Druzhinin <igor.druzhinin@xxxxxxxxxx>
AuthorDate: Fri Oct 28 15:47:59 2022 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Oct 28 15:47:59 2022 +0200

    x86/pv-shim: correctly ignore empty onlining requests
    
    Mem-op requests may have zero extents. Such requests need treating as
    no-ops. pv_shim_online_memory(), however, would have tried to take 2³²-1
    order-sized pages from its balloon list (to then populate them),
    typically ending when the entire set of ballooned pages of this order
    was consumed.
    
    Note that pv_shim_offline_memory() does not have such an issue.
    
    Fixes: b2245acc60c3 ("xen/pvshim: memory hotplug")
    Signed-off-by: Igor Druzhinin <igor.druzhinin@xxxxxxxxxx>
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Release-acked-by: Henry Wang <Henry.Wang@xxxxxxx>
---
 xen/arch/x86/pv/shim.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/arch/x86/pv/shim.c b/xen/arch/x86/pv/shim.c
index 49ce4f93f2..ae1a0e6e65 100644
--- a/xen/arch/x86/pv/shim.c
+++ b/xen/arch/x86/pv/shim.c
@@ -944,6 +944,9 @@ void pv_shim_online_memory(unsigned int nr, unsigned int 
order)
     struct page_info *page, *tmp;
     PAGE_LIST_HEAD(list);
 
+    if ( !nr )
+        return;
+
     spin_lock(&balloon_lock);
     page_list_for_each_safe ( page, tmp, &balloon )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

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