kernel-hacking-2024-linux-s.../arch/x86/mm
Venki Pallipadi c26421d019 x86: fix Xorg crash with xf86MapVidMem error
Clarify the usage of mtrr_lookup() in PAT code, and to make PAT code
resilient to mtrr lookup problems.

Specifically, pat_x_mtrr_type() is restructured to highlight, under what
conditions we look for mtrr hint. pat_x_mtrr_type() uses a default type
when there are any errors in mtrr lookup (still maintaining the pat
consistency). And, reserve_memtype() highlights its usage ot mtrr_lookup
for request type of '-1' and also defaults in a sane way on any mtrr
lookup failure.

pat.c looks at mtrr type of a range to get a hint on what mapping type
to request when user/API: (1) hasn't specified any type (/dev/mem
mapping) and we do not want to take performance hit by always mapping
UC_MINUS. This will be the case for /dev/mem mappings used to map BIOS
area or ACPI region which are WB'able. In this case, as long as MTRR is
not WB, PAT will request UC_MINUS for such mappings.

(2) user/API requests WB mapping while in reality MTRR may have UC or
WC. In this case, PAT can map as WB (without checking MTRR) and still
effective type will be UC or WC. But, a subsequent request to map same
region as UC or WC may fail, as the region will get trackked as WB in
PAT list. Looking at MTRR hint helps us to track based on effective type
rather than what user requested. Again, here mtrr_lookup is only used as
hint and we fallback to WB mapping (as requested by user) as default.

In both cases, after using the mtrr hint, we still go through the
memtype list to make sure there are no inconsistencies among multiple
users.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Tested-by: Rufus & Azrael <rufus-azrael@numericable.fr>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-06-12 10:03:55 +02:00
..
discontig_32.c x86: undo visws/numaq build changes 2008-05-04 20:04:45 +02:00
dump_pagetables.c "make namespacecheck" fixes 2008-04-24 23:15:44 +02:00
extable.c x86: unify extable_{32|64}.c 2008-01-30 13:31:41 +01:00
fault.c x86: cleanup - rename VM_MASK to X86_VM_MASK 2008-04-17 17:41:33 +02:00
highmem_32.c x86: unexport kmap_atomic_to_page 2008-04-30 23:15:34 +02:00
hugetlbpage.c x86: stricter check in follow_huge_addr() 2008-03-27 16:08:45 +01:00
init_32.c x86: fix app crashes after SMP resume 2008-05-13 19:36:12 +02:00
init_64.c hotplug-memory: make online_page() common 2008-04-28 08:58:17 -07:00
ioremap.c x86: ioremap ram check fix 2008-04-30 23:15:35 +02:00
k8topology_64.c acpi: get boot_cpu_id as early for k8_scan_nodes 2008-04-26 23:41:04 +02:00
Makefile x86: add common mm/pgtable.c 2008-04-24 23:57:30 +02:00
mmap.c x86: unify mmap_{32|64}.c 2008-01-30 13:31:10 +01:00
numa_64.c x86_64: fix setup_node_bootmem to support big mem excluding with memmap 2008-04-26 22:51:08 +02:00
pageattr-test.c x86: remove over noisy debug printk 2008-02-11 11:24:24 -08:00
pageattr.c x86 PAT: fix performance drop for glx, use UC minus for ioremap(), ioremap_nocache() and pci_mmap_page_range() 2008-04-30 23:15:35 +02:00
pat.c x86: fix Xorg crash with xf86MapVidMem error 2008-06-12 10:03:55 +02:00
pgtable.c x86: unify pgd ctor/dtor 2008-04-24 23:57:31 +02:00
pgtable_32.c x86: fix PAE pmd_bad bootup warning 2008-05-06 13:08:58 -07:00
srat_64.c "make namespacecheck" fixes 2008-04-24 23:15:44 +02:00