qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] Refactor PPI logic/definitions for virt/sbsa-ref
@ 2023-09-14 12:01 Leif Lindholm
  2023-09-14 12:01 ` [RFC PATCH 1/3] include/hw/arm: move BSA definitions to bsa.h Leif Lindholm
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Leif Lindholm @ 2023-09-14 12:01 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-arm, Radoslaw Biernacki, Peter Maydell, Marcin Juszkiewicz

While reviewing Marcin's patch this morning, cross referencing different
specifications and looking at various places around the source code in
order to convinced myself he really hadn't missed something out (the
existing plumbing made it *so* clean to add), my brain broke slightly
at keeping track of PPIs/INTIDs between the various sources.

Moreover, I found the PPI() macro in virt.h to be doing the exact
opposite of what I would have expected it to (it converts a PPI to an
INTID rather than the other way around).

So I refactored stuff so that:
- PPIs defined by BSA are moved to a (new) common header.
- The _IRQ definitions for those PPIs refer to the INTIDs.
- sbsa-ref and virt both use these definitions.

This change does objectively add a bit more noise to the code, since it
means more locations need to use the PPI macro than before, but it felt
like a readability improvement to me.

Not even compilation tested, just the least confusing way of asking
whether the change could be accepted at all.

Leif Lindholm (3):
  include/hw/arm: move BSA definitions to bsa.h
  {include/}hw/arm: refactor BSA/virt PPI logic
  hw/arm/sbsa-ref: use bsa.h for PPI definitions

 hw/arm/sbsa-ref.c        | 24 +++++++++++-------------
 hw/arm/virt-acpi-build.c |  4 ++--
 hw/arm/virt.c            |  9 +++++----
 include/hw/arm/bsa.h     | 35 +++++++++++++++++++++++++++++++++++
 include/hw/arm/virt.h    | 12 +-----------
 5 files changed, 54 insertions(+), 30 deletions(-)
 create mode 100644 include/hw/arm/bsa.h

-- 
2.30.2


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

end of thread, other threads:[~2023-09-14 15:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-14 12:01 [RFC PATCH 0/3] Refactor PPI logic/definitions for virt/sbsa-ref Leif Lindholm
2023-09-14 12:01 ` [RFC PATCH 1/3] include/hw/arm: move BSA definitions to bsa.h Leif Lindholm
2023-09-14 12:01 ` [RFC PATCH 2/3] {include/}hw/arm: refactor BSA/virt PPI logic Leif Lindholm
2023-09-14 12:26   ` Philippe Mathieu-Daudé
2023-09-14 12:01 ` [RFC PATCH 3/3] hw/arm/sbsa-ref: use bsa.h for PPI definitions Leif Lindholm
2023-09-14 12:26   ` Philippe Mathieu-Daudé
2023-09-14 13:15 ` [RFC PATCH 0/3] Refactor PPI logic/definitions for virt/sbsa-ref Marcin Juszkiewicz
2023-09-14 15:06   ` Leif Lindholm

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).