aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/alternative.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-03-04 00:05:42 -0500
committerH. Peter Anvin <hpa@zytor.com>2009-03-04 00:05:42 -0500
commit2e22ea7cea0f7de86fd30df867fbf5b7e8eee0fd (patch)
tree8b8e5583fb2787ff7107a6f59b114ddcd2c2f691 /arch/x86/kernel/alternative.c
parent638bee71c83a2837b48062fdc5b222163cf53d79 (diff)
parent645af4e9e0e32481e3336dda813688732c7e5f0f (diff)
Merge branch 'x86/core' into x86/mce2
Diffstat (limited to 'arch/x86/kernel/alternative.c')
-rw-r--r--arch/x86/kernel/alternative.c6
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)
503 */ 503 */
504void *__kprobes text_poke(void *addr, const void *opcode, size_t len) 504void *__kprobes text_poke(void *addr, const void *opcode, size_t len)
505{ 505{
506 unsigned long flags;
507 char *vaddr; 506 char *vaddr;
508 int nr_pages = 2; 507 int nr_pages = 2;
509 struct page *pages[2]; 508 struct page *pages[2];
510 int i; 509 int i;
511 510
511 might_sleep();
512 if (!core_kernel_text((unsigned long)addr)) { 512 if (!core_kernel_text((unsigned long)addr)) {
513 pages[0] = vmalloc_to_page(addr); 513 pages[0] = vmalloc_to_page(addr);
514 pages[1] = vmalloc_to_page(addr + PAGE_SIZE); 514 pages[1] = vmalloc_to_page(addr + PAGE_SIZE);
@@ -522,9 +522,9 @@ void *__kprobes text_poke(void *addr, const void *opcode, size_t len)
522 nr_pages = 1; 522 nr_pages = 1;
523 vaddr = vmap(pages, nr_pages, VM_MAP, PAGE_KERNEL); 523 vaddr = vmap(pages, nr_pages, VM_MAP, PAGE_KERNEL);
524 BUG_ON(!vaddr); 524 BUG_ON(!vaddr);
525 local_irq_save(flags); 525 local_irq_disable();
526 memcpy(&vaddr[(unsigned long)addr & ~PAGE_MASK], opcode, len); 526 memcpy(&vaddr[(unsigned long)addr & ~PAGE_MASK], opcode, len);
527 local_irq_restore(flags); 527 local_irq_enable();
528 vunmap(vaddr); 528 vunmap(vaddr);
529 sync_core(); 529 sync_core();
530 /* Could also do a CLFLUSH here to speed up CPU recovery; but 530 /* Could also do a CLFLUSH here to speed up CPU recovery; but