Skip to content

Commit

Permalink
target-lm32: flush tlb after clearing env
Browse files Browse the repository at this point in the history
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 <michael@walle.cc>
  • Loading branch information
mwalle committed Mar 18, 2013
1 parent de55c4b commit a5b0f6d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions target-lm32/cpu.c
Expand Up @@ -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)
Expand Down

0 comments on commit a5b0f6d

Please sign in to comment.