RE: [PATCH 10/19] kvm: x86: Emulate WRMSR of guest IA32_XFD

Liu, Jing2
2021-12-13T07:51:36Z

On 12/11/2021 12:02 AM, Paolo Bonzini wrote:
>
> Also:
>
> On 12/8/21 01:03, Yang Zhong wrote:
> >
> > + if (!guest_cpuid_has(vcpu, X86_FEATURE_XFD))
> > + return 1;
>
> This should allow msr->host_initiated always (even if XFD is not part of
> CPUID).
Thanks Paolo.

msr->host_initiated handling would be added in next version.

I'd like to ask why always allow msr->host_initiated even if XFD is not part of
CPUID, although guest doesn't care that MSR? We found some MSRs
(e.g. MSR_AMD64_OSVW_STATUS and MSR_AMD64_OSVW_ID_LENGTH )
are specially handled so would like to know the consideration of allowing
msr->host_initiated.

if (!msr_info->host_initiated && !guest_cpuid_has(vcpu, X86_FEATURE_XFD))
return 1;

However, if XFD is nonzero and kvm_check_guest_realloc_fpstate
> returns true, then it should return 1.
>
If XFD is nonzero, kvm_check_guest_realloc_fpstate() won't return true. So
may not need this check here?

Thanks,
Jing

>
> Paolo