Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp352572rwb; Mon, 26 Sep 2022 20:34:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4nRPWalwncbQ+4i3XG3o50F9VMYtrpElvhfp1J2rgT8eCjTwy0tQzfhwoWIVEKxfFbsrp/ X-Received: by 2002:a17:907:968b:b0:782:6256:58eb with SMTP id hd11-20020a170907968b00b00782625658ebmr20807621ejc.750.1664249646991; Mon, 26 Sep 2022 20:34:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664249646; cv=none; d=google.com; s=arc-20160816; b=fcTq6d+tcg59ayoQBQOxsesEQ6ZeaM943viGu3o3rHnSpc4slPI6N4ObVtoLVLok+7 8H2sKLCdhuFeL7K2zYtdJw35iDuamliuskg+tjRA3kvMu9leEikdmYoO2dFB50fB9/AS aC7GffVTUCfBam3gkhUFld62ifvlc59RBo32pTv/ZNjufB8JDSKyCWeoE3LRGMlcxZhu VeluYTMR1PYcGlxcYVx+xFMSfi56HS/kjZrt3lzVRs+2BymYYVSGxBuKXrXPmqamEpFc WiLsJxdwyqhGQKhXS4QsR3iq1VASYyxwDZbjVRBFPuYNL6mhByQBQgMbe75HjJoouFBK FD7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=KcxHXWJv3mg+ZuDQWS9QqeEJ6BrzZQHH7wepzz72ZVg=; b=BhN17xWvrJNRktrLmZ5l375gUoAmkm1U8XtvF8D4LsQ1hB3tls3zAa9TNGlmObDrfE AyZPNEpp4K/VFhlBY8Bv58MYfhss6IQlXyhRYY33qA3dW+Cng3XoRDxsyW8B+zETGspw Pwk9XanHbFU2X5yev17b4TPMR434TtXeC09j4m0xlxfz9gPNB+icyHmAu1xP+ZSNohJA lymbg1axLYyFK+SWWlKnm89sgm0APfLX1fvT6yFgBqIbncTe5Kj40hteE02DtbleNHQC UxP5Be9TFLGquM2zH1Op2ZOfpOmCWRamBaoyHy+plFFO6MeivX+C1RXCkZXZradBENlr bt5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq40-20020a1709073f2800b00783e7d72fc0si241298ejc.272.2022.09.26.20.33.39; Mon, 26 Sep 2022 20:34:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229492AbiI0DN2 (ORCPT + 99 others); Mon, 26 Sep 2022 23:13:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231197AbiI0DMe (ORCPT ); Mon, 26 Sep 2022 23:12:34 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B193610FE3 for ; Mon, 26 Sep 2022 20:10:39 -0700 (PDT) Received: from [10.20.42.28] (unknown [10.20.42.28]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cx72umaTJj5ZEiAA--.60554S3; Tue, 27 Sep 2022 11:10:31 +0800 (CST) Message-ID: <5bf565a4-5bc4-42f8-59c0-8b908a9c2ab6@loongson.cn> Date: Tue, 27 Sep 2022 11:10:30 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v3] LoongArch: Fixup do_ri csr_era Content-Language: en-US To: Guo Ren Cc: Huacai Chen , WANG Xuerui , Tiezhu Yang , Jiaxun Yang , Qing Zhang , Mao Bibo , Jianmin Lv , loongarch@lists.linux.dev, linux-kernel@vger.kernel.org References: <20220926122727.2310118-1-yijun@loongson.cn> From: Jun Yi In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CM-TRANSID: AQAAf8Cx72umaTJj5ZEiAA--.60554S3 X-Coremail-Antispam: 1UD129KBjvJXoWrtw18JrWkGFW7ur15CF4rZrb_yoW8Jr1rpF nrCa1DJF48XFnrCw1Dtr4jvry3tasxGr43uanrt34Sk3Wqqr9Yq3WvqF12vF1jv3y5Gr40 qFyFy3sFga13Aa7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9G14x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4U JVWxJr1l84ACjcxK6I8E87Iv67AKxVWxJr0_GcWl84ACjcxK6I8E87Iv6xkF7I0E14v26r xl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj 6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr 0_Gr1lF7xvr2IY64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7M4IIrI8v6xkF7I0E8cxa n2IY04v7Mxk0xIA0c2IEe2xFo4CEbIxvr21lc2xSY4AK6svPMxAIw28IcxkI7VAKI48JMx C20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAF wI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20x vE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v2 0xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxV W8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7VUbXdbUUUUUU== X-CM-SenderInfo: p1lm30o6or00hjvr0hdfq/1tbiAQACAWMxll4P4AABs2 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org do_ri is porting from mips, mipsr6 use do_ri to emulate some fp instructions, but Loongarch do not need to emulate these instructions. And the regs->csr_era be always recovered to ths old_era = regs->csr_era, so the compute_return_era is useless. On 9/27/22 07:41, Guo Ren wrote: > On Mon, Sep 26, 2022 at 8:27 PM Jun Yi wrote: >> >> csr_era of pt_regs in do_ri should not add 4 to point to the >> next instruction. > The comment does not make sense. I think it wants to skip some > instructions, but your patch broke that. > >> >> Signed-off-by: Jun Yi >> --- >> arch/loongarch/kernel/traps.c | 2 -- >> 1 file changed, 2 deletions(-) >> >> diff --git a/arch/loongarch/kernel/traps.c b/arch/loongarch/kernel/traps.c >> index aa1c95aaf595..ec888eda3d45 100644 >> --- a/arch/loongarch/kernel/traps.c >> +++ b/arch/loongarch/kernel/traps.c >> @@ -477,8 +477,6 @@ asmlinkage void noinstr do_ri(struct pt_regs *regs) >> >> die_if_kernel("Reserved instruction in kernel code", regs); >> >> - compute_return_era(regs); >> - >> if (unlikely(get_user(opcode, era) < 0)) { >> status = SIGSEGV; >> current->thread.error_code = 1; >> -- >> 2.31.1 >> > >