linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Huang Pei <huangpei@loongson.cn>
To: "Maciej W. Rozycki" <macro@orcam.me.uk>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	ambrosehua@gmail.com, Bibo Mao <maobibo@loongson.cn>,
	linux-mips@vger.kernel.org, linux-arch@vger.kernel.org,
	linux-mm@kvack.org, Jiaxun Yang <jiaxun.yang@flygoat.com>,
	Paul Burton <paulburton@kernel.org>,
	Li Xuefeng <lixuefeng@loongson.cn>,
	Yang Tiezhu <yangtiezhu@loongson.cn>,
	Gao Juxin <gaojuxin@loongson.cn>,
	Huacai Chen <chenhuacai@loongson.cn>,
	Jinyang He <hejinyang@loongson.cn>,
	Steven Rostedt <rostedt@goodmis.org>,
	Jisheng Zhang <Jisheng.Zhang@synaptics.com>,
	Masami Hiramatsu <mhiramat@kernel.org>
Subject: Re: [PATCH] MIPS: fix local_t operation on MIPS64
Date: Mon, 6 Sep 2021 22:03:07 +0800	[thread overview]
Message-ID: <20210906140307.cnj7iv567aibvhzr@ThinkPad-W520> (raw)
In-Reply-To: <alpine.DEB.2.21.2109061306140.38640@angie.orcam.me.uk>

On Mon, Sep 06, 2021 at 01:08:02PM +0200, Maciej W. Rozycki wrote:
> On Sun, 5 Sep 2021, 黄沛 wrote:
> 
> > You mean including  asm/asm.h? 
> > 
> > or redefine LONG_ADDU as ** "addu " ** in asm/llsc.h?
> 
>  Use the existing macros, they're there for this purpose and widely used 
> throughout the port already.
> 
>   Maciej

diff --git a/arch/mips/include/asm/local.h b/arch/mips/include/asm/local.h
index 3c6db82ee0a6..551d8ba09cd7 100644
--- a/arch/mips/include/asm/local.h
+++ b/arch/mips/include/asm/local.h
@@ -9,6 +9,7 @@
 #include <asm/cmpxchg.h>
 #include <asm/compiler.h>
 #include <asm/war.h>
