Skip to contentSkip to conversation

gic-vgic optimizations

PATCH In review Andrii Anisov 2 participants 6 messages Dec 12, 2018 – Dec 14, 2018

lore
Share & tools
lore
#0 lore raw

cover gic-vgic optimizations

From: Andrii Anisov <[email protected]>

Here are few patches from RFC series [1] currently approved to be upstreamed with appropriate changes.

Andrii Anisov (2):
gic-vgic: Drop an excessive clear_lrs
Is a patch #5 [2], with a change:
- Keep LR clear for debug build
No changes in v2:

arm/irq: skip action availability check for non-debug build
Is a patch #11 [3], with a change:
- Completely remove the check for a non-debug build, but preserve for debug.
Changes in v2:
- reworded the commit title and message
- removed an RB prematurely inserted by mistake

[1] https://lists.xenproject.org/archives/html/xen-devel/2018-11/msg03328.html
[2] https://lists.xenproject.org/archives/html/xen-devel/2018-11/msg03285.html
[3] https://lists.xenproject.org/archives/html/xen-devel/2018-11/msg03291.html

 xen/arch/arm/gic-vgic.c | 2 ++
 xen/arch/arm/irq.c      | 2 ++
 2 files changed, 4 insertions(+)
Signature · 7 lines
2.7.4


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

PATCH v2 1/2 gic-vgic: Drop an excessive clear_lrs

From: Andrii Anisov <[email protected]>

This action is excessive because for an invalid LR there is no need to write another invalid value to a register. So we can skip it here, saving a peripheral register write.
Keep clearing the LR for the DEBUG build. This would make dumped invalid LRs be zero. That is more obvious than picking state bits from a non-zero value.

---
 xen/arch/arm/gic-vgic.c | 2 ++
 1 file changed, 2 insertions(+)
xen/arch/arm/gic-vgic.c +2 -0
index 990399c..48922f5 100644
@@ -216,7 +216,9 @@ static void gic_update_one_lr(struct vcpu *v, int i)
     }
     else
     {
+#ifndef NDEBUG
         gic_hw_ops->clear_lr(i);
+#endif
         clear_bit(i, &this_cpu(lr_mask));
 
         if ( p->desc != NULL )
Signature · 7 lines
2.7.4


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

PATCH v2 2/2 arm/irq: skip action availability check for non-debug build

In reply to Andrii Anisov

From: Andrii Anisov <[email protected]>

Under desc->lock taken:
An IRQ with _IRQ_GUEST flag set always has an action. An IRQ with _IRQ_DISABLED flag cleared always has an action. Those flags checks cover all accesses to desc->action in do_IRQ, so we can skip desc->action check in non-debug build. Keep in place for debug build to help diagnostics potential misconfiguration.

---
 xen/arch/arm/irq.c | 2 ++
 1 file changed, 2 insertions(+)
xen/arch/arm/irq.c +2 -0
index d6a0273..4a02cc1 100644
@@ -209,12 +209,14 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq)
     spin_lock(&desc->lock);
     desc->handler->ack(desc);
 
+#ifndef NDEBUG
     if ( !desc->action )
     {
         printk("Unknown %s %#3.3x\n",
                is_fiq ? "FIQ" : "IRQ", irq);
         goto out;
     }
+#endif
 
     if ( test_bit(_IRQ_GUEST, &desc->status) )
     {
Signature · 7 lines
2.7.4


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

Re: [PATCH v2 2/2] arm/irq: skip action availability check for non-debug build

Hi Andrii,

Quoted 11 lines · Andrii Anisov

From: Andrii Anisov <[email protected]>

Under desc->lock taken:
An IRQ with _IRQ_GUEST flag set always has an action. An IRQ with _IRQ_DISABLED flag cleared always has an action. Those flags checks cover all accesses to desc->action in do_IRQ, so we can skip desc->action check in non-debug build. Keep in place for debug build to help diagnostics potential misconfiguration.

Cheers,

Quoted 24 lines
---
  xen/arch/arm/irq.c | 2 ++
  1 file changed, 2 insertions(+)
xen/arch/arm/irq.c +2 -0
index d6a0273..4a02cc1 100644
@@ -209,12 +209,14 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq)
      spin_lock(&desc->lock);
      desc->handler->ack(desc);
 
+#ifndef NDEBUG
      if ( !desc->action )
      {
          printk("Unknown %s %#3.3x\n",
                 is_fiq ? "FIQ" : "IRQ", irq);
          goto out;
      }
+#endif
 
      if ( test_bit(_IRQ_GUEST, &desc->status) )
      {
Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#4 lore raw
In reply to Andrii Anisov

Hi,

I have committed the 2 patches.

In the future, please add the version of the series in the title of the cover letter. This makes easier for us to know which series is the latest.

This could be done automatically if you use git-format-patch to generate the cover letter at the same time as the patches.

Cheers,

Quoted 28 lines · Andrii Anisov

From: Andrii Anisov <[email protected]>

Here are few patches from RFC series [1] currently approved to be upstreamed with appropriate changes.

Andrii Anisov (2):
gic-vgic: Drop an excessive clear_lrs
Is a patch #5 [2], with a change:
- Keep LR clear for debug build
No changes in v2:

arm/irq: skip action availability check for non-debug build
Is a patch #11 [3], with a change:
- Completely remove the check for a non-debug build, but preserve for debug.
Changes in v2:
- reworded the commit title and message
- removed an RB prematurely inserted by mistake

[1] https://lists.xenproject.org/archives/html/xen-devel/2018-11/msg03328.html
[2] https://lists.xenproject.org/archives/html/xen-devel/2018-11/msg03285.html
[3] https://lists.xenproject.org/archives/html/xen-devel/2018-11/msg03291.html

  xen/arch/arm/gic-vgic.c | 2 ++
  xen/arch/arm/irq.c      | 2 ++
  2 files changed, 4 insertions(+)
Signature · 6 lines
Julien Grall

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

Hello Julien,

Quoted 1 line · Julien Grall

This could be done automatically if you use git-format-patch to generate the cover letter at the same time as the patches.

It was done automatically by git-format-patch. But was overwritten by cover letter content copy-paste from the first version. I noticed that when received the series back from the list.
Sorry for the mess.

Signature · 7 lines
Sincerely,
Andrii Anisov.

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