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>
This commit is contained in:
parent
a919198b97
commit
185be15143
|
@ -75,8 +75,6 @@ int set_pages_array_wb(struct page **pages, int addrinarray);
|
||||||
|
|
||||||
int set_pages_uc(struct page *page, int numpages);
|
int set_pages_uc(struct page *page, int numpages);
|
||||||
int set_pages_wb(struct page *page, int numpages);
|
int set_pages_wb(struct page *page, int numpages);
|
||||||
int set_pages_x(struct page *page, int numpages);
|
|
||||||
int set_pages_nx(struct page *page, int numpages);
|
|
||||||
int set_pages_ro(struct page *page, int numpages);
|
int set_pages_ro(struct page *page, int numpages);
|
||||||
int set_pages_rw(struct page *page, int numpages);
|
int set_pages_rw(struct page *page, int numpages);
|
||||||
|
|
||||||
|
|
|
@ -148,7 +148,7 @@ int machine_kexec_prepare(struct kimage *image)
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
set_pages_x(image->control_code_page, 1);
|
set_memory_x((unsigned long)page_address(image->control_code_page), 1);
|
||||||
error = machine_kexec_alloc_page_tables(image);
|
error = machine_kexec_alloc_page_tables(image);
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
|
@ -162,7 +162,7 @@ int machine_kexec_prepare(struct kimage *image)
|
||||||
*/
|
*/
|
||||||
void machine_kexec_cleanup(struct kimage *image)
|
void machine_kexec_cleanup(struct kimage *image)
|
||||||
{
|
{
|
||||||
set_pages_nx(image->control_code_page, 1);
|
set_memory_nx((unsigned long)page_address(image->control_code_page), 1);
|
||||||
machine_kexec_free_page_tables(image);
|
machine_kexec_free_page_tables(image);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -916,7 +916,7 @@ static void mark_nxdata_nx(void)
|
||||||
|
|
||||||
if (__supported_pte_mask & _PAGE_NX)
|
if (__supported_pte_mask & _PAGE_NX)
|
||||||
printk(KERN_INFO "NX-protecting the kernel data: %luk\n", size >> 10);
|
printk(KERN_INFO "NX-protecting the kernel data: %luk\n", size >> 10);
|
||||||
set_pages_nx(virt_to_page(start), size >> PAGE_SHIFT);
|
set_memory_nx(start, size >> PAGE_SHIFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void mark_rodata_ro(void)
|
void mark_rodata_ro(void)
|
||||||
|
|
|
@ -2113,22 +2113,6 @@ int set_pages_array_wb(struct page **pages, int numpages)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(set_pages_array_wb);
|
EXPORT_SYMBOL(set_pages_array_wb);
|
||||||
|
|
||||||
int set_pages_x(struct page *page, int numpages)
|
|
||||||
{
|
|
||||||
unsigned long addr = (unsigned long)page_address(page);
|
|
||||||
|
|
||||||
return set_memory_x(addr, numpages);
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(set_pages_x);
|
|
||||||
|
|
||||||
int set_pages_nx(struct page *page, int numpages)
|
|
||||||
{
|
|
||||||
unsigned long addr = (unsigned long)page_address(page);
|
|
||||||
|
|
||||||
return set_memory_nx(addr, numpages);
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(set_pages_nx);
|
|
||||||
|
|
||||||
int set_pages_ro(struct page *page, int numpages)
|
int set_pages_ro(struct page *page, int numpages)
|
||||||
{
|
{
|
||||||
unsigned long addr = (unsigned long)page_address(page);
|
unsigned long addr = (unsigned long)page_address(page);
|
||||||
|
|
Loading…
Reference in New Issue