fix: rework read_msr for values > INT32_MAX (#507)

This commit is contained in:
Stéphane Lesimple
2026-03-30 20:53:13 +02:00
parent 72824deea5
commit 3d6acc460e
4 changed files with 41 additions and 30 deletions

View File

@@ -69,7 +69,8 @@ parse_cpu_details() {
read_msr 0x17
ret=$?
if [ $ret = $READ_MSR_RET_OK ]; then
cpu_platformid=$((1 << ((ret_read_msr_value >> 18) & 7)))
# platform ID (bits 52:50) = bits 18:20 of the upper 32-bit word
cpu_platformid=$((1 << ((ret_read_msr_value_hi >> 18) & 7)))
fi
fi