Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3261449imw; Wed, 6 Jul 2022 21:18:32 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sV01P3pYxVWFT78K3bVIn9WMa/8VsFalNip8J6xm659vU2j1iCdoszBH7yWWYgrnCZ9JQx X-Received: by 2002:a17:907:9005:b0:718:391:45e with SMTP id ay5-20020a170907900500b007180391045emr43040921ejc.616.1657167512423; Wed, 06 Jul 2022 21:18:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657167512; cv=none; d=google.com; s=arc-20160816; b=yd4Bo+A5jEVm7OCrRI6ZBl9eRpWT8uJEbaww5RaP4r1otNxTVzbfkQIYGbTkar1mQP JDYksK9pwMo0I3i9VivDTW3dwt11jHyRJVR2FgrYj3p6rlJNLYiEEtHtm7tEMP6T6fNa JusDeLIEb5h2y8P96pP3wdC73xx0e811qzfvkjG+Qf7G05ugrG4lTuU/NnHoqfI6Sdk8 fLnyIlVFjiinwoH/IrS2JrYlP10pQ4aHN3/0HRsiyMF7GPZX5sSAqA9WX5t2ABFIEzdd 8ha5UPPIMWrwFGBo/51WUsBLXzL72pbi9ZCpeSqQ2j/RMyAlAHOfdXKJNriSK4ReOKbg NV/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=dVEI8ymEjesflHwLEjaOkr2qe+sYEg0OsfhWe+Sn9ng=; b=pCfFAogHUOrDDR9t8s3epe/brMFUidzWmrM2Jb04sm2imxXX+qNcc4MuExUrQWiYoT rTKTF51UVR8kmGByU6hE9MUCyBwzO58GkrTeftwjBGZCMbz659fFKdQLpM0oA8Vkggqe uq2KkY95Qkhu+9Wk1xCG5psbVvNA1juIjq3lJ/6MbMWAykMP4OPUyoWs/82+auFZHhal 3qffW8JLoG2Vcsrx3ug89vQq0cppmz81aL2mRyt7SQL6LPFjnEKOmnSqjoGUFz/4GbKK tgfvKtresfBYKIuAhkZpERzLe++iwQKqAJfKiVJIN0NOv+Pp0mCL3pnBGFQaMiS2Ev4z W31w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=EOafTUqN; 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=REJECT sp=REJECT dis=NONE) header.from=xry111.site Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qa44-20020a17090786ac00b00707aefb3cc2si5645460ejc.510.2022.07.06.21.18.07; Wed, 06 Jul 2022 21:18:32 -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=@xry111.site header.s=default header.b=EOafTUqN; 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=REJECT sp=REJECT dis=NONE) header.from=xry111.site Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233928AbiGGEFY (ORCPT + 99 others); Thu, 7 Jul 2022 00:05:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbiGGEFX (ORCPT ); Thu, 7 Jul 2022 00:05:23 -0400 Received: from xry111.site (xry111.site [IPv6:2001:470:683e::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00DEB2CCAB for ; Wed, 6 Jul 2022 21:05:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1657166715; bh=xMn7MrQA8Rmpsy+c97xahDZzxB54Wg0Ugt9J9SQO4vc=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=EOafTUqNac5KDAd9ls46gfsCl24HWzca6XRCAz1uXx8HGJnv5dTrHFG0ZEM/z7D2Y N86zIwO+ObrVe2stwKGm96K5rgkbVmXOIc+fUGbRxYJL23O6er5akeRm2ynmVrfoba DlJNO2AVhJiMDFgEkmoUMgJ2+MLVsUKVYsf+sU3M= Received: from [IPv6:240e:358:1139:6500:dc73:854d:832e:4] (unknown [IPv6:240e:358:1139:6500:dc73:854d:832e:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id CB233669AA; Thu, 7 Jul 2022 00:05:06 -0400 (EDT) Message-ID: Subject: Re: [PATCH v2] LoongArch: Clean useless vcsr in loongarch_fpu. From: Xi Ruoyao To: WANG Xuerui , Qi Hu , Jiaxun Yang , Huacai Chen Cc: loongarch@lists.linux.dev, LKML Date: Thu, 07 Jul 2022 12:04:28 +0800 In-Reply-To: <0583a335-72f7-55cf-3cd9-4dbd8109a440@xen0n.name> References: <20220704153612.314112-1-huqi@loongson.cn> <4273e104-8392-6a06-5d18-a1933978d8c3@xen0n.name> <22a1ba993e298ce12a374decefebeca484240883.camel@xry111.site> <16c9ccaa5e5a2ffd39272cff6f66e487c659b571.camel@xry111.site> <9d064771-9402-4e84-96f8-4713cddf42f2@www.fastmail.com> <730cb4c4-a6a3-783e-3e4c-7c2bdc35c088@loongson.cn> <0583a335-72f7-55cf-3cd9-4dbd8109a440@xen0n.name> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.3 MIME-Version: 1.0 X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, SPF_HELO_PASS,SPF_PASS,T_PDS_OTHER_BAD_TLD,T_SCC_BODY_TEXT_LINE autolearn=no 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 On Thu, 2022-07-07 at 11:05 +0800, WANG Xuerui wrote: > To be frank, at this point I think you're trying to hide something.=20 > (This is not your fault, blame someone else of course because they told= =20 > you the fact.) In the old-world kernel the VCSR a.k.a. FCSR16 is=20 > certainly being saved/restored, and there's apparently no harm in doing= =20 > so. And if the contents are indeed "undefined", why are the code there > in the first place? Certainly the bits *are* meaningful, only that for > some reason you aren't revealing the semantics and pretending that they= =20 > are "undefined" and probably "do nothing externally observable" if=20 > accessed in the first place. On a 3A5000LL, I did an experiment via a kernel module, which enables LSX/LASX and tries to write and read fcsr16. I tried each bit (1, 2, 4, 8, ..., 1 << 31) one by one. The result: no matter which bit I wrote into fcsr16, I always read out 0. And I've objdump'ed a kernel shipped in an early Loongnix release. It seems the only reference to fcsr16 is a "movgr2fcsr $r16, $r0" instruction. --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University