KVM: x86: Always set kvm_run->if_flag
authorMarc Orr <marcorr@google.com>
Thu, 9 Dec 2021 15:52:57 +0000 (07:52 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Dec 2021 11:28:54 +0000 (12:28 +0100)
commit5dea76f5da655a5998da9a06e16c2b0e311ebefc
treeeb717ce8dbfdede8ed1e94f6f9a6a062e6e52b54
parent9ca1324755f1f8629a370af5cc315b175331f5d1
KVM: x86: Always set kvm_run->if_flag

commit c5063551bfcae4e48fec890b7bf369598b77526b upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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