[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 4/8] ppc: Fix conditions for delivering external inter
From: |
Cédric Le Goater |
Subject: |
[Qemu-ppc] [PATCH 4/8] ppc: Fix conditions for delivering external interrupts to a guest |
Date: |
Mon, 27 Jun 2016 08:55:17 +0200 |
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>
---
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 533866b87b60..26adda49b248 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.1.4
- [Qemu-ppc] [PATCH 0/8] pnv: more fixes to the exception model, Cédric Le Goater, 2016/06/27
- [Qemu-ppc] [PATCH 1/8] ppc: Add a bunch of hypervisor SPRs to Book3s, Cédric Le Goater, 2016/06/27
- [Qemu-ppc] [PATCH 2/8] ppc: Update LPCR definitions, Cédric Le Goater, 2016/06/27
- [Qemu-ppc] [PATCH 3/8] ppc: Use a helper to filter writes to LPCR, Cédric Le Goater, 2016/06/27
- [Qemu-ppc] [PATCH 4/8] ppc: Fix conditions for delivering external interrupts to a guest,
Cédric Le Goater <=
- [Qemu-ppc] [PATCH 5/8] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set, Cédric Le Goater, 2016/06/27
- [Qemu-ppc] [PATCH 6/8] ppc: Initial HDEC support, Cédric Le Goater, 2016/06/27
- [Qemu-ppc] [PATCH 7/8] ppc: LPCR is a HV resource, Cédric Le Goater, 2016/06/27
- [Qemu-ppc] [PATCH 8/8] ppc: Print HSRR0/HSRR1 in "info registers", Cédric Le Goater, 2016/06/27
- Re: [Qemu-ppc] [PATCH 0/8] pnv: more fixes to the exception model, David Gibson, 2016/06/28