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

[PATCH v2 1/2] xen: Introduce system suspend config option



From: Mykola Kvach <mykola_kvach@xxxxxxxx>

This option enables the system suspend support. This is the mechanism that
allows the system to be suspended to RAM and later resumed.

The patch introduces three options:
- HAS_SYSTEM_SUSPEND: indicates suspend support is available on the platform.
- SYSTEM_SUSPEND_ALWAYS_ON: used for architectures where suspend must always
  be enabled.
- SYSTEM_SUSPEND: user-facing option to enable/disable suspend if supported.
  Defaults to enabled if SYSTEM_SUSPEND_ALWAYS_ON is set and depends on
  HAS_SYSTEM_SUSPEND.

On x86, both HAS_SYSTEM_SUSPEND and SYSTEM_SUSPEND_ALWAYS_ON are selected by
default, making suspend support always enabled. The options are designed to
be easily extensible to other architectures (e.g., PPC, RISC-V) as future
support is added.

Signed-off-by: Mykyta Poturai <mykyta_poturai@xxxxxxxx>
Signed-off-by: Mykola Kvach <mykola_kvach@xxxxxxxx>
---
Discussion on adding the SYSTEM_SUSPEND config can be found here:
https://lists.xenproject.org/archives/html/xen-devel/2025-03/msg00169.html
---
 xen/arch/x86/Kconfig |  2 ++
 xen/common/Kconfig   | 17 +++++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 7afe879710..f7c026b0aa 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -33,6 +33,8 @@ config X86
        select HAS_VMAP
        select HAS_VPCI if HVM
        select NEEDS_LIBELF
+       select HAS_SYSTEM_SUSPEND
+       select SYSTEM_SUSPEND_ALWAYS_ON
 
 config ARCH_DEFCONFIG
        string
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 3d66d09397..3886a77e46 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -579,4 +579,21 @@ config BUDDY_ALLOCATOR_SIZE
          Amount of memory reserved for the buddy allocator to serve Xen heap,
          working alongside the colored one.
 
+config HAS_SYSTEM_SUSPEND
+       bool
+
+config SYSTEM_SUSPEND_ALWAYS_ON
+       bool
+
+config SYSTEM_SUSPEND
+       bool "System suspend support"
+       depends on HAS_SYSTEM_SUSPEND
+       default y if SYSTEM_SUSPEND_ALWAYS_ON
+       help
+         This option enables the system suspend support. This is the
+         mechanism that allows the system to be suspended to RAM and
+         later resumed.
+
+         If unsure, say N.
+
 endmenu
-- 
2.48.1




 


Rackspace

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