hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/arch/x86/include/asm/suspend_64.h
....@@ -14,9 +14,13 @@
1414 * Image of the saved processor state, used by the low level ACPI suspend to
1515 * RAM code and by the low level hibernation code.
1616 *
17
- * If you modify it, fix arch/x86/kernel/acpi/wakeup_64.S and make sure that
18
- * __save/__restore_processor_state(), defined in arch/x86/kernel/suspend_64.c,
19
- * still work as required.
17
+ * If you modify it, check how it is used in arch/x86/kernel/acpi/wakeup_64.S
18
+ * and make sure that __save/__restore_processor_state(), defined in
19
+ * arch/x86/power/cpu.c, still work as required.
20
+ *
21
+ * Because the structure is packed, make sure to avoid unaligned members. For
22
+ * optimisation purposes but also because tools like kmemleak only search for
23
+ * pointers that are aligned.
2024 */
2125 struct saved_context {
2226 struct pt_regs regs;
....@@ -34,9 +38,8 @@
3438 */
3539 unsigned long kernelmode_gs_base, usermode_gs_base, fs_base;
3640
37
- unsigned long cr0, cr2, cr3, cr4, cr8;
41
+ unsigned long cr0, cr2, cr3, cr4;
3842 u64 misc_enable;
39
- bool misc_enable_saved;
4043 struct saved_msrs saved_msrs;
4144 unsigned long efer;
4245 u16 gdt_pad; /* Unused */
....@@ -48,6 +51,7 @@
4851 unsigned long tr;
4952 unsigned long safety;
5053 unsigned long return_address;
54
+ bool misc_enable_saved;
5155 } __attribute__((packed));
5256
5357 #define loaddebug(thread,register) \