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

RE: question about virtio-vsock on xen


  • To: Stefano Stabellini <stefano.stabellini@xxxxxxx>
  • From: Peng Fan <peng.fan@xxxxxxx>
  • Date: Tue, 27 Feb 2024 00:38:26 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3z97EjzGtu9/xxGGajgA60u5lrmI1O9k7D6WquivLoc=; b=K/MWDVzwx+EQX7NIyRCUCWkMM6jl7CrrEVTyFAfivUcKdSSpRxackFJwDpZ5vIJHVN2KS3SgM8c0UBbUKCiJduAaS4DifVCTNhuEcqwhT9Qbrr8e1VSGKd2FnMUc3sva/ooxS+sXTfSHi7vkgTgrjoxNwEYLPHTUt6aHQZ7YhLrqqH3WCEr8LOqcS43PXYoohCmHO8TZEMbvJDn0UewohKT2v6zuUjh7xOp3ZmX8O2WG3MIX2Ec5WQW+ZHucSjrgxnCe66WUis+tmszrHWoKo+dKrI72rvdVwPSpZFcqSE3AhX8LWvpRl9NXh02J6IfFu5I7H2jXjuV+Dj38wLUF+g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BvB1OMEAMRGEzGeYcguzntm56Zsby+CdnlNFZKo7QQUSlMmLNqfSsjqF8f3Ge0yEoOiaVsSOSVZKdn2JRhR9hPe8sRMcduGAsTSe4yJlYPW+yWQZh6JfBflJTKbM/bmjq9FWIrE1pxcMdXYB+X77edkHLgaU7k8VOWhdfQK+6GR3HPhuM7RCe+X03y3NBgc9JXPU2aIp38CSW5L0QVK9G/6xPdCWy88G3zAu/kFdkabN4In6J+Hqiu0pc31gUibiQiDTxn17gOQKblAABojU4rsIZfEsVBDVzeirLPDWNAgDz7wB9IA38Mcn49QlFLErftmqBoaT5topReijort2Ng==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com;
  • Cc: Julien Grall <julien@xxxxxxx>, "vikram.garhwal@xxxxxxx" <vikram.garhwal@xxxxxxx>, "oleksandr_tyshchenko@xxxxxxxx" <oleksandr_tyshchenko@xxxxxxxx>, Leo Yan <leo.yan@xxxxxxxxxx>, Viresh Kumar <viresh.kumar@xxxxxxxxxx>, "stewart.hildebrand@xxxxxxx" <stewart.hildebrand@xxxxxxx>, "sgarzare@xxxxxxxxxx" <sgarzare@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 27 Feb 2024 00:38:32 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AdpmUSXKZvg8Aft6RRu9smUwoggtbwAUAHAAAG+7FYAAJ8zQAAAFc0Og
  • Thread-topic: question about virtio-vsock on xen

> Subject: RE: question about virtio-vsock on xen
> 
> On Mon, 26 Feb 2024, Peng Fan wrote:
> > Hi Stefano,
> >
> > > Subject: Re: question about virtio-vsock on xen
> > >
> > > Hi Peng,
> > >
> > > We haven't tried to setup virtio-vsock yet.
> > >
> > > In general, I am very supportive of using QEMU for virtio backends.
> > > We use QEMU to provide virtio-net, virtio-block, virtio-console and more.
> >
> > Would you mind share how to setup virtio-console using qemu + xen?
> 
> Vikram (CCed) has been working on it and should be able to share more
> details
> 
> 
> > > However, typically virtio-vsock comes into play for VM-to-VM
> > > communication, which is different. Going via QEMU in Dom0 just to
> > > have 1 VM communicate with another VM is not an ideal design: it
> > > adds latency and uses resources in Dom0 when actually we could do
> without it.
> > >
> > > A better model for VM-to-VM communication would be to have the VM
> > > talk to each other directly via grant table or pre-shared memory
> > > (see the static shared memory feature) or via Xen hypercalls (see
> > > Argo.)
> >
> > The goal is to make android trout VM run with XEN + i.MX95, so need vsock.
> 
> I am not familiar with the details of Android Trout... Where is vsock used?
> Just asking for my own understanding.

Here is the link
https://source.android.com/docs/automotive/virtualization/reference_platform

vsock is used for audio control hal, dumpstate HAL, vehicle HAL.

Regards,
Peng.

> 
> 
> > > For a good Xen design, I think the virtio-vsock backend would need
> > > to be in Xen itself (the hypervisor).
> > >
> > > Of course that is more work and it doesn't help you with the
> > > specific question you had below :-)
> > >
> > > For that, I don't have a pointer to help you but maybe others in CC have.
> > >
> > > Cheers,
> > >
> > > Stefano
> > >
> > >
> > > On Fri, 23 Feb 2024, Peng Fan wrote:
> > > > Hi All,
> > > >
> > > > Has anyone make virtio-vsock on xen work? My dm args as below:
> > > >
> > > > virtio = [
> > > >
> > > 'backend=0,type=virtio,device,transport=pci,bdf=05:00.0,backend_type
> > > =qem
> > > u,grant_usage=true'
> > > > ]
> > > > device_model_args = [
> > > > '-D', '/home/root/qemu_log.txt',
> > > > '-d',
> > > > 'trace:*vsock*,trace:*vhost*,trace:*virtio*,trace:*pci_update*,tra
> > > > ce:* pci_route*,trace:*handle_ioreq*,trace:*xen*',
> > > > '-device',
> > > > 'vhost-vsock-pci,iommu_platform=false,id=vhost-vsock-pci0,bus=pcie
> > > > .0,a
> > > > ddr=5.0,guest-cid=3']
> > > >
> > > > During my test, it always return failure in dom0 kernel in below code:
> > > >
> > > > vhost_transport_do_send_pkt {
> > > > ...
> > > >                nbytes = copy_to_iter(hdr, sizeof(*hdr), &iov_iter);
> > > >                 if (nbytes != sizeof(*hdr)) {
> > > >                         vq_err(vq, "Faulted on copying pkt hdr %x
> > > > %x %x %px\n",
> > > nbytes, sizeof(*hdr),
> > > > __builtin_object_size(hdr, 0), &iov_iter);
> > > >                         kfree_skb(skb);
> > > >                         break;
> > > >                 }
> > > > }
> > > >
> > > > I checked copy_to_iter, it is copy data to __user addr, but it
> > > > never pass, the copy to __user addr always return 0 bytes copied.
> > > >
> > > > The asm code "sttr x7, [x6]" will trigger data abort, the kernel
> > > > will run into do_page_fault, but lock_mm_and_find_vma report it is
> > > > VM_FAULT_BADMAP, that means the __user addr is not mapped, no
> vma
> > > has this addr.
> > > >
> > > > I am not sure what may cause this. Appreciate if any comments.
> > > >
> > > > BTW: I tested blk pci, it works, so the virtio pci should work on my 
> > > > setup.
> > > >
> > > > Thanks,
> > > > Peng.
> > > >
> >



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.