Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1634032 > unrolled thread

[PATCH 1/1] arm64: Always provide "model name" in /proc/cpuinfo

Started byHeinrich Schuchardt <xypron.glpk@gmx.de>
First post2017-05-02 00:50 +0200
Last post2017-05-06 09:00 +0200
Articles 7 — 5 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/1] arm64: Always provide "model name" in /proc/cpuinfo Heinrich Schuchardt <xypron.glpk@gmx.de> - 2017-05-02 00:50 +0200
    Re: [PATCH 1/1] arm64: Always provide "model name" in /proc/cpuinfo Catalin Marinas <catalin.marinas@arm.com> - 2017-05-02 13:10 +0200
      Re: [PATCH 1/1] arm64: Always provide "model name" in /proc/cpuinfo Mark Rutland <mark.rutland@arm.com> - 2017-05-02 14:40 +0200
      Re: [PATCH 1/1] arm64: Always provide "model name" in /proc/cpuinfo Heinrich Schuchardt <xypron.glpk@gmx.de> - 2017-05-02 18:30 +0200
        Re: [PATCH 1/1] arm64: Always provide "model name" in /proc/cpuinfo Mark Rutland <mark.rutland@arm.com> - 2017-05-02 18:50 +0200
        Re: [PATCH 1/1] arm64: Always provide "model name" in /proc/cpuinfo Sudeep Holla <sudeep.holla@arm.com> - 2017-05-02 18:50 +0200
      Re: [PATCH 1/1] arm64: Always provide "model name" in /proc/cpuinfo Jon Masters <jcm@jonmasters.org> - 2017-05-06 09:00 +0200

#1634032 — [PATCH 1/1] arm64: Always provide "model name" in /proc/cpuinfo

FromHeinrich Schuchardt <xypron.glpk@gmx.de>
Date2017-05-02 00:50 +0200
Subject[PATCH 1/1] arm64: Always provide "model name" in /proc/cpuinfo
Message-ID<tCsiJ-6wM-5@gated-at.bofh.it>
There is no need to hide the model name in processes
that are not PER_LINUX32.

So let us always provide a model name that is easily readable.

Fixes: e47b020a323d ("arm64: Provide "model name" in /proc/cpuinfo for PER_LINUX32 tasks")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 arch/arm64/kernel/cpuinfo.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c
index b3d5b3e8fbcb..9ad9ddcd2f19 100644
--- a/arch/arm64/kernel/cpuinfo.c
+++ b/arch/arm64/kernel/cpuinfo.c
@@ -118,9 +118,8 @@ static int c_show(struct seq_file *m, void *v)
 		 * "processor".  Give glibc what it expects.
 		 */
 		seq_printf(m, "processor\t: %d\n", i);
