mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Stephen Zhang <starzhangzsd@gmail.com>
Cc: macro@orcam.me.uk, liam.howlett@oracle.com, geert@linux-m68k.org,
	ebiederm@xmission.com, dbueso@suse.de, 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 v4] MIPS: adding a safety check for cpu_has_fpu
Date: Wed, 4 May 2022 22:28:22 +0200	[thread overview]
Message-ID: <20220504202822.GB23391@alpha.franken.de> (raw)
In-Reply-To: <20220502032002.840029-1-starzhangzsd@gmail.com>

On Mon, May 02, 2022 at 11:20:02AM +0800, Stephen Zhang wrote:
> From: Shida Zhang <zhangshida@kylinos.cn>
> 
> There is a chance 'cpu_has_fpu' would still be overridden when the
> CONFIG_MIPS_FP_SUPPORT configuration option has been disabled. So
> add a safety check for 'cpu_has_fpu'.
> 
> Suggested-by: Maciej W. Rozycki <macro@orcam.me.uk>
> Signed-off-by: Shida Zhang <zhangshida@kylinos.cn>
> ---
>  Changelog in v1 -> v2:
>  - Choose to redefine cpu_has_fpu to solve the problem silently.
> 
>  Changelog in v2 -> v3:
>  - Choose to point out the error instead.
> 
>  Changelog in v3 -> v4:
>  - Make the check work for 'nofpu' option.
> 
>  arch/mips/include/asm/cpu-features.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h
> index de8cb2ccb781..c0983130a44c 100644
> --- a/arch/mips/include/asm/cpu-features.h
> +++ b/arch/mips/include/asm/cpu-features.h
> @@ -133,6 +133,9 @@
>  #  define raw_cpu_has_fpu	0
>  # endif
>  #else
> +# if cpu_has_fpu
> +#  error "Forcing `cpu_has_fpu' to non-zero is not supported"
> +# endif
>  # define raw_cpu_has_fpu	cpu_has_fpu
>  #endif
>  #ifndef cpu_has_32fpr
> -- 
> 2.30.2

applied to mips-next.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

      reply	other threads:[~2022-05-04 20:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-02  3:20 Stephen Zhang
2022-05-04 20:28 ` Thomas Bogendoerfer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220504202822.GB23391@alpha.franken.de \
    --to=tsbogend@alpha.franken.de \
    --cc=alobakin@pm.me \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=dbueso@suse.de \
    --cc=ebiederm@xmission.com \
    --cc=f.fainelli@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=liam.howlett@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=macro@orcam.me.uk \
    --cc=paul@crapouillou.net \
    --cc=starzhangzsd@gmail.com \
    --cc=zhangshida@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®