diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2016-07-11 18:10:06 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-07-11 18:10:06 +0200 |
commit | 6d5315b3a60cc9b136b86b4dafeb73bf272d24c0 (patch) | |
tree | e84da27738b855bd268fec8f1ae23cec5f019dab /arch/powerpc/kvm/book3s_pr.c | |
parent | 8391ce447f18476273331399a7f5930e5494bf46 (diff) | |
parent | fd7bacbca47a86a6f418440d8a5d7b7edbb2f8f9 (diff) |
Merge branch 'kvm-ppc-next' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc into HEAD
Diffstat (limited to 'arch/powerpc/kvm/book3s_pr.c')
-rw-r--r-- | arch/powerpc/kvm/book3s_pr.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c index 6a66c5ff0827..b6cd730c33ef 100644 --- a/arch/powerpc/kvm/book3s_pr.c +++ b/arch/powerpc/kvm/book3s_pr.c @@ -1049,7 +1049,17 @@ int kvmppc_handle_exit_pr(struct kvm_run *run, struct kvm_vcpu *vcpu, int emul; program_interrupt: - flags = vcpu->arch.shadow_srr1 & 0x1f0000ull; + /* + * shadow_srr1 only contains valid flags if we came here via + * a program exception. The other exceptions (emulation assist, + * FP unavailable, etc.) do not provide flags in SRR1, so use + * an illegal-instruction exception when injecting a program + * interrupt into the guest. + */ + if (exit_nr == BOOK3S_INTERRUPT_PROGRAM) + flags = vcpu->arch.shadow_srr1 & 0x1f0000ull; + else + flags = SRR1_PROGILL; emul = kvmppc_get_last_inst(vcpu, INST_GENERIC, &last_inst); if (emul != EMULATE_DONE) { |