Commit ff1ca3f9 authored by Alexander Graf's avatar Alexander Graf Committed by Marcelo Tosatti

KVM: PPC: Pass program interrupt flags to the guest

When we need to reinject a program interrupt into the guest, we also need to
reinject the corresponding flags into the guest.
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
Reported-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent d35feb26
...@@ -633,6 +633,9 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, ...@@ -633,6 +633,9 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
case BOOK3S_INTERRUPT_PROGRAM: case BOOK3S_INTERRUPT_PROGRAM:
{ {
enum emulation_result er; enum emulation_result er;
ulong flags;
flags = (vcpu->arch.shadow_msr & 0x1f0000ull);
if (vcpu->arch.msr & MSR_PR) { if (vcpu->arch.msr & MSR_PR) {
#ifdef EXIT_DEBUG #ifdef EXIT_DEBUG
...@@ -640,7 +643,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, ...@@ -640,7 +643,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
#endif #endif
if ((vcpu->arch.last_inst & 0xff0007ff) != if ((vcpu->arch.last_inst & 0xff0007ff) !=
(INS_DCBZ & 0xfffffff7)) { (INS_DCBZ & 0xfffffff7)) {
kvmppc_book3s_queue_irqprio(vcpu, exit_nr); kvmppc_core_queue_program(vcpu, flags);
r = RESUME_GUEST; r = RESUME_GUEST;
break; break;
} }
...@@ -655,7 +658,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, ...@@ -655,7 +658,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
case EMULATE_FAIL: case EMULATE_FAIL:
printk(KERN_CRIT "%s: emulation at %lx failed (%08x)\n", printk(KERN_CRIT "%s: emulation at %lx failed (%08x)\n",
__func__, vcpu->arch.pc, vcpu->arch.last_inst); __func__, vcpu->arch.pc, vcpu->arch.last_inst);
kvmppc_book3s_queue_irqprio(vcpu, exit_nr); kvmppc_core_queue_program(vcpu, flags);
r = RESUME_GUEST; r = RESUME_GUEST;
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment