zephyr/include
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
..
arch x86: Jailhouse port, tested for UART (# 0, polling) and LOAPIC timer 2017-11-07 08:58:49 -05:00
bluetooth Bluetooth: Add support for Link Layer Privacy 2017-11-06 12:50:40 +02:00
crypto crypto: Remove useless attribute 2017-04-27 13:06:31 +00:00
debug object_tracing: fix definition 2017-08-16 10:59:10 -07:00
dfu DFU: add module for store the image 2017-09-11 11:37:43 -04:00
display doc: spelling check doxygen comments include/ 2017-05-02 22:21:37 -04:00
drivers jailhouse: add support for x2APIC mode for all LOAPIC accesses 2017-11-07 08:58:49 -05:00
dt-bindings dts: Add Kinetis SIM clock bindings 2017-10-20 12:28:11 -05:00
fs subsys: fs: consolidate elm FAT kconfig options 2017-10-03 08:43:50 -04:00
linker linker: use quotes with OUTPUT_ARCH macro 2017-10-31 12:32:34 -04:00
logging cleanup: rename fiber/task -> thread 2017-10-30 18:41:15 -04:00
misc sys: slist, dlist: Improve "not thread safe" docstrings 2017-10-17 17:39:15 -04:00
net net: http: Deprecate old HTTP library 2017-11-06 09:33:00 -05:00
random subsys: Add random subsystem 2017-11-01 08:26:29 -04:00
shell shell: Add define to _SHELL_H_ 2017-06-09 18:54:27 -04:00
toolchain kernel: abolish __syscall_inline 2017-10-03 16:16:03 -04:00
usb doc: Fix misspellings in header/doxygen comments 2017-10-17 19:40:29 -04:00
zephyr Introduce new sized integer typedefs 2017-04-20 16:07:08 +00:00
adc.h drivers: adc: add system call handlers 2017-10-30 13:20:19 -07:00
aio_comparator.h drivers: aio_comparator: add system calls 2017-10-30 13:20:19 -07:00
atomic.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
cache.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
clock_control.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
console.h doc: fix misspellings in include (API docs) 2017-08-10 12:22:19 -04:00
counter.h drivers: counter: add syscall handlers 2017-10-30 13:20:19 -07:00
crc16.h drivers: crc: Add 'pad' parameter to crc16() 2017-08-17 22:19:19 -04:00
device.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
disk_access.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
dma.h drivers: dma: remove deprecated API functions 2017-09-22 07:50:20 -04:00
entropy.h drivers: Rename random to entropy 2017-11-01 08:26:29 -04:00
eth.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
flash.h drivers: flash: add system calls 2017-10-30 13:20:19 -07:00
fs.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
gpio.h drivers: gpio: deprecate GPIO_PIN_ENABLE, GPIO_PIN_DISABLE 2017-11-02 18:46:30 -04:00
i2c.h drivers: i2c: add system call handlers 2017-10-30 13:20:19 -07:00
i2s.h doc: replace UTF-8 chars 2017-10-03 20:03:57 -04:00
init.h kernel: remove deprecated init levels 2017-04-07 17:45:34 +00:00
ipm.h drivers: ipm: add system calls 2017-10-30 13:20:19 -07:00
irq_offload.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
irq.h irq.h: include generic toolchain header 2017-08-16 10:59:10 -07:00
json.h lib: json: move json.h to include/ 2017-10-03 14:50:14 -04:00
kernel_version.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
kernel.h userspace: assign thread IDs at build time 2017-11-03 11:29:23 -07:00
led_strip.h drivers: led_strip: add public API for addressable LED strips 2017-10-28 13:23:30 -04:00
pinmux.h drivers: pinmux: add system call handlers 2017-10-30 13:20:19 -07:00
power.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
pthread.h kernel: POSIX thread IPC support 2017-08-15 19:42:07 -04:00
pwm.h drivers: pwm: add system call handlers 2017-10-30 13:20:19 -07:00
rtc.h drivers: rtc: add system calls 2017-10-30 13:20:19 -07:00
sensor.h cleanup: rename fiber/task -> thread 2017-10-30 18:41:15 -04:00
shared_irq.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
spi_legacy.h api: New SPI API 2017-05-19 18:52:25 -04:00
spi.h drivers: spi: add system call handlers 2017-10-30 13:20:19 -07:00
sw_isr_table.h sw_isr_table.h: fix includes 2017-10-27 16:08:54 -04:00
sys_clock.h kernel: tickless: Add tickless kernel support 2017-04-27 13:46:28 +00:00
sys_io.h sys_io.h: don't pull in kernel.h 2017-11-02 13:25:01 -07:00
syscall.h kernel: allow system call with 64-bit return val 2017-10-12 16:25:00 -07:00
toolchain.h xtensa: move byte-order macros out of arch.h 2017-05-11 12:47:23 -04:00
uart.h drivers: uart: add system call handlers 2017-10-30 13:20:19 -07:00
watchdog.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
zephyr.h kernel: remove legacy.h and MDEF support 2017-04-19 10:59:35 -05:00