KVM: vmx, svm: clean up mass updates to regs_avail/regs_dirty bits
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 26 Nov 2021 12:00:15 +0000 (07:00 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 8 Dec 2021 09:25:03 +0000 (04:25 -0500)
commit41e68b6964ebf20082af55ad1394523cf86c4c6a
tree88cf9d35a980b7fbe405ffb990214171ea4dd276
parentc62c7bd4f95b8f2a28098c4139a369670998aef2
KVM: vmx, svm: clean up mass updates to regs_avail/regs_dirty bits

Document the meaning of the three combinations of regs_avail and
regs_dirty.  Update regs_dirty just after writeback instead of
doing it later after vmexit.  After vmexit, instead, we clear the
regs_avail bits corresponding to lazily-loaded registers.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/kvm_cache_regs.h
arch/x86/kvm/svm/svm.c
arch/x86/kvm/svm/svm.h
arch/x86/kvm/vmx/nested.c
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/vmx/vmx.h