diff options
author | Suresh Siddha <suresh.b.siddha@intel.com> | 2011-08-23 20:05:18 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-09-21 04:21:50 -0400 |
commit | 41750d31fc9599fd81763e685a6b7b42d298c4f8 (patch) | |
tree | 6cacc746aa159c8bd08f151270f0bffe126caa9d /include/linux/dmar.h | |
parent | 9d037a777695993ec7437e5f451647dea7919d4c (diff) |
x86, x2apic: Enable the bios request for x2apic optout
On the platforms which are x2apic and interrupt-remapping
capable, Linux kernel is enabling x2apic even if the BIOS
doesn't. This is to take advantage of the features that x2apic
brings in.
Some of the OEM platforms are running into issues because of
this, as their bios is not x2apic aware. For example, this was
resulting in interrupt migration issues on one of the platforms.
Also if the BIOS SMI handling uses APIC interface to send SMI's,
then the BIOS need to be aware of x2apic mode that OS has
enabled.
On some of these platforms, BIOS doesn't have a HW mechanism to
turnoff the x2apic feature to prevent OS from enabling it.
To resolve this mess, recent changes to the VT-d2 specification:
http://download.intel.com/technology/computing/vptech/Intel(r)_VT_for_Direct_IO.pdf
includes a mechanism that provides BIOS a way to request system
software to opt out of enabling x2apic mode.
Look at the x2apic optout flag in the DMAR tables before
enabling the x2apic mode in the platform. Also print a warning
that we have disabled x2apic based on the BIOS request.
Kernel boot parameter "intremap=no_x2apic_optout" can be used to
override the BIOS x2apic optout request.
Signed-off-by: Youquan Song <youquan.song@intel.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: yinghai@kernel.org
Cc: joerg.roedel@amd.com
Cc: tony.luck@intel.com
Cc: dwmw2@infradead.org
Link: http://lkml.kernel.org/r/20110824001456.171766616@sbsiddha-desk.sc.intel.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/dmar.h')
-rw-r--r-- | include/linux/dmar.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/include/linux/dmar.h b/include/linux/dmar.h index 7b776d71d36d..2dc810e35dd0 100644 --- a/include/linux/dmar.h +++ b/include/linux/dmar.h | |||
@@ -26,8 +26,13 @@ | |||
26 | #include <linux/msi.h> | 26 | #include <linux/msi.h> |
27 | #include <linux/irqreturn.h> | 27 | #include <linux/irqreturn.h> |
28 | 28 | ||
29 | /* DMAR Flags */ | ||
30 | #define DMAR_INTR_REMAP 0x1 | ||
31 | #define DMAR_X2APIC_OPT_OUT 0x2 | ||
32 | |||
29 | struct intel_iommu; | 33 | struct intel_iommu; |
30 | #if defined(CONFIG_DMAR) || defined(CONFIG_INTR_REMAP) | 34 | #if defined(CONFIG_DMAR) || defined(CONFIG_INTR_REMAP) |
35 | extern struct acpi_table_header *dmar_tbl; | ||
31 | struct dmar_drhd_unit { | 36 | struct dmar_drhd_unit { |
32 | struct list_head list; /* list of drhd units */ | 37 | struct list_head list; /* list of drhd units */ |
33 | struct acpi_dmar_header *hdr; /* ACPI header */ | 38 | struct acpi_dmar_header *hdr; /* ACPI header */ |
@@ -110,7 +115,7 @@ struct irte { | |||
110 | #ifdef CONFIG_INTR_REMAP | 115 | #ifdef CONFIG_INTR_REMAP |
111 | extern int intr_remapping_enabled; | 116 | extern int intr_remapping_enabled; |
112 | extern int intr_remapping_supported(void); | 117 | extern int intr_remapping_supported(void); |
113 | extern int enable_intr_remapping(int); | 118 | extern int enable_intr_remapping(void); |
114 | extern void disable_intr_remapping(void); | 119 | extern void disable_intr_remapping(void); |
115 | extern int reenable_intr_remapping(int); | 120 | extern int reenable_intr_remapping(int); |
116 | 121 | ||
@@ -177,7 +182,7 @@ static inline int set_msi_sid(struct irte *irte, struct pci_dev *dev) | |||
177 | 182 | ||
178 | #define intr_remapping_enabled (0) | 183 | #define intr_remapping_enabled (0) |
179 | 184 | ||
180 | static inline int enable_intr_remapping(int eim) | 185 | static inline int enable_intr_remapping(void) |
181 | { | 186 | { |
182 | return -1; | 187 | return -1; |
183 | } | 188 | } |
@@ -192,6 +197,11 @@ static inline int reenable_intr_remapping(int eim) | |||
192 | } | 197 | } |
193 | #endif | 198 | #endif |
194 | 199 | ||
200 | enum { | ||
201 | IRQ_REMAP_XAPIC_MODE, | ||
202 | IRQ_REMAP_X2APIC_MODE, | ||
203 | }; | ||
204 | |||
195 | /* Can't use the common MSI interrupt functions | 205 | /* Can't use the common MSI interrupt functions |
196 | * since DMAR is not a pci device | 206 | * since DMAR is not a pci device |
197 | */ | 207 | */ |