diff options
author | H. Peter Anvin <hpa@zytor.com> | 2009-03-04 06:05:42 +0100 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-03-04 06:05:42 +0100 |
commit | 2e22ea7cea0f7de86fd30df867fbf5b7e8eee0fd (patch) | |
tree | 8b8e5583fb2787ff7107a6f59b114ddcd2c2f691 /arch/x86/kernel/alternative.c | |
parent | Merge branch 'x86/core' into x86/mce2 (diff) | |
parent | Merge branch 'x86/pat' into x86/core (diff) | |
download | linux-2e22ea7cea0f7de86fd30df867fbf5b7e8eee0fd.tar.xz linux-2e22ea7cea0f7de86fd30df867fbf5b7e8eee0fd.zip |
Merge branch 'x86/core' into x86/mce2
Diffstat (limited to 'arch/x86/kernel/alternative.c')
-rw-r--r-- | arch/x86/kernel/alternative.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 5b8394a3a6b2..4c80f1557433 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -503,12 +503,12 @@ void *text_poke_early(void *addr, const void *opcode, size_t len) */ void *__kprobes text_poke(void *addr, const void *opcode, size_t len) { - unsigned long flags; char *vaddr; int nr_pages = 2; struct page *pages[2]; int i; + might_sleep(); if (!core_kernel_text((unsigned long)addr)) { pages[0] = vmalloc_to_page(addr); pages[1] = vmalloc_to_page(addr + PAGE_SIZE); @@ -522,9 +522,9 @@ void *__kprobes text_poke(void *addr, const void *opcode, size_t len) nr_pages = 1; vaddr = vmap(pages, nr_pages, VM_MAP, PAGE_KERNEL); BUG_ON(!vaddr); - local_irq_save(flags); + local_irq_disable(); memcpy(&vaddr[(unsigned long)addr & ~PAGE_MASK], opcode, len); - local_irq_restore(flags); + local_irq_enable(); vunmap(vaddr); sync_core(); /* Could also do a CLFLUSH here to speed up CPU recovery; but |