From patchwork Wed Jul 14 00:47:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongli Zhang X-Patchwork-Id: 12375447 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B555C07E96 for ; Wed, 14 Jul 2021 00:50:06 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C06606115B for ; Wed, 14 Jul 2021 00:50:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C06606115B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:43236 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3T6C-0005ts-QL for qemu-devel@archiver.kernel.org; Tue, 13 Jul 2021 20:50:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53456) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3T4S-0003dp-8P for qemu-devel@nongnu.org; Tue, 13 Jul 2021 20:48:16 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:36978) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3T4P-0005Vn-MR for qemu-devel@nongnu.org; Tue, 13 Jul 2021 20:48:16 -0400 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16E0fVFk007873; Wed, 14 Jul 2021 00:48:09 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 : content-type : mime-version; s=corp-2020-01-29; bh=7pDnk8aDBGlk67J0p1NgKI4WkvPcfv13dh+e/M9YbN0=; b=VoBndsdVaS2s6sqIZfTPxu64T5Qxc0Pc4rn8ubIV85Gs4Dy/ClCl4YtkohO4G4Xl7ptJ zhwcLdMQOghsHA+QTIvI4QwNy3crWUNQcnD9MvyM7Pcf+DoJ27MCZn3heZ5hUGJHX/DU Is8U2s0NQU4VYngmm3ANEvw7acShSzuKSNxG0muGPaepquD9ZO5HvgYiMwktCXVEPhyf x+gUJUPuwSaVdb3a8SECx/CB2S8poI+RtRlprReo8MAxUUUGWUjBC1wYtXfclB+vVjS6 +KeryO3lHyT1JBGcvl1TTsK7IlAzDS8Cq4yJ3fwLMnNuvinyIAH6r4g0Ll/ig5FPLXlG PQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 39sbtuh97q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Jul 2021 00:48:08 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16E0eubl195448; Wed, 14 Jul 2021 00:48:07 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam08lp2040.outbound.protection.outlook.com [104.47.74.40]) by userp3020.oracle.com with ESMTP id 39qnb1bb89-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Jul 2021 00:48:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IcSFhHvUuMuAUmcwtVmGzJYcLX+e16OYqcAYOKr9GytoCHTdhuA+J/KDvjK4Mz6Lq0BFqSm+Ro0/7O8dxAVAwaqB9JJqg/ZOsn05cJdJmawN9KjUEepEk2ypXvH005PrDF/i7KcERcyKrnqcpiPlAFzm7apUQgygYawX4lgSaOcRhhdqfJC5rAr7heHcal7L25RuA1Jd6UGKpvRBLLnlRxttxwrpR33SQ+Vel3lQQ0jum5i7izfqPaIZq3OvpWMjzYfmKJcOOUNbBW7PcwphRhSBqhA+GtDeMw2f60+u/NBuZyzXCyWHW91vCT29s7pKabvNkcwXCJZZVwWHlr/bvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7pDnk8aDBGlk67J0p1NgKI4WkvPcfv13dh+e/M9YbN0=; b=VaSnHfAC4kHl4sOFeTIdqz/Ty1eHsDgIR8hqsYM+ht3Y0KP/6z7emYooRUB2wgRFdpChTobLC32xmns5GKY6IIarxZqELvhOpmid/Ww111jpYb3kiYHmoXxBVtC6qvru+so+BLbKJPwc59OrH9ohANvp0pYCac3iYHA8NO9p5XJcMOCmGtMhCPIPft1fa7z3MiIzrQ+xP5zShuUsSDVPiL9qFezY6GJyJkfePFjuM8+Ihcap0Ma+nG6pp5Y5Qs1/MvSInXNMFoKl/h702+09/RM8CCR+2NmgvSCqVFganHzc9iU9EjsimcX7OQzcatdU7jTKj4tV3WfAESQ//hsRSg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7pDnk8aDBGlk67J0p1NgKI4WkvPcfv13dh+e/M9YbN0=; b=zHrRulAjGraq/e61Zrw2gx9uJghqdesrWMbusk+z4bwILOhDejtqroA7ZDPCtAsT/FEVH1QgRusKWRCJpuyO17kt1pNs2f/QXl53vicc4hCiMWGQp7ASPOu9BKg8QabYpNQsO6KtimgorlOVwYib2Q0l9hXpSaJ/WWNB8xo8zI0= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB2663.namprd10.prod.outlook.com (2603:10b6:a02:a9::20) by SJ0PR10MB4592.namprd10.prod.outlook.com (2603:10b6:a03:2d8::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.21; Wed, 14 Jul 2021 00:48:05 +0000 Received: from BYAPR10MB2663.namprd10.prod.outlook.com ([fe80::18a:7c1f:bf20:ba6c]) by BYAPR10MB2663.namprd10.prod.outlook.com ([fe80::18a:7c1f:bf20:ba6c%3]) with mapi id 15.20.4308.027; Wed, 14 Jul 2021 00:48:05 +0000 From: Dongli Zhang To: qemu-devel@nongnu.org Subject: [PATCH v3 1/3] msix/hmp: add hmp interface to dump MSI-X info Date: Tue, 13 Jul 2021 17:47:52 -0700 Message-Id: <20210714004754.22243-2-dongli.zhang@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210714004754.22243-1-dongli.zhang@oracle.com> References: <20210714004754.22243-1-dongli.zhang@oracle.com> X-ClientProxiedBy: SN7PR04CA0042.namprd04.prod.outlook.com (2603:10b6:806:120::17) To BYAPR10MB2663.namprd10.prod.outlook.com (2603:10b6:a02:a9::20) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (138.3.200.16) by SN7PR04CA0042.namprd04.prod.outlook.com (2603:10b6:806:120::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.21 via Frontend Transport; Wed, 14 Jul 2021 00:48:04 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0071d235-60c4-4bb0-1129-08d946610a7d X-MS-TrafficTypeDiagnostic: SJ0PR10MB4592: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:256; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: th0dK/pKqNTTlBvBhwfCIx0Ze6JBJtguqo87DpItaq1AMuvt08FEVZrjt4VG/Uyea6HQIVI0lMudC+Psrsnu37EWrugRzWT2iewwvjRJALiOSaZwOUiT+Pob51QUI0ZZLt74OQcS3SPW8tasTFjho1Mui0lyAAjpY134xTtti7OfjMMpeq0+GBH0VVt0YOa9tyO5YVEs2PwCMRdKuB3aLdNfi/DmCFSVsz0o3nPE4UjjHhBtWRsu1JgIZw6XO97sxnWIicLZdumP2rSmt7V1pmGL8prajTQcEJzQCtPucS/J47D5pTPIJ6qIkC2rwFeibwxXJguPbgXb/RBDeeOOl8LOqchG0f+v5MEJm6iTDNhFmnmbBCEBcUz9VOOzzdNBxSVaHSzCo8XatRhyOL55M3L+64AaebJod/Brh8G/7ax4f01TlLfxnOsttIhEI4rRBqOE0BH+L66hSu/peHBv0ulE05JId9UGmtItk2vhF08eCbUpnMX0Vy4/j5hyIh3AH27v4hjsjq2fA8adofi1WLBqyGcbDI5wZQ7F6wx06j8xcuqfXeONJ1GaSAGAWT+BDD6vUCYOKEPxbMKS8/K1VKqOhMXd0DHUkkctGIeh/KEJmTmpE2catxtVd+pew9w2681cAfbcfM2MIUdDA8qpzp4/GszB78Hg0x6kOGSqDC9wWOTZzHXfTyS65unVm2JhiGukOpsJQc1zbBRK6pCPjW2sqkyOCK/uqIeUZznFRtU= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR10MB2663.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(39860400002)(346002)(396003)(136003)(376002)(4326008)(66556008)(2616005)(6916009)(956004)(44832011)(8676002)(86362001)(52116002)(5660300002)(316002)(66946007)(36756003)(66476007)(186003)(8936002)(6666004)(2906002)(26005)(6506007)(38350700002)(38100700002)(1076003)(6512007)(6486002)(478600001)(83380400001)(107886003)(309714004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cKQebHp7BqM3S9eAiVoCs3LgxueL7ZpMCcFy1lnxkR++MGyVTK4DEwLVFUmyXZZVRlNQ+y1hlBFyXpTQK37YbLg598K0+An7rza9nVIjHPdRgCJRmrSk3QiPo2Y3DEoUilgeeDMvYMcl43Sj7y+7ePh5oDeInBu0blfoY7jo/lu4cmbYiVa1+y/D8jydfkIuwnkqNXN1wUkjUmpCl+dd77aL9XdirIPMQDIAPCdKDIQGNAuhiFJABXUQ2Vh0SJ1lOJWU7fZ2Z3bvtWn7YkmVuOEqPwtgiNOQZNx6almT0OGBr4Hk/9ioFPF9K8C/O/4wdKvWMvDcbDiFt7VJSYXV1RQAxM0gISBZEKMS9b7RkIEtckDkluGvAPowqp9hJrNpONXP59TqunlIa6b5ywVsotQkz8FCjZKRCPer9oQ7tZIWMlPsBp59yU9JyDixW6+zZ8LJb900GkKtbuyIyIg0xD7RG8JdaKM/o2OFRTBaW3HJB4zvKoCSVfOMkoHoM+b8Z1FqeKZS5tb4s5jdGdPc7WeSYABs1DLtrpyNl/YRoTXdpHTUoJ2MyxPO2matRTB5LS42PMWC4revF4iayUd7Mwy7j+5PHT5aXUlAMUUWHtXKhRkz/0wVrGhfIom2/hYGSm5krgv5oWmO2zEB5//GjinZ3boiFC8NFSzdeq2t86lDcxpFzH9cIw4XHnHi9dNRZDCpvPET1x2AbBIYK7pWlX6jx10BdZcIfOLXJtB6I+XlyfLbfkraTG2rrA76a/dZdqNxybdibnKgT0TCoxsGLS9AV4GiOlO4lbe5SSzkmEjBV/Ck1cVF0XvmIhBECG8hHgnllh/QK+WQvugeVU8GVm9FfP2wGCXNwF0n6oiRVoYsF/gs0dMgT1e/APiF17pJJJx4M2gnM9zu3IW5PPoRq92OQZsfNWC3NfLStW/IcF0uRd1EkrdaKgiVkNc0+k8CW3usaav7tTRcpAfWtdTlPtcemUT2d7eRWYlbLeJ/Ns9G+1FV56sMkb89gMR7OlMTUTS7qYHfWiNMXHITxKKEREXJ1mtUrWLDTlHrz7174WQHuTmtV89cqTYsBWatxyufH7YLNEOzpIX+Qkq0tCjov1ol9raG9X59BUTe3TS0p4Db9ODXfkZo0qQL3nf0GgCj/k4eGoJSsT0BUL32SxKDG63UMpV0PktWH4gd9a1sk6Fg87s48qJ3IEA8vDMVo6NajpyYpaA9e3G8qUm/ejgkkp2AGFuF48SiQ7ZgjQ+RRGd/4sDLxpxhewx94gwbGKBZFx0b1c4U/FdKF6TRqQiyjW7GOfxglFmn4Nr8cZcwgidQaQIb6gT5GudRRt6IVsX/ X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0071d235-60c4-4bb0-1129-08d946610a7d X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB2663.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2021 00:48:05.4084 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: krJN5n4Ctlf2XKlW8hdAn5Gyv9d8jz0PksrnebhPNQqPUPYSkxXWTF5MNiz5JrXtJdUfdgmMR94PFs7LkI6Fqg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4592 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10044 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 malwarescore=0 spamscore=0 suspectscore=0 adultscore=0 mlxlogscore=725 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107140001 X-Proofpoint-GUID: 2pjeTxlKeDFtBXVgr6PcQ3Qs274QCsMg X-Proofpoint-ORIG-GUID: 2pjeTxlKeDFtBXVgr6PcQ3Qs274QCsMg Received-SPF: pass client-ip=205.220.165.32; envelope-from=dongli.zhang@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, jasowang@redhat.com, joe.jin@oracle.com, dgilbert@redhat.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This patch is to add the HMP interface to dump MSI-X table and PBA, in order to help diagnose the loss of IRQ issue in VM (e.g., if an MSI-X vector is erroneously masked permanently). Here is the example with vhost-scsi: (qemu) info msix /machine/peripheral/vscsi0 Msg L.Addr Msg U.Addr Msg Data Vect Ctrl 0xfee00000 0x00000000 0x00004041 0x00000000 0xfee00000 0x00000000 0x00004051 0x00000000 0xfee00000 0x00000000 0x00004061 0x00000000 0xfee00000 0x00000000 0x00004071 0x00000000 0xfee01000 0x00000000 0x000040b1 0x00000000 0xfee02000 0x00000000 0x000040c1 0x00000000 0xfee03000 0x00000000 0x000040d1 0x00000000 MSI-X PBA 0 0 0 0 0 0 0 Since the number of MSI-X entries is not determined and might be very large, it is sometimes inappropriate to dump via QMP. Therefore, this patch dumps MSI-X information only via HMP, which is similar to the implementation of hmp_info_mem(). Cc: Jason Wang Cc: Joe Jin Signed-off-by: Dongli Zhang Acked-by: Dr. David Alan Gilbert Acked-by: Jason Wang --- Changed since v1/v2: - Add msix_present() to pci-stub.c to avoid build error hmp-commands-info.hx | 13 +++++++++ hw/pci/msix.c | 63 ++++++++++++++++++++++++++++++++++++++++++ hw/pci/pci-stub.c | 5 ++++ include/hw/pci/msix.h | 2 ++ include/monitor/hmp.h | 1 + softmmu/qdev-monitor.c | 25 +++++++++++++++++ 6 files changed, 109 insertions(+) diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index 27206ac049..ce5c550d44 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -221,6 +221,19 @@ SRST Show PCI information. ERST + { + .name = "msix", + .args_type = "dev:s", + .params = "dev", + .help = "dump MSI-X information", + .cmd = hmp_info_msix, + }, + +SRST + ``info msix`` *dev* + Dump MSI-X information for device *dev*. +ERST + #if defined(TARGET_I386) || defined(TARGET_SH4) || defined(TARGET_SPARC) || \ defined(TARGET_PPC) || defined(TARGET_XTENSA) || defined(TARGET_M68K) { diff --git a/hw/pci/msix.c b/hw/pci/msix.c index ae9331cd0b..4b4ec87eee 100644 --- a/hw/pci/msix.c +++ b/hw/pci/msix.c @@ -22,6 +22,7 @@ #include "sysemu/xen.h" #include "migration/qemu-file-types.h" #include "migration/vmstate.h" +#include "monitor/monitor.h" #include "qemu/range.h" #include "qapi/error.h" #include "trace.h" @@ -669,3 +670,65 @@ const VMStateDescription vmstate_msix = { VMSTATE_END_OF_LIST() } }; + +static void msix_dump_table(Monitor *mon, PCIDevice *dev) +{ + int vector; + uint32_t val; + uint8_t *table_entry; + + monitor_printf(mon, "Msg L.Addr "); + monitor_printf(mon, "Msg U.Addr "); + monitor_printf(mon, "Msg Data "); + monitor_printf(mon, "Vect Ctrl\n"); + + for (vector = 0; vector < dev->msix_entries_nr; vector++) { + table_entry = dev->msix_table + vector * PCI_MSIX_ENTRY_SIZE; + + val = pci_get_long(table_entry + PCI_MSIX_ENTRY_LOWER_ADDR); + monitor_printf(mon, "0x%08x ", val); + + val = pci_get_long(table_entry + PCI_MSIX_ENTRY_UPPER_ADDR); + monitor_printf(mon, "0x%08x ", val); + + val = pci_get_long(table_entry + PCI_MSIX_ENTRY_DATA); + monitor_printf(mon, "0x%08x ", val); + + val = pci_get_long(table_entry + PCI_MSIX_ENTRY_VECTOR_CTRL); + monitor_printf(mon, "0x%08x\n", val); + } + + monitor_printf(mon, "\n"); +} + +static void msix_dump_pba(Monitor *mon, PCIDevice *dev) +{ + int vector; + + monitor_printf(mon, "MSI-X PBA\n"); + + for (vector = 0; vector < dev->msix_entries_nr; vector++) { + monitor_printf(mon, "%d ", !!msix_is_pending(dev, vector)); + + if (vector % 16 == 15) { + monitor_printf(mon, "\n"); + } + } + + if (vector % 16 != 15) { + monitor_printf(mon, "\n"); + } + + monitor_printf(mon, "\n"); +} + +void msix_dump_info(Monitor *mon, PCIDevice *dev, Error **errp) +{ + if (!msix_present(dev)) { + error_setg(errp, "MSI-X not available"); + return; + } + + msix_dump_table(mon, dev); + msix_dump_pba(mon, dev); +} diff --git a/hw/pci/pci-stub.c b/hw/pci/pci-stub.c index 3a027c42e4..8191d49d56 100644 --- a/hw/pci/pci-stub.c +++ b/hw/pci/pci-stub.c @@ -91,3 +91,8 @@ MSIMessage msix_get_message(PCIDevice *dev, unsigned int vector) { g_assert_not_reached(); } + +void msix_dump_info(Monitor *mon, PCIDevice *dev, Error **errp) +{ + monitor_printf(mon, "PCI devices not supported\n"); +} diff --git a/include/hw/pci/msix.h b/include/hw/pci/msix.h index 4c4a60c739..10a4500295 100644 --- a/include/hw/pci/msix.h +++ b/include/hw/pci/msix.h @@ -47,6 +47,8 @@ int msix_set_vector_notifiers(PCIDevice *dev, MSIVectorPollNotifier poll_notifier); void msix_unset_vector_notifiers(PCIDevice *dev); +void msix_dump_info(Monitor *mon, PCIDevice *dev, Error **errp); + extern const VMStateDescription vmstate_msix; #define VMSTATE_MSIX_TEST(_field, _state, _test) { \ diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h index 3baa1058e2..97c040a3c8 100644 --- a/include/monitor/hmp.h +++ b/include/monitor/hmp.h @@ -36,6 +36,7 @@ void hmp_info_irq(Monitor *mon, const QDict *qdict); void hmp_info_pic(Monitor *mon, const QDict *qdict); void hmp_info_rdma(Monitor *mon, const QDict *qdict); void hmp_info_pci(Monitor *mon, const QDict *qdict); +void hmp_info_msix(Monitor *mon, const QDict *qdict); void hmp_info_tpm(Monitor *mon, const QDict *qdict); void hmp_info_iothreads(Monitor *mon, const QDict *qdict); void hmp_quit(Monitor *mon, const QDict *qdict); diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index 721dec2d82..7837a17d0d 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c @@ -19,6 +19,7 @@ #include "qemu/osdep.h" #include "hw/sysbus.h" +#include "hw/pci/msix.h" #include "monitor/hmp.h" #include "monitor/monitor.h" #include "monitor/qdev.h" @@ -1005,3 +1006,27 @@ bool qmp_command_available(const QmpCommand *cmd, Error **errp) } return true; } + +void hmp_info_msix(Monitor *mon, const QDict *qdict) +{ + const char *name = qdict_get_str(qdict, "dev"); + DeviceState *dev = find_device_state(name, NULL); + PCIDevice *pci_dev; + Error *err = NULL; + + if (!dev) { + error_setg(&err, "Device %s not found", name); + goto exit; + } + + if (!object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) { + error_setg(&err, "Not a PCI device"); + goto exit; + } + + pci_dev = PCI_DEVICE(dev); + msix_dump_info(mon, pci_dev, &err); + +exit: + hmp_handle_error(mon, err); +} From patchwork Wed Jul 14 00:47:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongli Zhang X-Patchwork-Id: 12375451 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49CC0C07E95 for ; Wed, 14 Jul 2021 00:52:32 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E55096136E for ; Wed, 14 Jul 2021 00:52:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E55096136E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:47738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3T8Z-0000iX-3O for qemu-devel@archiver.kernel.org; Tue, 13 Jul 2021 20:52:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53470) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3T4T-0003e9-GB for qemu-devel@nongnu.org; Tue, 13 Jul 2021 20:48:17 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:37478) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3T4P-0005Wf-MW for qemu-devel@nongnu.org; Tue, 13 Jul 2021 20:48:17 -0400 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16E0fZG0020511; Wed, 14 Jul 2021 00:48:10 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 : content-type : mime-version; s=corp-2020-01-29; bh=UIRcz0pvGTUkSkZCcsyk27rw5xMmS/v/s2dXMtmEXco=; b=MnsGlmfWwt4s4LZglidZGgYQ04RNj7zsVk/hmN6thtA/tGu7OdkmESDdntfzTei/I8Nx kdcu8u1PsgjT/1G6mNVjkD5sYyuwbHjHoNNN9R2/6RALc0nVJ+VUjpOnN/1orIxM/sOQ 2Y9PV2jIDHBEkVfPS2DJEQGu+F9vrUvdI3orpdV5k6HIMESrg8Ritu8eX9bObHgOLsiV hLmNdaB9InY3ZfGMd2i5FJnUPtU/RvbH4f5k/Voe08BSbY8NhjsG35KeYtADJQfML/M9 p9qgYvDh8HtB2PBK8Ggb1zdO9CF5ucEZoEydy9mznsduwFjgA/qRX55tdx6Vr6e0368s 7w== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 39rpxrbjvt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Jul 2021 00:48:09 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16E0eubm195448; Wed, 14 Jul 2021 00:48:08 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam08lp2040.outbound.protection.outlook.com [104.47.74.40]) by userp3020.oracle.com with ESMTP id 39qnb1bb89-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Jul 2021 00:48:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=az6OklH7WyAXoquIn5xysW86i49lHK5sTJ+9vwIZAERnddeKPz2+SvAO4vzz9CgF0+B6G38RsOAcQkLMmC1AOtYiVAJ7F0kxD87ApRA1glzY+OdUZjeBn6zqPl4/h+k1uL4fWu9aJoy4oWzw9gEQP1lmvwOkdVJKu2SWdrllogLwRN8HmsnbJwf9fOVG46/ssMJ5kwfjUQj6cgY+NGjK1HZSXeL/4Gz3EgCRXpXzulJ5Bu9GgbLEpsQ1G1ojWUpUOoCOf9YI8sNRlVTAdFK/OPQh5RJz1NqCNd3Ym1Fj8QgIegP4etSwhC30AGn81FIyViQxDWI0RKTGKqHWY91Iiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UIRcz0pvGTUkSkZCcsyk27rw5xMmS/v/s2dXMtmEXco=; b=FSzk8ysmFrK6QQlA3hXeK2k4zoK8+W/7duIGzlpWdmh2lflvHJYRpbWd1JaSl1paYaMKVexDf+HLqMpgmEID9DzTppQrLYQ+0r35Ci3NylUpW5Rfb0/nPl8ecmU/AfKewtH8bBgC3fQgPdY7+1cN7st+78nWXY/TiNGp7R7smLyEXgBiWL8Kx4TaCLVMHMcv0Xcmxauw9SiNm+leke+D6zDAuT11cjsZwUC0Hph32M8BA6gC8xmp2KezPug1f3IurGGGw+9vPPUl+dj5D3IJc6MSziCOzbYjRo6aZ99jbeuF/LYVtWdDTEmGafzZfIz/ABlE165eppyrVmGYHapjTg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UIRcz0pvGTUkSkZCcsyk27rw5xMmS/v/s2dXMtmEXco=; b=VfUqYKYWbT8drGJ+4CJGqKN91WLyRE1NZHQmcpewlFzoC/zlAG7aQCQwCv0MyzkTFgdNm/+caG7gX3anZYRBHx3j2DZ64VFiIor5Mwp7EZbKW7pU93kX6elYpqGLbEujH7CHgaI4Vz55vwggS5RQjgOvFyxjbKR2+LRRHm2qTGs= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB2663.namprd10.prod.outlook.com (2603:10b6:a02:a9::20) by SJ0PR10MB4592.namprd10.prod.outlook.com (2603:10b6:a03:2d8::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.21; Wed, 14 Jul 2021 00:48:06 +0000 Received: from BYAPR10MB2663.namprd10.prod.outlook.com ([fe80::18a:7c1f:bf20:ba6c]) by BYAPR10MB2663.namprd10.prod.outlook.com ([fe80::18a:7c1f:bf20:ba6c%3]) with mapi id 15.20.4308.027; Wed, 14 Jul 2021 00:48:06 +0000 From: Dongli Zhang To: qemu-devel@nongnu.org Subject: [PATCH v3 2/3] msix/hmp: add interface to dump device specific info Date: Tue, 13 Jul 2021 17:47:53 -0700 Message-Id: <20210714004754.22243-3-dongli.zhang@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210714004754.22243-1-dongli.zhang@oracle.com> References: <20210714004754.22243-1-dongli.zhang@oracle.com> X-ClientProxiedBy: SN7PR04CA0042.namprd04.prod.outlook.com (2603:10b6:806:120::17) To BYAPR10MB2663.namprd10.prod.outlook.com (2603:10b6:a02:a9::20) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (138.3.200.16) by SN7PR04CA0042.namprd04.prod.outlook.com (2603:10b6:806:120::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.21 via Frontend Transport; Wed, 14 Jul 2021 00:48:05 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c256c37c-534b-4885-6f60-08d946610b47 X-MS-TrafficTypeDiagnostic: SJ0PR10MB4592: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:183; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: X99H0PJvQnpzA10ZuWI3F+qPkm0O5yuXiWGuL7Txs2JpyM6+W8LJlCK0HGQ5V/i0h/qn7y0VEpJHXYuq1Dhs3g+JPCQkIR8eRdc7kkQtfha8F12nPo6a9KdY1tHRwmnLdkT6HHLKzDQJF8S+eF1NNwsYJoc9MyBNP29ywdhOW57GkJhuO4ipu956w0VdpswhS5aj6lZxPhxjAhmdwfD7Mz80OidP6+4Zl+eh+ihoFC76l9BHIaA3Im6PpyvwAwM9UbYsJsglx6bcSlHFqq/51K8oebTEqWPyIQG9x3CrEHFl+yvH3vAJXvtnIMDdLBZ8/Plmp7iIry6I/p0fsx4J04PrODqQkDZ7U0MglMMXoxY7qKk5LcDA5XZqXcC+NBgkGwbFG+KBcMZOniS1FgnN0qpWjKVyDcOUX+Q3rUOP1Ysnn2eI3sSdGpHGBgVjB5/3Ul+sPdS+G/dE4hAFNzcqTCRtHjNsYrfEA7hZCe73rYuUB1oT9WrM29Z/GLt+y08rRKhsy2nZ+7HrggkY9mprhk4wHI9yaiwXBcJsQI1RtGSv1oEyFGIfQz6j9ihN3xbuXeT/lVFFlxPqXnqhJ71Y8S0tsYmtlaZWzhQ8zrnaI5hrBLHwc886UfDZFestsCArD1y/KQQVOvwfQ51c832gkFIg8lcBPxKQaRHLGdbHXrrt1YVmyTuEmSjbJBcHGEZgiMoH2qbq7CsX3d7va5wgJQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR10MB2663.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(39860400002)(346002)(396003)(136003)(376002)(4326008)(66556008)(2616005)(6916009)(956004)(44832011)(8676002)(86362001)(52116002)(5660300002)(316002)(66946007)(36756003)(66476007)(186003)(8936002)(6666004)(2906002)(26005)(6506007)(38350700002)(38100700002)(1076003)(6512007)(6486002)(478600001)(83380400001)(107886003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cyFcUEkGlTlFWHHUK1171aZYCeHQbuljJPEQ9DJXm/RM08jdzWRb7SSKJ4HqjBiWJn5evsSS7zIiX+PBcR66hzK1af2J7xbWqAs87As+ZCUOfsxToV7FgDCnWizvFzvfsXUtWk97ULHVzHI1Ze1XxpL7Krzbpm6NBjYGaYN4zT5MKSUgBkBuKIFiB/xijjkut6cT8CTnNcPqT/zFGbDxiqKhkNdNh013F9Gkx/o0VJwjQPWtby0/VpOhyYeOANAPXs4QNnT6nrZ/pHEnb8kej/E3v/R2STqO69QA0WbBXDzSDMKHe44TiKcMDEVSJbJ1YN8zEWoBoU/HyAVnzRuSOqU/H8NzsEMVqJdSICRedRw9sNjK5zp+0fee33miKDAh693e96nAEWbVNIfHoFFq45mdbuEfycg1HgfMJ3WsAL1hkI2wsT7jes/bBAb3XliYqLn2v0UsgPz1unpPByx8AWo1D2LlLrZucbYwxujnnwfof0lXuCsvo9y7/R6gwdM7VEm8vEOuyU3wta8NC55mdyOASNUZ220bRIFrqInUKSX9uP0TynN0bGYD8vNceND3NaPU4D9mdfhDO4DPg3OowDsDMUTSqTbZCV5uJJ7J1ovvjSYhAuR+12qq+EqiUgWsfu7zdKJwI1ipqAc9mlFa7ydR79g5j9OCPg4GdKPavOufiGNcca37YOsOx09zd/hLn9UBgM0LF+RxxsGwjJBk0z2EKj0YBSl+oeHWRjrfYm5O7SmZOKVBpOo8UO5SCpJ3UhG/yjPlz1/Tzl9E28OopTbMNf8TzjYZEinEg5jdJOPiADYMjbjmCkLOSax3aPrXlaEAFiL01rr9ckAjIHAOqTaPdpS311U6wuLJPBR1gpdR45otbp32Q9j+2fsrnc0DO29UIyxlgNHQ8LFbIyd8dUj+T4n1QQiwz48E6OyydMAsYykQkuNzhf9Vxm6er7visXPddxqZ7tobuz8/S9P3Ykxrjt9koQGCu/C6i2N1yqjTqx9zx47GwtfQHl/RKxr8zzP9iQUmgEEflFgVZ6AAmNtk7zcOVo2CnLmdkDtu2hlp9nHf/ioCsLNwi1JosYZOYy8IiZYKtgnRDEqjD6cGdsY4hH9d0JcA/EQsMl0Z3BzqcKQ3dc4IlpHQ0NJuhMe6P+tN8XuxDiPAgmlFxKqT5VbQx46F85ih/P/mV2ysKyRHUZ/c/+FdMIWnE6oNiGY9NDDf03TXyTvmCIaESve8XQQ6SMEx4s6AdQFUKYVJ0nQY1OACJUUo98CFnSD064KHzG63aZM7S33kUeVnhL99HJXOcTgkT5Xh9wDs1Fn7BHs5eaZ+Rs70XyErRO0N6Trz X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c256c37c-534b-4885-6f60-08d946610b47 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB2663.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2021 00:48:06.5858 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lw8BfSG2/DJpu2by6Zdoq1p4yFoMVEAd2FUgVEN7DqgnRl2xPEnJB3QzF6wLUy8dV0dmcurGz4s3wMlnHb7gKQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4592 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10044 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 malwarescore=0 spamscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107140001 X-Proofpoint-GUID: UZThYi-wYsJiJxemcFPxhnzy68zoTepL X-Proofpoint-ORIG-GUID: UZThYi-wYsJiJxemcFPxhnzy68zoTepL Received-SPF: pass client-ip=205.220.165.32; envelope-from=dongli.zhang@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, jasowang@redhat.com, joe.jin@oracle.com, dgilbert@redhat.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" While the previous patch is to dump the MSI-X table, sometimes we may need to dump device specific data, e.g., to help match the vector with the specific device queue. This patch is to add the PCI device specific interface to help dump those information. Any PCI device class may implement this PCIDeviceClass->msix_info interface. Cc: Jason Wang Cc: Joe Jin Suggested-by: Jason Wang Signed-off-by: Dongli Zhang Acked-by: Jason Wang --- hmp-commands-info.hx | 7 ++++--- include/hw/pci/pci.h | 3 +++ softmmu/qdev-monitor.c | 11 +++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index ce5c550d44..4e831d7ae4 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -223,9 +223,10 @@ ERST { .name = "msix", - .args_type = "dev:s", - .params = "dev", - .help = "dump MSI-X information", + .args_type = "info:-d,dev:s", + .params = "[-d] dev", + .help = "dump MSI-X information; " + "(-d: show device specific info)", .cmd = hmp_info_msix, }, diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 6be4e0c460..4620b9e757 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -129,6 +129,8 @@ typedef void PCIMapIORegionFunc(PCIDevice *pci_dev, int region_num, pcibus_t addr, pcibus_t size, int type); typedef void PCIUnregisterFunc(PCIDevice *pci_dev); +typedef void PCIMSIXInfoFunc(Monitor *mon, PCIDevice *dev, Error **errp); + typedef struct PCIIORegion { pcibus_t addr; /* current PCI mapping address. -1 means not mapped */ #define PCI_BAR_UNMAPPED (~(pcibus_t)0) @@ -224,6 +226,7 @@ struct PCIDeviceClass { PCIUnregisterFunc *exit; PCIConfigReadFunc *config_read; PCIConfigWriteFunc *config_write; + PCIMSIXInfoFunc *msix_info; uint16_t vendor_id; uint16_t device_id; diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index 7837a17d0d..7fd3fe0ada 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c @@ -1011,7 +1011,9 @@ void hmp_info_msix(Monitor *mon, const QDict *qdict) { const char *name = qdict_get_str(qdict, "dev"); DeviceState *dev = find_device_state(name, NULL); + bool info = qdict_get_try_bool(qdict, "info", false); PCIDevice *pci_dev; + PCIDeviceClass *pc; Error *err = NULL; if (!dev) { @@ -1027,6 +1029,15 @@ void hmp_info_msix(Monitor *mon, const QDict *qdict) pci_dev = PCI_DEVICE(dev); msix_dump_info(mon, pci_dev, &err); + if (info) { + pc = PCI_DEVICE_GET_CLASS(pci_dev); + if (pc->msix_info) { + pc->msix_info(mon, pci_dev, &err); + } else { + error_setg(&err, "Device specific info not supported"); + } + } + exit: hmp_handle_error(mon, err); } From patchwork Wed Jul 14 00:47:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongli Zhang X-Patchwork-Id: 12375449 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F276C07E95 for ; Wed, 14 Jul 2021 00:50:33 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A887C611AC for ; Wed, 14 Jul 2021 00:50:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A887C611AC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:43404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3T6d-00060R-SK for qemu-devel@archiver.kernel.org; Tue, 13 Jul 2021 20:50:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53476) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3T4U-0003fW-Bi for qemu-devel@nongnu.org; Tue, 13 Jul 2021 20:48:18 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:38648) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3T4Q-0005Wo-BJ for qemu-devel@nongnu.org; Tue, 13 Jul 2021 20:48:18 -0400 Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16E0fE3U001519; Wed, 14 Jul 2021 00:48:11 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 : content-type : mime-version; s=corp-2020-01-29; bh=r1n7485cQhaxPzj8emFerG876GfvUQJ2MFub7M84KMs=; b=Xykro58G2DjZHuU+THDeu/jqPUvzFGTyzxDVkTO6VVh8TJ4XGdqzB/fTXZlPlmlvinj6 8DRZE2pxsXAuJhuOYNJNxrbfQzkDDN2ExVziZW0ORp1q/kRc7dF6eBp8qHvVcDXqF65L XicfiWvOON129KQ+BsPhvPs/nsjdc5bJWoIkG7ua2Aw4mpr7IgSZdnRaiTDnG9bgGSVY SY0vh6q34z2UsCwGuQUnrVcyamioq4SFmSNw83ELLC+/I0lmjBdrNGPsT62aiC71GR42 6iezofK/5uM3n6J2WBhD5RL1zFBx8L89qf+ibEYv4gE9RqVwliWOVXKYffYM/mivLOmr jQ== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 39rqkb3mt8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Jul 2021 00:48:10 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16E0eiYO076431; Wed, 14 Jul 2021 00:48:09 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2174.outbound.protection.outlook.com [104.47.55.174]) by aserp3020.oracle.com with ESMTP id 39q3cdcng2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Jul 2021 00:48:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y0Cd9jOGqB93t7s2XML+ENT0cOuQbKPXTH4tLbHUOXii+KejyC9/1bQoFqBPJtSTh9BeIL8vlLx6fysdxoND6J1re9nsjhn9spRvXKfeADeigK3VYwHg2WUkafAQymbDvNsvdGti35i6PGMLRJlP2GkHbzyyZDeA8Lot4ZwmSA3Nm+EtZQE/p+aXrqBg4ZhTiXTVkucvYkUKLU1yNOWi/cOvKOYCHofDV3OGBkHqiCMobyF4yNRyryIVny7/i3GcCWLFmCFTFl+EpHdim7PiMJzm9K4PAWutUFVUbFnhgfhIJ+cwGT44I63RvENkcVPlLdjfXJxqXBrm6jdY+8T+zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=r1n7485cQhaxPzj8emFerG876GfvUQJ2MFub7M84KMs=; b=Xk5dovnfS10VwnWRc4hX5H7O1ne5V/ukcx5aZPUfIDApF1M+Guu/Pi11CCjhiCE5MNhY0VgSADnT66eak/IWih1UR+gc5MQcwtCbUs/KbXY0WvJPEfPjrsfwO2l73tAktJKiS/g9IhoKvHwI2/yt4qT1RgrZ9OXTPWoYAhyNySE4oM1s4exD7OyKY0t4MMONbmOCZKUyXEuueJhLN4q+Xb+cAEdsO2/DqsoLJNef5i8kRLi+l95uNjRWfjZUCXYfV1XU7KmTl1+elvGZlrdpyxKi+5J6ReCAg4BJCbjDfXvdUh+cvp49grHM0YN7WBwejbV0gWj/G/UdddCMWdWrZA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=r1n7485cQhaxPzj8emFerG876GfvUQJ2MFub7M84KMs=; b=w5nI+6l71TO3uwkAc44fgXIKt2DRw1H7bfQIUm2ZjrcTbP92QAvdXbmYOkqpQr62GvEltO4s8e2qGE/j6g0ODq5CJGEWGZxcB/d2tkg2IoINFHwVX0MgbtsMwOUVaA6Jt9sFaGFM+62TwgdfPLoyCmpB9RBYsz4D1T9q0YRVwtU= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB2663.namprd10.prod.outlook.com (2603:10b6:a02:a9::20) by BYAPR10MB3589.namprd10.prod.outlook.com (2603:10b6:a03:129::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.23; Wed, 14 Jul 2021 00:48:07 +0000 Received: from BYAPR10MB2663.namprd10.prod.outlook.com ([fe80::18a:7c1f:bf20:ba6c]) by BYAPR10MB2663.namprd10.prod.outlook.com ([fe80::18a:7c1f:bf20:ba6c%3]) with mapi id 15.20.4308.027; Wed, 14 Jul 2021 00:48:07 +0000 From: Dongli Zhang To: qemu-devel@nongnu.org Subject: [PATCH v3 3/3] virtio-pci/hmp: implement device specific hmp interface Date: Tue, 13 Jul 2021 17:47:54 -0700 Message-Id: <20210714004754.22243-4-dongli.zhang@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210714004754.22243-1-dongli.zhang@oracle.com> References: <20210714004754.22243-1-dongli.zhang@oracle.com> X-ClientProxiedBy: SN7PR04CA0042.namprd04.prod.outlook.com (2603:10b6:806:120::17) To BYAPR10MB2663.namprd10.prod.outlook.com (2603:10b6:a02:a9::20) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (138.3.200.16) by SN7PR04CA0042.namprd04.prod.outlook.com (2603:10b6:806:120::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.21 via Frontend Transport; Wed, 14 Jul 2021 00:48:06 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8cebaa24-30da-4357-ed98-08d946610bfa X-MS-TrafficTypeDiagnostic: BYAPR10MB3589: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:192; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lh8GdffSEbUpSoIqNG3zgsu3e1txjt6ajsnDY+2ExkPPJhHg+OW6+3gLTgQOGQyniPyjQ+QNkb6MuvV0Pk/ULKkX4qLIACYKUOCiXeZpzEBvxjHcz5jLtRQ1+nfY2JQ/3KddWeHZoLLkTXvjUir4NL2oCwAhsMyFmhTQUvRE+4CWMRg8VAMUBUkIGAvG+Fk4TsIQMXLDX0mfqb5iXlPyCFE2IoNFKVEiP/QCcxIXiD4XJKz2fUFQldIv4HpS60UCwdfFNAhn6VNA/P/TWDgIGMHZZiXciTMVVNY2vcQrv0Lv+NfBqrFiwlFk9n/UsdhfqbOsEG6dKm4pqVJ1b6bvMH1eO5ofQjgmNcHt/Uu4T+DSLZSCgIocLznRwocLaHUpsqmDJ1iO/WVKet6eA3biG9SRt4agWAaEAjN087To57pXSSVtCMKODA74Q4i0FwM8+7jzKbRDkh8GPi7HX2EBsd6+eaHzhZrpUOWRbuaTXzRA4WmwARVoqToSczmueLI6yC+OcY1sPD1TSchsWxcbScrf2nI8vFiK4jh9rgBYM+YMUwIgQIjkRvGP8JEPbXtOgOd3PevLZfQTU3C0N63iCqnkLWUjybStnAR7RP2Xl6O7JP+zP4AwQ9k6BuOMTTPk+2KcXL2d62Wi1yQYzbThndHBbxoJZArnbsNpssFbH1Th1x78KX/erPCyIzrqrZPUA9N6LzQIDu/+PsH3ahJNZQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR10MB2663.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(39860400002)(366004)(376002)(136003)(396003)(6666004)(83380400001)(38100700002)(4326008)(6512007)(38350700002)(6916009)(107886003)(6486002)(316002)(8936002)(6506007)(1076003)(86362001)(2906002)(2616005)(5660300002)(36756003)(44832011)(26005)(66476007)(66946007)(186003)(956004)(52116002)(66556008)(478600001)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: V8Id4bYyJTY0TnRD6VTxZ1TX7mvvJA6eG/TWG6na1ISmgRO6MsUbETeuh+hTnqkn09mPvsLKJNUZIV2jqsF0Cpt1vDZrF9wL1th6xuEPoPkIEKgDSpU6HF2l3Se8Vqf86BTXOIfXMHW9A2VuxR7SnuyIJ3ZNFUqimsq+Rn98y9JMvgYWhT1P9DVEgO6SAqaiCWRWD1ggqf+IDTH6UTem1Fz0IsZMzBgUc51nd6M3RnttrkgMVqywWbHn6bYxZhYc0vjTp/nj2b9Nfu8OGvUadMRlF3TXLRS3jNDevPvLa+N0wJhoAgOZ/2SgaCT22G8obcdMfPFWYkWAywyHvNBHbqbctFbwelby0QDQmivkZNV5v4Wqf+pgT6abKiaP3ILlMRRKd2RvTiV7cYSX5WlP02nSU4vQVgHhbm3RIsLCmNQQw0iCWa2kSm+kd+p/ZH+cXStkHU40V/kwXkhgd11jTAHLGrviBjTdefziRZUvu5PyJ4Hy+yVCayufPlptrpCYO+O4m1buYNCcNGqSQ0nFnl1wPz4PzE37sktIXzP47hRoEAfNGqMKf1X3IX9g51NK9z1ZcvJZ26o1g8CRsrVAM8rRgRN1quUZRBCCls6nXs/kkd8WCdE/jwjCVTYWf+LWXksYE8BL0nyR+Vr+5X6+6gyrLrGIeiTWYKelS8w9llM+EjqAn2TkWGqks6I7xN4jJnKZkDcLvdOJgW8VNJci74KMNbJHeB6ZoUUGny9JIaRHw/X7hSOeQFdsPYCYXlao0dPNFq5HvVmULI8KCJvVp0S3LbpP8dQZ/+H6dEI7Gp0xPxUh54hIKifhZtj5fyHw2frjUujkqyIi6zXyvUlRMnRYBt7JHUIL5NupZ7H9jAJggKuxAoyB/1p8QI4JVrsFrVwWv0Y7/MeoTKaafaq8n9lSOoNAL5NWcsPTGecgNX0Z3v0I1MP01vFnttbYIEC1ua+yZ/BRDn2eCex4SH9uGFKXeg50FmLlcwdi0hFP4SOAP62zz410ZZ0ExXAh0KdaNoBekMzCnhWrDuKBIwIT2doHFGvzv2wM9LF3MOuh16qJGcsS9xeP9PX0XBlX2w+C7ILDajgJriFDQD8jkVgCMAFWGlCCh8HVmCGy49j6LqjtdaT1NLA5srlPILyOGG17NaZ5QZ3UzHZXFa8BJGsUoQnoh13Rnb1vFsGGgOb2qV7fbA5/EpKnHgE3Kljj9wEJ5VZDlKR78XJKUcRV4lzf/FvRkqr1KWY0BWAA1gCKAfyNyEKM+X0aZDSMfELKTtRTBHm1A+WVY4i4fC/WvhmgUBsKqTT529gqWBNcP6D2sA4br2c5kB39DPGBYZ8p5Wae X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8cebaa24-30da-4357-ed98-08d946610bfa X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB2663.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2021 00:48:07.7771 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZtjwyRunyGOuWs6AeWkDGubX0gv1LjJSQhh9Drdy8rMJDo5yrg8kBvEJ+G//4YdHrf1ZEX0Db0NRf8WZ0OlFzg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3589 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10044 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 mlxscore=0 suspectscore=0 phishscore=0 adultscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107140001 X-Proofpoint-ORIG-GUID: O83OrPZeFmJdFL7YP8ep9WZ_Jo0epqi2 X-Proofpoint-GUID: O83OrPZeFmJdFL7YP8ep9WZ_Jo0epqi2 Received-SPF: pass client-ip=205.220.165.32; envelope-from=dongli.zhang@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com, jasowang@redhat.com, joe.jin@oracle.com, dgilbert@redhat.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This patch is to implement the device specific interface to dump the mapping between virtio queues and vectors. (qemu) info msix -d /machine/peripheral/vscsi0 Msg L.Addr Msg U.Addr Msg Data Vect Ctrl 0xfee00000 0x00000000 0x00004041 0x00000000 0xfee00000 0x00000000 0x00004051 0x00000000 0xfee00000 0x00000000 0x00004061 0x00000000 0xfee00000 0x00000000 0x00004071 0x00000000 0xfee01000 0x00000000 0x000040b1 0x00000000 0xfee02000 0x00000000 0x000040c1 0x00000000 0xfee03000 0x00000000 0x000040d1 0x00000000 MSI-X PBA 0 0 0 0 0 0 0 virtio pci vector info: config: 0 queue 0: 1 queue 1: 2 queue 2: 3 queue 3: 4 queue 4: 5 queue 5: 6 Cc: Jason Wang Cc: Joe Jin Suggested-by: Jason Wang Signed-off-by: Dongli Zhang Acked-by: Jason Wang --- hw/virtio/virtio-pci.c | 22 ++++++++++++++++++++++ hw/virtio/virtio.c | 10 ++++++++++ include/hw/virtio/virtio.h | 2 ++ 3 files changed, 34 insertions(+) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 433060ac02..2971e8049c 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -38,6 +38,7 @@ #include "hw/virtio/virtio-bus.h" #include "qapi/visitor.h" #include "sysemu/replay.h" +#include "monitor/monitor.h" #define VIRTIO_PCI_REGION_SIZE(dev) VIRTIO_PCI_CONFIG_OFF(msix_present(dev)) @@ -1587,6 +1588,26 @@ static void virtio_pci_modern_io_region_unmap(VirtIOPCIProxy *proxy, ®ion->mr); } +static void virtio_pci_dc_msix_info(Monitor *mon, PCIDevice *dev, + Error **errp) +{ + DeviceState *qdev = DEVICE(dev); + VirtIOPCIProxy *proxy = to_virtio_pci_proxy_fast(qdev); + VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); + int num = virtio_get_num_queues(vdev); + int i; + + monitor_printf(mon, "virtio pci vector info:\n"); + + monitor_printf(mon, "config: %d\n", virtio_get_config_vector(vdev)); + + for (i = 0; i < num; i++) + monitor_printf(mon, "queue %d: %u\n", + i, virtio_get_vector(vdev, i)); + + monitor_printf(mon, "\n"); +} + static void virtio_pci_pre_plugged(DeviceState *d, Error **errp) { VirtIOPCIProxy *proxy = VIRTIO_PCI(d); @@ -2004,6 +2025,7 @@ static void virtio_pci_class_init(ObjectClass *klass, void *data) k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET; k->revision = VIRTIO_PCI_ABI_VERSION; k->class_id = PCI_CLASS_OTHERS; + k->msix_info = virtio_pci_dc_msix_info; device_class_set_parent_realize(dc, virtio_pci_dc_realize, &vpciklass->parent_dc_realize); dc->reset = virtio_pci_reset; diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 874377f37a..ea54939e98 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -2581,6 +2581,16 @@ void virtio_notify_config(VirtIODevice *vdev) virtio_notify_vector(vdev, vdev->config_vector); } +uint16_t virtio_get_vector(VirtIODevice *vdev, int n) +{ + return vdev->vq[n].vector; +} + +uint16_t virtio_get_config_vector(VirtIODevice *vdev) +{ + return vdev->config_vector; +} + static bool virtio_device_endian_needed(void *opaque) { VirtIODevice *vdev = opaque; diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 8bab9cfb75..6746227f73 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -268,6 +268,8 @@ int virtio_set_status(VirtIODevice *vdev, uint8_t val); void virtio_reset(void *opaque); void virtio_update_irq(VirtIODevice *vdev); int virtio_set_features(VirtIODevice *vdev, uint64_t val); +uint16_t virtio_get_vector(VirtIODevice *vdev, int n); +uint16_t virtio_get_config_vector(VirtIODevice *vdev); /* Base devices. */ typedef struct VirtIOBlkConf VirtIOBlkConf;