]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: X86: Expose bus lock debug exception to guest
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 6 May 2021 10:30:04 +0000 (06:30 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 7 May 2021 10:06:20 +0000 (06:06 -0400)
commit50e646e7e1f46d521d21c2957aa422a6e2e941b8
tree36518e96f9c98f5277e30167520243e724ee1c45
parentb950ca978387abb6f93852ee7c654f9a638db443
KVM: X86: Expose bus lock debug exception to guest

Bus lock debug exception is an ability to notify the kernel by an #DB
trap after the instruction acquires a bus lock and is executed when
CPL>0. This allows the kernel to enforce user application throttling or
mitigations.

Existence of bus lock debug exception is enumerated via
CPUID.(EAX=7,ECX=0).ECX[24]. Software can enable these exceptions by
setting bit 2 of the MSR_IA32_DEBUGCTL. Expose the CPUID to guest and
emulate the MSR handling when guest enables it.

Support for this feature was originally developed by Xiaoyao Li and
Chenyi Qiang, but code has since changed enough that this patch has
nothing in common with theirs, except for this commit message.

Co-developed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Chenyi Qiang <chenyi.qiang@intel.com>
Message-Id: <20210202090433.13441-4-chenyi.qiang@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/cpuid.c
arch/x86/kvm/vmx/capabilities.h
arch/x86/kvm/vmx/vmx.c