From patchwork Mon Jan 7 22:29:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venu Busireddy X-Patchwork-Id: 10751265 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4D62913BF for ; Mon, 7 Jan 2019 22:35:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 32A6928A95 for ; Mon, 7 Jan 2019 22:35:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2137A28AB6; Mon, 7 Jan 2019 22:35:21 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AF5F628A95 for ; Mon, 7 Jan 2019 22:35:20 +0000 (UTC) Received: from localhost ([127.0.0.1]:51731 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggdUN-0000j3-VB for patchwork-qemu-devel@patchwork.kernel.org; Mon, 07 Jan 2019 17:35:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggdPm-0005IG-Q7 for qemu-devel@nongnu.org; Mon, 07 Jan 2019 17:30:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggdPl-00050C-DW for qemu-devel@nongnu.org; Mon, 07 Jan 2019 17:30:34 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:36644) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ggdPl-0004YH-1R for qemu-devel@nongnu.org; Mon, 07 Jan 2019 17:30:33 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id x07MIhxn070722; Mon, 7 Jan 2019 22:30:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=7aTwapqUJp8TAE107BG7YNxfp8aFak6XrepdzSJl7hQ=; b=aS7ccKV0g7R1woUPEYPMLqtFkC9XXOCRcFoF5eFYEu37MnEaS64nsWAeDCMoqSGsJtgW /5F2Ya4C2M+Zc0u8/4S0RBFWUu0+9jf2zkoZCVBB1Adn3ZG/mzqUvkP0tbA+CxFMD1BY S4E3GSOTMXOAPZzplgHeTYjw1B6ZkN7WfphVz7LQ8DrRRzOpsSj2zsx01AEJlTmAUZCm XjZ30C4Ov+mQtHYU6CueOQI6gqjYioUntmvh3Ehk6qMSW0wIk05N+tQnHQg+dPZhIG+5 poS3z7lCP/85DUBSfZHMWBFPCHHL9ySgJXMDEBvG5hlkX/ET5gRIMBzxt75r4YdLZ8Ba uw== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2120.oracle.com with ESMTP id 2ptn7qr9dh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 07 Jan 2019 22:30:23 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x07MUMNB001816 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 7 Jan 2019 22:30:22 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x07MUM27010535; Mon, 7 Jan 2019 22:30:22 GMT Received: from ban25x6uut28.us.oracle.com (/10.153.73.28) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 07 Jan 2019 14:30:22 -0800 From: Venu Busireddy To: venu.busireddy@oracle.com, "Michael S. Tsirkin" , Marcel Apfelbaum Date: Mon, 7 Jan 2019 17:29:44 -0500 Message-Id: <1546900184-27403-6-git-send-email-venu.busireddy@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1546900184-27403-1-git-send-email-venu.busireddy@oracle.com> References: <1546900184-27403-1-git-send-email-venu.busireddy@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9129 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901070183 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 156.151.31.85 Subject: [Qemu-devel] [PATCH v3 5/5] pci: query command extension to check the bus master enabling status of the failover-primary device X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Si-Wei Liu , virtio-dev@lists.oasis-open.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Si-Wei Liu Signed-off-by: Si-Wei Liu Signed-off-by: Venu Busireddy --- hmp.c | 5 +++++ hw/pci/pci.c | 5 +++++ qapi/misc.json | 5 ++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/hmp.c b/hmp.c index 7828f93..7a75c93 100644 --- a/hmp.c +++ b/hmp.c @@ -890,6 +890,11 @@ static void hmp_info_pci_device(Monitor *mon, const PciDeviceInfo *dev) } } + if (dev->has_failover_status) { + monitor_printf(mon, " Failover primary, bus master %s.\n", + dev->failover_status ? "enabled" : "disabled"); + } + monitor_printf(mon, " id \"%s\"\n", dev->qdev_id); if (dev->has_pci_bridge) { diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 56b13b3..9da49fd 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -1761,6 +1761,11 @@ static PciDeviceInfo *qmp_query_pci_device(PCIDevice *dev, PCIBus *bus, pci_get_word(dev->config + PCI_CB_SUBSYSTEM_VENDOR_ID); } + if (dev->failover_primary) { + info->has_failover_status = true; + info->failover_status = dev->bus_master_enable_region.enabled; + } + return info; } diff --git a/qapi/misc.json b/qapi/misc.json index 6c1c5c0..05f003e 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -865,6 +865,9 @@ # # @regions: a list of the PCI I/O regions associated with the device # +# @failover_status: if 'failover-primary' property is 'true', true if PCI +# bus master bit on the device is enabled +# # Notes: the contents of @class_info.desc are not stable and should only be # treated as informational. # @@ -874,7 +877,7 @@ 'data': {'bus': 'int', 'slot': 'int', 'function': 'int', 'class_info': 'PciDeviceClass', 'id': 'PciDeviceId', '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo', - 'regions': ['PciMemoryRegion']} } + 'regions': ['PciMemoryRegion'], '*failover_status': 'bool'} } ## # @PciInfo: