<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/arch/um/kernel/time.c, branch v5.6</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>um: Add SPDX headers to files in arch/um/kernel/</title>
<updated>2019-09-15T19:37:17+00:00</updated>
<author>
<name>Alex Dewar</name>
<email>alex.dewar@gmx.co.uk</email>
</author>
<published>2019-08-25T09:49:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=0d1fb0a47c09b21d82c680476da26035f402660a'/>
<id>0d1fb0a47c09b21d82c680476da26035f402660a</id>
<content type='text'>
Convert files to use SPDX header. All files are licensed under the
GPLv2.

Signed-off-by: Alex Dewar &lt;alex.dewar@gmx.co.uk&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Convert files to use SPDX header. All files are licensed under the
GPLv2.

Signed-off-by: Alex Dewar &lt;alex.dewar@gmx.co.uk&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>um: time-travel: Restrict time update in IRQ handler</title>
<updated>2019-09-15T19:37:13+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2019-09-10T15:03:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=278911ee89fa0f35127c0194010ffe2c17c2e3af'/>
<id>278911ee89fa0f35127c0194010ffe2c17c2e3af</id>
<content type='text'>
We currently do the time updates in the timer handler, even if
we just call the timer handler ourselves. In basic mode we must
in fact do it there since otherwise the OS timer signal won't
move time forward, but in inf-cpu mode we don't need to, and
it's harder to understand.

Restrict the update there to basic mode, adding a comment, and
do it before calling the timer_handler() in inf-cpu mode.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We currently do the time updates in the timer handler, even if
we just call the timer handler ourselves. In basic mode we must
in fact do it there since otherwise the OS timer signal won't
move time forward, but in inf-cpu mode we don't need to, and
it's harder to understand.

Restrict the update there to basic mode, adding a comment, and
do it before calling the timer_handler() in inf-cpu mode.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>um: time-travel: Fix periodic timers</title>
<updated>2019-09-15T19:37:13+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2019-09-10T15:03:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=eec94b8acb03aaaa6fb050883624381f5c07a3f0'/>
<id>eec94b8acb03aaaa6fb050883624381f5c07a3f0</id>
<content type='text'>
Periodic timers are broken, because the also only fire once.
As it happens, Linux doesn't care because it only sets the
timer to periodic very briefly during boot, and then switches
it only between one-shot and off later.

Nevertheless, fix the logic (we shouldn't even be looking at
time_travel_timer_expiry unless the timer is enabled) and
change the code to fire the timer periodically in periodic
mode, in case it ever gets used in the future.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Periodic timers are broken, because the also only fire once.
As it happens, Linux doesn't care because it only sets the
timer to periodic very briefly during boot, and then switches
it only between one-shot and off later.

Nevertheless, fix the logic (we shouldn't even be looking at
time_travel_timer_expiry unless the timer is enabled) and
change the code to fire the timer periodically in periodic
mode, in case it ever gets used in the future.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>um: fix time travel mode</title>
<updated>2019-08-22T22:39:53+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2019-07-22T07:12:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e0917f879536cbf57367429d084775d8224c986c'/>
<id>e0917f879536cbf57367429d084775d8224c986c</id>
<content type='text'>
Unfortunately, my build fix for when time travel mode isn't
enabled broke time travel mode, because I forgot that we need
to use the timer time after the timer has been marked disabled,
and thus need to leave the time stored instead of zeroing it.

Fix that by splitting the inline into two, so we can call only
the _mode() one in the relevant code path.

Fixes: b482e48d29f1 ("um: fix build without CONFIG_UML_TIME_TRAVEL_SUPPORT")
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Unfortunately, my build fix for when time travel mode isn't
enabled broke time travel mode, because I forgot that we need
to use the timer time after the timer has been marked disabled,
and thus need to leave the time stored instead of zeroing it.

Fix that by splitting the inline into two, so we can call only
the _mode() one in the relevant code path.

Fixes: b482e48d29f1 ("um: fix build without CONFIG_UML_TIME_TRAVEL_SUPPORT")
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>um: Support time travel mode</title>
<updated>2019-07-02T21:27:36+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2019-05-27T08:34:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=065038706f77a56754e8f0c2556dab7e22dfe577'/>
<id>065038706f77a56754e8f0c2556dab7e22dfe577</id>
<content type='text'>
Sometimes it can be useful to run with "time travel" inside the
UML instance, for example for testing. For example, some tests
for the wireless subsystem and userspace are based on hwsim, a
virtual wireless adapter. Some tests can take a long time to
run because they e.g. wait for 120 seconds to elapse for some
regulatory checks. This obviously goes faster if it need not
actually wait that long, but time inside the test environment
just "bumps up" when there's nothing to do.

