162a163
> WalkerState *savedCurrState = NULL;
164c165
< if (!currState) {
---
> if (!currState && !_functional) {
171a173,180
> } else if (_functional) {
> // If we are mixing functional mode with timing (or even
> // atomic), we need to to be careful and clean up after
> // ourselves to not risk getting into an inconsistent state.
> DPRINTF(TLBVerbose, "creating functional instance of WalkerState\n");
> savedCurrState = currState;
> currState = new WalkerState();
> currState->tableWalker = this;
266a276
> Fault fault = NoFault;
268c278
< return processWalkAArch64();
---
> fault = processWalkAArch64();
270c280
< return processWalkLPAE();
---
> fault = processWalkLPAE();
272c282,290
< return processWalk();
---
> fault = processWalk();
>
> // If this was a functional non-timing access restore state to
> // how we found it.
> if (currState->functional) {
> delete currState;
> currState = savedCurrState;
> }
> return fault;