From 19d36ccdc34f5ed444f8a6af0cbfdb6790eb1177 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Sun, 22 Jul 2007 11:12:31 +0200 Subject: x86: Fix alternatives and kprobes to remap write-protected kernel text Reenable kprobes and alternative patching when the kernel text is write protected by DEBUG_RODATA Add a general utility function to change write protected text. The new function remaps the code using vmap to write it and takes care of CPU synchronization. It also does CLFLUSH to make icache recovery faster. There are some limitations on when the function can be used, see the comment. This is a newer version that also changes the paravirt_ops code. text_poke also supports multi byte patching now. Contains bug fixes from Zach Amsden and suggestions from Mathieu Desnoyers. Cc: Jan Beulich Cc: Jeremy Fitzhardinge Cc: Mathieu Desnoyers Cc: Zach Amsden Signed-off-by: Andi Kleen Signed-off-by: Linus Torvalds --- include/asm-i386/alternative.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/asm-i386/alternative.h') diff --git a/include/asm-i386/alternative.h b/include/asm-i386/alternative.h index eb7da5402bf..bda6c810c0f 100644 --- a/include/asm-i386/alternative.h +++ b/include/asm-i386/alternative.h @@ -149,4 +149,6 @@ apply_paravirt(struct paravirt_patch_site *start, #define __parainstructions_end NULL #endif +extern void text_poke(void *addr, unsigned char *opcode, int len); + #endif /* _I386_ALTERNATIVE_H */ -- cgit v1.2.3