qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] ARM host: fix generated blocks linking
@ 2009-09-21 12:27 Laurent Desnogues
  2009-09-25 15:27 ` Aurelien Jarno
  0 siblings, 1 reply; 3+ messages in thread
From: Laurent Desnogues @ 2009-09-21 12:27 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 198 bytes --]

Hello,

this patch fixes the linking of generated blocks on an ARM host.
No need to say this brings a very nice speedup :-)


Laurent

Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com>

[-- Attachment #2: arm-block-link.patch --]
[-- Type: text/x-patch, Size: 586 bytes --]

diff --git a/exec-all.h b/exec-all.h
index 51519ff..daafc78 100644
--- a/exec-all.h
+++ b/exec-all.h
@@ -208,7 +208,9 @@ static inline void tb_set_jmp_target1(unsigned long jmp_addr, unsigned long addr
 #endif
 
     /* we could use a ldr pc, [pc, #-4] kind of branch and avoid the flush */
-    *(uint32_t *)jmp_addr |= ((addr - (jmp_addr + 8)) >> 2) & 0xffffff;
+    *(uint32_t *)jmp_addr =
+        (*(uint32_t *)jmp_addr & ~0xffffff)
+        | (((addr - (jmp_addr + 8)) >> 2) & 0xffffff);
 
 #if QEMU_GNUC_PREREQ(4, 1)
     __clear_cache((char *) jmp_addr, (char *) jmp_addr + 4);

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

* Re: [Qemu-devel] [PATCH] ARM host: fix generated blocks linking
  2009-09-21 12:27 [Qemu-devel] [PATCH] ARM host: fix generated blocks linking Laurent Desnogues
@ 2009-09-25 15:27 ` Aurelien Jarno
  2009-09-25 15:32   ` Laurent Desnogues
  0 siblings, 1 reply; 3+ messages in thread
From: Aurelien Jarno @ 2009-09-25 15:27 UTC (permalink / raw)
  To: Laurent Desnogues; +Cc: qemu-devel

On Mon, Sep 21, 2009 at 02:27:59PM +0200, Laurent Desnogues wrote:
> Hello,
> 
> this patch fixes the linking of generated blocks on an ARM host.
> No need to say this brings a very nice speedup :-)
> 
>
> Laurent
> 
> Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com>

Thanks, applied. Do you think it also apply to stable?

> diff --git a/exec-all.h b/exec-all.h
> index 51519ff..daafc78 100644
> --- a/exec-all.h
> +++ b/exec-all.h
> @@ -208,7 +208,9 @@ static inline void tb_set_jmp_target1(unsigned long jmp_addr, unsigned long addr
>  #endif
>  
>      /* we could use a ldr pc, [pc, #-4] kind of branch and avoid the flush */
> -    *(uint32_t *)jmp_addr |= ((addr - (jmp_addr + 8)) >> 2) & 0xffffff;
> +    *(uint32_t *)jmp_addr =
> +        (*(uint32_t *)jmp_addr & ~0xffffff)
> +        | (((addr - (jmp_addr + 8)) >> 2) & 0xffffff);
>  
>  #if QEMU_GNUC_PREREQ(4, 1)
>      __clear_cache((char *) jmp_addr, (char *) jmp_addr + 4);


-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

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

* Re: [Qemu-devel] [PATCH] ARM host: fix generated blocks linking
  2009-09-25 15:27 ` Aurelien Jarno
@ 2009-09-25 15:32   ` Laurent Desnogues
  0 siblings, 0 replies; 3+ messages in thread
From: Laurent Desnogues @ 2009-09-25 15:32 UTC (permalink / raw)
  To: Aurelien Jarno; +Cc: qemu-devel

On Fri, Sep 25, 2009 at 5:27 PM, Aurelien Jarno <aurelien@aurel32.net> wrote:
> On Mon, Sep 21, 2009 at 02:27:59PM +0200, Laurent Desnogues wrote:
>> Hello,
>>
>> this patch fixes the linking of generated blocks on an ARM host.
>> No need to say this brings a very nice speedup :-)
>>
>>
>> Laurent
>>
>> Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com>
>
> Thanks, applied. Do you think it also apply to stable?

Well it used to work by accident;  it's fundamentally broken
since it just 'or' some new bits with existing ones (which are
there due to internal relocation).

So I think, it should be applied to stable too.


Laurent

>> diff --git a/exec-all.h b/exec-all.h
>> index 51519ff..daafc78 100644
>> --- a/exec-all.h
>> +++ b/exec-all.h
>> @@ -208,7 +208,9 @@ static inline void tb_set_jmp_target1(unsigned long jmp_addr, unsigned long addr
>>  #endif
>>
>>      /* we could use a ldr pc, [pc, #-4] kind of branch and avoid the flush */
>> -    *(uint32_t *)jmp_addr |= ((addr - (jmp_addr + 8)) >> 2) & 0xffffff;
>> +    *(uint32_t *)jmp_addr =
>> +        (*(uint32_t *)jmp_addr & ~0xffffff)
>> +        | (((addr - (jmp_addr + 8)) >> 2) & 0xffffff);
>>
>>  #if QEMU_GNUC_PREREQ(4, 1)
>>      __clear_cache((char *) jmp_addr, (char *) jmp_addr + 4);
>
>
> --
> Aurelien Jarno                          GPG: 1024D/F1BCDB73
> aurelien@aurel32.net                 http://www.aurel32.net
>

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

end of thread, other threads:[~2009-09-25 15:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-21 12:27 [Qemu-devel] [PATCH] ARM host: fix generated blocks linking Laurent Desnogues
2009-09-25 15:27 ` Aurelien Jarno
2009-09-25 15:32   ` Laurent Desnogues

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