On 20/03/2018 18:35, Vitaly Kuznetsov wrote:
> + if (has_msr_hv_frequencies && env->tsc_khz) {
> env->features[FEAT_HYPERV_EAX] |= HV_ACCESS_FREQUENCY_MSRS;
> env->features[FEAT_HYPERV_EDX] |= HV_FREQUENCY_MSRS_AVAILABLE;
> }
Since you have added cpu->hyperv_reenlightenment, I'd rather change this
so that we don't make the "license to change guest ABI across migration"
apply more. We can exploit the fact that Windows doesn't even use the
MSRs unless either invtsc or re-enlightenment is present. Something
like this:
if (has_msr_hv_frequencies && env->tsc_khz &&
(tsc_is_stable_and_known(env) ||
cpu->hyperv_reenlightenment))
will make the MSRs visible in all useful cases, without having to add
yet another knob.
(Don't worry, this backwards-compatibility stuff is the hardest part.
I'm so happy that Eduardo is the one maintaining it :)).
Paolo