On 25/05/21 18:34, Sean Christopherson wrote:
I actually like the idea of storing the expected value in kvm_vcpu and the
current value in loaded_vmcs. We might use it for other things such as
reload_vmcs01_apic_access_page perhaps.
I'm not necessarily opposed to aggressively shadowing the VMCS, but if we go
that route then it should be a standalone series that implements a framework
that can be easily extended to arbitrary fields. Adding fields to loaded_vmcs
one at a time will be tedious and error prone. E.g. what makes TSC_MULTIPLIER
more special than TSC_OFFSET, GUEST_IA32_PAT, GUEST_IA32_DEBUGCTL, GUEST_BNDCFGS,
and other number of fields that are likely to persist for a given vmcs02?
That it can be changed via ioctls in a way that affects both vmcs01 and
vmcs02. So TSC_MULTIPLIER is in the same boat as TSC_OFFSET, which I
agree we should shadow more aggressively, but the others are different.
Paolo