[PATCH for-4.22 0/2] xen/arm: Fix eSPI IRQ indexing issues

Mykola Kvach posted 2 patches 1 week, 6 days ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/cover.1783671887.git.mykola._5Fkvach@epam.com
xen/arch/arm/gic.c  |  2 --
xen/arch/arm/irq.c  |  9 +++++++--
xen/arch/arm/vgic.c | 27 ++++++++++++++++-----------
3 files changed, 23 insertions(+), 15 deletions(-)
[PATCH for-4.22 0/2] xen/arm: Fix eSPI IRQ indexing issues
Posted by Mykola Kvach 1 week, 6 days ago
This small series fixes two eSPI-related indexing issues in the Arm
interrupt and classic vGIC paths.

With GICv3 eSPI support enabled, Xen exposes a sparse architectural
INTID namespace: regular SPIs occupy the traditional range, while eSPIs
start at INTID 4096. Some paths were still treating that namespace as if
it mapped directly to dense internal arrays or bitmaps.

Patch 1 prevents sparse INTIDs in the gap between regular SPIs and eSPIs
from reaching irq_to_desc() and being used as dense irq_desc[] indices.

Patch 2 fixes classic vGIC eSPI allocation bookkeeping: reserve used the
compressed allocation bitmap index for eSPIs, while free still used the
raw virtual INTID.

Both patches are intentionally small and keep the existing eSPI mapping
model.

Tested with:
- CONFIG_GICV3_ESPI=y build
- CONFIG_GICV3_ESPI=n build
- FVP boot with 64 eSPIs
- pre-fix reproduction using a fake DT interrupt for INTID 3000
- post-fix smoke boot to Linux dom0

Mykola Kvach (2):
  xen/arm: validate IRQs before descriptor lookup
  xen/arm: vgic: free eSPIs using the bitmap index

 xen/arch/arm/gic.c  |  2 --
 xen/arch/arm/irq.c  |  9 +++++++--
 xen/arch/arm/vgic.c | 27 ++++++++++++++++-----------
 3 files changed, 23 insertions(+), 15 deletions(-)

-- 
2.43.0