* [PATCH v22 07/10] kernel: hibernate: Add an arch hook for preventing hiberation [not found] <20261002061507.1600269-1-suzuki.poulose@arm.com> @ 2026-10-02 6:15 ` Suzuki K Poulose 2026-10-02 11:03 ` Catalin Marinas 2026-10-02 13:32 ` Sudeep Holla 0 siblings, 2 replies; 5+ messages in thread From: Suzuki K Poulose @ 2026-10-02 6:15 UTC (permalink / raw) To: kvm, kvmarm Cc: maz, will, catalin.marinas, linux-kernel, linux-arm-kernel, steven.price, aneesh.kumar, oupton, gshan, joey.gouly, tabba, yuzenghui, linux-coco, gankulkarni, sdonthineni, alpergun, fj0570is, WeiLin.Chang, lpieralisi, enju.kohei, sudeep.holla, jonathan.cameron, Suzuki K Poulose, Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm, Sudeep Holla Add a hook to allow arch code disable hibernation. On arm64, with an RMM active, there could be pages that are delegated to the "Realm" security state. Any access to them are fatal (e.g., hibernate save image or restoring an image to a delegated page). pKVM host also has its restrictions on enabling hibernation. Add a weak arch hook to let the architectures have a say. Cc: "Rafael J. Wysocki" <rafael@kernel.org> Cc: Len Brown <lenb@kernel.org> Cc: Pavel Machek <pavel@kernel.org> Cc: linux-pm@vger.kernel.org Cc: Sudeep Holla <sudeep.holla@kernel.org> Suggested-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> --- include/linux/suspend.h | 1 + kernel/power/hibernate.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/linux/suspend.h b/include/linux/suspend.h index b02876f1ae38a..a3815027773c5 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h @@ -401,6 +401,7 @@ int hibernate_quiet_exec(int (*func)(void *data), void *data); int hibernate_resume_nonboot_cpu_disable(void); int arch_hibernation_header_save(void *addr, unsigned int max_size); int arch_hibernation_header_restore(void *addr); +bool arch_hibernation_available(void); #else /* CONFIG_HIBERNATION */ static inline void register_nosave_region(unsigned long b, unsigned long e) {} diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index d2479c69d71a4..9d9d53828542f 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c @@ -106,11 +106,17 @@ bool hibernation_in_progress(void) return !atomic_read(&hibernate_atomic); } +__weak bool arch_hibernation_available(void) +{ + return true; +} + bool hibernation_available(void) { return nohibernate == 0 && !security_locked_down(LOCKDOWN_HIBERNATION) && - !secretmem_active() && !cxl_mem_active(); + !secretmem_active() && !cxl_mem_active() && + arch_hibernation_available(); } /** -- 2.43.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v22 07/10] kernel: hibernate: Add an arch hook for preventing hiberation 2026-10-02 6:15 ` [PATCH v22 07/10] kernel: hibernate: Add an arch hook for preventing hiberation Suzuki K Poulose @ 2026-10-02 11:03 ` Catalin Marinas 2026-10-02 15:29 ` Suzuki K Poulose 2026-10-12 19:11 ` Rafael J. Wysocki (Intel) 2026-10-02 13:32 ` Sudeep Holla 1 sibling, 2 replies; 5+ messages in thread From: Catalin Marinas @ 2026-10-02 11:03 UTC (permalink / raw) To: Suzuki K Poulose, Rafael J. Wysocki Cc: kvm, kvmarm, maz, will, linux-kernel, linux-arm-kernel, steven.price, aneesh.kumar, oupton, gshan, joey.gouly, tabba, yuzenghui, linux-coco, gankulkarni, sdonthineni, alpergun, fj0570is, WeiLin.Chang, lpieralisi, enju.kohei, sudeep.holla, jonathan.cameron, Len Brown, Pavel Machek, linux-pm, Sudeep Holla On Fri, Oct 02, 2026 at 07:15:03AM +0100, Suzuki K Poulose wrote: > Add a hook to allow arch code disable hibernation. On arm64, with an RMM active, > there could be pages that are delegated to the "Realm" security state. Any > access to them are fatal (e.g., hibernate save image or restoring an image to > a delegated page). pKVM host also has its restrictions on enabling hibernation. > > Add a weak arch hook to let the architectures have a say. > > Cc: "Rafael J. Wysocki" <rafael@kernel.org> > Cc: Len Brown <lenb@kernel.org> > Cc: Pavel Machek <pavel@kernel.org> > Cc: linux-pm@vger.kernel.org > Cc: Sudeep Holla <sudeep.holla@kernel.org> > Suggested-by: Catalin Marinas <catalin.marinas@arm.com> > Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Nit: the subject prefix for kernel/power/ usually is PM: hibernate: .... I can fix it locally, no need to respin (and probably the wrap the long lines in the commit log, we tend to keep them shorter). > --- > include/linux/suspend.h | 1 + > kernel/power/hibernate.c | 8 +++++++- > 2 files changed, 8 insertions(+), 1 deletion(-) > > diff --git a/include/linux/suspend.h b/include/linux/suspend.h > index b02876f1ae38a..a3815027773c5 100644 > --- a/include/linux/suspend.h > +++ b/include/linux/suspend.h > @@ -401,6 +401,7 @@ int hibernate_quiet_exec(int (*func)(void *data), void *data); > int hibernate_resume_nonboot_cpu_disable(void); > int arch_hibernation_header_save(void *addr, unsigned int max_size); > int arch_hibernation_header_restore(void *addr); > +bool arch_hibernation_available(void); > > #else /* CONFIG_HIBERNATION */ > static inline void register_nosave_region(unsigned long b, unsigned long e) {} > diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c > index d2479c69d71a4..9d9d53828542f 100644 > --- a/kernel/power/hibernate.c > +++ b/kernel/power/hibernate.c > @@ -106,11 +106,17 @@ bool hibernation_in_progress(void) > return !atomic_read(&hibernate_atomic); > } > > +__weak bool arch_hibernation_available(void) > +{ > + return true; > +} > + > bool hibernation_available(void) > { > return nohibernate == 0 && > !security_locked_down(LOCKDOWN_HIBERNATION) && > - !secretmem_active() && !cxl_mem_active(); > + !secretmem_active() && !cxl_mem_active() && > + arch_hibernation_available(); Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Raphael, any objection to this patch going in through the arm64 tree? It matches the style of other __weak functions in this file. Thanks. -- Catalin ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v22 07/10] kernel: hibernate: Add an arch hook for preventing hiberation 2026-10-02 11:03 ` Catalin Marinas @ 2026-10-02 15:29 ` Suzuki K Poulose 2026-10-12 19:11 ` Rafael J. Wysocki (Intel) 1 sibling, 0 replies; 5+ messages in thread From: Suzuki K Poulose @ 2026-10-02 15:29 UTC (permalink / raw) To: Catalin Marinas, Rafael J. Wysocki Cc: kvm, kvmarm, maz, will, linux-kernel, linux-arm-kernel, steven.price, aneesh.kumar, oupton, gshan, joey.gouly, tabba, yuzenghui, linux-coco, gankulkarni, sdonthineni, alpergun, fj0570is, WeiLin.Chang, lpieralisi, enju.kohei, sudeep.holla, jonathan.cameron, Len Brown, Pavel Machek, linux-pm, Sudeep Holla On 02/10/2026 12:03, Catalin Marinas wrote: > On Fri, Oct 02, 2026 at 07:15:03AM +0100, Suzuki K Poulose wrote: >> Add a hook to allow arch code disable hibernation. On arm64, with an RMM active, >> there could be pages that are delegated to the "Realm" security state. Any >> access to them are fatal (e.g., hibernate save image or restoring an image to >> a delegated page). pKVM host also has its restrictions on enabling hibernation. >> >> Add a weak arch hook to let the architectures have a say. >> >> Cc: "Rafael J. Wysocki" <rafael@kernel.org> >> Cc: Len Brown <lenb@kernel.org> >> Cc: Pavel Machek <pavel@kernel.org> >> Cc: linux-pm@vger.kernel.org >> Cc: Sudeep Holla <sudeep.holla@kernel.org> >> Suggested-by: Catalin Marinas <catalin.marinas@arm.com> >> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> > > Nit: the subject prefix for kernel/power/ usually is > > PM: hibernate: .... > > I can fix it locally, no need to respin (and probably the wrap the long > lines in the commit log, we tend to keep them shorter). > Ack, I will take care of that in the future. >> --- >> include/linux/suspend.h | 1 + >> kernel/power/hibernate.c | 8 +++++++- >> 2 files changed, 8 insertions(+), 1 deletion(-) >> >> diff --git a/include/linux/suspend.h b/include/linux/suspend.h >> index b02876f1ae38a..a3815027773c5 100644 >> --- a/include/linux/suspend.h >> +++ b/include/linux/suspend.h >> @@ -401,6 +401,7 @@ int hibernate_quiet_exec(int (*func)(void *data), void *data); >> int hibernate_resume_nonboot_cpu_disable(void); >> int arch_hibernation_header_save(void *addr, unsigned int max_size); >> int arch_hibernation_header_restore(void *addr); >> +bool arch_hibernation_available(void); >> >> #else /* CONFIG_HIBERNATION */ >> static inline void register_nosave_region(unsigned long b, unsigned long e) {} >> diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c >> index d2479c69d71a4..9d9d53828542f 100644 >> --- a/kernel/power/hibernate.c >> +++ b/kernel/power/hibernate.c >> @@ -106,11 +106,17 @@ bool hibernation_in_progress(void) >> return !atomic_read(&hibernate_atomic); >> } >> >> +__weak bool arch_hibernation_available(void) >> +{ >> + return true; >> +} >> + >> bool hibernation_available(void) >> { >> return nohibernate == 0 && >> !security_locked_down(LOCKDOWN_HIBERNATION) && >> - !secretmem_active() && !cxl_mem_active(); >> + !secretmem_active() && !cxl_mem_active() && >> + arch_hibernation_available(); > > Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> > > Raphael, any objection to this patch going in through the arm64 tree? It > matches the style of other __weak functions in this file. Thanks Catalin Suzuki > > Thanks. > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v22 07/10] kernel: hibernate: Add an arch hook for preventing hiberation 2026-10-02 11:03 ` Catalin Marinas 2026-10-02 15:29 ` Suzuki K Poulose @ 2026-10-12 19:11 ` Rafael J. Wysocki (Intel) 1 sibling, 0 replies; 5+ messages in thread From: Rafael J. Wysocki (Intel) @ 2026-10-12 19:11 UTC (permalink / raw) To: Catalin Marinas Cc: Suzuki K Poulose, Rafael J. Wysocki, kvm, kvmarm, maz, will, linux-kernel, linux-arm-kernel, steven.price, aneesh.kumar, oupton, gshan, joey.gouly, tabba, yuzenghui, linux-coco, gankulkarni, sdonthineni, alpergun, fj0570is, WeiLin.Chang, lpieralisi, enju.kohei, sudeep.holla, jonathan.cameron, Len Brown, Pavel Machek, linux-pm, Sudeep Holla On Fri, Oct 2, 2026 at 1:03 PM Catalin Marinas <catalin.marinas@arm.com> wrote: > > On Fri, Oct 02, 2026 at 07:15:03AM +0100, Suzuki K Poulose wrote: > > Add a hook to allow arch code disable hibernation. On arm64, with an RMM active, > > there could be pages that are delegated to the "Realm" security state. Any > > access to them are fatal (e.g., hibernate save image or restoring an image to > > a delegated page). pKVM host also has its restrictions on enabling hibernation. > > > > Add a weak arch hook to let the architectures have a say. > > > > Cc: "Rafael J. Wysocki" <rafael@kernel.org> > > Cc: Len Brown <lenb@kernel.org> > > Cc: Pavel Machek <pavel@kernel.org> > > Cc: linux-pm@vger.kernel.org > > Cc: Sudeep Holla <sudeep.holla@kernel.org> > > Suggested-by: Catalin Marinas <catalin.marinas@arm.com> > > Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> > > Nit: the subject prefix for kernel/power/ usually is > > PM: hibernate: .... > > I can fix it locally, no need to respin (and probably the wrap the long > lines in the commit log, we tend to keep them shorter). > > > --- > > include/linux/suspend.h | 1 + > > kernel/power/hibernate.c | 8 +++++++- > > 2 files changed, 8 insertions(+), 1 deletion(-) > > > > diff --git a/include/linux/suspend.h b/include/linux/suspend.h > > index b02876f1ae38a..a3815027773c5 100644 > > --- a/include/linux/suspend.h > > +++ b/include/linux/suspend.h > > @@ -401,6 +401,7 @@ int hibernate_quiet_exec(int (*func)(void *data), void *data); > > int hibernate_resume_nonboot_cpu_disable(void); > > int arch_hibernation_header_save(void *addr, unsigned int max_size); > > int arch_hibernation_header_restore(void *addr); > > +bool arch_hibernation_available(void); > > > > #else /* CONFIG_HIBERNATION */ > > static inline void register_nosave_region(unsigned long b, unsigned long e) {} > > diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c > > index d2479c69d71a4..9d9d53828542f 100644 > > --- a/kernel/power/hibernate.c > > +++ b/kernel/power/hibernate.c > > @@ -106,11 +106,17 @@ bool hibernation_in_progress(void) > > return !atomic_read(&hibernate_atomic); > > } > > > > +__weak bool arch_hibernation_available(void) > > +{ > > + return true; > > +} > > + > > bool hibernation_available(void) > > { > > return nohibernate == 0 && > > !security_locked_down(LOCKDOWN_HIBERNATION) && > > - !secretmem_active() && !cxl_mem_active(); > > + !secretmem_active() && !cxl_mem_active() && > > + arch_hibernation_available(); > > Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> > > Raphael, any objection to this patch going in through the arm64 tree? It > matches the style of other __weak functions in this file. No objection, and feel free to add an ACK from me to this one. Thanks! ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v22 07/10] kernel: hibernate: Add an arch hook for preventing hiberation 2026-10-02 6:15 ` [PATCH v22 07/10] kernel: hibernate: Add an arch hook for preventing hiberation Suzuki K Poulose 2026-10-02 11:03 ` Catalin Marinas @ 2026-10-02 13:32 ` Sudeep Holla 1 sibling, 0 replies; 5+ messages in thread From: Sudeep Holla @ 2026-10-02 13:32 UTC (permalink / raw) To: Suzuki K Poulose Cc: kvm, kvmarm, maz, Sudeep Holla, will, catalin.marinas, linux-kernel, linux-arm-kernel, steven.price, aneesh.kumar, oupton, gshan, joey.gouly, tabba, yuzenghui, linux-coco, gankulkarni, sdonthineni, alpergun, fj0570is, WeiLin.Chang, lpieralisi, enju.kohei, jonathan.cameron, Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm On Fri, Oct 02, 2026 at 07:15:03AM +0100, Suzuki K Poulose wrote: > Add a hook to allow arch code disable hibernation. On arm64, with an RMM active, > there could be pages that are delegated to the "Realm" security state. Any > access to them are fatal (e.g., hibernate save image or restoring an image to > a delegated page). pKVM host also has its restrictions on enabling hibernation. > > Add a weak arch hook to let the architectures have a say. > > Cc: "Rafael J. Wysocki" <rafael@kernel.org> > Cc: Len Brown <lenb@kernel.org> > Cc: Pavel Machek <pavel@kernel.org> > Cc: linux-pm@vger.kernel.org > Cc: Sudeep Holla <sudeep.holla@kernel.org> FWIW, it makes sense for this RMM use case: Reviewed-by: Sudeep Holla <sudeep.holla@kernel.org> -- Regards, Sudeep ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-10-12 19:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20261002061507.1600269-1-suzuki.poulose@arm.com>
2026-10-02 6:15 ` [PATCH v22 07/10] kernel: hibernate: Add an arch hook for preventing hiberation Suzuki K Poulose
2026-10-02 11:03 ` Catalin Marinas
2026-10-02 15:29 ` Suzuki K Poulose
2026-10-12 19:11 ` Rafael J. Wysocki (Intel)
2026-10-02 13:32 ` Sudeep Holla
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox