From 7228113d1fa0107a377aef71094d610eb8824aa2 Mon Sep 17 00:00:00 2001 From: Juergen Gross Date: Mon, 29 Aug 2022 13:26:08 +0200 Subject: [PATCH] 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 Reviewed-by: Oleksandr Tyshchenko Acked-by: Stefano Stabellini Signed-off-by: Juergen Gross --- drivers/xen/grant-dma-ops.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/xen/grant-dma-ops.c b/drivers/xen/grant-dma-ops.c index 7133272918f0..3e4c590896d0 100644 --- a/drivers/xen/grant-dma-ops.c +++ b/drivers/xen/grant-dma-ops.c @@ -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;