Thread (150 messages) 150 messages, 3 authors, 3d ago

Re: [RFC PATCH 03/36] arm64: hibernate: mask DAIF before restoring hibernated kernel

From: Vladimir Murzin <hidden>
Date: 2026-07-14 09:35:15
Also in: stable

On 7/10/26 04:00, Jinjie Ruan wrote:
quoted
@ -465,9 +466,21 @@ int __nocfi swsusp_arch_resume(void)
 	if (el2_reset_needed())
 		__hyp_set_vectors(el2_vectors);
 
+	/*
+	 * It is necessary to mask all DAIF exceptions here as:
+	 *
+	 * - The copy of swsusp_arch_suspend_exit() in the hibernation
+	 *   text cannot handle taking any exceptions.
+	 *
+	 * - The suspended kernel masked all DAIF exceptions in
+	 *   swsusp_arch_resume(), and expects to be re-entered in the
+	 *   same state : with all DAIF exceptions masked.
+	 */
+	flags = local_daif_save();
 	hibernate_exit(virt_to_phys(tmp_pg_dir), resume_hdr.ttbr1_el1,
 		       resume_hdr.reenter_kernel, restore_pblist,
 		       resume_hdr.__hyp_stub_vectors, virt_to_phys(zero_page));
hibernate_exit() is a noreturn function, the following
local_daif_restore() will not be called.
Agree. I'll fix that in the next iteration.

Cheers
Vladimir

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help