From: Michael Ellerman <mpe@ellerman.id.au>
To: Sandipan Das <sandipan@linux.ibm.com>,
"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Cc: ravi.bangoria@linux.ibm.com, ananth@linux.ibm.com,
jniethe5@gmail.com, paulus@samba.org,
linuxppc-dev@lists.ozlabs.org, dja@axtens.net
Subject: Re: [PATCH v2 1/3] powerpc: sstep: Fix load and update emulation
Date: Thu, 04 Feb 2021 11:53:12 +1100 [thread overview]
Message-ID: <87sg6cpsav.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <8e675de3-51df-0711-c90c-f450a1585f65@linux.ibm.com>
Sandipan Das <sandipan@linux.ibm.com> writes:
> On 03/02/21 3:19 pm, Naveen N. Rao wrote:
>> [...]
>>
>> Wouldn't it be easier to just do the below at the end? Or, am I missing something?
>>
>> diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
>> index ede093e9623472..a2d726d2a5e9d1 100644
>> --- a/arch/powerpc/lib/sstep.c
>> +++ b/arch/powerpc/lib/sstep.c
>> @@ -2980,6 +2980,10 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
>> }
>> #endif /* CONFIG_VSX */
>>
>> + if (GETTYPE(op->type) == LOAD && (op->type & UPDATE) &&
>> + (ra == 0 || ra == rd))
>> + goto unknown_opcode;
>> +
>> return 0;
>>
>> logical_done:
>>
>
> This looks good?
>
> diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
> index e96cff845ef7..a9c149bfd2f5 100644
> --- a/arch/powerpc/lib/sstep.c
> +++ b/arch/powerpc/lib/sstep.c
> @@ -3017,6 +3017,21 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
>
> }
>
> + if (op->type & UPDATE) {
> + if (ra == rd && GETTYPE(op->type) == LOAD)
> + goto unknown_opcode;
> + else if (ra == 0)
> + switch(GETTYPE(op->type)) {
> + case LOAD:
> + case STORE:
> +#ifdef CONFIG_PPC_FPU
> + case LOAD_FP:
> + case STORE_FP:
> +#endif
Why make it conditional?
cheers
next prev parent reply other threads:[~2021-02-04 0:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-03 6:38 [PATCH v2 1/3] powerpc: sstep: Fix load and update emulation Sandipan Das
2021-02-03 6:38 ` [PATCH v2 2/3] powerpc: sstep: Fix store " Sandipan Das
2021-02-03 6:38 ` [PATCH v2 3/3] powerpc: sstep: Fix darn emulation Sandipan Das
2021-02-03 9:49 ` [PATCH v2 1/3] powerpc: sstep: Fix load and update emulation Naveen N. Rao
2021-02-03 10:35 ` Sandipan Das
2021-02-03 11:37 ` Sandipan Das
2021-02-04 0:53 ` Michael Ellerman [this message]
2021-02-03 21:17 ` Segher Boessenkool
2021-02-04 8:27 ` Naveen N. Rao
2021-03-02 2:37 ` Segher Boessenkool
2021-03-03 16:31 ` Naveen N. Rao
2021-03-04 15:45 ` Segher Boessenkool
2021-03-04 1:06 ` Naveen N. Rao
2021-02-04 10:29 ` David Laight
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=87sg6cpsav.fsf@mpe.ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=ananth@linux.ibm.com \
--cc=dja@axtens.net \
--cc=jniethe5@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=naveen.n.rao@linux.vnet.ibm.com \
--cc=paulus@samba.org \
--cc=ravi.bangoria@linux.ibm.com \
--cc=sandipan@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).