KVM: SVM: Stuff save->dr6 at during VMSA sync, not at RESET/INIT
authorSean Christopherson <seanjc@google.com>
Tue, 13 Jul 2021 16:33:10 +0000 (09:33 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 2 Aug 2021 15:01:56 +0000 (11:01 -0400)
commitd0f9f826d8ac06446391ceb3d4a440f5b48b3134
tree48081c2c3a2ba01afe4b1fc36699a95945788d06
parent6cfe7b83acdcdd4d4ea9354f007a88bc0ccb16b9
KVM: SVM: Stuff save->dr6 at during VMSA sync, not at RESET/INIT

Move code to stuff vmcb->save.dr6 to its architectural init value from
svm_vcpu_reset() into sev_es_sync_vmsa().  Except for protected guests,
a.k.a. SEV-ES guests, vmcb->save.dr6 is set during VM-Enter, i.e. the
extra write is unnecessary.  For SEV-ES, stuffing save->dr6 handles a
theoretical case where the VMSA could be encrypted before the first
KVM_RUN.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210713163324.627647-33-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/sev.c
arch/x86/kvm/svm/svm.c