From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Tom Musta <tommusta@gmail.com>
Cc: tmusta@gmail.com, linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH 1/3] powerpc: Enable emulate_step In Little Endian Mode
Date: Wed, 30 Oct 2013 11:13:43 +1100 [thread overview]
Message-ID: <1383092023.5117.40.camel@pasglop> (raw)
In-Reply-To: <1382125235.2206.24.camel@tmusta-sc.rchland.ibm.com>
On Fri, 2013-10-18 at 14:40 -0500, Tom Musta wrote:
> This patch modifies the endian chicken switch in the single step
> emulation code (emulate_step()). The old (big endian) code bailed
> early if a load or store instruction was to be emulated in little
> endian mode.
>
> The new code modifies the check and only bails in a cross-endian
> situation (LE mode in a kernel compiled for BE and vice verse).
I get a malformed patch error, looks like it got wrapped.
Cheers,
Ben.
> Signed-off-by: Tom Musta <tmusta@gmail.com>
> ---
> arch/powerpc/lib/sstep.c | 12 +++++++++---
> 1 files changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
> index b1faa15..5e0d0e9 100644
> --- a/arch/powerpc/lib/sstep.c
> +++ b/arch/powerpc/lib/sstep.c
> @@ -1222,12 +1222,18 @@ int __kprobes emulate_step(struct pt_regs *regs,
> unsigned int instr)
> }
>
> /*
> - * Following cases are for loads and stores, so bail out
> - * if we're in little-endian mode.
> + * Following cases are for loads and stores and this
> + * implementation does not support cross-endian. So
> + * bail out if this is the case.
> */
> +#ifdef __BIG_ENDIAN__
> if (regs->msr & MSR_LE)
> return 0;
> -
> +#endif
> +#ifdef __LITTLE_ENDIAN__
> + if (!regs->msr & MSR_LE)
> + return 0;
> +#endif
> /*
> * Save register RA in case it's an update form load or store
> * and the access faults.
next prev parent reply other threads:[~2013-10-30 2:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-18 19:38 [PATCH 0/3] powerpc: Fix Little Endian Bugs in Single Step Code Tom Musta
2013-10-18 19:40 ` [PATCH 1/3] powerpc: Enable emulate_step In Little Endian Mode Tom Musta
2013-10-30 0:13 ` Benjamin Herrenschmidt [this message]
2013-10-30 17:43 ` Andreas Schwab
2013-10-30 19:35 ` Tom Musta
2013-10-30 19:43 ` Geert Uytterhoeven
2013-10-30 21:45 ` Tom Musta
2013-10-18 19:42 ` [PATCH 2/3] powerpc: Fix Unaligned Loads and Stores Tom Musta
2013-10-18 19:44 ` [PATCH 3/3] powerpc: Fix Unaligned LE Floating Point " Tom Musta
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=1383092023.5117.40.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=tmusta@gmail.com \
--cc=tommusta@gmail.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.