mirror of https://github.com/xemu-project/xemu.git
target/ppc: Add support for LPCR:HEIC on POWER9
This controls whether the External Interrupt (0x500) can be delivered to the hypervisor or not. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Message-Id: <20190215161648.9600-11-clg@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
67afe7759d
commit
6eebe6dccb
|
@ -827,7 +827,10 @@ static void ppc_hw_interrupt(CPUPPCState *env)
|
||||||
/* External interrupt can ignore MSR:EE under some circumstances */
|
/* External interrupt can ignore MSR:EE under some circumstances */
|
||||||
if (env->pending_interrupts & (1 << PPC_INTERRUPT_EXT)) {
|
if (env->pending_interrupts & (1 << PPC_INTERRUPT_EXT)) {
|
||||||
bool lpes0 = !!(env->spr[SPR_LPCR] & LPCR_LPES0);
|
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);
|
powerpc_excp(cpu, env->excp_model, POWERPC_EXCP_EXTERNAL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8823,8 +8823,11 @@ static bool cpu_has_work_POWER9(CPUState *cs)
|
||||||
/* External Exception */
|
/* External Exception */
|
||||||
if ((env->pending_interrupts & (1u << PPC_INTERRUPT_EXT)) &&
|
if ((env->pending_interrupts & (1u << PPC_INTERRUPT_EXT)) &&
|
||||||
(env->spr[SPR_LPCR] & LPCR_EEE)) {
|
(env->spr[SPR_LPCR] & LPCR_EEE)) {
|
||||||
|
bool heic = !!(env->spr[SPR_LPCR] & LPCR_HEIC);
|
||||||
|
if (heic == 0 || !msr_hv || msr_pr) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/* Decrementer Exception */
|
/* Decrementer Exception */
|
||||||
if ((env->pending_interrupts & (1u << PPC_INTERRUPT_DECR)) &&
|
if ((env->pending_interrupts & (1u << PPC_INTERRUPT_DECR)) &&
|
||||||
(env->spr[SPR_LPCR] & LPCR_DEE)) {
|
(env->spr[SPR_LPCR] & LPCR_DEE)) {
|
||||||
|
|
Loading…
Reference in New Issue