Merge tag 'iommu-fix-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/joro...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 20 Oct 2020 16:35:06 +0000 (09:35 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 20 Oct 2020 16:35:06 +0000 (09:35 -0700)
Pull iommu fix from Joerg Roedel:
 "Fix a build regression with !CONFIG_IOMMU_API"

* tag 'iommu-fix-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
  iommu/vt-d: Don't dereference iommu_device if IOMMU_API is not built

1  2 
drivers/iommu/intel/dmar.c

@@@ -316,9 -316,6 +316,9 @@@ static int dmar_pci_bus_add_dev(struct 
        if (ret < 0 && dmar_dev_scope_status == 0)
                dmar_dev_scope_status = ret;
  
 +      if (ret >= 0)
 +              intel_irq_remap_add_device(info);
 +
        return ret;
  }
  
@@@ -476,7 -473,7 +476,7 @@@ static int dmar_parse_one_rhsa(struct a
        rhsa = (struct acpi_dmar_rhsa *)header;
        for_each_drhd_unit(drhd) {
                if (drhd->reg_base_addr == rhsa->base_address) {
 -                      int node = acpi_map_pxm_to_node(rhsa->proximity_domain);
 +                      int node = pxm_to_node(rhsa->proximity_domain);
  
                        if (!node_online(node))
                                node = NUMA_NO_NODE;
@@@ -1136,7 -1133,7 +1136,7 @@@ error
  
  static void free_iommu(struct intel_iommu *iommu)
  {
-       if (intel_iommu_enabled && iommu->iommu.ops) {
+       if (intel_iommu_enabled && !iommu->drhd->ignored) {
                iommu_device_unregister(&iommu->iommu);
                iommu_device_sysfs_remove(&iommu->iommu);
        }
@@@ -1501,7 -1498,7 +1501,7 @@@ void qi_flush_dev_iotlb_pasid(struct in
  }
  
  void qi_flush_pasid_cache(struct intel_iommu *iommu, u16 did,
 -                        u64 granu, int pasid)
 +                        u64 granu, u32 pasid)
  {
        struct qi_desc desc = {.qw1 = 0, .qw2 = 0, .qw3 = 0};
  
@@@ -1815,7 -1812,7 +1815,7 @@@ void dmar_msi_read(int irq, struct msi_
  }
  
  static int dmar_fault_do_one(struct intel_iommu *iommu, int type,
 -              u8 fault_reason, int pasid, u16 source_id,
 +              u8 fault_reason, u32 pasid, u16 source_id,
                unsigned long long addr)
  {
        const char *reason;
@@@ -1865,8 -1862,7 +1865,8 @@@ irqreturn_t dmar_fault(int irq, void *d
                u8 fault_reason;
                u16 source_id;
                u64 guest_addr;
 -              int type, pasid;
 +              u32 pasid;
 +              int type;
                u32 data;
                bool pasid_present;