[PULL 02/67] target/ppc: Make divd[u] handler method decodetree compatible

Nicholas Piggin posted 67 patches 2 weeks, 5 days ago
[PULL 02/67] target/ppc: Make divd[u] handler method decodetree compatible
Posted by Nicholas Piggin 2 weeks, 5 days ago
From: Ilya Leoshkevich <iii@linux.ibm.com>

This is like commit 86e6202a57b1 ("target/ppc: Make divw[u] handler
method decodetree compatible."), but for gen_op_arith_divd().

Cc: qemu-stable@nongnu.org
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 target/ppc/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index be93777cf6..47ca50a064 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -1820,7 +1820,7 @@ static inline void gen_op_arith_divd(DisasContext *ctx, TCGv ret,
         tcg_gen_or_tl(cpu_so, cpu_so, cpu_ov);
     }
 
-    if (unlikely(Rc(ctx->opcode) != 0)) {
+    if (unlikely(compute_rc0)) {
         gen_set_Rc0(ctx, ret);
     }
 }
-- 
2.45.2


Re: [PULL 02/67] target/ppc: Make divd[u] handler method decodetree compatible
Posted by Michael Tokarev 2 weeks, 4 days ago
04.11.2024 03:17, Nicholas Piggin wrote:
> From: Ilya Leoshkevich <iii@linux.ibm.com>
> 
> This is like commit 86e6202a57b1 ("target/ppc: Make divw[u] handler
> method decodetree compatible."), but for gen_op_arith_divd().

86e6202a57b1 is v9.0.0-880-g86e6202a57b1, ie, it is in 9.1 only.
So I wonder what should we do for older stable series (namely for
8.2 lts and 9.0), -- should we pick this one together with the
mentioned 86e6202a57b1, or neither?

A separate question is whenever it makes sense to pick these for 7.2?

Thanks,

/mjt

> Cc: qemu-stable@nongnu.org
> Suggested-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
>   target/ppc/translate.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/ppc/translate.c b/target/ppc/translate.c
> index be93777cf6..47ca50a064 100644
> --- a/target/ppc/translate.c
> +++ b/target/ppc/translate.c
> @@ -1820,7 +1820,7 @@ static inline void gen_op_arith_divd(DisasContext *ctx, TCGv ret,
>           tcg_gen_or_tl(cpu_so, cpu_so, cpu_ov);
>       }
>   
> -    if (unlikely(Rc(ctx->opcode) != 0)) {
> +    if (unlikely(compute_rc0)) {
>           gen_set_Rc0(ctx, ret);
>       }
>   }

-- 
GPG Key transition (from rsa2048 to rsa4096) since 2024-04-24.
New key: rsa4096/61AD3D98ECDF2C8E  9D8B E14E 3F2A 9DD7 9199  28F1 61AD 3D98 ECDF 2C8E
Old key: rsa2048/457CE0A0804465C5  6EE1 95D1 886E 8FFB 810D  4324 457C E0A0 8044 65C5
Transition statement: http://www.corpit.ru/mjt/gpg-transition-2024.txt


Re: [PULL 02/67] target/ppc: Make divd[u] handler method decodetree compatible
Posted by Ilya Leoshkevich 2 weeks, 4 days ago
On Tue, 2024-11-05 at 18:33 +0300, Michael Tokarev wrote:
> 04.11.2024 03:17, Nicholas Piggin wrote:
> > From: Ilya Leoshkevich <iii@linux.ibm.com>
> > 
> > This is like commit 86e6202a57b1 ("target/ppc: Make divw[u] handler
> > method decodetree compatible."), but for gen_op_arith_divd().
> 
> 86e6202a57b1 is v9.0.0-880-g86e6202a57b1, ie, it is in 9.1 only.
> So I wonder what should we do for older stable series (namely for
> 8.2 lts and 9.0), -- should we pick this one together with the
> mentioned 86e6202a57b1, or neither?
> 
> A separate question is whenever it makes sense to pick these for 7.2?
> 
> Thanks,
> 
> /mjt

Come to think of it, I would recommend only the previous commit
("target/ppc: Set ctx->opcode for decode_insn32()") for stable. It
solves the whole class of potential problems like this one, and it
should apply to 7.2 as well.

The reason we also have this fix in the pull request is that long-term
the ctx->opcode field will be removed.

[...]
Re: [PULL 02/67] target/ppc: Make divd[u] handler method decodetree compatible
Posted by Michael Tokarev 2 weeks, 4 days ago
05.11.2024 21:01, Ilya Leoshkevich wrote:
> On Tue, 2024-11-05 at 18:33 +0300, Michael Tokarev wrote:
>> 04.11.2024 03:17, Nicholas Piggin wrote:
>>> From: Ilya Leoshkevich <iii@linux.ibm.com>
>>>
>>> This is like commit 86e6202a57b1 ("target/ppc: Make divw[u] handler
>>> method decodetree compatible."), but for gen_op_arith_divd().
...
> Come to think of it, I would recommend only the previous commit
> ("target/ppc: Set ctx->opcode for decode_insn32()") for stable. It
> solves the whole class of potential problems like this one, and it
> should apply to 7.2 as well.

Yes, "Set ctx->opcode for decode_insn32()" applies and works for all
older stable releases.

So I'm not picking up this commit ("Make divd[u] handler method decodetree
compatible") for the stable releases (not even for 9.1), and do not pick
"Make divw[u] handler" either.

The rest from this pull request which are marked for-stable, are picked
up.

> The reason we also have this fix in the pull request is that long-term
> the ctx->opcode field will be removed.

Thank you for the clarification!

/mjt