Re: [PATCH v10 03/13] iommu/arm-smmu-v3: Add ARM_SMMU_FEAT_EVTQ for the event queue

From: Nicolin Chen

Date: Sun Oct 04 2026 - 16:23:32 EST


On Sun, Oct 04, 2026 at 02:24:10PM +0100, Will Deacon wrote:
> On Sun, Aug 30, 2026 at 04:18:04PM -0700, Nicolin Chen wrote:
> > The driver programs and enables the event queue unconditionally, while the
> > PRI queue has an ARM_SMMU_FEAT_PRI gating each of its touch points. Yet a
> > kdump kernel wants to leave both of the queues alone, which would take an
> > is_kdump_kernel() test at every one of those places.
> >
> > Add an ARM_SMMU_FEAT_EVTQ that the probe always sets, as the event queue is
> > architecturally mandatory, and gate the queue's allocation, its interrupt
> > and its CR0 and IRQ_CTRL enables on it, so that a later change can turn the
> > queue off in a single place.
> >
> > No functional change intended.
> >
> > Suggested-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
> > Suggested-by: Robin Murphy <robin.murphy@xxxxxxx>
> > Assisted-by: Claude:claude-opus-5
> > Signed-off-by: Nicolin Chen <nicolinc@xxxxxxxxxx>
> > ---
> > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 1 +
> > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 79 +++++++++++++--------
> > 2 files changed, 52 insertions(+), 28 deletions(-)
>
> Sashiko has comments about the event queue MSI configuration for this patch.
> Please can you have a look?

Sashiko raised those because it doesn't read subsequent patches.

And I left them as-is because I don't think they worth a change:

1. IRQ_CTRL_EVTQ_IRQEN is never enabled in the kdump mode, so that
ARM_SMMU_EVTQ_IRQ_CFG0 line shouldn't matter.

2. arm_smmu_write_msi_msg() is never called in the kdump mode since
devm_request_threaded_irq() is guarded with ARM_SMMU_FEAT_EVTQ.

Sashiko is only right about the small waste of the MSI vector since
it's unused. But, that nvec decrement trick only works for PRIQ, as
its MSI index is at top of the list:

enum arm_smmu_msi_index {
EVTQ_MSI_INDEX,
GERROR_MSI_INDEX,
PRIQ_MSI_INDEX,
ARM_SMMU_MAX_MSIS, // "nvec--" shifts up this, skipping PRIQ
};

On the other hand, EVTQ_MSI_INDEX is at 0. Skipping it would need to
shift the entire index list; struct arm_smmu_msi_cfg would not work
straightforwardly as today.

Nicolin