]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
KVM: x86: Register Processor Trace interrupt hook iff PT enabled in guest
authorSean Christopherson <seanjc@google.com>
Thu, 11 Nov 2021 02:07:24 +0000 (02:07 +0000)
committerPaolo Pisati <paolo.pisati@canonical.com>
Tue, 25 Jan 2022 11:05:31 +0000 (12:05 +0100)
commitf2b7891e328196df32c07278e2f7f8635527dbe5
tree26813e887eb1b7be166c74b27cbae662b00e00a9
parenta91407066d0816dc9b153ac219fe444c2eba74a4
KVM: x86: Register Processor Trace interrupt hook iff PT enabled in guest

BugLink: https://bugs.launchpad.net/bugs/1958977
commit f4b027c5c8199abd4fb6f00d67d380548dbfdfa8 upstream.

Override the Processor Trace (PT) interrupt handler for guest mode if and
only if PT is configured for host+guest mode, i.e. is being used
independently by both host and guest.  If PT is configured for system
mode, the host fully controls PT and must handle all events.

Fixes: 8479e04e7d6b ("KVM: x86: Inject PMI for KVM guest")
Reported-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reported-by: Artem Kashkanov <artem.kashkanov@intel.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20211111020738.2512932-4-seanjc@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/x86.c