lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1670075656-4754-1-git-send-email-yangtiezhu@loongson.cn>
Date:   Sat,  3 Dec 2022 21:54:16 +0800
From:   Tiezhu Yang <yangtiezhu@...ngson.cn>
To:     Huacai Chen <chenhuacai@...nel.org>,
        WANG Xuerui <kernel@...0n.name>
Cc:     loongarch@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: [PATCH] LoongArch: Make lscpu show "Model name" and "CPU family"

When update the latest kernel on LoongArch, and then use lscpu command
to show cpuinfo, we can not see "Model name" and "CPU family", this is
because there are no matched patterns in /proc/cpuinfo, use small letter
of "Model Name" and "CPU Family" in show_cpuinfo() to fix it.

Here is the related code of lscpu:

static const struct cpuinfo_pattern type_patterns[] =
{
...
        DEF_PAT_CPUTYPE( "cpu family",          PAT_FAMILY,     family),
...
        DEF_PAT_CPUTYPE( "model name",          PAT_MODEL_NAME, modelname),
...
};

Link: https://github.com/util-linux/util-linux/blob/master/sys-utils/lscpu-cputype.c
Fixes: 7153c3cbb5b9 ("LoongArch: Add misc common routines")
Signed-off-by: Tiezhu Yang <yangtiezhu@...ngson.cn>
---
 arch/loongarch/kernel/proc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/loongarch/kernel/proc.c b/arch/loongarch/kernel/proc.c
index 5c67cc4..eafd1cf 100644
--- a/arch/loongarch/kernel/proc.c
+++ b/arch/loongarch/kernel/proc.c
@@ -49,8 +49,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 	seq_printf(m, "processor\t\t: %ld\n", n);
 	seq_printf(m, "package\t\t\t: %d\n", cpu_data[n].package);
 	seq_printf(m, "core\t\t\t: %d\n", cpu_data[n].core);
-	seq_printf(m, "CPU Family\t\t: %s\n", __cpu_family[n]);
-	seq_printf(m, "Model Name\t\t: %s\n", __cpu_full_name[n]);
+	seq_printf(m, "cpu family\t\t: %s\n", __cpu_family[n]);
+	seq_printf(m, "model name\t\t: %s\n", __cpu_full_name[n]);
 	seq_printf(m, "CPU Revision\t\t: 0x%02x\n", version);
 	seq_printf(m, "FPU Revision\t\t: 0x%02x\n", fp_version);
 	seq_printf(m, "CPU MHz\t\t\t: %llu.%02llu\n",
-- 
2.1.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