From 5ad0f8491bd544e92b85b369303c6504d136fea7 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 23 Jan 2009 14:14:21 -0800 Subject: [PATCH] --- yaml --- r: 129971 b: refs/heads/master c: ef5fa0ab24b87646c7bc98645acbb4b51fc2acd4 h: refs/heads/master i: 129969: 202362cdea03eefc54d14567c83a0bb44a4dc5ad 129967: 5013944851e1ea03644e266bc6d4e4ce7fa004ff v: v3 --- [refs] | 2 +- trunk/arch/x86/mm/iomap_32.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 0a74292858dd..7e82ebcee37e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e1b4d1143651fb3838be1117785b6e0386fa151f +refs/heads/master: ef5fa0ab24b87646c7bc98645acbb4b51fc2acd4 diff --git a/trunk/arch/x86/mm/iomap_32.c b/trunk/arch/x86/mm/iomap_32.c index d0151d8ce452..ca53224fc56c 100644 --- a/trunk/arch/x86/mm/iomap_32.c +++ b/trunk/arch/x86/mm/iomap_32.c @@ -17,6 +17,7 @@ */ #include +#include #include /* Map 'pfn' using fixed map 'type' and protections 'prot' @@ -29,6 +30,15 @@ iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot) pagefault_disable(); + /* + * For non-PAT systems, promote PAGE_KERNEL_WC to PAGE_KERNEL_UC_MINUS. + * PAGE_KERNEL_WC maps to PWT, which translates to uncached if the + * MTRR is UC or WC. UC_MINUS gets the real intention, of the + * user, which is "WC if the MTRR is WC, UC if you can't do that." + */ + if (!pat_enabled && pgprot_val(prot) == pgprot_val(PAGE_KERNEL_WC)) + prot = PAGE_KERNEL_UC_MINUS; + idx = type + KM_TYPE_NR*smp_processor_id(); vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); set_pte(kmap_pte-idx, pfn_pte(pfn, prot));