Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3281718iob; Sun, 1 May 2022 12:02:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytQXBKfWSURaVqWcGEjwSanwjuq314dFIFVmG6YzO0NFCTJJcw+8a6lPCXkNPAUBaqsMrs X-Received: by 2002:a05:6512:1509:b0:443:e7fa:1c68 with SMTP id bq9-20020a056512150900b00443e7fa1c68mr6791228lfb.58.1651431777166; Sun, 01 May 2022 12:02:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651431777; cv=none; d=google.com; s=arc-20160816; b=XKCpP2xADdlGZp13rs5TatdK6NLbXm3vgFzGe7bsvQ7hvrRIPYVh1hUsB97mtPYCYe Kq7Myd6qUvr7yKBwS1uvIPGtDh/PImPbTCq7gT3oPo5TSyK6qhE3QhwqWSYv3WlwAew8 PTh5v+OSp9rw8nDLcP3QrDOhjDWfMtf4Fo6AnK0wNsPY9uG+qKDhxm8wHG6NRGTnjXGJ i2wgwwEYUV9bG2+aLj7Y3GBOr7J/J78DcLwUckgvyNUL+GQVHcmh5D3+22oQRtZ9ge+P vct2MXiCv7NU2tEko5eR8wB0IngaGyItvha1MspZ60XiEu8RotxG1qVSShAzcvpyQHjx dDyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=KgbcOTFf2/WKEpwVwrAfufJJsMQ1jEMDr2aPY6Bjn1g=; b=JswiWttIfnK86w4Sqdb2z3Td5R0Ib3cQ+1dwYCWXZtLe0X9POoIcHe33uA+i3Wew9c cuhXnOr1I5TRrM23Okq9bwy6HV7PlYb+fApyT3/dTr1fzzmJnjCaEMb5N6dJlcbETehz Efu7YubUHWKEiiy7WWaSsoJ+A/epcECbupvBv80SnlXuFw0bVtQ5ns7p49bLIU61nL7w vhjSAZmGtZus43T591/DCus5Ml9rna6bE3UkalU/cQZl0SpFyM7KJ2ApYrBX+hakR0Sa igHBuI6Fcipy2W4kZK2mH0rlwXJQNl7Z1A7wNB2iiLQBuWvYNswYyuEWG7lm5LzB6jRL YvzA== 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 q6-20020a2e84c6000000b0024f0e868b76si12456041ljh.368.2022.05.01.12.02.30; Sun, 01 May 2022 12:02:57 -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 S1346508AbiEALiI (ORCPT + 99 others); Sun, 1 May 2022 07:38:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237006AbiEALiH (ORCPT ); Sun, 1 May 2022 07:38:07 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8EAD61BEB6; Sun, 1 May 2022 04:34:42 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 848F792009C; Sun, 1 May 2022 13:34:41 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 75AD092009B; Sun, 1 May 2022 12:34:41 +0100 (BST) Date: Sun, 1 May 2022 12:34:41 +0100 (BST) From: "Maciej W. Rozycki" To: Stephen Zhang cc: Thomas Bogendoerfer , liam.howlett@oracle.com, Geert Uytterhoeven , ebiederm@xmission.com, alobakin@pm.me, f.fainelli@gmail.com, paul@crapouillou.net, linux@roeck-us.net, anemo@mba.ocn.ne.jp, zhangshida@kylinos.cn, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org Subject: Re: [PATCH v3] MIPS: adding a safety check for cpu_has_fpu In-Reply-To: <20220501030956.786012-1-starzhangzsd@gmail.com> Message-ID: References: <20220501030956.786012-1-starzhangzsd@gmail.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,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 Sun, 1 May 2022, Stephen Zhang wrote: > diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h > index de8cb2ccb781..57ff0f8a507c 100644 > --- a/arch/mips/include/asm/cpu-features.h > +++ b/arch/mips/include/asm/cpu-features.h > @@ -134,6 +134,11 @@ > # endif > #else > # define raw_cpu_has_fpu cpu_has_fpu > +# ifndef CONFIG_MIPS_FP_SUPPORT > +# if cpu_has_fpu > +# error "Forcing `cpu_has_fpu' to non-zero is not supported" > +# endif > +# endif > #endif For this to work for `nofpu' the check has to be outside the conditional, possibly right below the comment we've been discussing. Maciej