tcg: Fix MAX_OPC_PARAM_IARGS
PATCH 1/1 tcg: Fix MAX_OPC_PARAM_IARGS
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.
---
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(-)
def-helper.h +2 -0
@@ -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
exec-all.h +1 -1
@@ -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)
Signature · 1 line
1.7.10
Quoted 10 lines · Stefan Weil
DEF_HELPER_FLAGS_5was added some time ago without adjustingMAX_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_6will be added.Signed-off-by Stefan Weil <[email protected]>
r~
Blue Swirl
AppliedThanks, applied.
Quoted 58 lines · Stefan Weil
DEF_HELPER_FLAGS_5was added some time ago without adjustingMAX_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_6will be added.Signed-off-by Stefan Weil <[email protected]>---
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 Weildef-helper.h | 2 ++ exec-all.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-)def-helper.h +2
-0@@ -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 exec-all.h +1
-2@@ -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