Skip to content

Commit 093bf43

Browse files
author
Marc Zyngier
committed
irqchip/gic-v3-its: Fix get_vlpi_map() breakage with doorbells
When updating an LPI configuration, get_vlpi_map() may be passed a irq_data structure relative to an ITS domain (the normal case) or one that is relative to the core GICv3 domain in the case of a GICv4 doorbell. In the latter case, special care must be take not to dereference the irq_chip data as an its_dev structure, as that isn't what is stored there. Instead, check *first* whether the IRQ is forwarded to a vcpu, and only then try to obtain the vlpi mapping. Fixes: c1d4d5c ("irqchip/gic-v3-its: Add its_vlpi_map helpers") Signed-off-by: Marc Zyngier <[email protected]> Reported-by: Zenghui Yu <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 0f394da commit 093bf43

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

drivers/irqchip/irq-gic-v3-its.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,13 +1170,14 @@ static void its_send_vclear(struct its_device *dev, u32 event_id)
11701170
*/
11711171
static struct its_vlpi_map *get_vlpi_map(struct irq_data *d)
11721172
{
1173-
struct its_device *its_dev = irq_data_get_irq_chip_data(d);
1174-
u32 event = its_get_event_id(d);
1173+
if (irqd_is_forwarded_to_vcpu(d)) {
1174+
struct its_device *its_dev = irq_data_get_irq_chip_data(d);
1175+
u32 event = its_get_event_id(d);
11751176

1176-
if (!irqd_is_forwarded_to_vcpu(d))
1177-
return NULL;
1177+
return dev_event_to_vlpi_map(its_dev, event);
1178+
}
11781179

1179-
return dev_event_to_vlpi_map(its_dev, event);
1180+
return NULL;
11801181
}
11811182

11821183
static void lpi_write_config(struct irq_data *d, u8 clr, u8 set)

0 commit comments

Comments
 (0)