lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250728-luo-pci-v1-16-955b078dd653@kernel.org>
Date: Mon, 28 Jul 2025 01:24:46 -0700
From: chrisl@...nel.org
To: Bjorn Helgaas <bhelgaas@...gle.com>, 
 Greg Kroah-Hartman <gregkh@...uxfoundation.org>, 
 "Rafael J. Wysocki" <rafael@...nel.org>, Danilo Krummrich <dakr@...nel.org>, 
 Len Brown <lenb@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org, 
 linux-acpi@...r.kernel.org, David Matlack <dmatlack@...gle.com>, 
 Pasha Tatashin <tatashin@...gle.com>, Jason Miu <jasonmiu@...gle.com>, 
 Vipin Sharma <vipinsh@...gle.com>, Saeed Mahameed <saeedm@...dia.com>, 
 Adithya Jayachandran <ajayachandra@...dia.com>, 
 Parav Pandit <parav@...dia.com>, William Tu <witu@...dia.com>, 
 Mike Rapoport <rppt@...nel.org>, Chris Li <chrisl@...nel.org>, 
 Jason Gunthorpe <jgg@...pe.ca>, Leon Romanovsky <leon@...nel.org>
Subject: [PATCH RFC 16/25] PCI/LUO: Restore the pme_poll flag

From: Jason Miu <jasonmiu@...gle.com>

Restore the pci_dev pme_poll flag from liveupdate. If the restored
flag is false, the device is in an active state (was not being PME
polled before liveupdate reboot), we do not touch the PCI PME register
of the device.

Tested: QEMU VM liveupdate reboot, put liveupdate in to finish phase.
Signed-off-by: Chris Li <chrisl@...nel.org>
---
 drivers/pci/pci.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index e0e730f7bb3932567815c390088088bd5c56f11e..46fb80dbca590c251fcad3bf2f011a16f6898810 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -3263,8 +3263,17 @@ void pci_pm_init(struct pci_dev *dev)
 		 * let the user space enable it to wake up the system as needed.
 		 */
 		device_set_wakeup_capable(&dev->dev, true);
-		/* Disable the PME# generation functionality */
-		pci_pme_active(dev, false);
+
+		dev->pme_poll = PCI_SER_GET(dev, pme_poll, true);
+		/*
+		 * If the restored pme_poll is false, do not
+		 * set disable to pci_pme_active(), as the device should be in
+		 * an active state, we do not update the device's
+		 * PCI_PM_CTRL_PME_ENABLE flag and disable the PME# generation
+		 * functionality
+		 */
+		if (dev->pme_poll)
+			pci_pme_active(dev, false);
 	}
 
 	pci_read_config_word(dev, PCI_STATUS, &status);

-- 
2.50.1.487.gc89ff58d15-goog


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