]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: x86: Clear "has_error_code", not "error_code", for RM exception injection
authorSean Christopherson <seanjc@google.com>
Wed, 22 Mar 2023 14:32:59 +0000 (07:32 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Apr 2023 14:55:30 +0000 (16:55 +0200)
commit5f35a72fcc8bb2ff2df6a18226d1f272dd1f03e8
treee11c8a4452993f18851e34f2a77272a3fc0fc610
parentda429cddabe0701469534c8dc7a11e2ccd9e098e
KVM: x86: Clear "has_error_code", not "error_code", for RM exception injection

commit 6c41468c7c12d74843bb414fc00307ea8a6318c3 upstream.

When injecting an exception into a vCPU in Real Mode, suppress the error
code by clearing the flag that tracks whether the error code is valid, not
by clearing the error code itself.  The "typo" was introduced by recent
fix for SVM's funky Paged Real Mode.

Opportunistically hoist the logic above the tracepoint so that the trace
is coherent with respect to what is actually injected (this was also the
behavior prior to the buggy commit).

Fixes: b97f07458373 ("KVM: x86: determine if an exception has an error code only when injecting it.")
Cc: stable@vger.kernel.org
Cc: Maxim Levitsky <mlevitsk@redhat.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20230322143300.2209476-2-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/x86.c