Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3340861imw; Wed, 6 Jul 2022 23:18:59 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ueePQ2fQtXsfPB7IL0E+94Q29M0icuyE4xKgGTFCgqUEDMpUqj9i1AMoPV6LmHzdV9q+OE X-Received: by 2002:a17:902:b78c:b0:16b:f943:ae98 with SMTP id e12-20020a170902b78c00b0016bf943ae98mr10859228pls.102.1657174739258; Wed, 06 Jul 2022 23:18:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657174739; cv=none; d=google.com; s=arc-20160816; b=BFd93e5vfn6WU2w05wUGryfdY3BvkvY+OgfhQTW4pnpSSUlEbIFkRuFZtyKnaKSide Yp153VKsLLy4TKKWfKSP+aw4O2B/kT3ygwigi3C4qOCOsoyq9huI7/ZXd92dUaC5EDqw vKtP4Yd80LBMHBtCTxeJgv7PVAbVqiaUxwuq6HF+qA0ucm6M1aVCjunHD1ZT099kKy+D FtwlwMvax/Oh0KVBYyHUKkje+U4Zkwfg8CtQrRJr2K3MlzztDxgaetsCpKEC9W18RYgn ycF9+5ieUCgBi0BQQjrcQDN2Yz3heLWVhsuAdt9rRHNStwSF7XWkp3ITCsV7LYCr9GPO 2K7Q== 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=C2Pzpr8fiZfxxp3G8J13J3RemUyb1Dw/JfwIq40TwYM=; b=mEyVwkK0/8DSJVl4Lbs5D2Tjey8bx8LLO5JOeOwzM3f55Da5uqwaOv/RO6D6+3skcU IRYvXf5kbPxNJT+MZPYbn9jadO/SCfJG6eKBCmsfo+i7/y06WTzKS4eht6Ou/Byio2rA rL0bVgo8GDIx03FSvDoHBSM+ocY/uHptBzh/6aKSyqTHP2s2Gp313A10NLjuYmVJYt26 v73ki6CEIKzCTDCmLrSi2VCj6cZu6s9fTMI7nj6VRxBJsm6hfWqzQd87b2ne2LEZaK4H /Q/pPQaLqOPt5TETSEHMDl/3ncLjrDz0Lp2hDGfRlx2tQbY2KydOakZmvb6P8z5byTC+ hqxg== 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 y10-20020a17090322ca00b0016a3e903cffsi38131541plg.88.2022.07.06.23.18.46; Wed, 06 Jul 2022 23:18:59 -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 S233304AbiGGGJ5 (ORCPT + 99 others); Thu, 7 Jul 2022 02:09:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232207AbiGGGJz (ORCPT ); Thu, 7 Jul 2022 02:09:55 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 78411B1F2 for ; Wed, 6 Jul 2022 23:09:54 -0700 (PDT) Received: from [10.90.50.23] (unknown [192.168.200.1]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Dxn9OseMZi7XgOAA--.1729S3; Thu, 07 Jul 2022 14:09:49 +0800 (CST) Message-ID: <41a2a420-adfa-6f8d-392d-0c15892b6945@loongson.cn> Date: Thu, 7 Jul 2022 14:09:48 +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 v2] LoongArch: Clean useless vcsr in loongarch_fpu. Content-Language: en-US To: WANG Xuerui , Xi Ruoyao , Jiaxun Yang , Huacai Chen Cc: loongarch@lists.linux.dev, LKML 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> From: Qi Hu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf9Dxn9OseMZi7XgOAA--.1729S3 X-Coremail-Antispam: 1UD129KBjvJXoW7Aw13Kr4rGryxuFWfuF4Durg_yoW8Ar15pr W5ta9Yyr4kJryxAw1Ivwn5XrySvwn5AF15J3WkXFsavwn0qF9agrW8JFW093yYgrZ7Ka4Y vr47Kas5ZayUZaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnUUvcSsGvfC2KfnxnUUI43ZEXa7xR_UUUUUUUUU== X-CM-SenderInfo: pkxtxqxorr0wxvrqhubq/1tbiAQAACV3QvPyK7wABsh X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On 2022/7/7 12:22, WANG Xuerui wrote: > On 2022/7/7 12:04, Xi Ruoyao wrote: >> 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. >>> (This is not your fault, blame someone else of course because they told >>> you the fact.) In the old-world kernel the VCSR a.k.a. FCSR16 is >>> certainly being saved/restored, and there's apparently no harm in doing >>> 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 >>> are "undefined" and probably "do nothing externally observable" if >>> 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. > > Hmm this is weird. I can't understand why the vcsr code was there in > the first place then... I'd like to check a few Loongnix/Kylin/UOS > kernels but currently I don't have the time. > > If this is the case, indeed all vcsr-related code should be removed. > Although I'm still not sure how to best word the commit message. > Thanks for the Ruoyao's experiment. Removing the vcsr is the first step to trying to support LBT and LSX/LASX in Kernel. In my opinion, the vcsr relevant code may be used for debugging and forgot to remove.