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

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



commit a46f01fad17173afe3809ac1980cbe4b67a9a8b5
Author:     Igor Druzhinin <igor.druzhinin@xxxxxxxxxx>
AuthorDate: Mon Oct 31 13:37:17 2022 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Oct 31 13:37:17 2022 +0100

    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>
    master commit: 9272225ca72801fd9fa5b268a2d1c5adebd19cd9
    master date: 2022-10-28 15:47:59 +0200
---
 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 b4e83e0778..104357e2c3 100644
--- a/xen/arch/x86/pv/shim.c
+++ b/xen/arch/x86/pv/shim.c
@@ -922,6 +922,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#stable-4.15



 


Rackspace

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