Re: [RFC PATCH] lscpu: get more infomation when using "/sys/firmware/dmi/entries/4-0/raw"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 21, 2021 at 11:09:00AM +0000, Huang Shijie wrote:
> This patch gets more infomation for "BIOS Model name"
> from the file "/sys/firmware/dmi/entries/4-0/raw"
> 
> Before this patch, we can get the output from Centos 7.9:
>   ----------------------------------------------------
>   BIOS Vendor ID:                  Ampere(TM)
>   Model name:                     Neoverse-N1
>     BIOS Model name:               Ampere(TM) Altra(TM) Processor
>   ----------------------------------------------------
> 
>  After this patch, in Centos 7.9, we get:
>   ----------------------------------------------------
>   BIOS Vendor ID:                  Ampere(TM)
>   Model name:                     Neoverse-N1
>     BIOS Model name:               Ampere(TM) Altra(TM) Processor Q00-00 CPU @ 2.8GHz
>   ----------------------------------------------------
> 
> Signed-off-by: Huang Shijie <shijie@xxxxxxxxxxxxxxxxxxxxxx>
> ---
>  sys-utils/lscpu-arm.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/sys-utils/lscpu-arm.c b/sys-utils/lscpu-arm.c

> index 885aadc36..1af689649 100644
> --- a/sys-utils/lscpu-arm.c
> +++ b/sys-utils/lscpu-arm.c
> @@ -317,6 +317,8 @@ static int arm_rXpY_decode(struct lscpu_cputype *ct)
>  
>  #define PROC_MFR_OFFSET		0x07
>  #define PROC_VERSION_OFFSET	0x10
> +#define PROC_CURRENT_SPEED	0x16
> +#define PROC_PART_NUM		0x22
>  
>  /*
>   * Use firmware to get human readable names
> @@ -324,7 +326,8 @@ static int arm_rXpY_decode(struct lscpu_cputype *ct)
>  static int arm_smbios_decode(struct lscpu_cputype *ct)

I've lost in your patches :-) 

Your previous patch "[PATCH] lscpu: remove the old code" removes all
arm_smbios_decode() as it's unnecessary. This next patch tries to
extend arm_smbios_decode().

Anyway, I think it's good idea to "normalize" the model name to "%s %s CPU @ %d.%dGHz"
for all ARMs. It seems the same is suggesting:
https://github.com/karelzak/util-linux/pull/1364

 Karel


-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux