On 17/3/26 18:50, Peter Maydell wrote:
The count_clock pointer is not something we can do a shallow copy of,
as linux-user cpu_copy() does, and although it is a system-mode piece
of state we unconditionally create it, so it is present also in
user-mode.
There isn't any need to keep this in the env struct rather than the
CPU struct, so move it to avoid possible memory leaks or
double-usage. This also puts it next to the other Clocks that this
CPU has.
I haven't seen any sanitizer reports about this field, so this is
averting a possible problem rather than correcting an observed one.
Signed-off-by: Peter Maydell <[email protected]>
---
target/mips/cpu.c | 4 ++--
target/mips/cpu.h | 2 +-
target/mips/system/cp0_timer.c | 12 ++++++++----
3 files changed, 11 insertions(+), 7 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>