Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3267966imw; Wed, 6 Jul 2022 21:28:35 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vD2h/MdFAPQCBdHHnxoZLAtfR587n3mypM/pNF0sQQWWdMh6EwRGVEP9U/PiZG3z1opfCB X-Received: by 2002:a17:907:7ba1:b0:72a:eba6:12ba with SMTP id ne33-20020a1709077ba100b0072aeba612bamr10889980ejc.652.1657168115116; Wed, 06 Jul 2022 21:28:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657168115; cv=none; d=google.com; s=arc-20160816; b=c+VeYEdGaC2kmoGsnbUcdxe2qalFpXv4kIIaNFIoVKwNjb3DfWJKH8gNp8ZejToj1A Po444La24YCk04VrYWdRbWp6vz5/O/XvVslgq5UTNwOpk/zTE0/U/+oJIkNhtf1rugxa 4Vi3vTsqW9X1xN5GxL0ueVaHcl9pTqSMv4bFe7z+FwhjprQGN/byx8TlyP8m88357v4k A1XYhm7jUY5w2I/FpNMF7CqgJ/8YH2YWLbX5OX2wiT9I28SScpKOP8YwsoniFFJsKgB0 eJy0aN1OGQ0w6Op9Z6jW1PZv1JNLo7nOZi3yup00RJwVhxuXD0p9cCHA6lHrwMPQHLh0 /qYA== 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 :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=lmlK2b4+rkS9Me3jt+6JVdIb81PY3P5KUzw1xjiFb+4=; b=IyYR6qwqNkMGLSy/xOKGNA6un+5lGLQEK/LdE46NvkLfgnTNdUx9w921KkMwXFwpIK vkFXl1mp4Z4RqC+CO5HwvOa4Gs21ydxIkEFz+h7+zRaAaoJNoZNQ+qWPDSN6qjSUzwYN Uvn7uVXVbGipbvRqOJh8qg7kajlGw1GXS47bdiiiLhjIIZeOcK5FgaUqeriuVB5l9ERh 2xxmTp8CliGNgohRNiqoifrB+1Ny/OsRZQT7tY39WWnoKIOMcxcLuIHlboZv3I/NMDPw fuuQ/BgJViyyf4pmJtFxLpEN+rS7Vxq0QYdgWOkFG9eaO9akRiWnbYW0znkDKLJZWooD Miug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=isW7nzFD; 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 fi5-20020a056402550500b0043a50fda151si3603732edb.434.2022.07.06.21.27.55; Wed, 06 Jul 2022 21:28:35 -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=@xen0n.name header.s=mail header.b=isW7nzFD; 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 S234774AbiGGEW7 (ORCPT + 99 others); Thu, 7 Jul 2022 00:22:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231676AbiGGEW5 (ORCPT ); Thu, 7 Jul 2022 00:22:57 -0400 Received: from mailbox.box.xen0n.name (mail.xen0n.name [115.28.160.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FC342FFE1 for ; Wed, 6 Jul 2022 21:22:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xen0n.name; s=mail; t=1657167773; bh=kVK+K1j5mB45c4TjayXPR0CHym4BWHEeRog+G28gmD4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=isW7nzFD73L6p2ml5+cAPqYl4RKlNVriE6R+uySXyUk146ghNKzC/K9WSfQrT1NOq hL/GcXSW4BJhw7YBkg7ABoC9BZeAEzNHDtNJXLiF0XcnF8pV120J/ZNh7uUZXKvHRf CSsA3C1+iC/yQ3PQDRIDP70wOQI8tjAaXOW18aHA= Received: from [100.100.57.190] (unknown [220.248.53.61]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mailbox.box.xen0n.name (Postfix) with ESMTPSA id 037FE6010B; Thu, 7 Jul 2022 12:22:52 +0800 (CST) Message-ID: Date: Thu, 7 Jul 2022 12:22:52 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:104.0) Gecko/20100101 Thunderbird/104.0a1 Subject: Re: [PATCH v2] LoongArch: Clean useless vcsr in loongarch_fpu. To: Xi Ruoyao , WANG Xuerui , Qi Hu , 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> Content-Language: en-US From: WANG Xuerui In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, 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: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.