[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 10/50] target/ppc: Add support for LPCR:HEIC on POWER9
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 10/50] target/ppc: Add support for LPCR:HEIC on POWER9 |
Date: |
Tue, 26 Feb 2019 15:52:24 +1100 |
From: Benjamin Herrenschmidt <address@hidden>
This controls whether the External Interrupt (0x500) can be
delivered to the hypervisor or not.
Signed-off-by: Benjamin Herrenschmidt <address@hidden>
Signed-off-by: Cédric Le Goater <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
target/ppc/excp_helper.c | 5 ++++-
target/ppc/translate_init.inc.c | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
index d171a5eb62..39bedbb11d 100644
--- a/target/ppc/excp_helper.c
+++ b/target/ppc/excp_helper.c
@@ -827,7 +827,10 @@ static void ppc_hw_interrupt(CPUPPCState *env)
/* External 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 (async_deliver || (env->has_hv_mode && msr_hv == 0 && !lpes0)) {
+ bool heic = !!(env->spr[SPR_LPCR] & LPCR_HEIC);
+ /* HEIC blocks delivery to the hypervisor */
+ if ((async_deliver && !(heic && msr_hv && !msr_pr)) ||
+ (env->has_hv_mode && msr_hv == 0 && !lpes0)) {
powerpc_excp(cpu, env->excp_model, POWERPC_EXCP_EXTERNAL);
return;
}
diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c
index 9d84164915..965c5273a6 100644
--- a/target/ppc/translate_init.inc.c
+++ b/target/ppc/translate_init.inc.c
@@ -8823,7 +8823,10 @@ static bool cpu_has_work_POWER9(CPUState *cs)
/* External Exception */
if ((env->pending_interrupts & (1u << PPC_INTERRUPT_EXT)) &&
(env->spr[SPR_LPCR] & LPCR_EEE)) {
- return true;
+ bool heic = !!(env->spr[SPR_LPCR] & LPCR_HEIC);
+ if (heic == 0 || !msr_hv || msr_pr) {
+ return true;
+ }
}
/* Decrementer Exception */
if ((env->pending_interrupts & (1u << PPC_INTERRUPT_DECR)) &&
--
2.20.1
- [Qemu-ppc] [PULL 00/50] ppc-for-4.0 queue 20190226, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 01/50] target/ppc: Fix nip on power management instructions, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 04/50] target/ppc: Move "wakeup reset" code to a separate function, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 02/50] target/ppc: Don't clobber MSR:EE on PM instructions, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 03/50] target/ppc: Fix support for "STOP light" states on POWER9, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 13/50] spapr: support memory unplug for qtest, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 10/50] target/ppc: Add support for LPCR:HEIC on POWER9,
David Gibson <=
- [Qemu-ppc] [PULL 05/50] target/ppc: Rename "in_pm_state" to "resume_as_sreset", David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 11/50] ppc: add host-serial and host-model machine attributes (CVE-2019-8934), David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 08/50] target/ppc: Add Hypervisor Virtualization Interrupt on POWER9, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 09/50] target/ppc: Add POWER9 external interrupt model, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 21/50] target/ppc: Fix #include guard in mmu-book3s-v3.h, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 20/50] target/ppc: Re-enable RMLS on POWER9 for virtual hypervisors, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 07/50] target/ppc: Detect erroneous condition in interrupt delivery, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 19/50] target/ppc/mmu: Use LPCR:HR to chose radix vs. hash translation, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 18/50] target/ppc/spapr: Set LPCR:HR when using Radix mode, David Gibson, 2019/02/25
- [Qemu-ppc] [PULL 31/50] spapr: Generate FDT fragment for CPUs at configure connector time, David Gibson, 2019/02/25