xen/virtio: use dom0 as default backend for CONFIG_XEN_VIRTIO_FORCE_GRANT

With CONFIG_XEN_VIRTIO_FORCE_GRANT set the default backend domid to 0,
enabling to use xen_grant_dma_ops for those devices.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Juergen Gross <jgross@suse.com>
This commit is contained in:
Juergen Gross 2022-08-29 13:26:08 +02:00
parent c9133112f3
commit 7228113d1f
1 changed files with 3 additions and 0 deletions

View File

@ -365,6 +365,9 @@ void xen_grant_setup_dma_ops(struct device *dev)
if (dev->of_node) {
if (xen_dt_grant_init_backend_domid(dev, data))
goto err;
} else if (IS_ENABLED(CONFIG_XEN_VIRTIO_FORCE_GRANT)) {
dev_info(dev, "Using dom0 as backend\n");
data->backend_domid = 0;
} else {
/* XXX ACPI device unsupported for now */
goto err;