1
0
mirror of https://github.com/speed47/spectre-meltdown-checker synced 2024-11-07 06:33:38 +01:00

fix(write_msr): use /dev/zero instead of manually echoing zeroes

This commit is contained in:
Stéphane Lesimple 2018-03-25 12:53:50 +02:00
parent f191ec7884
commit b42d8f2f27

View File

@ -1280,7 +1280,7 @@ write_msr()
else else
# convert to decimal # convert to decimal
_msrindex=$(( $1 )) _msrindex=$(( $1 ))
_echo_nol -9 "\0\0\0\0\0\0\0\0" | dd of=/dev/cpu/"$2"/msr bs=8 count=1 seek="$_msrindex" oflag=seek_bytes 2>/dev/null; ret=$? dd if=/dev/zero of=/dev/cpu/"$2"/msr bs=8 count=1 seek="$_msrindex" oflag=seek_bytes 2>/dev/null; ret=$?
fi fi
_debug "write_msr: for cpu $2 on msr $1 ($_msrindex), ret=$ret" _debug "write_msr: for cpu $2 on msr $1 ($_msrindex), ret=$ret"
return $ret return $ret