[patch 2/4] KVM: x86: add KVM_HC_CLOCK_OFFSET hypercall

2017-01-24 Thread 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 --- Documentation/virtual/kvm/hypercalls.txt | 33 arch/x86

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

2017-01-24 Thread Marcelo Tosatti
On Mon, Jan 23, 2017 at 08:44:53PM +0100, Paolo Bonzini wrote: > > > On 23/01/2017 19:44, Richard Cochran wrote: > >> device clock |sample1P,deviceclock| |sample2P,deviceclock| > >> - > >> realtime clock |sample1P,realtim

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

2017-01-23 Thread Marcelo Tosatti
On Mon, Jan 23, 2017 at 07:44:15PM +0100, Richard Cochran wrote: > On Mon, Jan 23, 2017 at 11:19:17AM -0200, Marcelo Tosatti wrote: > > This is needed to generate the PTP_SYS_OFFSET data: a table with read > > from realtime clock, read from device clock, read from

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

2017-01-23 Thread Marcelo Tosatti
On Fri, Jan 20, 2017 at 09:25:02PM +0100, Richard Cochran wrote: > On Fri, Jan 20, 2017 at 10:20:29AM -0200, Marcelo Tosatti wrote: > > Emulate PTP_SYS_OFFSET by using an arithmetic mean of the > > realtime samples from ->getcrosststamp callback. > > This change log

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

2017-01-20 Thread Marcelo Tosatti
On Fri, Jan 20, 2017 at 07:08:49PM +0100, Radim Krcmar wrote: > 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 { > >> > +

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

2017-01-20 Thread Marcelo Tosatti
On Fri, Jan 20, 2017 at 03:12:56PM +0100, Radim Krcmar wrote: > 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 bel

[patch 5/5] PTP: add kvm PTP driver (v2)

2017-01-20 Thread Marcelo Tosatti
ock. Signed-off-by: Marcelo Tosatti --- drivers/ptp/Kconfig | 12 +++ drivers/ptp/Makefile |1 drivers/ptp/ptp_kvm.c | 177 ++ 3 files changed, 190 insertions(+) v2: check for kvmclock (Radim) initialize global variables before dev

[patch 0/5] KVM virtual PTP driver (v4)

2017-01-20 Thread Marcelo Tosatti
This patchset implements a virtual PTP driver which allows guest to sync its clock to the host clock with high precision (error is < 1us on an idle guest). Changelog from v3 Patch3: v2: export kvmclock clocksource structure directly (Paolo) Patch4: v2: drop timekeeper spinlock, move back to dr

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

2017-01-20 Thread Marcelo Tosatti
On Fri, Jan 20, 2017 at 02:36:40PM +0100, Paolo Bonzini wrote: > > > 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: >

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

2017-01-20 Thread Marcelo Tosatti
ion), that should not be a problem. Signed-off-by: Marcelo Tosatti --- drivers/ptp/ptp_chardev.c | 73 ++ drivers/ptp/ptp_clock.c | 10 ++ 2 files changed, 83 insertions(+) v2: drop timekeeper spinlock, move back to drivers/ptp/ptp_charde

[patch 3/5] kvmclock: export kvmclock clocksource pointer

2017-01-20 Thread Marcelo Tosatti
To be used by KVM PTP driver. Signed-off-by: Marcelo Tosatti --- arch/x86/include/asm/kvmclock.h |6 ++ arch/x86/kernel/kvmclock.c |3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) v2: export kvmclock clocksource structure directly (Paolo) Index: kvm-ptpdriver/arch/x86

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

2017-01-20 Thread Marcelo Tosatti
ock. Signed-off-by: Marcelo Tosatti --- drivers/ptp/Kconfig | 12 +++ drivers/ptp/Makefile |1 drivers/ptp/ptp_kvm.c | 179 ++ 3 files changed, 192 insertions(+) v2: check for kvmclock (Radim) initialize global variables before dev

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

2017-01-20 Thread 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 | 36 1 file changed, 36 insertions(+) v2: unify nsec_base (Radim) Index: kvm-ptpdriver/arch/x86/kvm/x86.c

[patch 2/5] KVM: x86: add KVM_HC_CLOCK_OFFSET hypercall

2017-01-20 Thread 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 --- Documentation/virtual/kvm/hypercalls.txt | 33 arch/x86

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

2017-01-20 Thread Marcelo Tosatti
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 > > +++ > > Why not leave this in drivers/ptp/ptp_chardev.c? timekeep

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

