From patchwork Thu Mar 19 19:29:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 46117 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E114721515 for ; Thu, 19 Mar 2015 19:33:20 +0000 (UTC) Received: by lams18 with SMTP id s18sf14245522lam.2 for ; Thu, 19 Mar 2015 12:33:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=hIjUsLKLhyIT+rk1SZq1M8eiDVSpVLSsBxE/dO/L55U=; b=C0QQ2U7ZeO5Hv/9J6mVtGCv6si24OGYrBfTS+fbVpHFWPDIIDJmF2v7y36S+1OHc5c GDZ7HQ3GoMTWa6IQr5z12/ZiL/2bp6xcv+ugdm0QNUWtSxt0InZXWn5SqTwhzhhCycMM ryPAvJA4OScKmCQz4lQwR+ux1ef5lLOjQoSLwvtJnebnSnSbRXR4eTtHDDDdRUNWyWp3 AGgG57mifz6zTk3pcKUpxzV7WgxOZRuwQtIgJbBD6Bq4QzQ+rcu7I8Ttsz8QSYHaFWdF sT85SZaI/YiRaYZLQYAD5DODvjgIecgbgzzkwJca+7HUyZKe6hMT7CRKjMQvH1nfbWKk c5zA== X-Gm-Message-State: ALoCoQkeII5GNV7tY+TF52DqyP1YwxhNh1ceOd15MbeZLEhKTwojmGyvE3pB7zyVYbGoELYElLD9 X-Received: by 10.180.109.34 with SMTP id hp2mr2068880wib.4.1426793599873; Thu, 19 Mar 2015 12:33:19 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.7.75 with SMTP id da11ls320267lad.95.gmail; Thu, 19 Mar 2015 12:33:19 -0700 (PDT) X-Received: by 10.112.143.195 with SMTP id sg3mr20257935lbb.95.1426793599706; Thu, 19 Mar 2015 12:33:19 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id t9si1661135lal.77.2015.03.19.12.33.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Mar 2015 12:33:19 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by ladw1 with SMTP id w1so70605489lad.0 for ; Thu, 19 Mar 2015 12:33:19 -0700 (PDT) X-Received: by 10.152.30.103 with SMTP id r7mr66154592lah.76.1426793599273; Thu, 19 Mar 2015 12:33:19 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp598028lbj; Thu, 19 Mar 2015 12:33:18 -0700 (PDT) X-Received: by 10.140.133.67 with SMTP id 64mr64340474qhf.17.1426793570956; Thu, 19 Mar 2015 12:32:50 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id r23si2250235qkr.8.2015.03.19.12.32.50 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 19 Mar 2015 12:32:50 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YYgA5-0005FR-MF; Thu, 19 Mar 2015 19:31:21 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YYgA3-00058P-9R for xen-devel@lists.xenproject.org; Thu, 19 Mar 2015 19:31:19 +0000 Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id 94/0B-21221-6042B055; Thu, 19 Mar 2015 19:31:18 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-5.tower-27.messagelabs.com!1426793477!9783595!1 X-Originating-IP: [209.85.212.176] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 6.13.4; banners=-,-,- X-VirusChecked: Checked Received: (qmail 1918 invoked from network); 19 Mar 2015 19:31:17 -0000 Received: from mail-wi0-f176.google.com (HELO mail-wi0-f176.google.com) (209.85.212.176) by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 19 Mar 2015 19:31:17 -0000 Received: by wixw10 with SMTP id w10so78657263wix.0 for ; Thu, 19 Mar 2015 12:31:17 -0700 (PDT) X-Received: by 10.180.206.98 with SMTP id ln2mr18866863wic.94.1426793476871; Thu, 19 Mar 2015 12:31:16 -0700 (PDT) Received: from chilopoda.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id hl8sm3203005wjb.38.2015.03.19.12.31.15 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Mar 2015 12:31:16 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Thu, 19 Mar 2015 19:29:52 +0000 Message-Id: <1426793399-6283-27-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1426793399-6283-1-git-send-email-julien.grall@linaro.org> References: <1426793399-6283-1-git-send-email-julien.grall@linaro.org> Cc: Wei Liu , ian.campbell@citrix.com, tim@xen.org, Julien Grall , Ian Jackson , stefano.stabellini@citrix.com, Jan Beulich Subject: [Xen-devel] [PATCH v4 26/33] xen/passthrough: Extend XEN_DOMCTL_*assign_device to support DT device X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: A device node is described by a path. It will be used to retrieved the node in the device tree and assign the related device to the domain. Only non-PCI protected by an IOMMU can be assigned to a guest. Also document the behavior of XEN_DOMCTL_deassign_device in the public headers which differ between non-PCI and PCI. Signed-off-by: Julien Grall Cc: Ian Jackson Cc: Wei Liu Cc: Jan Beulich --- Changes in v4: - Add XSM bits - Return -ENODEV rather than -ENOSYS - Move the if (...) into the ifdef (see iommu.c) - Document the behavior of XEN_DOMCTL_deassign_device - Use PCI_BUS and PCI_DEVFN2 when it's possible - iommu_dt_device_is_assigned now returns 0 when the device is not protected Changes in v2: - Use a different number for XEN_DOMCTL_assign_dt_device --- tools/libxc/include/xenctrl.h | 10 ++++ tools/libxc/xc_domain.c | 95 ++++++++++++++++++++++++++++-- xen/drivers/passthrough/device_tree.c | 108 +++++++++++++++++++++++++++++++++- xen/drivers/passthrough/iommu.c | 9 ++- xen/drivers/passthrough/pci.c | 47 ++++++++++----- xen/include/public/domctl.h | 24 +++++++- xen/include/xen/iommu.h | 3 + 7 files changed, 271 insertions(+), 25 deletions(-) diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h index b6212bf..4648cb0 100644 --- a/tools/libxc/include/xenctrl.h +++ b/tools/libxc/include/xenctrl.h @@ -2055,6 +2055,16 @@ int xc_deassign_device(xc_interface *xch, uint32_t domid, uint32_t machine_sbdf); +int xc_assign_dt_device(xc_interface *xch, + uint32_t domid, + char *path); +int xc_test_assign_dt_device(xc_interface *xch, + uint32_t domid, + char *path); +int xc_deassign_dt_device(xc_interface *xch, + uint32_t domid, + char *path); + int xc_domain_memory_mapping(xc_interface *xch, uint32_t domid, unsigned long first_gfn, diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c index 8243b70..924a180 100644 --- a/tools/libxc/xc_domain.c +++ b/tools/libxc/xc_domain.c @@ -1633,7 +1633,8 @@ int xc_assign_device( domctl.cmd = XEN_DOMCTL_assign_device; domctl.domain = domid; - domctl.u.assign_device.machine_sbdf = machine_sbdf; + domctl.u.assign_device.dev = XEN_DOMCTL_DEV_PCI; + domctl.u.assign_device.u.pci.machine_sbdf = machine_sbdf; return do_domctl(xch, &domctl); } @@ -1682,7 +1683,8 @@ int xc_test_assign_device( domctl.cmd = XEN_DOMCTL_test_assign_device; domctl.domain = domid; - domctl.u.assign_device.machine_sbdf = machine_sbdf; + domctl.u.assign_device.dev = XEN_DOMCTL_DEV_PCI; + domctl.u.assign_device.u.pci.machine_sbdf = machine_sbdf; return do_domctl(xch, &domctl); } @@ -1696,11 +1698,96 @@ int xc_deassign_device( domctl.cmd = XEN_DOMCTL_deassign_device; domctl.domain = domid; - domctl.u.assign_device.machine_sbdf = machine_sbdf; - + domctl.u.assign_device.dev = XEN_DOMCTL_DEV_PCI; + domctl.u.assign_device.u.pci.machine_sbdf = machine_sbdf; + return do_domctl(xch, &domctl); } +int xc_assign_dt_device( + xc_interface *xch, + uint32_t domid, + char *path) +{ + int rc; + size_t size = strlen(path); + DECLARE_DOMCTL; + DECLARE_HYPERCALL_BOUNCE(path, size, XC_HYPERCALL_BUFFER_BOUNCE_IN); + + if ( xc_hypercall_bounce_pre(xch, path) ) + return -1; + + domctl.cmd = XEN_DOMCTL_assign_device; + domctl.domain = (domid_t)domid; + + domctl.u.assign_device.dev = XEN_DOMCTL_DEV_DT; + domctl.u.assign_device.u.dt.size = size; + set_xen_guest_handle(domctl.u.assign_device.u.dt.path, path); + + rc = do_domctl(xch, &domctl); + + xc_hypercall_bounce_post(xch, path); + + return rc; +} + +int xc_test_assign_dt_device( + xc_interface *xch, + uint32_t domid, + char *path) +{ + int rc; + size_t size = strlen(path); + DECLARE_DOMCTL; + DECLARE_HYPERCALL_BOUNCE(path, size, XC_HYPERCALL_BUFFER_BOUNCE_IN); + + if ( xc_hypercall_bounce_pre(xch, path) ) + return -1; + + domctl.cmd = XEN_DOMCTL_test_assign_device; + domctl.domain = (domid_t)domid; + + domctl.u.assign_device.dev = XEN_DOMCTL_DEV_DT; + domctl.u.assign_device.u.dt.size = size; + set_xen_guest_handle(domctl.u.assign_device.u.dt.path, path); + + rc = do_domctl(xch, &domctl); + + xc_hypercall_bounce_post(xch, path); + + return rc; +} + +int xc_deassign_dt_device( + xc_interface *xch, + uint32_t domid, + char *path) +{ + int rc; + size_t size = strlen(path); + DECLARE_DOMCTL; + DECLARE_HYPERCALL_BOUNCE(path, size, XC_HYPERCALL_BUFFER_BOUNCE_IN); + + if ( xc_hypercall_bounce_pre(xch, path) ) + return -1; + + domctl.cmd = XEN_DOMCTL_deassign_device; + domctl.domain = (domid_t)domid; + + domctl.u.assign_device.dev = XEN_DOMCTL_DEV_DT; + domctl.u.assign_device.u.dt.size = size; + set_xen_guest_handle(domctl.u.assign_device.u.dt.path, path); + + rc = do_domctl(xch, &domctl); + + xc_hypercall_bounce_post(xch, path); + + return rc; +} + + + + int xc_domain_update_msi_irq( xc_interface *xch, uint32_t domid, diff --git a/xen/drivers/passthrough/device_tree.c b/xen/drivers/passthrough/device_tree.c index 0ec4103..c37efeb 100644 --- a/xen/drivers/passthrough/device_tree.c +++ b/xen/drivers/passthrough/device_tree.c @@ -1,9 +1,6 @@ /* * Code to passthrough a device tree node to a guest * - * TODO: This contains only the necessary code to protected device passed to - * dom0. It will need some updates when device passthrough will is added. - * * Julien Grall * Copyright (c) 2014 Linaro Limited. * @@ -20,8 +17,10 @@ #include #include +#include #include #include +#include static spinlock_t dtdevs_lock = SPIN_LOCK_UNLOCKED; @@ -93,6 +92,20 @@ fail: return rc; } +static bool_t iommu_dt_device_is_assigned(const struct dt_device_node *dev) +{ + bool_t assigned = 0; + + if ( !dt_device_is_protected(dev) ) + return 0; + + spin_lock(&dtdevs_lock); + assigned = !list_empty(&dev->domain_list); + spin_unlock(&dtdevs_lock); + + return assigned; +} + int iommu_dt_domain_init(struct domain *d) { struct hvm_iommu *hd = domain_hvm_iommu(d); @@ -121,3 +134,92 @@ int iommu_release_dt_devices(struct domain *d) return 0; } + +int iommu_do_dt_domctl(struct xen_domctl *domctl, struct domain *d, + XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl) +{ + int ret; + struct dt_device_node *dev; + + /* TODO: How to deal with XSM? */ + /* TODO: Do we need to check is_dying? Mostly to protect against + * hypercall trying to passthrough a device while we are + * dying. + */ + + switch ( domctl->cmd ) + { + case XEN_DOMCTL_assign_device: + ret = -ENODEV; + if ( domctl->u.assign_device.dev != XEN_DOMCTL_DEV_DT ) + break; + + ret = dt_find_node_by_gpath(domctl->u.assign_device.u.dt.path, + domctl->u.assign_device.u.dt.size, + &dev); + if ( ret ) + break; + + ret = xsm_assign_dtdevice(XSM_HOOK, d, dt_node_full_name(dev)); + if ( ret ) + break; + + ret = iommu_assign_dt_device(d, dev); + + if ( ret ) + printk(XENLOG_G_ERR "XEN_DOMCTL_assign_dt_device: assign \"%s\"" + " to dom%u failed (%d)\n", + dt_node_full_name(dev), d->domain_id, ret); + break; + + case XEN_DOMCTL_deassign_device: + ret = -ENODEV; + if ( domctl->u.assign_device.dev != XEN_DOMCTL_DEV_DT ) + break; + + ret = dt_find_node_by_gpath(domctl->u.assign_device.u.dt.path, + domctl->u.assign_device.u.dt.size, + &dev); + if ( ret ) + break; + + ret = xsm_deassign_dtdevice(XSM_HOOK, d, dt_node_full_name(dev)); + + ret = iommu_deassign_dt_device(d, dev); + + if ( ret ) + printk(XENLOG_G_ERR "XEN_DOMCTL_assign_dt_device: assign \"%s\"" + " to dom%u failed (%d)\n", + dt_node_full_name(dev), d->domain_id, ret); + break; + + case XEN_DOMCTL_test_assign_device: + ret = -ENODEV; + if ( domctl->u.assign_device.dev != XEN_DOMCTL_DEV_DT ) + break; + + ret = dt_find_node_by_gpath(domctl->u.assign_device.u.dt.path, + domctl->u.assign_device.u.dt.size, + &dev); + if ( ret ) + break; + + ret = xsm_test_assign_dtdevice(XSM_HOOK, dt_node_full_name(dev)); + if ( ret ) + break; + + if ( iommu_dt_device_is_assigned(dev) ) + { + printk(XENLOG_G_ERR "%s already assigned.\n", + dt_node_full_name(dev)); + ret = -EINVAL; + } + break; + + default: + ret = -ENOSYS; + break; + } + + return ret; +} diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c index faddd50..a5d0831 100644 --- a/xen/drivers/passthrough/iommu.c +++ b/xen/drivers/passthrough/iommu.c @@ -335,7 +335,7 @@ int iommu_do_domctl( struct xen_domctl *domctl, struct domain *d, XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl) { - int ret = -ENOSYS; + int ret = -ENODEV; if ( !iommu_enabled ) return -ENOSYS; @@ -344,6 +344,13 @@ int iommu_do_domctl( ret = iommu_do_pci_domctl(domctl, d, u_domctl); #endif +#ifdef HAS_DEVICE_TREE + if ( ret != -ENODEV) + return ret; + + ret = iommu_do_dt_domctl(domctl, d, u_domctl); +#endif + return ret; } diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c index 18b74f4..5ddfd8d 100644 --- a/xen/drivers/passthrough/pci.c +++ b/xen/drivers/passthrough/pci.c @@ -1495,6 +1495,7 @@ int iommu_do_pci_domctl( u16 seg; u8 bus, devfn; int ret = 0; + uint32_t machine_sbdf; switch ( domctl->cmd ) { @@ -1508,8 +1509,8 @@ int iommu_do_pci_domctl( break; seg = domctl->u.get_device_group.machine_sbdf >> 16; - bus = (domctl->u.get_device_group.machine_sbdf >> 8) & 0xff; - devfn = domctl->u.get_device_group.machine_sbdf & 0xff; + bus = PCI_BUS(domctl->u.get_device_group.machine_sbdf); + devfn = PCI_DEVFN2(domctl->u.get_device_group.machine_sbdf); max_sdevs = domctl->u.get_device_group.max_sdevs; sdevs = domctl->u.get_device_group.sdev_array; @@ -1531,13 +1532,19 @@ int iommu_do_pci_domctl( break; case XEN_DOMCTL_test_assign_device: - ret = xsm_test_assign_device(XSM_HOOK, domctl->u.assign_device.machine_sbdf); + ret = -ENODEV; + if ( domctl->u.assign_device.dev != XEN_DOMCTL_DEV_PCI ) + break; + + machine_sbdf = domctl->u.assign_device.u.pci.machine_sbdf; + + ret = xsm_test_assign_device(XSM_HOOK, machine_sbdf); if ( ret ) break; - seg = domctl->u.assign_device.machine_sbdf >> 16; - bus = (domctl->u.assign_device.machine_sbdf >> 8) & 0xff; - devfn = domctl->u.assign_device.machine_sbdf & 0xff; + seg = machine_sbdf >> 16; + bus = PCI_BUS(machine_sbdf); + devfn = PCI_DEVFN2(machine_sbdf); if ( device_assigned(seg, bus, devfn) ) { @@ -1549,19 +1556,25 @@ int iommu_do_pci_domctl( break; case XEN_DOMCTL_assign_device: + ret = -ENODEV; + if ( domctl->u.assign_device.dev != XEN_DOMCTL_DEV_PCI ) + break; + if ( unlikely(d->is_dying) ) { ret = -EINVAL; break; } - ret = xsm_assign_device(XSM_HOOK, d, domctl->u.assign_device.machine_sbdf); + machine_sbdf = domctl->u.assign_device.u.pci.machine_sbdf; + + ret = xsm_assign_device(XSM_HOOK, d, machine_sbdf); if ( ret ) break; - seg = domctl->u.assign_device.machine_sbdf >> 16; - bus = (domctl->u.assign_device.machine_sbdf >> 8) & 0xff; - devfn = domctl->u.assign_device.machine_sbdf & 0xff; + seg = machine_sbdf >> 16; + bus = PCI_BUS(machine_sbdf); + devfn = PCI_DEVFN2(machine_sbdf); ret = device_assigned(seg, bus, devfn) ?: assign_device(d, seg, bus, devfn); @@ -1577,13 +1590,19 @@ int iommu_do_pci_domctl( break; case XEN_DOMCTL_deassign_device: - ret = xsm_deassign_device(XSM_HOOK, d, domctl->u.assign_device.machine_sbdf); + ret = -ENODEV; + if ( domctl->u.assign_device.dev != XEN_DOMCTL_DEV_PCI ) + break; + + machine_sbdf = domctl->u.assign_device.u.pci.machine_sbdf; + + ret = xsm_deassign_device(XSM_HOOK, d, machine_sbdf); if ( ret ) break; - seg = domctl->u.assign_device.machine_sbdf >> 16; - bus = (domctl->u.assign_device.machine_sbdf >> 8) & 0xff; - devfn = domctl->u.assign_device.machine_sbdf & 0xff; + seg = machine_sbdf >> 16; + bus = PCI_BUS(machine_sbdf); + devfn = PCI_DEVFN2(machine_sbdf); spin_lock(&pcidevs_lock); ret = deassign_device(d, seg, bus, devfn); diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index 7f90150..a7cb272 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -475,12 +475,30 @@ typedef struct xen_domctl_sendtrigger xen_domctl_sendtrigger_t; DEFINE_XEN_GUEST_HANDLE(xen_domctl_sendtrigger_t); -/* Assign PCI device to HVM guest. Sets up IOMMU structures. */ +/* Assign a device to a guest. Sets up IOMMU structures. */ /* XEN_DOMCTL_assign_device */ /* XEN_DOMCTL_test_assign_device */ -/* XEN_DOMCTL_deassign_device */ +/* + * XEN_DOMCTL_deassign_device: The behavior of this DOMCTL differs + * between the different type of device: + * - PCI device (XEN_DOMCTL_DEV_PCI) will be reassigned to DOM0 + * - non-PCI device (XEN_DOMCTL_DEV_PCI) will left unassigned. DOM0 + * will have to call XEN_DOMCTL_assign_device in order to use the + * device. + */ +#define XEN_DOMCTL_DEV_PCI 0 +#define XEN_DOMCTL_DEV_DT 1 struct xen_domctl_assign_device { - uint32_t machine_sbdf; /* machine PCI ID of assigned device */ + uint32_t dev; /* XEN_DOMCTL_DEV_* */ + union { + struct { + uint32_t machine_sbdf; /* machine PCI ID of assigned device */ + } pci; + struct { + uint32_t size; /* Length of the path */ + XEN_GUEST_HANDLE_64(char) path; /* path to the device tree node */ + } dt; + } u; }; typedef struct xen_domctl_assign_device xen_domctl_assign_device_t; DEFINE_XEN_GUEST_HANDLE(xen_domctl_assign_device_t); diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h index d9c9ede..b30bf41 100644 --- a/xen/include/xen/iommu.h +++ b/xen/include/xen/iommu.h @@ -119,6 +119,9 @@ int iommu_deassign_dt_device(struct domain *d, struct dt_device_node *dev); int iommu_dt_domain_init(struct domain *d); int iommu_release_dt_devices(struct domain *d); +int iommu_do_dt_domctl(struct xen_domctl *, struct domain *, + XEN_GUEST_HANDLE_PARAM(xen_domctl_t)); + #endif /* HAS_DEVICE_TREE */ struct page_info;