[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 01/26] hw/core/or-irq: Fix incorrect assert forbidding num-lines =
From: |
Peter Maydell |
Subject: |
[PULL 01/26] hw/core/or-irq: Fix incorrect assert forbidding num-lines == MAX_OR_LINES |
Date: |
Thu, 30 Jan 2020 16:15:08 +0000 |
The num-lines property of the TYPE_OR_GATE device sets the number
of input lines it has. An assert() in or_irq_realize() restricts
this to the maximum supported by the implementation. However we
got the condition in the assert wrong: it should be using <=,
because num-lines == MAX_OR_LINES is permitted, and means that
all entries from 0 to MAX_OR_LINES-1 in the s->levels[] array
are used.
We didn't notice this previously because no user has so far
needed that many input lines.
Reported-by: Guenter Roeck <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Guenter Roeck <address@hidden>
Message-id: address@hidden
---
hw/core/or-irq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/core/or-irq.c b/hw/core/or-irq.c
index 4bbdbcb321b..d8f3754e967 100644
--- a/hw/core/or-irq.c
+++ b/hw/core/or-irq.c
@@ -58,7 +58,7 @@ static void or_irq_realize(DeviceState *dev, Error **errp)
{
qemu_or_irq *s = OR_IRQ(dev);
- assert(s->num_lines < MAX_OR_LINES);
+ assert(s->num_lines <= MAX_OR_LINES);
qdev_init_gpio_in(dev, or_irq_handler, s->num_lines);
}
--
2.20.1
- [PULL 00/26] target-arm queue, Peter Maydell, 2020/01/30
- [PULL 01/26] hw/core/or-irq: Fix incorrect assert forbidding num-lines == MAX_OR_LINES,
Peter Maydell <=
- [PULL 02/26] target/arm/arm-semi: Don't let the guest close stdin/stdout/stderr, Peter Maydell, 2020/01/30
- [PULL 04/26] hw/arm: ast2600: Wire up the eMMC controller, Peter Maydell, 2020/01/30
- [PULL 03/26] hw/sd: Configure number of slots exposed by the ASPEED SDHCI model, Peter Maydell, 2020/01/30
- [PULL 05/26] ftgmac100: check RX and TX buffer alignment, Peter Maydell, 2020/01/30
- [PULL 06/26] hw/arm/aspeed: add a 'execute-in-place' property to boot directly from CE0, Peter Maydell, 2020/01/30
- [PULL 07/26] misc/pca9552: Add qom set and get, Peter Maydell, 2020/01/30
- [PULL 09/26] add device_legacy_reset function to prepare for reset api change, Peter Maydell, 2020/01/30
- [PULL 08/26] hw/arm/raspi: Remove obsolete use of -smp to set the soc 'enabled-cpus', Peter Maydell, 2020/01/30
- [PULL 10/26] hw/core/qdev: add trace events to help with resettable transition, Peter Maydell, 2020/01/30
- [PULL 12/26] hw/core: add Resettable support to BusClass and DeviceClass, Peter Maydell, 2020/01/30