qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] tcg: improve MAX_CODE_GEN_BUFFER_SIZE for arm
@ 2015-12-08  2:43 TeLeMan
  2015-12-08 10:39 ` Aurelien Jarno
  0 siblings, 1 reply; 5+ messages in thread
From: TeLeMan @ 2015-12-08  2:43 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-devel, Aurelien Jarno

I know MAX_CODE_GEN_BUFFER_SIZE is limited by the host direct branch
instructions.But the arm's MAX_CODE_GEN_BUFFER_SIZE is so small.I
tried improving MAX_CODE_GEN_BUFFER_SIZE.I wrote some check codes for
the overflow offset in tcg_out_b(), tcg_out_bl(),
tcg_out_blx_imm(),reloc_pc24(). But I didn't catch any overflow case
when tb_size and MAX_CODE_GEN_BUFFER_SIZE were larger than 32MB. After
the generated code size was larger than 32MB, qemu crashed.

Any suggest for this issue?

--
SUN OF A BEACH

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

* Re: [Qemu-devel] tcg: improve MAX_CODE_GEN_BUFFER_SIZE for arm
  2015-12-08  2:43 [Qemu-devel] tcg: improve MAX_CODE_GEN_BUFFER_SIZE for arm TeLeMan
@ 2015-12-08 10:39 ` Aurelien Jarno
  2015-12-08 10:51   ` Laurent Desnogues
  0 siblings, 1 reply; 5+ messages in thread
From: Aurelien Jarno @ 2015-12-08 10:39 UTC (permalink / raw)
  To: TeLeMan; +Cc: qemu-devel, Richard Henderson

On 2015-12-08 10:43, TeLeMan wrote:
> I know MAX_CODE_GEN_BUFFER_SIZE is limited by the host direct branch
> instructions.But the arm's MAX_CODE_GEN_BUFFER_SIZE is so small.I
> tried improving MAX_CODE_GEN_BUFFER_SIZE.I wrote some check codes for
> the overflow offset in tcg_out_b(), tcg_out_bl(),
> tcg_out_blx_imm(),reloc_pc24(). But I didn't catch any overflow case
> when tb_size and MAX_CODE_GEN_BUFFER_SIZE were larger than 32MB. After
> the generated code size was larger than 32MB, qemu crashed.

Instrumenting all the tcg_out_* branch related functions do not work
here as the address is actually not known at code generation:

    case INDEX_op_goto_tb:
        if (s->tb_jmp_offset) {
            /* Direct jump method */
            s->tb_jmp_offset[args[0]] = tcg_current_code_size(s);
            tcg_out_b_noaddr(s, COND_AL);

It is patched later during TB linking.

> Any suggest for this issue?

I already posted a patch a long time ago to remove the 16MB limit on ARM
hosts:

http://lists.gnu.org/archive/html/qemu-devel/2012-10/msg01684.html

However as you can see in the thread, it has been rejected as it doesn't
not bring improvement in all cases.

Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net

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

* Re: [Qemu-devel] tcg: improve MAX_CODE_GEN_BUFFER_SIZE for arm
  2015-12-08 10:39 ` Aurelien Jarno
@ 2015-12-08 10:51   ` Laurent Desnogues
  2015-12-08 11:21     ` Aurelien Jarno
  0 siblings, 1 reply; 5+ messages in thread
From: Laurent Desnogues @ 2015-12-08 10:51 UTC (permalink / raw)
  To: Aurelien Jarno; +Cc: TeLeMan, qemu-devel, Richard Henderson

Hello,

On Tue, Dec 8, 2015 at 11:39 AM, Aurelien Jarno <aurelien@aurel32.net> wrote:
[...]
> I already posted a patch a long time ago to remove the 16MB limit on ARM
> hosts:
>
> http://lists.gnu.org/archive/html/qemu-devel/2012-10/msg01684.html
>
> However as you can see in the thread, it has been rejected as it doesn't
> not bring improvement in all cases.

We could perhaps resurrect it and do some more benchmarking?  Who
would be able to do testing on (recent) ARM hardware?


Laurent

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

* Re: [Qemu-devel] tcg: improve MAX_CODE_GEN_BUFFER_SIZE for arm
  2015-12-08 10:51   ` Laurent Desnogues
@ 2015-12-08 11:21     ` Aurelien Jarno
  2015-12-09  1:14       ` TeLeMan
  0 siblings, 1 reply; 5+ messages in thread
From: Aurelien Jarno @ 2015-12-08 11:21 UTC (permalink / raw)
  To: Laurent Desnogues; +Cc: TeLeMan, qemu-devel, Richard Henderson

On 2015-12-08 11:51, Laurent Desnogues wrote:
> Hello,
> 
> On Tue, Dec 8, 2015 at 11:39 AM, Aurelien Jarno <aurelien@aurel32.net> wrote:
> [...]
> > I already posted a patch a long time ago to remove the 16MB limit on ARM
> > hosts:
> >
> > http://lists.gnu.org/archive/html/qemu-devel/2012-10/msg01684.html
> >
> > However as you can see in the thread, it has been rejected as it doesn't
> > not bring improvement in all cases.
> 
> We could perhaps resurrect it and do some more benchmarking?  Who
> would be able to do testing on (recent) ARM hardware?

I can provide an updated patch, but I would prefer if someone else does
the benchmarking on a really recent hardware. Not sure the hardware I
have (cortex A7) is really representative of a modern ARM CPU.

Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net

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

* Re: [Qemu-devel] tcg: improve MAX_CODE_GEN_BUFFER_SIZE for arm
  2015-12-08 11:21     ` Aurelien Jarno
@ 2015-12-09  1:14       ` TeLeMan
  0 siblings, 0 replies; 5+ messages in thread
From: TeLeMan @ 2015-12-09  1:14 UTC (permalink / raw)
  To: Laurent Desnogues, TeLeMan, qemu-devel, Richard Henderson

On Tue, Dec 8, 2015 at 7:21 PM, Aurelien Jarno <aurelien@aurel32.net> wrote:
> On 2015-12-08 11:51, Laurent Desnogues wrote:
>> Hello,
>>
>> On Tue, Dec 8, 2015 at 11:39 AM, Aurelien Jarno <aurelien@aurel32.net> wrote:
>> [...]
>> > I already posted a patch a long time ago to remove the 16MB limit on ARM
>> > hosts:
>> >
>> > http://lists.gnu.org/archive/html/qemu-devel/2012-10/msg01684.html
>> >
>> > However as you can see in the thread, it has been rejected as it doesn't
>> > not bring improvement in all cases.
>>
>> We could perhaps resurrect it and do some more benchmarking?  Who
>> would be able to do testing on (recent) ARM hardware?
>
> I can provide an updated patch, but I would prefer if someone else does
> the benchmarking on a really recent hardware. Not sure the hardware I
> have (cortex A7) is really representative of a modern ARM CPU.

ok,I wait your new patch, thanks. I have arm A7 too.

> Aurelien
>
> --
> Aurelien Jarno                          GPG: 4096R/1DDD8C9B
> aurelien@aurel32.net                 http://www.aurel32.net

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

end of thread, other threads:[~2015-12-09  1:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-08  2:43 [Qemu-devel] tcg: improve MAX_CODE_GEN_BUFFER_SIZE for arm TeLeMan
2015-12-08 10:39 ` Aurelien Jarno
2015-12-08 10:51   ` Laurent Desnogues
2015-12-08 11:21     ` Aurelien Jarno
2015-12-09  1:14       ` TeLeMan

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