Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2346768pxa; Fri, 7 Aug 2020 09:00:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjdnDEzJKB267a/4gaYjXbOgM7BN22GfJiwWZbUmz4FkwabjxtNUWa+cOU9kOeaycqzy+F X-Received: by 2002:a50:f10c:: with SMTP id w12mr9627898edl.202.1596816022512; Fri, 07 Aug 2020 09:00:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596816022; cv=none; d=google.com; s=arc-20160816; b=mimV17IqALTer0nIUYt5Wk3DbBsMvgZp6py/NyfqaixDewdf+gd5XoFcM9+jEyeRrK VoXYXcx/KUhZRcaap8oQNZH+U4tFcLi6Ra47IUX5w8eoy8mqJBziFO0brlinrzNbR/E+ WFQ9otYd/aYXfATebfgg1ERVnm6hX7MkSWPnm6yY066T6O70Rb4ZqsIBg4yKQNWEYZIn IyzYVaXqxErtDdc1GF85SzCMb7fDo1Y7II4Is94qQo8uh5s2ZwwRFj9eCwwMCYqQF3Vz KfJEzmqYwjsD3JzHXuLENn2RYtgxW4w23bk2zDYniALyiQ1Ds8j/QKPBeGiTkIlkbWt7 EM6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=GRuXSaAnJ/o9Xukh34/8JcRtIYkcxs3v+K7M0Y/7pJ8=; b=z+vNg+t4n3ilP/aVO3YLeQMFqQu4V0UjdOikoopGqUzNj9T1gjDTe8CEB0TZSNIXee ylOwn3zn/PWNZum8YZsNyg2ArnZPzKFHcFcNgg08qQazWtfZkVTTSFqVKj/IoEBIHRxL T8gjZc1Tp+gqszKqbOW6TosLqRxjavNLZxh6qa8k31w7puotWlWLIVpN04WZTSoVtqBG fEVET2MrSSA/zUOyDAEzwwbP3gKTSJw/ZDGdDbqqINF6+0acxmeJ4J59H7qwrK+5s7q6 6OQiFSKqsGIcR8FtfoIMDr+wL15eTOJ7sznuoGhHNiAoQfH9AUzDpn4clcz8/ZuvvTHW TyWQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id de5si5515509edb.586.2020.08.07.08.59.59; Fri, 07 Aug 2020 09:00:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726382AbgHGP71 (ORCPT + 99 others); Fri, 7 Aug 2020 11:59:27 -0400 Received: from out28-99.mail.aliyun.com ([115.124.28.99]:47444 "EHLO out28-99.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726078AbgHGP71 (ORCPT ); Fri, 7 Aug 2020 11:59:27 -0400 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.07706179|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_regular_dialog|0.0108605-0.00112385-0.988016;FP=0|0|0|0|0|-1|-1|-1;HT=e02c03306;MF=zhouyanjie@wanyeetech.com;NM=1;PH=DS;RN=11;RT=11;SR=0;TI=SMTPD_---.IE4BlWZ_1596815957; Received: from 192.168.10.205(mailfrom:zhouyanjie@wanyeetech.com fp:SMTPD_---.IE4BlWZ_1596815957) by smtp.aliyun-inc.com(10.147.42.135); Fri, 07 Aug 2020 23:59:17 +0800 Subject: Re: [PATCH v2] MIPS: Provide Kconfig option for default IEEE 754 conformance mode To: Jiaxun Yang , linux-mips@vger.kernel.org Cc: WANG Xuerui , Serge Semin , Huacai Chen , Thomas Bogendoerfer , Paul Burton , Serge Semin , Zhou Yanjie , Liangliang Huang , linux-kernel@vger.kernel.org References: <20200801061147.1412187-1-jiaxun.yang@flygoat.com> From: Zhou Yanjie Message-ID: <900c58a9-d706-be37-b160-603174a97e0f@wanyeetech.com> Date: Fri, 7 Aug 2020 23:59:16 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <20200801061147.1412187-1-jiaxun.yang@flygoat.com> Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Jiaxun, Reviewed-by: ?????? (Zhou Yanjie) ?? 2020/8/1 ????2:11, Jiaxun Yang ะด??: > Requested by downstream distros, a Kconfig option for default > IEEE 754 conformance mode allows them to set their mode to > relaxed by default. > > Signed-off-by: Jiaxun Yang > Reviewed-by: WANG Xuerui > Reviewed-by: Serge Semin > Reviewed-by: Huacai Chen > > -- > v2: Reword according to Xuerui's suggestion. > --- > arch/mips/Kconfig | 22 ++++++++++++++++++++++ > arch/mips/kernel/cpu-probe.c | 12 +++++++++++- > 2 files changed, 33 insertions(+), 1 deletion(-) > > diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig > index eaf7519e3033..ac35df2b9133 100644 > --- a/arch/mips/Kconfig > +++ b/arch/mips/Kconfig > @@ -2899,6 +2899,28 @@ config MIPS_NR_CPU_NR_MAP > default 1024 if MIPS_NR_CPU_NR_MAP_1024 > default NR_CPUS if !MIPS_NR_CPU_NR_MAP_1024 > > +choice > + prompt "Default IEEE 754 conformance mode" > + default IEEE754_DEFAULT_STRICT > + help > + Sets the default IEEE 754 conformance mode, same as overriding the > + default value for the ieee754= kernel parameter. See the kernel > + parameter for details. > + > + config IEEE754_DEFAULT_STRICT > + bool "Strict" > + > + config IEEE754_DEFAULT_LEGACY > + bool "Legacy" > + > + config IEEE754_DEFAULT_STD2008 > + bool "2008" > + > + config IEEE754_DEFAULT_RELAXED > + bool "Relaxed" > + > +endchoice > + > # > # Timer Interrupt Frequency Configuration > # > diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c > index c231c1b67889..a5b8fe019afc 100644 > --- a/arch/mips/kernel/cpu-probe.c > +++ b/arch/mips/kernel/cpu-probe.c > @@ -157,7 +157,17 @@ static void cpu_set_fpu_2008(struct cpuinfo_mips *c) > * IEEE 754 conformance mode to use. Affects the NaN encoding and the > * ABS.fmt/NEG.fmt execution mode. > */ > -static enum { STRICT, LEGACY, STD2008, RELAXED } ieee754 = STRICT; > +enum ieee754_mode { STRICT, LEGACY, STD2008, RELAXED }; > + > +#if defined(CONFIG_IEEE754_DEFAULT_STRICT) > +static enum ieee754_mode ieee754 = STRICT; > +#elif defined(CONFIG_IEEE754_DEFAULT_LEGACY) > +static enum ieee754_mode ieee754 = LEGACY; > +#elif defined(CONFIG_IEEE754_DEFAULT_STD2008) > +static enum ieee754_mode ieee754 = STD2008; > +#elif defined(CONFIG_IEEE754_DEFAULT_RELAXED) > +static enum ieee754_mode ieee754 = RELAXED; > +#endif > > /* > * Set the IEEE 754 NaN encodings and the ABS.fmt/NEG.fmt execution modes