-		if (compat)
-			seq_printf(m, "model name\t: ARMv8 Processor rev %d (%s)\n",
-				   MIDR_REVISION(midr), COMPAT_ELF_PLATFORM);
+		seq_printf(m, "model name\t: ARMv8 Processor rev %d (%s)\n",
+			   MIDR_REVISION(midr), COMPAT_ELF_PLATFORM);
 
 		seq_printf(m, "BogoMIPS\t: %lu.%02lu\n",
 			   loops_per_jiffy / (500000UL/HZ),
-- 
2.11.0

[toc] | [next] | [standalone]


#1634339

FromCatalin Marinas <catalin.marinas@arm.com>
Date2017-05-02 13:10 +0200
Message-ID<tCDQR-5Om-1@gated-at.bofh.it>
In reply to#1634032
On Tue, May 02, 2017 at 12:39:13AM +0200, Heinrich Schuchardt wrote:
> There is no need to hide the model name in processes
> that are not PER_LINUX32.
> 
> So let us always provide a model name that is easily readable.
> 
> Fixes: e47b020a323d ("arm64: Provide "model name" in /proc/cpuinfo for PER_LINUX32 tasks")
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  arch/arm64/kernel/cpuinfo.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c
> index b3d5b3e8fbcb..9ad9ddcd2f19 100644
> --- a/arch/arm64/kernel/cpuinfo.c
> +++ b/arch/arm64/kernel/cpuinfo.c
> @@ -118,9 +118,8 @@ static int c_show(struct seq_file *m, void *v)
>  		 * "processor".  Give glibc what it expects.
>  		 */
>  		seq_printf(m, "processor\t: %d\n", i);
> -		if (compat)
> -			seq_printf(m, "model name\t: ARMv8 Processor rev %d (%s)\n",
> -				   MIDR_REVISION(midr), COMPAT_ELF_PLATFORM);
> +		seq_printf(m, "model name\t: ARMv8 Processor rev %d (%s)\n",
> +			   MIDR_REVISION(midr), COMPAT_ELF_PLATFORM);
>  
>  		seq_printf(m, "BogoMIPS\t: %lu.%02lu\n",
>  			   loops_per_jiffy / (500000UL/HZ),

Such patch seems to come up regularly:

https://patchwork.kernel.org/patch/9303311/

(and it usually gets rejected)

-- 
Catalin

[toc] | [prev] | [next] | [standalone]


#1634383

FromMark Rutland <mark.rutland@arm.com>
Date2017-05-02 14:40 +0200
Message-ID<tCFfY-6Iv-27@gated-at.bofh.it>
In reply to#1634339
On Tue, May 02, 2017 at 12:08:27PM +0100, Catalin Marinas wrote:
> On Tue, May 02, 2017 at 12:39:13AM +0200, Heinrich Schuchardt wrote:
> > There is no need to hide the model name in processes
> > that are not PER_LINUX32.
> > 
> > So let us always provide a model name that is easily readable.
> > 
> > Fixes: e47b020a323d ("arm64: Provide "model name" in /proc/cpuinfo for PER_LINUX32 tasks")
> > Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> > ---
> >  arch/arm64/kernel/cpuinfo.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> > 
> > diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c
> > index b3d5b3e8fbcb..9ad9ddcd2f19 100644
> > --- a/arch/arm64/kernel/cpuinfo.c
> > +++ b/arch/arm64/kernel/cpuinfo.c
> > @@ -118,9 +118,8 @@ static int c_show(struct seq_file *m, void *v)
> >  		 * "processor".  Give glibc what it expects.
> >  		 */
> >  		seq_printf(m, "processor\t: %d\n", i);
> > -		if (compat)
> > -			seq_printf(m, "model name\t: ARMv8 Processor rev %d (%s)\n",
> > -				   MIDR_REVISION(midr), COMPAT_ELF_PLATFORM);
> > +		seq_printf(m, "model name\t: ARMv8 Processor rev %d (%s)\n",
> > +			   MIDR_REVISION(midr), COMPAT_ELF_PLATFORM);
> >  
> >  		seq_printf(m, "BogoMIPS\t: %lu.%02lu\n",
> >  			   loops_per_jiffy / (500000UL/HZ),
> 
> Such patch seems to come up regularly:
> 
> https://patchwork.kernel.org/patch/9303311/
> 
> (and it usually gets rejected)

Indeed; my comments from that previous discussion apply here.

In addition, the commit message above refers to this as fixing another
commit, but does not explain why the current behviour would be
considered a bug.

I do not think it makes sense to take this patch.

Thanks,
Mark.

[toc] | [prev] | [next] | [standalone]


#1634506

FromHeinrich Schuchardt <xypron.glpk@gmx.de>
Date2017-05-02 18:30 +0200
Message-ID<tCIQy-Fv-23@gated-at.bofh.it>
In reply to#1634339
On 05/02/2017 01:08 PM, Catalin Marinas wrote:
> On Tue, May 02, 2017 at 12:39:13AM +0200, Heinrich Schuchardt wrote:
>> There is no need to hide the model name in processes
>> that are not PER_LINUX32.
>>
>> So let us always provide a model name that is easily readable.
>>
>> Fixes: e47b020a323d ("arm64: Provide "model name" in /proc/cpuinfo for PER_LINUX32 tasks")
>> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>> ---
>>  arch/arm64/kernel/cpuinfo.c | 5 ++---
>>  1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c
>> index b3d5b3e8fbcb..9ad9ddcd2f19 100644
>> --- a/arch/arm64/kernel/cpuinfo.c
>> +++ b/arch/arm64/kernel/cpuinfo.c
>> @@ -118,9 +118,8 @@ static int c_show(struct seq_file *m, void *v)
>>  		 * "processor".  Give glibc what it expects.
>>  		 */
>>  		seq_printf(m, "processor\t: %d\n", i);
>> -		if (compat)
>> -			seq_printf(m, "model name\t: ARMv8 Processor rev %d (%s)\n",
>> -				   MIDR_REVISION(midr), COMPAT_ELF_PLATFORM);
>> +		seq_printf(m, "model name\t: ARMv8 Processor rev %d (%s)\n",
>> +			   MIDR_REVISION(midr), COMPAT_ELF_PLATFORM);
>>  
>>  		seq_printf(m, "BogoMIPS\t: %lu.%02lu\n",
>>  			   loops_per_jiffy / (500000UL/HZ),
> 
> Such patch seems to come up regularly:
> 
> https://patchwork.kernel.org/patch/9303311/
> 
> (and it usually gets rejected)
> 
Dear Catalin,

thank you for pointing me to the previous discussion. I understand that
adding model name in the current form would not provide sufficient
valuable information.

The real interesting thing in an ARM SOC is to see which CPU is A72,
A57, A53 or whatever.

This information is available from the device tree in the compatible
property of the individual CPUs
(/sys/firmware/devicetree/base/cpus/cpu@*/compatible), e.g.
compatible =3D "arm,cortex-a53", "arm,armv8";

I guess this information is the closest to the model name property on
other architectures that we can get.

Would exposing this information in /proc/cpuinfo as 'model name' make
sense to you?

Best regards

Heinrich

[toc] | [prev] | [next] | [standalone]


#1634524

FromMark Rutland <mark.rutland@arm.com>
Date2017-05-02 18:50 +0200
Message-ID<tCJ9U-LW-21@gated-at.bofh.it>
In reply to#1634506
On Tue, May 02, 2017 at 06:28:40PM +0200, Heinrich Schuchardt wrote:
> On 05/02/2017 01:08 PM, Catalin Marinas wrote:
> > On Tue, May 02, 2017 at 12:39:13AM +0200, Heinrich Schuchardt wrote:
> >> There is no need to hide the model name in processes
> >> that are not PER_LINUX32.
> >>
> >> So let us always provide a model name that is easily readable.
> >>
> >> Fixes: e47b020a323d ("arm64: Provide "model name" in /proc/cpuinfo for PER_LINUX32 tasks")
> >> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> >> ---
> >>  arch/arm64/kernel/cpuinfo.c | 5 ++---
> >>  1 file changed, 2 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c
> >> index b3d5b3e8fbcb..9ad9ddcd2f19 100644
> >> --- a/arch/arm64/kernel/cpuinfo.c
> >> +++ b/arch/arm64/kernel/cpuinfo.c
> >> @@ -118,9 +118,8 @@ static int c_show(struct seq_file *m, void *v)
> >>  		 * "processor".  Give glibc what it expects.
> >>  		 */
> >>  		seq_printf(m, "processor\t: %d\n", i);
> >> -		if (compat)
> >> -			seq_printf(m, "model name\t: ARMv8 Processor rev %d (%s)\n",
> >> -				   MIDR_REVISION(midr), COMPAT_ELF_PLATFORM);
> >> +		seq_printf(m, "model name\t: ARMv8 Processor rev %d (%s)\n",
> >> +			   MIDR_REVISION(midr), COMPAT_ELF_PLATFORM);
> >>  
> >>  		seq_printf(m, "BogoMIPS\t: %lu.%02lu\n",
> >>  			   loops_per_jiffy / (500000UL/HZ),
> > 
> > Such patch seems to come up regularly:
> > 
> > https://patchwork.kernel.org/patch/9303311/
> > 
> > (and it usually gets rejected)
> > 
> Dear Catalin,
> 
> thank you for pointing me to the previous discussion. I understand that
> adding model name in the current form would not provide sufficient
> valuable information.
> 
> The real interesting thing in an ARM SOC is to see which CPU is A72,
> A57, A53 or whatever.

This information can be derived from the MIDR fields exposed in
/proc/cpuninfo

e.g.

CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x1
CPU part        : 0xd07
CPU revision    : 2

... is a Cortex-A57.

> This information is available from the device tree in the compatible
> property of the individual CPUs
> (/sys/firmware/devicetree/base/cpus/cpu@*/compatible), e.g.
> compatible =3D "arm,cortex-a53", "arm,armv8";
> 
> I guess this information is the closest to the model name property on
> other architectures that we can get.
> 
> Would exposing this information in /proc/cpuinfo as 'model name' make
> sense to you?

I would disagree with exposing this, as in practice it is wrong in some
DTs, and it's not avaialble on ACPI systems.

We already expose the information necessary to derive the name, given a
lookup table in userspace. We don't have sufficient information to build
this in the kernel in all cases, so I don't think that we should attempt
to do so.

Thanks,
Mark.

[toc] | [prev] | [next] | [standalone]


#1634526

FromSudeep Holla <sudeep.holla@arm.com>
Date2017-05-02 18:50 +0200
Message-ID<tCJ9U-LW-19@gated-at.bofh.it>
In reply to#1634506

On 02/05/17 17:28, Heinrich Schuchardt wrote:
[...]

> The real interesting thing in an ARM SOC is to see which CPU is A72,
> A57, A53 or whatever.
> 
> This information is available from the device tree in the compatible
> property of the individual CPUs
> (/sys/firmware/devicetree/base/cpus/cpu@*/compatible), e.g.
> compatible =3D "arm,cortex-a53", "arm,armv8";
> 

You can refer "CPU part" in /proc/cpuinfo for the above information.

-- 
Regards,
Sudeep

[toc] | [prev] | [next] | [standalone]


#1636833

FromJon Masters <jcm@jonmasters.org>
Date2017-05-06 09:00 +0200
Message-ID<tE1R7-4Hf-1@gated-at.bofh.it>
In reply to#1634339
On 05/02/2017 07:08 AM, Catalin Marinas wrote:
> On Tue, May 02, 2017 at 12:39:13AM +0200, Heinrich Schuchardt wrote:
>> There is no need to hide the model name in processes
>> that are not PER_LINUX32.
>>
>> So let us always provide a model name that is easily readable.
>>
>> Fixes: e47b020a323d ("arm64: Provide "model name" in /proc/cpuinfo for PER_LINUX32 tasks")
>> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>> ---
>>  arch/arm64/kernel/cpuinfo.c | 5 ++---
>>  1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c
>> index b3d5b3e8fbcb..9ad9ddcd2f19 100644
>> --- a/arch/arm64/kernel/cpuinfo.c
>> +++ b/arch/arm64/kernel/cpuinfo.c
>> @@ -118,9 +118,8 @@ static int c_show(struct seq_file *m, void *v)
>>  		 * "processor".  Give glibc what it expects.
>>  		 */
>>  		seq_printf(m, "processor\t: %d\n", i);
>> -		if (compat)
>> -			seq_printf(m, "model name\t: ARMv8 Processor rev %d (%s)\n",
>> -				   MIDR_REVISION(midr), COMPAT_ELF_PLATFORM);
>> +		seq_printf(m, "model name\t: ARMv8 Processor rev %d (%s)\n",
>> +			   MIDR_REVISION(midr), COMPAT_ELF_PLATFORM);
>>  
>>  		seq_printf(m, "BogoMIPS\t: %lu.%02lu\n",
>>  			   loops_per_jiffy / (500000UL/HZ),
> 
> Such patch seems to come up regularly:
> 
> https://patchwork.kernel.org/patch/9303311/
> 
> (and it usually gets rejected)

Side note: I'm in the process of reviving a standardization discussion
around server and model information, and we'll be coming back with an
agenda to get this information in /proc/cpuinfo in coming months.

Jon.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web