mbox series

[v2,00/22] isa: Resolve unneeded IRQ attributes from ISADevice

Message ID 20220222193446.156717-1-shentey@gmail.com
Headers show
Series isa: Resolve unneeded IRQ attributes from ISADevice | expand

Message

Bernhard Beschow Feb. 22, 2022, 7:34 p.m. UTC
v2:
The newly QOM'ified devices now report an error to the user in their realize
functions if the configured IRQ number is greater than 15.

v1:
The IRQ attributes of ISADevice are hardcoded to support up to two IRQs per
device which creates an artificial limit. By not having the attributes in the
first place, this limitation can be avoided altogether.

The IRQ attributes are mostly used for printing ('info qtree') and there is one
user, hw/ppc/pnv, to use the attributes directly. As it turns out, the printing
is redundant if the IRQ numbers are exposed as QOM properties and hw/ppc/pnv
can be easily ported away.

The patch series is structured as follows: Patch 1-3 QOM'ify the last devices
which rely on printing their IRQ numbers via the ISADevice attributes. Patch
4 and 5 remove the last users of the ISADevice attributes such that they can be
removed in patch 6. The remainder of the patch series is cleanup.

Patch 6 turns isa_init_irq() into a trivial wrapper for isa_get_irq(). That is,
the former function becomes redundant. All users are therefore converted to use
isa_get_irq() directly. Finally, the last patch removes the now unused
isa_init_irq().


Bernhard Beschow (22):
  hw/rtc/mc146818rtc: QOM'ify IRQ number
  hw/rtc/m48t59-isa: QOM'ify IRQ number
  hw/input/pckbd: QOM'ify IRQ numbers
  hw/isa/isa-bus: Remove isabus_dev_print()
  hw/ppc/pnv: Determine ns16550's IRQ number from QOM property
  isa: Drop unused attributes from ISADevice
  hw/audio/cs4231a: Disuse isa_init_irq()
  hw/audio/gus: Disuse isa_init_irq()
  hw/audio/sb16: Disuse isa_init_irq()
  hw/block/fdc-isa: Disuse isa_init_irq()
  hw/char/parallel: Disuse isa_init_irq()
  hw/char/serial-isa: Disuse isa_init_irq()
  hw/ide/isa: Disuse isa_init_irq()
  hw/input/pckbd: Disuse isa_init_irq()
  hw/ipmi/isa_ipmi_bt: Disuse isa_init_irq()
  hw/ipmi/isa_ipmi_kcs: Disuse isa_init_irq()
  hw/isa/piix4: Disuse isa_init_irq()
  hw/net/ne2000-isa: Disuse isa_init_irq()
  hw/rtc/m48t59-isa: Disuse isa_init_irq()
  hw/tpm/tpm_tis_isa: Disuse isa_init_irq()
  hw/isa/isa-bus: Disuse isa_init_irq()
  isa: Remove unused isa_init_irq()

 hw/audio/cs4231a.c           |  2 +-
 hw/audio/gus.c               |  2 +-
 hw/audio/sb16.c              |  2 +-
 hw/block/fdc-isa.c           |  2 +-
 hw/char/parallel.c           |  2 +-
 hw/char/serial-isa.c         |  2 +-
 hw/ide/isa.c                 |  2 +-
 hw/input/pckbd.c             | 26 +++++++++++++++++++++----
 hw/ipmi/isa_ipmi_bt.c        |  2 +-
 hw/ipmi/isa_ipmi_kcs.c       |  2 +-
 hw/isa/isa-bus.c             | 37 +-----------------------------------
 hw/isa/piix4.c               |  2 +-
 hw/net/ne2000-isa.c          |  2 +-
 hw/ppc/pnv.c                 |  5 ++++-
 hw/rtc/m48t59-isa.c          |  9 ++++++++-
 hw/rtc/mc146818rtc.c         | 13 +++++++++++--
 hw/tpm/tpm_tis_isa.c         |  2 +-
 include/hw/isa/isa.h         |  3 ---
 include/hw/rtc/mc146818rtc.h |  1 +
 tests/qemu-iotests/172.out   | 26 -------------------------
 20 files changed, 59 insertions(+), 85 deletions(-)

Comments

