qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tcg/mips: mips sync* encode error


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] tcg/mips: mips sync* encode error
Date: Sun, 12 Apr 2020 19:25:06 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

On 4/11/20 2:46 PM, lixinyu wrote:
> OPC_SYNC_WMB, OPC_SYNC_MB, OPC_SYNC_ACQUIRE, OPC_SYNC_RELEASE and
> OPC_SYNC_RMB have wrong encode. According to the mips manual,
> their encode should be 'OPC_SYNC | 0x?? << 6' rather than
> 'OPC_SYNC | 0x?? << 5'. Wrong encode can lead illegal instruction
> errors. These instructions often appear with multi-threaded
> simulation.
> 

Fixes: 6f0b99104a3

> Signed-off-by: lixinyu <address@hidden>

Reviewed-by: Philippe Mathieu-Daudé <address@hidden>

> ---
>  tcg/mips/tcg-target.inc.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/tcg/mips/tcg-target.inc.c b/tcg/mips/tcg-target.inc.c
> index 1da663ce84..4d32ebc1df 100644
> --- a/tcg/mips/tcg-target.inc.c
> +++ b/tcg/mips/tcg-target.inc.c
> @@ -404,11 +404,11 @@ typedef enum {
>  
>      /* MIPS r6 introduced names for weaker variants of SYNC.  These are
>         backward compatible to previous architecture revisions.  */
> -    OPC_SYNC_WMB     = OPC_SYNC | 0x04 << 5,
> -    OPC_SYNC_MB      = OPC_SYNC | 0x10 << 5,
> -    OPC_SYNC_ACQUIRE = OPC_SYNC | 0x11 << 5,
> -    OPC_SYNC_RELEASE = OPC_SYNC | 0x12 << 5,
> -    OPC_SYNC_RMB     = OPC_SYNC | 0x13 << 5,
> +    OPC_SYNC_WMB     = OPC_SYNC | 0x04 << 6,
> +    OPC_SYNC_MB      = OPC_SYNC | 0x10 << 6,
> +    OPC_SYNC_ACQUIRE = OPC_SYNC | 0x11 << 6,
> +    OPC_SYNC_RELEASE = OPC_SYNC | 0x12 << 6,
> +    OPC_SYNC_RMB     = OPC_SYNC | 0x13 << 6,
>  
>      /* Aliases for convenience.  */
>      ALIAS_PADD     = sizeof(void *) == 4 ? OPC_ADDU : OPC_DADDU,
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]