diff options
author | Toshi Kani <toshi.kani@hp.com> | 2015-06-04 12:55:18 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-06-07 09:28:58 -0400 |
commit | d1b4bfbfac32da43bfc8425be1c4303548e20527 (patch) | |
tree | f8bbcc332d8f88c8e4b739da4f7b6ab3b31ee8c8 | |
parent | c7c95f19f37976731efca9576f6e4a22067798a2 (diff) |
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>
-rw-r--r-- | arch/x86/include/asm/pgtable_types.h | 3 | ||||
-rw-r--r-- | arch/x86/mm/pat.c | 7 | ||||
-rw-r--r-- | include/asm-generic/pgtable.h | 4 |
3 files changed, 14 insertions, 0 deletions
diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h index 78f0c8cbe316..13f310bfc09a 100644 --- a/arch/x86/include/asm/pgtable_types.h +++ b/arch/x86/include/asm/pgtable_types.h | |||
@@ -367,6 +367,9 @@ extern int nx_enabled; | |||
367 | #define pgprot_writecombine pgprot_writecombine | 367 | #define pgprot_writecombine pgprot_writecombine |
368 | extern pgprot_t pgprot_writecombine(pgprot_t prot); | 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 | /* Indicate that x86 has its own track and untrack pfn vma functions */ | 373 | /* Indicate that x86 has its own track and untrack pfn vma functions */ |
371 | #define __HAVE_PFNMAP_TRACKING | 374 | #define __HAVE_PFNMAP_TRACKING |
372 | 375 | ||
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index 6311193fd1a2..076187c76d7a 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c | |||
@@ -1000,6 +1000,13 @@ pgprot_t pgprot_writecombine(pgprot_t prot) | |||
1000 | } | 1000 | } |
1001 | EXPORT_SYMBOL_GPL(pgprot_writecombine); | 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 | #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_X86_PAT) | 1010 | #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_X86_PAT) |
1004 | 1011 | ||
1005 | static struct memtype *memtype_get_idx(loff_t pos) | 1012 | static struct memtype *memtype_get_idx(loff_t pos) |
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 39f1d6a2b04d..bd910ceaccfa 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -262,6 +262,10 @@ static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b) | |||
262 | #define pgprot_writecombine pgprot_noncached | 262 | #define pgprot_writecombine pgprot_noncached |
263 | #endif | 263 | #endif |
264 | 264 | ||
265 | #ifndef pgprot_writethrough | ||
266 | #define pgprot_writethrough pgprot_noncached | ||
267 | #endif | ||
268 | |||
265 | #ifndef pgprot_device | 269 | #ifndef pgprot_device |
266 | #define pgprot_device pgprot_noncached | 270 | #define pgprot_device pgprot_noncached |
267 | #endif | 271 | #endif |