All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: Julien Grall <julien.grall@linaro.org>
Cc: xen-devel@lists.xensource.com, apatel@apm.com,
	Ian Campbell <ian.campbell@citrix.com>,
	psawargaonkar@apm.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH] xen/arm: introduce platform_need_explicit_eoi
Date: Sat, 21 Jun 2014 15:43:08 +0100	[thread overview]
Message-ID: <alpine.DEB.2.02.1406211541550.19982@kaball.uk.xensource.com> (raw)
In-Reply-To: <CAPnVf8w=Jha60PZEVFS3=fKLayTWwdGzFquUafMcxe0gSUkN=Q@mail.gmail.com>

On Fri, 20 Jun 2014, Julien Grall wrote:
> On 20 Jun 2014 18:41, "Stefano Stabellini" <stefano.stabellini@eu.citrix.com> wrote:
> >
> > On Fri, 20 Jun 2014, Julien Grall wrote:
> > > On 20/06/14 17:48, Stefano Stabellini wrote:
> > > >
> > > > > Your patch "physical irq follow virtual irq" won't even solve this problem
> > > > > if
> > > > > the maintenance interrupt is request to EOI the IRQ.
> > > >
> > > > I don't understand this statement.
> > > > The maintenance interrupt is requested to make sure that the vcpu is
> > > > interrupted as soon as it EOIs the virtual irq, so that
> > > > gic_update_one_lr can run.
> > >
> > > I agree with that but ... the following step can happen
> > >
> > > 1) Xen receives the interrupt
> > > 2) Xen writes EOIR
> > > 3) Xen inject the IRQ to the guest
> > > 4) The guest will receive the IRQ (i.e read IAR)
> > > 5) Xen migrates the VCPU to another physical CPU
> > > 6) The guest writes into GIC_DIR and a maintenance IRQ is fired.
> > >
> > > In a such case, the IRQ will be EOIed to another physical CPU. If we assume
> > > that we should always write to GICC_DIR of the physical CPU that receive the
> > > interrupt, then even your patch "physcial irq follow virtual irq" won't solve
> > > the problem.
> >
> > That's true.
> >
> >
> >
> > > > > The VGIC lock is per-vcpu.
> > > > >
> > > > > If this is happening while we migrate, nothing protect p->lr and the
> > > > > different
> > > > > bit anymore.
> > > >
> > > > The patch series
> > > > alpine.DEB.2.02.1406111607450.13771@kaball.uk.xensource.com takes
> > > > care of vcpu migration and locking.
> > > >
> > > >
> > > > > Indeed, the vgic_inject_irq will use the new VCPU. This can happen as soon
> > > > > as
> > > > > we EOI the IRQ.
> > > >
> > > > Yes, but at that point we have also already migrated the corresponding
> > > > physical irq to the new pcpu.
> > >
> > > Even tho we the migration has been done, the 2 clear bit are not atomic. Let's
> > > imagine that the IRQ has fired between the two clear bit. In this case we may
> > > clear the ACTIVE bit by mistake.
> > >
> > > I don't see anything in this code which prevents a such configuration.
> >
> > Which 2 clear bit?
> 
> GUEST_VISIBLE and GUEST_ACTIVE see the code after eoi_irq.

The code is protected by the vgic lock.

  reply	other threads:[~2014-06-21 14:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-20 13:35 [PATCH] xen/arm: introduce platform_need_explicit_eoi Stefano Stabellini
2014-06-20 14:11 ` Julien Grall
2014-06-20 14:27   ` Stefano Stabellini
2014-06-20 14:47     ` Julien Grall
2014-06-20 16:48       ` Stefano Stabellini
2014-06-20 16:59         ` Julien Grall
2014-06-20 17:40           ` Stefano Stabellini
2014-06-20 18:33             ` Julien Grall
2014-06-21 14:43               ` Stefano Stabellini [this message]
2014-06-21 14:59                 ` Julien Grall
2014-06-21 15:26                   ` Stefano Stabellini
2014-06-21 15:59                     ` Julien Grall
2014-06-23 10:43                       ` Stefano Stabellini
2014-06-27 15:51                         ` Ian Campbell
2014-06-30 10:01                           ` Julien Grall
2014-07-02 15:31                             ` Stefano Stabellini
2014-07-02 15:34                           ` Stefano Stabellini
2014-07-02 14:49 ` Julien Grall
2014-07-02 15:31   ` Stefano Stabellini

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=alpine.DEB.2.02.1406211541550.19982@kaball.uk.xensource.com \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=apatel@apm.com \
    --cc=ian.campbell@citrix.com \
    --cc=julien.grall@linaro.org \
    --cc=psawargaonkar@apm.com \
    --cc=xen-devel@lists.xensource.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.