[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211214102619.GA25456@yangzhon-Virtual>
Date: Tue, 14 Dec 2021 18:26:19 +0800
From: Yang Zhong <yang.zhong@...el.com>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: x86@...nel.org, kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com, seanjc@...gle.com,
jun.nakajima@...el.com, kevin.tian@...el.com,
jing2.liu@...ux.intel.com, jing2.liu@...el.com,
yang.zhong@...el.com
Subject: Re: [PATCH 10/19] kvm: x86: Emulate WRMSR of guest IA32_XFD
On Fri, Dec 10, 2021 at 05:02:49PM +0100, Paolo Bonzini wrote:
> First, the MSR should be added to msrs_to_save_all and
> kvm_cpu_cap_has(X86_FEATURE_XFD) should be checked in
> kvm_init_msr_list.
>
> It seems that RDMSR support is missing, too.
>
> More important, please include:
>
> - documentation for the new KVM_EXIT_* value
>
> - a selftest that explains how userspace should react to it.
>
> This is a strong requirement for any new API (the first has been for
> years; but the latter is also almost always respected these days).
> This series should not have been submitted without documentation.
>
> 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). However, if XFD is nonzero and
> kvm_check_guest_realloc_fpstate returns true, then it should return
> 1.
>
> The selftest should also cover using KVM_GET_MSR/KVM_SET_MSR.
>
Paolo, Seems we do not need new KVM_EXIT_* again from below thomas' new patchset:
git://git.kernel.org/pub/scm/linux/kernel/git/people/tglx/devel.git x86/fpu-kvm
So the selftest stll need support KVM_GET_MSR/KVM_SET_MSR for MSR_IA32_XFD
and MSR_IA32_XFD_ERR? If yes, we only do some read/write test with vcpu_set_msr()/
vcpu_get_msr() from new selftest tool? or do wrmsr from guest side and check this value
from selftest side?
I checked some msr selftest reference code, tsc_msrs_test.c, which maybe better for this
reference. If you have better suggestion, please share it to me. thanks!
Yang
Powered by blists - more mailing lists