Commit e2e96c663639a3361bb1a84e666887d308c6c87e

Authored by Linus Torvalds

Merge git://git.infradead.org/iommu-2.6

* git://git.infradead.org/iommu-2.6:
  intel-iommu: Fix 32-bit build warning with __cmpxchg()
  intr-remap: allow disabling source id checking

Showing 3 changed files Side-by-side Diff

Documentation/kernel-parameters.txt
... ... @@ -981,6 +981,12 @@
981 981 result in a hardware IOTLB flush operation as opposed
982 982 to batching them for performance.
983 983  
  984 + intremap= [X86-64, Intel-IOMMU]
  985 + Format: { on (default) | off | nosid }
  986 + on enable Interrupt Remapping (default)
  987 + off disable Interrupt Remapping
  988 + nosid disable Source ID checking
  989 +
984 990 inttest= [IA64]
985 991  
986 992 iomem= Disable strict checking of access to MMIO memory
... ... @@ -1681,6 +1687,7 @@
1681 1687  
1682 1688 nointremap [X86-64, Intel-IOMMU] Do not enable interrupt
1683 1689 remapping.
  1690 + [Deprecated - use intremap=off]
1684 1691  
1685 1692 nointroute [IA-64]
1686 1693  
drivers/pci/intel-iommu.c
... ... @@ -236,7 +236,7 @@
236 236 return pte->val & VTD_PAGE_MASK;
237 237 #else
238 238 /* Must have a full atomic 64-bit read */
239   - return __cmpxchg64(pte, 0ULL, 0ULL) & VTD_PAGE_MASK;
  239 + return __cmpxchg64(&pte->val, 0ULL, 0ULL) & VTD_PAGE_MASK;
240 240 #endif
241 241 }
242 242  
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;