lkml.org 
[lkml]   [2004]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [3/4] Jumper Probes patch to provide function arguments
From
Date
Prasanna S Panchamukhi <prasanna@in.ibm.com> writes:

+void jprobe_return(void)
+{
+ preempt_enable_no_resched();
+ asm volatile (" xchgl %%ebx,%%esp \n"
+ " int3 \n"::"b"
+ (jprobe_saved_esp):"memory");
+}
whatever the preempt disable is protecting against, why isn't it a
problem during the xchgl ?

> +#define MAX_STACK_SIZE 64
> +#define MIN_STACK_SIZE(ADDR) ((((ADDR) + MAX_STACK_SIZE) < \
> + (((ADDR) & PAGE_MASK) + PAGE_SIZE) ? ((ADDR) + MAX_STACK_SIZE) \
> + : (((ADDR) & PAGE_MASK) + PAGE_SIZE )) - (ADDR))

What is this macro doing exactly?

If it is an attempt to not read beyond the kernel stack top i think
it is wrong. It will also randomly fail on 8k stacks at top-4K

Use something like

max_t(unsigned long,MAX_STACK_SIZE, current_thread_info() + THREAD_SIZE - addr)


The rest looks ok.

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:05    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site