Philippe Mathieu-Daudé Feb. 27, 2022, 10:40 p.m. UTC | #1
On 22/2/22 20:34, Bernhard Beschow wrote:
> v2:
> The newly QOM'ified devices now report an error to the user in their realize
> functions if the configured IRQ number is greater than 15.
> 
> v1:
> The IRQ attributes of ISADevice are hardcoded to support up to two IRQs per
> device which creates an artificial limit. By not having the attributes in the
> first place, this limitation can be avoided altogether.
> 
> The IRQ attributes are mostly used for printing ('info qtree') and there is one
> user, hw/ppc/pnv, to use the attributes directly. As it turns out, the printing
> is redundant if the IRQ numbers are exposed as QOM properties and hw/ppc/pnv
> can be easily ported away.
> 
> The patch series is structured as follows: Patch 1-3 QOM'ify the last devices
> which rely on printing their IRQ numbers via the ISADevice attributes. Patch
> 4 and 5 remove the last users of the ISADevice attributes such that they can be
> removed in patch 6. The remainder of the patch series is cleanup.
> 
> Patch 6 turns isa_init_irq() into a trivial wrapper for isa_get_irq(). That is,
> the former function becomes redundant. All users are therefore converted to use
> isa_get_irq() directly. Finally, the last patch removes the now unused
> isa_init_irq().
> 
> 
> Bernhard Beschow (22):
>    hw/rtc/mc146818rtc: QOM'ify IRQ number
>    hw/rtc/m48t59-isa: QOM'ify IRQ number
>    hw/input/pckbd: QOM'ify IRQ numbers
>    hw/isa/isa-bus: Remove isabus_dev_print()
>    hw/ppc/pnv: Determine ns16550's IRQ number from QOM property
>    isa: Drop unused attributes from ISADevice
>    hw/audio/cs4231a: Disuse isa_init_irq()
>    hw/audio/gus: Disuse isa_init_irq()
>    hw/audio/sb16: Disuse isa_init_irq()
>    hw/block/fdc-isa: Disuse isa_init_irq()
>    hw/char/parallel: Disuse isa_init_irq()
>    hw/char/serial-isa: Disuse isa_init_irq()
>    hw/ide/isa: Disuse isa_init_irq()
>    hw/input/pckbd: Disuse isa_init_irq()
>    hw/ipmi/isa_ipmi_bt: Disuse isa_init_irq()
>    hw/ipmi/isa_ipmi_kcs: Disuse isa_init_irq()
>    hw/isa/piix4: Disuse isa_init_irq()
>    hw/net/ne2000-isa: Disuse isa_init_irq()
>    hw/rtc/m48t59-isa: Disuse isa_init_irq()
>    hw/tpm/tpm_tis_isa: Disuse isa_init_irq()
>    hw/isa/isa-bus: Disuse isa_init_irq()
>    isa: Remove unused isa_init_irq()

Series:
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Philippe Mathieu-Daudé March 1, 2022, 12:04 p.m. UTC | #2
On 27/2/22 23:40, Philippe Mathieu-Daudé wrote:
> On 22/2/22 20:34, Bernhard Beschow wrote:
>> v2:
>> The newly QOM'ified devices now report an error to the user in their 
>> realize
>> functions if the configured IRQ number is greater than 15.
>>
>> v1:
>> The IRQ attributes of ISADevice are hardcoded to support up to two 
>> IRQs per
>> device which creates an artificial limit. By not having the attributes 
>> in the
>> first place, this limitation can be avoided altogether.
>>
>> The IRQ attributes are mostly used for printing ('info qtree') and 
>> there is one
>> user, hw/ppc/pnv, to use the attributes directly. As it turns out, the 
>> printing
>> is redundant if the IRQ numbers are exposed as QOM properties and 
>> hw/ppc/pnv
>> can be easily ported away.
>>
>> The patch series is structured as follows: Patch 1-3 QOM'ify the last 
>> devices
>> which rely on printing their IRQ numbers via the ISADevice attributes. 
>> Patch
>> 4 and 5 remove the last users of the ISADevice attributes such that 
>> they can be
>> removed in patch 6. The remainder of the patch series is cleanup.
>>
>> Patch 6 turns isa_init_irq() into a trivial wrapper for isa_get_irq(). 
>> That is,
>> the former function becomes redundant. All users are therefore 
>> converted to use
>> isa_get_irq() directly. Finally, the last patch removes the now unused
>> isa_init_irq().
>>
>>
>> Bernhard Beschow (22):
>>    hw/rtc/mc146818rtc: QOM'ify IRQ number
>>    hw/rtc/m48t59-isa: QOM'ify IRQ number
>>    hw/input/pckbd: QOM'ify IRQ numbers
>>    hw/isa/isa-bus: Remove isabus_dev_print()
>>    hw/ppc/pnv: Determine ns16550's IRQ number from QOM property
>>    isa: Drop unused attributes from ISADevice
>>    hw/audio/cs4231a: Disuse isa_init_irq()
>>    hw/audio/gus: Disuse isa_init_irq()
>>    hw/audio/sb16: Disuse isa_init_irq()
>>    hw/block/fdc-isa: Disuse isa_init_irq()
>>    hw/char/parallel: Disuse isa_init_irq()
>>    hw/char/serial-isa: Disuse isa_init_irq()
>>    hw/ide/isa: Disuse isa_init_irq()
>>    hw/input/pckbd: Disuse isa_init_irq()
>>    hw/ipmi/isa_ipmi_bt: Disuse isa_init_irq()
>>    hw/ipmi/isa_ipmi_kcs: Disuse isa_init_irq()
>>    hw/isa/piix4: Disuse isa_init_irq()
>>    hw/net/ne2000-isa: Disuse isa_init_irq()
>>    hw/rtc/m48t59-isa: Disuse isa_init_irq()
>>    hw/tpm/tpm_tis_isa: Disuse isa_init_irq()
>>    hw/isa/isa-bus: Disuse isa_init_irq()
>>    isa: Remove unused isa_init_irq()
> 
> Series:
> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

