From patchwork Mon Jan 7 17:54:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venu Busireddy X-Patchwork-Id: 10750969 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 E87F7746 for ; Mon, 7 Jan 2019 18:07:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D98EB2893D for ; Mon, 7 Jan 2019 18:07:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD2CD2898C; Mon, 7 Jan 2019 18:07:46 +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 6B5042893D for ; Mon, 7 Jan 2019 18:07:46 +0000 (UTC) Received: from localhost ([127.0.0.1]:38453 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggZJR-00024v-Ae for patchwork-qemu-devel@patchwork.kernel.org; Mon, 07 Jan 2019 13:07:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52230) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggZ7e-0007BF-9q for qemu-devel@nongnu.org; Mon, 07 Jan 2019 12:55:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggZ7b-0003Cy-5V for qemu-devel@nongnu.org; Mon, 07 Jan 2019 12:55:34 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:41908) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ggZ7Y-00036F-PX for qemu-devel@nongnu.org; Mon, 07 Jan 2019 12:55:30 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id x07Hs9Ff051626; Mon, 7 Jan 2019 17:55:25 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=vIhkDnkB8MNC5K4dCLLomVKxV5zNlfoRIPc7gow85jCOGcKaHj+Wb3Wj4r5qsy6C2ghJ 14Ai5Chgi9fpGXUI+248cAYf2o0ZH3pdXCbRVhrY8mGEVV0mk5spEDRFSFAh205rZhAN XsMzZkLHwnyFuUgXMPSHFlv7Y92Il/FL+418aXnXcF/jahUQX1I4sjhecl+GQzHFxTqm Qhln5wMVbmMF9mmuoeYBGn4bw2yA4m+9zZAYnXsaEoqFgEZfj62lTdsMTTbruR29T/t6 Dzw+kN8/Em+yJmN1rBTx9mijTy39DWEBMMwfotQuDD2vLCTh8VuE/oabCWXVLwEurTTf qg== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2ptj3dqecj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 07 Jan 2019 17:55:25 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x07HtPnO017470 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 7 Jan 2019 17:55:25 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x07HtPBk029970; Mon, 7 Jan 2019 17:55:25 GMT Received: from ban25x6uut28.us.oracle.com (/10.153.73.28) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 07 Jan 2019 09:55:25 -0800 From: Venu Busireddy To: venu.busireddy@oracle.com, "Michael S. Tsirkin" , Marcel Apfelbaum Date: Mon, 7 Jan 2019 12:54:50 -0500 Message-Id: <1546883690-17798-6-git-send-email-venu.busireddy@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1546883690-17798-1-git-send-email-venu.busireddy@oracle.com> References: <1546883690-17798-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-1901070153 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 141.146.126.79 Subject: [Qemu-devel] [PATCH v2 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: