KVM: x86: Always set kvm_run->if_flag
authorMarc Orr <marcorr@google.com>
Thu, 9 Dec 2021 15:52:57 +0000 (07:52 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 20 Dec 2021 13:06:53 +0000 (08:06 -0500)
commitc5063551bfcae4e48fec890b7bf369598b77526b
tree3b0c148a37c7b5230548ca6df0322d5c5d0ea97a
parent3a0f64de479cae75effb630a2e0a237ca0d0623c
KVM: x86: Always set kvm_run->if_flag

The kvm_run struct's if_flag is a part of the userspace/kernel API. The
SEV-ES patches failed to set this flag because it's no longer needed by
QEMU (according to the comment in the source code). However, other
hypervisors may make use of this flag. Therefore, set the flag for
guests with encrypted registers (i.e., with guest_state_protected set).

Fixes: f1c6366e3043 ("KVM: SVM: Add required changes to support intercepts under SEV-ES")
Signed-off-by: Marc Orr <marcorr@google.com>
Message-Id: <20211209155257.128747-1-marcorr@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
arch/x86/include/asm/kvm-x86-ops.h
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/svm/svm.c
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/x86.c