On Dec 06 16:03, Peter Maydell wrote: > On Wed, 5 Dec 2018 at 13:44, Aaron Lindsay <aa...@os.amperecomputing.com> > wrote: > > > > Setup a QEMUTimer to get a callback when we expect counters to next > > overflow and trigger an interrupt at that time. > > > > Signed-off-by: Aaron Lindsay <alind...@codeaurora.org> > > Signed-off-by: Aaron Lindsay <aa...@os.amperecomputing.com> > > --- > > target/arm/cpu.c | 12 +++++ > > target/arm/cpu.h | 7 +++ > > target/arm/helper.c | 126 +++++++++++++++++++++++++++++++++++++++++--- > > 3 files changed, 139 insertions(+), 6 deletions(-) > > > > --- a/target/arm/cpu.h > > +++ b/target/arm/cpu.h > > @@ -733,6 +733,8 @@ struct ARMCPU { > > > > /* Timers used by the generic (architected) timer */ > > QEMUTimer *gt_timer[NUM_GTIMERS]; > > + /* Timer used by the PMU */ > > + QEMUTimer *pmu_timer; > > We don't seem to migrate this timer state. Is that OK? If so, > a brief comment somewhere with the rationale would be helpful.
cpu_post_load() calls pmccntr_op_finish() and pmevcntr_op_finish() for each counter via pmu_op_finish(). They handle setting the timer according to the restored counters' state. I'll add a comment here at the definition unless you prefer somewhere else. -Aaron