From: Sander Eikelenboom Subject: Re: Xen-unstable: Xen panic when shutting down HVM guest with PCI passthrough: RIP: e008:[] evtchn_move_pirqs+0x90/0xbf Date: Fri, 6 Jun 2014 10:15:49 +0200 Message-ID: <1404039130.20140606101549@eikelenboom.it> References: <495141585.20140605165458@eikelenboom.it> <539086BC.7070200@citrix.com> <1617474467.20140605180343@eikelenboom.it> <53909933.5020109@citrix.com> <539146F0.7040902@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WspJc-0000EX-7S for xen-devel@lists.xenproject.org; Fri, 06 Jun 2014 08:15:56 +0000 In-Reply-To: <539146F0.7040902@suse.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: =?iso-8859-1?Q?J=FCrgen_Gro=DF?= Cc: George Dunlap , Andrew Cooper , Jan Beulich , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org Friday, June 6, 2014, 6:43:28 AM, you wrote: > On 06/05/2014 06:22 PM, Andrew Cooper wrote: >> On 05/06/14 17:03, Sander Eikelenboom wrote: >>> Thursday, June 5, 2014, 5:03:24 PM, you wrote: >>> >>>> On 05/06/14 15:54, Sander Eikelenboom wrote: >>>> >>>> Hi, >>>> When shutting down a HVM guest with PCI passthrough Xen panics with th= e panic >>>> below (complete xl-dmesg attached). >>>> # addr2line -e xen-syms ffff82d0801099b1 >>>> /usr/src/new/xen-unstable/xen/common/event_channel.c:1326 >>>> which is: >>>> pirq_set_affinity(d, chn->u.pirq.irq, mask); >>>> >>>> >>>> This is presumably an ordering issue on destroy. >>>> >>>> Does reverting bac6334b5 fix the problem? >>>> >>>> ~Andrew >>> Hi Andrew, >>> >>> That seems to have been a good hunch, after reverting that commit i hav= e been >>> able to repeatedly create and shutdown the guest with passthrough, with= out a crash. >>> >>> -- >>> Sander >>> >> >> CC'ing George and Juergen as the authors of the identified patch >> >> c/s bac6334b5 "move domain to cpupool0 before destroying it" appears to >> cause the crash identified the root of this thread. >> >> It appears to now move event channels after having torn parts of the >> event channel infrastructure. > Hmm, does the following patch fix it? > Juergen > diff --git a/xen/common/schedule.c b/xen/common/schedule.c > index c174c41..3ea9fc8 100644 > --- a/xen/common/schedule.c > +++ b/xen/common/schedule.c > @@ -297,7 +297,8 @@ int sched_move_domain(struct domain *d, struct = > cpupool *c) > spin_unlock_irq(lock); > v->sched_priv =3D vcpu_priv[v->vcpu_id]; > - evtchn_move_pirqs(v); + if ( !d->>is_dying ) > + evtchn_move_pirqs(v); > new_p =3D cpumask_cycle(new_p, c->cpu_valid); Hi J=FCrgen, Tried that one, it prevents the host panic, but immediately after i do get = a: [ 658.222311] irq 16: nobody cared (try booting with the "irqpoll" option) [ 658.229069] CPU: 0 PID: 17104 Comm: smtp Not tainted 3.15.0-rc8-20140602= -net-xendev-bt-mq+ #1 [ 658.235996] Hardware name: MSI MS-7640/890FXA-GD70 (MS-7640) , BIOS V1.= 8B1 09/13/2010 [ 658.243234] ffff880054b00718 ffff88005f603d98 ffffffff81b93243 ffff8800= 2e4e9330 [ 658.250342] ffff880054b00690 ffff88005f603dc8 ffffffff8112306d ffff8800= 5f603dc8 [ 658.257411] ffff880054b00690 0000000000000010 0000000000000000 ffff8800= 5f603e18 [ 658.264362] Call Trace: [ 658.271128] [] dump_stack+0x46/0x58 [ 658.278096] [] __report_bad_irq+0x3d/0xe0 [ 658.285175] [] note_interrupt+0x1bf/0x210 [ 658.292210] [] handle_irq_event_percpu+0xb5/0x1e0 [ 658.299135] [] handle_irq_event+0x48/0x70 [ 658.306032] [] ? handle_fasteoi_irq+0x2f/0x150 [ 658.312935] [] handle_fasteoi_irq+0x8c/0x150 [ 658.319847] [] generic_handle_irq+0x22/0x40 [ 658.326627] [] evtchn_fifo_handle_events+0x137/0x140 [ 658.333370] [] __xen_evtchn_do_upcall+0x50/0xa0 [ 658.340061] [] xen_evtchn_do_upcall+0x37/0x50 [ 658.346575] [] xen_do_hypervisor_callback+0x1e/0x30 [ 658.353214] [ 658.353264] handlers: [ 658.366234] [] azx_interrupt [ 658.372806] Disabling IRQ #16 Which could be related ? -- Sander