All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: wei.wang2@amd.com
Subject: [PATCH 3 of 3] xen: AMD IOMMU: Automatically enable per-device vector maps
Date: Tue, 26 Jul 2011 17:33:34 +0100	[thread overview]
Message-ID: <fffeeea7afbb5558d549.1311698014@elijah> (raw)
In-Reply-To: <patchbomb.1311698011@elijah>

Automatically enable per-device vector maps when using IOMMU,
unless disabled specifically by an IOMMU parameter.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

diff -r 362a881a79a4 -r fffeeea7afbb xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c	Tue Jul 26 17:21:23 2011 +0100
+++ b/xen/arch/x86/irq.c	Tue Jul 26 17:21:23 2011 +0100
@@ -32,6 +32,7 @@ unsigned int __read_mostly nr_irqs_gsi =
 unsigned int __read_mostly nr_irqs;
 integer_param("nr_irqs", nr_irqs);
 
+/* This default may be changed by the AMD IOMMU code */
 bool_t __read_mostly opt_irq_perdev_vector_map = 0;
 boolean_param("irq-perdev-vector-map", opt_irq_perdev_vector_map);
 
diff -r 362a881a79a4 -r fffeeea7afbb xen/drivers/passthrough/amd/pci_amd_iommu.c
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c	Tue Jul 26 17:21:23 2011 +0100
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c	Tue Jul 26 17:21:23 2011 +0100
@@ -25,6 +25,9 @@
 #include <asm/amd-iommu.h>
 #include <asm/hvm/svm/amd-iommu-proto.h>
 
+extern bool_t __read_mostly opt_irq_perdev_vector_map;
+extern bool_t __read_mostly iommu_amd_perdev_vector_map;
+
 struct amd_iommu *find_iommu_for_device(int bdf)
 {
     BUG_ON ( bdf >= ivrs_bdf_entries );
@@ -148,6 +151,18 @@ int __init amd_iov_detect(void)
         return -ENODEV;
     }
 
+    /* Enable use of per-device vector map unless otherwise
+     * specified */
+    if ( iommu_amd_perdev_vector_map )
+    {
+        printk("AMD-Vi: Enabling per-device vector maps\n");
+        opt_irq_perdev_vector_map=1;
+    }
+    else
+    {
+        printk("AMD-Vi: WARNING - not enabling per-device vector maps\n");
+    }
+
     return scan_pci_devices();
 }
 
diff -r 362a881a79a4 -r fffeeea7afbb xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Tue Jul 26 17:21:23 2011 +0100
+++ b/xen/drivers/passthrough/iommu.c	Tue Jul 26 17:21:23 2011 +0100
@@ -49,6 +49,7 @@ bool_t __read_mostly iommu_qinval = 1;
 bool_t __read_mostly iommu_intremap = 1;
 bool_t __read_mostly iommu_hap_pt_share;
 bool_t __read_mostly iommu_debug;
+bool_t __read_mostly iommu_amd_perdev_vector_map = 1;
 
 static void __init parse_iommu_param(char *s)
 {
@@ -81,6 +82,8 @@ static void __init parse_iommu_param(cha
             iommu_dom0_strict = 1;
         else if ( !strcmp(s, "sharept") )
             iommu_hap_pt_share = 1;
+        else if ( !strcmp(s, "no-perdev-vector-map") )
+            iommu_amd_perdev_vector_map = 0;
 
         s = ss + 1;
     } while ( ss );

  parent reply	other threads:[~2011-07-26 16:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-26 16:33 [PATCH 0 of 3] Avoid sharing vectors within a device when using an AMD IOMMU George Dunlap
2011-07-26 16:33 ` [PATCH 1 of 3] xen: Infrastructure to allow irqs to share vector maps George Dunlap
2011-07-26 16:33 ` [PATCH 2 of 3] xen: Option to allow per-device vector maps for MSI IRQs George Dunlap
2011-07-26 16:33 ` George Dunlap [this message]
2011-07-26 17:01 ` [PATCH 0 of 3] Avoid sharing vectors within a device when using an AMD IOMMU Keir Fraser
2011-07-26 17:17   ` George Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fffeeea7afbb5558d549.1311698014@elijah \
    --to=george.dunlap@eu.citrix.com \
    --cc=wei.wang2@amd.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.