mm/memremap: set caching mode for PCI P2PDMA memory to WC

PCI BAR IO memory should never be mapped as WB, however prior to this
the PAT bits were set WB and it was typically overridden by MTRR
registers set by the firmware.

Set PCI P2PDMA memory to be UC as this is what it currently, typically,
ends up being mapped as on x86 after the MTRR registers override the
cache setting.

Future use-cases may need to generalize this by adding flags to select
the caching type, as some P2PDMA cases may not want UC.  However, those
use-cases are not upstream yet and this can be changed when they arrive.

Signed-off-by: Logan Gunthorpe <>
Signed-off-by: Andrew Morton <>
Reviewed-by: Dan Williams <>
Cc: Christoph Hellwig <>
Cc: Jason Gunthorpe <>
Cc: Andy Lutomirski <>
Cc: Benjamin Herrenschmidt <>
Cc: Borislav Petkov <>
Cc: Catalin Marinas <>
Cc: Dave Hansen <>
Cc: David Hildenbrand <>
Cc: Eric Badger <>
Cc: "H. Peter Anvin" <>
Cc: Ingo Molnar <>
Cc: Michael Ellerman <>
Cc: Michal Hocko <>
Cc: Paul Mackerras <>
Cc: Peter Zijlstra <>
Cc: Thomas Gleixner <>
Cc: Will Deacon <>
Signed-off-by: Linus Torvalds <>
1 file changed