On 03/01/20 15:32, Li Qiang wrote:
> The ioctl(KVM_CAP_GET_MSR_FEATURES) is quite new. In old platform that
> doesn't support this ioctl will sometimes make the user confusion. For
> example, when we do nested virtualiztion using host-passthrough model
> the VM will has quite different cpu feature with the host.
>
> Signed-off-by: Li Qiang <liq3ea@163.com>
> ---
> target/i386/kvm.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/target/i386/kvm.c b/target/i386/kvm.c
> index 0b511906e3..9688f7a167 100644
> --- a/target/i386/kvm.c
> +++ b/target/i386/kvm.c
> @@ -1916,6 +1916,8 @@ static int kvm_get_supported_feature_msrs(KVMState *s)
> }
>
> if (!kvm_check_extension(s, KVM_CAP_GET_MSR_FEATURES)) {
> + info_report("ioctl(KVM_CAP_GET_MSR_FEATURES) is "
> + "not supported by this kernel.");
> return 0;
> }
Does this matter with host-passthrough? As long as "-cpu host,+vmx"
works with an old kernel, there's no reason to warn---and even then the
warning should:
1) be restricted to the nested case;
2) be emitted even if MSR features are supported but VMX MSRs are not.
Paolo