Internships/ProjectIdeas/PackedShadowVirtqueue: Difference between revisions

From QEMU
No edit summary
(Add length and "Internship task" TODOs)
Line 27: Line 27:


'''Internship tasks:'''
'''Internship tasks:'''
* ''TODO''
* Build the hands on blogs scenarios as development environment.
* Understand (in a very high level) the virtqueue handling code, using the virtqueues blogs, the code from QEMU hw/virtio/virtio.c and the kernel drivers/virtio/virtio_ring.c.
* Develop the basic code of the packet virtqueue in vhost-shadow-virtqueue.c, ignoring features like indirect.
* Add event_idx code.


'''Links:'''
'''Links:'''
* https://www.redhat.com/en/blog/hands-vdpa-what-do-you-do-when-you-aint-got-hardware-part-1
* https://www.redhat.com/en/blog/hands-vdpa-what-do-you-do-when-you-aint-got-hardware-part-2
* https://www.redhat.com/en/blog/virtio-devices-and-drivers-overview-headjack-and-phone
* https://www.redhat.com/en/blog/virtio-devices-and-drivers-overview-headjack-and-phone
* https://www.redhat.com/en/blog/virtqueues-and-virtio-ring-how-data-travels
* https://www.redhat.com/en/blog/virtqueues-and-virtio-ring-how-data-travels
Line 37: Line 42:


'''Details:'''
'''Details:'''
* Project size: ''TODO''
* Project size: Medium
* Skill level: Intermediate
* Skill level: Intermediate
* Language: C
* Language: C
* Mentors: Eugenio Perez Martin <eperezma@redhat.com>
* Mentors: Eugenio Perez Martin <eperezma@redhat.com>

Revision as of 12:04, 30 January 2024

Add packed virtqueue to Shadow Virtqueue

Summary: Add the packed virtqueue format support to QEMU's Shadow Virtqueue.

To live migrate a guest with a passthrough device, QEMU needs a way to know which memory the device modifies so it is able to migrate it every time it is modified. Otherwise the migrated guest would resume with outdated memory contents after live migration.

This is especially hard with passthrough hardware devices, as transports like PCI impose a few security and performance challenges. As a method to overcome this for VIRTIO devices, QEMU can offer an emulated virtqueue to the device, called a Shadow Virtqueue (SVQ), instead of allowing the device to communicate directly with the guest. SVQ will then forward the writes to the guest, being the effective writer in the guest memory and knowing when a portion of it needs to be migrated again.

Compared with the original Split Virtqueue layout already supported by Shadow Virtqueues, the Packed Virtqueue layout is a more compact representation that uses less memory size and allows both devices and drivers to exchange the same amount of information with fewer memory operations.

The task is to complete the packed virtqueue support for SVQ, using the kernel VIRTIO ring driver as a reference. There is already a setup that can be used to test the changes.

Internship tasks:

  • Build the hands on blogs scenarios as development environment.
  • Understand (in a very high level) the virtqueue handling code, using the virtqueues blogs, the code from QEMU hw/virtio/virtio.c and the kernel drivers/virtio/virtio_ring.c.
  • Develop the basic code of the packet virtqueue in vhost-shadow-virtqueue.c, ignoring features like indirect.
  • Add event_idx code.

Links:

Details:

  • Project size: Medium
  • Skill level: Intermediate
  • Language: C
  • Mentors: Eugenio Perez Martin <eperezma@redhat.com>