Re: [Qemu-devel] pl031 time across vm save/reload

2019-07-08 Thread Dr. David Alan Gilbert
* Peter Maydell (peter.mayd...@linaro.org) wrote: > On Fri, 5 Jul 2019 at 11:13, Paolo Bonzini wrote: > > > > On 05/07/19 11:58, Peter Maydell wrote: > > > On Fri, 5 Jul 2019 at 10:48, Paolo Bonzini wrote: > > >> You're right, the compatibility causes wrong behavior for the default > > >> -rtc se

Re: [Qemu-devel] pl031 time across vm save/reload

2019-07-08 Thread Peter Maydell
On Fri, 5 Jul 2019 at 10:48, Paolo Bonzini wrote: > You're right, the compatibility causes wrong behavior for the default > -rtc settings (the RC pauses across migration). The right thing to do > would be to store the base rather than the offset: that is, you store > the time at which LR was writ

Re: [Qemu-devel] pl031 time across vm save/reload

2019-07-05 Thread Peter Maydell
On Fri, 5 Jul 2019 at 11:32, Paolo Bonzini wrote: > > On 05/07/19 12:21, Peter Maydell wrote: > > On Fri, 5 Jul 2019 at 11:13, Paolo Bonzini wrote: > >> Yes, something like that but I would just bump the version. Version 1 > >> has the old meaning for the first field, version 2 has the new meani

Re: [Qemu-devel] pl031 time across vm save/reload

2019-07-05 Thread Paolo Bonzini
On 05/07/19 12:21, Peter Maydell wrote: > On Fri, 5 Jul 2019 at 11:13, Paolo Bonzini wrote: >> >> On 05/07/19 11:58, Peter Maydell wrote: >>> On Fri, 5 Jul 2019 at 10:48, Paolo Bonzini wrote: You're right, the compatibility causes wrong behavior for the default -rtc settings (the RC pau

Re: [Qemu-devel] pl031 time across vm save/reload

2019-07-05 Thread Peter Maydell
On Fri, 5 Jul 2019 at 10:48, Paolo Bonzini wrote: > By the way, the data sheet says "the counter and match values are > compared in a comparator. When both values are equal, the RTCINTR > interrupt is asserted HIGH"; QEMU compares the RTC value (read from > RTC_DR) and not the counter value, but L

Re: [Qemu-devel] pl031 time across vm save/reload

2019-07-05 Thread Peter Maydell
On Fri, 5 Jul 2019 at 11:13, Paolo Bonzini wrote: > > On 05/07/19 11:58, Peter Maydell wrote: > > On Fri, 5 Jul 2019 at 10:48, Paolo Bonzini wrote: > >> You're right, the compatibility causes wrong behavior for the default > >> -rtc settings (the RC pauses across migration). The right thing to d

Re: [Qemu-devel] pl031 time across vm save/reload

2019-07-05 Thread Paolo Bonzini
On 05/07/19 11:58, Peter Maydell wrote: > On Fri, 5 Jul 2019 at 10:48, Paolo Bonzini wrote: >> You're right, the compatibility causes wrong behavior for the default >> -rtc settings (the RC pauses across migration). The right thing to do >> would be to store the base rather than the offset: that

Re: [Qemu-devel] pl031 time across vm save/reload

2019-07-05 Thread Peter Maydell
On Fri, 5 Jul 2019 at 10:48, Paolo Bonzini wrote: > You're right, the compatibility causes wrong behavior for the default > -rtc settings (the RC pauses across migration). The right thing to do > would be to store the base rather than the offset: that is, you store > the time at which LR was writ

Re: [Qemu-devel] pl031 time across vm save/reload

2019-07-05 Thread Paolo Bonzini
On 04/07/19 18:02, Peter Maydell wrote: > I've had a report that the way the PL031 model handles time > across a vm save/reload fails to correctly advance the guest > RTC when the host RTC has advanced between the save and reload. > I looked at the code and my correspondent's analysis (which > I qu

[Qemu-devel] pl031 time across vm save/reload

2019-07-04 Thread Peter Maydell
I've had a report that the way the PL031 model handles time across a vm save/reload fails to correctly advance the guest RTC when the host RTC has advanced between the save and reload. I looked at the code and my correspondent's analysis (which I quote below, lightly edited) looks correct to me, bu