Patchwork [13/13] tcg: Fix !USE_DIRECT_JUMP

login
register
mail settings
Submitter Richard Henderson
Date Sept. 17, 2012, 3:28 p.m.
Message ID <1347895732-22212-14-git-send-email-rth@twiddle.net>
Download mbox | patch
Permalink /patch/184473/
State New
Headers show

Comments

Richard Henderson - Sept. 17, 2012, 3:28 p.m.
Commit 6375e09e changed the type of TranslationBlock.tb_next,
but failed to change the type of TCGContext.tb_next.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 tcg/tcg.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Andreas Färber - Sept. 17, 2012, 3:50 p.m.
Am 17.09.2012 17:28, schrieb Richard Henderson:
> Commit 6375e09e changed the type of TranslationBlock.tb_next,
> but failed to change the type of TCGContext.tb_next.
> 
> Signed-off-by: Richard Henderson <rth@twiddle.net>

Reviewed-by: Andreas Färber <afaerber@suse.de>

/-F

> ---
>  tcg/tcg.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tcg/tcg.h b/tcg/tcg.h
> index 7a72729..21016ec 100644
> --- a/tcg/tcg.h
> +++ b/tcg/tcg.h
> @@ -343,7 +343,7 @@ struct TCGContext {
>  
>      /* goto_tb support */
>      uint8_t *code_buf;
> -    unsigned long *tb_next;
> +    uintptr_t *tb_next;
>      uint16_t *tb_next_offset;
>      uint16_t *tb_jmp_offset; /* != NULL if USE_DIRECT_JUMP */
>
Aurelien Jarno - Sept. 21, 2012, 10:28 a.m.
On Mon, Sep 17, 2012 at 08:28:52AM -0700, Richard Henderson wrote:
> Commit 6375e09e changed the type of TranslationBlock.tb_next,
> but failed to change the type of TCGContext.tb_next.
> 
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
>  tcg/tcg.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tcg/tcg.h b/tcg/tcg.h
> index 7a72729..21016ec 100644
> --- a/tcg/tcg.h
> +++ b/tcg/tcg.h
> @@ -343,7 +343,7 @@ struct TCGContext {
>  
>      /* goto_tb support */
>      uint8_t *code_buf;
> -    unsigned long *tb_next;
> +    uintptr_t *tb_next;
>      uint16_t *tb_next_offset;
>      uint16_t *tb_jmp_offset; /* != NULL if USE_DIRECT_JUMP */
>  

Not directly sparc related, and definitely correct.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno - Sept. 21, 2012, 6:16 p.m.
On Mon, Sep 17, 2012 at 08:28:52AM -0700, Richard Henderson wrote:
> Commit 6375e09e changed the type of TranslationBlock.tb_next,
> but failed to change the type of TCGContext.tb_next.
> 
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
>  tcg/tcg.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tcg/tcg.h b/tcg/tcg.h
> index 7a72729..21016ec 100644
> --- a/tcg/tcg.h
> +++ b/tcg/tcg.h
> @@ -343,7 +343,7 @@ struct TCGContext {
>  
>      /* goto_tb support */
>      uint8_t *code_buf;
> -    unsigned long *tb_next;
> +    uintptr_t *tb_next;
>      uint16_t *tb_next_offset;
>      uint16_t *tb_jmp_offset; /* != NULL if USE_DIRECT_JUMP */
>  

I have applied this patch, given it's not directly SPARC related, and
fixes the problem for other hosts too.
Stefan Weil - Sept. 21, 2012, 8:21 p.m.
Am 17.09.2012 17:50, schrieb Andreas Färber:
> Am 17.09.2012 17:28, schrieb Richard Henderson:
>> Commit 6375e09e changed the type of TranslationBlock.tb_next,
>> but failed to change the type of TCGContext.tb_next.
>>
>> Signed-off-by: Richard Henderson<rth@twiddle.net>
>
> Reviewed-by: Andreas Färber<afaerber@suse.de>
>
> /-F
>
>> ---
>>   tcg/tcg.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tcg/tcg.h b/tcg/tcg.h
>> index 7a72729..21016ec 100644
>> --- a/tcg/tcg.h
>> +++ b/tcg/tcg.h
>> @@ -343,7 +343,7 @@ struct TCGContext {
>>
>>       /* goto_tb support */
>>       uint8_t *code_buf;
>> -    unsigned long *tb_next;
>> +    uintptr_t *tb_next;
>>       uint16_t *tb_next_offset;
>>       uint16_t *tb_jmp_offset; /* != NULL if USE_DIRECT_JUMP */

Thanks for fixing and reviewing this issue.

I expect problems caused by the wrong old code for w64 hosts
when QEMU is run with more than 4 GiB (that's a rare scenario
because it is much slower than QEMU with kvm on Linux).

All UNIX/Linux based hosts and also w32 hosts are unharmed.

Nevertheless I suggest to apply the patch to QEMU 1.2 as well.

Regards

Stefan Weil

Patch

diff --git a/tcg/tcg.h b/tcg/tcg.h
index 7a72729..21016ec 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -343,7 +343,7 @@  struct TCGContext {
 
     /* goto_tb support */
     uint8_t *code_buf;
-    unsigned long *tb_next;
+    uintptr_t *tb_next;
     uint16_t *tb_next_offset;
     uint16_t *tb_jmp_offset; /* != NULL if USE_DIRECT_JUMP */