All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESENT PATCH] arm64: cpuinfo: Add "model name" in /proc/cpuinfo for 64bit tasks also
@ 2021-02-01 23:58 ` Tianling Shen
  0 siblings, 0 replies; 8+ messages in thread
From: Tianling Shen @ 2021-02-01 23:58 UTC (permalink / raw)
  Cc: Sumit Gupta, Tianling Shen, Catalin Marinas, Will Deacon,
	Anshuman Khandual, Suzuki K Poulose, Gustavo A. R. Silva,
	Vincenzo Frascino, Dave Martin, Arnd Bergmann, linux-arm-kernel,
	linux-kernel

From: Sumit Gupta <sumitg@nvidia.com>

Removed restriction of displaying model name for 32 bit tasks only.
This can be used for 64 bit tasks as well, and it's useful for some
tools that already parse this, such as coreutils `uname -p`, Ubuntu
model name display etc.

It should be like this:
```
$ cat '/proc/cpuinfo' | grep 'model name' | head -n 1
model name : ARMv8 Processor rev X (v8l)
```

Link: https://lore.kernel.org/lkml/1472461345-28219-1-git-send-email-sumitg@nvidia.com/

Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
Signed-off-by: Tianling Shen <cnsztl@gmail.com>
---
 arch/arm64/kernel/cpuinfo.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c
index 77605aec25fe..d69b4e486098 100644
--- a/arch/arm64/kernel/cpuinfo.c
+++ b/arch/arm64/kernel/cpuinfo.c
@@ -148,8 +148,7 @@ 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",
+		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",
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [RESENT PATCH] arm64: cpuinfo: Add "model name" in /proc/cpuinfo for 64bit tasks also
@ 2021-02-01 23:58 ` Tianling Shen
  0 siblings, 0 replies; 8+ messages in thread
From: Tianling Shen @ 2021-02-01 23:58 UTC (permalink / raw)
  Cc: Arnd Bergmann, Anshuman Khandual, Catalin Marinas,
	Suzuki K Poulose, Gustavo A. R. Silva, linux-kernel,
	Tianling Shen, Sumit Gupta, Vincenzo Frascino, Will Deacon,
	Dave Martin, linux-arm-kernel

From: Sumit Gupta <sumitg@nvidia.com>

Removed restriction of displaying model name for 32 bit tasks only.
This can be used for 64 bit tasks as well, and it's useful for some
tools that already parse this, such as coreutils `uname -p`, Ubuntu
model name display etc.

It should be like this:
```
$ cat '/proc/cpuinfo' | grep 'model name' | head -n 1
model name : ARMv8 Processor rev X (v8l)
```

Link: https://lore.kernel.org/lkml/1472461345-28219-1-git-send-email-sumitg@nvidia.com/

Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
Signed-off-by: Tianling Shen <cnsztl@gmail.com>
---
 arch/arm64/kernel/cpuinfo.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c
index 77605aec25fe..d69b4e486098 100644
--- a/arch/arm64/kernel/cpuinfo.c
+++ b/arch/arm64/kernel/cpuinfo.c
@@ -148,8 +148,7 @@ 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",
+		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",
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [RESENT PATCH] arm64: cpuinfo: Add "model name" in /proc/cpuinfo for 64bit tasks also
  2021-02-01 23:58 ` Tianling Shen
@ 2021-02-02 11:39   ` Catalin Marinas
  -1 siblings, 0 replies; 8+ messages in thread
From: Catalin Marinas @ 2021-02-02 11:39 UTC (permalink / raw)
  To: Tianling Shen
  Cc: Sumit Gupta, Will Deacon, Anshuman Khandual, Suzuki K Poulose,
	Gustavo A. R. Silva, Vincenzo Frascino, Dave Martin,
	Arnd Bergmann, linux-arm-kernel, linux-kernel

