On Mon, Jan 30, 2023 at 10:51 AM Viresh Kumar viresh.kumar@linaro.org wrote:
Hi Oleksandr,
Hello Viresh
[Sorry for the possible format issues]
Finally I am getting around Xen grants and haven't got a running setup yet. There are few questions I have at the moment:
- Xen's libxl_arm.c creates the iommu nodes only if backend isn't in Dom0. Why are we forcing it this way ?
It was decided that Xen grant mappings on Arm (HVM) is a must for the backends running in other than Dom0 domain (which are not trusted by default), so the toolstack inserts required bindings only for these. Dom0 is trusted by default, so it is allowed to use Xen foreign mappings. Sure, it could also use grants, but we do not force it to do so currently (maybe, if there is a need to use grants for Dom0 as well we could probably add a configuration property for virtio devices).
I am not running my backend in a separate dom as of now, as they need to share a unix socket with dom0 (with vhost-user-fronend (our virtio-disk counterpart)) for vhost-user protocol and am not sure how to set it up. Maybe I need to use "channel" ? or something else ?
I am not sure I understand the question and use-case. Is the question how to pass some information from one domain to another? If yes, I don't know the details, but one of my colleagues uses Xen's libvchan feature for the communications between domains. https://lore.kernel.org/xen-devel/20230115113111.1207605-1-dmitry.semenets@g...
I tried to hack it up, to keep backend in Dom0 only and create the iommu nodes unconditionally and the guest kernel is crashing in drivers/iommu/iommu.c:332
iommu_dev = ops->probe_device(dev);
Since grant_dma_iommu_ops have all the fields set to NULL.
Hmm. Yes, grant-dma-iommu is a stub driver with empty ops. In a nutshell, we only need it for reusing generic IOMMU device-tree bindings.
https://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git/commit/drivers/x...
Last time, when I checked Xen grant mappings with virtio, I didn't notice any issues, it worked fine. I from time to time update Xen grant DMA-mapping layer. https://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git/log/drivers/xen/...
I think, I will need to get to my development board, rebase on the latest vanilla and re-check.
- Anything else you might want to share ?
-- viresh