diff mbox series

MIPS: Set better default CPU model and kernel code model

Message ID 20230408115936.6631-1-jiaxun.yang@flygoat.com (mailing list archive)
State Rejected
Headers show
Series MIPS: Set better default CPU model and kernel code model | expand

Commit Message

Jiaxun Yang April 8, 2023, 11:59 a.m. UTC
Set default CPU model to Release 2 CPUs (MIPS64R2 if 64 bit CPU
is present, otherwise MIPS32R2) to get better feature coverage
on various default configs.

Also set default kernel code model to 64 bit since nowadays it
doesn't make much sense to run 32 bit kernel on a 64 bit system.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 arch/mips/Kconfig | 3 +++
 1 file changed, 3 insertions(+)

Comments

Thomas Bogendoerfer April 12, 2023, 1:31 p.m. UTC | #1
On Sat, Apr 08, 2023 at 12:59:36PM +0100, Jiaxun Yang wrote:
> Set default CPU model to Release 2 CPUs (MIPS64R2 if 64 bit CPU
> is present, otherwise MIPS32R2) to get better feature coverage
> on various default configs.
> 
> Also set default kernel code model to 64 bit since nowadays it
> doesn't make much sense to run 32 bit kernel on a 64 bit system.
> 
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
>  arch/mips/Kconfig | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
> index ecc7a755fae6..1d681dd87bb0 100644
> --- a/arch/mips/Kconfig
> +++ b/arch/mips/Kconfig
> @@ -1260,6 +1260,8 @@ menu "CPU selection"
>  
>  choice
>  	prompt "CPU type"
> +	default CPU_MIPS64_R2 if SYS_HAS_CPU_MIPS64_R2
> +	default CPU_MIPS32_R2 if SYS_HAS_CPU_MIPS32_R2
>  	default CPU_R4X00

I don't think this makes things better. For systems with multiple
possible CPU choices it's quite easy to get a kernel compiled for
the wrong ISA.

>  
>  config CPU_LOONGSON64
> @@ -2007,6 +2009,7 @@ menu "Kernel type"
>  
>  choice
>  	prompt "Kernel code model"
> +	default 64BIT

I don't buy your "nowadays" argument. My SGI Indy still has 64Bit CPUs
and has not much reason to run a 64bit kernel.

Thomas.
Jiaxun Yang April 12, 2023, 2:42 p.m. UTC | #2
> 2023年4月12日 14:31,Thomas Bogendoerfer <tsbogend@alpha.franken.de> 写道:
> 
> On Sat, Apr 08, 2023 at 12:59:36PM +0100, Jiaxun Yang wrote:
>> Set default CPU model to Release 2 CPUs (MIPS64R2 if 64 bit CPU
>> is present, otherwise MIPS32R2) to get better feature coverage
>> on various default configs.
>> 
>> Also set default kernel code model to 64 bit since nowadays it
>> doesn't make much sense to run 32 bit kernel on a 64 bit system.
>> 
>> Reported-by: Guenter Roeck <linux@roeck-us.net>
>> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
>> ---
>> arch/mips/Kconfig | 3 +++
>> 1 file changed, 3 insertions(+)
>> 
>> diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
>> index ecc7a755fae6..1d681dd87bb0 100644
>> --- a/arch/mips/Kconfig
>> +++ b/arch/mips/Kconfig
>> @@ -1260,6 +1260,8 @@ menu "CPU selection"
>> 
>> choice
>> prompt "CPU type"
>> + default CPU_MIPS64_R2 if SYS_HAS_CPU_MIPS64_R2
>> + default CPU_MIPS32_R2 if SYS_HAS_CPU_MIPS32_R2
>> default CPU_R4X00
> 
> I don't think this makes things better. For systems with multiple
> possible CPU choices it's quite easy to get a kernel compiled for
> the wrong ISA.

Well this is only for best allmodconfig coverage.

Or at least:
default CPU_MIPS32_R2 if MIPS_GENERIC_KERNEL

Can make things better.

> 
>> 
>> config CPU_LOONGSON64
>> @@ -2007,6 +2009,7 @@ menu "Kernel type"
>> 
>> choice
>> prompt "Kernel code model"
>> + default 64BIT
> 
> I don't buy your "nowadays" argument. My SGI Indy still has 64Bit CPUs
> and has not much reason to run a 64bit kernel.

I see, I’ll leave it here.

Thanks
- Jiaxun

> 
> Thomas.
> 
> -- 
> Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
> good idea.                                                [ RFC1925, 2.3 ]
Thomas Bogendoerfer April 12, 2023, 3:29 p.m. UTC | #3
On Wed, Apr 12, 2023 at 03:42:21PM +0100, Jiaxun Yang wrote:
> 
> 
> > 2023年4月12日 14:31,Thomas Bogendoerfer <tsbogend@alpha.franken.de> 写道:
> > 
> > On Sat, Apr 08, 2023 at 12:59:36PM +0100, Jiaxun Yang wrote:
> >> Set default CPU model to Release 2 CPUs (MIPS64R2 if 64 bit CPU
> >> is present, otherwise MIPS32R2) to get better feature coverage
> >> on various default configs.
> >> 
> >> Also set default kernel code model to 64 bit since nowadays it
> >> doesn't make much sense to run 32 bit kernel on a 64 bit system.
> >> 
> >> Reported-by: Guenter Roeck <linux@roeck-us.net>
> >> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> >> ---
> >> arch/mips/Kconfig | 3 +++
> >> 1 file changed, 3 insertions(+)
> >> 
> >> diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
> >> index ecc7a755fae6..1d681dd87bb0 100644
> >> --- a/arch/mips/Kconfig
> >> +++ b/arch/mips/Kconfig
> >> @@ -1260,6 +1260,8 @@ menu "CPU selection"
> >> 
> >> choice
> >> prompt "CPU type"
> >> + default CPU_MIPS64_R2 if SYS_HAS_CPU_MIPS64_R2
> >> + default CPU_MIPS32_R2 if SYS_HAS_CPU_MIPS32_R2
> >> default CPU_R4X00
> > 
> > I don't think this makes things better. For systems with multiple
> > possible CPU choices it's quite easy to get a kernel compiled for
> > the wrong ISA.
> 
> Well this is only for best allmodconfig coverage.
> 
> Or at least:
> default CPU_MIPS32_R2 if MIPS_GENERIC_KERNEL
> 
> Can make things better.

not if there is the option SYS_HAS_CPU_R4X00 for MIPS_GENERIC_KERNEL
selected. I've reverted the commit doing this, but still this is
IMHO the wrong way forward.

Thomas.
diff mbox series

Patch

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index ecc7a755fae6..1d681dd87bb0 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1260,6 +1260,8 @@  menu "CPU selection"
 
 choice
 	prompt "CPU type"
+	default CPU_MIPS64_R2 if SYS_HAS_CPU_MIPS64_R2
+	default CPU_MIPS32_R2 if SYS_HAS_CPU_MIPS32_R2
 	default CPU_R4X00
 
 config CPU_LOONGSON64
@@ -2007,6 +2009,7 @@  menu "Kernel type"
 
 choice
 	prompt "Kernel code model"
+	default 64BIT
 	help
 	  You should only select this option if you have a workload that
 	  actually benefits from 64-bit processing or if your machine has