Skip to contentSkip to conversation

gic-vgic: fix an assert condition

PATCH In review Andrii Anisov 4 participants 6 messages Jan 25, 2019 – Jan 29, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 gic-vgic: fix an assert condition

From: Andrii Anisov <[email protected]>

Currently, that assert condition does not correspond to a comment above and makes assertion failed on HW IRQ disconnection.
Fix the condition so it corresponds to the comment and allows IRQ disconnection on debug builds.

Fixes ec2a2f1 ("ARM: VGIC: factor out vgic_connect_hw_irq()")

---
in v2:
- updated condition as suggested by Stefan
- provided detailed commit message
- added Suggested-by from Stefan
- referred a commit introduced the issue

 xen/arch/arm/gic-vgic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/arm/gic-vgic.c +1 -1
index 48922f5..a3bba85 100644
@@ -443,7 +443,7 @@ int vgic_connect_hw_irq(struct domain *d, struct vcpu *v, unsigned int virq,
     int ret = 0;
 
     /* "desc" is optional when we disconnect an IRQ. */
-    ASSERT(connect && desc);
+    ASSERT(!connect || desc);
 
     /* We are taking to rank lock to prevent parallel connections. */
     vgic_lock_rank(v_target, rank, flags);
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
Quoted 10 lines · On Fri, 25 Jan 2019 19:06:02 +0200 Andrii Anisov <[email protected]>…

From: Andrii Anisov <[email protected]>

Currently, that assert condition does not correspond to a comment above and makes assertion failed on HW IRQ disconnection. Fix the condition so it corresponds to the comment and allows IRQ disconnection on debug builds.

Fixes ec2a2f1 ("ARM: VGIC: factor out vgic_connect_hw_irq()")

Cheers,
Andre.

Quoted 15 lines

---
in v2:
- updated condition as suggested by Stefan
- provided detailed commit message
- added Suggested-by from Stefan
- referred a commit introduced the issue

 xen/arch/arm/gic-vgic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/arm/gic-vgic.c +0 -0
index 48922f5..a3bba85 100644

xen/arch/arm/gic-vgic.c int vgic_connect_hw_irq(struct domain *d, struct · line 449

Quoted 8 lines
xen/arch/arm/gic-vgic.c +1 -1
@@ -443,7 +443,7 @@ int vgic_connect_hw_irq(struct domain *d, struct
 vcpu *v, unsigned int virq, int ret = 0;
 
     /* "desc" is optional when we disconnect an IRQ. */
-    ASSERT(connect && desc);
+    ASSERT(!connect || desc);
 
     /* We are taking to rank lock to prevent parallel connections. */
     vgic_lock_rank(v_target, rank, flags);

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

Acked-by
#2 lore raw
Quoted 10 lines · Andre Przywara
Quoted 7 lines · On Fri, 25 Jan 2019 19:06:02 +0200 Andrii Anisov <[email protected]>…

From: Andrii Anisov <[email protected]>

Currently, that assert condition does not correspond to a comment above and makes assertion failed on HW IRQ disconnection. Fix the condition so it corresponds to the comment and allows IRQ disconnection on debug builds.

Quoted 5 lines
Quoted 3 lines
Fixes ec2a2f1 ("ARM: VGIC: factor out vgic_connect_hw_irq()")

Juergen, can we get a release-ack for this patch?

Cheers,

Signature · 6 lines
Julien Grall

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

From: Andrii Anisov <[email protected]>

Currently, that assert condition does not correspond to a comment above and makes assertion failed on HW IRQ disconnection.
Fix the condition so it corresponds to the comment and allows IRQ disconnection on debug builds.

Fixes ec2a2f1 ("ARM: VGIC: factor out vgic_connect_hw_irq()")

Juergen

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

#4 lore raw

Hi,

Quoted 8 lines · Juergen Gross
Quoted 7 lines · Andrii Anisov

From: Andrii Anisov <[email protected]>

Currently, that assert condition does not correspond to a comment above and makes assertion failed on HW IRQ disconnection.
Fix the condition so it corresponds to the comment and allows IRQ disconnection on debug builds.

Quoted 5 lines
Quoted 3 lines
Fixes ec2a2f1 ("ARM: VGIC: factor out vgic_connect_hw_irq()")

Thank you!

I have now applied the patch with a slight reword in the commit message:

xen/arm: gic-vgic: fix assert condition in vgic_connect_hw_irq

Currently, the assert condition in vgic_connect_hw_irq does not correspond to the comment above and result to hit the assertion on HW IRQ disconnection. Fix the condition so it corresponds to the comment and allows IRQ disconnection on debug builds.

Andrii, please try to add the subsystem you modify in the commit title (i.e xen/arm). This helps for the reviewer to know what you are modifying and also helps when looking at shortlog.

Cheers,

Quoted 4 lines

Juergen

Signature · 6 lines
Julien Grall

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

Andrii, please try to add the subsystem you modify in the commit title (i.e xen/arm). This helps for the reviewer to know what you are modifying and also helps when looking at shortlog.

Oh, I missed "arm/" this time.
Will try to not miss it further.

Signature · 7 lines
Sincerely,
Andrii Anisov.

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