|
|
Log in / Subscribe / Register

kvm/split_lock: Add feature split lock detection support in kvm

From:  Xiaoyao Li <xiaoyao.li-AT-intel.com>
To:  Paolo Bonzini <pbonzini-AT-redhat.com>, Sean Christopherson <sean.j.christopherson-AT-intel.com>, Thomas Gleixner <tglx-AT-linutronix.de>, Ingo Molnar <mingo-AT-redhat.com>, Borislav Petkov <bp-AT-alien8.de>, Andy Lutomirski <luto-AT-amacapital.net>
Subject:  [PATCH v2 0/6] kvm/split_lock: Add feature split lock detection support in kvm
Date:  Mon, 3 Feb 2020 23:16:02 +0800
Message-ID:  <20200203151608.28053-1-xiaoyao.li@intel.com>
Cc:  x86-AT-kernel.org, kvm-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org, David Laight <David.Laight-AT-aculab.com>, Xiaoyao Li <xiaoyao.li-AT-intel.com>
Archive-link:  Article

This version adds the virtualization of split lock detection for guest
in patch 5 and patch 6.

No matter whether we advertise split lock detection to guest, we have to make
a choice between not burn the old guest and prevent DoS attack from guest since
we cannot identify whether a guest is malicious.

Since sld_warn mode also allows userspace applications to do split lock
we can extend the similar policy to guest that if host is sld_warn, we allow
guest to generate split lock by clearing MSR_TEST_CTRL.SPLIT_LOCK_DETECT bit
when vcpu is running.

If host is sld_fatal mode and guest doesn't set its SPLIT_LOCK_DETECT bit we
forward split lock #AC to user space, similar as sending SIGBUS.

Xiaoyao Li (6):
  x86/split_lock: Add and export get_split_lock_detect_state()
  x86/split_lock: Add and export split_lock_detect_set()
  kvm: x86: Emulate split-lock access as a write
  kvm: vmx: Extend VMX's #AC handding for split lock in guest
  kvm: x86: Emulate MSR IA32_CORE_CAPABILITIES
  x86: vmx: virtualize split lock detection

 arch/x86/include/asm/cpu.h      | 13 +++++
 arch/x86/include/asm/kvm_host.h |  1 +
 arch/x86/kernel/cpu/intel.c     | 18 ++++--
 arch/x86/kvm/cpuid.c            |  5 +-
 arch/x86/kvm/vmx/vmx.c          | 98 ++++++++++++++++++++++++++++++++-
 arch/x86/kvm/vmx/vmx.h          |  4 ++
 arch/x86/kvm/x86.c              | 44 ++++++++++++++-
 7 files changed, 171 insertions(+), 12 deletions(-)

-- 
2.23.0



Copyright © 2020, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds