From patchwork Thu Aug 7 16:28:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 35056 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 670E221137 for ; Thu, 7 Aug 2014 16:30:43 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id lf10sf27514799pab.1 for ; Thu, 07 Aug 2014 09:30:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:cc:subject :precedence:list-id:list-unsubscribe:list-post:list-help :list-subscribe:mime-version:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive :content-type:content-transfer-encoding; bh=0vgyi8eBT1gyeE3WMR9BSR72x/rixpZ7xbA3AJSuzzI=; b=YqIgGsUaFsawcNqf3bwZleCWzPwAx0bO3EsZ9dQJfZxTH0Z2uxcpIHEA6Zwehrxzhk oUnobErlLLLLpZSz8MeCLQtTYisEyXJH9a6bverro0+2xxCK0gbNn0JVI+oIVp0RBz32 BarEijkvYWKaIj6v+8lFL4fIiW2EhH4+iAzymG+vzbDiE0f7UJAEiWOReVAg0t34/pSD 8uF6B9az5RJ3n2G1EhyNfo1AyXkNevWgqdtG93GyHlD3/4+jn2z4TrlVqiOSYuKGis4u HeF+UqdIF1KJxNIA5gzB7xJwcGu73nVfRyRvvhJUVcjdKOHwOfDsx8dyUxcCJJwQxIf8 QASw== X-Gm-Message-State: ALoCoQmXKHsUTs+/ruoUJ5fnDxr6eAO+14VIw3B6KISoyAs1fJjVgBk4yc5YmoMUH+uL4ejizhbI X-Received: by 10.66.235.66 with SMTP id uk2mr771781pac.39.1407429042651; Thu, 07 Aug 2014 09:30:42 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.103.193 with SMTP id y59ls201825qge.9.gmail; Thu, 07 Aug 2014 09:30:42 -0700 (PDT) X-Received: by 10.52.26.173 with SMTP id m13mr1410212vdg.69.1407429042430; Thu, 07 Aug 2014 09:30:42 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id rq6si1965106vcb.97.2014.08.07.09.30.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Aug 2014 09:30:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.180 as permitted sender) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id ij19so6618323vcb.11 for ; Thu, 07 Aug 2014 09:30:42 -0700 (PDT) X-Received: by 10.220.97.5 with SMTP id j5mr17504064vcn.16.1407429042312; Thu, 07 Aug 2014 09:30:42 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp43783vcb; Thu, 7 Aug 2014 09:30:41 -0700 (PDT) X-Received: by 10.50.178.172 with SMTP id cz12mr30953880igc.22.1407429039820; Thu, 07 Aug 2014 09:30:39 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id t6si11533496icp.106.2014.08.07.09.30.39 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 07 Aug 2014 09:30:39 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XFQYI-0000sA-PL; Thu, 07 Aug 2014 16:28:30 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XFQYI-0000s2-1o for xen-devel@lists.xenproject.org; Thu, 07 Aug 2014 16:28:30 +0000 Received: from [193.109.254.147:39070] by server-7.bemta-14.messagelabs.com id 88/99-13362-D29A3E35; Thu, 07 Aug 2014 16:28:29 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-4.tower-27.messagelabs.com!1407428908!14397334!1 X-Originating-IP: [209.85.212.177] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 19319 invoked from network); 7 Aug 2014 16:28:28 -0000 Received: from mail-wi0-f177.google.com (HELO mail-wi0-f177.google.com) (209.85.212.177) by server-4.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 7 Aug 2014 16:28:28 -0000 Received: by mail-wi0-f177.google.com with SMTP id ho1so5316682wib.16 for ; Thu, 07 Aug 2014 09:28:28 -0700 (PDT) X-Received: by 10.180.19.97 with SMTP id d1mr25711711wie.19.1407428908262; Thu, 07 Aug 2014 09:28:28 -0700 (PDT) Received: from belegaer.uk.xensource.com ([185.25.64.249]) by mx.google.com with ESMTPSA id do6sm1057582wib.22.2014.08.07.09.28.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Aug 2014 09:28:26 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Thu, 7 Aug 2014 17:28:20 +0100 Message-Id: <1407428900-1172-1-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 Cc: Juergen Gross , Keir Fraser , ian.campbell@citrix.com, Ian Jackson , Dario Faggioli , Julien Grall , tim@xen.org, George Dunlap , stefano.stabellini@citrix.com, Jan Beulich Subject: [Xen-devel] [PATCH v3] xen: domain_update_node_affinity: Bail out early if no VCPUs are allocated X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.180 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: The commit "move domain to cpupool0 before destroying it" make Xen crashes when a domain is destroyed with d->vcpus allocated but no VCPU initialized. Assertion '!cpumask_empty(dom_cpumask)' failed at domain.c:452 Xen call trace: [<00207bd8>] domain_update_node_affinity+0x10c/0x238 (PC) [<00000004>] 00000004 (LR) [<00226870>] sched_move_domain+0x3cc/0x42c [<0020925c>] domain_kill+0xc8/0x178 [<00206a0c>] do_domctl+0xaac/0x15e4 [<002529c0>] do_trap_hypervisor+0xc5c/0xf94 [<002559f0>] return_from_trap+0/0x4 Bail out early if there is d->VCPU is not allocated or VCPU 0 has not been initialized. Signed-off-by: Julien Grall Cc: George Dunlap Cc: Dario Faggioli Cc: Juergen Gross Cc: Ian Campbell Cc: Ian Jackson Cc: Jan Beulich Cc: Keir Fraser Cc: Tim Deegan --- This patch should be backported to Xen 4.4 Changes in v3: - Change commit message - Bail out early rather than modifying the ASSERT --- xen/common/domain.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/common/domain.c b/xen/common/domain.c index d7a84cf..f0d93e9 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -415,6 +415,9 @@ void domain_update_node_affinity(struct domain *d) struct vcpu *v; unsigned int cpu; + if ( !d->vcpu || !d->vcpu[0] ) + return; + if ( !zalloc_cpumask_var(&dom_cpumask) ) return; if ( !zalloc_cpumask_var(&dom_cpumask_soft) )