Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp426575rwb; Mon, 26 Sep 2022 22:19:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ts/oIDVWd9B8O98h3RSTgBk9FPf5TxZFfJcQLHfIL3sW2xL8KPHwtZ/83lMNx7JZ4JnwS X-Received: by 2002:a17:907:b10:b0:76f:e74f:4f4c with SMTP id h16-20020a1709070b1000b0076fe74f4f4cmr21306573ejl.132.1664255950847; Mon, 26 Sep 2022 22:19:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664255950; cv=none; d=google.com; s=arc-20160816; b=gM3CLdIZqYhIbSirrcVP47PsYJ1G3azHsx0S4sQoRaOvISMLHdiBvWlMfTM7a2p+lC HBOAz2T1LJAqoJ0x60z/mg4lLeVoh/hTwfZc8MEIqK0U+1N3z0XsBjSc8P57o+MX03nE 0Rfr3XFwV/ohjlwCwPXxqajCPG3Fjy8yjraLEvyIYonUO9a/7EUm1jzQvTWz7ikU/+dS lVBj6vf3SStGSqK/PdABEQT+VELA74FJ9Fc+CmlPJjPoaVmzHCIJCt2EYL54Vk+E5RbT s5AafqfeAW1BSoMoEay5EUsadCe8oIMpssu5g8puAzS0iWYMqDgdmwpLLZ6fm/7ZZaC3 ZsEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=xm9eMqx0JDKk6avnNHVKPRs+YF+f0+whbP+Nc+B8wGo=; b=QAbLeweF6ryHFDOw9JKNqCm09MQ6URhJ5q5y1n+X8u8RpLSAiOY9EPkBcZXlZtlTCV /Eue5Xp1ozZnUXhgXchLB46YDVlQFct0uVHX11S5PlpWYEfMAaJBBeeyaOa3MdvX3VXQ IN7UhW57pnSN77RJmxCpszMGoF5T1iYg2bAR6vleuva4GLsDSU9T3Q6Ljyqg163xV1aM NQGQmJl9QKBx6phZkLa4aWMXtleG8RrA26ILXeTWQYMa7BzBQJVkW26nZ2VQ7EwxLa9P vYMIAXwvI3gu28VkLxluj1WxSmvUOdB9PgOdi4lMnWHS22b8TebWngsTtYV9nIdqOIME cwmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VqooohJp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dt6-20020a170907728600b0078043d1ea08si352567ejc.362.2022.09.26.22.18.45; Mon, 26 Sep 2022 22:19:10 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VqooohJp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229641AbiI0FDV (ORCPT + 99 others); Tue, 27 Sep 2022 01:03:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbiI0FDS (ORCPT ); Tue, 27 Sep 2022 01:03:18 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06298A4B36 for ; Mon, 26 Sep 2022 22:03:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 84D2BB8160E for ; Tue, 27 Sep 2022 05:03:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46B9AC433C1 for ; Tue, 27 Sep 2022 05:03:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664254994; bh=Jt1l+ur8owCZNiwKZzkzl+bfr1wPLucqAu5BcgfoKHg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=VqooohJpWsmp9T0yAMgRfKNhQgNMildZLFNzSZBMp8sEoU/+P10eS8Z+WYpwOG6Xu lAYOt3ftHPLlTN1aF8Ja/ZBf5GXjnX9dV0JhA/RalpeoiFItESPgb13sbnvo0467C1 Mhnkv7d+u8EOsTMIeg2bYRax0Qb5l3RXUHhzw044GxTomY8rGqvq7Z/seOEiaKDMN+ 5Vi5KN/8MuAxqWU0zRct+I2Ocyrq8r1KwBwGr4HKU0y9r4IPIgZvaafSaHDtpUbElu N8xSaXRtZyHe6/n+GTLaEe/NuN8/dlRVw+hrXSNeikoL/YTYa7/k4zkmw6FOol++R7 KrDV0LggSs1kw== Received: by mail-vs1-f41.google.com with SMTP id k2so8596515vsk.8 for ; Mon, 26 Sep 2022 22:03:14 -0700 (PDT) X-Gm-Message-State: ACrzQf2NcbHRIAwRPs9NBBXHmY9795MLxESMiKdTF4o3kXrvsHBCL3WJ vGJOMFDOY2NM4HPEg/kUTXxrCQXnLkdwz7hwuYU= X-Received: by 2002:a05:6102:1481:b0:39a:67f5:3096 with SMTP id d1-20020a056102148100b0039a67f53096mr9795505vsv.70.1664254993281; Mon, 26 Sep 2022 22:03:13 -0700 (PDT) MIME-Version: 1.0 References: <20220926122727.2310118-1-yijun@loongson.cn> <5bf565a4-5bc4-42f8-59c0-8b908a9c2ab6@loongson.cn> In-Reply-To: <5bf565a4-5bc4-42f8-59c0-8b908a9c2ab6@loongson.cn> From: Huacai Chen Date: Tue, 27 Sep 2022 13:03:01 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] LoongArch: Fixup do_ri csr_era To: Jun Yi Cc: Guo Ren , WANG Xuerui , Tiezhu Yang , Jiaxun Yang , Qing Zhang , Mao Bibo , Jianmin Lv , loongarch@lists.linux.dev, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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 Hi, all, I clean up do_ri() further based on this patch [1], thanks. [1] https://lore.kernel.org/loongarch/20220927045820.2770062-1-chenhuacai@loongson.cn/T/#u On Tue, Sep 27, 2022 at 11:10 AM Jun Yi wrote: > > 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 > >> > > > > >