Subject: Re: [PATCH] Emulate more instructions in software

From: Ananth N Mavinakayanahalli <[email-masked]>
Date: Wed, 18 Apr 2007 12:43:49 +0530

On Wed, Apr 18, 2007 at 01:11:00AM -0500, Kumar Gala wrote:
> 
> On Apr 18, 2007, at 12:56 AM, Ananth N Mavinakayanahalli wrote:
> 
> > Emulate a few more instructions in software - especially useful during
> > singlestepping (xmon/kprobes).
> >
> > Instructions emulated with this patch are mfcr/mtcr rX, mfxer/mtxer  
> > rX,
> > mflr/mtlr rX, mfctr/mtctr rX and mr rA,rB.
> >
> >
> > Signed-off-by: Ananth N Mavinakayanahalli <[email-masked]>
> 
> When do we actually need to emulate any of these instructions?  I  
> don't see why single stepping would effect the ability to execute  
> these instructions.

In cases when these instructions are kprobed, it'd be possible to
eliminate the single step exception as we can emulate them.

Most usecases of kprobes are at function entry and in most cases, the
instruction at function entry is mflr r0, which can be emulated. So you
can get rid of one exception and get a nice speedup too. My other patch
did just this.

Ananth