Skip to contentSkip to conversation

irqchip/gic-v5: Fix inversion of IRS_IDR0.virt flag

PATCH Applied Sascha Bischoff 2 participants 3 messages Feb 25

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 irqchip/gic-v5: Fix inversion of IRS_IDR0.virt flag

It appears that a !! became ! during a cleanup, resulting in inverted logic when detecting if a host GICv5 implementation is capable of virtualization.

Re-add the missing !, fixing the behaviour.

Fixes 3227c3a89d65f ("irqchip/gic-v5: Check if impl is virt capable")
---
 drivers/irqchip/irq-gic-v5-irs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-gic-v5-irs.c +1 -1
index e518e5dfede78..f3fce0b1e25d9 100644
@@ -699,7 +699,7 @@ static int __init gicv5_irs_init(struct gicv5_irs_chip_data *irs_data)
 	 */
 	if (list_empty(&irs_nodes)) {
 		idr = irs_readl_relaxed(irs_data, GICV5_IRS_IDR0);
-		gicv5_global_data.virt_capable = !FIELD_GET(GICV5_IRS_IDR0_VIRT, idr);
+		gicv5_global_data.virt_capable = !!FIELD_GET(GICV5_IRS_IDR0_VIRT, idr);
 
 		idr = irs_readl_relaxed(irs_data, GICV5_IRS_IDR1);
 		irs_setup_pri_bits(idr);
Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 18 lines · Sascha Bischoff

It appears that a !! became ! during a cleanup, resulting in inverted logic when detecting if a host GICv5 implementation is capable of virtualization.

Re-add the missing !, fixing the behaviour.

Fixes 3227c3a89d65f ("irqchip/gic-v5: Check if impl is virt capable")
---
 drivers/irqchip/irq-gic-v5-irs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-gic-v5-irs.c +0 -0
index e518e5dfede78..f3fce0b1e25d9 100644

drivers/irqchip/irq-gic-v5-irs.c static int __init gicv5_irs_init(struct gicv5_irs_chip_data *irs_data) · line 705

Quoted 8 lines
drivers/irqchip/irq-gic-v5-irs.c +1 -1
@@ -699,7 +699,7 @@ static int __init gicv5_irs_init(struct gicv5_irs_chip_data *irs_data)
 	 */
 	if (list_empty(&irs_nodes)) {
 		idr = irs_readl_relaxed(irs_data, GICV5_IRS_IDR0);
-		gicv5_global_data.virt_capable = !FIELD_GET(GICV5_IRS_IDR0_VIRT, idr);
+		gicv5_global_data.virt_capable = !!FIELD_GET(GICV5_IRS_IDR0_VIRT, idr);
 
 		idr = irs_readl_relaxed(irs_data, GICV5_IRS_IDR1);
 		irs_setup_pri_bits(idr);

Gah. Apologies for the overly eager cleanup. I'll take that in the next batch of KVM fixes.

Thanks,

	M.
Signature · 1 line
Without deviation from the norm, progress is not possible.
maintainer Applied
#2 lore raw
In reply to Sascha Bischoff
Quoted 8 lines · Sascha Bischoff

It appears that a !! became ! during a cleanup, resulting in inverted logic when detecting if a host GICv5 implementation is capable of virtualization.

Re-add the missing !, fixing the behaviour.

[...]

Applied to fixes, thanks!

[1/1] irqchip/gic-v5: Fix inversion of IRS_IDR0.virt flag

      commit: 29c8b85adb47daefc213381bc1831787f512d89b

Cheers,

	M.
Signature · 1 line
Without deviation from the norm, progress is not possible.