android_kernel_lge_bullhead/arch/powerpc/kvm
Thomas Huth 9f3a56a479 KVM: PPC: Book3S PR: Fix illegal opcode emulation
commit 708e75a3ee750dce1072134e630d66c4e6eaf63c upstream.

If kvmppc_handle_exit_pr() calls kvmppc_emulate_instruction() to emulate
one instruction (in the BOOK3S_INTERRUPT_H_EMUL_ASSIST case), it calls
kvmppc_core_queue_program() afterwards if kvmppc_emulate_instruction()
returned EMULATE_FAIL, so the guest gets an program interrupt for the
illegal opcode.
However, the kvmppc_emulate_instruction() also tried to inject a
program exception for this already, so the program interrupt gets
injected twice and the return address in srr0 gets destroyed.
All other callers of kvmppc_emulate_instruction() are also injecting
a program interrupt, and since the callers have the right knowledge
about the srr1 flags that should be used, it is the function
kvmppc_emulate_instruction() that should _not_ inject program
interrupts, so remove the kvmppc_core_queue_program() here.

This fixes the issue discovered by Laurent Vivier with kvm-unit-tests
where the logs are filled with these messages when the test tries
to execute an illegal instruction:

     Couldn't emulate instruction 0x00000000 (op 0 xop 0)
     kvmppc_handle_exit_pr: emulation at 700 failed (00000000)

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Tested-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Willy Tarreau <w@1wt.eu>
2017-06-20 14:04:25 +02:00
..
44x.c KVM: PPC: Book3E: Refactor ONE_REG ioctl implementation 2013-04-26 20:27:05 +02:00
44x_emulate.c KVM: PPC: 44x: fix DCR read/write 2012-10-30 10:54:50 +01:00
44x_tlb.c kvm/ppc/booke: Hold srcu lock when calling gfn functions 2013-06-11 11:10:59 +03:00
44x_tlb.h KVM: ppc: rename 44x MMU functions used in booke.c 2009-03-24 11:02:56 +02:00
Kconfig KVM: PPC: Book3S: Add kernel emulation for the XICS interrupt controller 2013-04-26 20:27:30 +02:00
Makefile KVM: PPC: Book3S HV: Add support for real mode ICP in XICS emulation 2013-04-26 20:27:32 +02:00
book3s.c KVM: PPC: Book3S: Facilities to save/restore XICS presentation ctrler state 2013-04-26 20:27:34 +02:00
book3s_32_mmu.c KVM: PPC: Put segment registers in shared page 2010-10-24 10:52:11 +02:00
book3s_32_mmu_host.c KVM: do not treat noslot pfn as a error pfn 2012-10-29 20:31:04 -02:00
book3s_32_sr.S KVM: PPC: book3s_pr: Simplify transitions between virtual and real mode 2011-09-25 19:52:29 +03:00
book3s_64_mmu.c KVM: PPC: Interpret SDR1 as HVA in PAPR mode 2011-09-25 19:52:21 +03:00
book3s_64_mmu_host.c powerpc: Decode the pte-lp-encoding bits correctly. 2013-04-30 16:00:14 +10:00
book3s_64_mmu_hv.c powerpc: kvm: fix rare but potential deadlock scene 2014-01-09 12:24:19 -08:00
book3s_64_slb.S KVM: PPC: Book3S: PR: No isync in slbie path 2012-05-06 16:19:09 +02:00
book3s_64_vio.c constify a bunch of struct file_operations instances 2013-04-09 14:16:20 -04:00
book3s_64_vio_hv.c kvm/book3s: Make kernel emulated H_PUT_TCE available for "PR" KVM 2012-05-06 16:19:11 +02:00
book3s_emulate.c KVM: extend EMULATE_EXIT_USER to support different exit reasons 2013-04-26 20:27:03 +02:00
book3s_exports.c KVM: PPC: Book3S PR: Fix VSX handling 2012-12-06 01:34:02 +01:00
book3s_hv.c KVM: PPC: Book3S HV: Prohibit setting illegal transaction state in MSR 2016-01-28 21:49:28 -08:00
book3s_hv_builtin.c KVM: PPC: Quieten message about allocating linear regions 2012-10-05 23:38:40 +02:00
book3s_hv_interrupts.S powerpc: Fix build errors with UP configs in HV-style KVM 2013-04-18 13:03:57 +10:00
book3s_hv_ras.c KVM: PPC: Book3S HV: Fix compilation without CONFIG_PPC_POWERNV 2013-01-06 14:02:00 +01:00
book3s_hv_rm_mmu.c powerpc: kvm: fix rare but potential deadlock scene 2014-01-09 12:24:19 -08:00
book3s_hv_rm_xics.c KVM: PPC: Book3S HV: Add support for real mode ICP in XICS emulation 2013-04-26 20:27:32 +02:00
book3s_hv_rmhandlers.S KVM: PPC: Book3S HV: Fix typo in saving DSCR 2013-10-18 07:45:44 -07:00
book3s_interrupts.S powerpc: Merge VCPU_GPR 2012-07-10 19:18:06 +10:00
book3s_mmu_hpte.c hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
book3s_paired_singles.c powerpc/kvm: Fallout from system.h disintegration 2012-04-02 14:00:04 +10:00
book3s_pr.c Merge tag 'kvm-3.10-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm 2013-05-05 14:47:31 -07:00
book3s_pr_papr.c powerpc/kvm/book3s: Add support for H_IPOLL and H_XIRR_X in XICS emulation 2013-06-01 08:29:27 +10:00
book3s_rmhandlers.S KVM: PPC: Book3S PR: Fix VSX handling 2012-12-06 01:34:02 +01:00
book3s_rtas.c KVM: PPC: Book3S: Add support for ibm,int-on/off RTAS calls 2013-04-26 20:27:33 +02:00
book3s_segment.S powerpc: Move and fix MTMSR_EERI definition 2012-07-10 19:18:08 +10:00
book3s_xics.c KVM: PPC: Book3S: Fix compile error in XICS emulation 2013-09-26 17:18:03 -07:00
book3s_xics.h KVM: PPC: Book3S: Add API for in-kernel XICS emulation 2013-05-02 15:28:36 +02:00
booke.c kvm/ppc/booke: Delay kvmppc_lazy_ee_enable 2013-06-19 12:15:13 +02:00
booke.h KVM: PPC: booke: Allow multiple exception types 2013-02-13 12:56:40 +01:00
booke_emulate.c KVM: PPC: BookE: Emulate mfspr on EPR 2013-01-10 13:42:30 +01:00
booke_interrupts.S KVM: PPC: booke: Added debug handler 2013-03-22 01:21:09 +01:00
bookehv_interrupts.S KVM: PPC: bookehv64: Add support for interrupt handling 2012-12-06 01:34:11 +01:00
e500.c KVM: PPC: e500: Expose MMU registers via ONE_REG 2013-04-26 20:27:06 +02:00
e500.h KVM: PPC: e500: Add support for TLBnPS registers 2013-04-26 20:27:07 +02:00
e500_emulate.c KVM: PPC: e500: Add support for EPTCFG register 2013-04-26 20:27:08 +02:00
e500_mmu.c KVM: PPC: e500: Fix bad address type in deliver_tlb_misss() 2014-02-06 11:08:17 -08:00
e500_mmu_host.c kvm/ppc/e500: eliminate tlb_refs 2013-04-11 15:53:43 +02:00
e500_mmu_host.h KVM: PPC: E500: Make clear_tlb_refs and clear_tlb1_bitmap static 2013-01-24 19:23:33 +01:00
e500mc.c kvm/ppc/booke64: Disable e6500 support 2013-06-11 11:10:56 +03:00
emulate.c KVM: PPC: Book3S PR: Fix illegal opcode emulation 2017-06-20 14:04:25 +02:00
fpu.S powerpc: Remove fpscr use from [kvm_]cvt_{fd,df} 2010-09-02 14:07:32 +10:00
irq.h KVM: PPC: Book3S: Add API for in-kernel XICS emulation 2013-05-02 15:28:36 +02:00
mpic.c kvm/ppc/mpic: fix missing unlock in set_base_addr() 2013-05-02 15:28:35 +02:00
powerpc.c KVM: PPC: Book3S: Add API for in-kernel XICS emulation 2013-05-02 15:28:36 +02:00
timing.c KVM: PPC: fix partial application of "exit timing in ticks" 2011-07-12 13:16:28 +03:00
timing.h KVM: PPC: booke: category E.HV (GS-mode) support 2012-04-08 12:51:19 +03:00
trace.h Merge remote-tracking branch 'master' into queue 2012-10-29 19:15:32 -02:00