2017-01-20 Thread Marcelo Tosatti
On Fri, Jan 20, 2017 at 01:58:33PM +0100, Paolo Bonzini wrote: > > > On 20/01/2017 13:20, Marcelo Tosatti wrote: > > + ret = kvm_hypercall2(KVM_HC_CLOCK_PAIRING, > > +clock_off_gpa, > > +

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

2017-01-20 Thread Marcelo Tosatti
Emulate PTP_SYS_OFFSET by using an arithmetic mean of the realtime samples from ->getcrosststamp callback. Signed-off-by: Marcelo Tosatti --- drivers/ptp/ptp_chardev.c|6 ++ include/linux/ptp_clock_kernel.h |5 ++ include/linux/timekeeping_ptp.h | 10 kernel/t

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

2017-01-20 Thread 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 | 36 1 file changed, 36 insertions(+) v2: unify nsec_base (Radim) Index: kvm-ptpdriver/arch/x86/kvm/x86.c

[patch 3/5] kvmclock: export kvmclock clocksource pointer

2017-01-20 Thread Marcelo Tosatti
To be used by KVM PTP driver. Signed-off-by: Marcelo Tosatti --- arch/x86/include/asm/kvmclock.h |6 ++ arch/x86/kernel/kvmclock.c |6 ++ 2 files changed, 12 insertions(+) Index: kvm-ptpdriver/arch/x86/include/asm/kvmclock.h

[patch 2/5] KVM: x86: add KVM_HC_CLOCK_OFFSET hypercall

2017-01-20 Thread 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 --- Documentation/virtual/kvm/hypercalls.txt | 33 arch/x86

[patch 0/5] KVM virtual PTP driver (v3)

2017-01-20 Thread Marcelo Tosatti
This patchset implements a virtual PTP driver which allows guest to sync its clock to the host clock with high precision (error is < 1us on an idle guest). Changelog from v2 Cross timestamping, emulation of PTP_SYS_OFFSET with cross timestamping (Paolo, Miroslav, Radim). Changelog from v1 Patch

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

2017-01-20 Thread Marcelo Tosatti
ock. Signed-off-by: Marcelo Tosatti --- drivers/ptp/Kconfig | 12 ++ drivers/ptp/Makefile |1 drivers/ptp/ptp_kvm.c | 213 ++ 3 files changed, 226 insertions(+) v2: check for kvmclock (Radim) initialize global variables before dev

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

2017-01-20 Thread Marcelo Tosatti
On Wed, Jan 18, 2017 at 04:45:07PM +0100, Paolo Bonzini wrote: > > > On 18/01/2017 15:50, Marcelo Tosatti wrote: > >> Interesting idea! For this to work, KVM needs to implement > >> getcrosstimestamp and ptp_chardev.c can then add an alternative > >> implem

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

2017-01-20 Thread 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:58PM +0100, Paolo Bonzini wrote: > > > > > > >

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

2017-01-18 Thread 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: run a gu

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

2017-01-18 Thread Marcelo Tosatti
GOn Wed, Jan 18, 2017 at 12:37:25PM -0200, Marcelo Tosatti wrote: > On Wed, Jan 18, 2017 at 01:46:58PM +0100, Paolo Bonzini wrote: > > > > > > On 18/01/2017 13:24, Marcelo Tosatti wrote: > > > On Wed, Jan 18, 2017 at 10:17:38AM -0200, Marcelo Tosatti wrote: > &

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

2017-01-18 Thread Marcelo Tosatti
On Wed, Jan 18, 2017 at 01:46:58PM +0100, Paolo Bonzini wrote: > 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-

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

2017-01-18 Thread Marcelo Tosatti
On Wed, Jan 18, 2017 at 01:46:58PM +0100, Paolo Bonzini wrote: > > > 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: > >>> 20

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

2017-01-18 Thread Marcelo Tosatti
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, Marcelo Tosatti: > > > On Tue, Jan 17, 2017 at 09:03:27AM +0100, Miroslav Lichvar wrote: > > >> On Mon, Ja

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

2017-01-18 Thread Marcelo Tosatti
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 +0100, Miroslav Lichvar wrote: > >> On Mon, Jan 16, 2017 at 06:01:14PM -0200, Marcelo Tosatti wrote: > >> > On Mon, Ja

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

2017-01-17 Thread 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, Marcelo Tosatti wrote: >

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

2017-01-16 Thread Marcelo Tosatti
On Mon, Jan 16, 2017 at 05:47:15PM -0200, Marcelo Tosatti wrote: > On Mon, Jan 16, 2017 at 05:36:55PM -0200, Marcelo Tosatti wrote: > > On Mon, Jan 16, 2017 at 07:01:48PM +0100, Radim Krcmar wrote: > > > > Sorry the clock difference is 10ns now. So the guest clock is of

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

2017-01-16 Thread Marcelo Tosatti
On Mon, Jan 16, 2017 at 05:36:55PM -0200, Marcelo Tosatti wrote: > On Mon, Jan 16, 2017 at 07:01:48PM +0100, Radim Krcmar wrote: > > > Sorry the clock difference is 10ns now. So the guest clock is off by _10 > > > ns_ > > > of the host clock. > > > > T

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

2017-01-16 Thread Marcelo Tosatti
On Mon, Jan 16, 2017 at 07:01:48PM +0100, Radim Krcmar wrote: > > Sorry the clock difference is 10ns now. So the guest clock is off by _10 > > ns_ > > of the host clock. > > That is pretty good. Yes. > > You are suggesting to use getcrosststamp instead, to drop the (rdtsc() - > > guest_tsc) pa

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

2017-01-16 Thread 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: > >> > 2017-01-13 15:40-0200, Marcelo Tosatti: > &g

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

2017-01-16 Thread 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: > >> > 2017-01-13 10:01-0200, Marcelo Tosatti: &

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

2017-01-16 Thread 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: > >> > +ve

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

2017-01-13 Thread 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 | 36 1 file changed, 36 insertions(+) v2: unify nsec_base (Radim) Index: kvm-ptpdriver/arch/x86/kvm/x86.c

[patch 0/3] KVM virtual PTP driver (v2)

2017-01-13 Thread Marcelo Tosatti
This patchset implements a virtual PTP driver which allows guest to sync its clock to the host clock with high precision ( error is < 10ns). Changelog from v1 Patch1: v2: unify nsec_base (Radim) Patch2: v2: improve documentation (Radim) change hypercall name to KVM_HC_CLOCK_PAIRING (Radim)

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

2017-01-13 Thread 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 --- Documentation/virtual/kvm/hypercalls.txt | 33 arch/x86

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

2017-01-13 Thread Marcelo Tosatti
ock. Signed-off-by: Marcelo Tosatti --- drivers/ptp/Kconfig | 12 +++ drivers/ptp/Makefile |1 drivers/ptp/ptp_kvm.c | 179 ++ 3 files changed, 192 insertions(+) v2: check for kvmclock (Radim) initialize global variables before dev

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

2017-01-13 Thread Marcelo Tosatti
On Fri, Jan 13, 2017 at 06:07:40PM +0100, Radim Krcmar wrote: > 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

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

2017-01-13 Thread Marcelo Tosatti
On Fri, Jan 13, 2017 at 04:56:58PM +0100, Radim Krcmar wrote: > 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 bel

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

2017-01-13 Thread 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: > >> > Expose the realtime host clock and save the

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

2017-01-13 Thread 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. > > > > Signed-off-by: Marcelo Tosatti > > >

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

2017-01-13 Thread 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. > > > > Used to implement clock synchronization

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

2017-01-13 Thread Marcelo Tosatti
On Fri, Jan 13, 2017 at 10:41:10AM -0500, Konrad Rzeszutek Wilk wrote: > 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 calcu

[patch 0/3] KVM virtual PTP driver

2017-01-13 Thread Marcelo Tosatti
This patchset implements a virtual PTP driver which allows guest to sync its clock to the host clock with high precision ( error is < 10ns).

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

2017-01-13 Thread Marcelo Tosatti
_off); + + hv_clock = pvclock_pvti_cpu0_va(); + + return 0; +} + +module_init(ptp_kvm_init); +module_exit(ptp_kvm_exit); + +MODULE_AUTHOR("Marcelo Tosatti "); +MODULE_DESCRIPTION("PTP clock using KVMCLOCK"); +MODULE_LICENSE("GPL"); Index: kvm-ptpdri

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

