Skip to contentSkip to conversation

qemu vs. kvm: When to flush the coalesced mmio buffer?

DISCUSSION Jan Kiszka 3 participants 4 messages Jan 3, 2011 KVM

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

Hi again,

another subtle difference between qemu-kvm and upstream:

When we leave the guest for an IO window (KVM_RUN returns EINTR or EAGAIN), we call kvm_flush_coalesced_mmio_buffer in qemu-kvm but not in upstream. When version is better? I can't find any rationales in both git logs.

Jan

#1 lore raw
Quoted 9 lines · Jan Kiszka

Hi again,

another subtle difference between qemu-kvm and upstream:

When we leave the guest for an IO window (KVM_RUN returns EINTR or EAGAIN), we call kvm_flush_coalesced_mmio_buffer in qemu-kvm but not in upstream. When version is better? I can't find any rationales in both git logs.

Since coalesced mmio is used to prevent unnecessary exits to userspace if vcpu thread is already in userspace why not flush coalesced mmio buffer?

--
Gleb.

#2 lore raw
In reply to Jan Kiszka
Quoted 8 lines · Jan Kiszka

Hi again,

another subtle difference between qemu-kvm and upstream:

When we leave the guest for an IO window (KVM_RUN returns EINTR or EAGAIN), we call kvm_flush_coalesced_mmio_buffer in qemu-kvm but not in upstream. When version is better? I can't find any rationales in both git logs.

We must flush on EINTR, otherwise a live migration can leave some mmios in the source host and not replay them on the destination host.

(plus, as Gleb says, if you're in userspace you might as well flush)

Signature · 1 line
error compiling committee.c: too many arguments to function
author
#3 lore raw
Quoted 10 lines · Avi Kivity
Quoted 8 lines · Jan Kiszka

Hi again,

another subtle difference between qemu-kvm and upstream:

When we leave the guest for an IO window (KVM_RUN returns EINTR or EAGAIN), we call kvm_flush_coalesced_mmio_buffer in qemu-kvm but not in upstream. When version is better? I can't find any rationales in both git logs.

Quoted 5 lines

We must flush on EINTR, otherwise a live migration can leave some mmios in the source host and not replay them on the destination host.

(plus, as Gleb says, if you're in userspace you might as well flush)

OK, will append a fix to my series.

Thanks,
Jan