linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC 0/3] Xen on Virtio
@ 2015-12-07 16:19 Stefano Stabellini
  2015-12-07 16:19 ` [PATCH RFC 1/3] xen: export xen_phys_to_bus, xen_bus_to_phys and xen_virt_to_bus Stefano Stabellini
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Stefano Stabellini @ 2015-12-07 16:19 UTC (permalink / raw)
  To: mst; +Cc: virtualization, linux-kernel, xen-devel, Stefano Stabellini

Hi all,

this patch series introduces support for running Linux on top of Xen
inside a virtual machine with virtio devices (nested virt scenario).
The problem is that Linux virtio drivers use virt_to_phys to get the
guest pseudo-physical addresses to pass to the backend, which doesn't
work as expected on Xen.

Switching the virtio drivers to the dma APIs (dma_alloc_coherent,
dma_map/unmap_single and dma_map/unmap_sg) would solve the problem, as
Xen support in Linux provides an implementation of the dma API which
takes care of the additional address conversions. However using the dma
API would increase the complexity of the non-Xen case too. We would also
need to keep track of the physical or virtual address in addition to the
dma address for each vring_desc to be able to free the memory in
detach_buf (see patch #3).

Instead this series adds few obvious checks to perform address
translations in a couple of key places, without changing non-Xen code
paths. You are welcome to suggest improvements or alternative
implementations.

Thanks,

Stefano


Stefano Stabellini (3):
      xen: export xen_phys_to_bus, xen_bus_to_phys and xen_virt_to_bus
      xen/virtio: allocate a contiguous region to be use as virtio queue
      xen/virtio_ring: introduce cpu_to_virtio_addr and virtio_addr_to_cpu

 drivers/virtio/virtio_pci_legacy.c |   19 +++++++++++++++----
 drivers/virtio/virtio_ring.c       |    9 +++++----
 drivers/xen/swiotlb-xen.c          |   31 -------------------------------
 include/linux/virtio_config.h      |   14 ++++++++++++++
 include/xen/swiotlb-xen.h          |   32 ++++++++++++++++++++++++++++++++
 5 files changed, 66 insertions(+), 39 deletions(-)

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-01-11 23:03 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-07 16:19 [PATCH RFC 0/3] Xen on Virtio Stefano Stabellini
2015-12-07 16:19 ` [PATCH RFC 1/3] xen: export xen_phys_to_bus, xen_bus_to_phys and xen_virt_to_bus Stefano Stabellini
2015-12-14 14:12   ` [Xen-devel] " David Vrabel
2015-12-07 16:19 ` [PATCH RFC 2/3] xen/virtio: allocate a contiguous region to be use as virtio queue Stefano Stabellini
2015-12-07 16:19 ` [PATCH RFC 3/3] xen/virtio_ring: introduce cpu_to_virtio_addr and virtio_addr_to_cpu Stefano Stabellini
2015-12-14 14:00 ` [Xen-devel] [PATCH RFC 0/3] Xen on Virtio David Vrabel
2015-12-14 14:12   ` Michael S. Tsirkin
2015-12-14 18:27     ` Andy Lutomirski
2015-12-15 12:13       ` Stefano Stabellini
2015-12-15 16:45         ` Andy Lutomirski
2015-12-15 20:44           ` Michael S. Tsirkin
2015-12-15 20:40       ` Michael S. Tsirkin
2016-01-11 23:03         ` Andy Lutomirski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).