Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5779460ioo; Wed, 1 Jun 2022 12:25:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2kAaIi095462/32sE4/FI8KKD7ukBEpoSTmHcVRlioqr5pvNImwycUr04txHGnw9gMaja X-Received: by 2002:a17:90a:10f:b0:1e3:3f45:796a with SMTP id b15-20020a17090a010f00b001e33f45796amr956086pjb.136.1654111516272; Wed, 01 Jun 2022 12:25:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654111516; cv=none; d=google.com; s=arc-20160816; b=e7IBLNUb0RLJrl33Vgr56QqUO0/WZ/wG59f5xKyNNvs/JP+nqbB9QWefbb2qkv8P6x 1+fMvDgK+8Z7N04T3s3pvoglTTOfkqYC9on4jlNXDaXy3pXT3U1ckNLuC3lWhRZTcylS +vLvX6tRotSUw0K/iLH08I+NZ7bSugTRAphtuTXcIzhz2KoQuauDyRrcsjBfj5PB+lJ+ ByU1UY0KAHmrczOSKbgzncKC3WdVCe3XqI6HcMYznm/1vGJ/E/IpHplNyFiPCLLb3yDK /k1r/YQlMIpRqDSPl3CR7/PySoH5yFFr2uDxfm9W1XquNWrK8Z0Gedmq0VleuNBHFI9o nCVA== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=8lnhgnSWwHutqtYkh7EtY0e4ON7IRphJYIb523UmDxM=; b=HCgX0m+IpK+KWmYDi+LEnBjSRiDzgA+M5oHtnFJBuvhG7JHf7kP/sVd6E25I5Jm8lx u1ouqr6jmtE5DX+1fy7yEFtGx+NsLaBKgOwf4e322pflHQNPVgy25T/jTep9ZsV3V9W0 feCY5Jg6k2XCsU2bVGjih7lp1Ncs8/yKsbe+7W2fC0DAm9zT8y9VWHk2f/7cRFinTio6 JOBUVBQwYvim9e/97YKTpha3eeZRWzcJaLqPxRsO5oqQvkJARytvl0DE8WJRbvzDjbjw CCWv1CzV8epDmMyzC2Z7dvcC+jLcWD5PGSIEAJIpmgMFABTwtqKJN0eHRytvF3V+hEiI 28jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="gV/qqw1S"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id w8-20020a170902e88800b0015eaa9783ddsi4215195plg.532.2022.06.01.12.25.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 12:25:16 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="gV/qqw1S"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BB147168D30; Wed, 1 Jun 2022 11:58:22 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356209AbiFASP6 (ORCPT + 99 others); Wed, 1 Jun 2022 14:15:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353446AbiFASP4 (ORCPT ); Wed, 1 Jun 2022 14:15:56 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 976CA95A2F for ; Wed, 1 Jun 2022 11:15:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654107351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8lnhgnSWwHutqtYkh7EtY0e4ON7IRphJYIb523UmDxM=; b=gV/qqw1SwOLntwNjgwGSjwMO59S7Jzdx10x0qARGpwevRr6yJVuOlRgAu23H6O2uAho8mU L6jdmKkORhD4LhywR6/653GBld/iJvPOA35hX0gboa63Brg/Kr9avNWj9IodRX75oAZy6w a6Oladznh7NQ71fCI/b/HVc4Hmk1ycE= Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-623-MKe-zbBiOniEwcVGhuJ7Sg-1; Wed, 01 Jun 2022 14:15:50 -0400 X-MC-Unique: MKe-zbBiOniEwcVGhuJ7Sg-1 Received: by mail-io1-f71.google.com with SMTP id ay41-20020a5d9da9000000b006685ce50214so1346746iob.22 for ; Wed, 01 Jun 2022 11:15:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=8lnhgnSWwHutqtYkh7EtY0e4ON7IRphJYIb523UmDxM=; b=SV68Pt+7R3XVIuqcMHi0Hv3qgffBAmVwCeoMowyRCllxoCOGmZMhyY1uOYWN0ilKTk +BjB6qEngysYE79n+DH6mhXCw8vkc8Mltd/moD0koC2oaLXAyV9ORrhVv2CVfSJ6OP6W bdjNtQlUkJcifzZQ0EaduXoYiY6TH21lvu7Agv13ubLWaDN6y79E1FgqrwDawhhTE6TO TEXJsJQC8tUSc7cR2kCMYzqqqgbd0KRR7aUcCovgyM/C+1/9uf9rZqEElHL1x5UICc53 gHpHTR2sDCQHYrIQHRvF+xmTPuphpg0mC9sI3YS1g1RdrQJLsFdUmhzEvNIov1YpLKSX dJAA== X-Gm-Message-State: AOAM532TWXru/0ibfNXbKanPDTSPpdM5GegB/98a0gOdgpk9X/SG0uK+ zKmjSIWzpOpjkX/my9B6F8FTX02b/5z4huD2GzDLoWwGe6qVrhyiAUKrzJ50oo075zaI+hAViKk dmRwCWSB+VFLBzAr+vO5NbIPa X-Received: by 2002:a05:6638:1909:b0:32e:d7f1:9072 with SMTP id p9-20020a056638190900b0032ed7f19072mr799190jal.261.1654107349221; Wed, 01 Jun 2022 11:15:49 -0700 (PDT) X-Received: by 2002:a05:6638:1909:b0:32e:d7f1:9072 with SMTP id p9-20020a056638190900b0032ed7f19072mr799178jal.261.1654107349017; Wed, 01 Jun 2022 11:15:49 -0700 (PDT) Received: from redhat.com ([38.15.36.239]) by smtp.gmail.com with ESMTPSA id i12-20020a926d0c000000b002d39ae9918asm719208ilc.54.2022.06.01.11.15.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 11:15:48 -0700 (PDT) Date: Wed, 1 Jun 2022 12:15:47 -0600 From: Alex Williamson To: Jason Gunthorpe Cc: Abhishek Sahu , Cornelia Huck , Yishai Hadas , 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 Subject: Re: [PATCH v3 8/8] vfio/pci: Add the support for PCI D3cold state Message-ID: <20220601121547.03ebbf64.alex.williamson@redhat.com> In-Reply-To: <20220601173054.GS1343366@nvidia.com> References: <9e44e9cc-a500-ab0d-4785-5ae26874b3eb@nvidia.com> <20220509154844.79e4915b.alex.williamson@redhat.com> <68463d9b-98ee-b9ec-1a3e-1375e50a2ad2@nvidia.com> <42518bd5-da8b-554f-2612-80278b527bf5@nvidia.com> <20220530122546.GZ1343366@nvidia.com> <20220531194304.GN1343366@nvidia.com> <20220531165209.1c18854f.alex.williamson@redhat.com> <00b6e380-ecf4-1eaf-f950-2c418bdb6cac@nvidia.com> <20220601102151.75445f6a.alex.williamson@redhat.com> <20220601173054.GS1343366@nvidia.com> Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Wed, 1 Jun 2022 14:30:54 -0300 Jason Gunthorpe wrote: > On Wed, Jun 01, 2022 at 10:21:51AM -0600, Alex Williamson wrote: > > > Some ioctls clearly cannot occur while the device is in low power, such > > as resets and interrupt control, but even less obvious things like > > getting region info require device access. Migration also provides a > > channel to device access. > > I wonder what power management means in a case like that. > > For the migration drivers they all rely on a PF driver that is not > VFIO, so it should be impossible for power management to cause the PF > to stop working. > > I would expect any sane design of power management for a VF to not > cause any harm to the migration driver.. Is there even a significant benefit or use case for power management for VFs? The existing D3hot support should be ok, but I imagine to support D3cold, all the VFs and the PF would need to move to low power. It might be safe to simply exclude VFs from providing this feature for now. > > I'm also still curious how we're going to handle devices that cannot > > return to low power such as the self-refresh mode on the GPU. We can > > potentially prevent any wake-ups from the vfio device interface, but > > that doesn't preclude a wake-up via an external lspci. I think we need > > to understand how we're going to handle such devices before we can > > really complete the design. AIUI, we cannot disable the self-refresh > > sleep mode without imposing unreasonable latency and memory > > requirements on the guest and we cannot retrigger the self-refresh > > low-power mode without non-trivial device specific code. > > It begs the question if power management should be something that only > a device-specific drivers should allow? Yes, but that's also penalizing devices that require no special support, for the few that do. I'm not opposed to some sort of vfio-pci-nvidia-gpu variant driver to provide that device specific support, but I'd think the device table for such a driver might just be added to the exclusion list for power management support in vfio-pci. vfio-pci-core would need some way for drivers to opt-out/in for power management. Thanks, Alex