Add CONFIG_UML_TIME_TRAVEL_SUPPORT to enable code to support
such modes at runtime, selected on the command line:
 * just "time-travel", in which time inside the UML instance
   can move faster than real time, if there's nothing to do
 * "time-travel=inf-cpu" in which time also moves slower and
   any CPU processing takes no time at all, which allows to
   implement consistent behaviour regardless of host CPU load
   (or speed) or debug overhead.

An additional "time-travel-start=&lt;seconds&gt;" parameter is also
supported in this case to start the wall clock at this time
(in unix epoch).

With this enabled, the test mentioned above goes from a runtime
of about 140 seconds (with startup overhead and all) to being
CPU bound and finishing in 15 seconds (on my slow laptop).

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sometimes it can be useful to run with "time travel" inside the
UML instance, for example for testing. For example, some tests
for the wireless subsystem and userspace are based on hwsim, a
virtual wireless adapter. Some tests can take a long time to
run because they e.g. wait for 120 seconds to elapse for some
regulatory checks. This obviously goes faster if it need not
actually wait that long, but time inside the test environment
just "bumps up" when there's nothing to do.

Add CONFIG_UML_TIME_TRAVEL_SUPPORT to enable code to support
such modes at runtime, selected on the command line:
 * just "time-travel", in which time inside the UML instance
   can move faster than real time, if there's nothing to do
 * "time-travel=inf-cpu" in which time also moves slower and
   any CPU processing takes no time at all, which allows to
   implement consistent behaviour regardless of host CPU load
   (or speed) or debug overhead.

An additional "time-travel-start=&lt;seconds&gt;" parameter is also
supported in this case to start the wall clock at this time
(in unix epoch).

With this enabled, the test mentioned above goes from a runtime
of about 140 seconds (with startup overhead and all) to being
CPU bound and finishing in 15 seconds (on my slow laptop).

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>um: Pass nsecs to os timer functions</title>
<updated>2019-07-02T21:27:29+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2019-05-27T08:34:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=c7c6f3b95303c7de5d52af56c902fcb5abe827df'/>
<id>c7c6f3b95303c7de5d52af56c902fcb5abe827df</id>
<content type='text'>
This makes the code clearer and lets the time travel patch have
the actual time used for these functions in just one place.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes the code clearer and lets the time travel patch have
the actual time used for these functions in just one place.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>um: Timer code cleanup</title>
<updated>2019-07-02T21:27:00+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2019-05-06T12:39:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=56fc187065451ebca74edb30d50de5f10a88339b'/>
<id>56fc187065451ebca74edb30d50de5f10a88339b</id>
<content type='text'>
There are some unused functions, and some others that have
unused arguments; clean up the timer code a bit.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are some unused functions, and some others that have
unused arguments; clean up the timer code a bit.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>uml: fix a boot splat wrt use of cpu_all_mask</title>
<updated>2019-05-07T21:18:28+00:00</updated>
<author>
<name>Maciej Żenczykowski</name>
<email>maze@google.com</email>
</author>
<published>2019-04-10T18:11:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=689a58605b63173acb0a8cf954af6a8f60440c93'/>
<id>689a58605b63173acb0a8cf954af6a8f60440c93</id>
<content type='text'>
Memory: 509108K/542612K available (3835K kernel code, 919K rwdata, 1028K rodata, 129K init, 211K bss, 33504K reserved, 0K cma-reserved)
NR_IRQS: 15
clocksource: timer: mask: 0xffffffffffffffff max_cycles: 0x1cd42e205, max_idle_ns: 881590404426 ns
------------[ cut here ]------------
WARNING: CPU: 0 PID: 0 at kernel/time/clockevents.c:458 clockevents_register_device+0x72/0x140
posix-timer cpumask == cpu_all_mask, using cpu_possible_mask instead
Modules linked in:
CPU: 0 PID: 0 Comm: swapper Not tainted 5.1.0-rc4-00048-ged79cc87302b #4
Stack:
 604ebda0 603c5370 604ebe20 6046fd17
 00000000 6006fcbb 604ebdb0 603c53b5
 604ebe10 6003bfc4 604ebdd0 9000001ca
