Re: [PATCH v2] arm/arm64: KVM: Properly account for guest CPU time

2015-06-09 Thread Christoffer Dall
On Mon, Jun 08, 2015 at 06:50:08PM +0100, Marc Zyngier wrote: Hi Christoffer, On 28/05/15 19:49, Christoffer Dall wrote: Until now we have been calling kvm_guest_exit after re-enabling interrupts when we come back from the guest, but this has the unfortunate effect that CPU time

Re: [PATCH v2] arm/arm64: KVM: Properly account for guest CPU time

2015-06-09 Thread Marc Zyngier
On 09/06/15 15:43, Christoffer Dall wrote: On Mon, Jun 08, 2015 at 06:50:08PM +0100, Marc Zyngier wrote: Hi Christoffer, On 28/05/15 19:49, Christoffer Dall wrote: Until now we have been calling kvm_guest_exit after re-enabling interrupts when we come back from the guest, but this has the

Re: [PATCH v2] arm/arm64: KVM: Properly account for guest CPU time

2015-06-09 Thread Mario Smarduch
On 06/08/2015 04:35 AM, Christoffer Dall wrote: On Fri, Jun 05, 2015 at 05:24:07AM -0700, Mario Smarduch wrote: On 06/02/2015 02:27 AM, Christoffer Dall wrote: On Mon, Jun 01, 2015 at 08:48:22AM -0700, Mario Smarduch wrote: On 05/30/2015 11:59 PM, Christoffer Dall wrote: Hi Mario, On Fri,

Re: [PATCH v2] arm/arm64: KVM: Properly account for guest CPU time

2015-06-08 Thread Marc Zyngier
Hi Christoffer, On 28/05/15 19:49, Christoffer Dall wrote: Until now we have been calling kvm_guest_exit after re-enabling interrupts when we come back from the guest, but this has the unfortunate effect that CPU time accounting done in the context of timer interrupts occurring while the

Re: [PATCH v2] arm/arm64: KVM: Properly account for guest CPU time

2015-06-08 Thread Christoffer Dall
On Fri, Jun 05, 2015 at 05:24:07AM -0700, Mario Smarduch wrote: On 06/02/2015 02:27 AM, Christoffer Dall wrote: On Mon, Jun 01, 2015 at 08:48:22AM -0700, Mario Smarduch wrote: On 05/30/2015 11:59 PM, Christoffer Dall wrote: Hi Mario, On Fri, May 29, 2015 at 03:34:47PM -0700, Mario

Re: [PATCH v2] arm/arm64: KVM: Properly account for guest CPU time

2015-06-05 Thread Mario Smarduch
On 06/02/2015 02:27 AM, Christoffer Dall wrote: On Mon, Jun 01, 2015 at 08:48:22AM -0700, Mario Smarduch wrote: On 05/30/2015 11:59 PM, Christoffer Dall wrote: Hi Mario, On Fri, May 29, 2015 at 03:34:47PM -0700, Mario Smarduch wrote: On 05/28/2015 11:49 AM, Christoffer Dall wrote: Until now

Re: [PATCH v2] arm/arm64: KVM: Properly account for guest CPU time

2015-06-02 Thread Christoffer Dall
On Mon, Jun 01, 2015 at 08:48:22AM -0700, Mario Smarduch wrote: On 05/30/2015 11:59 PM, Christoffer Dall wrote: Hi Mario, On Fri, May 29, 2015 at 03:34:47PM -0700, Mario Smarduch wrote: On 05/28/2015 11:49 AM, Christoffer Dall wrote: Until now we have been calling kvm_guest_exit after

Re: [PATCH v2] arm/arm64: KVM: Properly account for guest CPU time

2015-06-02 Thread Christoffer Dall
On Mon, Jun 01, 2015 at 03:37:32PM +0200, Christian Borntraeger wrote: Am 01.06.2015 um 15:35 schrieb Christoffer Dall: On Mon, Jun 01, 2015 at 11:21:19AM +0200, Christian Borntraeger wrote: Am 01.06.2015 um 11:08 schrieb Christoffer Dall: Second, looking at the ppc and mips code, they

Re: [PATCH v2] arm/arm64: KVM: Properly account for guest CPU time

2015-06-02 Thread Christoffer Dall
[replying to myself] On Tue, Jun 02, 2015 at 11:27:59AM +0200, Christoffer Dall wrote: [..] If this patch is incorrect, then how does it work on x86, where handle_external_intr() is called (with a barrier in between) before kvm_guest_exit(), and where handle_external_intr() is

Re: [PATCH v2] arm/arm64: KVM: Properly account for guest CPU time

2015-06-01 Thread Paolo Bonzini
On 01/06/2015 13:42, Christian Borntraeger wrote: Am 01.06.2015 um 13:34 schrieb Paolo Bonzini: On 01/06/2015 09:47, Christian Borntraeger wrote: 1: disable, guest, disable again and save, restore to disable, enable and now it is 2: disable, guest, enable and with your patch it is 3:

