Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp2459300ybg; Thu, 30 Jul 2020 23:21:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwf23gAwVdTdd0vaXxqSGk3RJG8O8hRbt3VNBh3vZZr9TYZFID0WviNMNxp1MZq/Kuq606x X-Received: by 2002:aa7:dd91:: with SMTP id g17mr2504124edv.186.1596176463515; Thu, 30 Jul 2020 23:21:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596176463; cv=none; d=google.com; s=arc-20160816; b=UlPD4d03gUL43YYVZ7fs3BDzFWtXicYKhvC9qPDgjBFO5oCXIQaNGYWpVU1rax+BCm 3boQRUCdHH6cO7OOH0Vm9G89su5mOxqZqA35Ao2tms93KncenuN+9PIdUeC1Kpw/F1XA edsmrKwEsQpCvostGKV8VIENHkH4+UBFP/wiRKXaubvF+byrn/IAyGBlrLUKMsT5xZl+ OuM0pqAyG5vhHxsg/wKyBT6GDzU95VhtbLqPk+fI4RHNX5NS4vgnpn0jc3HlYarmxX6q ouqxzOJYlkQdKt7KqtV5qaD7/JN2bm8UQ5EGXL9Md2d0R/CJ+1Y/FSY1wmCG5FFlkWB5 OP/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=659ZiFVFJSwswVZ9hI+192SyxuaXL6nM7q75CxRmzVQ=; b=ezsGghOhI6c2b4g8ZraceVHUL/WfM3LU6zxh1xbdWxQTmYoAxpdUdhkqazsB60d53u cxgTiyl7Cv7yLqHRp5toVL1uLT3kk89ep1PGHZEe+zXklLy6VYEuzaq/zKe45M4nOnAB eD7OgTTZotPtYAM120e3WzgJkIT1K/AmoQvRkh8vAOWOPxhzrz+WmI1z4fZbmM/KHl/t dBA2pCOM9akHPq93PUNl/zL2iLgN1AjhUytBYLcSFJDUuBc7YzESDsbGHO0erdRnlW+x 0CswiCRcAPeFoyGa9UZsdig4AWOmkaUB1/3cH7wAXQ+auWcydcx2Ltf1sWtf7azZEZtU onGA== 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 t19si5035295edi.420.2020.07.30.23.20.40; Thu, 30 Jul 2020 23:21:03 -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 S1731376AbgGaGRK (ORCPT + 99 others); Fri, 31 Jul 2020 02:17:10 -0400 Received: from mail.baikalelectronics.com ([87.245.175.226]:59184 "EHLO mail.baikalelectronics.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731152AbgGaGRK (ORCPT ); Fri, 31 Jul 2020 02:17:10 -0400 Received: from localhost (unknown [127.0.0.1]) by mail.baikalelectronics.ru (Postfix) with ESMTP id B2D24803202D; Fri, 31 Jul 2020 06:17:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at baikalelectronics.ru Received: from mail.baikalelectronics.ru ([127.0.0.1]) by localhost (mail.baikalelectronics.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RqL-rhfuLKKA; Fri, 31 Jul 2020 09:17:05 +0300 (MSK) Date: Fri, 31 Jul 2020 09:17:02 +0300 From: Serge Semin To: Jiaxun Yang CC: Serge Semin , , Thomas Bogendoerfer , Paul Burton , Huacai Chen , Zhou Yanjie , =?utf-8?B?5ZGo55Cw5p2wIChaaG91IFlhbmppZSk=?= , Liangliang Huang , Subject: Re: [PATCH] MIPS: Provide Kconfig option for default IEEE754 conformance mode Message-ID: <20200731061702.fxdfyxpvd6qrhoql@mobilestation> References: <20200731041018.1381642-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20200731041018.1381642-1-jiaxun.yang@flygoat.com> X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 31, 2020 at 12:10:16PM +0800, Jiaxun Yang wrote: > Requested by downstream distros, a Kconfig option for default > IEEE754 conformance mode allows them to set their mode to > relaxed by default. That's what should have been here in the first place. Thanks! Reviewed-by: Serge Semin > > Signed-off-by: Jiaxun Yang > --- > arch/mips/Kconfig | 21 +++++++++++++++++++++ > arch/mips/kernel/cpu-probe.c | 12 +++++++++++- > 2 files changed, 32 insertions(+), 1 deletion(-) > > diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig > index f6bb446d30f0..ef5b2a177b1b 100644 > --- a/arch/mips/Kconfig > +++ b/arch/mips/Kconfig > @@ -2877,6 +2877,27 @@ 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 Std 754 conformance mode" > + default IEEE754_DEFAULT_STRICT > + help > + Default IEEE Std 754 conformance mode, see ieee754= kernel parameter > + for detail. > + > + 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 d9e8d39a7289..03adeed58efb 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 > -- > 2.28.0 >