]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Use "raw" APIC register read for handling APIC-write VM-Exit
authorSean Christopherson <seanjc@google.com>
Fri, 4 Feb 2022 21:41:57 +0000 (21:41 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 1 Mar 2022 13:50:45 +0000 (08:50 -0500)
commit5799cd041dc57dcb26d11130af13e589545ae433
tree727926c7e956448b541f1308f297443d63bb4cb2
parente8db9ccdfef20aaf0ea4999cf00544ba0916de7d
KVM: x86: Use "raw" APIC register read for handling APIC-write VM-Exit

Use the "raw" helper to read the vAPIC register after an APIC-write trap
VM-Exit.  Hardware is responsible for vetting the write, and the caller
is responsible for sanitizing the offset.  This is a functional change,
as it means KVM will consume whatever happens to be in the vAPIC page if
the write was dropped by hardware.  But, unless userspace deliberately
wrote garbage into the vAPIC page via KVM_SET_LAPIC, the value should be
zero since it's not writable by the guest.

This aligns common x86 with SVM's AVIC logic, i.e. paves the way for
using the nodecode path to handle APIC-write traps when AVIC is enabled.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220204214205.3306634-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/lapic.c