Skip to content

Commit

Permalink
fix(cpuid): fix off-by-one SPEC_CTRL bit check
Browse files Browse the repository at this point in the history
  • Loading branch information
speed47 committed Jan 24, 2018
1 parent 53b9eda commit 3c1d452
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spectre-meltdown-checker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -917,9 +917,9 @@ check_variant2()
# getting high byte of edx on leaf7 of cpuinfo in decimal
edx_hb=$(dd if=/dev/cpu/0/cpuid bs=16 skip=7 iflag=skip_bytes count=1 2>/dev/null | dd bs=1 skip=15 count=1 2>/dev/null | od -t u -A n | awk '{print $1}')
_debug "cpuid: leaf7 edx higher byte: $edx_hb (decimal)"
edx_bit26=$(( edx_hb & 8 ))
edx_bit26=$(( edx_hb & 4 ))
_debug "cpuid: edx_bit26=$edx_bit26"
if [ "$edx_bit26" -eq 8 ]; then
if [ "$edx_bit26" -eq 4 ]; then
pstatus green YES "SPEC_CTRL feature bit"
cpuid_spec_ctrl=1
else
Expand Down

0 comments on commit 3c1d452

Please sign in to comment.