mirror of
https://github.com/speed47/spectre-meltdown-checker.git
synced 2026-01-26 04:10:31 +01:00
fix: set cpu_* vars to a default value
On ARM64 systems, /proc/cpuinfo uses different field names (CPU implementer, CPU variant, CPU part, CPU revision) instead of x86-style fields (cpu family, model, stepping). This left these variables empty, causing printf to fail with 'invalid number' errors when formatting them as hex values. Fixes #520.
This commit is contained in:
@@ -2309,6 +2309,11 @@ parse_cpu_details()
|
||||
# if we got no cpu_ucode (e.g. we're in a vm), fall back to 0x0
|
||||
: "${cpu_ucode:=0x0}"
|
||||
|
||||
# on non-x86 systems (e.g. ARM), these fields may not exist in cpuinfo, fall back to 0
|
||||
: "${cpu_family:=0}"
|
||||
: "${cpu_model:=0}"
|
||||
: "${cpu_stepping:=0}"
|
||||
|
||||
if [ -n "${SMC_MOCK_CPU_UCODE:-}" ]; then
|
||||
cpu_ucode="$SMC_MOCK_CPU_UCODE"
|
||||
_debug "parse_cpu_details: MOCKING cpu ucode to $cpu_ucode"
|
||||
|
||||
Reference in New Issue
Block a user