mirror of
https://github.com/speed47/spectre-meltdown-checker.git
synced 2025-04-19 04:35:17 +02: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()
|
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 [ "$os" = Linux ]; then
|
||||||
if ! grep -qw msr "$procfs/modules" 2>/dev/null; then
|
if ! grep -qw msr "$procfs/modules" 2>/dev/null; then
|
||||||
modprobe msr 2>/dev/null && insmod_msr=1
|
modprobe msr 2>/dev/null && insmod_msr=1
|
||||||
@ -1432,6 +1436,10 @@ load_msr()
|
|||||||
|
|
||||||
load_cpuid()
|
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 [ "$os" = Linux ]; then
|
||||||
if ! grep -qw cpuid "$procfs/modules" 2>/dev/null; then
|
if ! grep -qw cpuid "$procfs/modules" 2>/dev/null; then
|
||||||
modprobe cpuid 2>/dev/null && insmod_cpuid=1
|
modprobe cpuid 2>/dev/null && insmod_cpuid=1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user