From patchwork Tue Jun 27 17:14:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venu Busireddy X-Patchwork-Id: 9812811 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 73A7560351 for ; Tue, 27 Jun 2017 17:17:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 582B2282E8 for ; Tue, 27 Jun 2017 17:17:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B22D286EE; Tue, 27 Jun 2017 17:17:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C5908282E8 for ; Tue, 27 Jun 2017 17:17:54 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPu5I-0007t6-6y; Tue, 27 Jun 2017 17:15:28 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPu5G-0007sd-UX for xen-devel@lists.xen.org; Tue, 27 Jun 2017 17:15:27 +0000 Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id E6/69-01996-EA292595; Tue, 27 Jun 2017 17:15:26 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLLMWRWlGSWpSXmKPExsXSO6nOVXftpKB IgxdT1CyWfFzM4sDocXT3b6YAxijWzLyk/IoE1oyT/YtYC34KVHw4e4+tgfEfbxcjF4eQwEQm iRc9O1ggnN+MEocWLWeDcDYySlyes58VqoxR4ubM+4xdjJwcbAIGEkcP97CC2CICuRIXu4+yg djMAtIS1568BbOFBSwldtx8ywJiswioSiz7uYYJxOYVsJXY9fAdWFxCQE5i6fbrzCA2p4CdRP PKH2AzhYBqtk/rYIaoMZQ4/XAb4wRGvgWMDKsYNYpTi8pSi3SNLPWSijLTM0pyEzNzdA0NTPV yU4uLE9NTcxKTivWS83M3MQKDpZ6BgXEH4+UtfocYJTmYlER5T3UGRQrxJeWnVGYkFmfEF5Xm pBYfYpTh4FCS4D0yESgnWJSanlqRlpkDDFuYtAQHj5II71uQNG9xQWJucWY6ROoUo6KUOO9dk IQASCKjNA+uDRYrlxhlpYR5GRkYGIR4ClKLcjNLUOVfMYpzMCoJ8/JPAJrCk5lXAjf9FdBiJq DFLPMCQBaXJCKkpBoYNfT3Ojp4GZdHOrN33+aWjy7ceO1UrVbQzZOBeqfzLGbo5884e+ZVX92 bTo0/iY9SorMn7/uam7zzbJnlusgDN2S/hnw1WMQe2DBrbW7N3pkJDhdO79pUtFHmdWtIiOy+ 1Orl7c+KJjDmCnQumjYzZea2jhDN7ovn9545kWa86tie+BMifwNtlFiKMxINtZiLihMBJMZPs JACAAA= X-Env-Sender: venu.busireddy@oracle.com X-Msg-Ref: server-5.tower-206.messagelabs.com!1498583723!100900740!1 X-Originating-IP: [141.146.126.69] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjc3MjE4\n X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 64414 invoked from network); 27 Jun 2017 17:15:25 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-5.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 27 Jun 2017 17:15:25 -0000 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v5RHFGDi006153 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Jun 2017 17:15:16 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v5RHFGe2001800 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Jun 2017 17:15:16 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v5RHFFS0009150; Tue, 27 Jun 2017 17:15:15 GMT Received: from ban25uut183.us.oracle.com (/10.153.74.183) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 27 Jun 2017 10:15:15 -0700 From: Venu Busireddy To: venu.busireddy@oracle.com, Ian Jackson , Wei Liu Date: Tue, 27 Jun 2017 12:14:55 -0500 Message-Id: <20170627171458.2529-4-venu.busireddy@oracle.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170627171458.2529-1-venu.busireddy@oracle.com> References: <20170627171458.2529-1-venu.busireddy@oracle.com> X-Source-IP: userv0021.oracle.com [156.151.31.71] Cc: xen-devel@lists.xen.org Subject: [Xen-devel] [PATCH 3/6] libxc: Add wrappers for new commands X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP libxc: Add wrappers for new commands Add wrappers for the newly introduced commands "pci-assignable-hide", "pci-assignable-unhide", and "pci-assignable-list-hidden". Signed-off-by: Venu Busireddy --- tools/libxc/include/xenctrl.h | 4 ++++ tools/libxc/xc_domain.c | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h index 1629f41..9730285 100644 --- a/tools/libxc/include/xenctrl.h +++ b/tools/libxc/include/xenctrl.h @@ -1670,6 +1670,10 @@ int xc_assign_device(xc_interface *xch, uint32_t machine_sbdf, uint32_t flag); +int xc_hide_device(xc_interface *xch, uint32_t machine_bdf); +int xc_unhide_device(xc_interface *xch, uint32_t machine_bdf); +int xc_test_hidden_device(xc_interface *xch, uint32_t machine_bdf); + int xc_get_device_group(xc_interface *xch, uint32_t domid, uint32_t machine_sbdf, diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c index 00909ad4..714d632 100644 --- a/tools/libxc/xc_domain.c +++ b/tools/libxc/xc_domain.c @@ -1501,6 +1501,44 @@ int xc_assign_device( return do_domctl(xch, &domctl); } +int xc_hide_device( + xc_interface *xch, + uint32_t machine_sbdf) +{ + DECLARE_DOMCTL; + + domctl.cmd = XEN_DOMCTL_hide_device; + domctl.domain = DOMID_XEN; + domctl.u.assign_device.u.pci.machine_sbdf = machine_sbdf; + + return do_domctl(xch, &domctl); +} + +int xc_unhide_device( + xc_interface *xch, + uint32_t machine_sbdf) +{ + DECLARE_DOMCTL; + + domctl.cmd = XEN_DOMCTL_unhide_device; + domctl.domain = DOMID_XEN; + domctl.u.assign_device.u.pci.machine_sbdf = machine_sbdf; + + return do_domctl(xch, &domctl); +} + +int xc_test_hidden_device( + xc_interface *xch, + uint32_t machine_sbdf) +{ + DECLARE_DOMCTL; + + domctl.cmd = XEN_DOMCTL_test_hidden_device; + domctl.u.assign_device.u.pci.machine_sbdf = machine_sbdf; + + return do_domctl(xch, &domctl); +} + int xc_get_device_group( xc_interface *xch, uint32_t domid,