[PATCH v3 2/7] xfrm/compat: Add 64=>32-bit messages translator

2020-09-21 Thread Dmitry Safonov
an ABI difference) Kernel sends 64-bit xfrm messages to the userspace for: - multicast (monitor events) - netlink dumps Wire up the translator to xfrm_nlmsg_multicast(). Signed-off-by: Dmitry Safonov --- include/net/xfrm.h | 5 + net/xfrm/xfrm_compat.c | 296

[PATCH v3 7/7] selftest/net/xfrm: Add test for ipsec tunnel

2020-09-21 Thread Dmitry Safonov
| | | | The parent sends the description of a test (xfrm parameters) to the child, the child and grand child setup a tunnel over veth interface and test it by sending udp packets. Cc: Shuah Khan Cc: linux-kselft...@vger.kernel.org Signed-off-by: Dmitry Safonov --- MAINTAINERS

Re: [PATCH v2 1/6] xfrm/compat: Add 64=>32-bit messages translator

2020-09-07 Thread Dmitry Safonov
On 9/7/20 12:24 PM, Steffen Klassert wrote: [..] > One comment on this. Looks like the above is the same in all > commit messages. Please provide that generic information > with the patch 0/n and remove it from the other patches. Yeah, I think I've used to that from x86/core submissions - they

Re: [PATCH v2 0/6] xfrm: Add compat layer

2020-09-07 Thread Dmitry Safonov
On 9/7/20 10:43 AM, Steffen Klassert wrote: > On Wed, Aug 26, 2020 at 02:49:43AM +0100, Dmitry Safonov wrote: [..] > > Thanks for the patches, looks good! > > Please fix the issue reported from 'kernel test robot' and resend. Thanks, will do! -- Dmitry

Re: [PATCH v2 3/6] netlink/compat: Append NLMSG_DONE/extack to frag_list

2020-09-07 Thread Dmitry Safonov
On 8/26/20 8:19 AM, Johannes Berg wrote: > On Wed, 2020-08-26 at 02:49 +0100, Dmitry Safonov wrote: [..] >> +nl_dump_check_consistent(cb, nlh); >> +memcpy(nlmsg_data(nlh), >dump_done_errno, >> +sizeof(nlk->dump_done_errno)); > >

Re: [PATCH v8 2/8] powerpc/vdso: Remove __kernel_datapage_offset and simplify __get_datapage()

2020-08-27 Thread Dmitry Safonov
Hello, On Wed, 26 Aug 2020 at 15:39, Michael Ellerman wrote: > Christophe Leroy writes: [..] > > arch_remap() gets replaced by vdso_remap() > > > > For arch_unmap(), I'm wondering how/what other architectures do, because > > powerpc seems to be the only one to erase the vdso context pointer

[PATCH v2 0/6] xfrm: Add compat layer

2020-08-25 Thread Dmitry Safonov
Xu Cc: Jakub Kicinski Cc: Steffen Klassert Cc: Stephen Suryaputra Cc: Dmitry Safonov <0x7f454...@gmail.com> Cc: net...@vger.kernel.org Dmitry Safonov (6): xfrm/compat: Add 64=>32-bit messages translator xfrm/compat: Attach xfrm dumps to 64=>32 bit translator netlink/compat: App

[PATCH v2 4/6] xfrm/compat: Add 32=>64-bit messages translator

2020-08-25 Thread Dmitry Safonov
https://lkml.kernel.org/r/20180726023144.31066-1-d...@arista.com Signed-off-by: Dmitry Safonov --- include/net/xfrm.h | 11 ++ net/xfrm/Kconfig | 3 +- net/xfrm/xfrm_compat.c | 276 + net/xfrm/xfrm_user.c | 50 +--- 4 files changed, 321 i

[PATCH v2 1/6] xfrm/compat: Add 64=>32-bit messages translator

2020-08-25 Thread Dmitry Safonov
44.31066-1-d...@arista.com Signed-off-by: Dmitry Safonov --- include/net/xfrm.h | 10 ++ net/xfrm/Kconfig | 10 ++ net/xfrm/Makefile | 1 + net/xfrm/xfrm_compat.c | 302 + net/xfrm/xfrm_user.c | 9 +- 5 files changed, 331 insertions(+),

[PATCH v2 5/6] xfrm/compat: Translate 32-bit user_policy from sockptr

2020-08-25 Thread Dmitry Safonov
In these patches, his idea is reused and some of his initial code is also present. Provide compat_xfrm_userpolicy_info translation for xfrm setsocketopt(). Reallocate buffer and put the missing padding for 64-bit message. [1]: https://lkml.kernel.org/r/20180726023144.31066-1-d...@arista.com Sig

[PATCH v2 3/6] netlink/compat: Append NLMSG_DONE/extack to frag_list

