* [Qemu-devel] [PATCH] exec.c: Fix calculation of code_gen_buffer_max_size
@ 2011-06-22 10:58 Peter Maydell
2011-07-06 11:07 ` Peter Maydell
0 siblings, 1 reply; 3+ messages in thread
From: Peter Maydell @ 2011-06-22 10:58 UTC (permalink / raw)
To: qemu-devel; +Cc: patches
When calculating the point at which we should not try to put another
TB into the code gen buffer, we have to allow not just for OPC_MAX_SIZE
but OPC_BUF_SIZE. This is because the target translate.c will only
stop when an instruction has put it past the OPC_MAX_SIZE limit, so
we have to include the MAX_OP_PER_INSTR margin which that final insn
might have used.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
exec.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/exec.c b/exec.c
index 09928a3..c910840 100644
--- a/exec.c
+++ b/exec.c
@@ -555,8 +555,8 @@ static void code_gen_alloc(unsigned long tb_size)
#endif
#endif /* !USE_STATIC_CODE_GEN_BUFFER */
map_exec(code_gen_prologue, sizeof(code_gen_prologue));
- code_gen_buffer_max_size = code_gen_buffer_size -
- (TCG_MAX_OP_SIZE * OPC_MAX_SIZE);
+ code_gen_buffer_max_size = code_gen_buffer_size -
+ (TCG_MAX_OP_SIZE * OPC_BUF_SIZE);
code_gen_max_blocks = code_gen_buffer_size / CODE_GEN_AVG_BLOCK_SIZE;
tbs = qemu_malloc(code_gen_max_blocks * sizeof(TranslationBlock));
}
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] exec.c: Fix calculation of code_gen_buffer_max_size
2011-06-22 10:58 [Qemu-devel] [PATCH] exec.c: Fix calculation of code_gen_buffer_max_size Peter Maydell
@ 2011-07-06 11:07 ` Peter Maydell
2011-07-12 20:52 ` Blue Swirl
0 siblings, 1 reply; 3+ messages in thread
From: Peter Maydell @ 2011-07-06 11:07 UTC (permalink / raw)
To: qemu-devel; +Cc: patches
Ping?
On 22 June 2011 11:58, Peter Maydell <peter.maydell@linaro.org> wrote:
> When calculating the point at which we should not try to put another
> TB into the code gen buffer, we have to allow not just for OPC_MAX_SIZE
> but OPC_BUF_SIZE. This is because the target translate.c will only
> stop when an instruction has put it past the OPC_MAX_SIZE limit, so
> we have to include the MAX_OP_PER_INSTR margin which that final insn
> might have used.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> exec.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/exec.c b/exec.c
> index 09928a3..c910840 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -555,8 +555,8 @@ static void code_gen_alloc(unsigned long tb_size)
> #endif
> #endif /* !USE_STATIC_CODE_GEN_BUFFER */
> map_exec(code_gen_prologue, sizeof(code_gen_prologue));
> - code_gen_buffer_max_size = code_gen_buffer_size -
> - (TCG_MAX_OP_SIZE * OPC_MAX_SIZE);
> + code_gen_buffer_max_size = code_gen_buffer_size -
> + (TCG_MAX_OP_SIZE * OPC_BUF_SIZE);
> code_gen_max_blocks = code_gen_buffer_size / CODE_GEN_AVG_BLOCK_SIZE;
> tbs = qemu_malloc(code_gen_max_blocks * sizeof(TranslationBlock));
> }
> --
> 1.7.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] exec.c: Fix calculation of code_gen_buffer_max_size
2011-07-06 11:07 ` Peter Maydell
@ 2011-07-12 20:52 ` Blue Swirl
0 siblings, 0 replies; 3+ messages in thread
From: Blue Swirl @ 2011-07-12 20:52 UTC (permalink / raw)
To: Peter Maydell; +Cc: qemu-devel, patches
Thanks, applied.
On Wed, Jul 6, 2011 at 2:07 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
> Ping?
>
> On 22 June 2011 11:58, Peter Maydell <peter.maydell@linaro.org> wrote:
>> When calculating the point at which we should not try to put another
>> TB into the code gen buffer, we have to allow not just for OPC_MAX_SIZE
>> but OPC_BUF_SIZE. This is because the target translate.c will only
>> stop when an instruction has put it past the OPC_MAX_SIZE limit, so
>> we have to include the MAX_OP_PER_INSTR margin which that final insn
>> might have used.
>>
>> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>> ---
>> exec.c | 4 ++--
>> 1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/exec.c b/exec.c
>> index 09928a3..c910840 100644
>> --- a/exec.c
>> +++ b/exec.c
>> @@ -555,8 +555,8 @@ static void code_gen_alloc(unsigned long tb_size)
>> #endif
>> #endif /* !USE_STATIC_CODE_GEN_BUFFER */
>> map_exec(code_gen_prologue, sizeof(code_gen_prologue));
>> - code_gen_buffer_max_size = code_gen_buffer_size -
>> - (TCG_MAX_OP_SIZE * OPC_MAX_SIZE);
>> + code_gen_buffer_max_size = code_gen_buffer_size -
>> + (TCG_MAX_OP_SIZE * OPC_BUF_SIZE);
>> code_gen_max_blocks = code_gen_buffer_size / CODE_GEN_AVG_BLOCK_SIZE;
>> tbs = qemu_malloc(code_gen_max_blocks * sizeof(TranslationBlock));
>> }
>> --
>> 1.7.1
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-07-12 20:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-22 10:58 [Qemu-devel] [PATCH] exec.c: Fix calculation of code_gen_buffer_max_size Peter Maydell
2011-07-06 11:07 ` Peter Maydell
2011-07-12 20:52 ` Blue Swirl
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.