Re: [PATCH] KVM: LAPIC: Fix pv ipis out-of-bounds access

2018-08-29 Thread Radim Krcmar
2018-08-29 13:29+0300, Dan Carpenter: > On Wed, Aug 29, 2018 at 06:23:08PM +0800, Wanpeng Li wrote: > > On Wed, 29 Aug 2018 at 18:18, Dan Carpenter > > wrote: > > > > > > On Wed, Aug 29, 2018 at 01:12:05PM +0300, Dan Carpenter wrote: > > > > On Wed, Aug 29, 2018 at 12:05:06PM +0300, Liran Alon

Re: [PATCH] KVM: LAPIC: Fix pv ipis out-of-bounds access

2018-08-29 Thread Radim Krcmar
2018-08-29 13:29+0300, Dan Carpenter: > On Wed, Aug 29, 2018 at 06:23:08PM +0800, Wanpeng Li wrote: > > On Wed, 29 Aug 2018 at 18:18, Dan Carpenter > > wrote: > > > > > > On Wed, Aug 29, 2018 at 01:12:05PM +0300, Dan Carpenter wrote: > > > > On Wed, Aug 29, 2018 at 12:05:06PM +0300, Liran Alon

Re: [PATCH] KVM: LAPIC: Fix pv ipis out-of-bounds access

2018-08-29 Thread Radim Krcmar
2018-08-29 15:55+0200, Radim Krcmar: > 2018-08-29 13:43+0300, Liran Alon: > > Why is “min” defined as “int” instead of “unsigned int”? > > It represents the lowest APIC ID in bitmap so it can’t be negative… > > Right, > > I think the code would look better as something

Re: [PATCH] KVM: LAPIC: Fix pv ipis out-of-bounds access

2018-08-29 Thread Radim Krcmar
2018-08-29 15:55+0200, Radim Krcmar: > 2018-08-29 13:43+0300, Liran Alon: > > Why is “min” defined as “int” instead of “unsigned int”? > > It represents the lowest APIC ID in bitmap so it can’t be negative… > > Right, > > I think the code would look better as something

Re: [PATCH] KVM: LAPIC: Fix pv ipis out-of-bounds access

2018-08-29 Thread Radim Krcmar
2018-08-29 13:43+0300, Liran Alon: > Why is “min” defined as “int” instead of “unsigned int”? > It represents the lowest APIC ID in bitmap so it can’t be negative… Right, I think the code would look better as something like (untested): diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c

Re: [PATCH] KVM: LAPIC: Fix pv ipis out-of-bounds access

2018-08-29 Thread Radim Krcmar
2018-08-29 13:43+0300, Liran Alon: > Why is “min” defined as “int” instead of “unsigned int”? > It represents the lowest APIC ID in bitmap so it can’t be negative… Right, I think the code would look better as something like (untested): diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c

Re: [PATCH v3 5/6] KVM: X86: Add NMI support to PV IPIs

