All of lore.kernel.org
 help / color / mirror / Atom feed
From: sshtylyov@mvista.com (Sergei Shtylyov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/6] ARM: kprobes: Fix emulation of SMUAD, SMUSD and SMMUL instructions
Date: Tue, 12 Apr 2011 15:42:52 +0400	[thread overview]
Message-ID: <4DA43ABC.8060105@ru.mvista.com> (raw)
In-Reply-To: <1302590726-3484-6-git-send-email-tixy@yxit.co.uk>

Hello.

On 12-04-2011 10:45, Tixy wrote:

> From: Jon Medhurst<tixy@yxit.co.uk>

> The signed multiply instructions were being decoded incorrectly.

> Signed-off-by: Jon Medhurst <tixy@yxit.co.uk>
> ---
>   arch/arm/kernel/kprobes-decode.c |   22 +++++++++++++++-------
>   1 files changed, 15 insertions(+), 7 deletions(-)

> diff --git a/arch/arm/kernel/kprobes-decode.c b/arch/arm/kernel/kprobes-decode.c
> index 30ba313..915b057 100644
> --- a/arch/arm/kernel/kprobes-decode.c
> +++ b/arch/arm/kernel/kprobes-decode.c
> @@ -1436,18 +1436,26 @@ space_cccc_0111__1(kprobe_opcode_t insn, struct arch_specific_insn *asi)
>   		return prep_emulate_rdhi16rdlo12rs8rm0_wflags(insn, asi);
>
>   	/* SMLAD  : cccc 0111 0000 xxxx xxxx xxxx 00x1 xxxx :Q */
> +	/* SMUAD  : cccc 0111 0000 xxxx 1111 xxxx 00x1 xxxx :Q */
>   	/* SMLSD  : cccc 0111 0000 xxxx xxxx xxxx 01x1 xxxx :Q */
> +	/* SMUSD  : cccc 0111 0000 xxxx 1111 xxxx 01x1 xxxx :  */
>   	/* SMMLA  : cccc 0111 0101 xxxx xxxx xxxx 00x1 xxxx :  */
> -	/* SMMLS  : cccc 0111 0101 xxxx xxxx xxxx 11x1 xxxx :  */
> +	/* SMMUL  : cccc 0111 0101 xxxx 1111 xxxx 00x1 xxxx :  */
>   	if ((insn&  0x0ff00090) == 0x07000010 ||
> -	    (insn&  0x0ff000d0) == 0x07500010 ||
> -	    (insn&  0x0ff000d0) == 0x075000d0)
> +	    (insn&  0x0ff000d0) == 0x07500010) {
> +
> +		if ((insn&  0x0000f000) == 0x0000f000) {
> +			return prep_emulate_rd16rs8rm0_wflags(insn, asi);
> +		} else {
> +			return prep_emulate_rd16rn12rs8rm0_wflags(insn, asi);
> +		}

    Why use {} around the single statements here?

> +	}
> +
> +	/* SMMLS  : cccc 0111 0101 xxxx xxxx xxxx 11x1 xxxx :  */
> +	if ((insn & 0x0ff000d0) == 0x075000d0)
>   		return prep_emulate_rd16rn12rs8rm0_wflags(insn, asi);

    ... but not here. It's at least inconsistent. :-)

WBR, Sergei

  reply	other threads:[~2011-04-12 11:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-12  6:45 [PATCH 0/6] ARM: kprobes: Fixes for ARM instruction emulation (part 4) Tixy
2011-04-12  6:45 ` [PATCH 1/6] ARM: kprobes: Reject probing of LDRB instructions which load PC Tixy
2011-04-12  6:45 ` [PATCH 2/6] ARM: kprobes: Add emulation of RBIT instruction Tixy
2011-04-12  6:45 ` [PATCH 3/6] ARM: kprobes: Reject probing of undefined media instructions Tixy
2011-04-12  6:45 ` [PATCH 4/6] ARM: kprobes: Fix emulation of SXTB16, SXTB, SXTH, UXTB16, UXTB and UXTH instructions Tixy
2011-04-12 11:39   ` Sergei Shtylyov
2011-04-12 15:16     ` Tixy
2011-04-12  6:45 ` [PATCH 5/6] ARM: kprobes: Fix emulation of SMUAD, SMUSD and SMMUL instructions Tixy
2011-04-12 11:42   ` Sergei Shtylyov [this message]
2011-04-12  6:45 ` [PATCH 6/6] ARM: kprobes: Fix emulation of USAD8 instructions Tixy
2011-04-12 19:09 ` [PATCH 0/6] ARM: kprobes: Fixes for ARM instruction emulation (part 4) Nicolas Pitre

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=4DA43ABC.8060105@ru.mvista.com \
    --to=sshtylyov@mvista.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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.