Re: tlb flush after each vm_exit, also virtual interrupts injection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> >> So in the case of write I/O using virtio-blk dataplane=off
> >> [...] What is going to happen after the host there is
> >> the real I/O completion, the host complete bh is executed?  We go
> >> through iothread to guest, in order to executte the
> >> virtio-blk-complete request?
> >
> 
> How did the control transfer to QEMU user space (and which thread is
> running vcpu or worker)
> ->virtio_blk_device_realize
> -> virtio_blk_req_complete
> Was it the "real" interrupt for I/O completion from the device?
> 
> Which qemu thread executes the code you mentioned?, vcpu or a
> worker(iothread or main_loop)  When did iothread finish its work?

There are two ways:

1) the VCPU thread starts the I/O (control is transferred to QEMU user space
by leaving KVM_RUN).  The I/O system call happens in a worker thread.  When the
systemc call is finished the worker thread wakes up the I/O thread and the I/O
thread executes virtio_blk_req_complete.

2) the VCPU thread (which is running KVM_RUN) writes to an eventfd, which wakes
up the I/O thread.  The I/O thread runs the I/O system call in a worker
thread, same as case 1.  Also like case 1, when the I/O is finished the
worker thread wakes up the I/O thread and the I/O thread executes
virtio_blk_req_complete.

> I know that there are many exit reasons, but it's not clear to me
> HOW exactly, transfer the control from the execution of one of these
> instructions
> to VMEXIT point which is "vmx_return: " _ASM_PTR " 2b \n\t"
> Where does this extraction happened and we jumped to this label?
> Is it inside of the corresponding ioctl implementation?
> 
> I guess the answer is: "read the manual", which is fine to me, because
> you already helped me a lot :)

This is a more specific question, and thus easier to answer: after a
vmexit the instruction pointer is reset to the VMCS's HOST_RIP field,
and KVM writes the address of vmx_return to that field. :)

Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux