linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen/evtchn: Change irq_info lock to raw_spinlock_t
@ 2021-04-06 10:51 Luca Fancellu
  2021-04-06 13:46 ` Julien Grall
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Luca Fancellu @ 2021-04-06 10:51 UTC (permalink / raw)
  To: sstabellini, jgross, jgrall
  Cc: boris.ostrovsky, tglx, wei.liu, jbeulich, yyankovskyi, xen-devel,
	linux-kernel, stable, bertrand.marquis

Unmask operation must be called with interrupt disabled,
on preempt_rt spin_lock_irqsave/spin_unlock_irqrestore
don't disable/enable interrupts, so use raw_* implementation
and change lock variable in struct irq_info from spinlock_t
to raw_spinlock_t

Cc: stable@vger.kernel.org
Fixes: 25da4618af24 ("xen/events: don't unmask an event channel
when an eoi is pending")

Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
---
 drivers/xen/events/events_base.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
index 8236e2364eeb..7bbfd58958bc 100644
--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -110,7 +110,7 @@ struct irq_info {
 	unsigned short eoi_cpu; /* EOI must happen on this cpu-1 */
 	unsigned int irq_epoch; /* If eoi_cpu valid: irq_epoch of event */
 	u64 eoi_time;           /* Time in jiffies when to EOI. */
-	spinlock_t lock;
+	raw_spinlock_t lock;
 
 	union {
 		unsigned short virq;
@@ -312,7 +312,7 @@ static int xen_irq_info_common_setup(struct irq_info *info,
 	info->evtchn = evtchn;
 	info->cpu = cpu;
 	info->mask_reason = EVT_MASK_REASON_EXPLICIT;
-	spin_lock_init(&info->lock);
+	raw_spin_lock_init(&info->lock);
 
 	ret = set_evtchn_to_irq(evtchn, irq);
 	if (ret < 0)
@@ -472,28 +472,28 @@ static void do_mask(struct irq_info *info, u8 reason)
 {
 	unsigned long flags;
 
-	spin_lock_irqsave(&info->lock, flags);
+	raw_spin_lock_irqsave(&info->lock, flags);
 
 	if (!info->mask_reason)
 		mask_evtchn(info->evtchn);
 
 	info->mask_reason |= reason;
 
-	spin_unlock_irqrestore(&info->lock, flags);
+	raw_spin_unlock_irqrestore(&info->lock, flags);
 }
 
 static void do_unmask(struct irq_info *info, u8 reason)
 {
 	unsigned long flags;
 
-	spin_lock_irqsave(&info->lock, flags);
+	raw_spin_lock_irqsave(&info->lock, flags);
 
 	info->mask_reason &= ~reason;
 
 	if (!info->mask_reason)
 		unmask_evtchn(info->evtchn);
 
-	spin_unlock_irqrestore(&info->lock, flags);
+	raw_spin_unlock_irqrestore(&info->lock, flags);
 }
 
 #ifdef CONFIG_X86
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] xen/evtchn: Change irq_info lock to raw_spinlock_t
  2021-04-06 10:51 [PATCH] xen/evtchn: Change irq_info lock to raw_spinlock_t Luca Fancellu
@ 2021-04-06 13:46 ` Julien Grall
  2021-04-07 13:00 ` Wei Liu
  2021-04-07 21:43 ` Boris Ostrovsky
  2 siblings, 0 replies; 4+ messages in thread
From: Julien Grall @ 2021-04-06 13:46 UTC (permalink / raw)
  To: Luca Fancellu, sstabellini, jgross, jgrall
  Cc: boris.ostrovsky, tglx, wei.liu, jbeulich, yyankovskyi, xen-devel,
	linux-kernel, stable, bertrand.marquis

Hi Luca,

On 06/04/2021 11:51, Luca Fancellu wrote:
> Unmask operation must be called with interrupt disabled,
> on preempt_rt spin_lock_irqsave/spin_unlock_irqrestore
> don't disable/enable interrupts, so use raw_* implementation
> and change lock variable in struct irq_info from spinlock_t
> to raw_spinlock_t
> 
> Cc: stable@vger.kernel.org
> Fixes: 25da4618af24 ("xen/events: don't unmask an event channel
> when an eoi is pending")
> 
> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>

Reviewed-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] xen/evtchn: Change irq_info lock to raw_spinlock_t
  2021-04-06 10:51 [PATCH] xen/evtchn: Change irq_info lock to raw_spinlock_t Luca Fancellu
  2021-04-06 13:46 ` Julien Grall
@ 2021-04-07 13:00 ` Wei Liu
  2021-04-07 21:43 ` Boris Ostrovsky
  2 siblings, 0 replies; 4+ messages in thread
From: Wei Liu @ 2021-04-07 13:00 UTC (permalink / raw)
  To: Luca Fancellu
  Cc: sstabellini, jgross, jgrall, boris.ostrovsky, tglx, wei.liu,
	jbeulich, yyankovskyi, xen-devel, linux-kernel, stable,
	bertrand.marquis

On Tue, Apr 06, 2021 at 11:51:04AM +0100, Luca Fancellu wrote:
> Unmask operation must be called with interrupt disabled,
> on preempt_rt spin_lock_irqsave/spin_unlock_irqrestore
> don't disable/enable interrupts, so use raw_* implementation
> and change lock variable in struct irq_info from spinlock_t
> to raw_spinlock_t
> 
> Cc: stable@vger.kernel.org
> Fixes: 25da4618af24 ("xen/events: don't unmask an event channel
> when an eoi is pending")
> 
> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>

Reviewed-by: Wei Liu <wei.liu@kernel.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] xen/evtchn: Change irq_info lock to raw_spinlock_t
  2021-04-06 10:51 [PATCH] xen/evtchn: Change irq_info lock to raw_spinlock_t Luca Fancellu
  2021-04-06 13:46 ` Julien Grall
  2021-04-07 13:00 ` Wei Liu
@ 2021-04-07 21:43 ` Boris Ostrovsky
  2 siblings, 0 replies; 4+ messages in thread
From: Boris Ostrovsky @ 2021-04-07 21:43 UTC (permalink / raw)
  To: Luca Fancellu, sstabellini, jgross, jgrall
  Cc: tglx, wei.liu, jbeulich, yyankovskyi, xen-devel, linux-kernel,
	stable, bertrand.marquis


On 4/6/21 6:51 AM, Luca Fancellu wrote:
> Unmask operation must be called with interrupt disabled,
> on preempt_rt spin_lock_irqsave/spin_unlock_irqrestore
> don't disable/enable interrupts, so use raw_* implementation
> and change lock variable in struct irq_info from spinlock_t
> to raw_spinlock_t
>
> Cc: stable@vger.kernel.org
> Fixes: 25da4618af24 ("xen/events: don't unmask an event channel
> when an eoi is pending")
>
> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>



Applied to for-linus-5.12b


-boris


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-04-07 21:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-06 10:51 [PATCH] xen/evtchn: Change irq_info lock to raw_spinlock_t Luca Fancellu
2021-04-06 13:46 ` Julien Grall
2021-04-07 13:00 ` Wei Liu
2021-04-07 21:43 ` Boris Ostrovsky

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).