All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: Julien Grall <julien.grall@arm.com>
Cc: xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Andrii Anisov <andrii_anisov@epam.com>,
	Andrii Anisov <andrii.anisov@gmail.com>
Subject: Re: [PATCH v2] gic: drop interrupts enabling on interrupts processing
Date: Fri, 31 May 2019 18:25:11 +0100	[thread overview]
Message-ID: <20190531182511.7de8ff68@donnerap.cambridge.arm.com> (raw)
In-Reply-To: <d63ff1d7-963a-bd1a-7835-ee5b30504628@arm.com>

On Tue, 28 May 2019 18:07:19 +0100
Julien Grall <julien.grall@arm.com> wrote:

[ ... ]

> While looking at the code, I noticed that in the new vgic vgic_get_irq() 
> looks unsafe to be called with interrupt unmasked. This is because one 
> of the callee (vgic_get_lpi()) takes a spinlock and not a spinlock_irq. 
> Andre, what do you think?

I think you are right. In vgic_inject_irq(), right after the call to vgic_get_irq(), we use spin_lock_irqsave() on the irq_lock, so using the same irqsave version on the lpi_list_lock seems needed. But this is somewhat theoretical at the moment, as I think we will never LPIs through the new VGIC at the moment.

Cheers,
Andre.

> > Signed-off-by: Andrii Anisov <andrii_anisov@epam.com>
> > ---
> > 
> > Changes:
> > 
> >      in v2: Drop irq enabling for lpi processing as well.
> > 
> > 
> > ---
> >   xen/arch/arm/gic.c | 4 ----
> >   1 file changed, 4 deletions(-)
> > 
> > diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
> > index 6cc7dec..113655a 100644
> > --- a/xen/arch/arm/gic.c
> > +++ b/xen/arch/arm/gic.c
> > @@ -386,17 +386,13 @@ void gic_interrupt(struct cpu_user_regs *regs, int is_fiq)
> >   
> >           if ( likely(irq >= 16 && irq < 1020) )
> >           {
> > -            local_irq_enable();
> >               isb();
> >               do_IRQ(regs, irq, is_fiq);
> > -            local_irq_disable();
> >           }
> >           else if ( is_lpi(irq) )
> >           {
> > -            local_irq_enable();
> >               isb();
> >               gic_hw_ops->do_LPI(irq);
> > -            local_irq_disable();
> >           }
> >           else if ( unlikely(irq < 16) )
> >           {
> >   
> 
> Cheers,
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

WARNING: multiple messages have this Message-ID (diff)
From: Andre Przywara <andre.przywara@arm.com>
To: Julien Grall <julien.grall@arm.com>
Cc: xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Andrii Anisov <andrii_anisov@epam.com>,
	Andrii Anisov <andrii.anisov@gmail.com>
Subject: Re: [Xen-devel] [PATCH v2] gic: drop interrupts enabling on interrupts processing
Date: Fri, 31 May 2019 18:25:11 +0100	[thread overview]
Message-ID: <20190531182511.7de8ff68@donnerap.cambridge.arm.com> (raw)
Message-ID: <20190531172511.JEUnLMt-VoZOPO7fQiCm0bOOzpCqMnxjl866mMrqTbo@z> (raw)
In-Reply-To: <d63ff1d7-963a-bd1a-7835-ee5b30504628@arm.com>

On Tue, 28 May 2019 18:07:19 +0100
Julien Grall <julien.grall@arm.com> wrote:

[ ... ]

> While looking at the code, I noticed that in the new vgic vgic_get_irq() 
> looks unsafe to be called with interrupt unmasked. This is because one 
> of the callee (vgic_get_lpi()) takes a spinlock and not a spinlock_irq. 
> Andre, what do you think?

I think you are right. In vgic_inject_irq(), right after the call to vgic_get_irq(), we use spin_lock_irqsave() on the irq_lock, so using the same irqsave version on the lpi_list_lock seems needed. But this is somewhat theoretical at the moment, as I think we will never LPIs through the new VGIC at the moment.

Cheers,
Andre.

> > Signed-off-by: Andrii Anisov <andrii_anisov@epam.com>
> > ---
> > 
> > Changes:
> > 
> >      in v2: Drop irq enabling for lpi processing as well.
> > 
> > 
> > ---
> >   xen/arch/arm/gic.c | 4 ----
> >   1 file changed, 4 deletions(-)
> > 
> > diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
> > index 6cc7dec..113655a 100644
> > --- a/xen/arch/arm/gic.c
> > +++ b/xen/arch/arm/gic.c
> > @@ -386,17 +386,13 @@ void gic_interrupt(struct cpu_user_regs *regs, int is_fiq)
> >   
> >           if ( likely(irq >= 16 && irq < 1020) )
> >           {
> > -            local_irq_enable();
> >               isb();
> >               do_IRQ(regs, irq, is_fiq);
> > -            local_irq_disable();
> >           }
> >           else if ( is_lpi(irq) )
> >           {
> > -            local_irq_enable();
> >               isb();
> >               gic_hw_ops->do_LPI(irq);
> > -            local_irq_disable();
> >           }
> >           else if ( unlikely(irq < 16) )
> >           {
> >   
> 
> Cheers,
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2019-05-31 17:25 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-27  9:29 [PATCH v2] gic: drop interrupts enabling on interrupts processing Andrii Anisov
2019-05-27  9:29 ` [Xen-devel] " Andrii Anisov
2019-05-28 17:07 ` Julien Grall
2019-05-28 17:07   ` [Xen-devel] " Julien Grall
2019-05-29 10:31   ` Andrii Anisov
2019-05-29 10:31     ` [Xen-devel] " Andrii Anisov
2019-05-29 15:32     ` Julien Grall
2019-05-29 15:32       ` [Xen-devel] " Julien Grall
2019-05-30 16:12       ` Andrii Anisov
2019-05-30 16:12         ` [Xen-devel] " Andrii Anisov
2019-05-31 17:11         ` Julien Grall
2019-05-31 17:11           ` [Xen-devel] " Julien Grall
2019-05-31 20:08           ` Stefano Stabellini
2019-05-31 20:08             ` [Xen-devel] " Stefano Stabellini
2019-06-10 15:49           ` Andrii Anisov
2019-06-10 19:51             ` Julien Grall
2019-06-11  7:38               ` Andrii Anisov
2019-05-30 16:14       ` Andrii Anisov
2019-05-30 16:14         ` [Xen-devel] " Andrii Anisov
2019-05-31 17:16         ` Julien Grall
2019-05-31 17:16           ` [Xen-devel] " Julien Grall
2019-05-31 17:28           ` Andre Przywara
2019-05-31 17:28             ` [Xen-devel] " Andre Przywara
2019-05-31 17:25   ` Andre Przywara [this message]
2019-05-31 17:25     ` Andre Przywara
2019-05-31 17:54     ` Julien Grall
2019-05-31 17:54       ` [Xen-devel] " Julien Grall

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=20190531182511.7de8ff68@donnerap.cambridge.arm.com \
    --to=andre.przywara@arm.com \
    --cc=andrii.anisov@gmail.com \
    --cc=andrii_anisov@epam.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.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 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.