.. | .. |
---|
14 | 14 | * Image of the saved processor state, used by the low level ACPI suspend to |
---|
15 | 15 | * RAM code and by the low level hibernation code. |
---|
16 | 16 | * |
---|
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. |
---|
20 | 24 | */ |
---|
21 | 25 | struct saved_context { |
---|
22 | 26 | struct pt_regs regs; |
---|
.. | .. |
---|
34 | 38 | */ |
---|
35 | 39 | unsigned long kernelmode_gs_base, usermode_gs_base, fs_base; |
---|
36 | 40 | |
---|
37 | | - unsigned long cr0, cr2, cr3, cr4, cr8; |
---|
| 41 | + unsigned long cr0, cr2, cr3, cr4; |
---|
38 | 42 | u64 misc_enable; |
---|
39 | | - bool misc_enable_saved; |
---|
40 | 43 | struct saved_msrs saved_msrs; |
---|
41 | 44 | unsigned long efer; |
---|
42 | 45 | u16 gdt_pad; /* Unused */ |
---|
.. | .. |
---|
48 | 51 | unsigned long tr; |
---|
49 | 52 | unsigned long safety; |
---|
50 | 53 | unsigned long return_address; |
---|
| 54 | + bool misc_enable_saved; |
---|
51 | 55 | } __attribute__((packed)); |
---|
52 | 56 | |
---|
53 | 57 | #define loaddebug(thread,register) \ |
---|