<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/time/time.c, branch v4.20</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.20</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.20'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2018-11-01T12:02:21Z</updated>
<entry>
<title>compat: Cleanup in_compat_syscall() callers</title>
<updated>2018-11-01T12:02:21Z</updated>
<author>
<name>Dmitry Safonov</name>
<email>dima@arista.com</email>
</author>
<published>2018-10-12T13:42:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=98f76206b33504b934209d16196477dfa519a807'/>
<id>urn:sha1:98f76206b33504b934209d16196477dfa519a807</id>
<content type='text'>
Now that in_compat_syscall() is consistent on all architectures and does
not longer report true on native i686, the workarounds (ifdeffery and
helpers) can be removed.

Signed-off-by: Dmitry Safonov &lt;dima@arista.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Dmitry Safonov &lt;0x7f454c46@gmail.com&gt;
Cc: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Cc: Andy Lutomirsky &lt;luto@kernel.org&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: John Stultz &lt;john.stultz@linaro.org&gt;
Cc: "Kirill A. Shutemov" &lt;kirill.shutemov@linux.intel.com&gt;
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Steffen Klassert &lt;steffen.klassert@secunet.com&gt;
Cc: Stephen Boyd &lt;sboyd@kernel.org&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: linux-efi@vger.kernel.org
Cc: netdev@vger.kernel.org
Link: https://lkml.kernel.org/r/20181012134253.23266-3-dima@arista.com

</content>
</entry>
<entry>
<title>y2038: __get_old_timespec32() can be static</title>
<updated>2018-08-29T13:42:19Z</updated>
<author>
<name>kbuild test robot</name>
<email>fengguang.wu@intel.com</email>
</author>
<published>2018-08-29T12:50:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=743f5cdb6cec33d2300922f6b1b1670a572595ad'/>
<id>urn:sha1:743f5cdb6cec33d2300922f6b1b1670a572595ad</id>
<content type='text'>
The kbuild test robot reports two new warnings with the previous
patch:

 kernel/time/time.c:866:5: sparse: symbol '__get_old_timespec32' was not declared. Should it be static?
 kernel/time/time.c:882:5: sparse: symbol '__put_old_timespec32' was not declared. Should it be static?

These are actually older bugs, but came up now after the
symbol got renamed. Fortunately, commit afef05cf238c ("time:
Enable get/put_compat_itimerspec64 always") makes the two functions
(__compat_get_timespec64/__compat_get_timespec64) local to time.c already,
so we can mark them as 'static'.

Fixes: ee16c8f415e4 ("y2038: Globally rename compat_time to old_time32")
Signed-off-by: kbuild test robot &lt;fengguang.wu@intel.com&gt;
[arnd: added changelog text]
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
</content>
</entry>
<entry>
<title>y2038: globally rename compat_time to old_time32</title>
<updated>2018-08-27T12:48:48Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2018-07-13T10:52:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9afc5eee65ca7d717a99d6fe8f4adfe32a40940a'/>
<id>urn:sha1:9afc5eee65ca7d717a99d6fe8f4adfe32a40940a</id>
<content type='text'>
Christoph Hellwig suggested a slightly different path for handling
backwards compatibility with the 32-bit time_t based system calls:

Rather than simply reusing the compat_sys_* entry points on 32-bit
architectures unchanged, we get rid of those entry points and the
compat_time types by renaming them to something that makes more sense
on 32-bit architectures (which don't have a compat mode otherwise),
and then share the entry points under the new name with the 64-bit
architectures that use them for implementing the compatibility.

The following types and interfaces are renamed here, and moved
from linux/compat_time.h to linux/time32.h:

old				new
---				---
compat_time_t			old_time32_t
struct compat_timeval		struct old_timeval32
struct compat_timespec		struct old_timespec32
struct compat_itimerspec	struct old_itimerspec32
ns_to_compat_timeval()		ns_to_old_timeval32()
get_compat_itimerspec64()	get_old_itimerspec32()
put_compat_itimerspec64()	put_old_itimerspec32()
compat_get_timespec64()		get_old_timespec32()
compat_put_timespec64()		put_old_timespec32()

As we already have aliases in place, this patch addresses only the
instances that are relevant to the system call interface in particular,
not those that occur in device drivers and other modules. Those
will get handled separately, while providing the 64-bit version
of the respective interfaces.

I'm not renaming the timex, rusage and itimerval structures, as we are
still debating what the new interface will look like, and whether we
will need a replacement at all.

This also doesn't change the names of the syscall entry points, which can
be done more easily when we actually switch over the 32-bit architectures
to use them, at that point we need to change COMPAT_SYSCALL_DEFINEx to
SYSCALL_DEFINEx with a new name, e.g. with a _time32 suffix.

Suggested-by: Christoph Hellwig &lt;hch@infradead.org&gt;
Link: https://lore.kernel.org/lkml/20180705222110.GA5698@infradead.org/
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
</content>
</entry>
<entry>
<title>y2038: make do_gettimeofday() and get_seconds() inline</title>
<updated>2018-08-27T12:45:58Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2018-08-14T13:18:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=33e26418193f58d1895f2f968e1953b1caf8deb7'/>
<id>urn:sha1:33e26418193f58d1895f2f968e1953b1caf8deb7</id>
<content type='text'>
get_seconds() and do_gettimeofday() are only used by a few modules now any
more (waiting for the respective patches to get accepted), and they are
among the last holdouts of code that is not y2038 safe in the core kernel.

Move the implementation into the timekeeping32.h header to clean up
the core kernel and isolate the old interfaces further.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
</content>
</entry>
<entry>
<title>y2038: remove unused time interfaces</title>
<updated>2018-08-27T10:59:56Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2018-08-14T12:02:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=976516404ff3fab2a8caa8bd6f5efc1437fed0b8'/>
<id>urn:sha1:976516404ff3fab2a8caa8bd6f5efc1437fed0b8</id>
<content type='text'>
After many small patches, at least some of the deprecated interfaces
have no remaining users any more and can be removed:

  current_kernel_time
  do_settimeofday
  get_monotonic_boottime
  get_monotonic_boottime64
  get_monotonic_coarse
  get_monotonic_coarse64
  getrawmonotonic64
  ktime_get_real_ts
  timekeeping_clocktai
  timespec_trunc
  timespec_valid_strict
  time_to_tm

For many of the remaining time functions, we are missing one or
two patches that failed to make it into 4.19, they will be removed
in the following merge window.

The replacement functions for the removed interfaces are documented in
Documentation/core-api/timekeeping.rst.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
</content>
</entry>
<entry>
<title>Merge branch 'fortglx/4.19/time' of https://git.linaro.org/people/john.stultz/linux into timers/core</title>
<updated>2018-07-12T20:19:58Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2018-07-12T20:19:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c6bb11147eb09bd39f316c6062455b88c905ab6e'/>
<id>urn:sha1:c6bb11147eb09bd39f316c6062455b88c905ab6e</id>
<content type='text'>
Pull timekeeping updates from John Stultz:

  - Make the timekeeping update more precise when NTP frequency is set
    directly by updating the multiplier.

  - Adjust selftests
</content>
</entry>
<entry>
<title>time: Enable get/put_compat_itimerspec64 always</title>
<updated>2018-06-24T12:39:47Z</updated>
<author>
<name>Deepa Dinamani</name>
<email>deepa.kernel@gmail.com</email>
</author>
<published>2018-06-17T05:11:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=afef05cf238cfcecdc5ea9b06f31027b13ce6214'/>
<id>urn:sha1:afef05cf238cfcecdc5ea9b06f31027b13ce6214</id>
<content type='text'>
This will aid in enabling the compat syscalls on 32-bit architectures later
on.

Also move compat_itimerspec and related defines to compat_time.h.  The
compat_time.h file will eventually be deleted.

Signed-off-by: Deepa Dinamani &lt;deepa.kernel@gmail.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: arnd@arndb.de
Cc: viro@zeniv.linux.org.uk
Cc: linux-fsdevel@vger.kernel.org
Cc: linux-api@vger.kernel.org
Cc: y2038@lists.linaro.org
Link: https://lkml.kernel.org/r/20180617051144.29756-3-deepa.kernel@gmail.com

</content>
</entry>
<entry>
<title>time: Introduce struct __kernel_itimerspec</title>
<updated>2018-06-24T12:39:46Z</updated>
<author>
<name>Deepa Dinamani</name>
<email>deepa.kernel@gmail.com</email>
</author>
<published>2018-06-17T05:11:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d0dd63a8aee1ef89f2e48e554b796b9f9e4fcadb'/>
<id>urn:sha1:d0dd63a8aee1ef89f2e48e554b796b9f9e4fcadb</id>
<content type='text'>
struct itimerspec is not y2038-safe.

Introduce a new struct __kernel_itimerspec based on the kernel internal
y2038-safe struct itimerspec64.

The definition of struct __kernel_itimerspec includes two struct
__kernel_timespec.

Since struct __kernel_timespec has the same representation in native and
compat modes, so does struct __kernel_itimerspec. This helps have a common
entry point for syscalls using struct __kernel_itimerspec.

New y2038-safe syscalls will use this new type. Since most of the new
syscalls are just an update to the native syscalls with the type update,
place the new definition under CONFIG_64BIT_TIME. This helps architectures
that do not support the above config to keep using the old definition of
struct itimerspec.

Also change the get/put_itimerspec64 to use struct__kernel_itimerspec.
This will help 32 bit architectures to use the new syscalls when
architectures select CONFIG_64BIT_TIME.

Signed-off-by: Deepa Dinamani &lt;deepa.kernel@gmail.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: arnd@arndb.de
Cc: viro@zeniv.linux.org.uk
Cc: linux-fsdevel@vger.kernel.org
Cc: linux-api@vger.kernel.org
Cc: y2038@lists.linaro.org
Link: https://lkml.kernel.org/r/20180617051144.29756-2-deepa.kernel@gmail.com

</content>
</entry>
<entry>
<title>time: Make sure jiffies_to_msecs() preserves non-zero time periods</title>
<updated>2018-06-22T15:48:36Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert@linux-m68k.org</email>
</author>
<published>2018-06-22T14:33:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=abcbcb80cd09cd40f2089d912764e315459b71f7'/>
<id>urn:sha1:abcbcb80cd09cd40f2089d912764e315459b71f7</id>
<content type='text'>
For the common cases where 1000 is a multiple of HZ, or HZ is a multiple of
1000, jiffies_to_msecs() never returns zero when passed a non-zero time
period.

However, if HZ &gt; 1000 and not an integer multiple of 1000 (e.g. 1024 or
1200, as used on alpha and DECstation), jiffies_to_msecs() may return zero
for small non-zero time periods.  This may break code that relies on
receiving back a non-zero value.

jiffies_to_usecs() does not need such a fix: one jiffy can only be less
than one µs if HZ &gt; 1000000, and such large values of HZ are already
rejected at build time, twice:

  - include/linux/jiffies.h does #error if HZ &gt;= 12288,
  - kernel/time/time.c has BUILD_BUG_ON(HZ &gt; USEC_PER_SEC).

Broken since forever.

Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: John Stultz &lt;john.stultz@linaro.org&gt;
Cc: Stephen Boyd &lt;sboyd@kernel.org&gt;
Cc: linux-alpha@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20180622143357.7495-1-geert@linux-m68k.org

</content>
</entry>
<entry>
<title>time: Use ktime_get_real_seconds() in time syscall</title>
<updated>2018-06-19T07:56:26Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2018-06-18T14:08:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f5a89295e2f566d8e9f1d4f3d524d8d3c966958c'/>
<id>urn:sha1:f5a89295e2f566d8e9f1d4f3d524d8d3c966958c</id>
<content type='text'>
Both get_seconds() and do_gettimeofday() are deprecated. Change the time()
implementation to use the replacement function instead.

Obviously the system call will still overflow in 2038, but this gets us
closer to removing the old helper functions.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: John Stultz &lt;john.stultz@linaro.org&gt;
Cc: y2038@lists.linaro.org
Cc: Stephen Boyd &lt;sboyd@kernel.org&gt;
Cc: Deepa Dinamani &lt;deepa.kernel@gmail.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Link: https://lkml.kernel.org/r/20180618140811.2998503-2-arnd@arndb.de

</content>
</entry>
</feed>
