[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 08/11] kvm/x86: add sending hyper-v crash notificati
From: |
Denis V. Lunev |
Subject: |
[Qemu-devel] [PATCH 08/11] kvm/x86: add sending hyper-v crash notification to user space |
Date: |
Mon, 22 Jun 2015 19:05:05 +0300 |
From: Andrey Smetanin <address@hidden>
Sending of notification is done by exiting vcpu to user space if
KVM_REQ_HV_CRASH is set for vcpu. kvm_run structure will contain
system_event with type equals to KVM_SYSTEM_EVENT_CRASH and flag
KVM_SYSTEM_EVENT_FL_HV_CRASH to clarify that the crash occures
inside Hyper-V based guest.
Signed-off-by: Andrey Smetanin <address@hidden>
Signed-off-by: Denis V. Lunev <address@hidden>
CC: Paolo Bonzini <address@hidden>
CC: Gleb Natapov <address@hidden>
---
arch/x86/kvm/x86.c | 8 ++++++++
include/uapi/linux/kvm.h | 2 ++
2 files changed, 10 insertions(+)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 2046b78..111fa83 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -6027,6 +6027,14 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
vcpu_scan_ioapic(vcpu);
if (kvm_check_request(KVM_REQ_APIC_PAGE_RELOAD, vcpu))
kvm_vcpu_reload_apic_access_page(vcpu);
+ if (kvm_check_request(KVM_REQ_HV_CRASH, vcpu)) {
+ vcpu->run->exit_reason = KVM_EXIT_SYSTEM_EVENT;
+ vcpu->run->system_event.type = KVM_SYSTEM_EVENT_CRASH;
+ vcpu->run->system_event.flags =
+ KVM_SYSTEM_EVENT_FL_HV_CRASH;
+ r = 0;
+ goto out;
+ }
}
if (kvm_check_request(KVM_REQ_EVENT, vcpu) || req_int_win) {
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 4b60056..22b6cca 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -317,6 +317,8 @@ struct kvm_run {
struct {
#define KVM_SYSTEM_EVENT_SHUTDOWN 1
#define KVM_SYSTEM_EVENT_RESET 2
+#define KVM_SYSTEM_EVENT_CRASH 3
+#define KVM_SYSTEM_EVENT_FL_HV_CRASH (1ULL << 0)
__u32 type;
__u64 flags;
} system_event;
--
1.9.1
- Re: [Qemu-devel] [PATCH 07/11] kvm/x86: added hyper-v crash data and ctl msr's get/set'ers, (continued)
- [Qemu-devel] [PATCH 11/11] qemu/kvm: mark in cpu state that hyper-v crash occured, Denis V. Lunev, 2015/06/22
- Re: [Qemu-devel] [PATCH 11/11] qemu/kvm: mark in cpu state that hyper-v crash occured, Andreas Färber, 2015/06/22
- Re: [Qemu-devel] [PATCH 11/11] qemu/kvm: mark in cpu state that hyper-v crash occured, Paolo Bonzini, 2015/06/22
- Re: [Qemu-devel] [PATCH 11/11] qemu/kvm: mark in cpu state that hyper-v crash occured, Andreas Färber, 2015/06/22
- Re: [Qemu-devel] [PATCH 11/11] qemu/kvm: mark in cpu state that hyper-v crash occured, Denis V. Lunev, 2015/06/22
- Re: [Qemu-devel] [PATCH 11/11] qemu/kvm: mark in cpu state that hyper-v crash occured, Paolo Bonzini, 2015/06/22
- Re: [Qemu-devel] [PATCH 11/11] qemu/kvm: mark in cpu state that hyper-v crash occured, Andreas Färber, 2015/06/22
- Re: [Qemu-devel] [PATCH 11/11] qemu/kvm: mark in cpu state that hyper-v crash occured, Paolo Bonzini, 2015/06/23
[Qemu-devel] [PATCH 04/11] kvm/x86: added hyper-v crash msrs into kvm hyperv context, Denis V. Lunev, 2015/06/22
[Qemu-devel] [PATCH 08/11] kvm/x86: add sending hyper-v crash notification to user space,
Denis V. Lunev <=
[Qemu-devel] [PATCH 02/11] kvm: introduce vcpu_debug = kvm_debug + vcpu context, Denis V. Lunev, 2015/06/22
[Qemu-devel] [PATCH 01/11] kvm/x86: move Hyper-V MSR's/hypercall code into hyperv.c file, Denis V. Lunev, 2015/06/22
[Qemu-devel] [PATCH 10/11] qemu/kvm: kvm hyper-v based guest crash event handling, Denis V. Lunev, 2015/06/22
[Qemu-devel] [PATCH 09/11] kvm/x86: distingiush hyper-v guest crash notification, Denis V. Lunev, 2015/06/22