Richard Henderson <r...@twiddle.net> writes: > On 10/27/2016 08:10 AM, Alex Bennée wrote: >> cputlb owns the TLB entries and knows how to safely update them in >> MTTCG. >> >> Signed-off-by: Alex Bennée <alex.ben...@linaro.org> >> --- >> target-arm/cpu.c | 6 ++++++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/target-arm/cpu.c b/target-arm/cpu.c >> index 1b9540e..ff8c594 100644 >> --- a/target-arm/cpu.c >> +++ b/target-arm/cpu.c >> @@ -121,7 +121,13 @@ static void arm_cpu_reset(CPUState *s) >> >> acc->parent_reset(s); >> >> +#ifdef CONFIG_SOFTMMU >> + memset(env, 0, offsetof(CPUARMState, tlb_table)); >> + tlb_flush(s, 0); >> +#else >> memset(env, 0, offsetof(CPUARMState, features)); >> +#endif >> + > > Why special case this for softmmu?
I didn't want to move cpu->features to the other side of CPU_COMMON in cpu.h as there is an explicit statement about being reset. Adding another variable just to be an endpoint of a memset also seemed sub-optimal. > And don't we (or if not, shouldn't we) > handle the tlb_flush generically for reset? Probably. tlb_flush seems to be one of those things liberally sprinkled in the arch code for all sorts of things but certainly cpu_reset is one we could make the call from generic code. > > > r~ -- Alex Bennée