2017-01-13 Thread 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 --- Documentation/virtual/kvm/hypercalls.txt | 30 ++ arch/x86/include

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

2017-01-13 Thread 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: kvm-ptpdriver/arch/x86/kvm/x86.c

[ANNOUNCE] resctrltool: command line tool to manage CAT reservations from userspace

2017-01-03 Thread Marcelo Tosatti
Hello, Reviews, comments and questions are appreciated on this python script, called resctrltool.py, a utility to manage CAT reservations from the command line. Why: There are two main reasons for writing this tool, they are: 1) The kernel resctrlfs filesystem format is not functional for being

Re: [PATCH][RFC] VM: x86: Return ealier if clocksource has not changed

2016-12-29 Thread Marcelo Tosatti
On Thu, Dec 29, 2016 at 04:59:02PM +0800, Chen Yu wrote: > On Tue, Dec 27, 2016 at 01:32:47PM -0200, Marcelo Tosatti wrote: > > On Tue, Dec 27, 2016 at 04:06:44PM +0800, Chen Yu wrote: > > > Hi Marcelo, > > > On Mon, Dec 26, 2016 at 05:44:25PM -0200, Marcelo Tosatti wr

Re: [PATCH][RFC] VM: x86: Return ealier if clocksource has not changed

2016-12-27 Thread Marcelo Tosatti
On Tue, Dec 27, 2016 at 04:06:44PM +0800, Chen Yu wrote: > Hi Marcelo, > On Mon, Dec 26, 2016 at 05:44:25PM -0200, Marcelo Tosatti wrote: > > On Fri, Dec 23, 2016 at 04:41:53PM +0800, Chen Yu wrote: > > > Currently the notifier of pvclock_gtod_notify() get invoked > &

