Re: [PATCH] KVM: SVM: drop MSR_IA32_PERF_CAPABILITIES from emulated MSRs

From: Jim Mattson
Date: Wed Jun 17 2020 - 12:47:16 EST


On Wed, Jun 17, 2020 at 4:38 AM Vitaly Kuznetsov <vkuznets@xxxxxxxxxx> wrote:

> Side note: MSR_IA32_PERF_CAPABILITIES can be returned by both
> KVM_GET_MSR_INDEX_LIST and KVM_GET_MSR_FEATURE_INDEX_LIST as we have it
> both as an emulated MSR filtered by kvm_x86_ops.has_emulated_msr() and
> a feature msr filtered by kvm_x86_ops.get_msr_feature(). But the later
> is a whitelist so MSR_IA32_PERF_CAPABILITIES won't appear on AMD and the
> promise "can be passed to the KVM_GET_MSRS" is kept.

So, how is MSR_IA32_PERF_CAPABILITIES different from, say,
MSR_K7_HWCR, which by its very name doesn't sound like it would be
supported on Intel CPUs? Why not just emulate
MSR_IA32_PERF_CAPABILITIES on AMD, just as we emulate MSR_K7_HWCR on
Intel?

My concern is that we don't seem to have a standard here. Each
individual MSR is handled ad hoc, which adds unnecessary complexity.