linux-mips
[Top] [All Lists]

Re: [PATCH 1/3] fixed mtc0_tlbw_hazard

To: yoichi_yuasa@tripeaks.co.jp
Subject: Re: [PATCH 1/3] fixed mtc0_tlbw_hazard
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Fri, 22 Sep 2006 14:16:34 +0900 (JST)
Cc: ralf@linux-mips.org, linux-mips@linux-mips.org
In-reply-to: <20060922010713.657f2861.yoichi_yuasa@tripeaks.co.jp>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20060922010713.657f2861.yoichi_yuasa@tripeaks.co.jp>
Sender: linux-mips-bounce@linux-mips.org
On Fri, 22 Sep 2006 01:07:13 +0900, Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 
wrote:
> Some mtc0_tlbw_hazard() were broken by "[MIPS] Cleanup hazard handling" patch.
...
> Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
> 
> diff -pruN -X mips/Documentation/dontdiff 
> mips-orig/include/asm-mips/hazards.h mips/include/asm-mips/hazards.h
> --- mips-orig/include/asm-mips/hazards.h      2006-09-21 18:21:11.793973750 
> +0900
> +++ mips/include/asm-mips/hazards.h   2006-09-21 18:55:07.569201750 +0900
> @@ -138,7 +138,7 @@ ASMMACRO(back_to_back_c0_hazard,
>   * Mostly like R4000 for historic reasons
>   */
>  ASMMACRO(mtc0_tlbw_hazard,
> -      b      . + 8
> +      nop; nop; nop; nop; nop; nop
>       )
>  ASMMACRO(tlbw_use_hazard,
>        nop; nop; nop; nop; nop; nop
> @@ -169,7 +169,7 @@ ASMMACRO(back_to_back_c0_hazard,
>   * processors.
>   */
>  ASMMACRO(mtc0_tlbw_hazard,
> -      b      . + 8
> +      nop; nop; nop; nop; nop; nop
>       )
>  ASMMACRO(tlbw_use_hazard,
>        nop; nop; nop; nop; nop; nop
> 

The root problem would be new ASMMACRO lacks .set noreorder.

Here is my proposal.


[PATCH] force noreorder in ASMMACRO().

And mtc0_tlbw_hazard and mtc0_tlbw_hazard are adjusted.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>

diff --git a/include/asm-mips/hazards.h b/include/asm-mips/hazards.h
index dabfc0e..52eb0fc 100644
--- a/include/asm-mips/hazards.h
+++ b/include/asm-mips/hazards.h
@@ -12,11 +12,11 @@ #define _ASM_HAZARDS_H
 
 
 #ifdef __ASSEMBLER__
-#define ASMMACRO(name, code...) .macro name; code; .endm
+#define ASMMACRO(name, code...) .macro name; .set push; .set noreorder; code; 
.set pop; .endm
 #else
 
 #define ASMMACRO(name, code...)                                                
\
-__asm__(".macro " #name "; " #code "; .endm");                         \
+__asm__(".macro " #name "; .set push; .set noreorder; " #code "; .set pop; 
.endm");                            \
                                                                        \
 static inline void name(void)                                          \
 {                                                                      \
@@ -138,7 +138,7 @@ #elif defined(CONFIG_CPU_SB1)
  * Mostly like R4000 for historic reasons
  */
 ASMMACRO(mtc0_tlbw_hazard,
-        b      . + 8
+        b      . + 8; nop
        )
 ASMMACRO(tlbw_use_hazard,
         nop; nop; nop; nop; nop; nop
@@ -169,7 +169,7 @@ #else
  * processors.
  */
 ASMMACRO(mtc0_tlbw_hazard,
-        b      . + 8
+        b      . + 8; nop
        )
 ASMMACRO(tlbw_use_hazard,
         nop; nop; nop; nop; nop; nop

<Prev in Thread] Current Thread [Next in Thread>