diff options
author | Andi Kleen <ak@suse.de> | 2007-07-22 05:12:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-22 14:03:37 -0400 |
commit | 19d36ccdc34f5ed444f8a6af0cbfdb6790eb1177 (patch) | |
tree | 39942efb826f2793692da60b04fc0e7b015fa23d /include/asm-x86_64 | |
parent | f51c94528a9bc73504928926ca4d791a2b7ddd7c (diff) |
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 <jbeulich@novell.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Mathieu Desnoyers <compudj@krystal.dyndns.org>
Cc: Zach Amsden <zach@vmware.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-x86_64')
-rw-r--r-- | include/asm-x86_64/alternative.h | 2 | ||||
-rw-r--r-- | include/asm-x86_64/pgtable.h | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/include/asm-x86_64/alternative.h b/include/asm-x86_64/alternative.h index eea7aecfac78..ab161e810151 100644 --- a/include/asm-x86_64/alternative.h +++ b/include/asm-x86_64/alternative.h | |||
@@ -154,4 +154,6 @@ apply_paravirt(struct paravirt_patch *start, struct paravirt_patch *end) | |||
154 | #define __parainstructions_end NULL | 154 | #define __parainstructions_end NULL |
155 | #endif | 155 | #endif |
156 | 156 | ||
157 | extern void text_poke(void *addr, unsigned char *opcode, int len); | ||
158 | |||
157 | #endif /* _X86_64_ALTERNATIVE_H */ | 159 | #endif /* _X86_64_ALTERNATIVE_H */ |
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h index 60cff1e4f7a3..c9d8764c89d1 100644 --- a/include/asm-x86_64/pgtable.h +++ b/include/asm-x86_64/pgtable.h | |||
@@ -403,6 +403,8 @@ extern struct list_head pgd_list; | |||
403 | 403 | ||
404 | extern int kern_addr_valid(unsigned long addr); | 404 | extern int kern_addr_valid(unsigned long addr); |
405 | 405 | ||
406 | pte_t *lookup_address(unsigned long addr); | ||
407 | |||
406 | #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ | 408 | #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ |
407 | remap_pfn_range(vma, vaddr, pfn, size, prot) | 409 | remap_pfn_range(vma, vaddr, pfn, size, prot) |
408 | 410 | ||