Re: [PATCH][RFC] VM: x86: Return ealier if clocksource has not changed

2016-12-26 Thread Marcelo Tosatti
either we can add a new notifier for clocksource switch, > or we can simply bypass the following code in pvclock_gtod_notify() > earlier if there is no clocksource switch. > > Cc: Paolo Bonzini > Cc: "Radim Krcmar" > Cc: Marcelo Tosatti > Cc: Thomas Gleixner >

[tip:x86/cache] Documentation, x86, resctrl: Recommend locking for resctrlfs

2016-12-15 Thread tip-bot for Marcelo Tosatti
Commit-ID: 3c2a769de7955ff81818b49d388dd771bf6ae29d Gitweb: http://git.kernel.org/tip/3c2a769de7955ff81818b49d388dd771bf6ae29d Author: Marcelo Tosatti AuthorDate: Wed, 14 Dec 2016 15:08:37 -0200 Committer: Thomas Gleixner CommitDate: Thu, 15 Dec 2016 14:44:27 +0100 Documentation, x86

[PATCH v3] intelrdt: resctrl: recommend locking for resctrlfs

2016-12-14 Thread Marcelo Tosatti
There is a locking problem between different applications reading/writing to resctrlfs directory at the same time (read the patch below for details). Suggest a standard locking scheme for applications to use. Signed-off-by: Marcelo Tosatti diff --git a/Documentation/x86/intel_rdt_ui.txt b

Re: [PATCH v2] intelrdt: resctrl: recommend locking for resctrlfs

2016-12-02 Thread Marcelo Tosatti
On Fri, Dec 02, 2016 at 12:20:29PM +0100, Thomas Gleixner wrote: > On Thu, 1 Dec 2016, Marcelo Tosatti wrote: > > > > There is a locking problem between different applications > > reading/writing to resctrlfs directory at the same time (read the patch > > below for d

[PATCH v2] intelrdt: resctrl: recommend locking for resctrlfs

2016-12-02 Thread Marcelo Tosatti
There is a locking problem between different applications reading/writing to resctrlfs directory at the same time (read the patch below for details). Suggest a standard locking scheme for applications to use. Signed-off-by: Marcelo Tosatti --- v2: Improve commentary about generality of

Re: [PATCH] intelrdt: resctrl: recommend locking for resctrlfs

2016-12-01 Thread Marcelo Tosatti
On Wed, Nov 30, 2016 at 02:05:31PM -0800, Fenghua Yu wrote: > On Wed, Nov 30, 2016 at 01:48:10PM -0200, Marcelo Tosatti wrote: > > > > There is a locking problem between different applications > > reading/writing to resctrlfs directory at the same time (read the patch

[PATCH] intelrdt: resctrl: recommend locking for resctrlfs

2016-11-30 Thread Marcelo Tosatti
There is a locking problem between different applications reading/writing to resctrlfs directory at the same time (read the patch below for details). Suggest a standard locking scheme for applications to use. Signed-off-by: Marcelo Tosatti --- Documentation/x86/intel_rdt_ui.txt.orig 2016

Re: [PATCH v3] KVM: x86: do not go through vcpu in __get_kvmclock_ns

2016-11-17 Thread Marcelo Tosatti
value ourselves, using the master > clock (tsc, nsec) pair as the base and the host CPU frequency as > the scale. > > Reported-by: Marcelo Tosatti > Signed-off-by: Paolo Bonzini > --- > arch/x86/kvm/x86.c | 21 + > 1 file changed, 13 insertions(+), 8 dele

Re: [PATCH] KVM: x86: do not go through vcpu in __get_kvmclock_ns

2016-11-14 Thread Marcelo Tosatti
update. > > > > This is easily fixed however, because kvm_get_time_and_clockread provides > > the information we want. > > > > Reported-by: Marcelo Tosatti > > Signed-off-by: Paolo Bonzini > > --- > > arch/x86/kvm/x86.c | 18 ++ >

Re: [PATCH] kvm: kvmclock: let KVM_GET_CLOCK return whether the master clock is in use

2016-11-09 Thread Marcelo Tosatti
sm that lets userspace know if the new KVM_GET_CLOCK > semantics are in effect, and---since we are at it---if the clock > is stable across all VCPUs. > > Cc: Radim Krčmář > Cc: Marcelo Tosatti > Signed-off-by: Paolo Bonzini > --- > Documentation/virtual/kvm/api.txt |

Re: [PATCH] kvm: kvmclock: let KVM_GET_CLOCK return whether the master clock is in use

2016-11-09 Thread Marcelo Tosatti
On Wed, Nov 09, 2016 at 06:17:16PM -0200, Marcelo Tosatti wrote: > On Wed, Nov 09, 2016 at 06:12:50PM -0200, Marcelo Tosatti wrote: > > On Wed, Nov 09, 2016 at 05:48:15PM +0100, Paolo Bonzini wrote: > > > Userspace can read the exact value of kvmclock by reading the TSC >

Re: [PATCH] kvm: kvmclock: let KVM_GET_CLOCK return whether the master clock is in use

2016-11-09 Thread Marcelo Tosatti
On Wed, Nov 09, 2016 at 06:12:50PM -0200, Marcelo Tosatti wrote: > On Wed, Nov 09, 2016 at 05:48:15PM +0100, Paolo Bonzini wrote: > > Userspace can read the exact value of kvmclock by reading the TSC > > and fetching the timekeeping parameters out of guest memory. This > > h

Re: [PATCH] kvm: kvmclock: let KVM_GET_CLOCK return whether the master clock is in use

2016-11-09 Thread Marcelo Tosatti
point to commit or explanation why that is not the case anymore? Thanks > Provide > a mechanism that lets userspace know if the new KVM_GET_CLOCK > semantics are in effect, and---since we are at it---if the clock > is stable across all VCPUs. > > Cc: Radim Krčmář > Cc: Marcelo T

Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space

2016-09-02 Thread Marcelo Tosatti
On Fri, Sep 02, 2016 at 10:15:41AM -0400, Steven Rostedt wrote: > On Fri, 2 Sep 2016 09:43:01 -0400 > Stefan Hajnoczi wrote: > > > Can TSC offset changes occur at runtime? Yes, but Linux guests don't write to the TSC offset after booting and unless user does manual TSC writes. > > One example i

Re: [PATCH 4/4] kvm: x86: export TSC offset to user-space

2016-09-02 Thread Marcelo Tosatti
On Fri, Sep 02, 2016 at 09:43:01AM -0400, Stefan Hajnoczi wrote: > On Wed, Aug 31, 2016 at 01:05:45PM -0400, Luiz Capitulino wrote: > > We need to retrieve a VM's TSC offset in order to use > > the host's TSC to merge host and guest traces. This is > > explained in detail in this thread: > > > >

Re: [PATCH 13/32] Documentation, x86: Documentation for Intel resource allocation user interface

2016-08-03 Thread Marcelo Tosatti
On Tue, Jul 12, 2016 at 06:02:46PM -0700, Fenghua Yu wrote: > From: Fenghua Yu > > The documentation describes user interface of how to allocate resource > in Intel RDT. > > Please note that the documentation covers generic user interface. Current > patch set code only implemente CAT L3. CAT L2

Re: [PATCH 04/32] x86/intel_rdt: Add L3 cache capacity bitmask management

2016-07-25 Thread Marcelo Tosatti
On Fri, Jul 22, 2016 at 02:43:23PM -0700, Luck, Tony wrote: > On Fri, Jul 22, 2016 at 04:12:04AM -0300, Marcelo Tosatti wrote: > > How does this patchset handle the following condition: > > > > 6) Create reservations in such a way that the sum is larger than > > tot

Re: [PATCH 04/32] x86/intel_rdt: Add L3 cache capacity bitmask management

2016-07-22 Thread Marcelo Tosatti
On Tue, Jul 12, 2016 at 06:02:37PM -0700, Fenghua Yu wrote: > From: Vikas Shivappa > > This patch adds different APIs to manage the L3 cache capacity bitmask. > The capacity bit mask(CBM) needs to have only contiguous bits set. The > current implementation has a global CBM for each class of servi

[tip:sched/core] KVM: Use simple waitqueue for vcpu->wq

2016-02-25 Thread tip-bot for Marcelo Tosatti
Commit-ID: 8577370fb0cbe88266b7583d8d3b9f43ced077a0 Gitweb: http://git.kernel.org/tip/8577370fb0cbe88266b7583d8d3b9f43ced077a0 Author: Marcelo Tosatti AuthorDate: Fri, 19 Feb 2016 09:46:39 +0100 Committer: Thomas Gleixner CommitDate: Thu, 25 Feb 2016 11:27:16 +0100 KVM: Use simple

Re: [PATCH 4/4] KVM: x86: track actual TSC frequency from the timekeeper struct

2016-02-19 Thread Marcelo Tosatti
On Tue, Feb 16, 2016 at 05:59:57PM +0100, Paolo Bonzini wrote: > > > On 16/02/2016 15:25, Marcelo Tosatti wrote: > > On Tue, Feb 16, 2016 at 02:48:16PM +0100, Marcelo Tosatti wrote: > >> On Mon, Feb 08, 2016 at 04:18:31PM +0100, Paolo Bonzini wrote: > >>> W

Re: [PATCH 4/4] KVM: x86: track actual TSC frequency from the timekeeper struct

2016-02-16 Thread Marcelo Tosatti
On Tue, Feb 16, 2016 at 02:48:16PM +0100, Marcelo Tosatti wrote: > On Mon, Feb 08, 2016 at 04:18:31PM +0100, Paolo Bonzini wrote: > > When an NTP server is running, it may adjust the time substantially > > compared to the "official" frequency of the TSC. A 12 ppm change

Re: [PATCH 4/4] KVM: x86: track actual TSC frequency from the timekeeper struct

2016-02-16 Thread Marcelo Tosatti
On Mon, Feb 08, 2016 at 04:18:31PM +0100, Paolo Bonzini wrote: > When an NTP server is running, it may adjust the time substantially > compared to the "official" frequency of the TSC. A 12 ppm change > sums up to one second per day. > > This already shows up if the guest compares kvmclock with e.

Re: [PATCH 0/4] kvmclock: improve accuracy

2016-02-16 Thread Marcelo Tosatti
On Mon, Feb 08, 2016 at 04:18:27PM +0100, Paolo Bonzini wrote: > Currently kvmclock is obtaining the multiplier and shift value from > the TSC kHz. These however are less accurate than the host kernel's > clock, which includes corrections made through NTP. > > These patches change kvmclock to tic

Re: [PATCH 2/4] KVM: x86: rewrite handling of scaled TSC for kvmclock

2016-02-11 Thread Marcelo Tosatti
t_tsc_khz, > &vcpu->hv_clock.tsc_shift, > &vcpu->hv_clock.tsc_to_system_mul); > - vcpu->hw_tsc_khz = this_tsc_khz; > + vcpu->hw_tsc_khz = tgt_tsc_khz; > } > > /* With all the info we got, fill in the values */ > -- > 1.8.3.1 > Reviewed-by: Marcelo Tosatti