Call Trace:
 [&lt;6006fcbb&gt;] ? printk+0x0/0x94
 [&lt;60083160&gt;] ? clockevents_register_device+0x72/0x140
 [&lt;6001f16e&gt;] show_stack+0x13b/0x155
 [&lt;603c5370&gt;] ? dump_stack_print_info+0xe2/0xeb
 [&lt;6006fcbb&gt;] ? printk+0x0/0x94
 [&lt;603c53b5&gt;] dump_stack+0x2a/0x2c
 [&lt;6003bfc4&gt;] __warn+0x10e/0x13e
 [&lt;60070320&gt;] ? vprintk_func+0xc8/0xcf
 [&lt;60030fd6&gt;] ? block_signals+0x0/0x16
 [&lt;6006fcbb&gt;] ? printk+0x0/0x94
 [&lt;6003c08b&gt;] warn_slowpath_fmt+0x97/0x99
 [&lt;600311a1&gt;] ? set_signals+0x0/0x3f
 [&lt;6003bff4&gt;] ? warn_slowpath_fmt+0x0/0x99
 [&lt;600842cb&gt;] ? tick_oneshot_mode_active+0x44/0x4f
 [&lt;60030fd6&gt;] ? block_signals+0x0/0x16
 [&lt;6006fcbb&gt;] ? printk+0x0/0x94
 [&lt;6007d2d5&gt;] ? __clocksource_select+0x20/0x1b1
 [&lt;60030fd6&gt;] ? block_signals+0x0/0x16
 [&lt;6006fcbb&gt;] ? printk+0x0/0x94
 [&lt;60083160&gt;] clockevents_register_device+0x72/0x140
 [&lt;60031192&gt;] ? get_signals+0x0/0xf
 [&lt;60030fd6&gt;] ? block_signals+0x0/0x16
 [&lt;6006fcbb&gt;] ? printk+0x0/0x94
 [&lt;60002eec&gt;] um_timer_setup+0xc8/0xca
 [&lt;60001b59&gt;] start_kernel+0x47f/0x57e
 [&lt;600035bc&gt;] start_kernel_proc+0x49/0x4d
 [&lt;6006c483&gt;] ? kmsg_dump_register+0x82/0x8a
 [&lt;6001de62&gt;] new_thread_handler+0x81/0xb2
 [&lt;60003571&gt;] ? kmsg_dumper_stdout_init+0x1a/0x1c
 [&lt;60020c75&gt;] uml_finishsetup+0x54/0x59

random: get_random_bytes called from init_oops_id+0x27/0x34 with crng_init=0
---[ end trace 00173d0117a88acb ]---
Calibrating delay loop... 6941.90 BogoMIPS (lpj=34709504)

Signed-off-by: Maciej Żenczykowski &lt;maze@google.com&gt;
Cc: Jeff Dike &lt;jdike@addtoit.com&gt;
Cc: Richard Weinberger &lt;richard@nod.at&gt;
Cc: Anton Ivanov &lt;anton.ivanov@cambridgegreys.com&gt;
Cc: linux-um@lists.infradead.org
Cc: linux-kernel@vger.kernel.org

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Memory: 509108K/542612K available (3835K kernel code, 919K rwdata, 1028K rodata, 129K init, 211K bss, 33504K reserved, 0K cma-reserved)
NR_IRQS: 15
clocksource: timer: mask: 0xffffffffffffffff max_cycles: 0x1cd42e205, max_idle_ns: 881590404426 ns
------------[ cut here ]------------
WARNING: CPU: 0 PID: 0 at kernel/time/clockevents.c:458 clockevents_register_device+0x72/0x140
posix-timer cpumask == cpu_all_mask, using cpu_possible_mask instead
Modules linked in:
CPU: 0 PID: 0 Comm: swapper Not tainted 5.1.0-rc4-00048-ged79cc87302b #4
Stack:
 604ebda0 603c5370 604ebe20 6046fd17
 00000000 6006fcbb 604ebdb0 603c53b5
 604ebe10 6003bfc4 604ebdd0 9000001ca
