qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] tcg: Fix MAX_OPC_PARAM_IARGS
@ 2012-09-12 17:18 Stefan Weil
  2012-09-12 17:22 ` Richard Henderson
  2012-09-15 17:26 ` Blue Swirl
  0 siblings, 2 replies; 3+ messages in thread
From: Stefan Weil @ 2012-09-12 17:18 UTC (permalink / raw)
  To: Blue Swirl; +Cc: Stefan Weil, qemu-devel, qemu-stable

DEF_HELPER_FLAGS_5 was added some time ago without adjusting
MAX_OPC_PARAM_IARGS.

Fixing the definition becomes more important as QEMU is using
an increasing number of helper functions called with 5 arguments.

Add also a comment to avoid future problems when DEF_HELPER_FLAGS_6
will be added.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---

Hi,

I think this patch should be added to the latest stable versions, too.

Please note that this patch breaks compilation with --enable-tcg-interpreter.

TCI code is designed for up to 4 arguments and needs modifications.
The current TCI binaries crash at runtime, so the patch just makes it
obvious that TCI needs to be fixed.

Regards,
Stefan Weil

 def-helper.h |    2 ++
 exec-all.h   |    2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/def-helper.h b/def-helper.h
index b98ff69..022a9ce 100644
--- a/def-helper.h
+++ b/def-helper.h
@@ -128,6 +128,8 @@
 #define DEF_HELPER_5(name, ret, t1, t2, t3, t4, t5) \
     DEF_HELPER_FLAGS_5(name, 0, ret, t1, t2, t3, t4, t5)
 
+/* MAX_OPC_PARAM_IARGS must be set to n if last entry is DEF_HELPER_FLAGS_n. */
+
 #endif /* DEF_HELPER_H */
 
 #ifndef GEN_HELPER
diff --git a/exec-all.h b/exec-all.h
index ac19c02..8977729 100644
--- a/exec-all.h
+++ b/exec-all.h
@@ -51,7 +51,7 @@ typedef struct TranslationBlock TranslationBlock;
 #else
 #define MAX_OPC_PARAM_PER_ARG 1
 #endif
-#define MAX_OPC_PARAM_IARGS 4
+#define MAX_OPC_PARAM_IARGS 5
 #define MAX_OPC_PARAM_OARGS 1
 #define MAX_OPC_PARAM_ARGS (MAX_OPC_PARAM_IARGS + MAX_OPC_PARAM_OARGS)
 
-- 
1.7.10

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

* Re: [Qemu-devel] [PATCH] tcg: Fix MAX_OPC_PARAM_IARGS
  2012-09-12 17:18 [Qemu-devel] [PATCH] tcg: Fix MAX_OPC_PARAM_IARGS Stefan Weil
@ 2012-09-12 17:22 ` Richard Henderson
  2012-09-15 17:26 ` Blue Swirl
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2012-09-12 17:22 UTC (permalink / raw)
  To: Stefan Weil; +Cc: Blue Swirl, qemu-devel, qemu-stable

On 09/12/2012 10:18 AM, Stefan Weil wrote:
> DEF_HELPER_FLAGS_5 was added some time ago without adjusting
> MAX_OPC_PARAM_IARGS.
> 
> Fixing the definition becomes more important as QEMU is using
> an increasing number of helper functions called with 5 arguments.
> 
> Add also a comment to avoid future problems when DEF_HELPER_FLAGS_6
> will be added.
> 
> Signed-off-by: Stefan Weil <sw@weilnetz.de>

Reviewed-by: Richard Henderson <rth@twiddle.net>


r~

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

* Re: [Qemu-devel] [PATCH] tcg: Fix MAX_OPC_PARAM_IARGS
  2012-09-12 17:18 [Qemu-devel] [PATCH] tcg: Fix MAX_OPC_PARAM_IARGS Stefan Weil
  2012-09-12 17:22 ` Richard Henderson
@ 2012-09-15 17:26 ` Blue Swirl
  1 sibling, 0 replies; 3+ messages in thread
From: Blue Swirl @ 2012-09-15 17:26 UTC (permalink / raw)
  To: Stefan Weil; +Cc: qemu-devel, qemu-stable

Thanks, applied.

On Wed, Sep 12, 2012 at 5:18 PM, Stefan Weil <sw@weilnetz.de> wrote:
> DEF_HELPER_FLAGS_5 was added some time ago without adjusting
> MAX_OPC_PARAM_IARGS.
>
> Fixing the definition becomes more important as QEMU is using
> an increasing number of helper functions called with 5 arguments.
>
> Add also a comment to avoid future problems when DEF_HELPER_FLAGS_6
> will be added.
>
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
>
> Hi,
>
> I think this patch should be added to the latest stable versions, too.
>
> Please note that this patch breaks compilation with --enable-tcg-interpreter.
>
> TCI code is designed for up to 4 arguments and needs modifications.
> The current TCI binaries crash at runtime, so the patch just makes it
> obvious that TCI needs to be fixed.
>
> Regards,
> Stefan Weil
>
>  def-helper.h |    2 ++
>  exec-all.h   |    2 +-
>  2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/def-helper.h b/def-helper.h
> index b98ff69..022a9ce 100644
> --- a/def-helper.h
> +++ b/def-helper.h
> @@ -128,6 +128,8 @@
>  #define DEF_HELPER_5(name, ret, t1, t2, t3, t4, t5) \
>      DEF_HELPER_FLAGS_5(name, 0, ret, t1, t2, t3, t4, t5)
>
> +/* MAX_OPC_PARAM_IARGS must be set to n if last entry is DEF_HELPER_FLAGS_n. */
> +
>  #endif /* DEF_HELPER_H */
>
>  #ifndef GEN_HELPER
> diff --git a/exec-all.h b/exec-all.h
> index ac19c02..8977729 100644
> --- a/exec-all.h
> +++ b/exec-all.h
> @@ -51,7 +51,7 @@ typedef struct TranslationBlock TranslationBlock;
>  #else
>  #define MAX_OPC_PARAM_PER_ARG 1
>  #endif
> -#define MAX_OPC_PARAM_IARGS 4
> +#define MAX_OPC_PARAM_IARGS 5
>  #define MAX_OPC_PARAM_OARGS 1
>  #define MAX_OPC_PARAM_ARGS (MAX_OPC_PARAM_IARGS + MAX_OPC_PARAM_OARGS)
>
> --
> 1.7.10
>

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

end of thread, other threads:[~2012-09-15 17:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-12 17:18 [Qemu-devel] [PATCH] tcg: Fix MAX_OPC_PARAM_IARGS Stefan Weil
2012-09-12 17:22 ` Richard Henderson
2012-09-15 17:26 ` Blue Swirl

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).