From: Mykyta Poturai <mykyta_poturai@epam.com>
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@epam.com>
Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
---
Changes introduced in v3:
- select HAS_SYSTEM_SUSPEND from SYSTEM_SUSPEND_ALWAYS_ON
- drop selecting HAS_SYSTEM_SUSPEND from X86
- simplify default setting in SYSTEM_SUSPEND
- hide prompt of SYSTEM_SUSPEND when SYSTEM_SUSPEND_ALWAYS_ON is enabled
- move HAS_SYSTEM_SUSPEND alongside other HAS_* configs
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 | 1 +
xen/common/Kconfig | 18 ++++++++++++++++++
2 files changed, 19 insertions(+)
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 7afe879710..752d5141bb 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -33,6 +33,7 @@ config X86
select HAS_VMAP
select HAS_VPCI if HVM
select NEEDS_LIBELF
+ select SYSTEM_SUSPEND_ALWAYS_ON
config ARCH_DEFCONFIG
string
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index eece1370a3..867710134a 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -122,6 +122,9 @@ config HAS_SCHED_GRANULARITY
config HAS_STACK_PROTECTOR
bool
+config HAS_SYSTEM_SUSPEND
+ bool
+
config HAS_UBSAN
bool
@@ -593,4 +596,19 @@ config BUDDY_ALLOCATOR_SIZE
Amount of memory reserved for the buddy allocator to serve Xen heap,
working alongside the colored one.
+config SYSTEM_SUSPEND_ALWAYS_ON
+ bool
+ select HAS_SYSTEM_SUSPEND
+
+config SYSTEM_SUSPEND
+ bool "System suspend support" if !SYSTEM_SUSPEND_ALWAYS_ON
+ depends on HAS_SYSTEM_SUSPEND
+ default 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
On 06.06.2025 12:11, Mykola Kvach wrote: > From: Mykyta Poturai <mykyta_poturai@epam.com> > > 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@epam.com> > Signed-off-by: Mykola Kvach <mykola_kvach@epam.com> Acked-by: Jan Beulich <jbeulich@suse.com>
© 2016 - 2026 Red Hat, Inc.