linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm: Omit fixmap calls in text patching code if CONFIG_MMU=n
@ 2015-10-26  7:54 Geert Uytterhoeven
  2015-10-26 17:17 ` Rabin Vincent
  0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2015-10-26  7:54 UTC (permalink / raw)
  To: linux-arm-kernel

If CONFIG_JUMP_LABEL=y and CONFIG_MMU=n:

    arch/arm/kernel/patch.c: In function 'patch_map':
    arch/arm/kernel/patch.c:39:129: error: 'L_PTE_YOUNG' undeclared (first use in this function)
      set_fixmap(fixmap, page_to_phys(page));
																     ^
    arch/arm/kernel/patch.c:39:129: note: each undeclared identifier is reported only once for each function it appears in
    arch/arm/kernel/patch.c:39:143: error: 'L_PTE_PRESENT' undeclared (first use in this function)
      set_fixmap(fixmap, page_to_phys(page));
																		   ^
    arch/arm/kernel/patch.c:39:159: error: 'L_PTE_XN' undeclared (first use in this function)
      set_fixmap(fixmap, page_to_phys(page));
																				   ^
    arch/arm/kernel/patch.c:39:170: error: 'L_PTE_DIRTY' undeclared (first use in this function)
      set_fixmap(fixmap, page_to_phys(page));
																					      ^
    arch/arm/kernel/patch.c:39:185: error: 'L_PTE_MT_WRITEBACK' undeclared (first use in this function)
      set_fixmap(fixmap, page_to_phys(page));
																							     ^

Protect the calls to set_fixmap() and clear_fixmap() by #ifdef
CONFIG_MMU to fix this.

Fixes: commit ab0615e2d6fb0747 ("arm: use fixmap for text patching when text is RO")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
http://kisskb.ellerman.id.au/kisskb/buildresult/12531538/

 arch/arm/kernel/patch.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/kernel/patch.c b/arch/arm/kernel/patch.c
index 69bda1a5707ee826..447b53a68be5bd6f 100644
--- a/arch/arm/kernel/patch.c
+++ b/arch/arm/kernel/patch.c
@@ -36,7 +36,9 @@ static void __kprobes *patch_map(void *addr, int fixmap, unsigned long *flags)
 	else
 		__acquire(&patch_lock);
 
+#ifdef CONFIG_MMU
 	set_fixmap(fixmap, page_to_phys(page));
+#endif
 
 	return (void *) (__fix_to_virt(fixmap) + (uintaddr & ~PAGE_MASK));
 }
@@ -44,7 +46,9 @@ static void __kprobes *patch_map(void *addr, int fixmap, unsigned long *flags)
 static void __kprobes patch_unmap(int fixmap, unsigned long *flags)
 	__releases(&patch_lock)
 {
+#ifdef CONFIG_MMU
 	clear_fixmap(fixmap);
+#endif
 
 	if (flags)
 		spin_unlock_irqrestore(&patch_lock, *flags);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] arm: Omit fixmap calls in text patching code if CONFIG_MMU=n
  2015-10-26  7:54 [PATCH] arm: Omit fixmap calls in text patching code if CONFIG_MMU=n Geert Uytterhoeven
@ 2015-10-26 17:17 ` Rabin Vincent
  0 siblings, 0 replies; 2+ messages in thread
From: Rabin Vincent @ 2015-10-26 17:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Oct 26, 2015 at 08:54:52AM +0100, Geert Uytterhoeven wrote:
> Protect the calls to set_fixmap() and clear_fixmap() by #ifdef >
> CONFIG_MMU to fix this.
> 
> Fixes: commit ab0615e2d6fb0747 ("arm: use fixmap for text patching when text is RO")
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

Since both DEBUG_SET_MODULE_RONX and DEBUG_RODATA depend on MMU, we'll
never get to this code on !MMU so this ifdef build fix should be ok.

Acked-by: Rabin Vincent <rabin@rab.in>

Thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-26 17:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-26  7:54 [PATCH] arm: Omit fixmap calls in text patching code if CONFIG_MMU=n Geert Uytterhoeven
2015-10-26 17:17 ` Rabin Vincent

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).