Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2492618iob; Sat, 30 Apr 2022 10:00:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynWTddDd+ckesgjrQlpkh6FF6adImP9y7VNhflwP6ZxPP7thkKS2AePLTC15IqcXQ4q2tW X-Received: by 2002:a05:6512:33cb:b0:472:28a2:dfdc with SMTP id d11-20020a05651233cb00b0047228a2dfdcmr3563838lfg.430.1651338008042; Sat, 30 Apr 2022 10:00:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651338008; cv=none; d=google.com; s=arc-20160816; b=UNL+zEMR/weMpaOw6wSMkfMmP7u1EEWZ901fMNmvHdSz79N5aLhJ96evp38TinTNXb d12YxyDFFz8GrWeOJsKlOzRvdBnJHTyWDwdSFKSFT/0ycadkKHFhnNvaf/CA8ZPdo19W TiIWZoqZFZw6C+xiH3izzvvqsz6f7tZKqfI+lMDdYoTfsFShfq+jiN23Chnfy34efqYT iFNaJ6ArdJIFSY1AVQ9om4Hm7w5AmcIpuMLWNutDgkkYQSn5sorjMp4UYJ9IjlN2n/Br XCqOxLO6MD+GJdjg/zcWD3SIZeRs3WYydoFD0iHSUoKaR6LdsY0x4hPmuUYNvex0Uuya zYqA== 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=h82jP5ajE+1X6hMXxAWTuTKSOSz7XQtu/lE9AvLSvkc=; b=lKAnJOOOfqbNqdHJzYjVav6cv003aLS2tBaC2GBYOSJV/EKamnakkFmjrCRrh0jICY 6b92CiBDignwxXukFmMcs3tkeu6MfGudfn1l93rQOBLFAPGv+LiZ3mtrLj9fGK6YUssB J9PpR2PRHnLBLRS7EyAD/s/iDrJqaprh8e/4IN8vK3lYM0h/IdCKqgce/63U7k4/9Fkq eOQgm3HoGBkKWYgD2Nm/9+ESbWaQYMpMXyyH6RifEbL/Yj0eaYTqHZgljyea5gxFxnvK lA20uohcIIjBj9+FbsxSJx/88MJIJLjtUnbVYsWcvixHEu2F5+Oyt1XClIf5tDoh5QVj T2iw== 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 b26-20020a0565120b9a00b004725cb03cb0si1549049lfv.106.2022.04.30.09.59.35; Sat, 30 Apr 2022 10:00:07 -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 S1378128AbiD2PO7 (ORCPT + 99 others); Fri, 29 Apr 2022 11:14:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378115AbiD2PO6 (ORCPT ); Fri, 29 Apr 2022 11:14:58 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [78.133.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B163ED4477; Fri, 29 Apr 2022 08:11:39 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id C540B92009C; Fri, 29 Apr 2022 17:11:38 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id BEEC492009B; Fri, 29 Apr 2022 16:11:38 +0100 (BST) Date: Fri, 29 Apr 2022 16:11:38 +0100 (BST) From: "Maciej W. Rozycki" To: Thomas Bogendoerfer cc: Stephen Zhang , liam.howlett@oracle.com, 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 v2] MIPS: undefine and redefine cpu_has_fpu when it is overrided In-Reply-To: <20220429095104.GA11365@alpha.franken.de> Message-ID: References: <20220429032621.674865-1-starzhangzsd@gmail.com> <20220429095104.GA11365@alpha.franken.de> 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 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 Fri, 29 Apr 2022, Thomas Bogendoerfer wrote: > > diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h > > index de8cb2ccb781..38eb469008b6 100644 > > --- a/arch/mips/include/asm/cpu-features.h > > +++ b/arch/mips/include/asm/cpu-features.h > > @@ -134,6 +134,10 @@ > > # endif > > #else > > # define raw_cpu_has_fpu cpu_has_fpu > > +# ifndef CONFIG_MIPS_FP_SUPPORT > > +# undef cpu_has_fpu > > +# define cpu_has_fpu 0 > > +# endif > > #endif > > #ifndef cpu_has_32fpr > > #define cpu_has_32fpr __isa_ge_or_opt(1, MIPS_CPU_32FPR) > > -- > > 2.30.2 > > I prefer just removing the #defines from ip27/ip30 cpu-feasture-overrides.h. > Or isn't that enough for fixing the problem ? That's what I've meant, and I have now posted fixes, successfully build-tested. Additionally I've thought of adding something like: #if cpu_has_fpu # undef cpu_has_fpu #endif or maybe even: #if cpu_has_fpu # error "Forcing `cpu_has_fpu' to non-zero is not supported" #endif to arch/mips/include/asm/cpu-features.h, but maybe that's an overkill. Maciej