[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/2] xenbus: Use .freeze/.thaw to handle xenbus devices


  • To: Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Wed, 19 Nov 2025 17:47:29 -0500
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=0Jc7jSgi9oFlLTE+/8M413tkZoZeYTb/nTYdwbRMV2g=; b=tYZ0ggGNGpZRRhCx9FmcIhQXqPezyiNsZVSB1wnPINmFhEd5E/JaDoyj/2F5ayl6cEGsy/c0EkqAlTtAbOrN4K4z54wDpzSn5Sh+joT3T1yGIDVH/bZQ4v7cXwvkrtTw1umQ5hrvsW6DlkWfz4KT1KsIJiqZs6UJUFirjVT958o8wBAgvtYq7rloGEJZvUJBetSq6WZypU1wPQ6wVOM2x0DT1oTWdd0GNw38lM6BOavO8wYMBSEqmws1q4p93pcElI3oUQOi4M3RiQqh4jpQz5kmYDGX5S8QkalwOmy6tmTYGsbebFKRwYHGiDRrqz6ck6vrQLA8lmgQIYN3FZyRpg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=D6pdPn0lX0G72L/NgQ972YX2rREjmPusC6fo1HPQmDBnRa3T2XEZzpQ8hbyABGl02kOnZm6ixrYWpbCvwUyB2lxfm+sDmbd5idPJl0Y1dBIiRV4wNjJbY5ix7STxOvDjuKCpEr5xXCZHJVau8U+U7n1I0y/0fkBbldJ3D471Qy25DkC+w3EY/rQ+lO9076atq1sjkLt2JM90XJhfZWZz9g/Jx3rQyYUiBZgBF3v8s/x9ALP7wNUS/v6GH0HUH0GH7NtPkauVnGqyyASLHGws+Q7FTFVamABmlc+ps4p53SdLs5QLA3ZSwiOf38p3eO/5pt+UkG68opaZ5LQnuZfkDw==
  • Cc: Yann Sionneau <yann.sionneau@xxxxxxxxxx>, Jason Andryuk <jason.andryuk@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <linux-kernel@xxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 19 Nov 2025 22:46:45 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

The goal is to fix s2idle and S3 for Xen PV devices.  A domain resuming
from s3 or s2idle disconnects its PV devices during resume.  The
backends are not expecting this and do not reconnect.

b3e96c0c7562 ("xen: use freeze/restore/thaw PM events for suspend/
resume/chkpt") changed xen_suspend()/do_suspend() from
PMSG_SUSPEND/PMSG_RESUME to PMSG_FREEZE/PMSG_THAW/PMSG_RESTORE, but the
suspend/resume callbacks remained.

.freeze/restore are used with hiberation where Linux restarts in a new
place in the future.  .suspend/resume are useful for runtime power
management for the duration of a boot.

The current behavior of the callbacks works for an xl save/restore or
live migration where the domain is restored/migrated to a new location
and connecting to a not-already-connected backend.

Change xenbus_pm_ops to use .freeze/thaw/restore and drop the
.suspend/resume hook.  This matches the use in drivers/xen/manage.c for
save/restore and live migration.  With .suspend/resume empty, PV devices
are left connected during s2idle and s3, so PV devices are not changed
and work after resume.

Signed-off-by: Jason Andryuk <jason.andryuk@xxxxxxx>
---
 drivers/xen/xenbus/xenbus_probe_frontend.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/xen/xenbus/xenbus_probe_frontend.c 
b/drivers/xen/xenbus/xenbus_probe_frontend.c
index 6d1819269cbe..199917b6f77c 100644
--- a/drivers/xen/xenbus/xenbus_probe_frontend.c
+++ b/drivers/xen/xenbus/xenbus_probe_frontend.c
@@ -148,11 +148,9 @@ static void xenbus_frontend_dev_shutdown(struct device 
*_dev)
 }
 
 static const struct dev_pm_ops xenbus_pm_ops = {
-       .suspend        = xenbus_dev_suspend,
-       .resume         = xenbus_frontend_dev_resume,
        .freeze         = xenbus_dev_suspend,
        .thaw           = xenbus_dev_cancel,
-       .restore        = xenbus_dev_resume,
+       .restore        = xenbus_frontend_dev_resume,
 };
 
 static struct xen_bus_type xenbus_frontend = {
-- 
2.34.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.