2020-08-25 Thread Dmitry Safonov
will retrieve all netlink dump data, but will then get an unexpected EOF. Cc: Johannes Berg Signed-off-by: Florian Westphal Signed-off-by: Dmitry Safonov --- net/netlink/af_netlink.c | 48 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/net/netlink

[PATCH v2 2/6] xfrm/compat: Attach xfrm dumps to 64=>32 bit translator

2020-08-25 Thread Dmitry Safonov
r/20180726023144.31066-1-d...@arista.com Signed-off-by: Dmitry Safonov --- include/net/xfrm.h | 6 ++ net/xfrm/xfrm_compat.c | 10 -- net/xfrm/xfrm_user.c | 20 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/include/net/xfrm.h b/include/net

[PATCH v2 6/6] selftest/net/xfrm: Add test for ipsec tunnel

2020-08-25 Thread Dmitry Safonov
| | | | The parent sends the description of a test (xfrm parameters) to the child, the child and grand child setup a tunnel over veth interface and test it by sending udp packets. Cc: Shuah Khan Cc: linux-kselft...@vger.kernel.org Signed-off-by: Dmitry Safonov --- MAINTAINERS

[tip: x86/core] x86/dumpstack: Add log_lvl to show_iret_regs()

2020-07-22 Thread tip-bot2 for Dmitry Safonov
The following commit has been merged into the x86/core branch of tip: Commit-ID: fd07f802a70935fbbfb9cc2d11e1d8ac95f28e44 Gitweb: https://git.kernel.org/tip/fd07f802a70935fbbfb9cc2d11e1d8ac95f28e44 Author:Dmitry Safonov AuthorDate:Mon, 29 Jun 2020 15:48:45 +01:00

[tip: x86/core] x86/dumpstack: Add log_lvl to __show_regs()

2020-07-22 Thread tip-bot2 for Dmitry Safonov
The following commit has been merged into the x86/core branch of tip: Commit-ID: 44e215352cf17333992d56941b5bf4af60a67609 Gitweb: https://git.kernel.org/tip/44e215352cf17333992d56941b5bf4af60a67609 Author:Dmitry Safonov AuthorDate:Mon, 29 Jun 2020 15:48:46 +01:00

[tip: x86/core] x86/dumpstack: Show registers dump with trace's log level

2020-07-22 Thread tip-bot2 for Dmitry Safonov
The following commit has been merged into the x86/core branch of tip: Commit-ID: ef2ff0f5d6008d325c9a068e20981c0d0acc4d6b Gitweb: https://git.kernel.org/tip/ef2ff0f5d6008d325c9a068e20981c0d0acc4d6b Author:Dmitry Safonov AuthorDate:Mon, 29 Jun 2020 15:48:47 +01:00

Re: [PATCH v2 0/3] x86/dumpstack: Print registers with the same log level as the backtrace

2020-07-20 Thread Dmitry Safonov
Hi Ingo, Thomas, Could you take these to x86/tip tree? (in case they are good enough) On 6/29/20 3:48 PM, Dmitry Safonov wrote: > Changes since v1 [3]: > - Use (enum show_regs_mode) instead of (int) [nit by Jann, thanks!] > - Add acks from Petr > > show_trace_log_lvl() provid

[PATCH v2 3/3] x86/dumpstack: Show registers dump with trace's log level

2020-06-29 Thread Dmitry Safonov
...@arista.com/ Acked-by: Petr Mladek Signed-off-by: Dmitry Safonov --- arch/x86/kernel/dumpstack.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index 4954d6678cef..f9a3526af15d 100644 --- a/arch/x86/kernel

[PATCH v2 1/3] x86/dumpstack: Add log_lvl to show_iret_regs()

