diff options
Diffstat (limited to 'arch/ia64/kvm/process.c')
-rw-r--r-- | arch/ia64/kvm/process.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/arch/ia64/kvm/process.c b/arch/ia64/kvm/process.c index 800817307b7b..552d07724207 100644 --- a/arch/ia64/kvm/process.c +++ b/arch/ia64/kvm/process.c | |||
@@ -527,7 +527,8 @@ void reflect_interruption(u64 ifa, u64 isr, u64 iim, | |||
527 | vector = vec2off[vec]; | 527 | vector = vec2off[vec]; |
528 | 528 | ||
529 | if (!(vpsr & IA64_PSR_IC) && (vector != IA64_DATA_NESTED_TLB_VECTOR)) { | 529 | if (!(vpsr & IA64_PSR_IC) && (vector != IA64_DATA_NESTED_TLB_VECTOR)) { |
530 | panic_vm(vcpu); | 530 | panic_vm(vcpu, "Interruption with vector :0x%lx occurs " |
531 | "with psr.ic = 0\n", vector); | ||
531 | return; | 532 | return; |
532 | } | 533 | } |
533 | 534 | ||
@@ -586,7 +587,7 @@ static void set_pal_call_result(struct kvm_vcpu *vcpu) | |||
586 | vcpu_set_gr(vcpu, 10, p->u.pal_data.ret.v1, 0); | 587 | vcpu_set_gr(vcpu, 10, p->u.pal_data.ret.v1, 0); |
587 | vcpu_set_gr(vcpu, 11, p->u.pal_data.ret.v2, 0); | 588 | vcpu_set_gr(vcpu, 11, p->u.pal_data.ret.v2, 0); |
588 | } else | 589 | } else |
589 | panic_vm(vcpu); | 590 | panic_vm(vcpu, "Mis-set for exit reason!\n"); |
590 | } | 591 | } |
591 | 592 | ||
592 | static void set_sal_call_data(struct kvm_vcpu *vcpu) | 593 | static void set_sal_call_data(struct kvm_vcpu *vcpu) |
@@ -614,7 +615,7 @@ static void set_sal_call_result(struct kvm_vcpu *vcpu) | |||
614 | vcpu_set_gr(vcpu, 10, p->u.sal_data.ret.r10, 0); | 615 | vcpu_set_gr(vcpu, 10, p->u.sal_data.ret.r10, 0); |
615 | vcpu_set_gr(vcpu, 11, p->u.sal_data.ret.r11, 0); | 616 | vcpu_set_gr(vcpu, 11, p->u.sal_data.ret.r11, 0); |
616 | } else | 617 | } else |
617 | panic_vm(vcpu); | 618 | panic_vm(vcpu, "Mis-set for exit reason!\n"); |
618 | } | 619 | } |
619 | 620 | ||
620 | void kvm_ia64_handle_break(unsigned long ifa, struct kvm_pt_regs *regs, | 621 | void kvm_ia64_handle_break(unsigned long ifa, struct kvm_pt_regs *regs, |
@@ -680,7 +681,7 @@ static void generate_exirq(struct kvm_vcpu *vcpu) | |||
680 | vpsr = VCPU(vcpu, vpsr); | 681 | vpsr = VCPU(vcpu, vpsr); |
681 | isr = vpsr & IA64_PSR_RI; | 682 | isr = vpsr & IA64_PSR_RI; |
682 | if (!(vpsr & IA64_PSR_IC)) | 683 | if (!(vpsr & IA64_PSR_IC)) |
683 | panic_vm(vcpu); | 684 | panic_vm(vcpu, "Trying to inject one IRQ with psr.ic=0\n"); |
684 | reflect_interruption(0, isr, 0, 12, regs); /* EXT IRQ */ | 685 | reflect_interruption(0, isr, 0, 12, regs); /* EXT IRQ */ |
685 | } | 686 | } |
686 | 687 | ||
@@ -941,8 +942,20 @@ static void vcpu_do_resume(struct kvm_vcpu *vcpu) | |||
941 | ia64_set_pta(vcpu->arch.vhpt.pta.val); | 942 | ia64_set_pta(vcpu->arch.vhpt.pta.val); |
942 | } | 943 | } |
943 | 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 | |||
944 | static void kvm_do_resume_op(struct kvm_vcpu *vcpu) | 955 | static void kvm_do_resume_op(struct kvm_vcpu *vcpu) |
945 | { | 956 | { |
957 | vmm_sanity_check(vcpu); /*Guarantee vcpu runing on healthy vmm!*/ | ||
958 | |||
946 | if (test_and_clear_bit(KVM_REQ_RESUME, &vcpu->requests)) { | 959 | if (test_and_clear_bit(KVM_REQ_RESUME, &vcpu->requests)) { |
947 | vcpu_do_resume(vcpu); | 960 | vcpu_do_resume(vcpu); |
948 | return; | 961 | return; |
@@ -968,3 +981,11 @@ void vmm_transition(struct kvm_vcpu *vcpu) | |||
968 | 1, 0, 0, 0, 0, 0); | 981 | 1, 0, 0, 0, 0, 0); |
969 | kvm_do_resume_op(vcpu); | 982 | kvm_do_resume_op(vcpu); |
970 | } | 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 | } | ||