From: Michael Walle Date: Tue, 26 Feb 2013 18:51:52 +0000 (+0100) Subject: target-lm32: flush tlb after clearing env X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=a5b0f6d5c0f6678c078354c432a1f0943374f087;p=qemu.git target-lm32: flush tlb after clearing env The tlb data is stored within the CPU env. Therefore, the initialization has to be done after we clear the environment. Otherwise the tlb will have a valid entry for address 0x0. Signed-off-by: Michael Walle --- diff --git a/target-lm32/cpu.c b/target-lm32/cpu.c index bbb7fbf768..23c05ddbed 100644 --- a/target-lm32/cpu.c +++ b/target-lm32/cpu.c @@ -36,10 +36,10 @@ static void lm32_cpu_reset(CPUState *s) lcc->parent_reset(s); - tlb_flush(env, 1); - /* reset cpu state */ memset(env, 0, offsetof(CPULM32State, breakpoints)); + + tlb_flush(env, 1); } static void lm32_cpu_realizefn(DeviceState *dev, Error **errp)