qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] target/nios2: Roll cpu_pic code into CPU itself
@ 2020-11-27 19:12 Peter Maydell
  2020-11-27 19:12 ` [PATCH 1/2] target/nios2: Move cpu_pic code into CPU object proper Peter Maydell
  2020-11-27 19:12 ` [PATCH 2/2] target/nios2: Move nios2_check_interrupts() into target/nios2 Peter Maydell
  0 siblings, 2 replies; 7+ messages in thread
From: Peter Maydell @ 2020-11-27 19:12 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marek Vasut, Sandra Loosemore, Chris Wulff, Wentong Wu

(As well as the listed nios2 maintainers, I've cc'd a couple
of the more recent contributors to this target in case they're
interested or wish to test the changes.)

The nios2 code uses an old style of interrupt handling, where a
separate standalone set of qemu_irqs invoke a function
nios2_pic_cpu_handler() which signals the interrupt to the CPU proper
by directly calling cpu_interrupt() and cpu_reset_interrupt().
Because CPU objects now inherit (indirectly) from TYPE_DEVICE, they
can have GPIO input lines themselves, and the neater modern way to
implement this is to simply have the CPU object itself provide the
input IRQ lines.

This allows us to roll all of the code in hw/nios/cpu_pic.c
into target/nios2 one way or another.

The motivation here is fixing a trivial Coverity-reported leak
(CID 1421916) of the IRQ array allocated in nios2_cpu_pic_init(),
and also part of the extremely slow refactoring of code away
from using qemu_allocate_irqs() at all.

Tested with 'make check' and 'make check-acceptance' (which does
include a boot test of a nios2 10m50 guest).

thanks
-- PMM

Peter Maydell (2):
  target/nios2: Move cpu_pic code into CPU object proper
  target/nios2: Move nios2_check_interrupts() into target/nios2

 target/nios2/cpu.h        |  3 --
 hw/nios2/10m50_devboard.c |  8 ++---
 hw/nios2/cpu_pic.c        | 67 ---------------------------------------
 target/nios2/cpu.c        | 34 ++++++++++++++++++++
 target/nios2/op_helper.c  |  9 ++++++
 hw/nios2/meson.build      |  2 +-
 6 files changed, 47 insertions(+), 76 deletions(-)
 delete mode 100644 hw/nios2/cpu_pic.c

-- 
2.20.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-11-28 14:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-27 19:12 [PATCH 0/2] target/nios2: Roll cpu_pic code into CPU itself Peter Maydell
2020-11-27 19:12 ` [PATCH 1/2] target/nios2: Move cpu_pic code into CPU object proper Peter Maydell
2020-11-27 19:37   ` Philippe Mathieu-Daudé
2020-11-28  5:50   ` Wu, Wentong
2020-11-28 14:39     ` Peter Maydell
2020-11-27 19:12 ` [PATCH 2/2] target/nios2: Move nios2_check_interrupts() into target/nios2 Peter Maydell
2020-11-27 19:32   ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).