]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: SVM: Unconditionally sync GPRs to GHCB on VMRUN of SEV-ES guest
authorSean Christopherson <seanjc@google.com>
Fri, 22 Jan 2021 23:50:47 +0000 (15:50 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 25 Jan 2021 23:52:09 +0000 (18:52 -0500)
commit86cc7d8cfd740e4de7e6c374bf5d7d776f12a5c8
tree0f97d52249a358b0d69df5b97533f7dc42e61414
parent6cb9b3a881b36b69b3abeb05ad7954df0873efbb
KVM: SVM: Unconditionally sync GPRs to GHCB on VMRUN of SEV-ES guest

Drop the per-GPR dirty checks when synchronizing GPRs to the GHCB, the
GRPs' dirty bits are set from time zero and never cleared, i.e. will
always be seen as dirty.  The obvious alternative would be to clear
the dirty bits when appropriate, but removing the dirty checks is
desirable as it allows reverting GPR dirty+available tracking, which
adds overhead to all flavors of x86 VMs.

Note, unconditionally writing the GPRs in the GHCB is tacitly allowed
by the GHCB spec, which allows the hypervisor (or guest) to provide
unnecessary info; it's the guest's responsibility to consume only what
it needs (the hypervisor is untrusted after all).

  The guest and hypervisor can supply additional state if desired but
  must not rely on that additional state being provided.

Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Fixes: 2a4a6e417d97 ("KVM: SVM: Add initial support for a VMGEXIT VMEXIT")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210122235049.3107620-2-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/sev.c