zephyr/tests
Andy Ross 0f444c84e5 drivers/timer: Add a standard workaround for known qemu issues
Qemu doesn't like tickless.  By default[1] it tries to be realtime as
vied by the host CPU -- presenting read values from hardware cycle
counters and interrupt timings at the appropriate real world clock
times according to whatever the simulated counter frequency is.  But
when the host system is loaded, there is always the problem that the
qemu process might not see physical CPU time for large chunks of time
(i.e. a host OS scheduling quantum -- generally about the same size as
guest ticks!) leading to lost cycles.

When those timer interrupts are delivered by the emulated hardware at
fixed frequencies without software intervention, that's not so bad:
the work the guest has to do after the interrupt generally happens
synchronously (because the qemu process has just started running) and
nothing notices the dropout.

But with tickless, the interrupts need to be explicitly programmed by
guest software!  That means the driver needs to be sure it's going to
get some real CPU time within some small fraction of a Zephyr tick of
the right time, otherwise the computations get wonky.

The end result is that qemu tends to work with tickless well on an
unloaded/idle run, but not in situations (like sanitycheck) where it
needs to content with other processes for host CPU.

So, add a flag that drivers can use to "fake" tickless behavior when
run under qemu (only), and enable it (only!) for the small handful of
tests that are having trouble.

[1] There is an -icount feature to implement proper cycle counting at
the expense of real-world-time correspondence.  Maybe someday we might
get it to work for us.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-11-13 17:10:07 -05:00
..
application_development samples, tests: Use semi-accurate project names 2018-10-27 21:31:25 -04:00
benchmarks samples, tests: Use semi-accurate project names 2018-10-27 21:31:25 -04:00
bluetooth Bluetooth: shell: Remove macros to print messages 2018-11-13 20:42:01 +02:00
boards Kconfig: Remove unused symbols defined only in Kconfig.defconfig files 2018-11-13 16:04:01 -05:00
booting/stub samples, tests: Use semi-accurate project names 2018-10-27 21:31:25 -04:00
cmsis_rtos_v1 samples, tests: Use semi-accurate project names 2018-10-27 21:31:25 -04:00
compliance
crypto samples, tests: Use semi-accurate project names 2018-10-27 21:31:25 -04:00
drivers dts_fixups: Use DT_ prefix in all defined labels not related to Kconfig 2018-11-13 10:44:42 -06:00
include shell: Rename shell to legacy_shell 2018-09-19 09:30:29 -04:00
kernel drivers/timer: Add a standard workaround for known qemu issues 2018-11-13 17:10:07 -05:00
lib samples, tests: Use semi-accurate project names 2018-10-27 21:31:25 -04:00
misc/test_build samples, tests: Use semi-accurate project names 2018-10-27 21:31:25 -04:00
net tests: net: ethernet_mgmt: Enable IPv6 for this test 2018-11-08 15:23:05 +02:00
posix samples, tests: Use semi-accurate project names 2018-10-27 21:31:25 -04:00
power samples, tests: Use semi-accurate project names 2018-10-27 21:31:25 -04:00
shell samples, tests: Use semi-accurate project names 2018-10-27 21:31:25 -04:00
subsys dts_fixups: Use DT_ prefix in all defined labels not related to Kconfig 2018-11-13 10:44:42 -06:00
unit samples, tests: Use semi-accurate project names 2018-10-27 21:31:25 -04:00
ztest samples, tests: Use semi-accurate project names 2018-10-27 21:31:25 -04:00
CMakeLists.txt
Kconfig tests: add Kconfig for testing via shell 2018-11-05 09:32:38 -05:00