From patchwork Fri Jul 28 07:21:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liulongfang X-Patchwork-Id: 12752 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp281551vqg; Fri, 28 Jul 2023 01:28:05 -0700 (PDT) X-Google-Smtp-Source: APBJJlG+FcZC8OG/nupR1Ax+sSUGAuxSmfyJmJhlo2sT317plfPomL4rx+BLLYZ0xWkPDEPT1aEp X-Received: by 2002:a05:6512:1286:b0:4f8:5c90:f8a4 with SMTP id u6-20020a056512128600b004f85c90f8a4mr1380163lfs.33.1690532884831; Fri, 28 Jul 2023 01:28:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690532884; cv=none; d=google.com; s=arc-20160816; b=XrRz2RxHBJ8o3ydPm8oc1DJNBQwkCJ/xCNhSckwnHBA2nUyD5c78coAWHlujBwB2MF vSmRNoeddH9pA4qinrOlm6yGGnXwTRr3TJUc5cwTbp5Yb09g96rfCnvp8cc8aa8rPgJR SI2JxgpWxQltTBeDURCqQFubruqut0K+OBtQ5HaN+Q9o7UMzUckgbP2CeHVh93xMxWcO wsMqrilL1zZ8xdtikvFULsKZ5XQX9McHsyqQHiO3zEsvbZdCxjuTRk7UVBiPEjweyLnj vkkV8UyroiMEfJg0D3LxylV/HGDiNvWxZxQO9+iYDe7gPsgOet20qE92bFXUlgH8DK+E QCnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=88IM16meEm9KKpqzMUSFVNF/26GRFHB2QYNNZVdN8bg=; fh=p3Am84eky8JnrvU8V3qjJSb/r882u1KpK1t+PYxZV0c=; b=TXMSAg9NJHXV+mGOD0M3Ada2Y/qWCXskploIEZKJsLjkibrY3D/cE7Zba0UiJvhWqa gekGQKO9QGCcdPXZDYGKXMQE3dVFBKB7ifwuGSQYAg2qD28ErLWd4xmJckvBXggTBqWm e0nvfCFHRUL7UaJigCdf3Rq4EH/mxpUk8LyiMIZw2h1tU6PrgDZBbKX8uHktBpdfCinC CJAxTxygCkcpqvohrzRLDKLn4J4arH9EhGdBMQ6aXifsREqHvWXhLzYkqRtY8LeQx1mE RbI6tndUiP2JXWVy/64M8KIT1GwAhKDmO0e5c5kNsXd/0c/S54+kdpEB9gemJbyJoYbA 06sQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m6-20020aa7c2c6000000b00522561facd7si2140701edp.143.2023.07.28.01.27.40; Fri, 28 Jul 2023 01:28:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234132AbjG1HXR (ORCPT + 99 others); Fri, 28 Jul 2023 03:23:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234118AbjG1HXP (ORCPT ); Fri, 28 Jul 2023 03:23:15 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F23DF7 for ; Fri, 28 Jul 2023 00:23:12 -0700 (PDT) Received: from kwepemm600005.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4RBzbp3NXtz1GDMb; Fri, 28 Jul 2023 15:22:14 +0800 (CST) Received: from huawei.com (10.50.163.32) by kwepemm600005.china.huawei.com (7.193.23.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 28 Jul 2023 15:23:09 +0800 From: liulongfang To: , , , CC: , , , Subject: [PATCH v12 0/4] add debugfs to migration driver Date: Fri, 28 Jul 2023 15:21:00 +0800 Message-ID: <20230728072104.64834-1-liulongfang@huawei.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 X-Originating-IP: [10.50.163.32] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600005.china.huawei.com (7.193.23.191) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772652210114702728 X-GMAIL-MSGID: 1772652210114702728 Add a debugfs function to the migration driver in VFIO to provide a step-by-step test function for the migration driver. When the execution of live migration fails, the user can view the status and data during the migration process separately from the source and the destination, which is convenient for users to analyze and locate problems. Changes v11 -> v12 Update loading conditions of vfio debugfs. Changes v10 -> v11 Delete the device restore function in debugfs. Changes v9 -> v10 Update the debugfs file of the live migration driver. Changes v8 -> v9 Update the debugfs directory structure of vfio. Changes v7 -> v8 Add support for platform devices. Changes v6 -> v7 Fix some code style issues. Changes v5 -> v6 Control the creation of debugfs through the CONFIG_DEBUG_FS. Changes v4 -> v5 Remove the newly added vfio_migration_ops and use seq_printf to optimize the implementation of debugfs. Changes v3 -> v4 Change the migration_debug_operate interface to debug_root file. Changes v2 -> v3 Extend the debugfs function from hisilicon device to vfio. Changes v1 -> v2 Change the registration method of root_debugfs to register with module initialization. Longfang Liu (4): vfio/migration: Add debugfs to live migration driver hisi_acc_vfio_pci: extract public functions for container_of hisi_acc_vfio_pci: register debugfs for hisilicon migration driver Documentation: add debugfs description for vfio .../ABI/testing/debugfs-hisi-migration | 36 ++++ Documentation/ABI/testing/debugfs-vfio | 25 +++ MAINTAINERS | 2 + drivers/vfio/Makefile | 1 + .../vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 199 +++++++++++++++++- .../vfio/pci/hisilicon/hisi_acc_vfio_pci.h | 3 + drivers/vfio/vfio.h | 14 ++ drivers/vfio/vfio_debugfs.c | 80 +++++++ drivers/vfio/vfio_main.c | 5 +- include/linux/vfio.h | 7 + 10 files changed, 361 insertions(+), 11 deletions(-) create mode 100644 Documentation/ABI/testing/debugfs-hisi-migration create mode 100644 Documentation/ABI/testing/debugfs-vfio create mode 100644 drivers/vfio/vfio_debugfs.c