aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/pci/i386.c
diff options
context:
space:
mode:
authorSuresh Siddha <suresh.b.siddha@intel.com>2008-04-25 20:07:22 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-30 17:15:35 -0400
commitde33c442ed2a465d2d7804b26dafd2eec067aa34 (patch)
tree02a9cb2b96d0ad535f0dbfbdccc35afe21aa052e /arch/x86/pci/i386.c
parentb9b39bfba5b0de3418305f01cfa7bc55a16004e1 (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/pci/i386.c')
-rw-r--r--arch/x86/pci/i386.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c
index 94f6c73a53d0..8af0f0bae2af 100644
--- a/arch/x86/pci/i386.c
+++ b/arch/x86/pci/i386.c
@@ -301,6 +301,13 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
301 prot = pgprot_val(vma->vm_page_prot); 301 prot = pgprot_val(vma->vm_page_prot);
302 if (pat_wc_enabled && write_combine) 302 if (pat_wc_enabled && write_combine)
303 prot |= _PAGE_CACHE_WC; 303 prot |= _PAGE_CACHE_WC;
304 else if (pat_wc_enabled)
305 /*
306 * ioremap() and ioremap_nocache() defaults to UC MINUS for now.
307 * To avoid attribute conflicts, request UC MINUS here
308 * aswell.
309 */
310 prot |= _PAGE_CACHE_UC_MINUS;
304 else if (boot_cpu_data.x86 > 3) 311 else if (boot_cpu_data.x86 > 3)
305 prot |= _PAGE_CACHE_UC; 312 prot |= _PAGE_CACHE_UC;
306 313
@@ -319,9 +326,8 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
319 * - request is uncached, return cannot be write-combine 326 * - request is uncached, return cannot be write-combine
320 * - request is write-combine, return cannot be write-back 327 * - request is write-combine, return cannot be write-back
321 */ 328 */
322 if ((flags == _PAGE_CACHE_UC && 329 if ((flags == _PAGE_CACHE_UC_MINUS &&
323 (new_flags == _PAGE_CACHE_WB || 330 (new_flags == _PAGE_CACHE_WB)) ||
324 new_flags == _PAGE_CACHE_WC)) ||
325 (flags == _PAGE_CACHE_WC && 331 (flags == _PAGE_CACHE_WC &&
326 new_flags == _PAGE_CACHE_WB)) { 332 new_flags == _PAGE_CACHE_WB)) {
327 free_memtype(addr, addr+len); 333 free_memtype(addr, addr+len);