All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@muc.de>
To: prasanna@in.ibm.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [3/4] Jumper Probes patch to provide function arguments
Date: Wed, 11 Aug 2004 18:36:33 +0200	[thread overview]
Message-ID: <m3brhh4ooe.fsf@averell.firstfloor.org> (raw)
In-Reply-To: <2s3ZE-7Zq-29@gated-at.bofh.it> (Prasanna S. Panchamukhi's message of "Wed, 11 Aug 2004 18:20:10 +0200")

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


       reply	other threads:[~2004-08-11 16:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2s3ZE-7Zq-29@gated-at.bofh.it>
2004-08-11 16:36 ` Andi Kleen [this message]
2004-08-12 12:32   ` [3/4] Jumper Probes patch to provide function arguments Prasanna S Panchamukhi
2004-08-11 18:06 ` [3/4] Jumper Probes patch to provide function arguments II Andi Kleen
2004-08-11 16:15 [3/4] Jumper Probes patch to provide function arguments Prasanna S Panchamukhi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3brhh4ooe.fsf@averell.firstfloor.org \
    --to=ak@muc.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=prasanna@in.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.