Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp2470875ybg; Thu, 30 Jul 2020 23:56:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySBWyiyW7p6cThTELbEaSsmvhECK5W2Z0QYQxba5M8Zf/WFTvHdi4Iv1/KOyrxV4xhJp1E X-Received: by 2002:a05:6402:b6c:: with SMTP id cb12mr2549434edb.116.1596178577596; Thu, 30 Jul 2020 23:56:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596178577; cv=none; d=google.com; s=arc-20160816; b=wafvhuCY6p8+o4mxGsqrqYwrePk4NGDFeyxSqZc6rnZoFyw3g2EPFVgMqml/0PSeUO FdPrYgaxUmW81TNwmJxIj0hEIeImtLyObx9T8+NP08vMDm5ltBilw+LpTs7NFXsi5HAC C/xhprmmIuh8Mi875Ym/LU5b3CKmWpA5k3l9jqYzxXMczwYkJBbJEBsSxAwccnObA8Ym 5T5hcEM7z4gbaDaioDdZ8if9BZ7Ak/ClMIw8SQMc0525mfjJ1cHX9Bkb1WaQzg/kFeJ7 VriDZISM0pIWF1By9fVEASaPp4xv5MwtgSdJjlpsB2ed1AO6+WRNA/JloggzIha8Egpr 0k+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=ddULUPmve2Ih4FDIGVaZL8hkWKq+zZCtd1KIQB4rlVc=; b=XDvJ/W/CeOIfd85bbkIs8PlgV2usPWiMy0MYR6JQhaFWMAfP7qyh4e1GZAizCb/WvC OHsjUYRneBsIXW3Xesjoz/gRahWEW0r5/qSjV/GZRKHWZqxnFf9u61BarvZttr9/J9oF hRunatEYaD/dWV5W0JU2ipwdKsD0ZKSxCoGjJSBb7UhC0/XtAFcP1WYAkdlYuPEZGbL8 SzYL1EcF7Kw3GxpO/u/iBkn4Mq4eyoKnWmD1PxMW0WCOMX/xPQceiQO5vfY6iwb1OiTr GCxFye1PeP9jzNmtaCk3j3phTJLrGQ7eGTxPwvUsKPCYze6QDXQYUOV1VQPtKjYHPMPI pyEg== 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 pk23si4704571ejb.488.2020.07.30.23.55.55; Thu, 30 Jul 2020 23:56:17 -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 S1731478AbgGaGy0 (ORCPT + 99 others); Fri, 31 Jul 2020 02:54:26 -0400 Received: from mail-il1-f194.google.com ([209.85.166.194]:46330 "EHLO mail-il1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731224AbgGaGyZ (ORCPT ); Fri, 31 Jul 2020 02:54:25 -0400 Received: by mail-il1-f194.google.com with SMTP id l17so14326265ilq.13; Thu, 30 Jul 2020 23:54:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ddULUPmve2Ih4FDIGVaZL8hkWKq+zZCtd1KIQB4rlVc=; b=suKKRghKfTq6JZ9jPMggQB5fgmzLcCUZXN7OykBu0SFEz3om9ijn+A+1wWOA7SNyv+ ApXb+wgEPJ4yT1LYyKm3n3WvZ5wfFS9bJZH+pXi5teWzEEmmhU7wGyJEPYv30jP3Hk01 5jWeMtphz7366A8QfHclNVChsfOGL91Q6qS6X0Spem1HjuXs+eSpPpFAZ7RLI0n2nyic qR87ZA8vSnGToUAGXg2VO62YdwiB54xjX3xsFjoUsHO32CmEMTOTfvmqtEMbVCOw1Xd3 3WKREVcYGUDQBzyKytUK4fqlxKRFDsoMwH57ZI0lcjORfoIRn3LdLCdZn5Yhsn4FGtzj EXMw== X-Gm-Message-State: AOAM533U5toP8E1cmbvbsvzZ6LBB1owqfevBxqu8o0ohhmmAueIdoFKo RcyZFpb6AMnGiyHzTjypMVsM2wsqmXfpvDRKAKk= X-Received: by 2002:a92:d64d:: with SMTP id x13mr2302391ilp.287.1596178464410; Thu, 30 Jul 2020 23:54:24 -0700 (PDT) MIME-Version: 1.0 References: <20200731041018.1381642-1-jiaxun.yang@flygoat.com> <20200731061702.fxdfyxpvd6qrhoql@mobilestation> In-Reply-To: <20200731061702.fxdfyxpvd6qrhoql@mobilestation> From: Huacai Chen Date: Fri, 31 Jul 2020 14:54:12 +0800 Message-ID: Subject: Re: [PATCH] MIPS: Provide Kconfig option for default IEEE754 conformance mode To: Serge Semin Cc: Jiaxun Yang , Serge Semin , "open list:MIPS" , Thomas Bogendoerfer , Paul Burton , Zhou Yanjie , =?UTF-8?B?5ZGo55Cw5p2wIChaaG91IFlhbmppZSk=?= , Liangliang Huang , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reviewed-by: Huacai Chen On Fri, Jul 31, 2020 at 2:18 PM Serge Semin wrote: > > 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 > >