Commit d1423d5679875ebbbc2fc63b33d465baceee0430

Authored by Chris Wright
Committed by David Woodhouse
1 parent 9fe6206f40

intr-remap: allow disabling source id checking

Allow disabling the source id checking while programming the interrupt
remap table entry. Useful for debugging or working around the broken
source id checks on some platforms.

Signed-off-by: Chris Wright <chrisw@redhat.com>
Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>
Acked-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Showing 2 changed files with 27 additions and 0 deletions Side-by-side Diff

Documentation/kernel-parameters.txt
... ... @@ -1028,6 +1028,12 @@
1028 1028 result in a hardware IOTLB flush operation as opposed
1029 1029 to batching them for performance.
1030 1030  
  1031 + intremap= [X86-64, Intel-IOMMU]
  1032 + Format: { on (default) | off | nosid }
  1033 + on enable Interrupt Remapping (default)
  1034 + off disable Interrupt Remapping
  1035 + nosid disable Source ID checking
  1036 +
1031 1037 inttest= [IA64]
1032 1038  
1033 1039 iomem= Disable strict checking of access to MMIO memory
... ... @@ -1755,6 +1761,7 @@
1755 1761  
1756 1762 nointremap [X86-64, Intel-IOMMU] Do not enable interrupt
1757 1763 remapping.
  1764 + [Deprecated - use intremap=off]
1758 1765  
1759 1766 nointroute [IA-64]
1760 1767  
drivers/pci/intr_remapping.c
... ... @@ -21,6 +21,8 @@
21 21 int intr_remapping_enabled;
22 22  
23 23 static int disable_intremap;
  24 +static int disable_sourceid_checking;
  25 +
24 26 static __init int setup_nointremap(char *str)
25 27 {
26 28 disable_intremap = 1;
... ... @@ -28,6 +30,22 @@
28 30 }
29 31 early_param("nointremap", setup_nointremap);
30 32  
  33 +static __init int setup_intremap(char *str)
  34 +{
  35 + if (!str)
  36 + return -EINVAL;
  37 +
  38 + if (!strncmp(str, "on", 2))
  39 + disable_intremap = 0;
  40 + else if (!strncmp(str, "off", 3))
  41 + disable_intremap = 1;
  42 + else if (!strncmp(str, "nosid", 5))
  43 + disable_sourceid_checking = 1;
  44 +
  45 + return 0;
  46 +}
  47 +early_param("intremap", setup_intremap);
  48 +
31 49 struct irq_2_iommu {
32 50 struct intel_iommu *iommu;
33 51 u16 irte_index;
... ... @@ -453,6 +471,8 @@
453 471 static void set_irte_sid(struct irte *irte, unsigned int svt,
454 472 unsigned int sq, unsigned int sid)
455 473 {
  474 + if (disable_sourceid_checking)
  475 + svt = SVT_NO_VERIFY;
456 476 irte->svt = svt;
457 477 irte->sq = sq;
458 478 irte->sid = sid;