From patchwork Mon Mar 23 02:56:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaoyao Li X-Patchwork-Id: 11452231 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 67B44913 for ; Mon, 23 Mar 2020 03:15:40 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 46647206F8 for ; Mon, 23 Mar 2020 03:15:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 46647206F8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:56714 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGDYx-0007GU-Cb for patchwork-qemu-devel@patchwork.kernel.org; Sun, 22 Mar 2020 23:15:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51043) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGDY4-0005ig-NZ for qemu-devel@nongnu.org; Sun, 22 Mar 2020 23:14:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jGDY2-0003fh-UV for qemu-devel@nongnu.org; Sun, 22 Mar 2020 23:14:44 -0400 Received: from mga07.intel.com ([134.134.136.100]:56656) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jGDY2-0003fE-NI for qemu-devel@nongnu.org; Sun, 22 Mar 2020 23:14:42 -0400 IronPort-SDR: Ncbn1yt/iQBxyi9L+fxe3BA9BoAjhfupK0uUdLWGwbZ4XEK1c67+OCAvXRygfLyEDVj3u/+j+P Co/ZF/1BCSEA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2020 20:14:40 -0700 IronPort-SDR: pRX5EL3s7jKlUC0DyiWxWVCif4V9kHdzoAikBRqVPuPVWdDrntlbDIQIGRJvr185g3LRvS86fT K8iiw9uLqCUQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,294,1580803200"; d="scan'208";a="292453683" Received: from lxy-clx-4s.sh.intel.com ([10.239.43.161]) by FMSMGA003.fm.intel.com with ESMTP; 22 Mar 2020 20:14:38 -0700 From: Xiaoyao Li To: Paolo Bonzini , Marcelo Tosatti , Richard Henderson , Eduardo Habkost Subject: [PATCH 1/3] target/i386: Rename CORE_CAPABILITY to CORE_CAPABILITIES Date: Mon, 23 Mar 2020 10:56:56 +0800 Message-Id: <20200323025658.4540-2-xiaoyao.li@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200323025658.4540-1-xiaoyao.li@intel.com> References: <20200323025658.4540-1-xiaoyao.li@intel.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 134.134.136.100 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xiaoyao Li , qemu-devel@nongnu.org, kvm@vger.kernel.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Intel SDM updates the name of MSR CORE_CAPABILITY to CORE_CAPABILITIES, so updating it QEMU. Signed-off-by: Xiaoyao Li --- target/i386/cpu.c | 12 ++++++------ target/i386/cpu.h | 6 +++--- target/i386/kvm.c | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 34b511f078e5..1de7f3cd533e 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1216,7 +1216,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = { .index = MSR_IA32_ARCH_CAPABILITIES, }, }, - [FEAT_CORE_CAPABILITY] = { + [FEAT_CORE_CAPABILITIES] = { .type = MSR_FEATURE_WORD, .feat_names = { NULL, NULL, NULL, NULL, @@ -1229,7 +1229,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = { NULL, NULL, NULL, NULL, }, .msr = { - .index = MSR_IA32_CORE_CAPABILITY, + .index = MSR_IA32_CORE_CAPABILITIES, }, }, @@ -1406,8 +1406,8 @@ static FeatureDep feature_dependencies[] = { .to = { FEAT_ARCH_CAPABILITIES, ~0ull }, }, { - .from = { FEAT_7_0_EDX, CPUID_7_0_EDX_CORE_CAPABILITY }, - .to = { FEAT_CORE_CAPABILITY, ~0ull }, + .from = { FEAT_7_0_EDX, CPUID_7_0_EDX_CORE_CAPABILITIES }, + .to = { FEAT_CORE_CAPABILITIES, ~0ull }, }, { .from = { FEAT_1_ECX, CPUID_EXT_VMX }, @@ -3709,8 +3709,8 @@ static X86CPUDefinition builtin_x86_defs[] = { .features[FEAT_7_0_EDX] = CPUID_7_0_EDX_SPEC_CTRL | CPUID_7_0_EDX_ARCH_CAPABILITIES | CPUID_7_0_EDX_SPEC_CTRL_SSBD | - CPUID_7_0_EDX_CORE_CAPABILITY, - .features[FEAT_CORE_CAPABILITY] = + CPUID_7_0_EDX_CORE_CAPABILITIES, + .features[FEAT_CORE_CAPABILITIES] = MSR_CORE_CAP_SPLIT_LOCK_DETECT, /* * Missing: XSAVES (not supported by some Linux versions, diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 60d797d5941f..f6c54412ba5e 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -349,7 +349,7 @@ typedef enum X86Seg { #define MSR_VIRT_SSBD 0xc001011f #define MSR_IA32_PRED_CMD 0x49 #define MSR_IA32_UCODE_REV 0x8b -#define MSR_IA32_CORE_CAPABILITY 0xcf +#define MSR_IA32_CORE_CAPABILITIES 0xcf #define MSR_IA32_ARCH_CAPABILITIES 0x10a #define ARCH_CAP_TSX_CTRL_MSR (1<<7) @@ -526,7 +526,7 @@ typedef enum FeatureWord { FEAT_XSAVE_COMP_LO, /* CPUID[EAX=0xd,ECX=0].EAX */ FEAT_XSAVE_COMP_HI, /* CPUID[EAX=0xd,ECX=0].EDX */ FEAT_ARCH_CAPABILITIES, - FEAT_CORE_CAPABILITY, + FEAT_CORE_CAPABILITIES, FEAT_VMX_PROCBASED_CTLS, FEAT_VMX_SECONDARY_CTLS, FEAT_VMX_PINBASED_CTLS, @@ -777,7 +777,7 @@ typedef uint64_t FeatureWordArray[FEATURE_WORDS]; /* Arch Capabilities */ #define CPUID_7_0_EDX_ARCH_CAPABILITIES (1U << 29) /* Core Capability */ -#define CPUID_7_0_EDX_CORE_CAPABILITY (1U << 30) +#define CPUID_7_0_EDX_CORE_CAPABILITIES (1U << 30) /* Speculative Store Bypass Disable */ #define CPUID_7_0_EDX_SPEC_CTRL_SSBD (1U << 31) diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 69eb43d796e6..6888cb7caeae 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -2051,7 +2051,7 @@ static int kvm_get_supported_msrs(KVMState *s) case MSR_IA32_ARCH_CAPABILITIES: has_msr_arch_capabs = true; break; - case MSR_IA32_CORE_CAPABILITY: + case MSR_IA32_CORE_CAPABILITIES: has_msr_core_capabs = true; break; case MSR_IA32_VMX_VMFUNC: @@ -2696,8 +2696,8 @@ static void kvm_init_msrs(X86CPU *cpu) } if (has_msr_core_capabs) { - kvm_msr_entry_add(cpu, MSR_IA32_CORE_CAPABILITY, - env->features[FEAT_CORE_CAPABILITY]); + kvm_msr_entry_add(cpu, MSR_IA32_CORE_CAPABILITIES, + env->features[FEAT_CORE_CAPABILITIES]); } if (has_msr_ucode_rev) { From patchwork Mon Mar 23 02:56:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaoyao Li X-Patchwork-Id: 11452235 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AB3006CA for ; Mon, 23 Mar 2020 03:16:47 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8A53F206F8 for ; Mon, 23 Mar 2020 03:16:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8A53F206F8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:56736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGDa2-0000aq-Oi for patchwork-qemu-devel@patchwork.kernel.org; Sun, 22 Mar 2020 23:16:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51059) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGDY5-0005ih-IK for qemu-devel@nongnu.org; Sun, 22 Mar 2020 23:14:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jGDY4-0003gC-90 for qemu-devel@nongnu.org; Sun, 22 Mar 2020 23:14:45 -0400 Received: from mga07.intel.com ([134.134.136.100]:56660) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jGDY3-0003fq-UT for qemu-devel@nongnu.org; Sun, 22 Mar 2020 23:14:44 -0400 IronPort-SDR: 8xGx7k2Ccaj7baqWqXbHRmzmnf3/2x1kgF6QWfU4WHxLaJiStsYBLXHaTbzWr3r14tXJOmgcL6 yMFF8T9L0fKg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2020 20:14:42 -0700 IronPort-SDR: Gg+QmSZ8XLK3JGiAcInv8v2C/jGZtEXMFOu8gL1rc12E5hYuMeikfstiUIPjnpYrAk6dz6rqwo ULjSfFlndTVg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,294,1580803200"; d="scan'208";a="292453684" Received: from lxy-clx-4s.sh.intel.com ([10.239.43.161]) by FMSMGA003.fm.intel.com with ESMTP; 22 Mar 2020 20:14:40 -0700 From: Xiaoyao Li To: Paolo Bonzini , Marcelo Tosatti , Richard Henderson , Eduardo Habkost Subject: [PATCH 2/3] target/i386: Add support for TEST_CTRL MSR Date: Mon, 23 Mar 2020 10:56:57 +0800 Message-Id: <20200323025658.4540-3-xiaoyao.li@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200323025658.4540-1-xiaoyao.li@intel.com> References: <20200323025658.4540-1-xiaoyao.li@intel.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 134.134.136.100 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xiaoyao Li , qemu-devel@nongnu.org, kvm@vger.kernel.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Xiaoyao Li MSR_TEST_CTRL is needed and accessed by feature split lock detection. Signed-off-by: Xiaoyao Li --- target/i386/cpu.h | 2 ++ target/i386/kvm.c | 13 +++++++++++++ target/i386/machine.c | 20 ++++++++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index f6c54412ba5e..177732ad19da 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -343,6 +343,7 @@ typedef enum X86Seg { #define MSR_IA32_APICBASE_ENABLE (1<<11) #define MSR_IA32_APICBASE_EXTD (1 << 10) #define MSR_IA32_APICBASE_BASE (0xfffffU<<12) +#define MSR_TEST_CTRL 0x33 #define MSR_IA32_FEATURE_CONTROL 0x0000003a #define MSR_TSC_ADJUST 0x0000003b #define MSR_IA32_SPEC_CTRL 0x48 @@ -1466,6 +1467,7 @@ typedef struct CPUX86State { uint64_t spec_ctrl; uint64_t virt_ssbd; + uint64_t msr_test_ctrl; /* End of state preserved by INIT (dummy marker). */ struct {} end_init_save; diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 6888cb7caeae..411402aa29fa 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -101,6 +101,7 @@ static bool has_msr_umwait; static bool has_msr_spec_ctrl; static bool has_msr_tsx_ctrl; static bool has_msr_virt_ssbd; +static bool has_msr_test_ctrl; static bool has_msr_smi_count; static bool has_msr_arch_capabs; static bool has_msr_core_capabs; @@ -2048,6 +2049,9 @@ static int kvm_get_supported_msrs(KVMState *s) case MSR_VIRT_SSBD: has_msr_virt_ssbd = true; break; + case MSR_TEST_CTRL: + has_msr_test_ctrl = true; + break; case MSR_IA32_ARCH_CAPABILITIES: has_msr_arch_capabs = true; break; @@ -2766,6 +2770,9 @@ static int kvm_put_msrs(X86CPU *cpu, int level) if (has_msr_virt_ssbd) { kvm_msr_entry_add(cpu, MSR_VIRT_SSBD, env->virt_ssbd); } + if (has_msr_test_ctrl) { + kvm_msr_entry_add(cpu, MSR_TEST_CTRL, env->msr_test_ctrl); + } #ifdef TARGET_X86_64 if (lm_capable_kernel) { @@ -3154,6 +3161,9 @@ static int kvm_get_msrs(X86CPU *cpu) if (has_msr_virt_ssbd) { kvm_msr_entry_add(cpu, MSR_VIRT_SSBD, 0); } + if (has_msr_test_ctrl) { + kvm_msr_entry_add(cpu, MSR_TEST_CTRL, 0); + } if (!env->tsc_valid) { kvm_msr_entry_add(cpu, MSR_IA32_TSC, 0); env->tsc_valid = !runstate_is_running(); @@ -3549,6 +3559,9 @@ static int kvm_get_msrs(X86CPU *cpu) case MSR_VIRT_SSBD: env->virt_ssbd = msrs[i].data; break; + case MSR_TEST_CTRL: + env->msr_test_ctrl = msrs[i].data; + break; case MSR_IA32_RTIT_CTL: env->msr_rtit_ctrl = msrs[i].data; break; diff --git a/target/i386/machine.c b/target/i386/machine.c index 0c96531a56f0..a23c6687d5ba 100644 --- a/target/i386/machine.c +++ b/target/i386/machine.c @@ -1252,6 +1252,25 @@ static const VMStateDescription vmstate_msr_virt_ssbd = { } }; +static bool msr_test_ctrl_needed(void *opaque) +{ + X86CPU *cpu = opaque; + CPUX86State *env = &cpu->env; + + return env->msr_test_ctrl != 0; +} + +static const VMStateDescription vmstate_msr_test_ctrl = { + .name = "cpu/msr_test_ctrl", + .version_id = 1, + .minimum_version_id = 1, + .needed = msr_test_ctrl_needed, + .fields = (VMStateField[]){ + VMSTATE_UINT64(env.msr_test_ctrl, X86CPU), + VMSTATE_END_OF_LIST() + } +}; + static bool svm_npt_needed(void *opaque) { X86CPU *cpu = opaque; @@ -1439,6 +1458,7 @@ VMStateDescription vmstate_x86_cpu = { &vmstate_mcg_ext_ctl, &vmstate_msr_intel_pt, &vmstate_msr_virt_ssbd, + &vmstate_msr_test_ctrl, &vmstate_svm_npt, #ifndef TARGET_X86_64 &vmstate_efer32, From patchwork Mon Mar 23 02:56:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaoyao Li X-Patchwork-Id: 11452233 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 82E7C17D4 for ; Mon, 23 Mar 2020 03:15:40 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6375120732 for ; Mon, 23 Mar 2020 03:15:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6375120732 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:56716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGDYx-0007IE-HE for patchwork-qemu-devel@patchwork.kernel.org; Sun, 22 Mar 2020 23:15:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51072) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGDY6-0005is-KP for qemu-devel@nongnu.org; Sun, 22 Mar 2020 23:14:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jGDY5-0003gl-Mj for qemu-devel@nongnu.org; Sun, 22 Mar 2020 23:14:46 -0400 Received: from mga07.intel.com ([134.134.136.100]:56665) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jGDY5-0003gP-EI for qemu-devel@nongnu.org; Sun, 22 Mar 2020 23:14:45 -0400 IronPort-SDR: natrt4NfZs8pxDFTMfJO9EcDUKWQRNGlNYOyEUh26X79FbMzvJubwR4SLT5V+vO5s74Pro4ugo UFay3WEqGD6g== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2020 20:14:44 -0700 IronPort-SDR: uYur9/pt0qTm1pCiSl2Gb8z6WaZ27QWwAxqe0ET2NSe31lYk6CKbczLb2jDBKy4p6igdDvkzTZ 9acOqk7HrLcA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,294,1580803200"; d="scan'208";a="292453701" Received: from lxy-clx-4s.sh.intel.com ([10.239.43.161]) by FMSMGA003.fm.intel.com with ESMTP; 22 Mar 2020 20:14:42 -0700 From: Xiaoyao Li To: Paolo Bonzini , Marcelo Tosatti , Richard Henderson , Eduardo Habkost Subject: [PATCH 3/3] target/i386: Tell why guest exits to user space due to #AC Date: Mon, 23 Mar 2020 10:56:58 +0800 Message-Id: <20200323025658.4540-4-xiaoyao.li@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200323025658.4540-1-xiaoyao.li@intel.com> References: <20200323025658.4540-1-xiaoyao.li@intel.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 134.134.136.100 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xiaoyao Li , qemu-devel@nongnu.org, kvm@vger.kernel.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Tell why guest exits from kvm to user space due to #AC, so user knows what happened. Signed-off-by: Xiaoyao Li --- target/i386/kvm.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 411402aa29fa..36bc1485d478 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -4464,8 +4464,15 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) ret = -1; break; case KVM_EXIT_EXCEPTION: - fprintf(stderr, "KVM: exception %d exit (error code 0x%x)\n", - run->ex.exception, run->ex.error_code); + if (run->ex.exception == AC_VECTOR) { + fprintf(stderr, "Guest encounters an #AC due to split lock. Because " + "guest doesn't expect this split lock #AC (it doesn't set " + "msr_test_ctrl.split_lock_detect) and host sets " + "split_lock_detect=fatal, guest has to be killed.\n"); + } else { + fprintf(stderr, "KVM: exception %d exit (error code 0x%x)\n", + run->ex.exception, run->ex.error_code); + } ret = -1; break; case KVM_EXIT_DEBUG: