diff options
author | Suresh Siddha <suresh.b.siddha@intel.com> | 2008-04-25 20:07:22 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-30 17:15:35 -0400 |
commit | de33c442ed2a465d2d7804b26dafd2eec067aa34 (patch) | |
tree | 02a9cb2b96d0ad535f0dbfbdccc35afe21aa052e /arch/x86/mm/ioremap.c | |
parent | b9b39bfba5b0de3418305f01cfa7bc55a16004e1 (diff) |
x86 PAT: fix performance drop for glx, use UC minus for ioremap(), ioremap_nocache() and pci_mmap_page_range()
Use UC_MINUS for ioremap(), ioremap_nocache() instead of strong UC.
Once all the X drivers move to ioremap_wc(), we can go back to strong
UC semantics for ioremap() and ioremap_nocache().
To avoid attribute aliasing issues, pci_mmap_page_range() will also
use UC_MINUS for default non write-combining mapping request.
Next steps:
a) change all the video drivers using ioremap() or ioremap_nocache()
and adding WC MTTR using mttr_add() to ioremap_wc()
b) for strict usage, we can go back to strong uc semantics
for ioremap() and ioremap_nocache() after some grace period for
completing step-a.
c) user level X server needs to use the appropriate method for setting
up WC mapping (like using resourceX_wc sysfs file instead of
adding MTRR for WC and using /dev/mem or resourceX under /sys)
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/mm/ioremap.c')
-rw-r--r-- | arch/x86/mm/ioremap.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 0be9f9c59aa6..6d02a36e5e49 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c | |||
@@ -176,11 +176,11 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr, | |||
176 | /* | 176 | /* |
177 | * Do not fallback to certain memory types with certain | 177 | * Do not fallback to certain memory types with certain |
178 | * requested type: | 178 | * requested type: |
179 | * - request is uncached, return cannot be write-back | 179 | * - request is uc-, return cannot be write-back |
180 | * - request is uncached, return cannot be write-combine | 180 | * - request is uc-, return cannot be write-combine |
181 | * - request is write-combine, return cannot be write-back | 181 | * - request is write-combine, return cannot be write-back |
182 | */ | 182 | */ |
183 | if ((prot_val == _PAGE_CACHE_UC && | 183 | if ((prot_val == _PAGE_CACHE_UC_MINUS && |
184 | (new_prot_val == _PAGE_CACHE_WB || | 184 | (new_prot_val == _PAGE_CACHE_WB || |
185 | new_prot_val == _PAGE_CACHE_WC)) || | 185 | new_prot_val == _PAGE_CACHE_WC)) || |
186 | (prot_val == _PAGE_CACHE_WC && | 186 | (prot_val == _PAGE_CACHE_WC && |
@@ -201,6 +201,9 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr, | |||
201 | default: | 201 | default: |
202 | prot = PAGE_KERNEL_NOCACHE; | 202 | prot = PAGE_KERNEL_NOCACHE; |
203 | break; | 203 | break; |
204 | case _PAGE_CACHE_UC_MINUS: | ||
205 | prot = PAGE_KERNEL_UC_MINUS; | ||
206 | break; | ||
204 | case _PAGE_CACHE_WC: | 207 | case _PAGE_CACHE_WC: |
205 | prot = PAGE_KERNEL_WC; | 208 | prot = PAGE_KERNEL_WC; |
206 | break; | 209 | break; |
@@ -255,7 +258,16 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr, | |||
255 | */ | 258 | */ |
256 | void __iomem *ioremap_nocache(resource_size_t phys_addr, unsigned long size) | 259 | void __iomem *ioremap_nocache(resource_size_t phys_addr, unsigned long size) |
257 | { | 260 | { |
258 | return __ioremap_caller(phys_addr, size, _PAGE_CACHE_UC, | 261 | /* |
262 | * Ideally, this should be: | ||
263 | * pat_wc_enabled ? _PAGE_CACHE_UC : _PAGE_CACHE_UC_MINUS; | ||
264 | * | ||
265 | * Till we fix all X drivers to use ioremap_wc(), we will use | ||
266 | * UC MINUS. | ||
267 | */ | ||
268 | unsigned long val = _PAGE_CACHE_UC_MINUS; | ||
269 | |||
270 | return __ioremap_caller(phys_addr, size, val, | ||
259 | __builtin_return_address(0)); | 271 | __builtin_return_address(0)); |
260 | } | 272 | } |
261 | EXPORT_SYMBOL(ioremap_nocache); | 273 | EXPORT_SYMBOL(ioremap_nocache); |