Re: [PATCH 05/10] iommu/amd: remove the special case from get_irq_table()

From: Joerg Roedel
Date: Thu Mar 15 2018 - 11:19:25 EST


On Thu, Mar 15, 2018 at 03:15:41PM +0100, Sebastian Andrzej Siewior wrote:
> ->set_allocated() operates only on 0â31 and other could be used at the
> same time. However 0â31 should be accessed by other user before they are
> ready.
>
> irq_remapping_alloc() is that ->alloc() callback invoked via
> irq_domain_alloc_irqs_hierarchy() and each caller has to hold the
> &irq_domain_mutex mutex. So we should not have those in parallel.
>
> Is it possible to have those entries accessed before the setup is
> complete? My understanding is that this setup is performed once during
> boot (especially that ioapic part) and not again.
>
> From looking at that hunk, it should not hurt to add that lock, just
> wanted to check it is really needed.

Okay, if the irq-layer does the needed locking, then we don't need
another lock here. There is the modify_irte_ga() path for the
virtualized irq routing into KVM guests, but there should be no KVM
guests running when setup the ioapic routing entries.



Joerg