[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 07/67] target/ppc: Fix doorbell delivery to threads in powersave
From: |
Nicholas Piggin |
Subject: |
[PULL 07/67] target/ppc: Fix doorbell delivery to threads in powersave |
Date: |
Mon, 4 Nov 2024 10:17:56 +1000 |
Doorbell exceptions are not not cleared when they cause a wake from
powersave state, only when they take the corresponding interrupt.
The sreset-on-wake logic must avoid clearing the interrupt in this
case.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
target/ppc/excp_helper.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
index 701abe1b6d..b619a6adde 100644
--- a/target/ppc/excp_helper.c
+++ b/target/ppc/excp_helper.c
@@ -2237,7 +2237,9 @@ static void p8_deliver_interrupt(CPUPPCState *env, int
interrupt)
powerpc_excp(cpu, POWERPC_EXCP_DECR);
break;
case PPC_INTERRUPT_DOORBELL:
- env->pending_interrupts &= ~PPC_INTERRUPT_DOORBELL;
+ if (!env->resume_as_sreset) {
+ env->pending_interrupts &= ~PPC_INTERRUPT_DOORBELL;
+ }
if (is_book3s_arch2x(env)) {
powerpc_excp(cpu, POWERPC_EXCP_SDOOR);
} else {
@@ -2245,7 +2247,9 @@ static void p8_deliver_interrupt(CPUPPCState *env, int
interrupt)
}
break;
case PPC_INTERRUPT_HDOORBELL:
- env->pending_interrupts &= ~PPC_INTERRUPT_HDOORBELL;
+ if (!env->resume_as_sreset) {
+ env->pending_interrupts &= ~PPC_INTERRUPT_HDOORBELL;
+ }
powerpc_excp(cpu, POWERPC_EXCP_SDOOR_HV);
break;
case PPC_INTERRUPT_PERFM:
@@ -2301,6 +2305,7 @@ static void p9_deliver_interrupt(CPUPPCState *env, int
interrupt)
case PPC_INTERRUPT_HDECR: /* Hypervisor decrementer exception */
/* HDEC clears on delivery */
+ /* XXX: should not see an HDEC if resume_as_sreset. assert? */
env->pending_interrupts &= ~PPC_INTERRUPT_HDECR;
powerpc_excp(cpu, POWERPC_EXCP_HDECR);
break;
@@ -2320,11 +2325,15 @@ static void p9_deliver_interrupt(CPUPPCState *env, int
interrupt)
powerpc_excp(cpu, POWERPC_EXCP_DECR);
break;
case PPC_INTERRUPT_DOORBELL:
- env->pending_interrupts &= ~PPC_INTERRUPT_DOORBELL;
+ if (!env->resume_as_sreset) {
+ env->pending_interrupts &= ~PPC_INTERRUPT_DOORBELL;
+ }
powerpc_excp(cpu, POWERPC_EXCP_SDOOR);
break;
case PPC_INTERRUPT_HDOORBELL:
- env->pending_interrupts &= ~PPC_INTERRUPT_HDOORBELL;
+ if (!env->resume_as_sreset) {
+ env->pending_interrupts &= ~PPC_INTERRUPT_HDOORBELL;
+ }
powerpc_excp(cpu, POWERPC_EXCP_SDOOR_HV);
break;
case PPC_INTERRUPT_PERFM:
--
2.45.2
- [PULL 00/67] ppc-for-9.2-1 queue, Nicholas Piggin, 2024/11/03
- [PULL 03/67] ppc/pnv: Fix LPC serirq routing calculation, Nicholas Piggin, 2024/11/03
- [PULL 04/67] ppc/pnv: Fix LPC POWER8 register sanity check, Nicholas Piggin, 2024/11/03
- [PULL 05/67] target/ppc: Fix mtDPDES targeting SMT siblings, Nicholas Piggin, 2024/11/03
- [PULL 06/67] target/ppc: PMIs are level triggered, Nicholas Piggin, 2024/11/03
- [PULL 07/67] target/ppc: Fix doorbell delivery to threads in powersave,
Nicholas Piggin <=
- [PULL 08/67] target/ppc: Fix HFSCR facility checks, Nicholas Piggin, 2024/11/03
- [PULL 09/67] target/ppc: Fix VRMA to not check virtual page class key protection, Nicholas Piggin, 2024/11/03
- [PULL 10/67] ppc/pnv: ADU fix possible buffer overrun with invalid size, Nicholas Piggin, 2024/11/03
- [PULL 11/67] MAINTAINERS: Cover PowerPC SPI model in PowerNV section, Nicholas Piggin, 2024/11/03
- [PULL 12/67] hw/ssi/pnv_spi: Match _xfer_buffer_free() with _xfer_buffer_new(), Nicholas Piggin, 2024/11/03
- [PULL 13/67] hw/ssi/pnv_spi: Return early in transfer(), Nicholas Piggin, 2024/11/03
- [PULL 14/67] hw/ssi/pnv_spi: Fixes Coverity CID 1558831, Nicholas Piggin, 2024/11/03
- [PULL 15/67] tests/tcg: Replace -mpower8-vector with -mcpu=power8, Nicholas Piggin, 2024/11/03