Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp884379rwb; Fri, 28 Jul 2023 01:00:15 -0700 (PDT) X-Google-Smtp-Source: APBJJlHuxa0UMCBkjOCM3V/BOJkRkhFsgJpxUJ47b4AImkZyRH1lSuothKsc3imvliUg2Ga0CM6E X-Received: by 2002:a17:903:18c:b0:1bb:30c5:835a with SMTP id z12-20020a170903018c00b001bb30c5835amr642277plg.7.1690531215375; Fri, 28 Jul 2023 01:00:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690531215; cv=none; d=google.com; s=arc-20160816; b=yAbLz/856WDEEGskOBYFl5lGlOtOaewyTPqDiDpXvinykF5LzURLWy0mj7ftPkCgTG x80LSXFt4Dp/9c8K6IAOOLCe1TnyxgS9ZtA4BTpS6MTENfYO1vNbRbds8N6NgeD56Iqr gcYrIrp1gA6HvNQKyKCLRgYGwAvuP4j8sF2n4WnnJ1tr2TcmbiYi3Ws5QkioDVEmOdvs TlT1SSgSG6GeXA6cB02wzxEzyZmrxhWyv03Ltg2h/hiAx/SsNAV2lNaUMuFbcn0nzIAv HC3QS9JSo5SwF2aH90MFlgzv961jEpNQr3NY37L37ZkeqnqEsyXLx5DyNbfS/cDqyzwj GY3g== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c9-20020a170902d48900b001bbc170b2d4si2800057plg.491.2023.07.28.01.00.02; Fri, 28 Jul 2023 01:00:15 -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 S234128AbjG1HXQ (ORCPT + 99 others); Fri, 28 Jul 2023 03:23:16 -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 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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 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 -- 2.24.0