If you can address the few comments, I'll queue the v3 via the
MIPS tree.

Thanks,

Phil.
Bernhard Beschow March 1, 2022, 10:03 p.m. UTC | #3
Am 1. März 2022 12:04:24 UTC schrieb "Philippe Mathieu-Daudé" <philippe.mathieu.daude@gmail.com>:
>On 27/2/22 23:40, Philippe Mathieu-Daudé wrote:
>> On 22/2/22 20:34, Bernhard Beschow wrote:
>>> v2:
>>> The newly QOM'ified devices now report an error to the user in their 
>>> realize
>>> functions if the configured IRQ number is greater than 15.
>>>
>>> v1:
>>> The IRQ attributes of ISADevice are hardcoded to support up to two 
>>> IRQs per
>>> device which creates an artificial limit. By not having the attributes 
>>> in the
>>> first place, this limitation can be avoided altogether.
>>>
>>> The IRQ attributes are mostly used for printing ('info qtree') and 
>>> there is one
>>> user, hw/ppc/pnv, to use the attributes directly. As it turns out, the 
>>> printing
>>> is redundant if the IRQ numbers are exposed as QOM properties and 
>>> hw/ppc/pnv
>>> can be easily ported away.
>>>
>>> The patch series is structured as follows: Patch 1-3 QOM'ify the last 
>>> devices
>>> which rely on printing their IRQ numbers via the ISADevice attributes. 
>>> Patch
>>> 4 and 5 remove the last users of the ISADevice attributes such that 
>>> they can be
>>> removed in patch 6. The remainder of the patch series is cleanup.
>>>
>>> Patch 6 turns isa_init_irq() into a trivial wrapper for isa_get_irq(). 
>>> That is,
>>> the former function becomes redundant. All users are therefore 
>>> converted to use
>>> isa_get_irq() directly. Finally, the last patch removes the now unused
>>> isa_init_irq().
>>>
>>>
>>> Bernhard Beschow (22):
>>>    hw/rtc/mc146818rtc: QOM'ify IRQ number
>>>    hw/rtc/m48t59-isa: QOM'ify IRQ number
>>>    hw/input/pckbd: QOM'ify IRQ numbers
>>>    hw/isa/isa-bus: Remove isabus_dev_print()
>>>    hw/ppc/pnv: Determine ns16550's IRQ number from QOM property
>>>    isa: Drop unused attributes from ISADevice
>>>    hw/audio/cs4231a: Disuse isa_init_irq()
>>>    hw/audio/gus: Disuse isa_init_irq()
>>>    hw/audio/sb16: Disuse isa_init_irq()
>>>    hw/block/fdc-isa: Disuse isa_init_irq()
>>>    hw/char/parallel: Disuse isa_init_irq()
>>>    hw/char/serial-isa: Disuse isa_init_irq()
>>>    hw/ide/isa: Disuse isa_init_irq()
>>>    hw/input/pckbd: Disuse isa_init_irq()
>>>    hw/ipmi/isa_ipmi_bt: Disuse isa_init_irq()
>>>    hw/ipmi/isa_ipmi_kcs: Disuse isa_init_irq()
>>>    hw/isa/piix4: Disuse isa_init_irq()
>>>    hw/net/ne2000-isa: Disuse isa_init_irq()
>>>    hw/rtc/m48t59-isa: Disuse isa_init_irq()
>>>    hw/tpm/tpm_tis_isa: Disuse isa_init_irq()
>>>    hw/isa/isa-bus: Disuse isa_init_irq()
>>>    isa: Remove unused isa_init_irq()
>> 
>> Series:
>> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>
>If you can address the few comments, I'll queue the v3 via the
>MIPS tree.

[X] Done

Thank you!

Bernhard
>
>Thanks,
>
>Phil.