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

[xen staging-4.13] cpupool: fix removing cpu from a cpupool



commit 9eec3eecadec0a74b8b2a7d5a2a154414856822d
Author:     Juergen Gross <jgross@xxxxxxxx>
AuthorDate: Wed Jun 24 16:21:50 2020 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Jun 24 16:21:50 2020 +0200

    cpupool: fix removing cpu from a cpupool
    
    Commit cb563d7665f2 ("xen/sched: support core scheduling for moving
    cpus to/from cpupools") introduced a regression when trying to remove
    an offline cpu from a cpupool, as the system would crash in this
    situation.
    
    Fix that by testing the cpu to be online.
    
    Fixes: cb563d7665f2 ("xen/sched: support core scheduling for moving cpus 
to/from cpupools")
    Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
    Acked-by: Dario Faggioli <dfaggioli@xxxxxxxx>
    master commit: 498d73647fa17d9eb7a67d2e9bdccac6b438e559
    master date: 2020-05-08 10:44:22 +0200
---
 xen/common/cpupool.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index b90bf42703..85f22c5f53 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -519,6 +519,9 @@ static int cpupool_unassign_cpu(struct cpupool *c, unsigned 
int cpu)
     debugtrace_printk("cpupool_unassign_cpu(pool=%d,cpu=%d)\n",
                       c->cpupool_id, cpu);
 
+    if ( !cpu_online(cpu) )
+        return -EINVAL;
+
     master_cpu = sched_get_resource_cpu(cpu);
     ret = cpupool_unassign_cpu_start(c, master_cpu);
     if ( ret )
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13



 


Rackspace

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