Skip to contentSkip to conversation

gic-vgic: skip irqs locking in gic_restore_pending_irqs()

PATCH In review Andrii Anisov 2 participants 3 messages Dec 21, 2018 – Jan 22, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 gic-vgic: skip irqs locking in gic_restore_pending_irqs()

From: Andrii Anisov <[email protected]>

This function is called under IRQs disabled already, so drop additional flags save and restore.

---

This is a half of an RFC patch [1] which relies on the already existing code.

[1] https://lists.xenproject.org/archives/html/xen-devel/2018-11/msg03293.html

Changes in v2:
Added an ASSERT() to verify the function should be called with interrupts disabled.

---
 xen/arch/arm/gic-vgic.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
xen/arch/arm/gic-vgic.c +4 -3
index 48922f5..f9098c8 100644
@@ -279,11 +279,12 @@ static void gic_restore_pending_irqs(struct vcpu *v)
     int lr = 0;
     struct pending_irq *p, *t, *p_r;
     struct list_head *inflight_r;
-    unsigned long flags;
     unsigned int nr_lrs = gic_get_nr_lrs();
     int lrs = nr_lrs;
 
-    spin_lock_irqsave(&v->arch.vgic.lock, flags);
+    ASSERT(!local_irq_is_enabled());
+
+    spin_lock(&v->arch.vgic.lock);
 
     if ( list_empty(&v->arch.vgic.lr_pending) )
         goto out;
@@ -327,7 +328,7 @@ found:
     }
 
 out:
-    spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
+    spin_unlock(&v->arch.vgic.lock);
 }
 
 void gic_clear_pending_irqs(struct vcpu *v)
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Reviewed-by on v2 1/1
#1 lore raw

Hi,

Quoted 6 lines · Andrii Anisov

From: Andrii Anisov <[email protected]>

This function is called under IRQs disabled already, so drop additional flags save and restore.

I will queue this patch for 4.13.

Cheers,

Quoted 45 lines

---

This is a half of an RFC patch [1] which relies on the already existing code.

[1] https://lists.xenproject.org/archives/html/xen-devel/2018-11/msg03293.html

Changes in v2:
Added an ASSERT() to verify the function should be called with interrupts disabled.

---
  xen/arch/arm/gic-vgic.c | 7 ++++---
  1 file changed, 4 insertions(+), 3 deletions(-)
xen/arch/arm/gic-vgic.c +4 -3
index 48922f5..f9098c8 100644
@@ -279,11 +279,12 @@ static void gic_restore_pending_irqs(struct vcpu *v)
      int lr = 0;
      struct pending_irq *p, *t, *p_r;
      struct list_head *inflight_r;
-    unsigned long flags;
      unsigned int nr_lrs = gic_get_nr_lrs();
      int lrs = nr_lrs;
 
-    spin_lock_irqsave(&v->arch.vgic.lock, flags);
+    ASSERT(!local_irq_is_enabled());
+
+    spin_lock(&v->arch.vgic.lock);
 
      if ( list_empty(&v->arch.vgic.lr_pending) )
          goto out;
@@ -327,7 +328,7 @@ found:
      }
 
  out:
-    spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
+    spin_unlock(&v->arch.vgic.lock);
  }
 
  void gic_clear_pending_irqs(struct vcpu *v)
Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#2 lore raw
Quoted 3 lines · Julien Grall

I will queue this patch for 4.13.

Thank you.

Signature · 7 lines
Sincerely,
Andrii Anisov.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel