[kernel] r14238 - in dists/sid/linux-2.6/debian: . patches/bugfix/x86 patches/series
Ben Hutchings
benh at alioth.debian.org
Tue Sep 15 12:46:39 UTC 2009
Author: benh
Date: Tue Sep 15 12:46:37 2009
New Revision: 14238
Log:
x86, pat: Allow ISA memory range uncacheable mapping requests (Closes: #538159)
Added:
dists/sid/linux-2.6/debian/patches/bugfix/x86/x86-pat-allow-isa-memory-uncacheable-mapping.patch
Modified:
dists/sid/linux-2.6/debian/changelog
dists/sid/linux-2.6/debian/patches/series/7
Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog Tue Sep 15 12:23:38 2009 (r14237)
+++ dists/sid/linux-2.6/debian/changelog Tue Sep 15 12:46:37 2009 (r14238)
@@ -16,6 +16,8 @@
(Closes: #515982)
* intel-agp: Fix cache flushing on i8xx chipsets, avoiding graphics
corruption and GPU lock-ups (Closes: #541307)
+ * x86, pat: Allow ISA memory range uncacheable mapping requests
+ (Closes: #538159)
[ Bastian Blank ]
* Add stable release 2.6.30.5.
Added: dists/sid/linux-2.6/debian/patches/bugfix/x86/x86-pat-allow-isa-memory-uncacheable-mapping.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/bugfix/x86/x86-pat-allow-isa-memory-uncacheable-mapping.patch Tue Sep 15 12:46:37 2009 (r14238)
@@ -0,0 +1,85 @@
+From 1adcaafe7414c5731f758b158aa0525057225deb Mon Sep 17 00:00:00 2001
+From: Suresh Siddha <suresh.b.siddha at intel.com>
+Date: Mon, 17 Aug 2009 13:23:50 -0700
+Subject: [PATCH] x86, pat: Allow ISA memory range uncacheable mapping requests
+
+Max Vozeler reported:
+> Bug 13877 - bogl-term broken with CONFIG_X86_PAT=y, works with =n
+>
+> strace of bogl-term:
+> 814 mmap2(NULL, 65536, PROT_READ|PROT_WRITE, MAP_SHARED, 4, 0)
+> = -1 EAGAIN (Resource temporarily unavailable)
+> 814 write(2, "bogl: mmaping /dev/fb0: Resource temporarily unavailable\n",
+> 57) = 57
+
+PAT code maps the ISA memory range as WB in the PAT attribute, so that
+fixed range MTRR registers define the actual memory type (UC/WC/WT etc).
+
+But the upper level is_new_memtype_allowed() API checks are failing,
+as the request here is for UC and the return tracked type is WB (Tracked type is
+WB as MTRR type for this legacy range potentially will be different for each
+4k page).
+
+Fix is_new_memtype_allowed() by always succeeding the ISA address range
+checks, as the null PAT (WB) and def MTRR fixed range register settings
+satisfy the memory type needs of the applications that map the ISA address
+range.
+
+Reported-and-Tested-by: Max Vozeler <xam at debian.org>
+Signed-off-by: Suresh Siddha <suresh.b.siddha at intel.com>
+Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi at intel.com>
+Signed-off-by: H. Peter Anvin <hpa at zytor.com>
+---
+ arch/x86/include/asm/pgtable.h | 12 ++++++++++--
+ arch/x86/mm/pat.c | 3 ++-
+ 2 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
+index 3cc06e3..1674807 100644
+--- a/arch/x86/include/asm/pgtable.h
++++ b/arch/x86/include/asm/pgtable.h
+@@ -2,6 +2,7 @@
+ #define _ASM_X86_PGTABLE_H
+
+ #include <asm/page.h>
++#include <asm/e820.h>
+
+ #include <asm/pgtable_types.h>
+
+@@ -269,10 +270,17 @@ static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot)
+
+ #define canon_pgprot(p) __pgprot(massage_pgprot(p))
+
+-static inline int is_new_memtype_allowed(unsigned long flags,
+- unsigned long new_flags)
++static inline int is_new_memtype_allowed(u64 paddr, unsigned long size,
++ unsigned long flags,
++ unsigned long new_flags)
+ {
+ /*
++ * PAT type is always WB for ISA. So no need to check.
++ */
++ if (is_ISA_range(paddr, paddr + size - 1))
++ return 1;
++
++ /*
+ * Certain new memtypes are not allowed with certain
+ * requested memtype:
+ * - request is uncached, return cannot be write-back
+diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
+index e6718bb..352aa9e 100644
+--- a/arch/x86/mm/pat.c
++++ b/arch/x86/mm/pat.c
+@@ -623,7 +623,8 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot,
+ return ret;
+
+ if (flags != want_flags) {
+- if (strict_prot || !is_new_memtype_allowed(want_flags, flags)) {
++ if (strict_prot ||
++ !is_new_memtype_allowed(paddr, size, want_flags, flags)) {
+ free_memtype(paddr, paddr + size);
+ printk(KERN_ERR "%s:%d map pfn expected mapping type %s"
+ " for %Lx-%Lx, got %s\n",
+--
+1.6.3.3
+
Modified: dists/sid/linux-2.6/debian/patches/series/7
==============================================================================
--- dists/sid/linux-2.6/debian/patches/series/7 Tue Sep 15 12:23:38 2009 (r14237)
+++ dists/sid/linux-2.6/debian/patches/series/7 Tue Sep 15 12:46:37 2009 (r14238)
@@ -17,3 +17,4 @@
+ bugfix/all/sched_rt-fix-overload-bug-on-rt-group-scheduling.patch
+ bugfix/all/stable/2.6.30.5.patch
+ bugfix/all/stable/2.6.30.6.patch
++ bugfix/x86/x86-pat-allow-isa-memory-uncacheable-mapping.patch
More information about the Kernel-svn-changes
mailing list