From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Julien Grall <julien.grall@linaro.org>, xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>, Keir Fraser <keir@xen.org>,
ian.campbell@citrix.com, tim@xen.org,
Dario Faggioli <dario.faggioli@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
George Dunlap <george.dunlap@citrix.com>,
stefano.stabellini@citrix.com, Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH] xen: domain_update_node_affinity: Correct the ASSERT
Date: Fri, 25 Jul 2014 17:05:35 +0100 [thread overview]
Message-ID: <53D2804F.3040404@citrix.com> (raw)
In-Reply-To: <53D27C30.7020908@linaro.org>
On 25/07/14 16:48, Julien Grall wrote:
> On 07/25/2014 04:44 PM, Andrew Cooper wrote:
>> On 25/07/14 16:30, Julien Grall wrote:
>>> 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
>>>
>>> Fix the ASSERT to check if d->vcpu is allocated and VCPU 0 is initialized.
>>>
>>> Signed-off-by: Julien Grall <julien.grall@linaro.org>
>>> Cc: George Dunlap <george.dunlap@citrix.com>
>>> Cc: Dario Faggioli <dario.faggioli@citrix.com>
>>> Cc: Juergen Gross <jgross@suse.com>
>>> Cc: Ian Campbell <ian.campbell@citrix.com>
>>> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
>>> Cc: Jan Beulich <jbeulich@suse.com>
>>> Cc: Keir Fraser <keir@xen.org>
>>> Cc: Tim Deegan <tim@xen.org>
>>>
>>> ---
>>> This patch should be backported to Xen 4.4
>>> ---
>>> xen/common/domain.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/xen/common/domain.c b/xen/common/domain.c
>>> index d7a84cf..188b769 100644
>>> --- a/xen/common/domain.c
>>> +++ b/xen/common/domain.c
>>> @@ -449,7 +449,7 @@ void domain_update_node_affinity(struct domain *d)
>>> }
>>> /* Filter out non-online cpus */
>>> cpumask_and(dom_cpumask, dom_cpumask, online);
>>> - ASSERT(!cpumask_empty(dom_cpumask));
>>> + ASSERT( !d->vcpu || !d->vcpu[0] || !cpumask_empty(dom_cpumask));
>> You don't actually care for the vcpu pointers themselves. You only care
>> whether the domain has vcpus.
>>
>> d->max_vcpus == 0 is a more appropriate check.
> Actually no... max_vcpus has been set before Xen is allocating
> alloc_vcpu (see DOMCTL_max_vpus in common common/domctl.c).
>
> So if Xen fails to allocate VCPU0, the hypervisor will still crash when
> the domain is killed.
>
> Regards,
>
Ah yes - I had mis-remembered the problem at hand. Sorry for the noise.
~Andrew
next prev parent reply other threads:[~2014-07-25 16:05 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-25 15:30 [PATCH] xen: domain_update_node_affinity: Correct the ASSERT Julien Grall
2014-07-25 15:42 ` Jan Beulich
2014-07-25 15:44 ` Julien Grall
2014-07-25 15:59 ` Jan Beulich
2014-07-28 17:23 ` Dario Faggioli
2014-07-25 15:44 ` Andrew Cooper
2014-07-25 15:48 ` Julien Grall
2014-07-25 16:05 ` Andrew Cooper [this message]
2014-07-28 17:25 ` Dario Faggioli
2014-07-28 17:31 ` Julien Grall
2014-07-29 6:40 ` Jan Beulich
2014-07-29 10:46 ` Julien Grall
-- strict thread matches above, loose matches on Subject: below --
2014-08-01 14:52 Julien Grall
2014-08-01 15:12 ` Jan Beulich
2014-08-04 14:50 ` George Dunlap
2014-08-07 15:04 ` Julien Grall
2014-08-07 15:53 ` Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53D2804F.3040404@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=dario.faggioli@citrix.com \
--cc=george.dunlap@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=jgross@suse.com \
--cc=julien.grall@linaro.org \
--cc=keir@xen.org \
--cc=stefano.stabellini@citrix.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).