Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp2690788rwb; Sun, 4 Sep 2022 22:55:05 -0700 (PDT) X-Google-Smtp-Source: AA6agR7suM+4C95ydftPLoouq+PqUi20uiVhaHtE6bACEpDZyHDJGay4EDWXya0fxhxUrhH7znvX X-Received: by 2002:aa7:c458:0:b0:44e:9078:5712 with SMTP id n24-20020aa7c458000000b0044e90785712mr1902122edr.25.1662357305463; Sun, 04 Sep 2022 22:55:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1662357305; cv=pass; d=google.com; s=arc-20160816; b=GKaxFqhZs/8rxTLPgESU6SgZtOcBw1i+XWEqS2KAX3fOTkB/s97sHJCRSTfbAUvewD TRM2/SPiNppMRZglvXpl2py1Hg4og9iJypT9GisrHX/myrZbOGztOH3F5bZTLfXhG1ph Pvr8z0R7Fmmm4hqiKpo6fTG4lxprX1IYm0uV+90krG5270HSo6oYtK0JLQm+RKDaYc8/ 3xClIUDyDtIlEYs8jR4L8hIcPOfKHnmzNVwk47+FWpmhwXorV+c5y6ONrEM541TQHWtl B5BXE+Ph9n9/APq9jtazXO+F2OuiZ/2B5fdHrARzHYR8TcaK/Utq2s5TrkLL4L/r9OyR 9+Dg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=VApS/yBW941D/daKAn4pW4AvTu593l3xugGJ3jWM/TU=; b=nnYr6BAOJM2ClfJcpGtjVe4iYfL1SO6886Ko6SN3lh3JCg4r7xEPMkdbHjJleq2wAU XoVEIoqc7/BvyGrceG/ZQ5drpSZ6gVbABInI3nn5m3/zQYclBRz97vckjmZHj/pOY2s0 uQu4NYYroShpm8oO1dfMtSdqRT1zscHSu0N//BN8ApSt7yvdamxwLkz9cpIpa87GLlL6 3JEtOUfwZaY12PWOw7bOffEXPE6on/bEXtPMKSSPiQfq6Ulshzdm7tf34C22i0lsfJq/ fY3oElmWxAois2au7inVgoRzYZ/RUkrHbDaJUUu50ipLP+eBaldf7oD5pW+7gS6rbdrg 0cLg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=BnSkxzT+; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.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=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp18-20020a1709073e1200b0073d9b03865asi7044980ejc.706.2022.09.04.22.54.40; Sun, 04 Sep 2022 22:55:05 -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; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=BnSkxzT+; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.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=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235698AbiIEEy4 (ORCPT + 99 others); Mon, 5 Sep 2022 00:54:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229560AbiIEEyx (ORCPT ); Mon, 5 Sep 2022 00:54:53 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2084.outbound.protection.outlook.com [40.107.94.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AE7617E0B; Sun, 4 Sep 2022 21:54:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cBP8xjC5UHv0eiuI3lsmMohu+Rhni5dGVi3OOyMQJld1PDYFJpkBALiVetxw8uB9KrUvNiCrutFqUASMPc8qvyiUzkv0Sy2h8edP3aCI5xVpgLUzCqEKkhIEKgwOjTPvic6W5Y6EnzeskZJ+6Qee2zBOd416bm0o7K/bbk8pMlsWn7eUibNga2ULryH7UzqRY3ZWSQbdr4XTwtSmtoZfuv2InUvTFfHDUK6JydCL8WFcDypBHgiSOil1m+foABsO0Hul+7MXANOleX5a9OAXeDD8vMvjmy0bjsrIT2JUV/+sEjPU2cx6ekvqff2HH/e3og0bt5U55UXj28dAq7wZtw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VApS/yBW941D/daKAn4pW4AvTu593l3xugGJ3jWM/TU=; b=iVj8tEK1LrjOuetpWyfvfonuOAr1UGuhnGnc5XSsZQVm2VczuEXvgms6+XIP0HC9oEHwYlAnfBYCAwVDUWSRFgnGOi+3nH3mSexnDhbS0Qzea60GA9tBu9MA/aTTvdF7qwxiMy1s1ZAasOpVD6Aj8DYn19MumNBubuwr71FTmz+6zd1H0rySJEWbofSnawl3bapg6qqGmDA57h4z+18xFbRf1A2tdIHPnhKex5GKESwLzdtE7qM1MGTWr3qlkbrKM0wohbgV58LEmvUlp1Dc7ObBuqh/q1tjuiLswxvRI5MuxEuZEPdw9eyR3G+KoCW6t0mx+qQzALmr7WoE5GZKQw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VApS/yBW941D/daKAn4pW4AvTu593l3xugGJ3jWM/TU=; b=BnSkxzT+M+fmvQBq2iLEULVrBcgdurq9L7JgZFkDXUFjy5gGlHb/h/coW1bfD18jHLxFpoHL6NR/n6rA7yyOaeKnCFjgLp99jOq7Pb5Xi2VfKmCwjIYkfA+rqYdAJrnKk37V5818eslR9P+EE5HJGqYcBC9Gro3CQAUahfZamwxp6fQ7T3/2N4M3sWdGQd+d/Y9rmk9lU7oQSVXbprory3lgDway96k3KmyyZTDNVozZbXl5TcnWnl4U0cEeEbkE1RYJdgghuuqJV3WqgdJblCNzwH3swfUXgQt1HzDQxVfjvGKvLqHwWc5T7c2T9MiJEs2cKLhZ1/1+cSoeC40zDg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BL1PR12MB5304.namprd12.prod.outlook.com (2603:10b6:208:314::13) by IA1PR12MB6554.namprd12.prod.outlook.com (2603:10b6:208:3a2::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.10; Mon, 5 Sep 2022 04:54:49 +0000 Received: from BL1PR12MB5304.namprd12.prod.outlook.com ([fe80::753c:8885:3057:b0a1]) by BL1PR12MB5304.namprd12.prod.outlook.com ([fe80::753c:8885:3057:b0a1%3]) with mapi id 15.20.5588.018; Mon, 5 Sep 2022 04:54:49 +0000 Message-ID: <75332807-3645-6b82-be49-448ed8313a84@nvidia.com> Date: Mon, 5 Sep 2022 10:24:37 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: [PATCH v7 0/5] vfio/pci: power management changes Content-Language: en-US To: Alex Williamson Cc: Cornelia Huck , Yishai Hadas , Jason Gunthorpe , Shameer Kolothum , Kevin Tian , "Rafael J . Wysocki" , Max Gurtovoy , Bjorn Helgaas , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-pm@vger.kernel.org, linux-pci@vger.kernel.org References: <20220829114850.4341-1-abhsahu@nvidia.com> <20220902124234.472737cd.alex.williamson@redhat.com> X-Nvconfidentiality: public From: Abhishek Sahu In-Reply-To: <20220902124234.472737cd.alex.williamson@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MA0PR01CA0027.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:b8::20) To BL1PR12MB5304.namprd12.prod.outlook.com (2603:10b6:208:314::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: db501967-196f-4dd1-ae14-08da8efac314 X-MS-TrafficTypeDiagnostic: IA1PR12MB6554:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: V+Xt+Vd2GFcumhZhLgnLTwbzMnX+CcihAirzWZvI22PUaPYxTqCYFfFH9wk0mzQ+z4lylLnJnSzoU+X6XM2b+/1UIPEJTeGK7NRedoc3htdK8E4njiKpq7ViaUSc80GSQuYt8ljSLZPdNFcS6a6SRZyh2phHl01zs0W8ydtiYkQd1uw+iiBiriGNbrMBlgzOef4KpeduwmgOXjLreAY46kCiD9D0qHqIrMufPF+N0Unambe0LnkciM9IJCpJPYt9nVF1Xpm/frvkba8D5MpSSOguYrIZ+yHsNSe1NH+9caN2kjbXRLhiW/scZe5UHiBMjIwFnHMvXuNKglqy0jQKbWMGqmmcq6HEAr3uNG7of20Ldzo9lfNWKKfubnczvAyHk4Icx1Z+P3SfYpDnLfZSwf7mI8feAdQhTEdC3GUmlbRqVRBmK1e2yiDOUOUa95pMvRLXPgKMs7GByZ3tVhaYj9kBpSBnU7Cq/ny3P+x4222/T401wmREZ1OY8bA1+IJEzPBUzaq0U3aFAjjh3cPX41yp51TPfdu7EZXsleW6VebWlxfB8Fn0xwIUw8900lJqJc1sT85q5DYebmQLWDjuK2MJwGI8H84CK/J7mhTXYwQqBcToVRlGw4fXrmDUAGWeR6qbKOduQt7AIl6uXxkZM5AsX8f293XjTxhyoKJzmYxDuMAYA4zBoXUBz+7PT2OuxwwXeC4hf4Ohcnd0c/414tW7WN0OVMgI35SVHs7s6zxCb8IQvXuxrlnuydiLc1nUZcIHrogDQMNF+hIr0j+lpXGcjG50qdA4UV+dKx3aS/u9cPES01Sq/cw4of2UAO4qLY6bIibdm/GLz6EgBSHVyLCCXpzqRxtUJDOKgSGFNZra4Lw4Q0T0Hs1WO5rWRUKq X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5304.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(39860400002)(366004)(396003)(136003)(346002)(376002)(6512007)(8936002)(186003)(2616005)(6506007)(966005)(7416002)(26005)(5660300002)(55236004)(53546011)(31686004)(36756003)(6486002)(41300700001)(86362001)(6666004)(478600001)(54906003)(31696002)(83380400001)(2906002)(6916009)(316002)(38100700002)(66476007)(8676002)(66556008)(66946007)(4326008)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eldhY0pkQ0lIYWlKRXd6OS9MR1c5a1o4eEFGdWM2Tk1PSWFiN1NDZHFHVGth?= =?utf-8?B?UWs1a0J4Wm1ZdXJGVlJiQ3E0UFJ2K0QwSEU2MmExYm1hMEE5N0RnVlZoQzI2?= =?utf-8?B?ZDFqWG5ySG1lVk1aN3lZNi9tdEwvZGJ4ZW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?= =?utf-8?B?V05rcFg5cEEzaHdJb1RqYzR5Zkoyc0JNb3RjRVZ4bm1iY1Y1dUhXS2Y0Zll3?= =?utf-8?B?bXJ3UDUvVlhUdGJ0MnliTitkVzFRbEZzT3JMbEJiWU4wZm1QWkJGSlQ5SERm?= =?utf-8?B?QmUzYXhWMEtLOWExZ1E2ZE42dEVaZVdmZnc3TDZhN2RrWXZJMURvellScXN1?= =?utf-8?Q?W0p4kAaP6z0J3Uy/g7KW2auxi?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: db501967-196f-4dd1-ae14-08da8efac314 X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5304.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2022 04:54:49.6133 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: afCuP90OhkbT8MkRpeFLyffPiIj8Qv/b0OFlEZuG1PwBsJ9XxGak0JIfImqOTXwSCX4/NUesa8uqMx581ohOIA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6554 X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_NONE,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 On 9/3/2022 12:12 AM, Alex Williamson wrote: > On Mon, 29 Aug 2022 17:18:45 +0530 > Abhishek Sahu wrote: > >> This is part 2 for the vfio-pci driver power management support. >> Part 1 of this patch series was related to adding D3cold support >> when there is no user of the VFIO device and has already merged in the >> mainline kernel. If we enable the runtime power management for >> vfio-pci device in the guest OS, then the device is being runtime >> suspended (for linux guest OS) and the PCI device will be put into >> D3hot state (in function vfio_pm_config_write()). If the D3cold >> state can be used instead of D3hot, then it will help in saving >> maximum power. The D3cold state can't be possible with native >> PCI PM. It requires interaction with platform firmware which is >> system-specific. To go into low power states (Including D3cold), >> the runtime PM framework can be used which internally interacts >> with PCI and platform firmware and puts the device into the >> lowest possible D-States. >> >> This patch series adds the support to engage runtime power management >> initiated by the user. Since D3cold state can't be achieved by writing >> PCI standard PM config registers, so new device features have been >> added in DEVICE_FEATURE IOCTL for low power entry and exit related >> handling. For the PCI device, this low power state will be D3cold >> (if the platform supports the D3cold state). The hypervisors can implement >> virtual ACPI methods to make the integration with guest OS. >> For example, in guest Linux OS if PCI device ACPI node has >> _PR3 and _PR0 power resources with _ON/_OFF method, then guest >> Linux OS makes the _OFF call during D3cold transition and >> then _ON during D0 transition. The hypervisor can tap these virtual >> ACPI calls and then do the low power related IOCTL. >> >> The entry device feature has two variants. These two variants are mainly >> to support the different behaviour for the low power entry. >> If there is any access for the VFIO device on the host side, then the >> device will be moved out of the low power state without the user's >> guest driver involvement. Some devices (for example NVIDIA VGA or >> 3D controller) require the user's guest driver involvement for >> each low-power entry. In the first variant, the host can move the >> device into low power without any guest driver involvement while >> in the second variant, the host will send a notification to user >> through eventfd and then user guest driver needs to move the device >> into low power. The hypervisor can implement the virtual PME >> support to notify the guest OS. Please refer >> https://lore.kernel.org/lkml/20220701110814.7310-7-abhsahu@nvidia.com/ >> where initially this virtual PME was implemented in the vfio-pci driver >> itself, but later-on, it has been decided that hypervisor can implement >> this. >> >> * Changes in v7 > > Applied to vfio next branch for v6.1. Thanks, > > Alex > Thanks Alex for your guidance and support. Regards, Abhishek