All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] target/ppc: Fix TCG leak with the evmwsmiaa instruction
@ 2020-07-27 17:21 Matthieu Bucchianeri
  2020-07-27 17:26 ` Richard Henderson
  2020-07-28  3:53 ` David Gibson
  0 siblings, 2 replies; 3+ messages in thread
From: Matthieu Bucchianeri @ 2020-07-27 17:21 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc, qemu-trivial; +Cc: Matthieu Bucchianeri, david

Fix double-call to tcg_temp_new_i64(), where a temp is allocated both at
declaration time and further down the implementation of gen_evmwsmiaa().

Note that gen_evmwsmia() and gen_evmwsmiaa() are still not implemented
correctly, as they invoke gen_evmwsmi() which may return early, but the
return is not propagated. This will be fixed in my patch for bug #1888918.

Signed-off-by: Matthieu Bucchianeri <matthieu.bucchianeri@leostella.com>
---
 target/ppc/translate/spe-impl.inc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/ppc/translate/spe-impl.inc.c b/target/ppc/translate/spe-impl.inc.c
index 36b4d5654d..42a0d1cffb 100644
--- a/target/ppc/translate/spe-impl.inc.c
+++ b/target/ppc/translate/spe-impl.inc.c
@@ -528,14 +528,14 @@ static inline void gen_evmwsmia(DisasContext *ctx)

     tcg_temp_free_i64(tmp);
 }

 static inline void gen_evmwsmiaa(DisasContext *ctx)
 {
-    TCGv_i64 acc = tcg_temp_new_i64();
-    TCGv_i64 tmp = tcg_temp_new_i64();
+    TCGv_i64 acc;
+    TCGv_i64 tmp;

     gen_evmwsmi(ctx);           /* rD := rA * rB */

     acc = tcg_temp_new_i64();
     tmp = tcg_temp_new_i64();

--
2.17.1

LeoStella, LLC
A joint venture of Thales Alenia Space and Spaceflight Industries

12501 E Marginal Way S • Tukwila, WA 98168

Proprietary Document: This document may contain trade secrets or otherwise proprietary and confidential information owned by LeoStella LLC. It is intended only for the individual addressee and may not be copied, distributed, or otherwise disclosed without LeoStella LLC express prior written authorization.
Export Controlled: This document may contain technical data whose export is restricted by the Arms Export Control Act (Title 22, U.S.C., Sec 2751 et seq.) or the Export Administration Act of 1979, as amended, Title 50,U.S.C., app 2401 et seq. Violation of these export laws are subject to severe criminal penalties. Recipient shall not export, re-export, or otherwise transfer or share this document to any foreign person (as defined by U.S. export laws) without advance written authorization from LeoStella LLC.


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] target/ppc: Fix TCG leak with the evmwsmiaa instruction
  2020-07-27 17:21 [PATCH] target/ppc: Fix TCG leak with the evmwsmiaa instruction Matthieu Bucchianeri
@ 2020-07-27 17:26 ` Richard Henderson
  2020-07-28  3:53 ` David Gibson
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2020-07-27 17:26 UTC (permalink / raw)
  To: Matthieu Bucchianeri, qemu-devel, qemu-ppc, qemu-trivial; +Cc: david

On 7/27/20 10:21 AM, Matthieu Bucchianeri wrote:
> Fix double-call to tcg_temp_new_i64(), where a temp is allocated both at
> declaration time and further down the implementation of gen_evmwsmiaa().
> 
> Note that gen_evmwsmia() and gen_evmwsmiaa() are still not implemented
> correctly, as they invoke gen_evmwsmi() which may return early, but the
> return is not propagated. This will be fixed in my patch for bug #1888918.
> 
> Signed-off-by: Matthieu Bucchianeri <matthieu.bucchianeri@leostella.com>
> ---
>  target/ppc/translate/spe-impl.inc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] target/ppc: Fix TCG leak with the evmwsmiaa instruction
  2020-07-27 17:21 [PATCH] target/ppc: Fix TCG leak with the evmwsmiaa instruction Matthieu Bucchianeri
  2020-07-27 17:26 ` Richard Henderson
@ 2020-07-28  3:53 ` David Gibson
  1 sibling, 0 replies; 3+ messages in thread
From: David Gibson @ 2020-07-28  3:53 UTC (permalink / raw)
  To: Matthieu Bucchianeri; +Cc: qemu-trivial, qemu-ppc, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1764 bytes --]

On Mon, Jul 27, 2020 at 10:21:14AM -0700, Matthieu Bucchianeri wrote:
> Fix double-call to tcg_temp_new_i64(), where a temp is allocated both at
> declaration time and further down the implementation of gen_evmwsmiaa().
> 
> Note that gen_evmwsmia() and gen_evmwsmiaa() are still not implemented
> correctly, as they invoke gen_evmwsmi() which may return early, but the
> return is not propagated. This will be fixed in my patch for bug #1888918.
> 
> Signed-off-by: Matthieu Bucchianeri
> <matthieu.bucchianeri@leostella.com>

Applied to ppc-for-5.1.  Note that since this isn't a regression, it's
not entirely clear it's a good candidate for 5.1 this late in the
freeze.  There's a possibility it will get punted to 5.2, therefore,
but for now I'm staging it for 5.1.

> ---
>  target/ppc/translate/spe-impl.inc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/ppc/translate/spe-impl.inc.c b/target/ppc/translate/spe-impl.inc.c
> index 36b4d5654d..42a0d1cffb 100644
> --- a/target/ppc/translate/spe-impl.inc.c
> +++ b/target/ppc/translate/spe-impl.inc.c
> @@ -528,14 +528,14 @@ static inline void gen_evmwsmia(DisasContext *ctx)
> 
>      tcg_temp_free_i64(tmp);
>  }
> 
>  static inline void gen_evmwsmiaa(DisasContext *ctx)
>  {
> -    TCGv_i64 acc = tcg_temp_new_i64();
> -    TCGv_i64 tmp = tcg_temp_new_i64();
> +    TCGv_i64 acc;
> +    TCGv_i64 tmp;
> 
>      gen_evmwsmi(ctx);           /* rD := rA * rB */
> 
>      acc = tcg_temp_new_i64();
>      tmp = tcg_temp_new_i64();
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-28  3:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-27 17:21 [PATCH] target/ppc: Fix TCG leak with the evmwsmiaa instruction Matthieu Bucchianeri
2020-07-27 17:26 ` Richard Henderson
2020-07-28  3:53 ` David Gibson

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.