Revert "target/ppc: Move SPR_DSISR setting to powerpc_excp"

This reverts commit 336e91f853.

It breaks the --disable-tcg build:

 ../target/ppc/excp_helper.c:463:29: error: implicit declaration of
 function ‘cpu_ldl_code’ [-Werror=implicit-function-declaration]

We should not have TCG code in powerpc_excp because some kvm-only
routines use it indirectly to dispatch interrupts. See
kvm_handle_debug, spapr_mce_req_event and
spapr_do_system_reset_on_cpu.

We can re-introduce the change once we have split the interrupt
injection code between KVM and TCG.

Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Message-Id: <20211209173323.2166642-1-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
This commit is contained in:
Fabiano Rosas 2021-12-17 17:57:18 +01:00 committed by Cédric Le Goater
parent 7fc1dc8313
commit 29c4a3363b
1 changed files with 12 additions and 9 deletions

View File

@ -464,15 +464,13 @@ static inline void powerpc_excp(PowerPCCPU *cpu, int excp_model, int excp)
break; break;
} }
case POWERPC_EXCP_ALIGN: /* Alignment exception */ case POWERPC_EXCP_ALIGN: /* Alignment exception */
/* Get rS/rD and rA from faulting opcode */
/* /*
* Get rS/rD and rA from faulting opcode. * Note: the opcode fields will not be set properly for a
* Note: We will only invoke ALIGN for atomic operations, * direct store load/store, but nobody cares as nobody
* so all instructions are X-form. * actually uses direct store segments.
*/ */
{ env->spr[SPR_DSISR] |= (env->error_code & 0x03FF0000) >> 16;
uint32_t insn = cpu_ldl_code(env, env->nip);
env->spr[SPR_DSISR] |= (insn & 0x03FF0000) >> 16;
}
break; break;
case POWERPC_EXCP_PROGRAM: /* Program exception */ case POWERPC_EXCP_PROGRAM: /* Program exception */
switch (env->error_code & ~0xF) { switch (env->error_code & ~0xF) {
@ -1441,6 +1439,11 @@ void ppc_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr,
int mmu_idx, uintptr_t retaddr) int mmu_idx, uintptr_t retaddr)
{ {
CPUPPCState *env = cs->env_ptr; CPUPPCState *env = cs->env_ptr;
uint32_t insn;
/* Restore state and reload the insn we executed, for filling in DSISR. */
cpu_restore_state(cs, retaddr, true);
insn = cpu_ldl_code(env, env->nip);
switch (env->mmu_model) { switch (env->mmu_model) {
case POWERPC_MMU_SOFT_4xx: case POWERPC_MMU_SOFT_4xx:
@ -1456,8 +1459,8 @@ void ppc_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr,
} }
cs->exception_index = POWERPC_EXCP_ALIGN; cs->exception_index = POWERPC_EXCP_ALIGN;
env->error_code = 0; env->error_code = insn & 0x03FF0000;
cpu_loop_exit_restore(cs, retaddr); cpu_loop_exit(cs);
} }
#endif /* CONFIG_TCG */ #endif /* CONFIG_TCG */
#endif /* !CONFIG_USER_ONLY */ #endif /* !CONFIG_USER_ONLY */