Page MenuHomeVyOS Platform

op-mode: "show hardware cpu" prints nothing on ARM64 bare-metal
Closed, ResolvedPublicBUG

Description

Summary

On ARM64 systems, show hardware cpu (and its alias show system cpu) prints nothing and exits with status 0. show hardware cpu summary prints the core count, but every model shows up as "unknown".

Root cause

The op-mode script reads /proc/cpuinfo and only prints the fields x86 CPUs provide: physical id, vendor_id, model name, cpu cores, cpu MHz. The ARM64 kernel exposes none of them. It only reports CPU implementer, CPU part, CPU variant, CPU revision, BogoMIPS and Features, so every line of the output template is skipped and the result is empty.

Example from a Banana Pi BPI-R4 (MediaTek MT7988A, 4x Cortex-A73):

vyos@vyos:~$ show hardware cpu
vyos@vyos:~$ show hardware cpu summary
Physical CPU cores: 4
CPU model(s): unknown, unknown, unknown, unknown

Proposed fix

Read CPU information from lscpu --json instead of /proc/cpuinfo. lscpu maps the ARM implementer/part IDs to vendor and model names, and reports sockets or clusters, cores, threads, and min/max frequency on both amd64 and arm64. It produces one record per CPU type, so heterogeneous (big.LITTLE) systems get one block per core type.

After the change, ARM64:

CPU Vendor:        ARM
Model:             Cortex-A73
Clusters:          1
Cores per cluster: 4
Threads per core:  1
Max MHz:           1800.0
Min MHz:           800.0

amd64 (KVM guest):

CPU Vendor:        GenuineIntel
Model:             12th Gen Intel(R) Core(TM) i5-12600H
Sockets:           1
Cores per socket:  2
Threads per core:  1

Behaviour changes

  • "Current MHz" is no longer shown. lscpu has no current-frequency field; show hardware cpu detail still prints the raw /proc/cpuinfo.
  • The --raw / API output of show uses new keys (vendor, model, sockets, clusters, cores_per_socket, cores_per_cluster, threads_per_core, max_mhz, min_mhz) instead of the /proc/cpuinfo field names.
  • Other users of vyos.utils.cpu.get_cpus() (system option, VPP, tech-support) are unchanged.

Details

Version
rolling
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)