On Tue, Feb 02, 2021 at 07:58:09AM +0800, Tianling Shen wrote:
> From: Sumit Gupta <sumitg@nvidia.com>
> 
> Removed restriction of displaying model name for 32 bit tasks only.
> This can be used for 64 bit tasks as well, and it's useful for some
> tools that already parse this, such as coreutils `uname -p`, Ubuntu
> model name display etc.
> 
> It should be like this:
> ```
> $ cat '/proc/cpuinfo' | grep 'model name' | head -n 1
> model name : ARMv8 Processor rev X (v8l)
> ```
> 
> Link: https://lore.kernel.org/lkml/1472461345-28219-1-git-send-email-sumitg@nvidia.com/

The thread above already has arguments against this patch. Has anything
changed since?

-- 
Catalin

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RESENT PATCH] arm64: cpuinfo: Add "model name" in /proc/cpuinfo for 64bit tasks also
@ 2021-02-02 11:39   ` Catalin Marinas
  0 siblings, 0 replies; 8+ messages in thread
From: Catalin Marinas @ 2021-02-02 11:39 UTC (permalink / raw)
  To: Tianling Shen
  Cc: Arnd Bergmann, Suzuki K Poulose, Anshuman Khandual,
	Gustavo A. R. Silva, linux-kernel, Sumit Gupta,
	Vincenzo Frascino, Will Deacon, Dave Martin, linux-arm-kernel

On Tue, Feb 02, 2021 at 07:58:09AM +0800, Tianling Shen wrote:
> From: Sumit Gupta <sumitg@nvidia.com>
> 
> Removed restriction of displaying model name for 32 bit tasks only.
> This can be used for 64 bit tasks as well, and it's useful for some
> tools that already parse this, such as coreutils `uname -p`, Ubuntu
> model name display etc.
> 
> It should be like this:
> ```
> $ cat '/proc/cpuinfo' | grep 'model name' | head -n 1
> model name : ARMv8 Processor rev X (v8l)
> ```
> 
> Link: https://lore.kernel.org/lkml/1472461345-28219-1-git-send-email-sumitg@nvidia.com/

The thread above already has arguments against this patch. Has anything
changed since?

-- 
Catalin

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RESENT PATCH] arm64: cpuinfo: Add "model name" in /proc/cpuinfo for 64bit tasks also
  2021-02-02 11:39   ` Catalin Marinas
@ 2021-02-02 13:06     ` CN_SZTL
  -1 siblings, 0 replies; 8+ messages in thread
From: CN_SZTL @ 2021-02-02 13:06 UTC (permalink / raw)
  To: Catalin Marinas
  Cc: Sumit Gupta, Will Deacon, Anshuman Khandual, Suzuki K Poulose,
	Gustavo A. R. Silva, Vincenzo Frascino, Dave Martin,
	Arnd Bergmann, linux-arm-kernel, linux-kernel

From reply of the upstream patch:
https://lore.kernel.org/linux-arm-kernel/20160629195137.GA142854@google.com/

Brian Norris wrote:
```
What's the status on this patch? The previous patch (which was accepted
already) is indeed confusing, because ARM32 processes on an ARM64 system
are not necessarily setting PER_LINUX32.

I'm also curious, why was 'model name' removed from ARM64 in the first
place? Plenty of other architectures support a similar property, and
it's useful for some tools that already parse this, such as coreutils
`uname -p` on Gentoo (and presumably others -- my Ubuntu machine must be
similarly patched, as it supports `uname -p` on x86_64).
```

However, the restriction seems not so fairly:
Firstly, the ARM32, which is the purpose of the author making the code
works for,
with this restriction, even doesn't work in some cases.
Secondly, as the code works for both ARM32 and ARM64, what's the
significance of setting
such a restriction?
Thirdly, there're many tools and systems which parse this, so the
field actually makes sense.
For example, like what we have written in cpuinfo.c#L148, "Give glibc
what it expects".

So, in my option, it's fine to remove the restriction and let it work
for both architectures.


Catalin Marinas <catalin.marinas@arm.com> 于2021年2月2日周二 下午7:39写道:
>
> On Tue, Feb 02, 2021 at 07:58:09AM +0800, Tianling Shen wrote:
> > From: Sumit Gupta <sumitg@nvidia.com>
> >
> > Removed restriction of displaying model name for 32 bit tasks only.
> > This can be used for 64 bit tasks as well, and it's useful for some
> > tools that already parse this, such as coreutils `uname -p`, Ubuntu
> > model name display etc.
> >
> > It should be like this:
> > ```
> > $ cat '/proc/cpuinfo' | grep 'model name' | head -n 1
> > model name : ARMv8 Processor rev X (v8l)
> > ```
> >
> > Link: https://lore.kernel.org/lkml/1472461345-28219-1-git-send-email-sumitg@nvidia.com/
>
> The thread above already has arguments against this patch. Has anything
> changed since?
>
> --
> Catalin

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RESENT PATCH] arm64: cpuinfo: Add "model name" in /proc/cpuinfo for 64bit tasks also
@ 2021-02-02 13:06     ` CN_SZTL
  0 siblings, 0 replies; 8+ messages in thread
