From: Julien Grall <julien.grall@arm.com>
To: Dario Faggioli <dario.faggioli@citrix.com>,
George Dunlap <george.dunlap@citrix.com>
Cc: Varun.Swara@arm.com, Xen Devel <xen-devel@lists.xen.org>,
Steve Capper <Steve.Capper@arm.com>
Subject: Re: xen/arm: Assertion 'timer->status >= TIMER_STATUS_inactive' failed at timer.c:279
Date: Tue, 26 Apr 2016 19:05:50 +0100 [thread overview]
Message-ID: <571FADFE.10500@arm.com> (raw)
In-Reply-To: <1461692950.3525.71.camel@citrix.com>
On 26/04/16 18:49, Dario Faggioli wrote:
> On Tue, 2016-04-26 at 15:25 +0100, Julien Grall wrote:
> Hi,
Hi Dario,
[...]
> commit eca4d65fb67a71c0f6563aafbfdd68e566c53c32
> Author: Dario Faggioli <dario.faggioli@citrix.com>
> Date: Tue Apr 26 17:42:36 2016 +0200
>
> xen: sched: fix killing an uninitialized timer in free_pdata.
>
> commit 64269d9365 "sched: implement .init_pdata in Credit,
> Credit2 and RTDS" helped fixing Credit2 runqueues, and
> the races we had in switching scheduler for pCPUs, but
> introduced another issue. In fact, if CPU bringup fails
> during __cpu_up() (and, more precisely, after CPU_UP_PREPARE,
> but before CPU_STARTING) the CPU_UP_CANCELED notifier
> would be executed, which calls the free_pdata hook.
>
> Such hook does two things: (1) undo the initialization
> done inside the init_pdata hook; (2) free the memory
> allocated by the alloc_pdata hook.
>
> However, in the failure path just described, it is possible
> that only alloc_pdata has really been called, which is
> potentially and issue (depending on what actually happens
> inside the implementation of free_pdata).
>
> In fact, for Credit1 (the only scheduler that actually
> allocates per-pCPU data), this result in calling kill_timer()
> on a timer that had not yet been initialized, which causes
> the following:
>
> (XEN) Xen call trace:
> (XEN) [<000000000022e304>] timer.c#active_timer+0x8/0x24 (PC)
> (XEN) [<000000000022f624>] kill_timer+0x108/0x2e0 (LR)
> (XEN) [<00000000002208c0>] sched_credit.c#csched_free_pdata+0xd8/0x114
> (XEN) [<0000000000227a18>] schedule.c#cpu_schedule_callback+0xc0/0x12c
> (XEN) [<0000000000219944>] notifier_call_chain+0x78/0x9c
> (XEN) [<00000000002015fc>] cpu_up+0x104/0x130
> (XEN) [<000000000028f7c0>] start_xen+0xaf8/0xce0
> (XEN) [<00000000810021d8>] 00000000810021d8
> (XEN)
> (XEN)
> (XEN) ****************************************
> (XEN) Panic on CPU 0:
> (XEN) Assertion 'timer->status >= TIMER_STATUS_inactive' failed at timer.c:279
> (XEN) ****************************************
>
> Solve this by making the scheduler hooks API symmetric again,
> i.e., by adding an deinit_pdata hook and making it responsible
> of undoing what init_pdata did, rather than asking to free_pdata
> to do everything.
>
> This is cleaner and, in the case at hand, makes it possible to
> only call free_pdata, which is the right thing to do, as only
> allocation and no initialization was performed.
>
> Reported-by: Julien Grall <julien.grall@arm.com>
> Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
> ---
> Cc: George Dunlap <george.dunlap@citrix.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Cc: Varun.Swara@arm.com
> Cc: Steve Capper <Steve.Capper@arm.com>
Thank you for the patch. It fixes the bug when secondary CPUs fail to
come online on the Foundation Model:
Tested-by: Julien Grall <julien.grall@arm.com>
Regards,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-04-26 18:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-26 14:25 xen/arm: Assertion 'timer->status >= TIMER_STATUS_inactive' failed at timer.c:279 Julien Grall
2016-04-26 17:49 ` Dario Faggioli
2016-04-26 18:05 ` Julien Grall [this message]
2016-04-27 13:43 ` George Dunlap
2016-04-27 14:05 ` Dario Faggioli
2016-04-27 14:29 ` George Dunlap
2016-05-03 13:03 ` Julien Grall
2016-05-03 13:20 ` George Dunlap
2016-05-03 13:22 ` Julien Grall
2016-05-03 13:23 ` Wei Liu
2016-05-03 21:52 ` Dario Faggioli
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=571FADFE.10500@arm.com \
--to=julien.grall@arm.com \
--cc=Steve.Capper@arm.com \
--cc=Varun.Swara@arm.com \
--cc=dario.faggioli@citrix.com \
--cc=george.dunlap@citrix.com \
--cc=xen-devel@lists.xen.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).