]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
mtrr, mm, x86: enhance MTRR checks for KVA huge page mapping
authorToshi Kani <toshi.kani@hp.com>
Tue, 7 Apr 2015 23:57:08 +0000 (09:57 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 9 Apr 2015 09:07:13 +0000 (19:07 +1000)
commitde7dd16ca4783a1a086628dba6566027a32228b0
tree3590eacb13fb61822b2ce0d47bf39025046aae4a
parentbbff1707d4f9a3fb4740c787a02e4099be175fda
mtrr, mm, x86: enhance MTRR checks for KVA huge page mapping

This patch adds an additional argument, 'uniform', to mtrr_type_lookup(),
which returns 1 when a given range is covered uniformly by MTRRs, i.e.
the range is fully covered by a single MTRR entry or the default type.

pud_set_huge() and pmd_set_huge() are changed to check the new 'uniform'
flag to see if it is safe to create a huge page mapping to the range.
This allows them to create a huge page mapping to a range covered by a
single MTRR entry of any memory type.  It also detects a non-optimal
request properly.  They continue to check with the WB type since the WB
type has no effect even if a request spans multiple MTRR entries.

pmd_set_huge() logs a warning message to a non-optimal request so that
driver writers will be aware of such a case.  Drivers should make a
mapping request aligned to a single MTRR entry when the range is covered
by MTRRs.

Signed-off-by: Toshi Kani <toshi.kani@hp.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Robert Elliott <Elliott@hp.com>
Cc: Paul Bolle <pebolle@tiscali.nl>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/x86/include/asm/mtrr.h
arch/x86/kernel/cpu/mtrr/generic.c
arch/x86/mm/pat.c
arch/x86/mm/pgtable.c