[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 07/18] hw/ide/piix: Ensure IDE output IRQs are wired at re
From: |
Bernhard Beschow |
Subject: |
Re: [PATCH v2 07/18] hw/ide/piix: Ensure IDE output IRQs are wired at realization |
Date: |
Thu, 16 Feb 2023 17:10:49 +0000 |
Am 16. Februar 2023 15:33:47 UTC schrieb "Philippe Mathieu-Daudé"
<philmd@linaro.org>:
>On 16/2/23 15:43, Bernhard Beschow wrote:
>>
>>
>> On Wed, Feb 15, 2023 at 5:20 PM Philippe Mathieu-Daudé <philmd@linaro.org
>> <mailto:philmd@linaro.org>> wrote:
>>
>> Ensure both IDE output IRQ lines are wired.
>>
>> We can remove the last use of isa_get_irq(NULL).
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org
>> <mailto:philmd@linaro.org>>
>> ---
>> hw/ide/piix.c | 13 ++++++++-----
>> 1 file changed, 8 insertions(+), 5 deletions(-)
>>
>> diff --git a/hw/ide/piix.c b/hw/ide/piix.c
>> index 9d876dd4a7..b75a4ddcca 100644
>> --- a/hw/ide/piix.c
>> +++ b/hw/ide/piix.c
>> @@ -133,14 +133,17 @@ static bool pci_piix_init_bus(PCIIDEState *d,
>> unsigned i, Error **errp)
>> static const struct {
>> int iobase;
>> int iobase2;
>> - int isairq;
>> } port_info[] = {
>> - {0x1f0, 0x3f6, 14},
>> - {0x170, 0x376, 15},
>> + {0x1f0, 0x3f6},
>> + {0x170, 0x376},
>> };
>> int ret;
>>
>> - qemu_irq irq_out = d->irq[i] ? : isa_get_irq(NULL,
>> port_info[i].isairq);
>> + if (!d->irq[i]) {
>> + error_setg(errp, "output IDE IRQ %u not connected", i);
>> + return false;
>> + }
>> +
>> ide_bus_init(&d->bus[i], sizeof(d->bus[i]), DEVICE(d), i, 2);
>> ret = ide_init_ioport(&d->bus[i], NULL, port_info[i].iobase,
>> port_info[i].iobase2);
>> @@ -149,7 +152,7 @@ static bool pci_piix_init_bus(PCIIDEState *d,
>> unsigned i, Error **errp)
>> object_get_typename(OBJECT(d)), i);
>> return false;
>> }
>> - ide_bus_init_output_irq(&d->bus[i], irq_out);
>> + ide_bus_init_output_irq(&d->bus[i], d->irq[i]);
>>
>> bmdma_init(&d->bus[i], &d->bmdma[i], d);
>> d->bmdma[i].bus = &d->bus[i];
>> -- 2.38.1
>>
>>
>> This now breaks user-created piix3-ide:
>>
>> qemu-system-x86_64 -M q35 -device piix3-ide
>>
>> Results in:
>>
>> qemu-system-x86_64: -device piix3-ide: output IDE IRQ 0 not connected
>
>Thank you for this real-life-impossible-but-exists-in-QEMU test-case!
>
>Should we cover it in qtests?
Yes, why not. Preferably along with the x-remote machine.
- [PATCH v2 02/18] hw/isa: Factor isa_bus_get_irq() out of isa_get_irq(), (continued)
- [PATCH v2 02/18] hw/isa: Factor isa_bus_get_irq() out of isa_get_irq(), Philippe Mathieu-Daudé, 2023/02/15
- [PATCH v2 03/18] hw: Replace isa_get_irq() by isa_bus_get_irq() when ISABus is available, Philippe Mathieu-Daudé, 2023/02/15
- [PATCH v2 04/18] hw/ide/piix: Expose output IRQ as properties for late object population, Philippe Mathieu-Daudé, 2023/02/15
- [PATCH v2 05/18] hw/i386/pc_piix: Wire PIIX3 IDE ouput IRQs to ISA bus IRQs 14/15, Philippe Mathieu-Daudé, 2023/02/15
- [PATCH v2 06/18] hw/isa/piix4: Wire PIIX4 IDE ouput IRQs to ISA bus IRQs 14/15, Philippe Mathieu-Daudé, 2023/02/15
- [PATCH v2 07/18] hw/ide/piix: Ensure IDE output IRQs are wired at realization, Philippe Mathieu-Daudé, 2023/02/15
[PATCH v2 08/18] hw/isa: Deprecate isa_get_irq() in favor of isa_bus_get_irq(), Philippe Mathieu-Daudé, 2023/02/15
[PATCH v2 09/18] hw/isa: Simplify isa_address_space[_io](), Philippe Mathieu-Daudé, 2023/02/15
[PATCH v2 10/18] hw/isa: Use isa_address_space_io() in isa_register_ioport(), Philippe Mathieu-Daudé, 2023/02/15
[PATCH v2 12/18] hw/ide: Rename ISA specific ide_init_ioport -> ide_bus_init_ioport_isa, Philippe Mathieu-Daudé, 2023/02/15
[PATCH v2 11/18] hw/ide: Declare ide_get_[geometry/bios_chs_trans] in 'hw/ide/internal.h', Philippe Mathieu-Daudé, 2023/02/15
[PATCH v2 14/18] hw/ide/piix: Use generic ide_bus_init_ioport(), Philippe Mathieu-Daudé, 2023/02/15