vmexit: time the number of cycles for simple PIO
This patch adds three scenarios to the vmexit test. Two are very simple PIO cases that are handled in the kernel (reading from and writing to ELCR). The other is an unmapped PIO that is handled in userspace. The difference between the two reading scenarios is roughly the cost of a userspace exit; the existing inl_from_pmtimer test is not precise enough, because the device model has a pretty high cost. The difference between the kernel read and write is the cost of emulation, because inl_from_kernel goes through the whole emulation stuff while outl does not (it is used for virtio, while the speed of inl matters less). Example: vmcall 3898 inl_from_pmtimer 24615 inl_from_qemu 20574 inl_from_kernel 7237 outl_to_kernel 4451 So the cost of exiting to userspace is 13000 cycles on this machine, and the cost of emulation is 3300 cycles. Suggested-by:Avi Kivity <avi.kivity@gmail.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Gleb Natapov <gleb@redhat.com>
Loading
Please register or sign in to comment