2004-09-23 05:31:44

by S. P. Prasanna

[permalink] [raw]
Subject: [Patch] kprobes exception notifier fix 2.6.9-rc2

In order to make other debuggers use exception notifiers, kprobes
notifier return values are required to be modified. This patch modifies the
return values of kprobes notifier return values in a clean way.

Please let me know your comments.

Thanks
Prasanna
--

Prasanna S Panchamukhi
Linux Technology Center
India Software Labs, IBM Bangalore
Ph: 91-80-25044636
<[email protected]>


Attachments:
(No filename) (387.00 B)
kprobes-exceptions-notifier-fix.patch (7.13 kB)
Download all attachments

2004-09-23 08:06:32

by Andi Kleen

[permalink] [raw]
Subject: Re: [Patch] kprobes exception notifier fix 2.6.9-rc2

On Thu, Sep 23, 2004 at 11:00:29AM +0530, Prasanna S Panchamukhi wrote:
> In order to make other debuggers use exception notifiers, kprobes
> notifier return values are required to be modified. This patch modifies the
> return values of kprobes notifier return values in a clean way.

It's incompatible to x86-64. If you change anything in exception
notifiers change both.

And I don't really see the sense of inverting the test: NOTIFY_OK
for handling the exception should be as good as NOTIFY_STOP.

-Andi

2004-09-23 08:43:58

by S. P. Prasanna

[permalink] [raw]
Subject: Re: [Patch] kprobes exception notifier fix 2.6.9-rc2

Hi Andi,

On Thu, Sep 23, 2004 at 10:06:28AM +0200, Andi Kleen wrote:
> On Thu, Sep 23, 2004 at 11:00:29AM +0530, Prasanna S Panchamukhi wrote:
> > In order to make other debuggers use exception notifiers, kprobes
> > notifier return values are required to be modified. This patch modifies the
> > return values of kprobes notifier return values in a clean way.
>
> It's incompatible to x86-64. If you change anything in exception
> notifiers change both.
>

Yes, I will make the changes to x86_64 exception notifiers as well and
send a patch to you.

> And I don't really see the sense of inverting the test: NOTIFY_OK
> for handling the exception should be as good as NOTIFY_STOP.
>

NOTIFY_OK does not stop notifying others registered for the same event.
This was causing problems when Kprobes and KGDB co-exist and KGDB handler
would get involked, when kprobes handler would have already handled its own
breakpoint. NOTIFY_BAD will also work, but returning NOTIFY_BAD would mean
Bad/Veto action. This patch solves the problem by returning NOTIFY_OK | NOTIFY_STOP_MASK in a clean way.

Please let me know your comments.

Thanks
Prasanna

> -Andi

--
Prasanna S Panchamukhi
Linux Technology Center
India Software Labs, IBM Bangalore
Ph: 91-80-25044636
<[email protected]>

2004-09-23 19:34:30

by David Miller

[permalink] [raw]
Subject: Re: [Patch] kprobes exception notifier fix 2.6.9-rc2

On 23 Sep 2004 10:06:28 +0200
Andi Kleen <[email protected]> wrote:

> On Thu, Sep 23, 2004 at 11:00:29AM +0530, Prasanna S Panchamukhi wrote:
> > In order to make other debuggers use exception notifiers, kprobes
> > notifier return values are required to be modified. This patch modifies the
> > return values of kprobes notifier return values in a clean way.
>
> It's incompatible to x86-64. If you change anything in exception
> notifiers change both.

And please change sparc64 as well, as it has the same exception
notification implemented there as well.

2004-09-27 12:10:47

by S. P. Prasanna

[permalink] [raw]
Subject: Re: [Patch] kprobes exception notifier fix 2.6.9-rc2

Hi,

As per Andi and David's request, I have updated exception notifiers for x86_64
and sparc64. This patch can been applied over linux-2.6.9-rc2-mm4.
Also KGDB exception notifier handler for x86_64 and
kprobes notifier handler for sparc64 have been updated.
I have only tested this patch on i386 architecture.

Please let me know if you have any issues.

Thanks
Prasanna

On Thu, Sep 23, 2004 at 12:32:50PM -0700, David S. Miller wrote:
> On 23 Sep 2004 10:06:28 +0200
> Andi Kleen <[email protected]> wrote:
>
> > On Thu, Sep 23, 2004 at 11:00:29AM +0530, Prasanna S Panchamukhi wrote:
> > > In order to make other debuggers use exception notifiers, kprobes
> > > notifier return values are required to be modified. This patch modifies the
> > > return values of kprobes notifier return values in a clean way.
> >
> > It's incompatible to x86-64. If you change anything in exception
> > notifiers change both.
>
> And please change sparc64 as well, as it has the same exception
> notification implemented there as well.

--
Prasanna S Panchamukhi
Linux Technology Center
India Software Labs, IBM Bangalore
Ph: 91-80-25044636
<[email protected]>


Attachments:
(No filename) (1.12 kB)
kprobes-exceptions-notifier-fix.patch (17.74 kB)
Download all attachments