Re: [PATCH v2] arm/arm64: KVM: Properly account for guest CPU time

2015-06-01 Thread Christian Borntraeger
Am 01.06.2015 um 13:34 schrieb Paolo Bonzini: On 01/06/2015 09:47, Christian Borntraeger wrote: 1: disable, guest, disable again and save, restore to disable, enable and now it is 2: disable, guest, enable and with your patch it is 3: disable, guest, enable, disable, enable I assume

Re: [PATCH v2] arm/arm64: KVM: Properly account for guest CPU time

2015-06-01 Thread Paolo Bonzini
On 01/06/2015 09:47, Christian Borntraeger wrote: 1: disable, guest, disable again and save, restore to disable, enable and now it is 2: disable, guest, enable and with your patch it is 3: disable, guest, enable, disable, enable I assume that 3 and 1 are similar in its costs, so this

Re: [PATCH v2] arm/arm64: KVM: Properly account for guest CPU time

2015-06-01 Thread Christian Borntraeger
Am 28.05.2015 um 20:49 schrieb Christoffer Dall: Until now we have been calling kvm_guest_exit after re-enabling interrupts when we come back from the guest, but this has the unfortunate effect that CPU time accounting done in the context of timer interrupts occurring while the guest is

Re: [PATCH v2] arm/arm64: KVM: Properly account for guest CPU time

2015-06-01 Thread Christoffer Dall
On Mon, Jun 01, 2015 at 09:47:46AM +0200, Christian Borntraeger wrote: Am 28.05.2015 um 20:49 schrieb Christoffer Dall: Until now we have been calling kvm_guest_exit after re-enabling interrupts when we come back from the guest, but this has the unfortunate effect that CPU time accounting

Re: [PATCH v2] arm/arm64: KVM: Properly account for guest CPU time

2015-06-01 Thread Christian Borntraeger
Am 01.06.2015 um 11:08 schrieb Christoffer Dall: Second, looking at the ppc and mips code, they seem to also call kvm_guest_exit() before enabling interrupts, so I don't understand how guest CPU time accounting works on those architectures. Not an expert here, but I assume mips has the same

Re: [PATCH v2] arm/arm64: KVM: Properly account for guest CPU time

2015-06-01 Thread Mario Smarduch
On 05/30/2015 11:59 PM, Christoffer Dall wrote: Hi Mario, On Fri, May 29, 2015 at 03:34:47PM -0700, Mario Smarduch wrote: On 05/28/2015 11:49 AM, Christoffer Dall wrote: Until now we have been calling kvm_guest_exit after re-enabling interrupts when we come back from the guest, but this has

Re: [PATCH v2] arm/arm64: KVM: Properly account for guest CPU time

2015-06-01 Thread Christoffer Dall
On Mon, Jun 01, 2015 at 11:21:19AM +0200, Christian Borntraeger wrote: Am 01.06.2015 um 11:08 schrieb Christoffer Dall: Second, looking at the ppc and mips code, they seem to also call kvm_guest_exit() before enabling interrupts, so I don't understand how guest CPU time accounting works

Re: [PATCH v2] arm/arm64: KVM: Properly account for guest CPU time

2015-06-01 Thread Christian Borntraeger
Am 01.06.2015 um 15:35 schrieb Christoffer Dall: On Mon, Jun 01, 2015 at 11:21:19AM +0200, Christian Borntraeger wrote: Am 01.06.2015 um 11:08 schrieb Christoffer Dall: Second, looking at the ppc and mips code, they seem to also call kvm_guest_exit() before enabling interrupts, so I don't

Re: [PATCH v2] arm/arm64: KVM: Properly account for guest CPU time

2015-05-31 Thread Christoffer Dall
Hi Mario, On Fri, May 29, 2015 at 03:34:47PM -0700, Mario Smarduch wrote: On 05/28/2015 11:49 AM, Christoffer Dall wrote: Until now we have been calling kvm_guest_exit after re-enabling interrupts when we come back from the guest, but this has the unfortunate effect that CPU time

Re: [PATCH v2] arm/arm64: KVM: Properly account for guest CPU time

2015-05-29 Thread Mario Smarduch
On 05/28/2015 11:49 AM, Christoffer Dall wrote: Until now we have been calling kvm_guest_exit after re-enabling interrupts when we come back from the guest, but this has the unfortunate effect that CPU time accounting done in the context of timer interrupts occurring while the guest is running

[PATCH v2] arm/arm64: KVM: Properly account for guest CPU time

2015-05-28 Thread Christoffer Dall
Until now we have been calling kvm_guest_exit after re-enabling interrupts when we come back from the guest, but this has the unfortunate effect that CPU time accounting done in the context of timer interrupts occurring while the guest is running doesn't properly notice that the time since the