Skip to content

Commit 185be15

Browse files
Christoph HellwigIngo Molnar
authored andcommitted
x86/mm: Remove set_pages_x() and set_pages_nx()
These wrappers don't provide a real benefit over just using set_memory_x() and set_memory_nx(). Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Dave Hansen <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Rik van Riel <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent a919198 commit 185be15

File tree

4 files changed

+3
-21
lines changed

4 files changed

+3
-21
lines changed

arch/x86/include/asm/set_memory.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ int set_pages_array_wb(struct page **pages, int addrinarray);
7575

7676
int set_pages_uc(struct page *page, int numpages);
7777
int set_pages_wb(struct page *page, int numpages);
78-
int set_pages_x(struct page *page, int numpages);
79-
int set_pages_nx(struct page *page, int numpages);
8078
int set_pages_ro(struct page *page, int numpages);
8179
int set_pages_rw(struct page *page, int numpages);
8280

arch/x86/kernel/machine_kexec_32.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ int machine_kexec_prepare(struct kimage *image)
148148
{
149149
int error;
150150

151-
set_pages_x(image->control_code_page, 1);
151+
set_memory_x((unsigned long)page_address(image->control_code_page), 1);
152152
error = machine_kexec_alloc_page_tables(image);
153153
if (error)
154154
return error;
@@ -162,7 +162,7 @@ int machine_kexec_prepare(struct kimage *image)
162162
*/
163163
void machine_kexec_cleanup(struct kimage *image)
164164
{
165-
set_pages_nx(image->control_code_page, 1);
165+
set_memory_nx((unsigned long)page_address(image->control_code_page), 1);
166166
machine_kexec_free_page_tables(image);
167167
}
168168

arch/x86/mm/init_32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ static void mark_nxdata_nx(void)
916916

917917
if (__supported_pte_mask & _PAGE_NX)
918918
printk(KERN_INFO "NX-protecting the kernel data: %luk\n", size >> 10);
919-
set_pages_nx(virt_to_page(start), size >> PAGE_SHIFT);
919+
set_memory_nx(start, size >> PAGE_SHIFT);
920920
}
921921

922922
void mark_rodata_ro(void)

arch/x86/mm/pageattr.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2113,22 +2113,6 @@ int set_pages_array_wb(struct page **pages, int numpages)
21132113
}
21142114
EXPORT_SYMBOL(set_pages_array_wb);
21152115

2116-
int set_pages_x(struct page *page, int numpages)
2117-
{
2118-
unsigned long addr = (unsigned long)page_address(page);
2119-
2120-
return set_memory_x(addr, numpages);
2121-
}
2122-
EXPORT_SYMBOL(set_pages_x);
2123-
2124-
int set_pages_nx(struct page *page, int numpages)
2125-
{
2126-
unsigned long addr = (unsigned long)page_address(page);
2127-
2128-
return set_memory_nx(addr, numpages);
2129-
}
2130-
EXPORT_SYMBOL(set_pages_nx);
2131-
21322116
int set_pages_ro(struct page *page, int numpages)
21332117
{
21342118
unsigned long addr = (unsigned long)page_address(page);

0 commit comments

Comments
 (0)