Re: [PATCHv4 07/28] posix-timers/timens: Take into account clock offsets

2019-06-16 Thread Dmitry Safonov
On 6/14/19 2:42 PM, Thomas Gleixner wrote: > On Wed, 12 Jun 2019, Dmitry Safonov wrote: > >> Subject: posix-timers/timens: Take into account clock offsets > > Please avoid that '/timens' appendix. It's not really a new subsystem or > subfunction of posix

Re: [PATCHv4 06/28] timerfd/timens: Take into account ns clock offsets

2019-06-16 Thread Dmitry Safonov
On 6/14/19 2:37 PM, Thomas Gleixner wrote: > On Wed, 12 Jun 2019, Dmitry Safonov wrote: >> --- >> fs/timerfd.c | 3 +++ >> include/linux/time_namespace.h | 18 ++ >> kernel/time_namespace.c| 27

Re: [PATCHv4 03/28] posix-clocks: add another call back to return clock time in ktime_t

2019-06-14 Thread Dmitry Safonov
Hi Thomas, Thanks much for the review, On 6/14/19 2:32 PM, Thomas Gleixner wrote: > Dmitry, > > On Wed, 12 Jun 2019, Dmitry Safonov wrote: > >> From: Andrei Vagin >> >> The callsite in common_timer_get() has already a comment: >> /* >>

Re: [PATCHv4 02/28] timens: Add timens_offsets

2019-06-14 Thread Dmitry Safonov
On 6/14/19 2:11 PM, Thomas Gleixner wrote: > On Wed, 12 Jun 2019, Dmitry Safonov wrote: > >> From: Andrei Vagin >> >> Introduce offsets for time namespace. They will contain an adjustment >> needed to convert clocks to/from host's. >> >> Allocat

Re: [PATCH] x86/hyperv: Disable preemption while setting reenlightenment vector

2019-06-14 Thread Dmitry Safonov
On 6/14/19 1:27 PM, Peter Zijlstra wrote: > On Fri, Jun 14, 2019 at 12:50:51PM +0100, Dmitry Safonov wrote: >> On 6/14/19 11:08 AM, Vitaly Kuznetsov wrote: >>> Peter Zijlstra writes: >>> >>>> @@ -182,7 +182,7 @@ void set_hv_tsccha

Re: [PATCH] x86/hyperv: Disable preemption while setting reenlightenment vector

2019-06-14 Thread Dmitry Safonov
On 6/14/19 11:08 AM, Vitaly Kuznetsov wrote: > Peter Zijlstra writes: > >> @@ -182,7 +182,7 @@ void set_hv_tscchange_cb(void (*cb)(void)) >> struct hv_reenlightenment_control re_ctrl = { >> .vector = HYPERV_REENLIGHTENMENT_VECTOR, >> .enabled = 1, >> -.t

[PATCHv4 05/28] timens: Introduce CLOCK_BOOTTIME offset

2019-06-12 Thread Dmitry Safonov
From: Andrei Vagin Adds boottime virtualisation for time namespace. Introduce timespec for boottime clock into timens offsets and wire clock_gettime() syscall. Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- include/linux/time_namespace.h | 9

[PATCHv4 15/28] x86/vdso: Add offsets page in vvar

2019-06-12 Thread Dmitry Safonov
, add Kconfig dependency for arch. Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- arch/Kconfig | 5 arch/x86/Kconfig | 1 + arch/x86/entry/vdso/vclock_gettime.c | 43 +++ arc

[PATCHv4 03/28] posix-clocks: add another call back to return clock time in ktime_t

2019-06-12 Thread Dmitry Safonov
n why we need a separate callback to return clock value in ktime_t. Suggested-by: Thomas Gleixner Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- include/linux/posix-timers.h | 3 ++ kernel/time/alarmtimer.c | 24 ++--- kernel/tim

[PATCHv4 01/28] ns: Introduce Time Namespace

2019-06-12 Thread Dmitry Safonov
u.org/Time_namespace Link: https://lists.openvz.org/pipermail/criu/2018-June/041504.html Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- MAINTAINERS| 2 + fs/proc/namespaces.c | 4 + include/linux/nsproxy.h

[PATCHv4 12/28] x86/vdso/Makefile: Add vobjs32

2019-06-12 Thread Dmitry Safonov
Treat ia32/i386 objects in array the same As for 64-bit vdso objects. This is a preparation ground to avoid code duplication on introduction timens vdso. Co-developed-by: Andrei Vagin Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- arch/x86/entry/vdso/Makefile | 15

[PATCHv4 09/28] timens: Shift /proc/uptime

2019-06-12 Thread Dmitry Safonov
Respect boottime inside time namespace for /proc/uptime Co-developed-by: Andrei Vagin Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- fs/proc/uptime.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/proc/uptime.c b/fs/proc/uptime.c index a4c2791ab70b..5a1b228964fb

[PATCHv4 06/28] timerfd/timens: Take into account ns clock offsets

2019-06-12 Thread Dmitry Safonov
From: Andrei Vagin Make timerfd respect timens offsets. Provide a helper timens_ktime_to_host() that is useful to wire up timens to different kernel subsystems. Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- fs/timerfd.c | 3

[PATCHv4 16/28] x86/vdso: Allocate timens vdso

2019-06-12 Thread Dmitry Safonov
. Co-developed-by: Andrei Vagin Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- arch/x86/entry/vdso/vdso2c.h | 2 +- arch/x86/entry/vdso/vma.c| 113 +-- arch/x86/include/asm/vdso.h | 9 +-- 3 files changed, 114 insertions(+), 10 deletions

[PATCHv4 10/28] x86/vdso2c: Correct err messages on file opening

2019-06-12 Thread Dmitry Safonov
err() message in main() is misleading: it should print `outfilename`, which is argv[3], not argv[2]. Correct error messages to be more precise about what failed and for which file. Co-developed-by: Andrei Vagin Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- arch/x86/entry/vdso

[PATCHv4 07/28] posix-timers/timens: Take into account clock offsets

2019-06-12 Thread Dmitry Safonov
From: Andrei Vagin Wire timer_settime() syscall into time namespace virtualization. Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- kernel/time/posix-timers.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/time/posix-timers.c b

[PATCHv4 08/28] timens/kernel: Take into account timens clock offsets in clock_nanosleep

2019-06-12 Thread Dmitry Safonov
From: Andrei Vagin Wire up clock_nanosleep() to timens offsets. Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- include/linux/hrtimer.h| 2 +- kernel/time/alarmtimer.c | 2 ++ kernel/time/hrtimer.c | 8 kernel/time/posix

[PATCHv4 17/28] x86/vdso: Switch image on setns()/unshare()/clone()

2019-06-12 Thread Dmitry Safonov
Signed-off-by: Dmitry Safonov --- arch/x86/entry/vdso/vma.c | 28 arch/x86/include/asm/vdso.h | 1 + kernel/time_namespace.c | 11 +++ 3 files changed, 40 insertions(+) diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c index cc

[PATCHv4 14/28] x86/vdso: Rename vdso_image {.data=>.text}

2019-06-12 Thread Dmitry Safonov
To avoid any confusion with VVAR. Co-developed-by: Andrei Vagin Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- arch/x86/entry/vdso/vdso2c.h | 2 +- arch/x86/entry/vdso/vma.c| 6 +++--- arch/x86/include/asm/vdso.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions

[PATCHv4 21/28] selftest/timens: Add Time Namespace test for supported clocks

2019-06-12 Thread Dmitry Safonov
Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- tools/testing/selftests/Makefile | 1 + tools/testing/selftests/timens/.gitignore | 1 + tools/testing/selftests/timens/Makefile | 5 + tools/testing/selftests/timens/config | 1 + tools/testing/selftests/timens

[PATCHv4 20/28] timens/fs/proc: Introduce /proc/pid/timens_offsets

2019-06-12 Thread Dmitry Safonov
From: Andrei Vagin API to set time namespace offsets for children processes, i.e.: echo "clockid off_ses off_nsec" > /proc/self/timens_offsets Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- fs/proc/base.c

[PATCHv4 23/28] selftest/timens: Add a test for clock_nanosleep()

2019-06-12 Thread Dmitry Safonov
From: Andrei Vagin Check that clock_nanosleep() takes into account clock offsets. Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- tools/testing/selftests/timens/.gitignore | 1 + tools/testing/selftests/timens/Makefile | 2

[PATCHv4 26/28] x86/vdso: Align VDSO functions by CPU L1 cache line

2019-06-12 Thread Dmitry Safonov
CPU @ 2.40GHz Co-developed-by: Dmitry Safonov Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- arch/x86/entry/vdso/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile index b58d34120fd8..c7bfd62d1fc3 100644 --- a

[PATCHv4 25/28] selftest/timens: Add timer offsets test

2019-06-12 Thread Dmitry Safonov
From: Andrei Vagin Check that timer_create() takes into account clock offsets. Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- tools/testing/selftests/timens/.gitignore | 1 + tools/testing/selftests/timens/Makefile | 3 +- tools/testing

[PATCHv4 24/28] selftest/timens: Add procfs selftest

2019-06-12 Thread Dmitry Safonov
Check that /proc/uptime is correct inside a new time namespace. Co-developed-by: Andrei Vagin Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- tools/testing/selftests/timens/.gitignore | 1 + tools/testing/selftests/timens/Makefile | 2 +- tools/testing/selftests/timens

[PATCHv4 27/28] selftests: Add a simple perf test for clock_gettime()

2019-06-12 Thread Dmitry Safonov
From: Andrei Vagin Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- tools/testing/selftests/timens/.gitignore | 2 + tools/testing/selftests/timens/Makefile | 8 +- tools/testing/selftests/timens/gettime_perf.c | 74

[PATCHv4 28/28] selftest/timens: Check that a right vdso is mapped after fork and exec

2019-06-12 Thread Dmitry Safonov
From: Andrei Vagin Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- tools/testing/selftests/timens/.gitignore | 1 + tools/testing/selftests/timens/Makefile | 2 +- tools/testing/selftests/timens/exec.c | 91 +++ 3

[PATCHv4 18/28] vdso: introduce timens_static_branch

2019-06-12 Thread Dmitry Safonov
by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- arch/x86/entry/vdso/vclock_gettime.c | 9 +-- arch/x86/entry/vdso/vdso-layout.lds.S | 1 + arch/x86/entry/vdso/vdso2c.h | 11 +++- arch/x86/entry/vdso/vma.c | 37 +++

[PATCHv4 22/28] selftest/timens: Add a test for timerfd

2019-06-12 Thread Dmitry Safonov
From: Andrei Vagin Check that timerfd_create() takes into account clock offsets. Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- tools/testing/selftests/timens/.gitignore | 1 + tools/testing/selftests/timens/Makefile | 2 +- tools/testing

[PATCHv4 02/28] timens: Add timens_offsets

2019-06-12 Thread Dmitry Safonov
From: Andrei Vagin Introduce offsets for time namespace. They will contain an adjustment needed to convert clocks to/from host's. Allocate one page for each time namespace that will be premapped into userspace among vvar pages. Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Sa

[PATCHv4 19/28] timens: Add align for timens_offsets

2019-06-12 Thread Dmitry Safonov
Align offsets so that time namespace will work for ia32 applications on x86_64 host. Co-developed-by: Andrei Vagin Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- include/linux/timens_offsets.h | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a

[PATCHv4 00/28] kernel: Introduce Time Namespace

2019-06-12 Thread Dmitry Safonov
.7 | 188 The numbers gathered on Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz. Cc: Adrian Reber Cc: Andrei Vagin Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Christian Brauner Cc: Cyrill Gorcunov Cc: Dmitry Safonov <0x7f454...@gmail.com> Cc: "Eric W. Biederman" Cc: "

[PATCHv4 11/28] x86/vdso2c: Convert iterator to unsigned

2019-06-12 Thread Dmitry Safonov
space. Co-developed-by: Andrei Vagin Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- arch/x86/entry/vdso/vdso2c.h | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/x86/entry/vdso/vdso2c.h b/arch/x86/entry/vdso/vdso2c.h index a20b134de2a8..80be339

[PATCHv4 13/28] x86/vdso: Restrict splitting VVAR VMA

2019-06-12 Thread Dmitry Safonov
this patch can be easily reverted. Co-developed-by: Andrei Vagin Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- arch/x86/entry/vdso/vma.c | 13 + 1 file changed, 13 insertions(+) diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c index 8db1f59

[PATCHv4 04/28] timens: Introduce CLOCK_MONOTONIC offsets

2019-06-12 Thread Dmitry Safonov
From: Andrei Vagin Add monotonic time virtualisation for time namespace. Introduce timespec for monotionic clock into timens offsets and wire clock_gettime() syscall. Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- include/linux/time_namespace.h

Re: [RFC] printk/sysrq: Don't play with console_loglevel

2019-06-12 Thread Dmitry Safonov
On 6/12/19 1:00 PM, Petr Mladek wrote: > On Wed 2019-06-12 17:36:43, Sergey Senozhatsky wrote: >> On (06/06/19 09:10), Petr Mladek wrote: >>> Just to be sure. I wanted to say that I like the idea with >>> KERN_UNSUPRESSED. So, I think that we are on the same page. >> >> I understand. All I wanted t

[PATCH] x86/hyperv: Disable preemption while setting reenlightenment vector

2019-06-11 Thread Dmitry Safonov
p...@vger.kernel.org Cc: x...@kernel.org Reported-by: Prasanna Panchamukhi Signed-off-by: Dmitry Safonov --- arch/x86/hyperv/hv_init.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c index 1608050e9df9..0bdd79ecbff

Re: [RFC] printk/sysrq: Don't play with console_loglevel

2019-05-28 Thread Dmitry Safonov
Hi guys, I see that the thread is ongoing and you understand printk code much better than me or probably anybody :) So, feel free to reuse it. Or I can send v1 with split sysrq/printk parts if you think it's worth being shaped further. I think worth to mention three "features" that you might had

[RFC] printk/sysrq: Don't play with console_loglevel

2019-05-27 Thread Dmitry Safonov
print the headers unsuppressed instead of changing console_loglevel. Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: Petr Mladek Cc: Sergey Senozhatsky Cc: Steven Rostedt Cc: Tetsuo Handa Signed-off-by: Dmitry Safonov --- (I'm not fond at all of this patch - sending as RFC just to touch how you

Re: [PATCHv3 15/27] x86/vdso: Allocate timens vdso

2019-04-25 Thread Dmitry Safonov
On 4/25/19 7:32 PM, Jann Horn wrote: > On Thu, Apr 25, 2019 at 6:14 PM Dmitry Safonov wrote: >> >> As it has been discussed on timens RFC, adding a new conditional branch >> `if (inside_time_ns)` on VDSO for all processes is undesirable. >> It will add a penalty for ev

Re: [PATCHv3 12/27] x86/vdso: Restrict splitting VVAR VMA

2019-04-25 Thread Dmitry Safonov
On 4/25/19 7:41 PM, Jann Horn wrote: > On Thu, Apr 25, 2019 at 6:17 PM Dmitry Safonov wrote: >> Although, time namespace can work with VVAR VMA split, it seems worth >> to forbid splitting VVAR resulting in stricter ABI and reducing amount >> of corner-cases to consider

Re: [PATCHv3 16/27] x86/vdso: Switch image on setns()/unshare()/clone()

2019-04-25 Thread Dmitry Safonov
On 4/25/19 6:53 PM, Jann Horn wrote: > On Thu, Apr 25, 2019 at 6:15 PM Dmitry Safonov wrote: >> As it has been discussed on timens RFC, adding a new conditional branch >> `if (inside_time_ns)` on VDSO for all processes is undesirable. >> It will add a penalty for everybody as

[PATCHv3 03/27] timens: Introduce CLOCK_MONOTONIC offsets

2019-04-25 Thread Dmitry Safonov
From: Andrei Vagin Add monotonic time virtualisation for time namespace. Introduce timespec for monotionic clock into timens offsets and wire clock_gettime() syscall. Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- include/linux/time_namespace.h

[PATCHv3 08/27] timens: Shift /proc/uptime

2019-04-25 Thread Dmitry Safonov
Respect boottime inside time namespace for /proc/uptime Signed-off-by: Dmitry Safonov --- fs/proc/uptime.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/proc/uptime.c b/fs/proc/uptime.c index a4c2791ab70b..5a1b228964fb 100644 --- a/fs/proc/uptime.c +++ b/fs/proc/uptime.c @@ -5,6

[PATCHv3 05/27] timerfd/timens: Take into account ns clock offsets

2019-04-25 Thread Dmitry Safonov
From: Andrei Vagin Make timerfd respect timens offsets. Provide a helper timens_ktime_to_host() that is useful to wire up timens to different kernel subsystems. Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- fs/timerfd.c | 8

[PATCHv3 06/27] posix-timers/timens: Take into account clock offsets

2019-04-25 Thread Dmitry Safonov
From: Andrei Vagin Wire timer_settime() syscall into time namespace virtualization. Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- kernel/time/alarmtimer.c | 3 +++ kernel/time/posix-timers.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/kernel/time/alarmtimer.c b

[PATCHv3 07/27] timens/kernel: Take into account timens clock offsets in clock_nanosleep

2019-04-25 Thread Dmitry Safonov
From: Andrei Vagin Wire up clock_nanosleep() to timens offsets. Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- kernel/time/alarmtimer.c | 2 ++ kernel/time/posix-stubs.c | 8 kernel/time/posix-timers.c | 12 ++-- 3 files changed, 16 insertions(+), 6

[PATCHv3 10/27] x86/vdso2c: Convert iterator to unsigned

2019-04-25 Thread Dmitry Safonov
space. Signed-off-by: Dmitry Safonov --- arch/x86/entry/vdso/vdso2c.h | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/x86/entry/vdso/vdso2c.h b/arch/x86/entry/vdso/vdso2c.h index fa847a620f40..61c8bb2e5af8 100644 --- a/arch/x86/entry/vdso/vdso2c.h +++ b/arch/x86/

[PATCHv3 12/27] x86/vdso: Restrict splitting VVAR VMA

2019-04-25 Thread Dmitry Safonov
this patch can be easily reverted. Signed-off-by: Dmitry Safonov --- arch/x86/entry/vdso/vma.c | 13 + 1 file changed, 13 insertions(+) diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c index babc4e7a519c..ff9875a4d53b 100644 --- a/arch/x86/entry/vdso/vma.c +++ b/arc

[PATCHv3 14/27] x86/vdso: Add offsets page in vvar

2019-04-25 Thread Dmitry Safonov
, add Kconfig dependency for arch. Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- arch/Kconfig | 5 arch/x86/Kconfig | 1 + arch/x86/entry/vdso/vclock_gettime.c | 43 +++ arc

[PATCHv3 17/27] vdso: introduce timens_static_branch

2019-04-25 Thread Dmitry Safonov
alternative approach has being considered: to omit no-ops - memcpy() the following asm ret sequience on the place of a function call: https://github.com/0x7f454c46/linux/commit/4cc0180f6d65 Having in mind possible issues with different toolchains, the usual static_branch() approach was choosen. Cc: D

[PATCHv3 13/27] x86/vdso: Rename vdso_image {.data=>.text}

2019-04-25 Thread Dmitry Safonov
To avoid any confusion with VVAR. Signed-off-by: Dmitry Safonov --- arch/x86/entry/vdso/vdso2c.h | 2 +- arch/x86/entry/vdso/vma.c| 6 +++--- arch/x86/include/asm/vdso.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/x86/entry/vdso/vdso2c.h b/arch/x86/entry

[PATCHv3 15/27] x86/vdso: Allocate timens vdso

2019-04-25 Thread Dmitry Safonov
. Signed-off-by: Dmitry Safonov --- arch/x86/entry/vdso/vdso2c.h | 2 +- arch/x86/entry/vdso/vma.c| 36 +++- arch/x86/include/asm/vdso.h | 9 + 3 files changed, 37 insertions(+), 10 deletions(-) diff --git a/arch/x86/entry/vdso/vdso2c.h b/arch/x86

[PATCHv3 21/27] selftest/timens: Add a test for timerfd

2019-04-25 Thread Dmitry Safonov
From: Andrei Vagin Check that timerfd_create() takes into account clock offsets. Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- tools/testing/selftests/timens/.gitignore | 1 + tools/testing/selftests/timens/Makefile | 2 +- tools/testing/selftests/timens/timerfd.c

[PATCHv3 19/27] timens/fs/proc: Introduce /proc/pid/timens_offsets

2019-04-25 Thread Dmitry Safonov
From: Andrei Vagin API to set time namespace offsets for children processes, i.e.: echo "clockid off_ses off_nsec" > /proc/self/timens_offsets Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- fs/proc/base.c | 101 +

[PATCHv3 27/27] selftest/timens: Check that a right vdso is mapped after fork and exec

2019-04-25 Thread Dmitry Safonov
From: Andrei Vagin Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- tools/testing/selftests/timens/.gitignore | 1 + tools/testing/selftests/timens/Makefile | 2 +- tools/testing/selftests/timens/exec.c | 91 +++ 3 files changed, 93 insertions(+), 1

[PATCHv3 25/27] x86/vdso: Align VDSO functions by CPU L1 cache line

2019-04-25 Thread Dmitry Safonov
CPU @ 2.40GHz Co-developed-by: Dmitry Safonov Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- arch/x86/entry/vdso/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile index bc0bdbf49397..9b45aafdfcfe 100644 --- a

[PATCHv3 22/27] selftest/timens: Add a test for clock_nanosleep()

2019-04-25 Thread Dmitry Safonov
From: Andrei Vagin Check that clock_nanosleep() takes into account clock offsets. Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- tools/testing/selftests/timens/.gitignore | 1 + tools/testing/selftests/timens/Makefile | 2 +- .../selftests/timens

[PATCHv3 24/27] selftest/timens: Add timer offsets test

2019-04-25 Thread Dmitry Safonov
From: Andrei Vagin Check that timer_create() takes into account clock offsets. Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- tools/testing/selftests/timens/.gitignore | 1 + tools/testing/selftests/timens/Makefile | 3 +- tools/testing/selftests/timens/timer.c| 116

[PATCHv3 23/27] selftest/timens: Add procfs selftest

2019-04-25 Thread Dmitry Safonov
Check that /proc/uptime is correct inside a new time namespace. Co-developed-by: Andrei Vagin Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- tools/testing/selftests/timens/.gitignore | 1 + tools/testing/selftests/timens/Makefile | 2 +- tools/testing/selftests/timens

[PATCHv3 18/27] timens: Add align for timens_offsets

2019-04-25 Thread Dmitry Safonov
Align offsets so that time namespace will work for ia32 applications on x86_64 host. Signed-off-by: Dmitry Safonov --- include/linux/timens_offsets.h | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/linux/timens_offsets.h b/include/linux/timens_offsets.h

[PATCHv3 20/27] selftest/timens: Add Time Namespace test for supported clocks

2019-04-25 Thread Dmitry Safonov
Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- tools/testing/selftests/Makefile | 1 + tools/testing/selftests/timens/.gitignore | 1 + tools/testing/selftests/timens/Makefile | 5 + tools/testing/selftests/timens/config | 1 + tools/testing/selftests/timens

[PATCHv3 26/27] selftests: Add a simple perf test for clock_gettime()

2019-04-25 Thread Dmitry Safonov
From: Andrei Vagin Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- tools/testing/selftests/timens/.gitignore | 2 + tools/testing/selftests/timens/Makefile | 8 +- tools/testing/selftests/timens/gettime_perf.c | 74 +++ .../selftests/timens

[PATCHv3 16/27] x86/vdso: Switch image on setns()/unshare()/clone()

2019-04-25 Thread Dmitry Safonov
Signed-off-by: Dmitry Safonov --- arch/x86/entry/vdso/vma.c | 29 + arch/x86/include/asm/vdso.h | 1 + kernel/time_namespace.c | 11 +++ 3 files changed, 41 insertions(+) diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c index 6a

[PATCHv3 11/27] x86/vdso/Makefile: Add vobjs32

2019-04-25 Thread Dmitry Safonov
Treat ia32/i386 objects in array the same As for 64-bit vdso objects. This is a preparation ground to avoid code duplication on introduction timens vdso. Signed-off-by: Dmitry Safonov --- arch/x86/entry/vdso/Makefile | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff

[PATCHv3 09/27] x86/vdso2c: Correct err messages on file opening

2019-04-25 Thread Dmitry Safonov
err() message in main() is misleading: it should print `outfilename`, which is argv[3], not argv[2]. Correct error messages to be more precise about what failed and for which file. Signed-off-by: Dmitry Safonov --- arch/x86/entry/vdso/vdso2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCHv3 00/27] kernel: Introduce Time Namespace

2019-04-25 Thread Dmitry Safonov
d on Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz. Cc: Adrian Reber Cc: Andrei Vagin Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Christian Brauner Cc: Cyrill Gorcunov Cc: Dmitry Safonov <0x7f454...@gmail.com> Cc: "Eric W. Biederman" Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc

[PATCHv3 04/27] timens: Introduce CLOCK_BOOTTIME offset

2019-04-25 Thread Dmitry Safonov
From: Andrei Vagin Adds boottime virtualisation for time namespace. Introduce timespec for boottime clock into timens offsets and wire clock_gettime() syscall. Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- include/linux/time_namespace.h | 9

[PATCHv3 02/27] timens: Add timens_offsets

2019-04-25 Thread Dmitry Safonov
From: Andrei Vagin Introduce offsets for time namespace. They will contain an adjustment needed to convert clocks to/from host's. Allocate one page for each time namespace that will be premapped into userspace among vvar pages. Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Sa

[PATCHv3 01/27] ns: Introduce Time Namespace

2019-04-25 Thread Dmitry Safonov
join a namespace. This scheme allows setting clock offsets for a namespace, before any processes appear in it. Link: https://criu.org/Time_namespace Link: https://lists.openvz.org/pipermail/criu/2018-June/041504.html Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: D

Re: [PATCH 3.16 23/99] tty/ldsem: Wake up readers after timed out down_write()

2019-04-02 Thread Dmitry Safonov
On 4/2/19 3:32 PM, Ben Hutchings wrote: > On Tue, 2019-04-02 at 15:22 +0100, Dmitry Safonov wrote: >> Hi Ben, >> >> JFI: I haven't checked your tree, but the same patches set contains fixes >> that are more important to my mind (looking at 4.9 stable tree): >>

Re: [PATCH 3.16 23/99] tty/ldsem: Wake up readers after timed out down_write()

2019-04-02 Thread Dmitry Safonov
already in your tree) Thanks, Dmitry On Tue, 2 Apr 2019 at 14:44, Ben Hutchings wrote: > > 3.16.65-rc1 review patch. If anyone has any objections, please let me know. > > -- > > From: Dmitry Safonov > > commit 231f8fd0cca078bd4396dd7e380db813ac5736e2 upst

Re: [RFC 1/4] net/ipv4/fib: Remove run-time check in tnode_alloc()

2019-04-01 Thread Dmitry Safonov
Hi Alexander, On 4/1/19 4:40 PM, Alexander Duyck wrote: >> @@ -333,8 +328,7 @@ static struct tnode *tnode_alloc(int bits) >> { >> size_t size; >> >> -/* verify bits is within bounds */ >> -if (bits > TNODE_VMALLOC_MAX) >> +if ((BITS_PER_LONG <= KEYLENGTH) && unlikely(bits >= BI

Re: [RFC 4/4] net/ipv4/fib: Don't synchronise_rcu() every 512Kb

2019-03-26 Thread Dmitry Safonov
On 3/26/19 3:39 PM, David Ahern wrote: > On 3/26/19 9:30 AM, Dmitry Safonov wrote: >> Fib trie has a hard-coded sync_pages limit to call synchronise_rcu(). >> The limit is 128 pages or 512Kb (considering common case with 4Kb >> pages). >> >> Unfortunately, at Arist

Re: [PATCH 3/4] iommu/vt-d: Allow IOMMU_DOMAIN_DMA and IOMMU_DOMAIN_IDENTITY to be allocated

2019-03-07 Thread Dmitry Safonov
On 3/4/19 3:46 PM, James Sewart wrote: > +static inline int domain_is_initialised(struct dmar_domain *domain) > +{ > + return domain->flags & DOMAIN_FLAG_INITIALISED; > +} Maybe check it in intel_iommu_domain_free(), eh? Thanks, Dmitry

Re: [PATCH] rtnetlink: Synchronze net in rtnl_unregister()

2019-02-25 Thread Dmitry Safonov
On 2/25/19 11:31 PM, Eric Dumazet wrote: > On 02/25/2019 03:21 PM, Dmitry Safonov wrote: >> Well, sure - but it seems confusing that rtnl_unregister() will require >> synchronize_rcu(), while rtnl_unregister_all() will not. > > rtnl_unregister_all() is a different beast,

Re: [PATCH] rtnetlink: Synchronze net in rtnl_unregister()

2019-02-25 Thread Dmitry Safonov
On 2/25/19 11:21 PM, Dmitry Safonov wrote: > Hi Eric, > > On 2/25/19 11:09 PM, Eric Dumazet wrote: >> On 02/25/2019 01:27 PM, Dmitry Safonov wrote: >>> While it's possible to document that rtnl_unregister() requires >>> synchronize_net() afterwards - u

Re: [PATCH] rtnetlink: Synchronze net in rtnl_unregister()

2019-02-25 Thread Dmitry Safonov
Hi Eric, On 2/25/19 11:09 PM, Eric Dumazet wrote: > On 02/25/2019 01:27 PM, Dmitry Safonov wrote: >> While it's possible to document that rtnl_unregister() requires >> synchronize_net() afterwards - unlike rtnl_unregister_all(), I believe >> the module e

[PATCH] rtnetlink: Synchronze net in rtnl_unregister()

2019-02-25 Thread Dmitry Safonov
Fixes: 6853dd488119 ("rtnetlink: protect handler table with rcu") Cc: "David S. Miller" Cc: Florian Westphal Cc: "Hannes Frederic Sowa" Cc: net...@vger.kernel.org Signed-off-by: Dmitry Safonov --- net/core/rtnetlink.c | 4 +++- 1 file changed, 3 insertions(+), 1 de

Re: [PATCH 16/32] x86/vdso: Generate vdso{,32}-timens.lds

2019-02-08 Thread Dmitry Safonov
On 2/8/19 9:57 AM, Thomas Gleixner wrote: > On Thu, 7 Feb 2019, Rasmus Villemoes wrote: > > Cc: + Vincenzo, Will > >> On 06/02/2019 01.10, Dmitry Safonov wrote: >>> As it has been discussed on timens RFC, adding a new conditional branch >>> `if (inside_ti

Re: [PATCH 16/32] x86/vdso: Generate vdso{,32}-timens.lds

2019-02-07 Thread Dmitry Safonov
Hi Rasmus, On 2/7/19 8:31 AM, Rasmus Villemoes wrote: > These (14-19, if I'm reading them right) seems to add quite a lot of > complexity and fragility to the build, and other architectures would > probably have to add something similar to their vdso builds. > > I'm wondering why not make the rul

[PATCH 03/32] timens: Introduce CLOCK_MONOTONIC offsets

2019-02-05 Thread Dmitry Safonov
From: Andrei Vagin Add monotonic time virtualisation for time namespace. Introduce timespec for monotionic clock into timens offsets and wire clock_gettime() syscall. Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- include/linux/time_namespace.h

[PATCH 06/32] posix-timers/timens: Take into account clock offsets

2019-02-05 Thread Dmitry Safonov
From: Andrei Vagin Wire timer_settime() syscall into time namespace virtualization. Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- kernel/time/posix-timers.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/kernel/time/posix-timers.c b/kernel

[PATCH 08/32] timens: Shift /proc/uptime

2019-02-05 Thread Dmitry Safonov
Respect boottime inside time namespace for /proc/uptime Signed-off-by: Dmitry Safonov --- fs/proc/uptime.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/proc/uptime.c b/fs/proc/uptime.c index a4c2791ab70b..4421ec058472 100644 --- a/fs/proc/uptime.c +++ b/fs/proc/uptime.c @@ -5,6

[PATCH 05/32] timerfd/timens: Take into account ns clock offsets

2019-02-05 Thread Dmitry Safonov
Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- fs/timerfd.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/fs/timerfd.c b/fs/timerfd.c index 803ca070d42e..c7ae1e371912 100644 --- a/fs/timerfd.c +++ b/fs/timerfd.c @@ -26,6 +26,7

[PATCH 02/32] timens: Add timens_offsets

2019-02-05 Thread Dmitry Safonov
From: Andrei Vagin Introduce offsets for time namespace. They will contain an adjustment needed to convert clocks to/from host's. Allocate one page for each time namespace that will be premapped into userspace among vvar pages. Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Sa

[PATCH 09/32] x86/vdso2c: Correct err messages on file opening

2019-02-05 Thread Dmitry Safonov
err() message in main() is misleading: it should print `outfilename`, which is argv[3], not argv[2]. Correct error messages to be more precise about what failed and for which file. Signed-off-by: Dmitry Safonov --- arch/x86/entry/vdso/vdso2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH 01/32] ns: Introduce Time Namespace

2019-02-05 Thread Dmitry Safonov
join a namespace. This scheme allows setting clock offsets for a namespace, before any processes appear in it. Link: https://criu.org/Time_namespace Link: https://lists.openvz.org/pipermail/criu/2018-June/041504.html Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: D

[PATCH 14/32] x86/VDSO: Build VDSO with -ffunction-sections

2019-02-05 Thread Dmitry Safonov
with -ffunction-sections so that VDSO entries can be aligned on the same addresses with linker script magic. Put ia32 functions those are written in assembly into corresponding sections. Signed-off-by: Dmitry Safonov --- arch/x86/entry/vdso/Makefile | 2 +- arch/x86/entry/vdso/vds

[PATCH 15/32] x86/vdso2c: Optionally produce linker script for vdso entries

2019-02-05 Thread Dmitry Safonov
bigger in .text than VDSO for tasks outside namespace, this parameter will be used to generate .entries file from timens VDSO and include those aligns into linker script for !timens VDSO building. Signed-off-by: Dmitry Safonov --- arch/x86/entry/vdso/.gitignore | 1 + arch/x86/entry/vdso/Makefile

[PATCH 13/32] x86/vdso: Build timens .so(s)

2019-02-05 Thread Dmitry Safonov
. Suggested-by: Andy Lutomirski Suggested-by: Thomas Gleixner Signed-off-by: Dmitry Safonov --- arch/x86/entry/vdso/Makefile | 28 +-- arch/x86/entry/vdso/vclock_gettime-timens.c | 6 .../entry/vdso/vdso32/vclock_gettime-timens.c | 6 3 files changed

[PATCH 07/32] timens/kernel: Take into account timens clock offsets in clock_nanosleep

2019-02-05 Thread Dmitry Safonov
From: Andrei Vagin Wire up clock_nanosleep() to timens offsets. Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- kernel/time/hrtimer.c | 8 1 file changed, 8 insertions(+) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index f5cfa1b73d6f..47345aea406d

[PATCH 10/32] x86/vdso2c: Convert iterator to unsigned

2019-02-05 Thread Dmitry Safonov
space. Signed-off-by: Dmitry Safonov --- arch/x86/entry/vdso/vdso2c.h | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/x86/entry/vdso/vdso2c.h b/arch/x86/entry/vdso/vdso2c.h index fa847a620f40..61c8bb2e5af8 100644 --- a/arch/x86/entry/vdso/vdso2c.h +++ b/arch/x86/

[PATCH 12/32] x86/vdso/timens: Add offsets page in vvar

2019-02-05 Thread Dmitry Safonov
ed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- arch/Kconfig | 5 arch/x86/Kconfig | 1 + arch/x86/entry/vdso/vclock_gettime.c | 42 +++ arch/x86/entry/vdso/vdso-layout.lds.S | 9 +- arch/x86/entry/vdso/vds

[PATCH 20/32] x86/vdso: Initialize timens 64-bit vdso

2019-02-05 Thread Dmitry Safonov
Initialize both 64-bit VDSO(s): host .so and timens one that has code for adding timens offsets. Signed-off-by: Dmitry Safonov --- arch/x86/entry/vdso/vma.c | 4 arch/x86/include/asm/vdso.h | 6 ++ 2 files changed, 10 insertions(+) diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86

[PATCH 18/32] x86/vdso.lds: Align !timens (host's) vdso.so entries

2019-02-05 Thread Dmitry Safonov
s for host with addresses generated from timens VDSO (which is bigger as it has code for adding offsets). Signed-off-by: Dmitry Safonov --- arch/x86/entry/vdso/vdso-layout.lds.S | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/x86/entry/vdso/vdso-layout.lds.S b

[PATCH 25/32] selftest/timens: Add a test for timerfd

2019-02-05 Thread Dmitry Safonov
From: Andrei Vagin Check that timerfd_create() takes into account clock offsets. Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- tools/testing/selftests/timens/.gitignore | 1 + tools/testing/selftests/timens/Makefile | 2 +- tools/testing/selftests/timens/timerfd.c

[PATCH 16/32] x86/vdso: Generate vdso{,32}-timens.lds

2019-02-05 Thread Dmitry Safonov
Signed-off-by: Dmitry Safonov --- arch/x86/entry/vdso/.gitignore | 1 + arch/x86/entry/vdso/Makefile | 18 ++ arch/x86/entry/vdso/vdso-timens.lds.S | 7 +++ arch/x86/entry/vdso/vdso32/.gitignore | 1 + arch/x86/entry/vds

[PATCH 17/32] x86/vdso2c: Sort vdso entries by addresses for linker script

2019-02-05 Thread Dmitry Safonov
magic to fit with entries from timens) To adjust entries on host vdso, *.lds includes *.entries. Those are generated by vdso2c while parsing timens vdso. Linker doesn't allow going back on some addresses, so sort entries to timens VDSO before writing them to .entries file. Signed-off-by: D

[PATCH 23/32] timens/fs/proc: Introduce /proc/pid/timens_offsets

2019-02-05 Thread Dmitry Safonov
From: Andrei Vagin API to set time namespace offsets for children processes, i.e.: echo "clockid off_ses off_nsec" > /proc/self/timens_offsets Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- fs/proc/base.c | 101 +

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