Skip to content
Commit 00bfecaa authored by Paolo Bonzini's avatar Paolo Bonzini Committed by Gleb Natapov
Browse files

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: default avatarAvi Kivity <avi.kivity@gmail.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarGleb Natapov <gleb@redhat.com>
parent 6cff92dd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment