| 0bc8fb4d | 13-Feb-2020 |
Johannes Berg <[email protected]> |
um: Implement ndelay/udelay in time-travel mode
In external or inf-cpu time-travel mode, ndelay/udelay currently just waste CPU time since the simulation time doesn't advance. Implement them properl
um: Implement ndelay/udelay in time-travel mode
In external or inf-cpu time-travel mode, ndelay/udelay currently just waste CPU time since the simulation time doesn't advance. Implement them properly in this case.
Note that the "if (time_travel_mode == ...)" parts compile out if CONFIG_UML_TIME_TRAVEL_SUPPORT isn't set, time_travel_mode is defined to TT_MODE_OFF in that case.
Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
show more ...
|
| 4b786e24 | 13-Feb-2020 |
Johannes Berg <[email protected]> |
um: time-travel: Rewrite as an event scheduler
Instead of tracking all the various timer configurations, modify the time-travel mode to have an event scheduler and use a timer event on the scheduler
um: time-travel: Rewrite as an event scheduler
Instead of tracking all the various timer configurations, modify the time-travel mode to have an event scheduler and use a timer event on the scheduler to handle the different timer configurations.
This doesn't change the function right now, but it prepares the code for having different kinds of events in the future (i.e. interrupts coming from other devices that are part of co-simulation.)
While at it, also move time_travel_sleep() to time.c to reduce the externally visible API surface.
Also, we really should mark time-travel as incompatible with SMP, even if UML doesn't support SMP yet.
Finally, I noticed a bug while developing this - if we move time forward due to consuming time while reading the clock, we might move across the next event and that would cause us to go backward in time when we then handle that event. Fix that by invoking the whole event machine in this case, but in order to simplify this, make reading the clock only cost something when interrupts are not disabled. Otherwise, we'd have to hook into the interrupt delivery machinery etc. and that's somewhat intrusive.
Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
show more ...
|