do not ignore MSR=0 even if ignore_bad_msrs is set

This commit is contained in:
Stanislav Shwartsman 2022-07-30 19:53:10 +03:00
parent d576eaa7c1
commit cf03c00ef0

View File

@ -466,7 +466,7 @@ bool BX_CPP_AttrRegparmN(2) BX_CPU_C::handle_unknown_rdmsr(Bit32u index, Bit64u
// failed to find the MSR, could #GP or ignore it silently
BX_ERROR(("RDMSR: Unknown register %#x", index));
if (! BX_CPU_THIS_PTR ignore_bad_msrs)
if (! BX_CPU_THIS_PTR ignore_bad_msrs || ! index)
return 0; // will result in #GP fault due to unknown MSR
}
}
@ -1094,7 +1094,7 @@ bool BX_CPP_AttrRegparmN(2) BX_CPU_C::handle_unknown_wrmsr(Bit32u index, Bit64u
#endif
// failed to find the MSR, could #GP or ignore it silently
BX_ERROR(("WRMSR: Unknown register %#x", index));
if (! BX_CPU_THIS_PTR ignore_bad_msrs)
if (! BX_CPU_THIS_PTR ignore_bad_msrs || ! index)
return 0; // will result in #GP fault due to unknown MSR
}