Call Trace:
 [&lt;6006fcbb&gt;] ? printk+0x0/0x94
 [&lt;60083160&gt;] ? clockevents_register_device+0x72/0x140
 [&lt;6001f16e&gt;] show_stack+0x13b/0x155
 [&lt;603c5370&gt;] ? dump_stack_print_info+0xe2/0xeb
 [&lt;6006fcbb&gt;] ? printk+0x0/0x94
 [&lt;603c53b5&gt;] dump_stack+0x2a/0x2c
 [&lt;6003bfc4&gt;] __warn+0x10e/0x13e
 [&lt;60070320&gt;] ? vprintk_func+0xc8/0xcf
 [&lt;60030fd6&gt;] ? block_signals+0x0/0x16
 [&lt;6006fcbb&gt;] ? printk+0x0/0x94
 [&lt;6003c08b&gt;] warn_slowpath_fmt+0x97/0x99
 [&lt;600311a1&gt;] ? set_signals+0x0/0x3f
 [&lt;6003bff4&gt;] ? warn_slowpath_fmt+0x0/0x99
 [&lt;600842cb&gt;] ? tick_oneshot_mode_active+0x44/0x4f
 [&lt;60030fd6&gt;] ? block_signals+0x0/0x16
 [&lt;6006fcbb&gt;] ? printk+0x0/0x94
 [&lt;6007d2d5&gt;] ? __clocksource_select+0x20/0x1b1
 [&lt;60030fd6&gt;] ? block_signals+0x0/0x16
 [&lt;6006fcbb&gt;] ? printk+0x0/0x94
 [&lt;60083160&gt;] clockevents_register_device+0x72/0x140
 [&lt;60031192&gt;] ? get_signals+0x0/0xf
 [&lt;60030fd6&gt;] ? block_signals+0x0/0x16
 [&lt;6006fcbb&gt;] ? printk+0x0/0x94
 [&lt;60002eec&gt;] um_timer_setup+0xc8/0xca
 [&lt;60001b59&gt;] start_kernel+0x47f/0x57e
 [&lt;600035bc&gt;] start_kernel_proc+0x49/0x4d
 [&lt;6006c483&gt;] ? kmsg_dump_register+0x82/0x8a
 [&lt;6001de62&gt;] new_thread_handler+0x81/0xb2
 [&lt;60003571&gt;] ? kmsg_dumper_stdout_init+0x1a/0x1c
 [&lt;60020c75&gt;] uml_finishsetup+0x54/0x59

random: get_random_bytes called from init_oops_id+0x27/0x34 with crng_init=0
---[ end trace 00173d0117a88acb ]---
Calibrating delay loop... 6941.90 BogoMIPS (lpj=34709504)

Signed-off-by: Maciej Żenczykowski &lt;maze@google.com&gt;
Cc: Jeff Dike &lt;jdike@addtoit.com&gt;
Cc: Richard Weinberger &lt;richard@nod.at&gt;
Cc: Anton Ivanov &lt;anton.ivanov@cambridgegreys.com&gt;
Cc: linux-um@lists.infradead.org
Cc: linux-kernel@vger.kernel.org

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>um: time: Use timespec64 for persistent clock</title>
<updated>2018-02-19T18:38:51+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2017-11-02T12:07:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=288fb3d5683f5089fa1ba9258e4351170c1f0401'/>
<id>288fb3d5683f5089fa1ba9258e4351170c1f0401</id>
<content type='text'>
This read_persistent_clock() implementation is the only remaining
caller of set_normalized_timespec(). Using read_persistent_clock64()
and set_normalized_timespec64() instead lets us remove the deprecated
interface in the future and helps make 32-bit arch/um get closer to
working beyond 2038.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This read_persistent_clock() implementation is the only remaining
caller of set_normalized_timespec(). Using read_persistent_clock64()
and set_normalized_timespec64() instead lets us remove the deprecated
interface in the future and helps make 32-bit arch/um get closer to
working beyond 2038.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>um/time: Fixup namespace collision</title>
<updated>2017-09-29T08:07:44+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2017-09-29T08:07:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=69b73e95982649a1f2dc63b8f08f2113d28f7fed'/>
<id>69b73e95982649a1f2dc63b8f08f2113d28f7fed</id>
<content type='text'>
The new timer_setup() function for struct timer_list collides with a
private um function. Rename it.

Fixes: 686fef928bba ("timer: Prepare to change timer callback argument type")
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Richard Weinberger &lt;richard@nod.at&gt;
Cc: Jeff Dike &lt;jdike@addtoit.com&gt;
Cc: user-mode-linux-devel@lists.sourceforge.net
Cc: Kees Cook  &lt;keescook@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The new timer_setup() function for struct timer_list collides with a
private um function. Rename it.

Fixes: 686fef928bba ("timer: Prepare to change timer callback argument type")
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Richard Weinberger &lt;richard@nod.at&gt;
Cc: Jeff Dike &lt;jdike@addtoit.com&gt;
Cc: user-mode-linux-devel@lists.sourceforge.net
Cc: Kees Cook  &lt;keescook@chromium.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
