[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] IOMMU/x86: don't map IO-APICs for PV Dom0


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 16 Aug 2021 17:31:53 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rk5bsRVmd168z5+RIwq3jLAB6dql/1sgp2aT+H6oh1A=; b=dFbgplexrXGnSHh/MMgxfmvp34mkR41CajD+Xh+LE5p0xoitdjeqdFXC7XrUfnWv4HSMsX8Cl4hE8v8GaRKO+qQ+O7Y2wMqqZ8QvULve8fTGqEvflZXfyGSLQvOLzvNEB704O6efgAbrjSfQf0+sJJOoZqbcqq2iBr+g2VkpaZ7MyEiWQrGJy0iZED1VMTGnw6QSvu1ZfiZS1jNNYwJrZcHXLcplimV2/5BRNbYKNi2gt+BFWw2HtfD1UHtoIB/MkgPZcAYdXWL4EZJ6BezooOTWiH1uA0HOgwM+aK8OC0cAIhYAYlolThUkTK8qG6YBXkPajnYBvc1pmsRW8yUVmQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TJJeGuszG1fwDILxAXQ7RRkNwd0y6s0u5Sd+zv4QQwIro5almD+c0c0O32P6XKS/U8bCzSD/HwZ7GkVVFUQTIv6tQprJRfeeBooMNM+I+n8bWm8SIfUU2TUbxX0dLuY7kC91xapzLyxkZtInl1GRLOCoQqxFHphhVF+WDqOnofZ05i2P1o6CcvoyuFTnv4XmiQwpyyvyf6s6FWuqHUXQXchazP45dVNPUUtJxjGYCNiExHR+bkSvAUwAVLRuTvtqFyhx//vdAdegk6vc+QSnPAmdAoG5ldVVIlHfmNq19FStzikJlJBdRko77K249dxjL4AVAFe4eYhXXpyLV/JJAg==
  • Authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>
  • Delivery-date: Mon, 16 Aug 2021 15:32:02 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

While already the case for PVH, there's no reason to treat PV
differently here (except of course where to take the addresses from).

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/drivers/passthrough/x86/iommu.c
+++ b/xen/drivers/passthrough/x86/iommu.c
@@ -199,9 +199,18 @@ static bool __hwdom_init hwdom_iommu_map
     if ( pfn >= 0xfee00 && pfn <= 0xfeeff )
         return false;
     /* ... or the IO-APIC */
-    for ( i = 0; has_vioapic(d) && i < d->arch.hvm.nr_vioapics; i++ )
-        if ( pfn == PFN_DOWN(domain_vioapic(d, i)->base_address) )
-            return false;
+    if ( has_vioapic(d) )
+    {
+        for ( i = 0; i < d->arch.hvm.nr_vioapics; i++ )
+            if ( pfn == PFN_DOWN(domain_vioapic(d, i)->base_address) )
+                return false;
+    }
+    else
+    {
+        for ( i = 0; i < nr_ioapics; i++ )
+            if ( pfn == PFN_DOWN(mp_ioapics[i].mpc_apicaddr) )
+                return false;
+    }
     /*
      * ... or the PCIe MCFG regions.
      * TODO: runtime added MMCFG regions are not checked to make sure they




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.