mbox series

[v2,0/3] Refactor PPI logic/definitions for virt/sbsa-ref

Message ID 20230919090229.188092-1-quic_llindhol@quicinc.com (mailing list archive)
Headers show
Series Refactor PPI logic/definitions for virt/sbsa-ref | expand

Message

Leif Lindholm Sept. 19, 2023, 9:02 a.m. UTC
This set reworks the handling of private peripheral interrupts in virt
to use INTIDs instead of PPI IDs, to make it easier to cross reference
against Arm's Base System Architecture specification.

It then breaks those definitions out into a separate header and switches
sbsa-ref to use the same header instead of defining its own values
locally.

Changes since v1:
- Replaced PPI macro with PPI_TO_INTID/INTID_TO_PPI macros.
- Fixed a few missing changes to interrupt translation (some reported
  by Peter, some I found when I searched more properly)
- Changed ppibase to intidbase in gic creation instead of doing the
  translation, as suggested by Peter.
- Added explicit comment that listed IDs are INTIDs.

Changes since RFC:
- Compilation tested
- Reordered patches 1-2 as suggested by Philippe.

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

 hw/arm/sbsa-ref.c        | 20 +++++++++-----------
 hw/arm/virt-acpi-build.c | 12 ++++++------
 hw/arm/virt.c            | 24 ++++++++++++++----------
 include/hw/arm/bsa.h     | 37 +++++++++++++++++++++++++++++++++++++
 include/hw/arm/virt.h    | 12 +-----------
 5 files changed, 67 insertions(+), 38 deletions(-)
 create mode 100644 include/hw/arm/bsa.h

Comments

Peter Maydell Oct. 17, 2023, 11:53 a.m. UTC | #1
On Tue, 19 Sept 2023 at 10:02, Leif Lindholm <quic_llindhol@quicinc.com> wrote:
>
> This set reworks the handling of private peripheral interrupts in virt
> to use INTIDs instead of PPI IDs, to make it easier to cross reference
> against Arm's Base System Architecture specification.
>
> It then breaks those definitions out into a separate header and switches
> sbsa-ref to use the same header instead of defining its own values
> locally.

I've applied these patches, with a few tweaks to patch 2:
 * the macro PPI_TO_INTID is unused, so I dropped it
 * I sorted the defines into numerical order
 * I added ARCH_TIMER_NS_EL2_VIRT_IRQ, which fixes up a
   minor conflict with the recent sbsa-ref change which added
   use of that IRQ

Applied to target-arm.next, thanks.

-- PMM