diff options
author | Christoph Hellwig <hch@lst.de> | 2019-08-26 03:55:56 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2019-09-03 03:26:37 -0400 |
commit | 185be15143aa308184310df9fde3d409ca9f83bb (patch) | |
tree | 33ed1563edf4a9cf35f2f268d7b6f218ac35ec3f | |
parent | a919198b97c85e093c81eaae0b4864206ec2fe02 (diff) |
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 <hch@lst.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@surriel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20190826075558.8125-4-hch@lst.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | arch/x86/include/asm/set_memory.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/machine_kexec_32.c | 4 | ||||
-rw-r--r-- | arch/x86/mm/init_32.c | 2 | ||||
-rw-r--r-- | arch/x86/mm/pageattr.c | 16 |
4 files changed, 3 insertions, 21 deletions
diff --git a/arch/x86/include/asm/set_memory.h b/arch/x86/include/asm/set_memory.h index 899ec9ae7cff..fd549c3ebb17 100644 --- a/arch/x86/include/asm/set_memory.h +++ b/arch/x86/include/asm/set_memory.h | |||
@@ -75,8 +75,6 @@ int set_pages_array_wb(struct page **pages, int addrinarray); | |||
75 | 75 | ||
76 | int set_pages_uc(struct page *page, int numpages); | 76 | int set_pages_uc(struct page *page, int numpages); |
77 | int set_pages_wb(struct page *page, int numpages); | 77 | 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); | ||
80 | int set_pages_ro(struct page *page, int numpages); | 78 | int set_pages_ro(struct page *page, int numpages); |
81 | int set_pages_rw(struct page *page, int numpages); | 79 | int set_pages_rw(struct page *page, int numpages); |
82 | 80 | ||
diff --git a/arch/x86/kernel/machine_kexec_32.c b/arch/x86/kernel/machine_kexec_32.c index 77854b192fef..7b45e8daad22 100644 --- a/arch/x86/kernel/machine_kexec_32.c +++ b/arch/x86/kernel/machine_kexec_32.c | |||
@@ -148,7 +148,7 @@ int machine_kexec_prepare(struct kimage *image) | |||
148 | { | 148 | { |
149 | int error; | 149 | int error; |
150 | 150 | ||
151 | set_pages_x(image->control_code_page, 1); | 151 | set_memory_x((unsigned long)page_address(image->control_code_page), 1); |
152 | error = machine_kexec_alloc_page_tables(image); | 152 | error = machine_kexec_alloc_page_tables(image); |
153 | if (error) | 153 | if (error) |
154 | return error; | 154 | return error; |
@@ -162,7 +162,7 @@ int machine_kexec_prepare(struct kimage *image) | |||
162 | */ | 162 | */ |
163 | void machine_kexec_cleanup(struct kimage *image) | 163 | void machine_kexec_cleanup(struct kimage *image) |
164 | { | 164 | { |
165 | set_pages_nx(image->control_code_page, 1); | 165 | set_memory_nx((unsigned long)page_address(image->control_code_page), 1); |
166 | machine_kexec_free_page_tables(image); | 166 | machine_kexec_free_page_tables(image); |
167 | } | 167 | } |
168 | 168 | ||
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index 4068abb9427f..930edeb41ec3 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c | |||
@@ -916,7 +916,7 @@ static void mark_nxdata_nx(void) | |||
916 | 916 | ||
917 | if (__supported_pte_mask & _PAGE_NX) | 917 | if (__supported_pte_mask & _PAGE_NX) |
918 | printk(KERN_INFO "NX-protecting the kernel data: %luk\n", size >> 10); | 918 | 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); |
920 | } | 920 | } |
921 | 921 | ||
922 | void mark_rodata_ro(void) | 922 | void mark_rodata_ro(void) |
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index 1f97a726d09a..d5586a012745 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c | |||
@@ -2113,22 +2113,6 @@ int set_pages_array_wb(struct page **pages, int numpages) | |||
2113 | } | 2113 | } |
2114 | EXPORT_SYMBOL(set_pages_array_wb); | 2114 | EXPORT_SYMBOL(set_pages_array_wb); |
2115 | 2115 | ||
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 | |||
2132 | int set_pages_ro(struct page *page, int numpages) | 2116 | int set_pages_ro(struct page *page, int numpages) |
2133 | { | 2117 | { |
2134 | unsigned long addr = (unsigned long)page_address(page); | 2118 | unsigned long addr = (unsigned long)page_address(page); |