qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

tcg: Add support for a helper with 7 arguments

Currently, helpers can only take up to 6 arguments. This patch adds the
capability for up to 7 arguments. I have tested it with the Hexagon port
that I am preparing for submission.

Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
Message-Id: <1580942510-2820-1-git-send-email-tsimpson@quicinc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

authored by

Taylor Simpson and committed by
Richard Henderson
e6cadf49 b55f54bc

+28
+13
include/exec/helper-gen.h
··· 66 66 tcg_gen_callN(HELPER(name), dh_retvar(ret), 6, args); \ 67 67 } 68 68 69 + #define DEF_HELPER_FLAGS_7(name, flags, ret, t1, t2, t3, t4, t5, t6, t7)\ 70 + static inline void glue(gen_helper_, name)(dh_retvar_decl(ret) \ 71 + dh_arg_decl(t1, 1), dh_arg_decl(t2, 2), dh_arg_decl(t3, 3), \ 72 + dh_arg_decl(t4, 4), dh_arg_decl(t5, 5), dh_arg_decl(t6, 6), \ 73 + dh_arg_decl(t7, 7)) \ 74 + { \ 75 + TCGTemp *args[7] = { dh_arg(t1, 1), dh_arg(t2, 2), dh_arg(t3, 3), \ 76 + dh_arg(t4, 4), dh_arg(t5, 5), dh_arg(t6, 6), \ 77 + dh_arg(t7, 7) }; \ 78 + tcg_gen_callN(HELPER(name), dh_retvar(ret), 7, args); \ 79 + } 80 + 69 81 #include "helper.h" 70 82 #include "trace/generated-helpers.h" 71 83 #include "trace/generated-helpers-wrappers.h" ··· 79 91 #undef DEF_HELPER_FLAGS_4 80 92 #undef DEF_HELPER_FLAGS_5 81 93 #undef DEF_HELPER_FLAGS_6 94 + #undef DEF_HELPER_FLAGS_7 82 95 #undef GEN_HELPER 83 96 84 97 #endif /* HELPER_GEN_H */
+2
include/exec/helper-head.h
··· 148 148 DEF_HELPER_FLAGS_5(name, 0, ret, t1, t2, t3, t4, t5) 149 149 #define DEF_HELPER_6(name, ret, t1, t2, t3, t4, t5, t6) \ 150 150 DEF_HELPER_FLAGS_6(name, 0, ret, t1, t2, t3, t4, t5, t6) 151 + #define DEF_HELPER_7(name, ret, t1, t2, t3, t4, t5, t6, t7) \ 152 + DEF_HELPER_FLAGS_7(name, 0, ret, t1, t2, t3, t4, t5, t6, t7) 151 153 152 154 /* MAX_OPC_PARAM_IARGS must be set to n if last entry is DEF_HELPER_FLAGS_n. */ 153 155
+6
include/exec/helper-proto.h
··· 30 30 dh_ctype(ret) HELPER(name) (dh_ctype(t1), dh_ctype(t2), dh_ctype(t3), \ 31 31 dh_ctype(t4), dh_ctype(t5), dh_ctype(t6)); 32 32 33 + #define DEF_HELPER_FLAGS_7(name, flags, ret, t1, t2, t3, t4, t5, t6, t7) \ 34 + dh_ctype(ret) HELPER(name) (dh_ctype(t1), dh_ctype(t2), dh_ctype(t3), \ 35 + dh_ctype(t4), dh_ctype(t5), dh_ctype(t6), \ 36 + dh_ctype(t7)); 37 + 33 38 #include "helper.h" 34 39 #include "trace/generated-helpers.h" 35 40 #include "tcg-runtime.h" ··· 42 47 #undef DEF_HELPER_FLAGS_4 43 48 #undef DEF_HELPER_FLAGS_5 44 49 #undef DEF_HELPER_FLAGS_6 50 + #undef DEF_HELPER_FLAGS_7 45 51 46 52 #endif /* HELPER_PROTO_H */
+7
include/exec/helper-tcg.h
··· 52 52 | dh_sizemask(t2, 2) | dh_sizemask(t3, 3) | dh_sizemask(t4, 4) \ 53 53 | dh_sizemask(t5, 5) | dh_sizemask(t6, 6) }, 54 54 55 + #define DEF_HELPER_FLAGS_7(NAME, FLAGS, ret, t1, t2, t3, t4, t5, t6, t7) \ 56 + { .func = HELPER(NAME), .name = str(NAME), .flags = FLAGS, \ 57 + .sizemask = dh_sizemask(ret, 0) | dh_sizemask(t1, 1) \ 58 + | dh_sizemask(t2, 2) | dh_sizemask(t3, 3) | dh_sizemask(t4, 4) \ 59 + | dh_sizemask(t5, 5) | dh_sizemask(t6, 6) | dh_sizemask(t7, 7) }, 60 + 55 61 #include "helper.h" 56 62 #include "trace/generated-helpers.h" 57 63 #include "tcg-runtime.h" ··· 65 71 #undef DEF_HELPER_FLAGS_4 66 72 #undef DEF_HELPER_FLAGS_5 67 73 #undef DEF_HELPER_FLAGS_6 74 + #undef DEF_HELPER_FLAGS_7 68 75 69 76 #endif /* HELPER_TCG_H */