Skip to contentSkip to conversation

xen/arm: gic-v3: Fix wake-up loop in gicv3_enable_redist

PATCH In review Edgar E. Iglesias 3 participants 4 messages May 18 – May 19

lore
Share & tools
lore
#0 lore raw

cover xen/arm: gic-v3: Fix wake-up loop in gicv3_enable_redist

From: "Edgar E. Iglesias" <[email protected]>

Hi,

I ran into this issue with a poll loop in gicv3_enable_redist while exploring QEMU fault-injection techniques in the context of safety certification.

Cheers,
Edgar

Edgar E. Iglesias (1):
xen/arm: gic-v3: Fix wake-up loop in gicv3_enable_redist

 xen/arch/arm/gic-v3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/1 xen/arm: gic-v3: Fix wake-up loop in gicv3_enable_redist

From: "Edgar E. Iglesias" <[email protected]>

timeout starts as false and is only set on the timeout break, so the loop always exits after one iteration and a stuck redistributor is silently treated as woken. Use while ( 1 ) to match the sibling gicv3_do_wait_for_rwp().

Fixes bc183a0235 ("xen/arm: Add support for GIC v3")
---
 xen/arch/arm/gic-v3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/arm/gic-v3.c +1 -1
index 7f365cdbe9..f03217282e 100644
@@ -828,7 +828,7 @@ static int gicv3_enable_redist(void)
         }
         cpu_relax();
         udelay(1);
-    } while ( timeout );
+    } while ( 1 );
 
     if ( timeout )
     {
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#2 lore raw
Quoted 9 lines · Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

timeout starts as false and is only set on the timeout break, so the loop always exits after one iteration and a stuck redistributor is silently treated as woken. Use while ( 1 ) to match the sibling gicv3_do_wait_for_rwp().

Fixes bc183a0235 ("xen/arm: Add support for GIC v3")
Quoted 20 lines
---
 xen/arch/arm/gic-v3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/arm/gic-v3.c +1 -1
index 7f365cdbe9..f03217282e 100644
@@ -828,7 +828,7 @@ static int gicv3_enable_redist(void)
         }
         cpu_relax();
         udelay(1);
-    } while ( timeout );
+    } while ( 1 );
 
     if ( timeout )
     {
Signature · 1 line
2.43.0
#3 lore raw

Hi all,

I think this issue is already covered by Luca's patch, currently under review:

xen/arm: gic-v3: Fix redistributor wakeup polling

Best regards,
Mykola

Quoted 36 lines · Stefano Stabellini
Quoted 9 lines · Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

timeout starts as false and is only set on the timeout break, so the loop always exits after one iteration and a stuck redistributor is silently treated as woken. Use while ( 1 ) to match the sibling gicv3_do_wait_for_rwp().

Fixes bc183a0235 ("xen/arm: Add support for GIC v3")
Quoted 20 lines
---
 xen/arch/arm/gic-v3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/arm/gic-v3.c +1 -2
index 7f365cdbe9..f03217282e 100644
@@ -828,7 +828,7 @@ static int gicv3_enable_redist(void)
         }
         cpu_relax();
         udelay(1);
-    } while ( timeout );
+    } while ( 1 );
 
     if ( timeout )
     {
--

2.43.0