mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
PPC: Unify dcbzl code path
The bit that makes a dcbz instruction a dcbzl instruction was declared as reserved in ppc32 ISAs. However, hardware simply ignores the bit, making code valid if it simply invokes dcbzl instead of dcbz even on 750 and G4. Thus, mark the bit as unreserved so that we properly emulate a simple dcbz in case we're running on non-G5s. While at it, also refactor the code to check the 970 special case during runtime. This way we don't need to differenciate between a 970 dcbz and any other dcbz anymore. We also allow for future improvements to add e500mc dcbz handling. Reported-by: Amadeusz Sławiński <amade@asmblr.net> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
6b2578d678
commit
8e33944f8c
5 changed files with 32 additions and 41 deletions
|
@ -136,18 +136,21 @@ static void do_dcbz(CPUPPCState *env, target_ulong addr, int dcache_line_size)
|
|||
}
|
||||
}
|
||||
|
||||
void helper_dcbz(CPUPPCState *env, target_ulong addr)
|
||||
void helper_dcbz(CPUPPCState *env, target_ulong addr, uint32_t is_dcbzl)
|
||||
{
|
||||
do_dcbz(env, addr, env->dcache_line_size);
|
||||
}
|
||||
int dcbz_size = env->dcache_line_size;
|
||||
|
||||
void helper_dcbz_970(CPUPPCState *env, target_ulong addr)
|
||||
{
|
||||
if (((env->spr[SPR_970_HID5] >> 7) & 0x3) == 1) {
|
||||
do_dcbz(env, addr, 32);
|
||||
} else {
|
||||
do_dcbz(env, addr, env->dcache_line_size);
|
||||
#if !defined(CONFIG_USER_ONLY) && defined(TARGET_PPC64)
|
||||
if (!is_dcbzl &&
|
||||
(env->excp_model == POWERPC_EXCP_970) &&
|
||||
((env->spr[SPR_970_HID5] >> 7) & 0x3) == 1) {
|
||||
dcbz_size = 32;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* XXX add e500mc support */
|
||||
|
||||
do_dcbz(env, addr, dcbz_size);
|
||||
}
|
||||
|
||||
void helper_icbi(CPUPPCState *env, target_ulong addr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue