lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 8 May 2019 03:30:01 +0000
From:   Po Liu <po.liu@....com>
To:     Richard Cochran <richardcochran@...il.com>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "Y.b. Lu" <yangbo.lu@....com>,
        Claudiu Manoil <claudiu.manoil@....com>,
        "davem@...emloft.net" <davem@...emloft.net>,
        Leo Li <leoyang.li@....com>, Roy Zang <roy.zang@....com>,
        Mingkai Hu <mingkai.hu@....com>,
        "deepa.kernel@...il.com" <deepa.kernel@...il.com>
Subject: RE: [EXT] Re: [PATCH v1] timer:clock:ptp: add support the dynamic
 posix clock alarm set for ptp

Hi Richard,

Thank you for your reply.


Br,
Po Liu

> -----Original Message-----
> From: Richard Cochran [mailto:richardcochran@...il.com]
> Sent: 2019年5月7日 21:50
> To: Po Liu <po.liu@....com>
> Cc: netdev@...r.kernel.org; linux-kernel@...r.kernel.org; linuxppc-
> dev@...ts.ozlabs.org; linux-arm-kernel@...ts.infradead.org; Y.b. Lu
> <yangbo.lu@....com>; Claudiu Manoil <claudiu.manoil@....com>;
> davem@...emloft.net; Leo Li <leoyang.li@....com>; Roy Zang
> <roy.zang@....com>; Mingkai Hu <mingkai.hu@....com>;
> deepa.kernel@...il.com
> Subject: [EXT] Re: [PATCH v1] timer:clock:ptp: add support the dynamic posix
> clock alarm set for ptp
> 
> Caution: EXT Email
> 
> On Sun, May 05, 2019 at 05:02:05AM +0000, Po Liu wrote:
> > Current kernel code do not support the dynamic posix clock alarm set.
> > This code would support it by the posix timer structure.
> >
> > 319  const struct k_clock clock_posix_dynamic = {
> >
> > 320         .clock_getres   = pc_clock_getres,
> > 321         .clock_set      = pc_clock_settime,
> > 322         .clock_get      = pc_clock_gettime,
> > 323         .clock_adj      = pc_clock_adjtime,
> > 324 +       .timer_create   = pc_timer_create,
> > 325 +       .timer_del      = pc_timer_delete,
> > 326 +       .timer_set      = pc_timer_set,
> > 327 +       .timer_arm      = pc_timer_arm,
> > }
> >
> 
> Sorry, NAK, since we decided some time ago not to support timer_* operations
> on dynamic clocks.  You get much better application level timer performance
> by synchronizing CLOCK_REALTIME to your PHC and using clock_nanosleep()
> with CLOCK_REALTIME or CLOCK_MONOTONIC.

The code intend to get alarm by interrupt of ptp hardware. The code to fix ptp not support to application layer to get the alarm interrupt. 
Do you mean the synchronizing at application layer by PHC (using clock_nanosleep()) to the CLOCK_REALTIME source? Then the kernel could using the hrtimer with CLOCK_REALTIME?

> 
> > This won't change the user space system call code. Normally the user
> > space set alarm by timer_create() and timer_settime(). Reference code
> > are tools/testing/selftests/ptp/testptp.c.
> 
> That program still has misleading examples.  Sorry about that.  I'll submit a
> patch to remove them.

Is there any replace method for an application code to get alarm interrupt by the ptp source?

> 
> > +static int pc_timer_create(struct k_itimer *new_timer) {
> > +     return 0;
> > +}
> > +
> 
> This of course would never work.  Consider what happens when two or more
> timers are created and armed.
> 
> Thanks,
> Richard

Powered by blists - more mailing lists