Skip to content

Commit e1e6cd0

Browse files
coibyakpm00
authored andcommitted
Revert "x86/mm: Remove unused __set_memory_prot()"
This reverts commit 693bbf2 as kdump LUKS support (CONFIG_CRASH_DM_CRYPT) depends on __set_memory_prot. [[email protected]: x86 set_memory.h needs pgtable_types.h] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Coiby Xu <[email protected]> Cc: Baoquan He <[email protected]> Cc: "Daniel P. Berrange" <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Dave Young <[email protected]> Cc: Jan Pazdziora <[email protected]> Cc: Liu Pingfan <[email protected]> Cc: Milan Broz <[email protected]> Cc: Ondrej Kozina <[email protected]> Cc: Vitaly Kuznetsov <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 62f17d9 commit e1e6cd0

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

arch/x86/include/asm/set_memory.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include <asm/page.h>
66
#include <asm-generic/set_memory.h>
7+
#include <asm/pgtable.h>
78

89
#define set_memory_rox set_memory_rox
910
int set_memory_rox(unsigned long addr, int numpages);
@@ -37,6 +38,7 @@ int set_memory_rox(unsigned long addr, int numpages);
3738
* The caller is required to take care of these.
3839
*/
3940

41+
int __set_memory_prot(unsigned long addr, int numpages, pgprot_t prot);
4042
int _set_memory_uc(unsigned long addr, int numpages);
4143
int _set_memory_wc(unsigned long addr, int numpages);
4244
int _set_memory_wt(unsigned long addr, int numpages);

arch/x86/mm/pat/set_memory.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2148,6 +2148,19 @@ static inline int cpa_clear_pages_array(struct page **pages, int numpages,
21482148
CPA_PAGES_ARRAY, pages);
21492149
}
21502150

2151+
/*
2152+
* __set_memory_prot is an internal helper for callers that have been passed
2153+
* a pgprot_t value from upper layers and a reservation has already been taken.
2154+
* If you want to set the pgprot to a specific page protocol, use the
2155+
* set_memory_xx() functions.
2156+
*/
2157+
int __set_memory_prot(unsigned long addr, int numpages, pgprot_t prot)
2158+
{
2159+
return change_page_attr_set_clr(&addr, numpages, prot,
2160+
__pgprot(~pgprot_val(prot)), 0, 0,
2161+
NULL);
2162+
}
2163+
21512164
int _set_memory_uc(unsigned long addr, int numpages)
21522165
{
21532166
/*

0 commit comments

Comments
 (0)