• S
    iommu/amd: Drop the lock while allocating new irq remap table · 993ca6e0
    Sebastian Andrzej Siewior 提交于
    The irq_remap_table is allocated while the iommu_table_lock is held with
    interrupts disabled.
    >From looking at the call sites, all callers are in the early device
    initialisation (apic_bsp_setup(), pci_enable_device(),
    pci_enable_msi()) so make sense to drop the lock which also enables
    interrupts and try to allocate that memory with GFP_KERNEL instead
    GFP_ATOMIC.
    
    Since during the allocation the iommu_table_lock is dropped, we need to
    recheck if table exists after the lock has been reacquired. I *think*
    that it is impossible that the "devid" entry appears in irq_lookup_table
    while the lock is dropped since the same device can only be probed once.
    However I check for both cases, just to be sure.
    Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: NJoerg Roedel <jroedel@suse.de>
    993ca6e0
amd_iommu.c 103.3 KB