[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v6 14/15] xen/arm: clear pending irq queues on do_psci_cpu_on



On Tue, 2013-05-07 at 12:52 +0100, Stefano Stabellini wrote:
> On Tue, 7 May 2013, Ian Campbell wrote:

> > As I say, I think this stuff needs rationalising, it has become a bit
> > confused as SMP host and guest have been added and as our understanding
> > of the requirements has expanded etc.
> 
> I agree, but it's something for a separate patch

ACK

> > vgic_clear_pending_irqs beats any possible race with a big hammer.
> > 
> > In any case I don't think this check closes the race as you seem to
> > think, the cpu_off CPU could not have yet set VPF_down.
> 
> I am trying to prevent vgic_vcpu_inject_irq from calling vcpu_unblock
> on a vcpu that is going down.
> 
> Given that VPF_down is set before calling vcpu_sleep_nosync, I think
> that the test_bit I added should be enough to prevent the race.

Ah yes, I see now. Thanks for explaining.

> > I don't think this is a race you can win without a big lock around
> > interrupt injection & cpu up/down, but luckily I don't think it is
> > necessary since clear_pending_irqs takes care of it.
> > 
> > However I do think you need to call vgic_clear_pending_irqs before you
> > clear VPF_down in cpu_up (i.e. before the call to arch_set_info_guest).
> > Otherwise you will drop any interrupts sent while the processor is
> > coming up.
> 
> I guess it would make sense but keeping in mind that the vcpu is not
> actually up until vcpu_wake is called, I don't think it would make a
> difference.

I suppose not.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.