lkml.org 
[lkml]   [2018]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 05/10] iommu/amd: remove the special case from get_irq_table()
    On Fri, Feb 23, 2018 at 11:27:31PM +0100, Sebastian Andrzej Siewior wrote:
    > @@ -4103,10 +4093,26 @@ static int irq_remapping_alloc(struct irq_domain *domain, unsigned int virq,
    > return ret;
    >
    > if (info->type == X86_IRQ_ALLOC_TYPE_IOAPIC) {
    > - if (get_irq_table(devid, true))
    > + struct irq_remap_table *table;
    > + struct amd_iommu *iommu;
    > +
    > + table = get_irq_table(devid);
    > + if (table) {
    > + if (!table->min_index) {
    > + /*
    > + * Keep the first 32 indexes free for IOAPIC
    > + * interrupts.
    > + */
    > + table->min_index = 32;
    > + iommu = amd_iommu_rlookup_table[devid];
    > + for (i = 0; i < 32; ++i)
    > + iommu->irte_ops->set_allocated(table, i);
    > + }

    I think this needs to be protected by the table->lock.

    \
     
     \ /
      Last update: 2018-03-15 13:54    [W:7.421 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site