@@ -223,11 +223,11 @@ def writemsr(msr, val):
223
223
except (IOError , OSError ) as e :
224
224
if e .errno == EPERM or e .errno == EACCES :
225
225
fatal (
226
- 'Unable to write to MSR {:x}. Try to disable Secure Boot '
227
- 'and check if your kernel does not restrict access to MSR.' .format (msr )
226
+ 'Unable to write to MSR {} ({ :x}) . Try to disable Secure Boot '
227
+ 'and check if your kernel does not restrict access to MSR.' .format (msr , MSR_DICT [ msr ] )
228
228
)
229
229
elif e .errno == EIO :
230
- fatal ('Unable to write to MSR {:x}. Unknown error.' .format (msr ))
230
+ fatal ('Unable to write to MSR {} ({ :x}) . Unknown error.' .format (msr , MSR_DICT [ msr ] ))
231
231
else :
232
232
raise e
233
233
@@ -253,14 +253,14 @@ def readmsr(msr, from_bit=0, to_bit=63, cpu=None, flatten=False):
253
253
output .append (get_value_for_bits (val , from_bit , to_bit ))
254
254
if flatten :
255
255
if len (set (output )) > 1 :
256
- warning ('Found multiple values for {:s} (0x {:x}). This should never happen.' )
256
+ warning ('Found multiple values for {:s} ({:x}). This should never happen.' . format ( msr , MSR_DICT [ msr ]) )
257
257
return output [0 ]
258
258
return output [cpu ] if cpu is not None else output
259
259
except (IOError , OSError ) as e :
260
260
if e .errno == EPERM or e .errno == EACCES :
261
- fatal ('Unable to read from MSR {:x}. Try to disable Secure Boot.' .format (msr ))
261
+ fatal ('Unable to read from MSR {} ({ :x}) . Try to disable Secure Boot.' .format (msr , MSR_DICT [ msr ] ))
262
262
elif e .errno == EIO :
263
- fatal ('Unable to read to MSR {:x}. Unknown error.' .format (msr ))
263
+ fatal ('Unable to read to MSR {} ({ :x}) . Unknown error.' .format (msr , MSR_DICT [ msr ] ))
264
264
else :
265
265
raise e
266
266
0 commit comments