public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
From: Greg Ungerer <gerg@linux-m68k.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Linux/m68k <linux-m68k@vger.kernel.org>
Subject: Re: [PATCH 7/8] m68k: only generate FPU instructions of CONFIG_FPU
Date: Tue, 30 Aug 2016 09:58:50 +1000	[thread overview]
Message-ID: <dd16c1a3-5fe9-7d93-fb73-52f58ee91bcc@linux-m68k.org> (raw)
In-Reply-To: <CAMuHMdWZEG+mtX+339QbKVfaHXf6TsTs6dVvFsuBjaXDP9t8Rw@mail.gmail.com>

Hi Geert,

On 29/08/16 22:53, Geert Uytterhoeven wrote:
> Hi Greg,
> 
> On Mon, Aug 29, 2016 at 1:43 PM, Greg Ungerer <gerg@linux-m68k.org> wrote:
>> Most of the m68k code that supports a hardware FPU is surrounded by
>> CONFIG_FPU. Except this setup code in setup_mm.c. Be consistent and
>> surround these hardware FPU instructions with CONFIG_FPU instead of
>> a check based on CONFIG_M68KFPU_EMU_ONLY.
>>
>> The side effect of this is that we can now compile a kernel with no
>> m68k/ColdFire hardware support FPU instructions at all (if we do not
>> define CONFIG_FPU).
>>
>> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
>> ---
>>  arch/m68k/kernel/setup_mm.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/m68k/kernel/setup_mm.c b/arch/m68k/kernel/setup_mm.c
>> index 13f4640..00290c4 100644
>> --- a/arch/m68k/kernel/setup_mm.c
>> +++ b/arch/m68k/kernel/setup_mm.c
>> @@ -245,7 +245,7 @@ void __init setup_arch(char **cmdline_p)
>>          * We should really do our own FPU check at startup.
>>          * [what do we do with buggy 68LC040s? if we have problems
>>          *  with them, we should add a test to check_bugs() below] */
>> -#ifndef CONFIG_M68KFPU_EMU_ONLY
>> +#ifdef CONFIG_FPU
>>         /* clear the fpu if we have one */
>>         if (m68k_fputype & (FPU_68881|FPU_68882|FPU_68040|FPU_68060|FPU_COLDFIRE)) {
>>                 volatile int zero = 0;
> 
> This piece of code is now compiled in if CONFIG_M68KFPU_EMU_ONLY=y?

Yes, that is true. In that scenario I would expect m68k_fputype
to be 0. So it wouldn't be executed. 

The problem for me on ColdFire is that we currently do not
support the FPU emulation (the assembler for it is not ColdFire
clean). So in this case here we can't have CONFIG_M68KFPU_EMU_ONLY=y.

Would you prefer if it became:

  #if defined(CONFIG_FPU) && !defined(CONFIG_M68KFPU_EMU_ONL)

For the existing classic m68k machines they always currently
have CONFIG_FPU set. So that would be no change for them. And
for the ColdFire machines that do not have FPU hardware we are
good because CONFIG_FPU won't be set.

Regards
Greg

  reply	other threads:[~2016-08-29 23:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-29 11:43 [PATCH 0/8] m68k: prepare to support ColdFire M5441x MMU enabled Greg Ungerer
2016-08-29 11:43 ` [PATCH 1/8] m68k: move CONFIG_FPU set to per-CPU configuration Greg Ungerer
2016-08-29 11:43 ` [PATCH 2/8] m68k: set appropriate machine type for m5411x SoC platforms Greg Ungerer
2016-08-29 11:43 ` [PATCH 3/8] m68k: report correct FPU type on ColdFire MMU platforms Greg Ungerer
2016-08-29 11:43 ` [PATCH 4/8] m68k: move ColdFire _bootmem_alloc code Greg Ungerer
2016-08-29 11:43 ` [PATCH 5/8] m68k: generalize io memory region setup for ColdFire ACR registers Greg Ungerer
2016-08-29 11:43 ` [PATCH 6/8] m68k: always make available dump_fpu() Greg Ungerer
2016-08-29 11:43 ` [PATCH 7/8] m68k: only generate FPU instructions of CONFIG_FPU Greg Ungerer
2016-08-29 12:53   ` Geert Uytterhoeven
2016-08-29 23:58     ` Greg Ungerer [this message]
2016-08-30  6:26       ` Geert Uytterhoeven
2016-08-30  7:30         ` Greg Ungerer
2016-08-29 11:43 ` [PATCH 8/8] m68k: don't panic if no hardware FPU defined Greg Ungerer

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=dd16c1a3-5fe9-7d93-fb73-52f58ee91bcc@linux-m68k.org \
    --to=gerg@linux-m68k.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-m68k@vger.kernel.org \
    /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