Re: [RFC PATCH v2 3/5] target/arm/kvm: Implement virtual time adjustment

2020-01-20 Thread Andrew Jones
On Thu, Dec 19, 2019 at 03:30:12PM +0100, Andrew Jones wrote: > On Mon, Dec 16, 2019 at 06:06:30PM +, Peter Maydell wrote: > > Your approach in this patchset reads and writes on vm-paused, > > so it won't have the pre-2015 problems. > > > > It still feels odd that we're storing this bit of

Re: [RFC PATCH v2 3/5] target/arm/kvm: Implement virtual time adjustment

2019-12-19 Thread Andrew Jones
On Mon, Dec 16, 2019 at 06:06:30PM +, Peter Maydell wrote: > On Mon, 16 Dec 2019 at 16:44, Andrew Jones wrote: > > > > On Mon, Dec 16, 2019 at 03:40:16PM +, Peter Maydell wrote: > > > On Mon, 16 Dec 2019 at 15:14, Peter Maydell > > > wrote: > > > > How does this interact with the usual

Re: [RFC PATCH v2 3/5] target/arm/kvm: Implement virtual time adjustment

2019-12-16 Thread Peter Maydell
On Mon, 16 Dec 2019 at 16:44, Andrew Jones wrote: > > On Mon, Dec 16, 2019 at 03:40:16PM +, Peter Maydell wrote: > > On Mon, 16 Dec 2019 at 15:14, Peter Maydell > > wrote: > > > How does this interact with the usual register sync to/from > > > KVM (ie kvm_arch_get_registers(), which I think

Re: [RFC PATCH v2 3/5] target/arm/kvm: Implement virtual time adjustment

2019-12-16 Thread Andrew Jones
On Mon, Dec 16, 2019 at 03:40:16PM +, Peter Maydell wrote: > On Mon, 16 Dec 2019 at 15:14, Peter Maydell wrote: > > How does this interact with the usual register sync to/from > > KVM (ie kvm_arch_get_registers(), which I think will do a > > GET_ONE_REG read of the TIMER_CNT register the way

Re: [RFC PATCH v2 3/5] target/arm/kvm: Implement virtual time adjustment

2019-12-16 Thread Andrew Jones
On Mon, Dec 16, 2019 at 03:14:00PM +, Peter Maydell wrote: > On Thu, 12 Dec 2019 at 17:33, Andrew Jones wrote: > > > > When a VM is stopped (guest is paused) guest virtual time > > should stop counting. Otherwise, when the VM is resumed it > > will experience time jumps and its kernel may

Re: [RFC PATCH v2 3/5] target/arm/kvm: Implement virtual time adjustment

2019-12-16 Thread Peter Maydell
On Mon, 16 Dec 2019 at 15:14, Peter Maydell wrote: > How does this interact with the usual register sync to/from > KVM (ie kvm_arch_get_registers(), which I think will do a > GET_ONE_REG read of the TIMER_CNT register the way it does > any other sysreg, inside write_kvmstate_to_list(), plus >

Re: [RFC PATCH v2 3/5] target/arm/kvm: Implement virtual time adjustment

2019-12-16 Thread Peter Maydell
On Thu, 12 Dec 2019 at 17:33, Andrew Jones wrote: > > When a VM is stopped (guest is paused) guest virtual time > should stop counting. Otherwise, when the VM is resumed it > will experience time jumps and its kernel may report soft > lockups. Not counting virtual time while the VM is stopped >

[RFC PATCH v2 3/5] target/arm/kvm: Implement virtual time adjustment

2019-12-12 Thread Andrew Jones
When a VM is stopped (guest is paused) guest virtual time should stop counting. Otherwise, when the VM is resumed it will experience time jumps and its kernel may report soft lockups. Not counting virtual time while the VM is stopped has the side effect of making the guest's time appear to lag