From: CN_SZTL @ 2021-02-02 13:06 UTC (permalink / raw)
  To: Catalin Marinas
  Cc: Arnd Bergmann, Suzuki K Poulose, Anshuman Khandual,
	Gustavo A. R. Silva, linux-kernel, Sumit Gupta,
	Vincenzo Frascino, Will Deacon, Dave Martin, linux-arm-kernel

From reply of the upstream patch:
https://lore.kernel.org/linux-arm-kernel/20160629195137.GA142854@google.com/

Brian Norris wrote:
```
What's the status on this patch? The previous patch (which was accepted
already) is indeed confusing, because ARM32 processes on an ARM64 system
are not necessarily setting PER_LINUX32.

I'm also curious, why was 'model name' removed from ARM64 in the first
place? Plenty of other architectures support a similar property, and
it's useful for some tools that already parse this, such as coreutils
`uname -p` on Gentoo (and presumably others -- my Ubuntu machine must be
similarly patched, as it supports `uname -p` on x86_64).
```

However, the restriction seems not so fairly:
Firstly, the ARM32, which is the purpose of the author making the code
works for,
with this restriction, even doesn't work in some cases.
Secondly, as the code works for both ARM32 and ARM64, what's the
significance of setting
such a restriction?
Thirdly, there're many tools and systems which parse this, so the
field actually makes sense.
For example, like what we have written in cpuinfo.c#L148, "Give glibc
what it expects".

So, in my option, it's fine to remove the restriction and let it work
for both architectures.


Catalin Marinas <catalin.marinas@arm.com> 于2021年2月2日周二 下午7:39写道:
>
> On Tue, Feb 02, 2021 at 07:58:09AM +0800, Tianling Shen wrote:
> > From: Sumit Gupta <sumitg@nvidia.com>
> >
> > Removed restriction of displaying model name for 32 bit tasks only.
> > This can be used for 64 bit tasks as well, and it's useful for some
> > tools that already parse this, such as coreutils `uname -p`, Ubuntu
> > model name display etc.
> >
> > It should be like this:
> > ```
> > $ cat '/proc/cpuinfo' | grep 'model name' | head -n 1
> > model name : ARMv8 Processor rev X (v8l)
> > ```
> >
> > Link: https://lore.kernel.org/lkml/1472461345-28219-1-git-send-email-sumitg@nvidia.com/
>
> The thread above already has arguments against this patch. Has anything
> changed since?
>
> --
> Catalin

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RESENT PATCH] arm64: cpuinfo: Add "model name" in /proc/cpuinfo for 64bit tasks also
  2021-02-01 23:58 ` Tianling Shen
@ 2021-02-02 13:09   ` Robin Murphy
  -1 siblings, 0 replies; 8+ messages in thread
From: Robin Murphy @ 2021-02-02 13:09 UTC (permalink / raw)
  To: Tianling Shen
  Cc: Arnd Bergmann, Anshuman Khandual, Catalin Marinas,
	Suzuki K Poulose, Gustavo A. R. Silva, linux-kernel, Sumit Gupta,
	Vincenzo Frascino, Will Deacon, Dave Martin, linux-arm-kernel

