[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 04/23] ppc: Fix conditions for delivering external inte
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 04/23] ppc: Fix conditions for delivering external interrupts to a guest |
Date: |
Fri, 1 Jul 2016 16:41:40 +1000 |
From: Benjamin Herrenschmidt <address@hidden>
External interrupts can bypass the MSR_EE test if they occur in guest
mode and LPES0 is clear. In that case they are directed to the hypervisor
Signed-off-by: Benjamin Herrenschmidt <address@hidden>
Signed-off-by: Cédric Le Goater <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
target-ppc/excp_helper.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/target-ppc/excp_helper.c b/target-ppc/excp_helper.c
index 533866b..26adda4 100644
--- a/target-ppc/excp_helper.c
+++ b/target-ppc/excp_helper.c
@@ -794,6 +794,14 @@ static void ppc_hw_interrupt(CPUPPCState *env)
return;
}
}
+ /* Extermal interrupt can ignore MSR:EE under some circumstances */
+ if (env->pending_interrupts & (1 << PPC_INTERRUPT_EXT)) {
+ bool lpes0 = !!(env->spr[SPR_LPCR] & LPCR_LPES0);
+ if (msr_ee != 0 || (env->has_hv_mode && msr_hv == 0 && !lpes0)) {
+ powerpc_excp(cpu, env->excp_model, POWERPC_EXCP_EXTERNAL);
+ return;
+ }
+ }
if (msr_ce != 0) {
/* External critical interrupt */
if (env->pending_interrupts & (1 << PPC_INTERRUPT_CEXT)) {
@@ -839,17 +847,6 @@ static void ppc_hw_interrupt(CPUPPCState *env)
powerpc_excp(cpu, env->excp_model, POWERPC_EXCP_DECR);
return;
}
- /* External interrupt */
- if (env->pending_interrupts & (1 << PPC_INTERRUPT_EXT)) {
- /* Taking an external interrupt does not clear the external
- * interrupt status
- */
-#if 0
- env->pending_interrupts &= ~(1 << PPC_INTERRUPT_EXT);
-#endif
- powerpc_excp(cpu, env->excp_model, POWERPC_EXCP_EXTERNAL);
- return;
- }
if (env->pending_interrupts & (1 << PPC_INTERRUPT_DOORBELL)) {
env->pending_interrupts &= ~(1 << PPC_INTERRUPT_DOORBELL);
powerpc_excp(cpu, env->excp_model, POWERPC_EXCP_DOORI);
--
2.7.4
- [Qemu-ppc] [PULL 12/23] target-ppc: Eliminate redundant and incorrect function booke206_page_size_to_tlb, (continued)
- [Qemu-ppc] [PULL 12/23] target-ppc: Eliminate redundant and incorrect function booke206_page_size_to_tlb, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 01/23] ppc: Add a bunch of hypervisor SPRs to Book3s, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 13/23] ppc: Fix 64K pages support in full emulation, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 08/23] ppc: Print HSRR0/HSRR1 in "info registers", David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 18/23] target-ppc: gen_pause for instructions: yield, mdoio, mdoom, miso, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 09/23] hw/ppc/spapr: Add some missing hcall function set strings, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 22/23] spapr: drop duplicate variable in spapr_core_release(), David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 23/23] qmp: fix spapr example of query-hotpluggable-cpus, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 07/23] ppc: LPCR is a HV resource, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 20/23] spapr: drop reference on child object during core realization, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 04/23] ppc: Fix conditions for delivering external interrupts to a guest,
David Gibson <=
- [Qemu-ppc] [PULL 11/23] spapr: Restore support for older PowerPC CPU cores, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 06/23] ppc: Initial HDEC support, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 16/23] ppc/xics: Implement H_IPOLL using an accessor, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 14/23] ppc/xics: Rename existing xics to xics_spapr, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 15/23] ppc/xics: Move SPAPR specific code to a separate file, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 17/23] ppc/xics: Replace "icp" with "xics" in most places, David Gibson, 2016/07/01
- Re: [Qemu-ppc] [PULL 00/23] ppc-for-2.7 queue 20160701, Peter Maydell, 2016/07/01