From patchwork Mon Jun 22 16:05:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Denis V. Lunev" X-Patchwork-Id: 487289 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 88C29140306 for ; Tue, 23 Jun 2015 02:08:23 +1000 (AEST) Received: from localhost ([::1]:41015 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z74Gj-0001T5-Iv for incoming@patchwork.ozlabs.org; Mon, 22 Jun 2015 12:08:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52520) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z74Ds-0005AU-KF for qemu-devel@nongnu.org; Mon, 22 Jun 2015 12:05:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z74Dr-0003SX-9T for qemu-devel@nongnu.org; Mon, 22 Jun 2015 12:05:24 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:43079 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z74Dq-0003S6-RK for qemu-devel@nongnu.org; Mon, 22 Jun 2015 12:05:23 -0400 Received: from hades.sw.ru ([10.30.8.132]) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id t5MG5099028530; Mon, 22 Jun 2015 19:05:20 +0300 (MSK) From: "Denis V. Lunev" To: Date: Mon, 22 Jun 2015 19:05:08 +0300 Message-Id: <1434989108-20924-12-git-send-email-den@openvz.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1434989108-20924-1-git-send-email-den@openvz.org> References: <1434989108-20924-1-git-send-email-den@openvz.org> MIME-Version: 1.0 X-MIME-Autoconverted: from 8bit to quoted-printable by relay.sw.ru id t5MG5099028530 X-detected-operating-system: by eggs.gnu.org: OpenBSD 3.x X-Received-From: 195.214.232.25 Cc: kvm@vger.kernel.org, qemu-devel@nongnu.org, Paolo Bonzini , Andrey Smetanin , "Denis V. Lunev" , =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PATCH 11/11] qemu/kvm: mark in cpu state that hyper-v crash occured X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Andrey Smetanin It's usually impossible to understand from Hyper-V crash msr's that crash happened because ctl msr always contains the same value HV_X64_MSR_CRASH_CTL_NOTIFY. To solve it add a particalar value hv_crash_occurred inside CPU state and migrate this value with crash msr's. Signed-off-by: Andrey Smetanin Signed-off-by: Denis V. Lunev CC: Paolo Bonzini CC: Andreas Färber --- target-i386/cpu.h | 1 + target-i386/kvm.c | 1 + target-i386/machine.c | 1 + 3 files changed, 3 insertions(+) diff --git a/target-i386/cpu.h b/target-i386/cpu.h index 474a93e..2958cdc 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -907,6 +907,7 @@ typedef struct CPUX86State { uint64_t msr_hv_tsc; uint64_t msr_hv_crash_prm[HV_X64_MSR_CRASH_PARAMS]; uint64_t msr_hv_crash_ctl; + uint8_t hv_crash_occurred; /* exception/interrupt handling */ int error_code; diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 690677b..2c8d00f 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -2616,6 +2616,7 @@ int kvm_arch_handle_hv_crash(CPUState *cs) break; } } + env->hv_crash_occurred = 1; return 0; } diff --git a/target-i386/machine.c b/target-i386/machine.c index 15b3f31..4f72ba8 100644 --- a/target-i386/machine.c +++ b/target-i386/machine.c @@ -679,6 +679,7 @@ static const VMStateDescription vmstate_msr_hyperv_crash = { VMSTATE_UINT64(env.msr_hv_crash_ctl, X86CPU), VMSTATE_UINT64_ARRAY(env.msr_hv_crash_prm, X86CPU, HV_X64_MSR_CRASH_PARAMS), + VMSTATE_UINT8(env.hv_crash_occurred, X86CPU), VMSTATE_END_OF_LIST() } };