x86 PAT: return compatible mapping to remap_pfn_range callers
commitcdecff6864a1cd352a41d44a65e7451b8ef5cee2
authorvenkatesh.pallipadi@intel.com <venkatesh.pallipadi@intel.com>
Sat, 10 Jan 2009 00:13:12 +0000 (9 16:13 -0800)
committerIngo Molnar <mingo@elte.hu>
Tue, 13 Jan 2009 18:13:02 +0000 (13 19:13 +0100)
tree1e0e2ab289e757cbd34e6b961cd1b2088e62f3e7
parente4b866ed197cef9989348e0479fed8d864ea465b
x86 PAT: return compatible mapping to remap_pfn_range callers

Impact: avoid warning message, potentially solve 3D performance regression

Change x86 PAT code to return compatible memtype if the exact memtype that
was requested in remap_pfn_rage and friends is not available due to some
conflict.

This is done by returning the compatible type in pgprot parameter of
track_pfn_vma_new(), and the caller uses that memtype for page table.

Note that track_pfn_vma_copy() which is basically called during fork gets the
prot from existing page table and should not have any conflict. Hence we use
strict memtype check there and do not allow compatible memtypes.

This patch fixes the bug reported here:

  http://marc.info/?l=linux-kernel&m=123108883716357&w=2

Specifically the error message:

  X:5010 map pfn expected mapping type write-back for d0000000-d0101000,
  got write-combining

Should go away.

Reported-and-bisected-by: Kevin Winchester <kjwinchester@gmail.com>
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/mm/pat.c