From: Abhishek Sahu <abhsahu@nvidia.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: Cornelia Huck <cohuck@redhat.com>,
Yishai Hadas <yishaih@nvidia.com>,
Jason Gunthorpe <jgg@nvidia.com>,
Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>,
Kevin Tian <kevin.tian@intel.com>,
"Rafael J . Wysocki" <rafael@kernel.org>,
Max Gurtovoy <mgurtovoy@nvidia.com>,
Bjorn Helgaas <bhelgaas@google.com>,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
linux-pm@vger.kernel.org, linux-pci@vger.kernel.org
Subject: Re: [PATCH v7 0/5] vfio/pci: power management changes
Date: Mon, 5 Sep 2022 10:24:37 +0530 [thread overview]
Message-ID: <75332807-3645-6b82-be49-448ed8313a84@nvidia.com> (raw)
In-Reply-To: <20220902124234.472737cd.alex.williamson@redhat.com>
On 9/3/2022 12:12 AM, Alex Williamson wrote:
> On Mon, 29 Aug 2022 17:18:45 +0530
> Abhishek Sahu <abhsahu@nvidia.com> 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
prev parent reply other threads:[~2022-09-05 4:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-29 11:48 [PATCH v7 0/5] vfio/pci: power management changes Abhishek Sahu
2022-08-29 11:48 ` [PATCH v7 1/5] vfio: Add the device features for the low power entry and exit Abhishek Sahu
2022-08-29 11:48 ` [PATCH v7 2/5] vfio: Increment the runtime PM usage count during IOCTL call Abhishek Sahu
2022-08-29 11:48 ` [PATCH v7 3/5] vfio/pci: Mask INTx during runtime suspend Abhishek Sahu
2022-08-29 11:48 ` [PATCH v7 4/5] vfio/pci: Implement VFIO_DEVICE_FEATURE_LOW_POWER_ENTRY/EXIT Abhishek Sahu
2022-08-29 11:48 ` [PATCH v7 5/5] vfio/pci: Implement VFIO_DEVICE_FEATURE_LOW_POWER_ENTRY_WITH_WAKEUP Abhishek Sahu
2022-09-02 8:00 ` [PATCH v7 0/5] vfio/pci: power management changes Abhishek Sahu
2022-09-02 18:42 ` Alex Williamson
2022-09-05 4:54 ` Abhishek Sahu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=75332807-3645-6b82-be49-448ed8313a84@nvidia.com \
--to=abhsahu@nvidia.com \
--cc=alex.williamson@redhat.com \
--cc=bhelgaas@google.com \
--cc=cohuck@redhat.com \
--cc=jgg@nvidia.com \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mgurtovoy@nvidia.com \
--cc=rafael@kernel.org \
--cc=shameerali.kolothum.thodi@huawei.com \
--cc=yishaih@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox