qemu/target/mips
Leon Alrae c7c7e1e9a5 target/mips: compare virtual addresses in LL/SC sequence
Do only virtual addresses comaprisons in LL/SC sequence emulations.

Until this patch, physical addresses had been compared in SC part of
LL/SC sequence, even though such comparisons could be avoided. Getting
rid of them allows throwing away SC helpers and having common SC
implementations in user and system mode, avoiding the need for two
separate implementations selected by #ifdef CONFIG_USER_ONLY.

Correct guest software should not rely on LL/SC if they accesses the
same physical address via different virtual addresses or if page
mapping gets changed between LL/SC due to manipulating TLB entries.
MIPS Instruction Set Manual clearly says that an RMW sequence must
use the same address in the LL and SC (virtual address, physical
address, cacheability and coherency attributes must be identical).
Otherwise, the result of the SC is not predictable. This patch takes
advantage of this fact and removes the virtual->physical address
translation from SC helper.

lladdr served as Coprocessor 0 LLAddr register which captures physical
address of the most recent LL instruction, and also lladdr was used
for comparison with following SC physical address. This patch changes
the meaning of lladdr - now it will only keep the virtual address of
the most recent LL. Additionally, CP0_LLAddr field is introduced which
is the actual Coperocessor 0 LLAddr register that guest can access.

Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Signed-off-by: Miodrag Dinic <miodrag.dinic@imgtec.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Acked-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
2019-02-14 17:47:28 +01:00
..
cp0_timer.c mips: introduce internal.h and cleanup cpu.h 2017-09-21 13:24:34 +01:00
cpu-qom.h mips: MIPSCPU model subclasses 2017-09-21 13:25:30 +01:00
cpu.c target/mips: Add disassembler support for nanoMIPS 2018-10-25 22:13:33 +02:00
cpu.h target/mips: compare virtual addresses in LL/SC sequence 2019-02-14 17:47:28 +01:00
dsp_helper.c Remove unnecessary variables for function return value 2018-05-20 08:48:13 +03:00
gdbstub.c target/mips: Fix gdbstub to read/write 64 bit FP registers 2018-06-27 20:13:50 +02:00
helper.c target/mips: Implement hardware page table walker for MIPS32 2018-10-18 20:37:20 +02:00
helper.h target/mips: Provide R/W access to SAARI and SAAR CP0 registers 2019-01-18 16:53:28 +01:00
internal.h target/mips: Provide R/W access to SAARI and SAAR CP0 registers 2019-01-18 16:53:28 +01:00
kvm_mips.h
kvm.c mips: introduce internal.h and cleanup cpu.h 2017-09-21 13:24:34 +01:00
lmi_helper.c
machine.c target/mips: compare virtual addresses in LL/SC sequence 2019-02-14 17:47:28 +01:00
Makefile.objs mips: move hw/mips/cputimer.c to target/mips/ 2017-09-21 13:24:34 +01:00
mips-defs.h target/mips: Define a bit for MXU in insn_flags 2018-10-29 14:13:47 +01:00
mips-semi.c
msa_helper.c target/mips: Remove floatX_maybe_silence_nan from conversions 2018-05-17 15:27:15 -07:00
op_helper.c target/mips: compare virtual addresses in LL/SC sequence 2019-02-14 17:47:28 +01:00
TODO
trace-events docs: fix broken paths to docs/devel/tracing.txt 2017-07-31 13:12:53 +03:00
translate_init.inc.c target/mips: Add I6500 core configuration 2019-01-24 17:48:33 +01:00
translate.c target/mips: compare virtual addresses in LL/SC sequence 2019-02-14 17:47:28 +01:00