Message ID | 20220607170239.120084-1-jean-philippe.brucker@arm.com (mailing list archive) |
---|---|
Headers | show |
Series | Virtio v1 support | expand |
On Tue, Jun 07, 2022 at 06:02:15PM +0100, Jean-Philippe Brucker wrote: > Add support for version 1 of the virtio transport to kvmtool. Based on a > RFC by Sasha Levin [1], I've been trying to complete it here and there. > It's long overdue and is quite painful to rebase, so let's get it > merged. > > Several reasons why the legacy transport needs to be replaced: > > * Only 32 feature bits are supported. Most importantly > VIRTIO_F_ACCESS_PLATFORM, which forces a Linux guest to use the DMA > API, cannot be enabled. So we can't support private guests that > decrypt or share only their DMA memory with the host. Woohoo! > * Legacy virtqueue address is a 32-bit pfn, aligned on 4kB. Since Linux > guests bypass the DMA API they can't support large GPAs. > > * New devices types (iommu, crypto, memory, etc) and new features cannot > be supported. > > * New guests won't implement the legacy transport. Existing guests will > eventually drop legacy support. > > Support for modern transport becomes the default and legacy is enabled > with --virtio-legacy. > > I only tested what I could: vsock, scsi and vhost-net are currently > broken and can be fixed later (they have issues with mem regions and > feature mask, among other things). I also haven't tested big-endian. If these are broken, then shall we default to legacy mode and have the modern transport be opt-in? Otherwise we're regressing people in a confusing way. Will
On Tue, 7 Jun 2022 18:02:15 +0100, Jean-Philippe Brucker wrote: > Add support for version 1 of the virtio transport to kvmtool. Based on a > RFC by Sasha Levin [1], I've been trying to complete it here and there. > It's long overdue and is quite painful to rebase, so let's get it > merged. > > Several reasons why the legacy transport needs to be replaced: > > [...] Applied patches 1-16 to kvmtool (master), thanks! [01/24] virtio: Add NEEDS_RESET to the status mask https://git.kernel.org/will/kvmtool/c/7efc2622d5ee [02/24] virtio: Remove redundant test https://git.kernel.org/will/kvmtool/c/3a1e36e4bf49 [03/24] virtio/vsock: Remove redundant state tracking https://git.kernel.org/will/kvmtool/c/a8e397bb9dd9 [04/24] virtio: Factor virtqueue initialization https://git.kernel.org/will/kvmtool/c/fd41cde06617 [05/24] virtio: Support modern virtqueue addresses https://git.kernel.org/will/kvmtool/c/609ee9066879 [06/24] virtio: Add config access helpers https://git.kernel.org/will/kvmtool/c/15e6c4e74d06 [07/24] virtio: Fix device-specific config endianness https://git.kernel.org/will/kvmtool/c/867b15ccd7da [08/24] virtio/console: Remove unused callback https://git.kernel.org/will/kvmtool/c/17ad9fd6ce37 [09/24] virtio: Remove set_guest_features() device op https://git.kernel.org/will/kvmtool/c/902a8ecb3877 [10/24] Add memcpy_fromiovec_safe https://git.kernel.org/will/kvmtool/c/c492534f3ac9 [11/24] virtio/net: Offload vnet header endianness conversion to tap https://git.kernel.org/will/kvmtool/c/8b27bcff44fd [12/24] virtio/net: Prepare for modern virtio https://git.kernel.org/will/kvmtool/c/b231683c3361 [13/24] virtio/net: Implement VIRTIO_F_ANY_LAYOUT feature https://git.kernel.org/will/kvmtool/c/6daffe57762c [14/24] virtio/console: Add VIRTIO_F_ANY_LAYOUT feature https://git.kernel.org/will/kvmtool/c/e74b56e1495c [15/24] virtio/blk: Implement VIRTIO_F_ANY_LAYOUT feature https://git.kernel.org/will/kvmtool/c/484278913807 [16/24] virtio/pci: Factor MSI route creation https://git.kernel.org/will/kvmtool/c/f44af23e3a62 Cheers,
On Thu, Jun 09, 2022 at 01:39:48PM +0100, Will Deacon wrote: > On Tue, Jun 07, 2022 at 06:02:15PM +0100, Jean-Philippe Brucker wrote: > > Add support for version 1 of the virtio transport to kvmtool. Based on a > > RFC by Sasha Levin [1], I've been trying to complete it here and there. > > It's long overdue and is quite painful to rebase, so let's get it > > merged. > > > > Several reasons why the legacy transport needs to be replaced: > > > > * Only 32 feature bits are supported. Most importantly > > VIRTIO_F_ACCESS_PLATFORM, which forces a Linux guest to use the DMA > > API, cannot be enabled. So we can't support private guests that > > decrypt or share only their DMA memory with the host. > > Woohoo! > > > * Legacy virtqueue address is a 32-bit pfn, aligned on 4kB. Since Linux > > guests bypass the DMA API they can't support large GPAs. > > > > * New devices types (iommu, crypto, memory, etc) and new features cannot > > be supported. > > > > * New guests won't implement the legacy transport. Existing guests will > > eventually drop legacy support. > > > > Support for modern transport becomes the default and legacy is enabled > > with --virtio-legacy. > > > > I only tested what I could: vsock, scsi and vhost-net are currently > > broken and can be fixed later (they have issues with mem regions and > > feature mask, among other things). I also haven't tested big-endian. > > If these are broken, then shall we default to legacy mode and have the > modern transport be opt-in? Otherwise we're regressing people in a > confusing way. What I meant was that even without these patches, I wasn't able to use any of the vhost devices, they already had several bugs. But now that I spent a little more time trying to fix them, it looks like the modern transport does add one regression (vhost ioeventfd is set on I/O port but modern transport uses MMIO). I'll sort this out and resend. Thanks for picking up the base patches! Thanks, Jean