From patchwork Sat Sep 4 15:12:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huang Pei X-Patchwork-Id: 12475627 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89B81C433F5 for ; Sat, 4 Sep 2021 15:12:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D93E860F56 for ; Sat, 4 Sep 2021 15:12:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D93E860F56 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id E8B3E6B0071; Sat, 4 Sep 2021 11:12:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E3B20900002; Sat, 4 Sep 2021 11:12:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D032B6B0073; Sat, 4 Sep 2021 11:12:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0029.hostedemail.com [216.40.44.29]) by kanga.kvack.org (Postfix) with ESMTP id BDE7E6B0071 for ; Sat, 4 Sep 2021 11:12:50 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 69E781854C39A for ; Sat, 4 Sep 2021 15:12:50 +0000 (UTC) X-FDA: 78550233300.13.6862321 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by imf22.hostedemail.com (Postfix) with ESMTP id BB9AE1900 for ; Sat, 4 Sep 2021 15:12:46 +0000 (UTC) Received: from localhost.localdomain (unknown [119.4.66.120]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Bx4MvSjDNhOfQDAA--.6136S2; Sat, 04 Sep 2021 23:12:23 +0800 (CST) From: Huang Pei To: Thomas Bogendoerfer , ambrosehua@gmail.com Cc: Bibo Mao , linux-mips@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, Jiaxun Yang , Paul Burton , Li Xuefeng , Yang Tiezhu , Gao Juxin , Huacai Chen , Jinyang He , "Maciej W . Rozycki" , Steven Rostedt , Jisheng Zhang , Masami Hiramatsu Subject: [PATCH] MIPS: fix local_t operation on MIPS64 Date: Sat, 4 Sep 2021 23:12:18 +0800 Message-Id: <20210904151218.10167-1-huangpei@loongson.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: AQAAf9Bx4MvSjDNhOfQDAA--.6136S2 X-Coremail-Antispam: 1UD129KBjvJXoWxJw17Xr4UWF47uFy3WF1Dtrb_yoW5Wry3pF ZrCa97KrWDJF4rG3ZrCF4S9r4avrs5GrWYkFyq9ryqya48tr1DZrZ8K3sYqF1kJa1Dt3W8 GFW7Cwn8uF1xZrJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9j14x267AKxVW5JVWrJwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26r1j6r1xM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j 6F4UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Cr 1j6rxdM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj 6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr 0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7M4IIrI8v6xkF7I0E 8cxan2IY04v7MxkIecxEwVAFwVW5WwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbV WUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF 67kF1VAFwI0_GFv_WrylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42 IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6rW3Jr0E3s1l IxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvf C2KfnxnUUI43ZEXa7VUjTa0DUUUUU== X-CM-SenderInfo: xkxd0whshlqz5rrqw2lrqou0/ Authentication-Results: imf22.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf22.hostedemail.com: domain of huangpei@loongson.cn designates 114.242.206.163 as permitted sender) smtp.mailfrom=huangpei@loongson.cn X-Stat-Signature: pi9nhgwainfpoat1dpjizp1tbo551ufb X-Rspamd-Queue-Id: BB9AE1900 X-Rspamd-Server: rspam04 X-HE-Tag: 1630768366-215716 X-Bogosity: Ham, tests=bogofilter, spamicity=0.244348, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Use daddu/dsubu for long int on MIPS64. Signed-off-by: Huang Pei Reported-by: kernel test robot Reported-by: kernel test robot Reported-by: kernel test robot --- arch/mips/include/asm/llsc.h | 4 ++++ arch/mips/include/asm/local.h | 17 +++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/arch/mips/include/asm/llsc.h b/arch/mips/include/asm/llsc.h index ec09fe5d6d6c..788e26ad7fca 100644 --- a/arch/mips/include/asm/llsc.h +++ b/arch/mips/include/asm/llsc.h @@ -16,11 +16,15 @@ #define __SC "sc " #define __INS "ins " #define __EXT "ext " +#define __ADDU "addu " +#define __SUBU "subu " #elif _MIPS_SZLONG == 64 #define __LL "lld " #define __SC "scd " #define __INS "dins " #define __EXT "dext " +#define __ADDU "daddu " +#define __SUBU "dsubu " #endif /* diff --git a/arch/mips/include/asm/local.h b/arch/mips/include/asm/local.h index ecda7295ddcd..3c6db82ee0a6 100644 --- a/arch/mips/include/asm/local.h +++ b/arch/mips/include/asm/local.h @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -39,10 +40,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" + __ADDU "%0, %1, %3 \n" __SC "%0, %2 \n" " beqzl %0, 1b \n" - " addu %0, %1, %3 \n" + __ADDU "%0, %1, %3 \n" " .set pop \n" : "=&r" (result), "=&r" (temp), "=m" (l->a.counter) : "Ir" (i), "m" (l->a.counter) @@ -55,10 +56,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" + __ADDU "%0, %1, %3 \n" __SC "%0, %2 \n" " beqz %0, 1b \n" - " addu %0, %1, %3 \n" + __ADDU "%0, %1, %3 \n" " .set pop \n" : "=&r" (result), "=&r" (temp), "=m" (l->a.counter) : "Ir" (i), "m" (l->a.counter) @@ -88,10 +89,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" + __SUBU "%0, %1, %3 \n" __SC "%0, %2 \n" " beqzl %0, 1b \n" - " subu %0, %1, %3 \n" + __SUBU "%0, %1, %3 \n" " .set pop \n" : "=&r" (result), "=&r" (temp), "=m" (l->a.counter) : "Ir" (i), "m" (l->a.counter) @@ -104,10 +105,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" + __SUBU "%0, %1, %3 \n" __SC "%0, %2 \n" " beqz %0, 1b \n" - " subu %0, %1, %3 \n" + __SUBU "%0, %1, %3 \n" " .set pop \n" : "=&r" (result), "=&r" (temp), "=m" (l->a.counter) : "Ir" (i), "m" (l->a.counter)