mirror of
https://github.com/speed47/spectre-meltdown-checker.git
synced 2026-04-11 11:13:21 +02:00
enh: guard x86/arm specific checks in kernel/cpu for the proper arch
This commit is contained in:
@@ -21,6 +21,28 @@ is_intel() {
|
||||
return 1
|
||||
}
|
||||
|
||||
# Check whether the host CPU is x86/x86_64.
|
||||
# Use this to gate CPUID, MSR, and microcode operations.
|
||||
# Returns: 0 if x86, 1 otherwise
|
||||
is_x86_cpu() {
|
||||
parse_cpu_details
|
||||
case "$cpu_vendor" in
|
||||
GenuineIntel | AuthenticAMD | HygonGenuine | CentaurHauls | Shanghai) return 0 ;;
|
||||
esac
|
||||
return 1
|
||||
}
|
||||
|
||||
# Check whether the host CPU is ARM/ARM64.
|
||||
# Use this to gate ARM-specific hardware checks.
|
||||
# Returns: 0 if ARM, 1 otherwise
|
||||
is_arm_cpu() {
|
||||
parse_cpu_details
|
||||
case "$cpu_vendor" in
|
||||
ARM | CAVIUM | PHYTIUM) return 0 ;;
|
||||
esac
|
||||
return 1
|
||||
}
|
||||
|
||||
# Check whether SMT (HyperThreading) is enabled on the system
|
||||
# Returns: 0 if SMT enabled, 1 otherwise
|
||||
is_cpu_smt_enabled() {
|
||||
|
||||
Reference in New Issue
Block a user