On 20/02/2024 19:26, Philippe Mathieu-Daudé wrote:

Hi,

cpu_interrupt() doesn't scale well with heterogenous machines
because its mask is target specific (defined in target/ARCH/cpu.h).

While it is (often...) used by target-specific hw to notify cpu,
there is no restriction to use such target-specific hw in a
heterogeneous setup, where it'd still target the same kind of
target cpus.

The Alpha Typhoon HW is unlikely to be used heterogeneously,
but it is the simplest case I found to illustrate how I plan
to remove cpu_interrupt() calls from hw/: use the QDev GPIO API.

Does that sound good enough?

I think the basic mechanism of setting/resetting the interrupt using qdev GPIOs should work, but I wonder if there isn't a better way of defining them to avoid more #ifdeffery.

Is it possible to come up with some declarative syntax in either CPUClass or CPUClass::sysemu_ops that would avoid the developer manually having to call qdev_init_gpio_in_named() manually during CPU init() and/or create the various _irq() callback functions by hand?

Thanks,

Phil.

Philippe Mathieu-Daudé (2):
   target/alpha: Expose TMR and SMP IRQ lines via QDev
   hw/alpha/typhoon: Set CPU IRQs using QDev API

  hw/alpha/typhoon.c | 15 +++++++++------
  target/alpha/cpu.c | 30 ++++++++++++++++++++++++++++++
  2 files changed, 39 insertions(+), 6 deletions(-)


ATB,

Mark.


Reply via email to