KVM Forum Day 2

Thursday, October 26, 2017

Keynote: State of KVM

Some statistics about KVM. Paolo Bonzini shines both as a coder, reviewer and repairman. All architectures are represented in similar way, surprised me.

Optimizing KVM for ARM

Interesting explanation about the execution models for the ARM hypervisors. Has an execution model for user space (EL0), kernel (EL1) and hypervisor (EL2), which makes things harder for ARM KVM because you have two EL1 contexts, and issues with sharing EL1 registers. So there are now extensions to run code designed for EL1 at EL2. Weird.

Extensions are called VHE

In legacy mode, you have to trap to enter EL2.

Linux (EL1) -> KVM (EL1) -> Lowvisor (EL2)

It's disturbing to have a higher number for "lower rings"

#ifdef HAS_ARM_VIRT_EXTENSIONS
       mov msr_el2, x0

#else mov msr_el1, x0 #endif

Page table formats have to be interpreted in different ways between EL2 and EL0. Don't have separate X rights for EL0 and EL2. So that would make it possible for user-space to execute kernel code by jumping into a kernel address.

Hypercall cost goes from 3181 to 3045 for microbenchmark

Optimized versoin runs the main loop differently in vhe and non-VHE mode. With that, the results are much more interesting. Virtual IPI goes from 14155 cycles to 2526 (3102 on x86)