Re: [PATCH 1/4] KVM: x86: rename argument to kvm_set_tsc_khz

2016-02-11 Thread Marcelo Tosatti
u]\n", user_tsc_khz, thresh_lo, thresh_hi); > use_scaling = 1; > } > - return set_tsc_khz(vcpu, this_tsc_khz, use_scaling); > + return set_tsc_khz(vcpu, user_tsc_khz, use_scaling); > } > > static u64 compute_guest_tsc(struct kvm_vcpu *vcpu, s64 kernel_ns) > -- > 1.8.3.1 > Reviewed-by: Marcelo Tosatti

Re: [RFD] CAT user space interface revisited

2016-01-06 Thread Marcelo Tosatti
On Wed, Jan 06, 2016 at 12:09:50AM +0100, Thomas Gleixner wrote: > Marcelo, > > On Mon, 4 Jan 2016, Marcelo Tosatti wrote: > > On Thu, Dec 31, 2015 at 11:30:57PM +0100, Thomas Gleixner wrote: > > > I don't have an idea how that would look like. The current struc

Re: [PATCH v2 1/4] x86, vdso, pvclock: Simplify and speed up the vdso pvclock reader

2016-01-04 Thread Marcelo Tosatti
On Mon, Jan 04, 2016 at 02:33:12PM -0800, Andy Lutomirski wrote: > On Mon, Jan 4, 2016 at 12:26 PM, Marcelo Tosatti wrote: > > On Sun, Dec 20, 2015 at 03:05:41AM -0800, Andy Lutomirski wrote: > >> From: Andy Lutomirski > >> > >> The pvclock vdso code was too

