x86/mm: Remove set_kernel_text_r[ow]()
authorPeter Zijlstra <peterz@infradead.org>
Mon, 2 Sep 2019 08:16:12 +0000 (10:16 +0200)
committerIngo Molnar <mingo@kernel.org>
Wed, 27 Nov 2019 06:44:24 +0000 (07:44 +0100)
With the last and only user of these functions gone (ftrace) remove
them as well to avoid ever growing new users.

Tested-by: Alexei Starovoitov <ast@kernel.org>
Tested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20191111132457.819095320@infradead.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/include/asm/set_memory.h
arch/x86/mm/init_32.c
arch/x86/mm/init_64.c

index 2ee8e469dcf5ce88845aca1cb62385b6df4a6dfd..64c3dce374e5aa206ac4e09ef384896c1bac3b50 100644 (file)
@@ -81,8 +81,6 @@ int set_direct_map_invalid_noflush(struct page *page);
 int set_direct_map_default_noflush(struct page *page);
 
 extern int kernel_set_to_readonly;
-void set_kernel_text_rw(void);
-void set_kernel_text_ro(void);
 
 #ifdef CONFIG_X86_64
 static inline int set_mce_nospec(unsigned long pfn)
index 930edeb41ec33417755d38293f85ad1717cdee90..e9f239e25bb0debdefd9ea35c07aa958a92c699c 100644 (file)
@@ -874,34 +874,6 @@ void arch_remove_memory(int nid, u64 start, u64 size,
 
 int kernel_set_to_readonly __read_mostly;
 
-void set_kernel_text_rw(void)
-{
-       unsigned long start = PFN_ALIGN(_text);
-       unsigned long size = PFN_ALIGN(_etext) - start;
-
-       if (!kernel_set_to_readonly)
-               return;
-
-       pr_debug("Set kernel text: %lx - %lx for read write\n",
-                start, start+size);
-
-       set_pages_rw(virt_to_page(start), size >> PAGE_SHIFT);
-}
-
-void set_kernel_text_ro(void)
-{
-       unsigned long start = PFN_ALIGN(_text);
-       unsigned long size = PFN_ALIGN(_etext) - start;
-
-       if (!kernel_set_to_readonly)
-               return;
-
-       pr_debug("Set kernel text: %lx - %lx for read only\n",
-                start, start+size);
-
-       set_pages_ro(virt_to_page(start), size >> PAGE_SHIFT);
-}
-
 static void mark_nxdata_nx(void)
 {
        /*
index dcb9bc961b39c3e2928eb4d15f681c8dad29591e..b326f144021939f7216ede302db393c986cc18ea 100644 (file)
@@ -1260,42 +1260,6 @@ void __init mem_init(void)
 
 int kernel_set_to_readonly;
 
-void set_kernel_text_rw(void)
-{
-       unsigned long start = PFN_ALIGN(_text);
-       unsigned long end = PFN_ALIGN(_etext);
-
-       if (!kernel_set_to_readonly)
-               return;
-
-       pr_debug("Set kernel text: %lx - %lx for read write\n",
-                start, end);
-
-       /*
-        * Make the kernel identity mapping for text RW. Kernel text
-        * mapping will always be RO. Refer to the comment in
-        * static_protections() in pageattr.c
-        */
-       set_memory_rw(start, (end - start) >> PAGE_SHIFT);
-}
-
-void set_kernel_text_ro(void)
-{
-       unsigned long start = PFN_ALIGN(_text);
-       unsigned long end = PFN_ALIGN(_etext);
-
-       if (!kernel_set_to_readonly)
-               return;
-
-       pr_debug("Set kernel text: %lx - %lx for read only\n",
-                start, end);
-
-       /*
-        * Set the kernel identity mapping for text RO.
-        */
-       set_memory_ro(start, (end - start) >> PAGE_SHIFT);
-}
-
 void mark_rodata_ro(void)
 {
        unsigned long start = PFN_ALIGN(_text);