[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZIbYsBv43EcwLavy@chao-email>
Date: Mon, 12 Jun 2023 16:34:56 +0800
From: Chao Gao <chao.gao@...el.com>
To: Sean Christopherson <seanjc@...gle.com>
CC: Paolo Bonzini <pbonzini@...hat.com>, <kvm@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, Xiaoyao Li <xiaoyao.li@...el.com>,
"Pawan Gupta" <pawan.kumar.gupta@...ux.intel.com>
Subject: Re: [PATCH 1/2] KVM: x86: Snapshot host's MSR_IA32_ARCH_CAPABILITIES
On Tue, Jun 06, 2023 at 05:43:09PM -0700, Sean Christopherson wrote:
>Snapshot the host's MSR_IA32_ARCH_CAPABILITIES, if it's supported, instead
>of reading the MSR every time KVM wants to query the host state, e.g. when
>initializing the default value during vCPU creation. The paths that query
>ARCH_CAPABILITIES aren't particularly performance sensitive, but creating
>vCPUs is a frequent enough operation that burning 8 bytes is a good
>trade-off.
>
>Alternatively, KVM could add a field in kvm_caps and thus skip the
>on-demand calculations entirely, but a pure snapshot isn't possible due to
>the way KVM handles the l1tf_vmx_mitigation module param. And unlike the
>other "supported" fields in kvm_caps, KVM doesn't enforce the "supported"
>value, i.e. KVM treats ARCH_CAPABILITIES like a CPUID leaf and lets
>userspace advertise whatever it wants. Those problems are solvable, but
>it's not clear there is real benefit versus snapshotting the host value,
>and grabbing the host value will allow additional cleanup of KVM's
>FB_CLEAR_CTRL code.
>
>Link: https://lore.kernel.org/all/20230524061634.54141-2-chao.gao@intel.com
>Cc: Chao Gao <chao.gao@...el.com>
>Cc: Xiaoyao Li <xiaoyao.li@...el.com>
>Signed-off-by: Sean Christopherson <seanjc@...gle.com>
Reviewed-by: Chao Gao <chao.gao@...el.com>
Powered by blists - more mailing lists