Re: [PATCH v2 1/4] x86, vdso, pvclock: Simplify and speed up the vdso pvclock reader

2016-01-04 Thread Marcelo Tosatti
On Sun, Dec 20, 2015 at 03:05:41AM -0800, Andy Lutomirski wrote: > From: Andy Lutomirski > > The pvclock vdso code was too abstracted to understand easily and > excessively paranoid. Simplify it for a huge speedup. > > This opens the door for additional simplifications, as the vdso no > longer

Re: [RFD] CAT user space interface revisited

2016-01-04 Thread Marcelo Tosatti
On Mon, Jan 04, 2016 at 03:20:54PM -0200, Marcelo Tosatti wrote: > On Thu, Dec 31, 2015 at 11:30:57PM +0100, Thomas Gleixner wrote: > > Marcelo, > > > > On Thu, 31 Dec 2015, Marcelo Tosatti wrote: > > > > First of all thanks for the explanation. > > &g

Re: [RFD] CAT user space interface revisited

2016-01-04 Thread Marcelo Tosatti
On Thu, Dec 31, 2015 at 11:30:57PM +0100, Thomas Gleixner wrote: > Marcelo, > > On Thu, 31 Dec 2015, Marcelo Tosatti wrote: > > First of all thanks for the explanation. > > > There is one directory structure in this topic, CAT. That is the > > directory structure

Re: [RFD] CAT user space interface revisited

2015-12-31 Thread Marcelo Tosatti
On Tue, Dec 29, 2015 at 01:44:16PM +0100, Thomas Gleixner wrote: > Marcelo, > > On Wed, 23 Dec 2015, Marcelo Tosatti wrote: > > On Tue, Dec 22, 2015 at 06:12:05PM +, Yu, Fenghua wrote: > > > > From: Thomas Gleixner [mailto:t...@linutronix.de] > > > >

Re: [RFD] CAT user space interface revisited

2015-12-23 Thread Marcelo Tosatti
On Tue, Dec 22, 2015 at 06:12:05PM +, Yu, Fenghua wrote: > > From: Thomas Gleixner [mailto:t...@linutronix.de] > > Sent: Wednesday, November 18, 2015 10:25 AM > > Folks! > > > > After rereading the mail flood on CAT and staring into the SDM for a while, > > I > > think we all should sit back

Re: [PATCH V16 11/11] x86,cgroup/intel_rdt : Add a cgroup interface to manage Intel cache allocation

2015-12-21 Thread Marcelo Tosatti
On Mon, Dec 21, 2015 at 10:48:22AM -0500, Luiz Capitulino wrote: > On Sat, 19 Dec 2015 22:57:30 -0200 > Marcelo Tosatti wrote: > > > On Sat, Dec 19, 2015 at 11:42:57AM +0100, Thomas Gleixner wrote: > > > On Thu, 17 Dec 2015, Fenghua Yu wrote: > &g

Re: [PATCH V16 00/11] x86: Intel Cache Allocation Technology Support

2015-12-21 Thread Marcelo Tosatti
On Fri, Dec 18, 2015 at 11:45:29AM -0600, Christoph Lameter wrote: > On Thu, 17 Dec 2015, Fenghua Yu wrote: > > > Intel Cache allocation support: > > > > Cache allocation patches adds a cgroup subsystem to support the new > > Cache Allocation feature found in future Intel Xeon Intel proces

Re: [PATCH V16 11/11] x86,cgroup/intel_rdt : Add a cgroup interface to manage Intel cache allocation

