Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 137001
b: refs/heads/master
c: 34754b6
h: refs/heads/master
i:
  136999: 814618c
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Feb 25, 2009
1 parent 43a6439 commit c8d07b9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 95108fa34a83ffd97e0af959e4b28d7c62008781
refs/heads/master: 34754b69a6f87aa6aa2860525a82f12532f83afd
6 changes: 3 additions & 3 deletions trunk/arch/x86/kernel/alternative.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,12 +498,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);
Expand All @@ -517,9 +517,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
Expand Down
3 changes: 3 additions & 0 deletions trunk/mm/vmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1257,6 +1257,7 @@ EXPORT_SYMBOL(vfree);
void vunmap(const void *addr)
{
BUG_ON(in_interrupt());
might_sleep();
__vunmap(addr, 0);
}
EXPORT_SYMBOL(vunmap);
Expand All @@ -1276,6 +1277,8 @@ void *vmap(struct page **pages, unsigned int count,
{
struct vm_struct *area;

might_sleep();

if (count > num_physpages)
return NULL;

Expand Down

0 comments on commit c8d07b9

Please sign in to comment.