diff options
author | Masami Hiramatsu <mhiramat@redhat.com> | 2009-03-09 12:40:40 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-10 11:24:23 -0400 |
commit | 7cf49427042400d40bdc80b5c3399b6b5945afa8 (patch) | |
tree | a9466accbbe3e8dfea5a7206d735d5281ae0f257 /arch/x86/kernel/alternative.c | |
parent | 12e87e36e0141c08dbc8b2177c93c75fb18ad7e5 (diff) |
x86: expand irq-off region in text_poke()
Expand irq-off region to cover fixmap using code and cache synchronizing.
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
LKML-Reference: <49B54688.8090403@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/alternative.c')
-rw-r--r-- | arch/x86/kernel/alternative.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 2d903b760ddb..f57658702571 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c | |||
@@ -526,13 +526,12 @@ void *__kprobes text_poke(void *addr, const void *opcode, size_t len) | |||
526 | pages[1] = virt_to_page(addr + PAGE_SIZE); | 526 | pages[1] = virt_to_page(addr + PAGE_SIZE); |
527 | } | 527 | } |
528 | BUG_ON(!pages[0]); | 528 | BUG_ON(!pages[0]); |
529 | local_irq_save(flags); | ||
529 | set_fixmap(FIX_TEXT_POKE0, page_to_phys(pages[0])); | 530 | set_fixmap(FIX_TEXT_POKE0, page_to_phys(pages[0])); |
530 | if (pages[1]) | 531 | if (pages[1]) |
531 | set_fixmap(FIX_TEXT_POKE1, page_to_phys(pages[1])); | 532 | set_fixmap(FIX_TEXT_POKE1, page_to_phys(pages[1])); |
532 | vaddr = (char *)fix_to_virt(FIX_TEXT_POKE0); | 533 | vaddr = (char *)fix_to_virt(FIX_TEXT_POKE0); |
533 | local_irq_save(flags); | ||
534 | memcpy(&vaddr[(unsigned long)addr & ~PAGE_MASK], opcode, len); | 534 | memcpy(&vaddr[(unsigned long)addr & ~PAGE_MASK], opcode, len); |
535 | local_irq_restore(flags); | ||
536 | clear_fixmap(FIX_TEXT_POKE0); | 535 | clear_fixmap(FIX_TEXT_POKE0); |
537 | if (pages[1]) | 536 | if (pages[1]) |
538 | clear_fixmap(FIX_TEXT_POKE1); | 537 | clear_fixmap(FIX_TEXT_POKE1); |
@@ -542,5 +541,6 @@ void *__kprobes text_poke(void *addr, const void *opcode, size_t len) | |||
542 | that causes hangs on some VIA CPUs. */ | 541 | that causes hangs on some VIA CPUs. */ |
543 | for (i = 0; i < len; i++) | 542 | for (i = 0; i < len; i++) |
544 | BUG_ON(((char *)addr)[i] != ((char *)opcode)[i]); | 543 | BUG_ON(((char *)addr)[i] != ((char *)opcode)[i]); |
544 | local_irq_restore(flags); | ||
545 | return addr; | 545 | return addr; |
546 | } | 546 | } |