2015-12-21 Thread Marcelo Tosatti
On Sat, Dec 19, 2015 at 11:42:57AM +0100, Thomas Gleixner wrote: > On Thu, 17 Dec 2015, Fenghua Yu wrote: > > > From: Fenghua Yu > > > > From: Vikas Shivappa > > > > Add a new cgroup 'intel_rdt' to manage cache allocation. Each cgroup > > directory is associated with a class of service id(clos

[PATCH v3] cgroups: move cpuset specific checks from generic code to cpuset_can_attach

2015-12-17 Thread Marcelo Tosatti
Move PF_NO_SETAFFINITY check to cpuset cgroups, where it belongs. This makes it possible to attach PF_NO_SETAFFINITY to Intel CAT cgroups. Reported-by: Luiz Capitulino Signed-off-by: Marcelo Tosatti v2: "PF_NO_SETAFFINITY check" -> "PF_NO_SETAFFINITY and kthreadd_tas

[PATCH] cgroups: move cpuset specific checks from generic code to cpuset_can_attach (v2)

2015-11-26 Thread Marcelo Tosatti
Move PF_NO_SETAFFINITY and kthreadd_task checks to cpuset cgroups, where they belong. This makes it possible to attach PF_NO_SETAFFINITY tasks to Intel CAT cgroup. Reported-by: Luiz Capitulino Signed-off-by: Marcelo Tosatti Reviewed-by: Chao Peng v2: "PF_NO_SETAFFINITY

Re: [RFD] CAT user space interface revisited

2015-11-25 Thread Marcelo Tosatti
On Tue, Nov 24, 2015 at 03:31:24PM +0800, Chao Peng wrote: > On Wed, Nov 18, 2015 at 07:25:03PM +0100, Thomas Gleixner wrote: > > > > Let's look at partitioning itself. We have two options: > > > >1) Per task partitioning > > > >2) Per CPU partitioning > > > > So far we only talked abou

[PATCH] cgroups: move cpuset specific checks from generic code to cpuset_can_attach

2015-11-25 Thread Marcelo Tosatti
Move PF_NO_SETAFFINITY check to cpuset cgroups, where it belongs. This makes it possible to attach PF_NO_SETAFFINITY to Intel CAT cgroups. Reported-by: Luiz Capitulino Signed-off-by: Marcelo Tosatti diff --git a/kernel/cgroup.c b/kernel/cgroup.c index f89d929..0603652 100644 --- a/kernel

Re: [RFD] CAT user space interface revisited

2015-11-25 Thread Marcelo Tosatti
On Tue, Nov 24, 2015 at 07:25:43PM -0200, Marcelo Tosatti wrote: > On Tue, Nov 24, 2015 at 04:27:54PM +0800, Chao Peng wrote: > > On Wed, Nov 18, 2015 at 10:01:54PM -0200, Marcelo Tosatti wrote: > > > > tglx > > > > > > Again: you don't n

Re: [RFD] CAT user space interface revisited

2015-11-20 Thread Marcelo Tosatti
On Fri, Nov 20, 2015 at 08:53:34AM +0100, Thomas Gleixner wrote: > On Thu, 19 Nov 2015, Marcelo Tosatti wrote: > > On Thu, Nov 19, 2015 at 10:09:03AM +0100, Thomas Gleixner wrote: > > > On Wed, 18 Nov 2015, Marcelo Tosatti wrote > > > > Actually, there is a point that

Re: [RFD] CAT user space interface revisited

2015-11-20 Thread Marcelo Tosatti
On Thu, Nov 19, 2015 at 09:35:34AM +0100, Thomas Gleixner wrote: > On Wed, 18 Nov 2015, Marcelo Tosatti wrote: > > On Wed, Nov 18, 2015 at 08:34:07PM -0200, Marcelo Tosatti wrote: > > > On Wed, Nov 18, 2015 at 07:25:03PM +0100, Thomas Gleixner wrote: > > > > Assume th

Re: [RFD] CAT user space interface revisited

2015-11-19 Thread Marcelo Tosatti
On Thu, Nov 19, 2015 at 10:09:03AM +0100, Thomas Gleixner wrote: > On Wed, 18 Nov 2015, Marcelo Tosatti wrote > > Actually, there is a point that is useful: you might want the important > > application to share the L3 portion with HW (that HW DMAs into), and > > have only th

Re: [RFD] CAT user space interface revisited

2015-11-19 Thread Marcelo Tosatti
On Wed, Nov 18, 2015 at 11:05:35PM -0200, Marcelo Tosatti wrote: > On Wed, Nov 18, 2015 at 10:01:53PM -0200, Marcelo Tosatti wrote: > > On Wed, Nov 18, 2015 at 07:25:03PM +0100, Thomas Gleixner wrote: > > > Folks! > > > > > > After rereading the mail flood o

Re: [RFD] CAT user space interface revisited

2015-11-18 Thread Marcelo Tosatti
On Wed, Nov 18, 2015 at 10:01:53PM -0200, Marcelo Tosatti wrote: > On Wed, Nov 18, 2015 at 07:25:03PM +0100, Thomas Gleixner wrote: > > Folks! > > > > After rereading the mail flood on CAT and staring into the SDM for a > > while, I think we all should sit back

Re: [RFD] CAT user space interface revisited

2015-11-18 Thread Marcelo Tosatti
On Wed, Nov 18, 2015 at 08:34:07PM -0200, Marcelo Tosatti wrote: > On Wed, Nov 18, 2015 at 07:25:03PM +0100, Thomas Gleixner wrote: > > Folks! > > > > After rereading the mail flood on CAT and staring into the SDM for a > > while, I think we all should sit back

<    1   2   3   4   5   6   7   8   9   10   >