diff options
author | Xiantao Zhang <xiantao.zhang@intel.com> | 2008-11-21 04:16:07 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2008-12-31 09:54:59 -0500 |
commit | 9f7d5bb5e2abf5316bb17eb3e7751dbafa09e5cf (patch) | |
tree | 1d26023244a8882cda214019b59a6a237f707e55 /arch/ia64/kvm/process.c | |
parent | 5e2be19832ccf93bf731a1758ec9fabf48414584 (diff) |
KVM: ia64: Add handler for crashed vmm
Since vmm runs in an isolated address space and it is just a copy
of host's kvm-intel module, so once vmm crashes, we just crash all guests
running on it instead of crashing whole kernel.
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/ia64/kvm/process.c')
-rw-r--r-- | arch/ia64/kvm/process.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/ia64/kvm/process.c b/arch/ia64/kvm/process.c index cefc349ce354..552d07724207 100644 --- a/arch/ia64/kvm/process.c +++ b/arch/ia64/kvm/process.c | |||
@@ -942,8 +942,20 @@ static void vcpu_do_resume(struct kvm_vcpu *vcpu) | |||
942 | ia64_set_pta(vcpu->arch.vhpt.pta.val); | 942 | ia64_set_pta(vcpu->arch.vhpt.pta.val); |
943 | } | 943 | } |
944 | 944 | ||
945 | static void vmm_sanity_check(struct kvm_vcpu *vcpu) | ||
946 | { | ||
947 | struct exit_ctl_data *p = &vcpu->arch.exit_data; | ||
948 | |||
949 | if (!vmm_sanity && p->exit_reason != EXIT_REASON_DEBUG) { | ||
950 | panic_vm(vcpu, "Failed to do vmm sanity check," | ||
951 | "it maybe caused by crashed vmm!!\n\n"); | ||
952 | } | ||
953 | } | ||
954 | |||
945 | static void kvm_do_resume_op(struct kvm_vcpu *vcpu) | 955 | static void kvm_do_resume_op(struct kvm_vcpu *vcpu) |
946 | { | 956 | { |
957 | vmm_sanity_check(vcpu); /*Guarantee vcpu runing on healthy vmm!*/ | ||
958 | |||
947 | if (test_and_clear_bit(KVM_REQ_RESUME, &vcpu->requests)) { | 959 | if (test_and_clear_bit(KVM_REQ_RESUME, &vcpu->requests)) { |
948 | vcpu_do_resume(vcpu); | 960 | vcpu_do_resume(vcpu); |
949 | return; | 961 | return; |
@@ -969,3 +981,11 @@ void vmm_transition(struct kvm_vcpu *vcpu) | |||
969 | 1, 0, 0, 0, 0, 0); | 981 | 1, 0, 0, 0, 0, 0); |
970 | kvm_do_resume_op(vcpu); | 982 | kvm_do_resume_op(vcpu); |
971 | } | 983 | } |
984 | |||
985 | void vmm_panic_handler(u64 vec) | ||
986 | { | ||
987 | struct kvm_vcpu *vcpu = current_vcpu; | ||
988 | vmm_sanity = 0; | ||
989 | panic_vm(vcpu, "Unexpected interruption occurs in VMM, vector:0x%lx\n", | ||
990 | vec2off[vec]); | ||
991 | } | ||