mirror of
https://github.com/speed47/spectre-meltdown-checker.git
synced 2024-12-05 02:38:04 +01:00
chore: only attempt to load msr and cpuid module once
This commit is contained in:
parent
ba131fcd2f
commit
3679776f3c
@ -1413,6 +1413,10 @@ mount_debugfs()
|
||||
|
||||
load_msr()
|
||||
{
|
||||
# only attempt to do it once even if called multiple times
|
||||
[ "$load_msr_once" = 1 ] && return
|
||||
load_msr_once=1
|
||||
|
||||
if [ "$os" = Linux ]; then
|
||||
if ! grep -qw msr "$procfs/modules" 2>/dev/null; then
|
||||
modprobe msr 2>/dev/null && insmod_msr=1
|
||||
@ -1432,6 +1436,10 @@ load_msr()
|
||||
|
||||
load_cpuid()
|
||||
{
|
||||
# only attempt to do it once even if called multiple times
|
||||
[ "$load_cpuid_once" = 1 ] && return
|
||||
load_cpuid_once=1
|
||||
|
||||
if [ "$os" = Linux ]; then
|
||||
if ! grep -qw cpuid "$procfs/modules" 2>/dev/null; then
|
||||
modprobe cpuid 2>/dev/null && insmod_cpuid=1
|
||||
|
Loading…
Reference in New Issue
Block a user