aboutsummaryrefslogtreecommitdiffstats
path: root/sys-utils/lscpu-arm.c
diff options
context:
space:
mode:
authorMasayoshi Mizuma <m.mizuma@jp.fujitsu.com>2020-11-13 10:06:26 +0100
committerKarel Zak <kzak@redhat.com>2020-11-13 10:06:26 +0100
commit8014104bea78f6f82cb82e16329b562e60ecdc87 (patch)
tree18b7aabd095caab2dac59b4bc867d88f81bbe90e /sys-utils/lscpu-arm.c
parentdbc27723057544f56e70a9c84202dc7053518556 (diff)
downloadutil-linux-8014104bea78f6f82cb82e16329b562e60ecdc87.tar.gz
lscpu-arm: Add "BIOS Vendor ID" and "BIOS Model name" to show the SMBIOS information.
After commit: 367c85c47 ("lscpu: use SMBIOS tables on ARM for lscpu"), Model name for A64FX shows like as: Model name: 461F0010 That's because 367c85c47 changes to get the modelname from Processor Version of SMBIOS. To fix that, use the hard corded table to show the "Model name" and add two new lines; "BIOS Vendor ID" and "BIOS Model name" to show the SMBIOS information. lscpu shows the SMBIOS information when root user runs it because accessing the SMBIOS information requires root privilege. [kzak@redhat.com: - port the patch to new lscpu code] Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/lscpu-arm.c')
-rw-r--r--sys-utils/lscpu-arm.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/sys-utils/lscpu-arm.c b/sys-utils/lscpu-arm.c
index 73c8b45f32..1cbc9775fa 100644
--- a/sys-utils/lscpu-arm.c
+++ b/sys-utils/lscpu-arm.c
@@ -283,7 +283,7 @@ done:
}
/* use "rXpY" string as stepping */
-static int arm_decode_rXpY(struct lscpu_cputype *ct)
+static int arm_rXpY_decode(struct lscpu_cputype *ct)
{
int impl, revision, variant;
char *end = NULL;
@@ -340,13 +340,13 @@ static int arm_smbios_decode(struct lscpu_cputype *ct)
str = dmi_string(&h, data[PROC_MFR_OFFSET]);
if (str) {
xstrncpy(buf, str, 127);
- ct->vendor = xstrdup(buf);
+ ct->bios_vendor = xstrdup(buf);
}
str = dmi_string(&h, data[PROC_VERSION_OFFSET]);
if (str) {
xstrncpy(buf, str, 127);
- ct->modelname = xstrdup(buf);
+ ct->bios_modelname = xstrdup(buf);
}
return 0;
@@ -354,17 +354,12 @@ static int arm_smbios_decode(struct lscpu_cputype *ct)
static void arm_decode(struct lscpu_cxt *cxt, struct lscpu_cputype *ct)
{
- int rc = -1;
-
- /* use SMBIOS Type 4 data if available, else fall back to manual
- * decoding using the tables above
- */
+ /* use SMBIOS Type 4 data if available */
if (!cxt->noalive && access(_PATH_SYS_DMI_TYPE4, R_OK) == 0)
- rc = arm_smbios_decode(ct);
- if (rc)
- arm_ids_decode(ct);
+ arm_smbios_decode(ct);
- arm_decode_rXpY(ct);
+ arm_ids_decode(ct);
+ arm_rXpY_decode(ct);
}
void lscpu_decode_arm(struct lscpu_cxt *cxt)