zephyr/drivers/timer
Gustavo Lima Chaves 9bb07ff69a jailhouse: add support for x2APIC mode for all LOAPIC accesses
Besides the fact that we did not have that for the current supported
boards, that makes sense for this new, virtualized mode, that is meant
to be run on top of full-fledged x86 64 CPUs.

By having xAPIC mode access only, Jailhouse has to intercept those MMIO
reads and writes, in order to examine what they do and arbitrate if it's
safe or not (e.g. not all values are accepted to ICR register). This
means that we can't run away from having a VM-exit event for each and
every access to APIC memory region and this impacts the latency the
guest OS observes over bare metal a lot.

When in x2APIC mode, Jailhouse does not require VM-exits for MSR
accesses other that writes to the ICR register, so the latency the guest
observes is reduced to almost zero.

Here are some outputs of the the command line

  $ sudo ./tools/jailhouse cell stats tiny-demo

on a Jailhouse's root cell console, for one of the Zephyr demos using
LOAPIC timers, left for a couple of seconds:

Statistics for tiny-demo cell (x2APIC root, x2APIC inmate)

COUNTER                              SUM   PER SEC
vmexits_total                          7         0
vmexits_management                     3         0
vmexits_cr                             2         0
vmexits_cpuid                          1         0
vmexits_msr                            1         0
vmexits_exception                      0         0
vmexits_hypercall                      0         0
vmexits_mmio                           0         0
vmexits_pio                            0         0
vmexits_xapic                          0         0
vmexits_xsetbv                         0         0

Statistics for tiny-demo cell (xAPIC root, xAPIC inmate)

COUNTER                              SUM   PER SEC
vmexits_total                       4087        40
vmexits_xapic                       4080        40
vmexits_management                     3         0
vmexits_cr                             2         0
vmexits_cpuid                          1         0
vmexits_msr                            1         0
vmexits_exception                      0         0
vmexits_hypercall                      0         0
vmexits_mmio                           0         0
vmexits_pio                            0         0
vmexits_xsetbv                         0         0

Statistics for tiny-demo cell (xAPIC root, x2APIC inmate)

COUNTER                              SUM   PER SEC
vmexits_total                       4087        40
vmexits_msr                         4080        40
vmexits_management                     3         0
vmexits_cr                             2         0
vmexits_cpuid                          1         0
vmexits_exception                      0         0
vmexits_hypercall                      0         0
vmexits_mmio                           0         0
vmexits_pio                            0         0
vmexits_xapic                          0         0
vmexits_xsetbv                         0         0

See that under x2APIC mode on both Jailhouse/root-cell and guest, the
interruptions from the hypervisor are minimal. That is not the case when
Jailhouse is on xAPIC mode, though. Note also that, as a plus, x2APIC
accesses on the guest will map to xAPIC MMIO on the hypervisor just
fine.

Signed-off-by: Gustavo Lima Chaves <gustavo.lima.chaves@intel.com>
2017-11-07 08:58:49 -05:00
..
altera_avalon_timer.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
arcv2_timer0.c cleanup: rename fiber/task -> thread 2017-10-30 18:41:15 -04:00
cortex_m_systick.c tests: benchmark: timing_info: Change API/variable Name. 2017-08-31 14:25:31 -04:00
hpet.c linker: move all linker headers to include/linker 2017-06-18 09:24:04 -05:00
Kconfig timer: riscv_machine_timer driver depends on SOC_FAMILY_RISCV_PRIVILEGE 2017-04-02 15:14:59 +00:00
loapic_timer.c jailhouse: add support for x2APIC mode for all LOAPIC accesses 2017-11-07 08:58:49 -05:00
Makefile Xtensa port: Added support for Xtensa internal timer as system timer. 2017-02-13 08:04:27 -08:00
nrf_rtc_timer.c doc: Fix misspellings in header/doxygen comments 2017-10-17 19:40:29 -04:00
pulpino_timer.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
riscv_machine_timer.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
sys_clock_init.c drivers: timer: init earlier in boot sequence 2017-07-10 11:44:56 -07:00
xtensa_sys_timer.c timer: xtensa_sys_timer: Tickless Kernel Implementation for Xtensa 2017-11-07 08:17:40 -05:00