History log of /seL4-camkes-master/tools/rumprun/platform/hw/arch/x86/clock.c
Revision Date Author Comments
# 1f7cabf8 16-Oct-2017 Kent McLeod <Kent.Mcleod@data61.csiro.au>

Update hw for benchmarking and api changes

The hw platform is maintained in order to run benchmark comparisons with
the seL4 platform. As we develop the seL4 platform we change some of
the library apis. This commit adds:
- Extra interrupt numbers to the PIC
- A serial input interrupt handler for saving, resetting and printing
the tsc for measuring idle time
- Changes default console output to use COM port instead of VGA
- Changes for changed library functions
- A rumprun-bake configuration for only using ethernet modules


# a83f67b7 27-Dec-2015 Antti Kantee <pooka@iki.fi>

x86: keep state for both PICs


# e50c86f3 13-Oct-2015 Martin Lucina <martin@lucina.net>

Improve detection of pvclock

There are two MSR variants, old-style and new-style. We want to prefer
the new-style one, and neither if the relevant flags aren't set in
CPUID.


# 22fcdaa9 13-Oct-2015 Martin Lucina <martin@lucina.net>

Improve separation of pvclock/tscclock

Allows us to init pvclock and fall back to tscclock if pvclock is
unavailable. Also allows for easier implementation of e.g. Xen HVM use
of pvclock later.


# 0b8fd7cb 13-Oct-2015 Martin Lucina <martin@lucina.net>

pvclock_read_wall_clock reads boot time, not current time


# 1118fa6e 12-Oct-2015 Martin Lucina <martin@lucina.net>

Fix mul64_32() for i386 clobbering CF


# 3ddc4c05 12-Oct-2015 Martin Lucina <martin@lucina.net>

Implement KVM pvclock support (#36)


# 7dee79f8 01-Oct-2015 Martin Lucina <martin@lucina.net>

Remove broken abstraction in x86_cpuid()

CPUID is a mess, remove the broken abstraction in x86_cpuid() which
tries to detect the maximum supported level, as it gets in the way of
using other CPUID leaves (hypervisor detection).


# 644a1fed 10-Sep-2015 Antti Kantee <pooka@iki.fi>

Reduce export of clock routines where unnecessary.


# 12a1b233 20-Aug-2015 Antti Kantee <pooka@iki.fi>

Make delta_ticks unsigned, it's expected to be unsigned


# b403ff36 20-Aug-2015 Antti Kantee <pooka@iki.fi>

Fish for interrupts if returning from block() before timeout.


# cdf29518 20-Aug-2015 Antti Kantee <pooka@iki.fi>

Shortcircuit block is sleeptime is <=0, not only when <0.


# d31d308a 15-Aug-2015 Antti Kantee <pooka@iki.fi>

Enable interrupts "atomically" in x86 bmk_platform_cpu_halt().

Otherwise, we might even miss the clock interrupt, let alone other
interrupts which should prevent us from sleeping.


# dcc2b3f1 15-Aug-2015 Antti Kantee <pooka@iki.fi>

bmk_platform_block() -> bmk_platform_cpu_block()

It's arch-dependent anyway, no point in wrapping it.


# b1c8d596 07-Aug-2015 Antti Kantee <pooka@iki.fi>

Make the clock routines bmk_platform_cpu_clock_foo

bmk can now directly call into the relevant code instead of a bounce.


# 4f49cab4 02-Aug-2015 Antti Kantee <pooka@iki.fi>

actually commit the code changes too (for previous commit)


# 77fa03e0 02-Aug-2015 Antti Kantee <pooka@iki.fi>

remove bmk_ prefix from routines private to platform/hw


# 9cc025bb 08-Jul-2015 Antti Kantee <pooka@iki.fi>

remove unnecessary critical section


# 992bb2d1 07-Jul-2015 Antti Kantee <pooka@iki.fi>

clarify RTC_UIP comment


# 2709d67b 07-Jul-2015 Antti Kantee <pooka@iki.fi>

if bmk_isr_clock() does nothing, let's simply not call it


# eeec6be5 08-Jul-2015 Antti Kantee <pooka@iki.fi>

formatting nits

no functional change


# 11c4f207 06-Jul-2015 Martin Lucina <martin@lucina.net>

Cosmetic fix


# 0775b69e 06-Jul-2015 Martin Lucina <martin@lucina.net>

hw: Check for TSC support and invariant TSC


# 964ebd4a 06-Jul-2015 Martin Lucina <martin@lucina.net>

hw: Fix conditions in bmk_cpu_block and simplify common codepath

While removing the while loop in bmk_cpu_block(), the wrong condition
for running into the main codepath crept in. This was manifesting as
clock running slow on x86_64.

This commit fixes the conditions and cleans up the codepath to make the
control flow for the common case easier to follow.


# b798de61 03-Jul-2015 Martin Lucina <martin@lucina.net>

hw: Return from bmk_cpu_block() on any interrupt

If we get a non-timer interrupt then this may schedule work, so just
return into the scheduler after coming out of hlt().


# 0b54cfca 03-Jul-2015 Martin Lucina <martin@lucina.net>

hw: Decouple clock.c from rump kernel HZ

Clock setup does not actually depend on HZ in any way, so don't refer to
it.


# 9797aa6e 03-Jul-2015 Martin Lucina <martin@lucina.net>

hw: Add critical sections in arch/x86/clock.c

Add three critical sections:

1) While reading RTC wall time.
2) While calibrating the TSC.
3) When updating time_base and tsc_base in bmk_cpu_clock_now().

Technically the first two are not required since interrupts should not
be running at this point, but play it safe in case someone reorders the
platform initialisation code later.


# 71d7142e 03-Jul-2015 Martin Lucina <martin@lucina.net>

hw: Move rdtsc() to include/arch/x86/inline.h


# 7eebac9b 30-Jun-2015 Martin Lucina <martin@lucina.net>

Fix typo in 64-bit version of mul64_32


# 8aaf4379 30-Jun-2015 Martin Lucina <martin@lucina.net>

hw: Implement wall time using RTC offset at boot

Addresses issue #31.


# 61015f6d 30-Jun-2015 Martin Lucina <martin@lucina.net>

hw: Calculate tick/nsec conversions using 128-bit multiplication

Calculate tick to nsec / nsec to tick conversions using
128-bit multiplication. This avoids overflows, and in the case of
converting nanoseconds to PIT ticks is also slightly faster as it does
not use division.


# 7eade13a 26-Jun-2015 Martin Lucina <martin@lucina.net>

hw: Dynamically program PIT in one-shot mode when idle

Instead of running the clock interrupt with a fixed periodic tick when
idle, dynamically program the PIT in one-shot mode to fire a single
interrupt after the requested delay has elapsed.


# b0406eb7 25-Jun-2015 Martin Lucina <martin@lucina.net>

hw: Calibrate TSC and correctly scale monotonic time

This is the first phase of addressing issue #30. We calibrate the TSC at
boot against the i8254 timer and calculate a scaleing factor for
monotonic time.


# 8874ba38 22-Jun-2015 Martin Lucina <martin@lucina.net>

hw: Consolidate clock-related code

This commit consolidates the common clock-related functions for the x86
and amd64 hw platform into platform/hw/arch/x86/clock.c.

No functional change intended.