qemu-e2k/target/ppc
Daniel Henrique Barboza d139786e1b ppc/mmu_helper.c: do not truncate 'ea' in booke206_invalidate_ea_tlb()
'tlbivax' is implemented by gen_tlbivax_booke206() via
gen_helper_booke206_tlbivax(). In case the TLB needs to be flushed,
booke206_invalidate_ea_tlb() is called. All these functions, but
booke206_invalidate_ea_tlb(), uses a 64-bit effective address 'ea'.

booke206_invalidate_ea_tlb() uses an uint32_t 'ea' argument that
truncates the original 'ea' value for apparently no particular reason.
This function retrieves the tlb pointer by calling booke206_get_tlbm(),
which also uses a target_ulong address as parameter - in this case, a
truncated 'ea' address. All the surrounding logic considers the
effective TLB address as a 64 bit value, aside from the signature of
booke206_invalidate_ea_tlb().

Last but not the least, PowerISA 2.07B section 6.11.4.9 [2] makes it
clear that the effective address "EA" is a 64 bit value.

Commit 01662f3e51 introduced this code and no changes were made ever
since. An user detected a problem with tlbivax [1] stating that this
address truncation was the cause. This same behavior might be the source
of several subtle bugs that were never caught.

For all these reasons, this patch assumes that this address truncation
is the result of a mistake/oversight of the original commit, and changes
booke206_invalidate_ea_tlb() 'ea' argument to 'vaddr'.

[1] https://gitlab.com/qemu-project/qemu/-/issues/52
[2] https://wiki.raptorcs.com/wiki/File:PowerISA_V2.07B.pdf

Fixes: 01662f3e51 ("PPC: Implement e500 (FSL) MMU")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/52
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2021-11-11 11:35:13 +01:00
..
translate target/ppc: Fix register update on lf[sd]u[x]/stf[sd]u[x] 2021-11-10 08:20:02 +01:00
arch_dump.c
compat.c
cpu_init.c Trivial patches branch pull request 20211101 v2 2021-11-03 11:24:09 -04:00
cpu-models.c ppc: Add a POWER10 DD2 CPU 2021-08-27 12:41:13 +10:00
cpu-models.h ppc: Add a POWER10 DD2 CPU 2021-08-27 12:41:13 +10:00
cpu-param.h
cpu-qom.h
cpu.c linux-user: Fix XER access in ppc version of elf_core_copy_regs 2021-10-21 11:42:47 +11:00
cpu.h target/ppc: Implement ppc_cpu_record_sigsegv 2021-11-02 07:00:52 -04:00
dfp_helper.c target/ppc: Move ddedpd[q],denbcd[q],dscli[q],dscri[q] to decodetree 2021-11-09 10:32:52 +11:00
excp_helper.c target/ppc: Restrict ppc_cpu_do_unaligned_access to sysemu 2021-11-02 07:00:52 -04:00
fpu_helper.c
gdbstub.c target/ppc: Fix XER access in gdbstub 2021-10-21 11:42:47 +11:00
helper_regs.c target/ppc: add MMCR0 PMCC bits to hflags 2021-10-21 11:42:47 +11:00
helper_regs.h
helper.h target/ppc: Implement xxblendvb/xxblendvh/xxblendvw/xxblendvd instructions 2021-11-09 10:32:53 +11:00
insn32.decode target/ppc: Implement lxvkq instruction 2021-11-09 10:32:53 +11:00
insn64.decode target/ppc: Implement xxblendvb/xxblendvh/xxblendvw/xxblendvd instructions 2021-11-09 10:32:53 +11:00
int_helper.c target/ppc: Implement xxblendvb/xxblendvh/xxblendvw/xxblendvd instructions 2021-11-09 10:32:53 +11:00
internal.h target/ppc: Restrict ppc_cpu_do_unaligned_access to sysemu 2021-11-02 07:00:52 -04:00
Kconfig
kvm_ppc.h
kvm-stub.c
kvm.c
machine.c
mem_helper.c accel/tcg: Move cpu_atomic decls to exec/cpu_ldst.h 2021-10-13 08:14:54 -07:00
meson.build
mfrom_table_gen.c
mfrom_table.c.inc
misc_helper.c
mmu_common.c
mmu_helper.c ppc/mmu_helper.c: do not truncate 'ea' in booke206_invalidate_ea_tlb() 2021-11-11 11:35:13 +01:00
mmu-book3s-v3.c
mmu-book3s-v3.h
mmu-books.h
mmu-hash32.c
mmu-hash32.h
mmu-hash64.c
mmu-hash64.h
mmu-radix64.c
mmu-radix64.h
monitor.c target/ppc: Fix XER access in monitor 2021-10-21 11:42:47 +11:00
power8-pmu-regs.c.inc target/ppc: adding user read/write functions for PMCs 2021-10-21 11:42:47 +11:00
spr_tcg.h target/ppc: adding user read/write functions for PMCs 2021-10-21 11:42:47 +11:00
tcg-stub.c
timebase_helper.c
trace-events target/ppc: Convert debug to trace events (exceptions) 2021-09-30 12:26:06 +10:00
trace.h
translate.c target/ppc: moved stxv and lxv from legacy to decodtree 2021-11-09 10:32:53 +11:00
user_only_helper.c target/ppc: Implement ppc_cpu_record_sigsegv 2021-11-02 07:00:52 -04:00