[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ae5b0195-b04f-8eef-9e0d-2a46c761d2d5@redhat.com>
Date: Mon, 8 Feb 2021 11:25:07 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Jing Liu <jing2.liu@...ux.intel.com>, seanjc@...gle.com,
kvm@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, jing2.liu@...el.com
Subject: Re: [PATCH RFC 3/7] kvm: x86: XSAVE state and XFD MSRs context switch
On 07/02/21 16:42, Jing Liu wrote:
> |In KVM, "guest_fpu" serves for any guest task working on this vcpu
> during vmexit and vmenter. We provide a pre-allocated guest_fpu space
> and entire "guest_fpu.state_mask" to avoid each dynamic features
> detection on each vcpu task. Meanwhile, to ensure correctly
> xsaves/xrstors guest state, set IA32_XFD as zero during vmexit and vmenter.|
Most guests will not need the whole xstate feature set. So perhaps you
could set XFD to the host value | the guest value, trap #NM if the
host XFD is zero, and possibly reflect the exception to the guest's XFD
and XFD_ERR.
In addition, loading the guest XFD MSRs should use the MSR autoload
feature (add_atomic_switch_msr).
Paolo
Powered by blists - more mailing lists