In the arm platform, we do not have the "CPU family" as X86.
In the linux kernel, it is hardcode to set the "CPU architecuture:8"
which should be changed for arm v9 in future.
This patch adds "bios_family" field, which we can get from the DMI table.
In the ampere Altra platform, we can get the new lscpu output:
----------------------------------------------------------------
Architecture: aarch64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 160
On-line CPU(s) list: 0-159
Vendor ID: ARM
BIOS Vendor ID: Ampere(R)
Model name: Neoverse-N1
BIOS Model name: Ampere(R) Altra(R) Processor Q00-00 CPU @ 3.0GHz
BIOS CPU family: 257
Model: 1
Thread(s) per core: 1
----------------------------------------------------------------
[kzak@redhat.com: - s/sprintf/snprintf/]
Signed-off-by: Huang Shijie <shijie@os.amperecomputing.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
free(ct->model);
free(ct->modelname);
free(ct->bios_modelname);
+ free(ct->bios_family);
free(ct->revision); /* alternative for model (ppc) */
free(ct->stepping);
free(ct->bogomips);
di->processor_version = dmi_string(&h, data[0x10]);
di->current_speed = *((uint16_t *)(&data[0x16]));
di->part_num = dmi_string(&h, data[0x22]);
+
+ if (data[0x6] == 0xfe)
+ di->processor_family = *((uint16_t *)(&data[0x28]));
+ else
+ di->processor_family = data[0x6];
}
di->sockets++;
break;
di.current_speed/1000, (di.current_speed % 1000) / 100);
ct->bios_modelname = xstrdup(buf);
+ /* Get CPU family */
+ memset(buf, 0, sizeof(buf));
+ snprintf(buf, sizeof(buf), "%d", di.processor_family);
+ ct->bios_family = xstrdup(buf);
+
free(data);
return 0;
}
sec = add_summary_s(tb, sec, _("Model name:"), ct->modelname);
if (ct->bios_modelname)
add_summary_s(tb, sec, _("BIOS Model name:"), ct->bios_modelname);
+ if (ct->bios_family)
+ add_summary_s(tb, sec, _("BIOS CPU family:"), ct->bios_family);
if (ct->machinetype)
add_summary_s(tb, sec, _("Machine type:"), ct->machinetype);
if (ct->family)
char *model;
char *modelname;
char *bios_modelname; /* aarch64 */
+ char *bios_family; /* aarch64 */
char *revision; /* alternative for model (ppc) */
char *stepping;
char *bogomips;
int sockets;
/* Processor Information */
+ uint16_t processor_family;
char *processor_manufacturer;
char *processor_version;
uint16_t current_speed;