mbox series

[v4,0/8] GICv3 LPI and ITS feature implementation

Message ID 20210602180042.111347-1-shashi.mallela@linaro.org
Headers show
Series GICv3 LPI and ITS feature implementation | expand

Message

Shashi Mallela June 2, 2021, 6 p.m. UTC
This patchset implements qemu device model for enabling physical
LPI support and ITS functionality in GIC as per GICv3 specification.
Both flat table and 2 level tables are implemented.The ITS commands
for adding/deleting ITS table entries,trigerring LPI interrupts are
implemented.Translated LPI interrupt ids are processed by redistributor
to determine priority and set pending state appropriately before
forwarding the same to cpu interface.
The ITS feature support has been added to sbsa-ref platform as well as
virt platform,wherein the emulated functionality co-exists with kvm
kernel functionality.

Changes in v4:
 - review comments addressed
 - redesigned the lpi pending priority determination logic to scan
   LPI pending table and config table right after lpi pending
   statechanges(SET/RESET) through gicv3_redist_update_lpi() call to
   determinethe highest priority lpi among the active lpis and save
   the details.The high priority interrupt determination logic in
   redistributor now usesthe saved high priority lpi details
   (alongside other interrupt types) instead of calling
   gicv3_redist_update_lpi() everytime(as in v3).This
   significantly reduces the call overhead associated with
   address_space_read of lpi config and pending tables.
   Testing with this new design showed no boot delays.
 - profiled execution of gicv3_redist_update_lpi() using perf and
   framegraph to confirm execution is within normal limits.
   Also,specifically measured execution time to be an average of 175us
   with linux distro testing.
 - All kvm_unit_tests PASS

Shashi Mallela (8):
  hw/intc: GICv3 ITS initial framework
  hw/intc: GICv3 ITS register definitions added
  hw/intc: GICv3 ITS command queue framework
  hw/intc: GICv3 ITS Command processing
  hw/intc: GICv3 ITS Feature enablement
  hw/intc: GICv3 redistributor ITS processing
  hw/arm/sbsa-ref: add ITS support in SBSA GIC
  hw/arm/virt: add ITS support in virt GIC

 hw/arm/sbsa-ref.c                      |   26 +-
 hw/arm/virt.c                          |   27 +-
 hw/intc/arm_gicv3.c                    |    9 +
 hw/intc/arm_gicv3_common.c             |   13 +
 hw/intc/arm_gicv3_cpuif.c              |    7 +-
 hw/intc/arm_gicv3_dist.c               |    7 +-
 hw/intc/arm_gicv3_its.c                | 1217 ++++++++++++++++++++++++
 hw/intc/arm_gicv3_its_common.c         |    8 +-
 hw/intc/arm_gicv3_its_kvm.c            |    2 +-
 hw/intc/arm_gicv3_redist.c             |  159 +++-
 hw/intc/gicv3_internal.h               |  186 +++-
 hw/intc/meson.build                    |    1 +
 include/hw/arm/virt.h                  |    2 +
 include/hw/intc/arm_gicv3_common.h     |   16 +
 include/hw/intc/arm_gicv3_its_common.h |   39 +-
 target/arm/kvm_arm.h                   |    4 +-
 16 files changed, 1694 insertions(+), 29 deletions(-)
 create mode 100644 hw/intc/arm_gicv3_its.c

-- 
2.27.0

Comments

Peter Maydell June 8, 2021, 10 a.m. UTC | #1
On Wed, 2 Jun 2021 at 19:00, Shashi Mallela <shashi.mallela@linaro.org> wrote:
>

> This patchset implements qemu device model for enabling physical

> LPI support and ITS functionality in GIC as per GICv3 specification.

> Both flat table and 2 level tables are implemented.The ITS commands

> for adding/deleting ITS table entries,trigerring LPI interrupts are

> implemented.Translated LPI interrupt ids are processed by redistributor

> to determine priority and set pending state appropriately before

> forwarding the same to cpu interface.

> The ITS feature support has been added to sbsa-ref platform as well as

> virt platform,wherein the emulated functionality co-exists with kvm

> kernel functionality.

>

> Changes in v4:

>  - review comments addressed

>  - redesigned the lpi pending priority determination logic to scan

>    LPI pending table and config table right after lpi pending

>    statechanges(SET/RESET) through gicv3_redist_update_lpi() call to

>    determinethe highest priority lpi among the active lpis and save

>    the details.The high priority interrupt determination logic in

>    redistributor now usesthe saved high priority lpi details

>    (alongside other interrupt types) instead of calling

>    gicv3_redist_update_lpi() everytime(as in v3).This

>    significantly reduces the call overhead associated with

>    address_space_read of lpi config and pending tables.

>    Testing with this new design showed no boot delays.

>  - profiled execution of gicv3_redist_update_lpi() using perf and

>    framegraph to confirm execution is within normal limits.

>    Also,specifically measured execution time to be an average of 175us

>    with linux distro testing.

>  - All kvm_unit_tests PASS


This still fails to build with clang, in the same way as v3 failed.
Also (as noted in my other email, you need to integrate the updates
to the ACPI table test data into this series; 'make' and 'make check'
should work at every step in the patch series.

thanks
-- PMM