Skip to contentSkip to conversation

irqchip/gic-v5: Fix gicv5_its_map_event() ITTE read endianness

PATCH Applied Lorenzo Pieralisi 3 participants 3 messages Dec 22, 2025 – Jan 9

Subsystems (3)
lore
Share & tools
lore

Lorenzo Pieralisi

author maintainer
#0 lore raw

PATCH 1/1 irqchip/gic-v5: Fix gicv5_its_map_event() ITTE read endianness

Kbuild bot (through sparse) reported that the ITTE read to carry out a valid check in gicv5_its_map_event() lacks proper endianness handling.

Fix it.

Fixes 57d72196dfc8 ("irqchip/gic-v5: Add GICv5 ITS support")
Cc Thomas Gleixner <[email protected]>
Cc Marc Zyngier <[email protected]>
---
 drivers/irqchip/irq-gic-v5-its.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-gic-v5-its.c +1 -1
index 554485f0be1f..8e22134b9f48 100644
@@ -849,7 +849,7 @@ static int gicv5_its_map_event(struct gicv5_its_dev *its_dev, u16 event_id, u32
 
 	itte = gicv5_its_device_get_itte_ref(its_dev, event_id);
 
-	if (FIELD_GET(GICV5_ITTL2E_VALID, *itte))
+	if (FIELD_GET(GICV5_ITTL2E_VALID, le64_to_cpu(*itte)))
 		return -EEXIST;
 
 	itt_entry = FIELD_PREP(GICV5_ITTL2E_LPI_ID, lpi) |
Signature · 1 line
2.50.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 21 lines · Lorenzo Pieralisi

Kbuild bot (through sparse) reported that the ITTE read to carry out a valid check in gicv5_its_map_event() lacks proper endianness handling.

Fix it.

Fixes 57d72196dfc8 ("irqchip/gic-v5: Add GICv5 ITS support")
Cc Thomas Gleixner <[email protected]>
Cc Marc Zyngier <[email protected]>
---
 drivers/irqchip/irq-gic-v5-its.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-gic-v5-its.c +0 -0
index 554485f0be1f..8e22134b9f48 100644

drivers/irqchip/irq-gic-v5-its.c static int gicv5_its_map_event(struct gicv5_its_dev *its_dev, u16 event_id, u32 · line 855

Quoted 8 lines
drivers/irqchip/irq-gic-v5-its.c +1 -1
@@ -849,7 +849,7 @@ static int gicv5_its_map_event(struct gicv5_its_dev *its_dev, u16 event_id, u32
 
 	itte = gicv5_its_device_get_itte_ref(its_dev, event_id);
 
-	if (FIELD_GET(GICV5_ITTL2E_VALID, *itte))
+	if (FIELD_GET(GICV5_ITTL2E_VALID, le64_to_cpu(*itte)))
 		return -EEXIST;
 
 	itt_entry = FIELD_PREP(GICV5_ITTL2E_LPI_ID, lpi) |
	M.
Signature · 1 line
Without deviation from the norm, progress is not possible.
#2 lore raw
In reply to Lorenzo Pieralisi
The following commit has been merged into the irq/urgent branch of tip:

The following commit has been merged into the irq/urgent branch of tip:

Commit-ID:     1690eeb0cb2bb77096cb6c826b6849ef05013e34
Gitweb:        https://git.kernel.org/tip/1690eeb0cb2bb77096cb6c826b6849ef05013e34
Author:        Lorenzo Pieralisi <[email protected]>
AuthorDate:    Mon, 22 Dec 2025 11:22:50 +01:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Fri, 09 Jan 2026 16:10:04 +01:00

irqchip/gic-v5: Fix gicv5_its_map_event() ITTE read endianness

Kbuild bot (through sparse) reported that the ITTE read to carry out a valid check in gicv5_its_map_event() lacks proper endianness handling.

Add the missing endianess conversion.

---
 drivers/irqchip/irq-gic-v5-its.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-gic-v5-its.c +1 -1
index 554485f..8e22134 100644
@@ -849,7 +849,7 @@ static int gicv5_its_map_event(struct gicv5_its_dev *its_dev, u16 event_id, u32 
 
 	itte = gicv5_its_device_get_itte_ref(its_dev, event_id);
 
-	if (FIELD_GET(GICV5_ITTL2E_VALID, *itte))
+	if (FIELD_GET(GICV5_ITTL2E_VALID, le64_to_cpu(*itte)))
 		return -EEXIST;
 
 	itt_entry = FIELD_PREP(GICV5_ITTL2E_LPI_ID, lpi) |