From nobody Mon Feb 9 12:15:18 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1588259789; cv=none; d=zohomail.com; s=zohoarc; b=S9+XIu478P/nWON/pImOcvj9OTqXvHvBDngc6Rqj6F8XDzZK9HMVWPOMm/yax8l2vVtY0bmWvxS4ME6O+sMoHqHeD39pI1Vpf4aDQ8+5yWJi4YTH4G4d9+eCURhVkYGx89/A8qwZj7h2LobeI/Ef+ahm3Ae70p75V8A57iB40QY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588259789; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=ny1M/drX4m3QII0hZRIWJJo1CHlVve5zzZTi1INaUm4=; b=MFGzNfaDBgv80n7BcNVuMJ4RQMEbHiK1n7yHVwWM6gisYZAQsz7hsaIF/1H8EJbKqPqF3eMgvNw5P0KRr56mbshhlqFSNyvy+jl2MkfnxzLWU45Saq6o9kTKpw3KILMGLGeDCmFX1WHgYh+T2XH/hVc5SDTG/dqP2+0B1GlcXKU= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1588259789044689.7187631261121; Thu, 30 Apr 2020 08:16:29 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jUAv5-0007Rd-U3; Thu, 30 Apr 2020 15:16:11 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jUAv4-0007R4-Um for xen-devel@lists.xenproject.org; Thu, 30 Apr 2020 15:16:10 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 811ec43f-8af5-11ea-9a67-12813bfff9fa; Thu, 30 Apr 2020 15:16:03 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 7ECE7AF4C; Thu, 30 Apr 2020 15:16:01 +0000 (UTC) X-Inumbo-ID: 811ec43f-8af5-11ea-9a67-12813bfff9fa X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Subject: [PATCH 3/3] xen/cpupool: fix removing cpu from a cpupool Date: Thu, 30 Apr 2020 17:15:59 +0200 Message-Id: <20200430151559.1464-4-jgross@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200430151559.1464-1-jgross@suse.com> References: <20200430151559.1464-1-jgross@suse.com> X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , George Dunlap , Dario Faggioli Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 Acked-by: Dario Faggioli --- xen/common/sched/cpupool.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/common/sched/cpupool.c b/xen/common/sched/cpupool.c index d40345b585..de9e25af84 100644 --- a/xen/common/sched/cpupool.c +++ b/xen/common/sched/cpupool.c @@ -520,6 +520,9 @@ static int cpupool_unassign_cpu(struct cpupool *c, unsi= gned int cpu) debugtrace_printk("cpupool_unassign_cpu(pool=3D%d,cpu=3D%d)\n", c->cpupool_id, cpu); =20 + if ( !cpu_online(cpu) ) + return -EINVAL; + master_cpu =3D sched_get_resource_cpu(cpu); ret =3D cpupool_unassign_cpu_start(c, master_cpu); if ( ret ) --=20 2.16.4