On 2021-02-01 23:58, Tianling Shen wrote:
> From: Sumit Gupta <sumitg@nvidia.com>
> 
> Removed restriction of displaying model name for 32 bit tasks only.
> This can be used for 64 bit tasks as well, and it's useful for some
> tools that already parse this, such as coreutils `uname -p`, Ubuntu
> model name display etc.

How exactly is it useful? It clearly isn't necessary for compatibility, 
since AArch64 userspace has apparently been running quite happily for 8 
years without it. It also doesn't convey anything meaningful to the 
user, since they already know they're on an Armv8-compatible processor 
by the fact that they're running AArch64 userspace at all.

Robin.

> It should be like this:
> ```
> $ cat '/proc/cpuinfo' | grep 'model name' | head -n 1
> model name : ARMv8 Processor rev X (v8l)
> ```
> 
> Link: https://lore.kernel.org/lkml/1472461345-28219-1-git-send-email-sumitg@nvidia.com/
> 
> Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
> Signed-off-by: Tianling Shen <cnsztl@gmail.com>
> ---
>   arch/arm64/kernel/cpuinfo.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c
> index 77605aec25fe..d69b4e486098 100644
> --- a/arch/arm64/kernel/cpuinfo.c
> +++ b/arch/arm64/kernel/cpuinfo.c
> @@ -148,8 +148,7 @@ 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",
> +		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",
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RESENT PATCH] arm64: cpuinfo: Add "model name" in /proc/cpuinfo for 64bit tasks also
@ 2021-02-02 13:09   ` Robin Murphy
  0 siblings, 0 replies; 8+ messages in thread
From: Robin Murphy @ 2021-02-02 13:09 UTC (permalink / raw)
  To: Tianling Shen
  Cc: Arnd Bergmann, Suzuki K Poulose, Catalin Marinas,
	Anshuman Khandual, linux-kernel, Gustavo A. R. Silva,
	Sumit Gupta, Vincenzo Frascino, Will Deacon, Dave Martin,
	linux-arm-kernel

On 2021-02-01 23:58, Tianling Shen wrote:
> From: Sumit Gupta <sumitg@nvidia.com>
> 
> Removed restriction of displaying model name for 32 bit tasks only.
> This can be used for 64 bit tasks as well, and it's useful for some
> tools that already parse this, such as coreutils `uname -p`, Ubuntu
> model name display etc.

How exactly is it useful? It clearly isn't necessary for compatibility, 
since AArch64 userspace has apparently been running quite happily for 8 
years without it. It also doesn't convey anything meaningful to the 
user, since they already know they're on an Armv8-compatible processor 
by the fact that they're running AArch64 userspace at all.

Robin.

> It should be like this:
> ```
> $ cat '/proc/cpuinfo' | grep 'model name' | head -n 1
> model name : ARMv8 Processor rev X (v8l)
> ```
> 
> Link: https://lore.kernel.org/lkml/1472461345-28219-1-git-send-email-sumitg@nvidia.com/
> 
> Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
> Signed-off-by: Tianling Shen <cnsztl@gmail.com>
> ---
>   arch/arm64/kernel/cpuinfo.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c
> index 77605aec25fe..d69b4e486098 100644
> --- a/arch/arm64/kernel/cpuinfo.c
> +++ b/arch/arm64/kernel/cpuinfo.c
> @@ -148,8 +148,7 @@ 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",
> +		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",
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-02-02 13:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-01 23:58 [RESENT PATCH] arm64: cpuinfo: Add "model name" in /proc/cpuinfo for 64bit tasks also Tianling Shen
2021-02-01 23:58 ` Tianling Shen
2021-02-02 11:39 ` Catalin Marinas
2021-02-02 11:39   ` Catalin Marinas
2021-02-02 13:06   ` CN_SZTL
2021-02-02 13:06     ` CN_SZTL
2021-02-02 13:09 ` Robin Murphy
2021-02-02 13:09   ` Robin Murphy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.