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

Configure Feed

Select the types of activity you want to include in your feed.

Revert "x86/mm: Remove unused __set_memory_prot()"

This reverts commit 693bbf2a50447353c6a47961e6a7240a823ace02 as kdump LUKS
support (CONFIG_CRASH_DM_CRYPT) depends on __set_memory_prot.

[akpm@linux-foundation.org: x86 set_memory.h needs pgtable_types.h]
Link: https://lkml.kernel.org/r/20250502011246.99238-7-coxu@redhat.com
Signed-off-by: Coiby Xu <coxu@redhat.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: "Daniel P. Berrange" <berrange@redhat.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Jan Pazdziora <jpazdziora@redhat.com>
Cc: Liu Pingfan <kernelfans@gmail.com>
Cc: Milan Broz <gmazyland@gmail.com>
Cc: Ondrej Kozina <okozina@redhat.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Coiby Xu and committed by
Andrew Morton
e1e6cd01 62f17d9d

+15
+2
arch/x86/include/asm/set_memory.h
··· 4 4 5 5 #include <asm/page.h> 6 6 #include <asm-generic/set_memory.h> 7 + #include <asm/pgtable.h> 7 8 8 9 #define set_memory_rox set_memory_rox 9 10 int set_memory_rox(unsigned long addr, int numpages); ··· 38 37 * The caller is required to take care of these. 39 38 */ 40 39 40 + int __set_memory_prot(unsigned long addr, int numpages, pgprot_t prot); 41 41 int _set_memory_uc(unsigned long addr, int numpages); 42 42 int _set_memory_wc(unsigned long addr, int numpages); 43 43 int _set_memory_wt(unsigned long addr, int numpages);
+13
arch/x86/mm/pat/set_memory.c
··· 2148 2148 CPA_PAGES_ARRAY, pages); 2149 2149 } 2150 2150 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 + 2151 2164 int _set_memory_uc(unsigned long addr, int numpages) 2152 2165 { 2153 2166 /*