Re: [PATCH 1/3] fixed mtc0_tlbw_hazard

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

 



On Fri, 22 Sep 2006 01:07:13 +0900, Yoichi Yuasa <yoichi_yuasa@xxxxxxxxxxxxxx> wrote:
> Some mtc0_tlbw_hazard() were broken by "[MIPS] Cleanup hazard handling" patch.
...
> Signed-off-by: Yoichi Yuasa <yoichi_yuasa@xxxxxxxxxxxxxx>
> 
> 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@xxxxxxxxxxxxx>

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


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux