Author: br
Date: Mon Oct 19 15:50:58 2020
New Revision: 366835
URL: https://svnweb.freebsd.org/changeset/base/366835

Log:
  Assign the reserved apic region (GAS entry) to the iommu domain msi_entry.
  
  Requested by: kib
  Reviewed by:  kib
  Sponsored by: Innovate DSbD
  Differential Revision:        https://reviews.freebsd.org/D26859

Modified:
  head/sys/dev/iommu/iommu.h
  head/sys/dev/iommu/iommu_gas.c
  head/sys/x86/iommu/intel_ctx.c

Modified: head/sys/dev/iommu/iommu.h
==============================================================================
--- head/sys/dev/iommu/iommu.h  Mon Oct 19 15:24:35 2020        (r366834)
+++ head/sys/dev/iommu/iommu.h  Mon Oct 19 15:50:58 2020        (r366835)
@@ -197,7 +197,7 @@ void iommu_gas_free_region(struct iommu_domain *domain
 int iommu_gas_map_region(struct iommu_domain *domain,
     struct iommu_map_entry *entry, u_int eflags, u_int flags, vm_page_t *ma);
 int iommu_gas_reserve_region(struct iommu_domain *domain, iommu_gaddr_t start,
-    iommu_gaddr_t end);
+    iommu_gaddr_t end, struct iommu_map_entry **entry0);
 
 void iommu_set_buswide_ctx(struct iommu_unit *unit, u_int busno);
 bool iommu_is_buswide_ctx(struct iommu_unit *unit, u_int busno);

Modified: head/sys/dev/iommu/iommu_gas.c
==============================================================================
--- head/sys/dev/iommu/iommu_gas.c      Mon Oct 19 15:24:35 2020        
(r366834)
+++ head/sys/dev/iommu/iommu_gas.c      Mon Oct 19 15:50:58 2020        
(r366835)
@@ -677,7 +677,7 @@ iommu_gas_map_region(struct iommu_domain *domain, stru
 
 int
 iommu_gas_reserve_region(struct iommu_domain *domain, iommu_gaddr_t start,
-    iommu_gaddr_t end)
+    iommu_gaddr_t end, struct iommu_map_entry **entry0)
 {
        struct iommu_map_entry *entry;
        int error;
@@ -692,6 +692,8 @@ iommu_gas_reserve_region(struct iommu_domain *domain, 
        IOMMU_DOMAIN_UNLOCK(domain);
        if (error != 0)
                iommu_gas_free_entry(domain, entry);
+       else if (entry0 != NULL)
+               *entry0 = entry;
        return (error);
 }
 

Modified: head/sys/x86/iommu/intel_ctx.c
==============================================================================
--- head/sys/x86/iommu/intel_ctx.c      Mon Oct 19 15:24:35 2020        
(r366834)
+++ head/sys/x86/iommu/intel_ctx.c      Mon Oct 19 15:50:58 2020        
(r366835)
@@ -366,7 +366,7 @@ dmar_domain_alloc(struct dmar_unit *dmar, bool id_mapp
                        goto fail;
                /* Disable local apic region access */
                error = iommu_gas_reserve_region(iodom, 0xfee00000,
-                   0xfeefffff + 1);
+                   0xfeefffff + 1, &iodom->msi_entry);
                if (error != 0)
                        goto fail;
        }
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to