[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 18/25] tcg: Add TCG_MAX_INSNS
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH v3 18/25] tcg: Add TCG_MAX_INSNS |
Date: |
Thu, 24 Sep 2015 13:43:58 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 |
On 09/24/2015 01:02 PM, Aurelien Jarno wrote:
>> @@ -2903,6 +2903,9 @@ static inline void
>> gen_intermediate_code_internal(AlphaCPU *cpu,
>> if (max_insns == 0) {
>> max_insns = CF_COUNT_MASK;
>> }
>
> I guess you can change also change the value to TCG_MAX_INSNS, though I
> guess the compiler will realize about that.
I did wonder about the best thing to do re CF_COUNT_MASK. Especially as it's
currently set to 0x7fff. FWIW, the largest TB I've seen so far while
collecting statistics is 157 insns. So the current setting of TCG_MAX_INSNS at
512 is more than enough.
>
>> + if (max_insns > TCG_MAX_INSNS) {
>> + max_insns = TCG_MAX_INSNS;
>> + }
>>
>> if (in_superpage(&ctx, pc_start)) {
>> pc_mask = (1ULL << 41) - 1;
>
> Given we have the same pattern in all targets, I do wonder if it
> wouldn't be better to just setup (cflags & CF_COUNT_MASK) to
> TCG_MAX_INSNS instead of 0 in translate-all.c when not using icount.
Yes, that would probably be best.
There should probably be some helper function that handles all these as well as
noticing single-stepping. Too many targets test
(num_insns >= max_insns || singlestep || ...)
when we could just as well set max_insns to 1 and have just the one runtime
test. Then there's all the targets which have a fixed insn size, where we can
pre-compute the number of insns left on the page, and fold in the end-of-page
test as well.
I'll put cleaning this up on the to-do list.
r~
>
> That said your code is correct, so:
>
> Reviewed-by: Aurelien Jarno <address@hidden>
>
- Re: [Qemu-devel] [PATCH v3 13/25] target-sparc: Split out gen_branch_n, (continued)
- [Qemu-devel] [PATCH v3 16/25] tcg: Merge cpu_gen_code into tb_gen_code, Richard Henderson, 2015/09/22
- [Qemu-devel] [PATCH v3 20/25] tcg: Save insn data and use it in cpu_restore_state_from_tb, Richard Henderson, 2015/09/22
- [Qemu-devel] [PATCH v3 19/25] tcg: Pass data argument to restore_state_to_opc, Richard Henderson, 2015/09/22
- [Qemu-devel] [PATCH v3 22/25] tcg: Remove tcg_gen_code_search_pc, Richard Henderson, 2015/09/22
- [Qemu-devel] [PATCH v3 18/25] tcg: Add TCG_MAX_INSNS, Richard Henderson, 2015/09/22
- [Qemu-devel] [PATCH v3 23/25] tcg: Emit prologue to the beginning of code_gen_buffer, Richard Henderson, 2015/09/22
- [Qemu-devel] [PATCH v3 25/25] tcg: Check for overflow via highwater mark, Richard Henderson, 2015/09/22
- [Qemu-devel] [PATCH v3 24/25] tcg: Allocate a guard page after code_gen_buffer, Richard Henderson, 2015/09/22