+#include <asm/asm.h>
 
 typedef struct
 {
@@ -40,10 +41,10 @@ static __inline__ long local_add_return(long i, local_t * l)
 		"	.set	arch=r4000				\n"
 			__SYNC(full, loongson3_war) "			\n"
 		"1:"	__LL	"%1, %2		# local_add_return	\n"
-			__ADDU	"%0, %1, %3				\n"
+		"	LONG_ADDU	%0, %1, %3			\n"
 			__SC	"%0, %2					\n"
 		"	beqzl	%0, 1b					\n"
-			__ADDU	"%0, %1, %3				\n"
+		"	LONG_ADDU	%0, %1, %3			\n"
 		"	.set	pop					\n"
 		: "=&r" (result), "=&r" (temp), "=m" (l->a.counter)
 		: "Ir" (i), "m" (l->a.counter)
@@ -56,10 +57,10 @@ static __inline__ long local_add_return(long i, local_t * l)
 		"	.set	"MIPS_ISA_ARCH_LEVEL"			\n"
 			__SYNC(full, loongson3_war) "			\n"
 		"1:"	__LL	"%1, %2		# local_add_return	\n"
-			__ADDU	"%0, %1, %3				\n"
+		"	LONG_ADDU	%0, %1, %3			\n"
 			__SC	"%0, %2					\n"
 		"	beqz	%0, 1b					\n"
-			__ADDU	"%0, %1, %3				\n"
+		"	LONG_ADDU	%0, %1, %3			\n"
 		"	.set	pop					\n"
 		: "=&r" (result), "=&r" (temp), "=m" (l->a.counter)
 		: "Ir" (i), "m" (l->a.counter)
@@ -89,10 +90,10 @@ static __inline__ long local_sub_return(long i, local_t * l)
 		"	.set	arch=r4000				\n"
 			__SYNC(full, loongson3_war) "			\n"
 		"1:"	__LL	"%1, %2		# local_sub_return	\n"
-			__SUBU	"%0, %1, %3				\n"
+		"	LONG_SUBU	%0, %1, %3			\n"
 			__SC	"%0, %2					\n"
 		"	beqzl	%0, 1b					\n"
-			__SUBU	"%0, %1, %3				\n"
+		"	LONG_SUBU	%0, %1, %3			\n"
 		"	.set	pop					\n"
 		: "=&r" (result), "=&r" (temp), "=m" (l->a.counter)
 		: "Ir" (i), "m" (l->a.counter)
@@ -105,10 +106,10 @@ static __inline__ long local_sub_return(long i, local_t * l)
 		"	.set	"MIPS_ISA_ARCH_LEVEL"			\n"
 			__SYNC(full, loongson3_war) "			\n"
 		"1:"	__LL	"%1, %2		# local_sub_return	\n"
-			__SUBU	"%0, %1, %3				\n"
+		"	LONG_SUBU	%0, %1, %3			\n"
 			__SC	"%0, %2					\n"
 		"	beqz	%0, 1b					\n"
-			__SUBU	"%0, %1, %3				\n"
+		"	LONG_SUBU	%0, %1, %3			\n"
 		"	.set	pop					\n"
 		: "=&r" (result), "=&r" (temp), "=m" (l->a.counter)
 		: "Ir" (i), "m" (l->a.counter)


|| make[1]: Entering directory '/home/hp/projects/Linux/temp/out_stable_loongson'
||   GEN     Makefile
||   Checking missing-syscalls for N32
||   CALL    /home/hp/projects/Linux/temp/linux-stable/scripts/checksyscalls.sh
||   Checking missing-syscalls for O32
||   CALL    /home/hp/projects/Linux/temp/linux-stable/scripts/checksyscalls.sh
||   CALL    /home/hp/projects/Linux/temp/linux-stable/scripts/checksyscalls.sh
||   CALL    /home/hp/projects/Linux/temp/linux-stable/scripts/atomic/check-atomics.sh
||   CC      kernel/trace/ring_buffer.o
|| {standard input}: Assembler messages:
{standard input}|11389| Error: unrecognized opcode `long_addu $6,$3,$2'
{standard input}|11392| Error: unrecognized opcode `long_addu $6,$3,$2'
{standard input}|11404| Error: unrecognized opcode `long_addu $5,$7,$2'
{standard input}|11407| Error: unrecognized opcode `long_addu $5,$7,$2'
{standard input}|12354| Error: unrecognized opcode `long_addu $20,$3,$2'
{standard input}|12357| Error: unrecognized opcode `long_addu $20,$3,$2'
/home/hp/projects/Linux/temp/linux-stable/scripts/Makefile.build|279| recipe for target 'kernel/trace/ring_buffer.o' failed
|| make[3]: *** [kernel/trace/ring_buffer.o] Error 1
/home/hp/projects/Linux/temp/linux-stable/scripts/Makefile.build|496| recipe for target 'kernel/trace' failed
|| make[2]: *** [kernel/trace] Error 2
/home/hp/projects/Linux/temp/linux-stable/Makefile|1805| recipe for target 'kernel' failed
|| make[1]: *** [kernel] Error 2
|| make[1]: Leaving directory '/home/hp/projects/Linux/temp/out_stable_loongson'
/home/hp/projects/Linux/temp/linux-stable/Makefile|185| recipe for target '__sub-make' failed
|| make: *** [__sub-make] Error 2


Any better idea?



  reply	other threads:[~2021-09-06 14:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-04 15:12 Huang Pei
2021-09-04 17:57 ` Maciej W. Rozycki
2021-09-05  0:48   ` 黄沛
2021-09-06 11:08     ` Maciej W. Rozycki
2021-09-06 14:03       ` Huang Pei [this message]
2021-09-06 16:29         ` Maciej W. Rozycki
     [not found]           ` <6113C299-3E26-4445-97FD-32690FD91C95@loongson.cn>
2021-09-07 10:00             ` Maciej W. Rozycki
2021-09-08  8:15               ` 黄沛
2021-09-04 18:50 ` kernel test robot
2021-09-04 19:10 ` kernel test robot
2021-09-05  3:42 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210906140307.cnj7iv567aibvhzr@ThinkPad-W520 \
    --to=huangpei@loongson.cn \
    --cc=Jisheng.Zhang@synaptics.com \
    --cc=ambrosehua@gmail.com \
    --cc=chenhuacai@loongson.cn \
    --cc=gaojuxin@loongson.cn \
    --cc=hejinyang@loongson.cn \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lixuefeng@loongson.cn \
    --cc=macro@orcam.me.uk \
    --cc=maobibo@loongson.cn \
    --cc=mhiramat@kernel.org \
    --cc=paulburton@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tsbogend@alpha.franken.de \
    --cc=yangtiezhu@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox