Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/mm/pat: Add pgprot_writethrough()

Add pgprot_writethrough() for setting page protection flags to
Write-Through mode.

Signed-off-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Elliott@hp.com
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Luis R. Rodriguez <mcgrof@suse.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: arnd@arndb.de
Cc: hch@lst.de
Cc: hmh@hmh.eng.br
Cc: jgross@suse.com
Cc: konrad.wilk@oracle.com
Cc: linux-mm <linux-mm@kvack.org>
Cc: linux-nvdimm@lists.01.org
Cc: stefan.bader@canonical.com
Cc: yigal@plexistor.com
Link: http://lkml.kernel.org/r/1433436928-31903-11-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Toshi Kani and committed by
Ingo Molnar
d1b4bfbf c7c95f19

+14
+3
arch/x86/include/asm/pgtable_types.h
··· 367 367 #define pgprot_writecombine pgprot_writecombine 368 368 extern pgprot_t pgprot_writecombine(pgprot_t prot); 369 369 370 + #define pgprot_writethrough pgprot_writethrough 371 + extern pgprot_t pgprot_writethrough(pgprot_t prot); 372 + 370 373 /* Indicate that x86 has its own track and untrack pfn vma functions */ 371 374 #define __HAVE_PFNMAP_TRACKING 372 375
+7
arch/x86/mm/pat.c
··· 1000 1000 } 1001 1001 EXPORT_SYMBOL_GPL(pgprot_writecombine); 1002 1002 1003 + pgprot_t pgprot_writethrough(pgprot_t prot) 1004 + { 1005 + return __pgprot(pgprot_val(prot) | 1006 + cachemode2protval(_PAGE_CACHE_MODE_WT)); 1007 + } 1008 + EXPORT_SYMBOL_GPL(pgprot_writethrough); 1009 + 1003 1010 #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_X86_PAT) 1004 1011 1005 1012 static struct memtype *memtype_get_idx(loff_t pos)
+4
include/asm-generic/pgtable.h
··· 262 262 #define pgprot_writecombine pgprot_noncached 263 263 #endif 264 264 265 + #ifndef pgprot_writethrough 266 + #define pgprot_writethrough pgprot_noncached 267 + #endif 268 + 265 269 #ifndef pgprot_device 266 270 #define pgprot_device pgprot_noncached 267 271 #endif