2018-07-20 Thread Radim Krcmar
2018-07-20 10:04+0200, Paolo Bonzini: > On 20/07/2018 05:53, Wanpeng Li wrote: > >>> - ret = kvm_hypercall3(KVM_HC_SEND_IPI, ipi_bitmap_low, > >>> ipi_bitmap_high, vector); > >>> + switch (vector) { > >>> + default: > >>> + icr = APIC_DM_FIXED | vector; > >>> +

Re: [PATCH v3 5/6] KVM: X86: Add NMI support to PV IPIs

2018-07-20 Thread Radim Krcmar
2018-07-20 10:04+0200, Paolo Bonzini: > On 20/07/2018 05:53, Wanpeng Li wrote: > >>> - ret = kvm_hypercall3(KVM_HC_SEND_IPI, ipi_bitmap_low, > >>> ipi_bitmap_high, vector); > >>> + switch (vector) { > >>> + default: > >>> + icr = APIC_DM_FIXED | vector; > >>> +

Re: [PATCH v3 2/6] KVM: X86: Implement PV IPIs in linux guest

2018-07-20 Thread Radim Krcmar
2018-07-20 11:45+0800, Wanpeng Li: > On Fri, 20 Jul 2018 at 07:05, David Matlack wrote: > > > > On Mon, Jul 2, 2018 at 11:23 PM Wanpeng Li wrote: > > > > > > From: Wanpeng Li > > > > > > Implement paravirtual apic hooks to enable PV IPIs. > > > > Very cool. Thanks for working on this! > >

Re: [PATCH v3 2/6] KVM: X86: Implement PV IPIs in linux guest

2018-07-20 Thread Radim Krcmar
2018-07-20 11:45+0800, Wanpeng Li: > On Fri, 20 Jul 2018 at 07:05, David Matlack wrote: > > > > On Mon, Jul 2, 2018 at 11:23 PM Wanpeng Li wrote: > > > > > > From: Wanpeng Li > > > > > > Implement paravirtual apic hooks to enable PV IPIs. > > > > Very cool. Thanks for working on this! > >

Re: [PATCH v3 2/6] KVM: X86: Implement PV IPIs in linux guest

2018-07-20 Thread Radim Krcmar
2018-07-20 11:33+0800, Wanpeng Li: > On Fri, 20 Jul 2018 at 00:28, Radim Krčmář wrote: > > 2018-07-03 14:21+0800, Wanpeng Li: > > But because it is very similar to x2apic, I'd really need some real > > performance data to see if this benefits a real workload. > > Thanks for your review, Radim!

Re: [PATCH v3 2/6] KVM: X86: Implement PV IPIs in linux guest

2018-07-20 Thread Radim Krcmar
2018-07-20 11:33+0800, Wanpeng Li: > On Fri, 20 Jul 2018 at 00:28, Radim Krčmář wrote: > > 2018-07-03 14:21+0800, Wanpeng Li: > > But because it is very similar to x2apic, I'd really need some real > > performance data to see if this benefits a real workload. > > Thanks for your review, Radim!

Re: [PATCH v5 1/3] x86/msr: Add AMD Core Perf Extension MSRs

2018-03-06 Thread Radim Krcmar
2018-02-05 13:24-0600, Janakarajan Natarajan: > Add the EventSelect and Counter MSRs for AMD Core Perf Extension. > > Signed-off-by: Janakarajan Natarajan > --- > arch/x86/include/asm/msr-index.h | 14 ++ > 1 file changed, 14 insertions(+) > > diff

Re: [PATCH v5 1/3] x86/msr: Add AMD Core Perf Extension MSRs

2018-03-06 Thread Radim Krcmar
2018-02-05 13:24-0600, Janakarajan Natarajan: > Add the EventSelect and Counter MSRs for AMD Core Perf Extension. > > Signed-off-by: Janakarajan Natarajan > --- > arch/x86/include/asm/msr-index.h | 14 ++ > 1 file changed, 14 insertions(+) > > diff --git

Re: [PATCH v5 0/3] Support Perf Extension on AMD KVM guests

2018-03-06 Thread Radim Krcmar
2018-02-16 13:26-0600, Natarajan, Janakarajan: > On 2/5/2018 1:24 PM, Janakarajan Natarajan wrote: > > This patchset adds support for Perf Extension on AMD KVM guests. > > > > When perf runs on a guest with family = 15h || 17h, the MSRs that are > > accessed, when the Perf Extension flag is made

Re: [PATCH v5 0/3] Support Perf Extension on AMD KVM guests

2018-03-06 Thread Radim Krcmar
2018-02-16 13:26-0600, Natarajan, Janakarajan: > On 2/5/2018 1:24 PM, Janakarajan Natarajan wrote: > > This patchset adds support for Perf Extension on AMD KVM guests. > > > > When perf runs on a guest with family = 15h || 17h, the MSRs that are > > accessed, when the Perf Extension flag is made

Re: [PATCH v4 3/3] x86/kvm: Expose AMD Core Perf Extension flag to guests

2018-02-05 Thread Radim Krcmar
2018-01-30 11:32-0600, Janakarajan Natarajan: > Expose the AMD Core Perf Extension flag to the guests. > > Signed-off-by: Janakarajan Natarajan > --- > diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c > @@ -365,7 +371,7 @@ static inline int

Re: [PATCH v4 3/3] x86/kvm: Expose AMD Core Perf Extension flag to guests

2018-02-05 Thread Radim Krcmar
2018-01-30 11:32-0600, Janakarajan Natarajan: > Expose the AMD Core Perf Extension flag to the guests. > > Signed-off-by: Janakarajan Natarajan > --- > diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c > @@ -365,7 +371,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 >

Re: [PATCH v2 3/4] Add support for AMD Core Perf Extension in guest

2017-12-05 Thread Radim Krcmar
2017-12-01 13:30-0600, Natarajan, Janakarajan: > On 11/17/2017 5:44 AM, Borislav Petkov wrote: > > On Thu, Nov 16, 2017 at 12:00:11PM -0600, Natarajan, Janakarajan wrote: > > > Ah my apologies. So when the pmu is initialized the cpuid entries > > > aren't available then. > > So let's see: > > > >

Re: [PATCH v2 3/4] Add support for AMD Core Perf Extension in guest

2017-12-05 Thread Radim Krcmar
2017-12-01 13:30-0600, Natarajan, Janakarajan: > On 11/17/2017 5:44 AM, Borislav Petkov wrote: > > On Thu, Nov 16, 2017 at 12:00:11PM -0600, Natarajan, Janakarajan wrote: > > > Ah my apologies. So when the pmu is initialized the cpuid entries > > > aren't available then. > > So let's see: > > > >

Re: [PATCH] x86,kvm: move qemu/guest FPU switching out to vcpu_run

2017-12-05 Thread Radim Krcmar
2017-12-04 10:15+0800, Wanpeng Li: > 2017-11-14 13:12 GMT+08:00 Rik van Riel : > > Currently, every time a VCPU is scheduled out, the host kernel will > > first save the guest FPU/xstate context, then load the qemu userspace > > FPU context, only to then immediately save the qemu

Re: [PATCH] x86,kvm: move qemu/guest FPU switching out to vcpu_run

2017-12-05 Thread Radim Krcmar
2017-12-04 10:15+0800, Wanpeng Li: > 2017-11-14 13:12 GMT+08:00 Rik van Riel : > > Currently, every time a VCPU is scheduled out, the host kernel will > > first save the guest FPU/xstate context, then load the qemu userspace > > FPU context, only to then immediately save the qemu userspace FPU > >

Re: [PATCH v2 1/4] x86/kvm/cpuid: Fix CPUID function for word 6 (80000001_ECX)

2017-11-10 Thread Radim Krcmar
2017-11-06 14:38-0600, Janakarajan Natarajan: > I forgot to add Boris's Reviewed-by Tag. If the patchset is acceptable, > please let me know if I should send another version with the Tag or if > the Tag can be added when it is merged. No problem, I have added that while applying, thanks for

Re: [PATCH v2 1/4] x86/kvm/cpuid: Fix CPUID function for word 6 (80000001_ECX)

2017-11-10 Thread Radim Krcmar
2017-11-06 14:38-0600, Janakarajan Natarajan: > I forgot to add Boris's Reviewed-by Tag. If the patchset is acceptable, > please let me know if I should send another version with the Tag or if > the Tag can be added when it is merged. No problem, I have added that while applying, thanks for

Re: [PATCHv3 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-11-09 Thread Radim Krcmar
2017-11-09 18:12+0100, Peter Zijlstra: > On Thu, Nov 09, 2017 at 05:45:23PM +0100, Radim Krcmar wrote: > > 2017-11-09 17:17+0100, Peter Zijlstra: > > > On Thu, Nov 09, 2017 at 05:05:36PM +0100, Radim Krcmar wrote: > > > > 2017-11-09 10:53-0500, Pankaj Gupta: > >

Re: [PATCHv3 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-11-09 Thread Radim Krcmar
2017-11-09 18:12+0100, Peter Zijlstra: > On Thu, Nov 09, 2017 at 05:45:23PM +0100, Radim Krcmar wrote: > > 2017-11-09 17:17+0100, Peter Zijlstra: > > > On Thu, Nov 09, 2017 at 05:05:36PM +0100, Radim Krcmar wrote: > > > > 2017-11-09 10:53-0500, Pankaj Gupta: > >

Re: [PATCHv3 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-11-09 Thread Radim Krcmar
2017-11-09 18:28+0100, Peter Zijlstra: > On Thu, Nov 09, 2017 at 06:15:11PM +0100, Peter Zijlstra wrote: > > On Thu, Nov 09, 2017 at 06:12:41PM +0100, Peter Zijlstra wrote: > > > On Thu, Nov 09, 2017 at 05:45:23PM +0100, Radim Krcmar wrote: > > > > 2017-11

Re: [PATCHv3 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-11-09 Thread Radim Krcmar
2017-11-09 18:28+0100, Peter Zijlstra: > On Thu, Nov 09, 2017 at 06:15:11PM +0100, Peter Zijlstra wrote: > > On Thu, Nov 09, 2017 at 06:12:41PM +0100, Peter Zijlstra wrote: > > > On Thu, Nov 09, 2017 at 05:45:23PM +0100, Radim Krcmar wrote: > > > > 2017-11

Re: [PATCHv3 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-11-09 Thread Radim Krcmar
2017-11-09 17:17+0100, Peter Zijlstra: > On Thu, Nov 09, 2017 at 05:05:36PM +0100, Radim Krcmar wrote: > > 2017-11-09 10:53-0500, Pankaj Gupta: > > > 2] PV TLB should also behave as per option PV_DEDICATED for better > > > performance. > > > > Right

Re: [PATCHv3 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-11-09 Thread Radim Krcmar
2017-11-09 17:17+0100, Peter Zijlstra: > On Thu, Nov 09, 2017 at 05:05:36PM +0100, Radim Krcmar wrote: > > 2017-11-09 10:53-0500, Pankaj Gupta: > > > 2] PV TLB should also behave as per option PV_DEDICATED for better > > > performance. > > > > Right

Re: [PATCHv3 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-11-09 Thread Radim Krcmar
2017-11-09 10:53-0500, Pankaj Gupta: > > > > 2017-11-07 4:26 GMT+08:00 Eduardo Valentin : > > > Currently, the existing qspinlock implementation will fallback to > > > test-and-set if the hypervisor has not set the PV_UNHALT flag. > > > > > > This patch gives the opportunity

Re: [PATCHv3 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-11-09 Thread Radim Krcmar
2017-11-09 10:53-0500, Pankaj Gupta: > > > > 2017-11-07 4:26 GMT+08:00 Eduardo Valentin : > > > Currently, the existing qspinlock implementation will fallback to > > > test-and-set if the hypervisor has not set the PV_UNHALT flag. > > > > > > This patch gives the opportunity to guest kernels to

Re: [PATCHv3 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-11-09 Thread Radim Krcmar
2017-11-09 20:43+0800, Wanpeng Li: > 2017-11-07 4:26 GMT+08:00 Eduardo Valentin : > > Currently, the existing qspinlock implementation will fallback to > > test-and-set if the hypervisor has not set the PV_UNHALT flag. > > > > This patch gives the opportunity to guest kernels to

Re: [PATCHv3 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-11-09 Thread Radim Krcmar
2017-11-09 20:43+0800, Wanpeng Li: > 2017-11-07 4:26 GMT+08:00 Eduardo Valentin : > > Currently, the existing qspinlock implementation will fallback to > > test-and-set if the hypervisor has not set the PV_UNHALT flag. > > > > This patch gives the opportunity to guest kernels to select > > between

Re: [PATCH v7 1/5] ptp_kvm: probe for kvm guest availability

2017-10-20 Thread Radim Krcmar
2017-10-19 14:39+0100, Joao Martins: > In the event of moving pvclock_pvti_cpu0_va() definition to common > pvclock code, this function could return a value on non KVM guests. > If user tried to load the module (or have it builtin) it would fail > with a GPF on ptp_kvm_init when running on a Xen

Re: [PATCH v7 1/5] ptp_kvm: probe for kvm guest availability

2017-10-20 Thread Radim Krcmar
2017-10-19 14:39+0100, Joao Martins: > In the event of moving pvclock_pvti_cpu0_va() definition to common > pvclock code, this function could return a value on non KVM guests. > If user tried to load the module (or have it builtin) it would fail > with a GPF on ptp_kvm_init when running on a Xen

Re: [PATCH 2/2] KVM: SVM: Enable Virtual GIF feature

2017-08-16 Thread Radim Krcmar
2017-08-16 10:54-0500, Janakarajan Natarajan: > Enable the Virtual GIF feature. This is done by setting bit 25 at position > 60h in the vmcb. > > With this feature enabled, the processor uses bit 9 at position 60h as the > virtual GIF when executing STGI/CLGI instructions. > > Since the

Re: [PATCH 2/2] KVM: SVM: Enable Virtual GIF feature

2017-08-16 Thread Radim Krcmar
2017-08-16 10:54-0500, Janakarajan Natarajan: > Enable the Virtual GIF feature. This is done by setting bit 25 at position > 60h in the vmcb. > > With this feature enabled, the processor uses bit 9 at position 60h as the > virtual GIF when executing STGI/CLGI instructions. > > Since the

Re: [PATCH] kvm: async_pf: fix rcu_irq_enter() with irqs enabled

2017-06-06 Thread Radim Krcmar
2017-06-05 12:21+0800, Wanpeng Li: > 2017-04-26 22:56 GMT+08:00 Paolo Bonzini : > > native_safe_halt enables interrupts, and you just shouldn't > > call rcu_irq_enter() with interrupts enabled. Reorder the > > call with the following local_irq_disable() to respect the > >

Re: [PATCH] kvm: async_pf: fix rcu_irq_enter() with irqs enabled

2017-06-06 Thread Radim Krcmar
2017-06-05 12:21+0800, Wanpeng Li: > 2017-04-26 22:56 GMT+08:00 Paolo Bonzini : > > native_safe_halt enables interrupts, and you just shouldn't > > call rcu_irq_enter() with interrupts enabled. Reorder the > > call with the following local_irq_disable() to respect the > > invariant. > > > >

Re: [patch 2/3] KVM: x86: introduce ioctl to allow frequency hypercalls

2017-02-23 Thread Radim Krcmar
2017-02-22 18:18-0300, Marcelo Tosatti: > On Fri, Feb 03, 2017 at 06:03:37PM +0100, Radim Krcmar wrote: >> 2017-02-02 15:47-0200, Marcelo Tosatti: >> > For most VMs, modifying the host frequency is an undesired >> > operation. Introduce ioctl to enable the guest to >

Re: [patch 2/3] KVM: x86: introduce ioctl to allow frequency hypercalls

2017-02-23 Thread Radim Krcmar
2017-02-22 18:18-0300, Marcelo Tosatti: > On Fri, Feb 03, 2017 at 06:03:37PM +0100, Radim Krcmar wrote: >> 2017-02-02 15:47-0200, Marcelo Tosatti: >> > For most VMs, modifying the host frequency is an undesired >> > operation. Introduce ioctl to enable the guest to >

Re: [patch 3/3] KVM: x86: frequency change hypercalls

2017-02-03 Thread Radim Krcmar
2017-02-03 16:24-0200, Marcelo Tosatti: > On Fri, Feb 03, 2017 at 06:40:34PM +0100, Radim Krcmar wrote: >> You can make it one hypercall with an argument. > > Fine. > >> And the argument doesn't have to be enum {UP, DOWN, MAX, MIN}, but an >> int, which would

Re: [patch 3/3] KVM: x86: frequency change hypercalls

2017-02-03 Thread Radim Krcmar
2017-02-03 16:24-0200, Marcelo Tosatti: > On Fri, Feb 03, 2017 at 06:40:34PM +0100, Radim Krcmar wrote: >> You can make it one hypercall with an argument. > > Fine. > >> And the argument doesn't have to be enum {UP, DOWN, MAX, MIN}, but an >> int, which would

Re: [patch 0/3] KVM CPU frequency change hypercalls

2017-02-03 Thread Radim Krcmar
2017-02-03 16:14-0200, Marcelo Tosatti: > On Fri, Feb 03, 2017 at 05:43:50PM +0100, Radim Krcmar wrote: >> 2017-02-02 15:47-0200, Marcelo Tosatti: >> > Implement KVM hypercalls for the guest >> > to issue frequency changes. >> > >> > Current situation

Re: [patch 0/3] KVM CPU frequency change hypercalls

2017-02-03 Thread Radim Krcmar
2017-02-03 16:14-0200, Marcelo Tosatti: > On Fri, Feb 03, 2017 at 05:43:50PM +0100, Radim Krcmar wrote: >> 2017-02-02 15:47-0200, Marcelo Tosatti: >> > Implement KVM hypercalls for the guest >> > to issue frequency changes. >> > >> > Current situation

Re: [patch 3/3] KVM: x86: frequency change hypercalls

2017-02-03 Thread Radim Krcmar
2017-02-02 15:47-0200, Marcelo Tosatti: > Implement min/max/up/down frequency change > KVM hypercalls. To be used by DPDK implementation. > > Also allow such hypercalls from guest userspace. > > Signed-off-by: Marcelo Tosatti > > --- > Index: kvm-pvfreq/arch/x86/kvm/x86.c

Re: [patch 3/3] KVM: x86: frequency change hypercalls

2017-02-03 Thread Radim Krcmar
2017-02-02 15:47-0200, Marcelo Tosatti: > Implement min/max/up/down frequency change > KVM hypercalls. To be used by DPDK implementation. > > Also allow such hypercalls from guest userspace. > > Signed-off-by: Marcelo Tosatti > > --- > Index: kvm-pvfreq/arch/x86/kvm/x86.c >

Re: [patch 2/3] KVM: x86: introduce ioctl to allow frequency hypercalls

2017-02-03 Thread Radim Krcmar
2017-02-02 15:47-0200, Marcelo Tosatti: > For most VMs, modifying the host frequency is an undesired > operation. Introduce ioctl to enable the guest to > modify host CPU frequency. > > > Signed-off-by: Marcelo Tosatti > --- > arch/x86/include/asm/kvm_host.h |2 ++ >

Re: [patch 2/3] KVM: x86: introduce ioctl to allow frequency hypercalls

2017-02-03 Thread Radim Krcmar
2017-02-02 15:47-0200, Marcelo Tosatti: > For most VMs, modifying the host frequency is an undesired > operation. Introduce ioctl to enable the guest to > modify host CPU frequency. > > > Signed-off-by: Marcelo Tosatti > --- > arch/x86/include/asm/kvm_host.h |2 ++ >

Re: [patch 0/3] KVM CPU frequency change hypercalls

2017-02-03 Thread Radim Krcmar
2017-02-02 15:47-0200, Marcelo Tosatti: > Implement KVM hypercalls for the guest > to issue frequency changes. > > Current situation with DPDK and frequency changes is as follows: > An algorithm in the guest decides when to increase/decrease > frequency based on the queue length of the device.

Re: [patch 0/3] KVM CPU frequency change hypercalls

2017-02-03 Thread Radim Krcmar
2017-02-02 15:47-0200, Marcelo Tosatti: > Implement KVM hypercalls for the guest > to issue frequency changes. > > Current situation with DPDK and frequency changes is as follows: > An algorithm in the guest decides when to increase/decrease > frequency based on the queue length of the device.

Re: [patch 4/5] PTP: add PTP_SYS_OFFSET emulation via cross timestamps infrastructure

2017-01-20 Thread Radim Krcmar
2017-01-20 15:23+0100, Paolo Bonzini: > On 20/01/2017 15:02, Radim Krcmar wrote: >> 2017-01-20 14:36+0100, Paolo Bonzini: >>> On 20/01/2017 14:07, Marcelo Tosatti wrote: >>>> On Fri, Jan 20, 2017 at 01:55:27PM +0100, Paolo Bonzini wrote: >>>>> >>&

Re: [patch 4/5] PTP: add PTP_SYS_OFFSET emulation via cross timestamps infrastructure

2017-01-20 Thread Radim Krcmar
2017-01-20 15:23+0100, Paolo Bonzini: > On 20/01/2017 15:02, Radim Krcmar wrote: >> 2017-01-20 14:36+0100, Paolo Bonzini: >>> On 20/01/2017 14:07, Marcelo Tosatti wrote: >>>> On Fri, Jan 20, 2017 at 01:55:27PM +0100, Paolo Bonzini wrote: >>>>> >>&

Re: [patch 5/5] PTP: add kvm PTP driver

2017-01-20 Thread Radim Krcmar
2017-01-20 13:00-0200, Marcelo Tosatti: > On Fri, Jan 20, 2017 at 03:12:56PM +0100, Radim Krcmar wrote: >> 2017-01-20 10:20-0200, Marcelo Tosatti: >> > + do { >> > + /* >> > + * We are measuring the delay between >> > +

Re: [patch 5/5] PTP: add kvm PTP driver

2017-01-20 Thread Radim Krcmar
2017-01-20 13:00-0200, Marcelo Tosatti: > On Fri, Jan 20, 2017 at 03:12:56PM +0100, Radim Krcmar wrote: >> 2017-01-20 10:20-0200, Marcelo Tosatti: >> > + do { >> > + /* >> > + * We are measuring the delay between >> > +

Re: [PATCH v4 2/2] hv_utils: implement Hyper-V PTP source

2017-01-20 Thread Radim Krcmar
2017-01-19 15:16+0100, Vitaly Kuznetsov: > With TimeSync version 4 protocol support we started updating system time > continuously through the whole lifetime of Hyper-V guests. Every 5 seconds > there is a time sample from the host which triggers do_settimeofday[64](). > While the time from the

Re: [PATCH v4 2/2] hv_utils: implement Hyper-V PTP source

2017-01-20 Thread Radim Krcmar
2017-01-19 15:16+0100, Vitaly Kuznetsov: > With TimeSync version 4 protocol support we started updating system time > continuously through the whole lifetime of Hyper-V guests. Every 5 seconds > there is a time sample from the host which triggers do_settimeofday[64](). > While the time from the

Re: [patch 3/3] PTP: add kvm PTP driver

2017-01-20 Thread Radim Krcmar
2017-01-18 13:28-0200, Marcelo Tosatti: > On Wed, Jan 18, 2017 at 04:20:33PM +0100, Radim Krcmar wrote: >> 2017-01-18 12:53-0200, Marcelo Tosatti: >> > GOn Wed, Jan 18, 2017 at 12:37:25PM -0200, Marcelo Tosatti wrote: >> > > On Wed, Jan 18, 2017 at 01:46:5

Re: [patch 3/3] PTP: add kvm PTP driver

2017-01-20 Thread Radim Krcmar
2017-01-18 13:28-0200, Marcelo Tosatti: > On Wed, Jan 18, 2017 at 04:20:33PM +0100, Radim Krcmar wrote: >> 2017-01-18 12:53-0200, Marcelo Tosatti: >> > GOn Wed, Jan 18, 2017 at 12:37:25PM -0200, Marcelo Tosatti wrote: >> > > On Wed, Jan 18, 2017 at 01:46:5

Re: [patch 5/5] PTP: add kvm PTP driver

2017-01-20 Thread Radim Krcmar
2017-01-20 15:12+0100, Radim Krcmar: > 2017-01-20 10:20-0200, Marcelo Tosatti: >> +spin_lock(_ptp_lock); > > What does the lock prevent? clock_off/clock_off_gpa. :)

Re: [patch 5/5] PTP: add kvm PTP driver

2017-01-20 Thread Radim Krcmar
2017-01-20 15:12+0100, Radim Krcmar: > 2017-01-20 10:20-0200, Marcelo Tosatti: >> +spin_lock(_ptp_lock); > > What does the lock prevent? clock_off/clock_off_gpa. :)

Re: [patch 5/5] PTP: add kvm PTP driver

2017-01-20 Thread Radim Krcmar
2017-01-20 10:20-0200, Marcelo Tosatti: > Add a driver with gettime method returning hosts realtime clock. > This allows Chrony to synchronize host and guest clocks with > high precision (see results below). > > chronyc> sources > MS Name/IP address Stratum Poll Reach LastRx Last sample

Re: [patch 5/5] PTP: add kvm PTP driver

2017-01-20 Thread Radim Krcmar
2017-01-20 10:20-0200, Marcelo Tosatti: > Add a driver with gettime method returning hosts realtime clock. > This allows Chrony to synchronize host and guest clocks with > high precision (see results below). > > chronyc> sources > MS Name/IP address Stratum Poll Reach LastRx Last sample

Re: [patch 4/5] PTP: add PTP_SYS_OFFSET emulation via cross timestamps infrastructure

2017-01-20 Thread Radim Krcmar
2017-01-20 14:36+0100, Paolo Bonzini: > On 20/01/2017 14:07, Marcelo Tosatti wrote: >> On Fri, Jan 20, 2017 at 01:55:27PM +0100, Paolo Bonzini wrote: >>> >>> >>> On 20/01/2017 13:20, Marcelo Tosatti wrote: kernel/time/timekeeping.c| 79 +++

Re: [patch 4/5] PTP: add PTP_SYS_OFFSET emulation via cross timestamps infrastructure

2017-01-20 Thread Radim Krcmar
2017-01-20 14:36+0100, Paolo Bonzini: > On 20/01/2017 14:07, Marcelo Tosatti wrote: >> On Fri, Jan 20, 2017 at 01:55:27PM +0100, Paolo Bonzini wrote: >>> >>> >>> On 20/01/2017 13:20, Marcelo Tosatti wrote: kernel/time/timekeeping.c| 79 +++

Re: [patch 3/3] PTP: add kvm PTP driver

2017-01-18 Thread Radim Krcmar
2017-01-18 16:54+0100, Miroslav Lichvar: > On Wed, Jan 18, 2017 at 12:24:09PM -0200, Marcelo Tosatti wrote: >> On Wed, Jan 18, 2017 at 01:46:58PM +0100, Paolo Bonzini wrote: >> > I'd rather use PTP_SYS_OFFSET_PRECISE instead, but unfortunately chrony >> > does not support it---but I would still

Re: [patch 3/3] PTP: add kvm PTP driver

2017-01-18 Thread Radim Krcmar
2017-01-18 16:54+0100, Miroslav Lichvar: > On Wed, Jan 18, 2017 at 12:24:09PM -0200, Marcelo Tosatti wrote: >> On Wed, Jan 18, 2017 at 01:46:58PM +0100, Paolo Bonzini wrote: >> > I'd rather use PTP_SYS_OFFSET_PRECISE instead, but unfortunately chrony >> > does not support it---but I would still

Re: [patch 3/3] PTP: add kvm PTP driver

2017-01-18 Thread Radim Krcmar
2017-01-18 13:46+0100, Paolo Bonzini: > > > On 18/01/2017 13:24, Marcelo Tosatti wrote: > > On Wed, Jan 18, 2017 at 10:17:38AM -0200, Marcelo Tosatti wrote: > >> On Tue, Jan 17, 2017 at 04:36:21PM +0100, Radim Krcmar wrote: > >>> 2017-01-17 09:30-0200, Ma

Re: [patch 3/3] PTP: add kvm PTP driver

2017-01-18 Thread Radim Krcmar
2017-01-18 13:46+0100, Paolo Bonzini: > > > On 18/01/2017 13:24, Marcelo Tosatti wrote: > > On Wed, Jan 18, 2017 at 10:17:38AM -0200, Marcelo Tosatti wrote: > >> On Tue, Jan 17, 2017 at 04:36:21PM +0100, Radim Krcmar wrote: > >>> 2017-01-17 09:30-0200, Ma

Re: [patch 3/3] PTP: add kvm PTP driver

2017-01-18 Thread Radim Krcmar
2017-01-18 12:50-0200, Marcelo Tosatti: > On Wed, Jan 18, 2017 at 03:02:23PM +0100, Paolo Bonzini wrote: >> >> >> On 18/01/2017 14:36, Miroslav Lichvar wrote: >> > On Wed, Jan 18, 2017 at 01:46:58PM +0100, Paolo Bonzini wrote: >> >> On 18/01/2017 13:24, Marcelo Tosatti wrote: >> Testcase:

Re: [patch 3/3] PTP: add kvm PTP driver

2017-01-18 Thread Radim Krcmar
2017-01-18 12:50-0200, Marcelo Tosatti: > On Wed, Jan 18, 2017 at 03:02:23PM +0100, Paolo Bonzini wrote: >> >> >> On 18/01/2017 14:36, Miroslav Lichvar wrote: >> > On Wed, Jan 18, 2017 at 01:46:58PM +0100, Paolo Bonzini wrote: >> >> On 18/01/2017 13:24, Marcelo Tosatti wrote: >> Testcase:

Re: [patch 3/3] PTP: add kvm PTP driver

2017-01-18 Thread Radim Krcmar
n Wed, Jan 18, 2017 at 10:17:38AM -0200, Marcelo Tosatti wrote: > > > >> On Tue, Jan 17, 2017 at 04:36:21PM +0100, Radim Krcmar wrote: > > > >>> 2017-01-17 09:30-0200, Marcelo Tosatti: > > > >>>> On Tue, Jan 17, 2017 at 09:03:27AM +0

Re: [patch 3/3] PTP: add kvm PTP driver

2017-01-18 Thread Radim Krcmar
n Wed, Jan 18, 2017 at 10:17:38AM -0200, Marcelo Tosatti wrote: > > > >> On Tue, Jan 17, 2017 at 04:36:21PM +0100, Radim Krcmar wrote: > > > >>> 2017-01-17 09:30-0200, Marcelo Tosatti: > > > >>>> On Tue, Jan 17, 2017 at 09:03:27AM +0

Re: [patch 3/3] PTP: add kvm PTP driver

2017-01-17 Thread Radim Krcmar
2017-01-17 09:30-0200, Marcelo Tosatti: > On Tue, Jan 17, 2017 at 09:03:27AM +0100, Miroslav Lichvar wrote: >> On Mon, Jan 16, 2017 at 06:01:14PM -0200, Marcelo Tosatti wrote: >> > On Mon, Jan 16, 2017 at 05:47:15PM -0200, Marcelo Tosatti wrote: >> > > On Mon, Jan 16, 2017 at 05:36:55PM -0200,

Re: [patch 3/3] PTP: add kvm PTP driver

2017-01-17 Thread Radim Krcmar
2017-01-17 09:30-0200, Marcelo Tosatti: > On Tue, Jan 17, 2017 at 09:03:27AM +0100, Miroslav Lichvar wrote: >> On Mon, Jan 16, 2017 at 06:01:14PM -0200, Marcelo Tosatti wrote: >> > On Mon, Jan 16, 2017 at 05:47:15PM -0200, Marcelo Tosatti wrote: >> > > On Mon, Jan 16, 2017 at 05:36:55PM -0200,

Re: [patch 3/3] PTP: add kvm PTP driver

2017-01-16 Thread Radim Krcmar
2017-01-16 15:39-0200, Marcelo Tosatti: > On Mon, Jan 16, 2017 at 06:27:58PM +0100, Radim Krcmar wrote: >> 2017-01-16 15:08-0200, Marcelo Tosatti: >> > On Mon, Jan 16, 2017 at 05:54:11PM +0100, Radim Krcmar wrote: >> >> 2017-01-16 17:26+0100, Radim Krcmar: >>

Re: [patch 3/3] PTP: add kvm PTP driver

2017-01-16 Thread Radim Krcmar
2017-01-16 15:39-0200, Marcelo Tosatti: > On Mon, Jan 16, 2017 at 06:27:58PM +0100, Radim Krcmar wrote: >> 2017-01-16 15:08-0200, Marcelo Tosatti: >> > On Mon, Jan 16, 2017 at 05:54:11PM +0100, Radim Krcmar wrote: >> >> 2017-01-16 17:26+0100, Radim Krcmar: >>

Re: [patch 3/3] PTP: add kvm PTP driver

2017-01-16 Thread Radim Krcmar
2017-01-16 15:04-0200, Marcelo Tosatti: > On Mon, Jan 16, 2017 at 05:26:53PM +0100, Radim Krcmar wrote: >> 2017-01-13 15:40-0200, Marcelo Tosatti: >> > On Fri, Jan 13, 2017 at 04:56:58PM +0100, Radim Krcmar wrote: >> > > 2017-01-13 10:01-0200, Marcelo Tosatti: &

Re: [patch 3/3] PTP: add kvm PTP driver

2017-01-16 Thread Radim Krcmar
2017-01-16 15:04-0200, Marcelo Tosatti: > On Mon, Jan 16, 2017 at 05:26:53PM +0100, Radim Krcmar wrote: >> 2017-01-13 15:40-0200, Marcelo Tosatti: >> > On Fri, Jan 13, 2017 at 04:56:58PM +0100, Radim Krcmar wrote: >> > > 2017-01-13 10:01-0200, Marcelo Tosatti: &

Re: [patch 3/3] PTP: add kvm PTP driver

2017-01-16 Thread Radim Krcmar
2017-01-16 15:08-0200, Marcelo Tosatti: > On Mon, Jan 16, 2017 at 05:54:11PM +0100, Radim Krcmar wrote: >> 2017-01-16 17:26+0100, Radim Krcmar: >> > 2017-01-13 15:40-0200, Marcelo Tosatti: >> >> On Fri, Jan 13, 2017 at 04:56:58PM +0100, Radim Krcmar wrote: >>

Re: [patch 3/3] PTP: add kvm PTP driver

2017-01-16 Thread Radim Krcmar
2017-01-16 15:08-0200, Marcelo Tosatti: > On Mon, Jan 16, 2017 at 05:54:11PM +0100, Radim Krcmar wrote: >> 2017-01-16 17:26+0100, Radim Krcmar: >> > 2017-01-13 15:40-0200, Marcelo Tosatti: >> >> On Fri, Jan 13, 2017 at 04:56:58PM +0100, Radim Krcmar wrote: >>

Re: [patch 3/3] PTP: add kvm PTP driver

2017-01-16 Thread Radim Krcmar
2017-01-16 17:26+0100, Radim Krcmar: > 2017-01-13 15:40-0200, Marcelo Tosatti: >> On Fri, Jan 13, 2017 at 04:56:58PM +0100, Radim Krcmar wrote: >> > 2017-01-13 10:01-0200, Marcelo Tosatti: >>> > + version = pvclock_read_begin(src); >>> &

Re: [patch 3/3] PTP: add kvm PTP driver

2017-01-16 Thread Radim Krcmar
2017-01-16 17:26+0100, Radim Krcmar: > 2017-01-13 15:40-0200, Marcelo Tosatti: >> On Fri, Jan 13, 2017 at 04:56:58PM +0100, Radim Krcmar wrote: >> > 2017-01-13 10:01-0200, Marcelo Tosatti: >>> > + version = pvclock_read_begin(src); >>> &

Re: [patch 3/3] PTP: add kvm PTP driver

2017-01-16 Thread Radim Krcmar
2017-01-13 15:40-0200, Marcelo Tosatti: > On Fri, Jan 13, 2017 at 04:56:58PM +0100, Radim Krcmar wrote: > > 2017-01-13 10:01-0200, Marcelo Tosatti: >> > + version = pvclock_read_begin(src); >> > + >> > + ret

Re: [patch 3/3] PTP: add kvm PTP driver

2017-01-16 Thread Radim Krcmar
2017-01-13 15:40-0200, Marcelo Tosatti: > On Fri, Jan 13, 2017 at 04:56:58PM +0100, Radim Krcmar wrote: > > 2017-01-13 10:01-0200, Marcelo Tosatti: >> > + version = pvclock_read_begin(src); >> > + >> > + ret

Re: [patch 3/3] PTP: add kvm PTP driver

2017-01-16 Thread Radim Krcmar
2017-01-14 16:26+0100, Richard Cochran: > On Fri, Jan 13, 2017 at 04:56:58PM +0100, Radim Krcmar wrote: >> > +static int __init ptp_kvm_init(void) >> > +{ >> > + if (!kvm_para_available()) >> > + return -ENODEV; >>

Re: [patch 3/3] PTP: add kvm PTP driver

2017-01-16 Thread Radim Krcmar
2017-01-14 16:26+0100, Richard Cochran: > On Fri, Jan 13, 2017 at 04:56:58PM +0100, Radim Krcmar wrote: >> > +static int __init ptp_kvm_init(void) >> > +{ >> > + if (!kvm_para_available()) >> > + return -ENODEV; >>

Re: [patch 1/3] KVM: x86: provide realtime host clock via vsyscall notifiers

2017-01-16 Thread Radim Krcmar
2017-01-13 15:51-0200, Marcelo Tosatti: > On Fri, Jan 13, 2017 at 05:28:09PM +0100, Radim Krcmar wrote: >> 2017-01-13 13:34-0200, Marcelo Tosatti: >> > On Fri, Jan 13, 2017 at 04:18:04PM +0100, Radim Krcmar wrote: >> >> 2017-01-13 10:01-0200, Marcelo Tosatti: >>

Re: [patch 1/3] KVM: x86: provide realtime host clock via vsyscall notifiers

2017-01-16 Thread Radim Krcmar
2017-01-13 15:51-0200, Marcelo Tosatti: > On Fri, Jan 13, 2017 at 05:28:09PM +0100, Radim Krcmar wrote: >> 2017-01-13 13:34-0200, Marcelo Tosatti: >> > On Fri, Jan 13, 2017 at 04:18:04PM +0100, Radim Krcmar wrote: >> >> 2017-01-13 10:01-0200, Marcelo Tosatti: >>

Re: [patch 2/3] KVM: x86: add KVM_HC_CLOCK_OFFSET hypercall

2017-01-13 Thread Radim Krcmar
2017-01-13 13:43-0200, Marcelo Tosatti: > On Fri, Jan 13, 2017 at 04:31:58PM +0100, Radim Krcmar wrote: >> 2017-01-13 10:01-0200, Marcelo Tosatti: >> > Add a hypercall to retrieve the host realtime clock >> > and the TSC value used to calculate that clock read. >>

Re: [patch 2/3] KVM: x86: add KVM_HC_CLOCK_OFFSET hypercall

2017-01-13 Thread Radim Krcmar
2017-01-13 13:43-0200, Marcelo Tosatti: > On Fri, Jan 13, 2017 at 04:31:58PM +0100, Radim Krcmar wrote: >> 2017-01-13 10:01-0200, Marcelo Tosatti: >> > Add a hypercall to retrieve the host realtime clock >> > and the TSC value used to calculate that clock read. >>

Re: [patch 1/3] KVM: x86: provide realtime host clock via vsyscall notifiers

2017-01-13 Thread Radim Krcmar
2017-01-13 13:34-0200, Marcelo Tosatti: > On Fri, Jan 13, 2017 at 04:18:04PM +0100, Radim Krcmar wrote: >> 2017-01-13 10:01-0200, Marcelo Tosatti: >> > Expose the realtime host clock and save the TSC value >> > used for the clock calculation. >> > >&g

Re: [patch 1/3] KVM: x86: provide realtime host clock via vsyscall notifiers

2017-01-13 Thread Radim Krcmar
2017-01-13 13:34-0200, Marcelo Tosatti: > On Fri, Jan 13, 2017 at 04:18:04PM +0100, Radim Krcmar wrote: >> 2017-01-13 10:01-0200, Marcelo Tosatti: >> > Expose the realtime host clock and save the TSC value >> > used for the clock calculation. >> >

Re: [patch 3/3] PTP: add kvm PTP driver

2017-01-13 Thread Radim Krcmar
2017-01-13 10:01-0200, Marcelo Tosatti: > Add a driver with gettime method returning hosts realtime clock. > This allows Chrony to synchronize host and guest clocks with > high precision (see results below). > > chronyc> sources > MS Name/IP address Stratum Poll Reach LastRx Last sample

Re: [patch 3/3] PTP: add kvm PTP driver

2017-01-13 Thread Radim Krcmar
2017-01-13 10:01-0200, Marcelo Tosatti: > Add a driver with gettime method returning hosts realtime clock. > This allows Chrony to synchronize host and guest clocks with > high precision (see results below). > > chronyc> sources > MS Name/IP address Stratum Poll Reach LastRx Last sample

Re: [patch 2/3] KVM: x86: add KVM_HC_CLOCK_OFFSET hypercall

2017-01-13 Thread Radim Krcmar
2017-01-13 10:01-0200, Marcelo Tosatti: > Add a hypercall to retrieve the host realtime clock > and the TSC value used to calculate that clock read. > > Used to implement clock synchronization between > host and guest. > > Signed-off-by: Marcelo Tosatti > > --- >

Re: [patch 2/3] KVM: x86: add KVM_HC_CLOCK_OFFSET hypercall

2017-01-13 Thread Radim Krcmar
2017-01-13 10:01-0200, Marcelo Tosatti: > Add a hypercall to retrieve the host realtime clock > and the TSC value used to calculate that clock read. > > Used to implement clock synchronization between > host and guest. > > Signed-off-by: Marcelo Tosatti > > --- >

Re: [patch 1/3] KVM: x86: provide realtime host clock via vsyscall notifiers

2017-01-13 Thread Radim Krcmar
2017-01-13 10:01-0200, Marcelo Tosatti: > Expose the realtime host clock and save the TSC value > used for the clock calculation. > > Signed-off-by: Marcelo Tosatti > > --- > arch/x86/kvm/x86.c | 38 ++ > 1 file changed, 38

Re: [patch 1/3] KVM: x86: provide realtime host clock via vsyscall notifiers

2017-01-13 Thread Radim Krcmar
2017-01-13 10:01-0200, Marcelo Tosatti: > Expose the realtime host clock and save the TSC value > used for the clock calculation. > > Signed-off-by: Marcelo Tosatti > > --- > arch/x86/kvm/x86.c | 38 ++ > 1 file changed, 38 insertions(+) > > Index:

  1   2   >