2020-06-29 Thread Dmitry Safonov
parameter to show_iret_regs() as a preparation to add it to __show_regs() and show_regs_if_on_stack(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-d...@arista.com/ [2]: https://lore.kernel.org/linux-doc/20190724170249.9644-1-d...@arista.com/ Acked-by: Petr Mladek Signed-off-by: Dmitry

[PATCH v2 0/3] x86/dumpstack: Print registers with the same log level as the backtrace

2020-06-29 Thread Dmitry Safonov
Handa Cc: Thomas Gleixner Cc: x...@kernel.org [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-d...@arista.com/ [2]: https://lore.kernel.org/linux-doc/20190724170249.9644-1-d...@arista.com/ [3]: https://lore.kernel.org/lkml/20200623162958.331051-1-d...@arista.com/ Dmitry Safonov (3): x86

[PATCH v2 2/3] x86/dumpstack: Add log_lvl to __show_regs()

2020-06-29 Thread Dmitry Safonov
parameter to __show_regs(). Keep the used log level intact to separate visible change. [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-d...@arista.com/ [2]: https://lore.kernel.org/linux-doc/20190724170249.9644-1-d...@arista.com/ Acked-by: Petr Mladek Signed-off-by: Dmitry Safonov

Re: [PATCH 2/3] x86/dumpstack: Add log_lvl to __show_regs()

2020-06-25 Thread Dmitry Safonov
On 6/23/20 5:45 PM, Jann Horn wrote: > On Tue, Jun 23, 2020 at 6:30 PM Dmitry Safonov wrote: >> show_trace_log_lvl() provides x86 platform-specific way to unwind >> backtrace with a given log level. Unfortunately, registers dump(s) are >> not printed with the sam

Re: [PATCH 0/3] x86/dumpstack: Print registers with the same log level as the backtrace

2020-06-25 Thread Dmitry Safonov
On 6/24/20 7:50 AM, Petr Mladek wrote: > On Tue 2020-06-23 17:29:55, Dmitry Safonov wrote: >> show_trace_log_lvl() provides x86 platform-specific way to unwind >> backtrace with a given log level. Unfortunately, registers dump(s) are >> not printed with the same log level -

[PATCH 3/3] x86/dumpstack: Show registers dump with trace's log level

2020-06-23 Thread Dmitry Safonov
...@arista.com/ Signed-off-by: Dmitry Safonov --- arch/x86/kernel/dumpstack.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index ec90d71979f4..6b00964d5873 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86

[PATCH 0/3] x86/dumpstack: Print registers with the same log level as the backtrace

2020-06-23 Thread Dmitry Safonov
ta.com/ [2]: https://lore.kernel.org/linux-doc/20190724170249.9644-1-d...@arista.com/ Dmitry Safonov (3): x86/dumpstack: Add log_lvl to show_iret_regs() x86/dumpstack: Add log_lvl to __show_regs() x86/dumpstack: Show registers dump with trace's log level arch/x86/include/asm/kdebug.h | 5

[PATCH 2/3] x86/dumpstack: Add log_lvl to __show_regs()

2020-06-23 Thread Dmitry Safonov
parameter to __show_regs(). Keep the used log level intact to separate visible change. [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-d...@arista.com/ [2]: https://lore.kernel.org/linux-doc/20190724170249.9644-1-d...@arista.com/ Signed-off-by: Dmitry Safonov --- arch/x86/include/asm

[PATCH 1/3] x86/dumpstack: Add log_lvl to show_iret_regs()

2020-06-23 Thread Dmitry Safonov
parameter to show_iret_regs() as a preparation to add it to __show_regs() and show_regs_if_on_stack(). [1]: https://lore.kernel.org/lkml/20190528002412.1625-1-d...@arista.com/ [2]: https://lore.kernel.org/linux-doc/20190724170249.9644-1-d...@arista.com/ Signed-off-by: Dmitry Safonov --- arch/x86

Re: [PATCH 2/6] arm64/vdso: Zap vvar pages when switching to a time namespace

2020-06-16 Thread Dmitry Safonov
Hi Mark, On 6/16/20 12:24 PM, Mark Rutland wrote: > On Tue, Jun 16, 2020 at 12:55:41AM -0700, Andrei Vagin wrote: [..] >> Whenever a task changes its namespace, the VVAR >> page tables are cleared and then they will be re-faulted with a >> corresponding layout. > > How does this work for

Re: [PATCH v2 3/3] serial: core: drop redundant sysrq checks

2020-06-12 Thread Dmitry Safonov
-by: Johan Hovold Reviewed-by: Dmitry Safonov <0x7f454...@gmail.com> Thanks, Dmitry

Re: [PATCH v2 2/3] serial: core: fix sysrq overhead regression

2020-06-12 Thread Dmitry Safonov
ot;serial_core: Move sysrq functions from header file") > Cc: Dmitry Safonov <0x7f454...@gmail.com> > Signed-off-by: Johan Hovold Thanks for sending and the numbers, it's a bit pity that we need to move them back to the header, but as it matters for your setup, Reviewed-by: Dmitry Safonov <0x7f454...@gmail.com> Thanks, Dmitry

Re: [PATCH v2 2/3] serial: core: fix sysrq overhead regression

2020-06-12 Thread Dmitry Safonov
On 6/12/20 4:29 PM, Johan Hovold wrote: > On Wed, Jun 10, 2020 at 05:24:57PM +0100, Dmitry Safonov wrote: >> Hi Johan, >> >> On 6/10/20 4:22 PM, Johan Hovold wrote: >>> Commit 8e20fc391711 ("serial_core: Move sysrq functions from header >>> file"

Re: vdso_join_timens() question

2020-06-11 Thread Dmitry Safonov
Hi Christian, On 6/11/20 12:02 PM, Christian Brauner wrote: > Hey, > > I'm about to finish a patch to add CLONE_NEWTIME support to setns(). > Since setns() now allows to attach to a multiple namespaces at the same > time I've also reworked it to be atomic (already upstream). Either all >

Re: [PATCH v2 2/3] serial: core: fix sysrq overhead regression

2020-06-10 Thread Dmitry Safonov
Hi Johan, On 6/10/20 4:22 PM, Johan Hovold wrote: > Commit 8e20fc391711 ("serial_core: Move sysrq functions from header > file") converted the inline sysrq helpers to exported functions which > are now called for every received character, interrupt and break signal > also on systems without

Re: [PATCH RESEND v3 0/6] arm64: add the time namespace support

2020-06-02 Thread Dmitry Safonov
t in __arch_get_timens_vdso_data. > > Reviewed-by: Vincenzo Frascino > Cc: Thomas Gleixner > Cc: Dmitry Safonov > > v3 on github (if someone prefers `git pull` to `git am`): > https://github.com/avagin/linux-task-diag/tree/arm64/timens-v3 Thanks for adding arm64 sup

Re: [PATCH 3/6] arm64/vdso: Add time namespace page

2020-06-02 Thread Dmitry Safonov
Hi Andrei, On 6/2/20 7:02 PM, Andrei Vagin wrote: [..] > --- a/arch/arm64/include/asm/vdso.h > +++ b/arch/arm64/include/asm/vdso.h > @@ -12,6 +12,12 @@ > */ > #define VDSO_LBASE 0x0 > > +#ifdef CONFIG_TIME_NS > +#define __VVAR_PAGES2 > +#else > +#define __VVAR_PAGES1 > +#endif > +

Re: [PATCH 2/4] serial: core: fix broken sysrq port unlock

2020-06-02 Thread Dmitry Safonov
On 6/2/20 3:48 PM, Andy Shevchenko wrote: > On Tue, Jun 2, 2020 at 5:03 PM Johan Hovold wrote: >> >> Commit d6e1935819db ("serial: core: Allow processing sysrq at port >> unlock time") worked around a circular locking dependency by adding >> helpers used to defer sysrq processing to when the port

Re: [PATCHv3 12/50] csky: Add show_stack_loglvl()

2020-05-18 Thread Dmitry Safonov
Hi Andrew, On 5/15/20 8:23 PM, Andrew Morton wrote: > On Sat, 18 Apr 2020 21:19:06 +0100 Dmitry Safonov wrote: > >> Currently, the log-level of show_stack() depends on a platform >> realization. It creates situations where the headers are printed with >> lower

Re: [PATCHv3 42/50] xtensa: Add loglvl to show_trace()

2020-05-11 Thread Dmitry Safonov
Hi Mike, On 5/11/20 8:45 PM, Mike Rapoport wrote: [..] >> @@ -511,7 +515,7 @@ void show_stack(struct task_struct *task, unsigned long >> *sp) >> print_hex_dump(KERN_INFO, " ", DUMP_PREFIX_NONE, >> STACK_DUMP_LINE_SIZE, STACK_DUMP_ENTRY_SIZE, >> sp,

Re: [PATCH -next RESEND] Documentation/admin-guide: fix sysctl Sphinx warning

2019-10-21 Thread Dmitry Safonov
= Thanks for the patch! I'm in process of reworking the patch in akpm according to reviews, I will incorporate your change in next version. > > Signed-off-by: Randy Dunlap > Cc: Dmitry Safonov > Cc: Andrew Morton > Cc: Ingo Molnar > --- > Documentation/admin-guide/

Re: [PATCHv7 01/33] ns: Introduce Time Namespace

2019-10-16 Thread Dmitry Safonov
On 10/16/19 11:44 AM, Vincenzo Frascino wrote: > On 10/16/19 11:39 AM, Thomas Gleixner wrote: [..] >> config TIME_NS >> bool "TIME namespace" >> depends on GENERIC_VDSO_TIME_NS >> default y >> >> and in lib/vdso/Kconfig >> >> config GENERIC_VDSO_TIME_NS >> bool >> >> and let

[PATCHv7 02/33] time: Add timens_offsets to be used for tasks in timens

2019-10-10 Thread Dmitry Safonov
From: Andrei Vagin Introduce offsets for time namespace. They will contain an adjustment needed to convert clocks to/from host's. A new namespace is created with the same offsets as the time namespace of the current process. Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed

[PATCHv7 11/33] timerfd: Make timerfd_settime() time namespace aware

2019-10-10 Thread Dmitry Safonov
From: Andrei Vagin timerfd_settime() accepts an absolute value of the expiration time if TFD_TIMER_ABSTIME is specified. This value is in task's time namespace and has to be converted to the host's time namespace. Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off

[PATCHv7 31/33] selftests/timens: Add timer offsets test

2019-10-10 Thread Dmitry Safonov
support of time namespaces: 1..3 not ok 1 # SKIP Time namespaces are not supported 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

[PATCHv7 07/33] posix-clocks: Introduce clock_get_ktime() callback

2019-10-10 Thread Dmitry Safonov
gested-by: Thomas Gleixner Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- kernel/time/alarmtimer.c | 19 ++- kernel/time/posix-timers.c | 26 +- kernel/time/posix-timers.h | 3 +++ 3 files changed, 46 insertions

[PATCHv7 18/33] lib/vdso: Add unlikely() hint into vdso_read_begin()

2019-10-10 Thread Dmitry Safonov
| 0.1 Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- include/vdso/helpers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/vdso/helpers.h b/include/vdso/helpers.h index 01641dbb68ef..9a2af9fca45e 100644 --- a/include

[PATCHv7 12/33] posix-timers: Make timer_settime() time namespace aware

2019-10-10 Thread Dmitry Safonov
ime and then timens_ktime_to_host() can be used to convert namespace's time to the host time. Inside a time namespace kernel's time differ on a fixed offset from a user-supplied, but only absolute values (TIMER_ABSTIME) must be converted. Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safo

[PATCHv7 20/33] x86/vdso: Provide vdso_data offset on vvar_page

2019-10-10 Thread Dmitry Safonov
e time namespace handling path. To prepare timens page kernel needs to know the vdso_data offset. Provide arch_get_vdso_data() helper for locating vdso_data on VVAR page. Co-developed-by: Andrei Vagin Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- arch/x86/entry/vdso/vdso-layout.lds.

[PATCHv7 15/33] posix-timers: Make clock_nanosleep() time namespace aware

2019-10-10 Thread Dmitry Safonov
From: Andrei Vagin clock_nanosleep() accepts absolute values of expiration time, if the TIMER_ABSTIME flag is set. This value is in the task time namespace, which has to be converted to the host time namespace. Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry

[PATCHv7 08/33] posix-timers: Use clock_get_ktime() in common_timer_get()

2019-10-10 Thread Dmitry Safonov
From: Andrei Vagin Now, when the clock_get_ktime() callback exists, the suboptimal timespec64-based conversion can be removed from common_timer_get(). Suggested-by: Thomas Gleixner Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- kernel/time

[PATCHv7 24/33] x86/vdso: On timens page fault prefault also VVAR page

2019-10-10 Thread Dmitry Safonov
As timens page has offsets to data on VVAR page VVAR is going to be accessed shortly. Set it up with timens in one page fault as optimization. Suggested-by: Thomas Gleixner Co-developed-by: Andrei Vagin Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- arch/x86/entry/vdso/vma.c

[PATCHv7 17/33] x86/vdso: Restrict splitting VVAR VMA

2019-10-10 Thread Dmitry Safonov
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 f5937742b290..000db8282cc8 100644 --- a/arch/x86/entry/vdso/vma.c +++ b/arch/x86

[PATCHv7 19/33] lib/vdso: Prepare for time namespace support

2019-10-10 Thread Dmitry Safonov
tional check for vdso_data->clock_mode is added which switches to the real vdso when the clock_mode is VCLOCK_TIMENS. Suggested-by: Andy Lutomirski Signed-off-by: Thomas Gleixner Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- include/linux/time.h| 6 ++ include/vdso/d

[PATCHv7 28/33] selftests/timens: Add a test for timerfd

2019-10-10 Thread Dmitry Safonov
not ok 3 clockid: 9 elapsed: 0 Bail out! Output with lack of permissions: 1..3 not ok 1 # SKIP need to run as root Output without support of time namespaces: 1..3 not ok 1 # SKIP Time namespaces are not supported Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off

[PATCHv7 25/33] x86/vdso: Zap vvar pages on switch a time namspace

2019-10-10 Thread Dmitry Safonov
-by: Dmitry Safonov --- arch/x86/entry/vdso/vma.c | 27 +++ include/linux/time_namespace.h | 3 +++ kernel/time/namespace.c| 10 ++ 3 files changed, 40 insertions(+) diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c index d6cb8a16f368

[PATCHv7 22/33] time: Allocate per-timens vvar page

2019-10-10 Thread Dmitry Safonov
Thomas Gleixner Co-developed-by: Andrei Vagin Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- include/linux/time_namespace.h | 3 + kernel/time/namespace.c| 103 - 2 files changed, 105 insertions(+), 1 deletion(-) diff --git a/include

[PATCHv7 29/33] selftests/timens: Add a test for clock_nanosleep()

2019-10-10 Thread Dmitry Safonov
support of time namespaces: 1..4 not ok 1 # SKIP Time namespaces are not supported 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 | 4

[PATCHv7 32/33] selftests/timens: Add a simple perf test for clock_gettime()

2019-10-10 Thread Dmitry Safonov
: monotonic cycles: 145671139 ok 2 host: clock: boottime cycles: 146958357 not ok 3 # SKIP Time namespaces are not supported Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- tools/testing/selftests/timens/.gitignore | 2

[PATCHv7 33/33] selftests/timens: Check for right timens offsets after fork and exec

2019-10-10 Thread Dmitry Safonov
# SKIP Time namespaces are not supported 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 | 94

[PATCHv7 30/33] selftests/timens: Add procfs selftest

2019-10-10 Thread Dmitry Safonov
not ok 1 # SKIP Time namespaces are not supported 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/procfs.c | 144

[PATCHv7 14/33] hrtimers: Prepare hrtimer_nanosleep() for time namespaces

2019-10-10 Thread Dmitry Safonov
argument. As a preparation, make hrtimer_nanosleep() accept a clock value in ktime instead of timespec64. Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- include/linux/hrtimer.h| 2 +- kernel/time/hrtimer.c | 8 kernel/time

[PATCHv7 06/33] alarmtimer: Provide get_timespec() callback

2019-10-10 Thread Dmitry Safonov
-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- include/linux/posix-timers.h | 3 +++ kernel/time/alarmtimer.c | 8 ++-- kernel/time/posix-timers.c | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/include/linux/posix-timers.h

[PATCHv7 10/33] kernel: Add do_timens_ktime_to_host() helper

2019-10-10 Thread Dmitry Safonov
From: Andrei Vagin The helper subtracts namespace's clock offset from the given time and checks that the result is in [0, KTIME_MAX]. Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- include/linux/time_namespace.h | 14 + kernel/time

[PATCHv7 13/33] alarmtimer: Make nanosleep time namespace aware

2019-10-10 Thread Dmitry Safonov
From: Andrei Vagin clock_nanosleep() accepts absolute values of expiration time when TIMER_ABSTIME flag is set. This absolute value is inside the task's time namespace, and has to be converted to the host's time. Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off

[PATCHv7 04/33] posix-clocks: Rename .clock_get_timespec() callbacks accordingly

2019-10-10 Thread Dmitry Safonov
-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- kernel/time/alarmtimer.c | 6 +++--- kernel/time/posix-timers.c | 16 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c index 8523df726fee..62b06cfa710d

[PATCHv7 26/33] fs/proc: Introduce /proc/pid/timens_offsets

2019-10-10 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

[PATCHv7 16/33] fs/proc: Respect boottime inside time namespace for /proc/uptime

2019-10-10 Thread Dmitry Safonov
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 100644 --- a/fs/proc/uptime.c +++ b/fs/proc/uptime.c @@ -5,6

[PATCHv7 21/33] x86/vdso: Add timens page

2019-10-10 Thread Dmitry Safonov
per for VDSO code to get the code-relative position of VVARs on that special page. Co-developed-by: Andrei Vagin Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- arch/x86/Kconfig | 1 + arch/x86/entry/vdso/vdso-layout.lds.S| 11 +-- arch/x8

[PATCHv7 09/33] posix-clocks: Wire up clock_gettime() with timens offsets

2019-10-10 Thread Dmitry Safonov
adjusted. Further changes complete time namespace virtualisation with vDSO support. Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- kernel/time/alarmtimer.c | 1 + kernel/time/posix-stubs.c | 3 +++ kernel/time/posix-timers.c | 5 + 3 files changed

[PATCHv7 27/33] selftests/timens: Add Time Namespace test for supported clocks

2019-10-10 Thread Dmitry Safonov
namespaces: 1..10 not ok 1 # SKIP Time namespaces are not supported Co-developed-by: Andrei Vagin 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

[PATCHv7 23/33] x86/vdso: Handle faults on timens page

2019-10-10 Thread Dmitry Safonov
If a task belongs to a time namespace then the VVAR page which contains the system wide VDSO data is replaced with a namespace specific page which has the same layout as the VVAR page. Co-developed-by: Andrei Vagin Signed-off-by: Andrei Vagin Signed-off-by: Dmitry Safonov --- arch/x86/entry

[PATCHv7 05/33] alarmtimer: Rename gettime() callback to get_ktime()

2019-10-10 Thread Dmitry Safonov
() callback into get_ktime() as a preparation for introducing get_timespec(). Suggested-by: Thomas Gleixner Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- kernel/time/alarmtimer.c | 34 +- 1 file changed, 17 insertions

[PATCHv7 03/33] posix-clocks: Rename the clock_get() callback to clock_get_timespec()

2019-10-10 Thread Dmitry Safonov
the time in ktime_t format, rather than in (struct timespec). Rename the clock_get() callback to clock_get_timespec() as a preparation for introducing clock_get_ktime(). Suggested-by: Thomas Gleixner Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov

[PATCHv7 00/33] kernel: Introduce Time Namespace

2019-10-10 Thread Dmitry Safonov
00.9| 102 | 112 vdsotest results: https://gist.github.com/avagin/f290afb8b721ae0522a561d585f34de0 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 Gorcuno

[PATCHv7 01/33] ns: Introduce Time Namespace

2019-10-10 Thread Dmitry Safonov
/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| 2

Re: [PATCH 4/9] select: Micro-optimise __estimate_accuracy()

2019-09-19 Thread Dmitry Safonov
On 9/19/19 3:05 PM, Cyrill Gorcunov wrote: [..] >> diff --git a/fs/select.c b/fs/select.c >> index 12cdefd3be2d..2477c202631e 100644 >> --- a/fs/select.c >> +++ b/fs/select.c >> @@ -51,15 +51,14 @@ >> >> static long __estimate_accuracy(ktime_t slack) >> { >> -int divfactor = 1000; >> - >>

Re: [PATCH 8/9] select/restart_block: Convert poll's timeout to u64

2019-09-16 Thread Dmitry Safonov
On 9/9/19 2:07 PM, David Laight wrote: > From: Dmitry Safonov >> Sent: 09 September 2019 11:24 >> >> All preparations have been done - now poll() can set u64 timeout in >> restart_block. It allows to do the next step - unifying all timeouts in >> restart_block

Re: [PATCH 4/9] select: Micro-optimise __estimate_accuracy()

2019-09-09 Thread Dmitry Safonov
Hi Cyrill, On Mon, 9 Sep 2019 at 12:18, Cyrill Gorcunov wrote: > Compiler precompute constants so it doesn't do division here. > But I didn't read the series yet so I might be missing > something obvious. Heh, like a division is in ktime_divns()? Thanks, Dmitry

[PATCH 3/9] select: Convert __esimate_accuracy() to ktime_t

2019-09-09 Thread Dmitry Safonov
not only a "hack", but also it's done every time poll() syscall is restarted. After conversion it'll be removed. While at it, rename parameters "slack" and "timeout" which describe their purpose better. Signed-off-by: Dmitry Safonov --- fs/select.c | 33 +++

[PATCH 2/9] restart_block: Prevent userspace set part of the block

2019-09-09 Thread Dmitry Safonov
surprises. Also, add a comment for any new restart_block user. Signed-off-by: Dmitry Safonov --- include/linux/restart_block.h | 4 kernel/time/hrtimer.c | 8 +--- kernel/time/posix-cpu-timers.c | 6 +++--- kernel/time/posix-stubs.c | 8 +--- kernel/time/posix

[PATCH 0/9] restart_block: Prepare the ground for dumping timeout

2019-09-09 Thread Dmitry Safonov
difficulties of designing new ptrace operation on Containers Microconference at Plumbers [with a hope to find the sensible solution]. Cc: Adrian Reber Cc: Alexander Viro Cc: Andrei Vagin Cc: Andy Lutomirski Cc: Cyrill Gorcunov Cc: Dmitry Safonov <0x7f454...@gmail.com> Cc: Ingo Molnar Cc

[PATCH 7/9] select: Use ktime_t in do_sys_poll() and do_poll()

2019-09-09 Thread Dmitry Safonov
for storing ktime_t inside restart_block. Signed-off-by: Dmitry Safonov --- fs/select.c | 47 +++ 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/fs/select.c b/fs/select.c index 262300e58370..4af88feaa2fe 100644 --- a/fs/select.c +++ b/fs

[PATCH 5/9] select: Convert select_estimate_accuracy() to take ktime_t

2019-09-09 Thread Dmitry Safonov
to introduce an API for ptrace() to get a timeout from restart_block. Signed-off-by: Dmitry Safonov --- fs/eventpoll.c | 4 ++-- fs/select.c | 38 -- include/linux/poll.h | 2 +- 3 files changed, 15 insertions(+), 29 deletions(-) diff --git a/fs

[PATCH 4/9] select: Micro-optimise __estimate_accuracy()

2019-09-09 Thread Dmitry Safonov
Shift on s64 is faster than division, use it instead. As the result of the patch there is a hardly user-visible effect: poll(), select(), etc syscalls will be a bit more precise on ~2.3% than before because 1000 != 1024 :) Signed-off-by: Dmitry Safonov --- fs/select.c | 9 - 1 file

[PATCH 9/9] restart_block: Make common timeout

2019-09-09 Thread Dmitry Safonov
In order to provide a unified API to get the leftover of timeout, the timeout for different users of restart_block can be joined. All preparations done, so move timeout out of union and convert the users. Signed-off-by: Dmitry Safonov --- fs/select.c| 10 +- include

[PATCH 6/9] select: Extract common code into do_sys_ppoll()

2019-09-09 Thread Dmitry Safonov
isters.. Signed-off-by: Dmitry Safonov --- fs/select.c | 94 ++--- 1 file changed, 32 insertions(+), 62 deletions(-) diff --git a/fs/select.c b/fs/select.c index 458f2a944318..262300e58370 100644 --- a/fs/select.c +++ b/fs/select.c @@ -1056,54 +1056,5

[PATCH 8/9] select/restart_block: Convert poll's timeout to u64

2019-09-09 Thread Dmitry Safonov
All preparations have been done - now poll() can set u64 timeout in restart_block. It allows to do the next step - unifying all timeouts in restart_block and provide ptrace() API to read it. Signed-off-by: Dmitry Safonov --- fs/select.c | 27

[PATCH 1/9] futex: Remove unused uaddr2 in restart_block

2019-09-09 Thread Dmitry Safonov
Not used since introduction in commit 52400ba94675 ("futex: add requeue_pi functionality"). The result union stays the same size, so nothing saved in task_struct, but still one __user pointer less to keep. Signed-off-by: Dmitry Safonov --- include/linux/restart_block.h | 1 - 1 file

Re: get_unmapped_area && in_ia32_syscall (Was: [PATCH] uprobes/x86: fix detection of 32-bit user mode)

2019-08-27 Thread Dmitry Safonov
-Cc my old @virtuozzo email. Previously it just ignored emails and now sends those ugly html replies. Sorry about that - I've updated .mailmap now. On 8/27/19 6:03 PM, Dmitry Safonov wrote: > Hi Oleg, > > On 8/27/19 3:00 PM, Oleg Nesterov wrote: > [..] >> But to remind, there

[PATCH] mailmap: Add aliases for Dmitry Safonov

2019-08-27 Thread Dmitry Safonov
I don't work for Virtuozzo or Samsung anymore and I've noticed that they have started sending annoying html email-replies. And I prioritize my personal emails over work email box, so while at it add an entry for Arista too - so I can reply faster when needed. Signed-off-by: Dmitry Safonov

Re: get_unmapped_area && in_ia32_syscall (Was: [PATCH] uprobes/x86: fix detection of 32-bit user mode)

2019-08-27 Thread Dmitry Safonov
Hi Oleg, On 8/27/19 3:00 PM, Oleg Nesterov wrote: [..] > But to remind, there is another problem with in_ia32_syscall() && uprobes. > > get_unmapped_area() paths use in_ia32_syscall() and this is wrong in case > when the caller is xol_add_vma(), in this case TS_COMPAT won't be set.> > Usually

Re: [PATCHv6 23/36] x86/vdso: Allocate timens vdso

2019-08-19 Thread Dmitry Safonov
Hi Thomas, On 8/18/19 5:21 PM, Thomas Gleixner wrote: [..] > I'm happy to review well written stuff which makes progress and takes > review comments into account or the submitter discusses them for > resolution. Thanks again for both your and Andy time! [..] > Coming back to Andy's idea. Create

Re: [PATCHv6 23/36] x86/vdso: Allocate timens vdso

2019-08-16 Thread Dmitry Safonov
Hi Andy, Thomas, thank you very much for your time and the reviews, appreciate that. On 8/16/19 9:10 PM, Thomas Gleixner wrote: > On Fri, 16 Aug 2019, Andy Lutomirski wrote: [..] >> I'm unconvinced that any of this magic is wise. I think you should make a >> special timens vvar page that causes

Re: [PATCHv6 22/36] x86/vdso: Add offsets page in vvar

2019-08-16 Thread Dmitry Safonov
Hi Thomas, On 8/15/19 8:21 PM, Thomas Gleixner wrote: > On Thu, 15 Aug 2019, Dmitry Safonov wrote: >> --- >> arch/Kconfig | 5 +++ >> arch/x86/Kconfig | 1 + >> arch/x86/entry/vdso/vdso-layout.lds.S | 9 - >&

[PATCHv6 04/36] posix-clocks: Rename .clock_get_timespec() callbacks accordingly

2019-08-15 Thread Dmitry Safonov
-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- kernel/time/alarmtimer.c | 6 +++--- kernel/time/posix-timers.c | 16 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c index b5f3779eae57..995dd5aa68f0

[PATCHv6 01/36] ns: Introduce Time Namespace

2019-08-15 Thread Dmitry Safonov
/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| 2

[PATCHv6 09/36] posix-clocks: Wire up clock_gettime() with timens offsets

2019-08-15 Thread Dmitry Safonov
adjusted. Further changes complete time namespace virtualisation with vDSO support. Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- kernel/time/alarmtimer.c | 1 + kernel/time/posix-stubs.c | 3 +++ kernel/time/posix-timers.c | 5 + 3 files changed

[PATCHv6 02/36] timens: Add timens_offsets

2019-08-15 Thread Dmitry Safonov
namespace of the current process. Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- MAINTAINERS| 1 + include/linux/time_namespace.h | 18 ++ include/linux/timens_offsets.h | 10 ++ kernel/time_namespace.c

[PATCHv6 08/36] posix-timers: Use clock_get_ktime() in common_timer_get()

2019-08-15 Thread Dmitry Safonov
From: Andrei Vagin Now, when the clock_get_ktime() callback exists, the suboptimal timespec64-based conversion can be removed from common_timer_get(). Suggested-by: Thomas Gleixner Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- kernel/time

[PATCHv6 03/36] posix-clocks: Rename the clock_get() into clock_get_timespec()

2019-08-15 Thread Dmitry Safonov
the time in ktime_t format, rather than in (struct timespec). Rename clock_get() callback into clock_get_timespec() as a preparation for introducing clock_get_ktime(). Suggested-by: Thomas Gleixner Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- kernel

[PATCHv6 20/36] x86/vdso: Restrict splitting VVAR VMA

2019-08-15 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 349a61d8bf34

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