diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2012-10-01 17:34:42 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2012-10-02 02:42:31 -0400 |
commit | 1396adc3c2bdc556d4cdd1cf107aa0b6d59fbb1e (patch) | |
tree | 7fc9ec52083551c3b1d5ea5937fa6e583ad32e07 /arch/x86/realmode/rm | |
parent | b2cc2a074de75671bbed5e2dda67a9252ef353ea (diff) |
x86, suspend: Correct the restore of CR4, EFER; skip computing EFLAGS.ID
The patch:
73201dbe x86, suspend: On wakeup always initialize cr4 and EFER
... was incorrectly committed in an intermediate (unfinished) form.
- We need to test CF, not ZF, for a bit test with btl.
- We don't actually need to compute the existence of EFLAGS.ID,
since we set a flag at suspend time if CR4 should be restored.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Link: http://lkml.kernel.org/r/1348529239-17943-1-git-send-email-hpa@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/realmode/rm')
-rw-r--r-- | arch/x86/realmode/rm/wakeup_asm.S | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/arch/x86/realmode/rm/wakeup_asm.S b/arch/x86/realmode/rm/wakeup_asm.S index e56479e5805..9e7e14797a7 100644 --- a/arch/x86/realmode/rm/wakeup_asm.S +++ b/arch/x86/realmode/rm/wakeup_asm.S | |||
@@ -74,18 +74,9 @@ ENTRY(wakeup_start) | |||
74 | 74 | ||
75 | lidtl wakeup_idt | 75 | lidtl wakeup_idt |
76 | 76 | ||
77 | /* Clear the EFLAGS but remember if we have EFLAGS.ID */ | 77 | /* Clear the EFLAGS */ |
78 | movl $X86_EFLAGS_ID, %ecx | ||
79 | pushl %ecx | ||
80 | popfl | ||
81 | pushfl | ||
82 | popl %edi | ||
83 | pushl $0 | 78 | pushl $0 |
84 | popfl | 79 | popfl |
85 | pushfl | ||
86 | popl %edx | ||
87 | xorl %edx, %edi | ||
88 | andl %ecx, %edi /* %edi is zero iff CPUID & %cr4 are missing */ | ||
89 | 80 | ||
90 | /* Check header signature... */ | 81 | /* Check header signature... */ |
91 | movl signature, %eax | 82 | movl signature, %eax |
@@ -120,12 +111,12 @@ ENTRY(wakeup_start) | |||
120 | movl %eax, %cr3 | 111 | movl %eax, %cr3 |
121 | 112 | ||
122 | btl $WAKEUP_BEHAVIOR_RESTORE_CR4, %edi | 113 | btl $WAKEUP_BEHAVIOR_RESTORE_CR4, %edi |
123 | jz 1f | 114 | jnc 1f |
124 | movl pmode_cr4, %eax | 115 | movl pmode_cr4, %eax |
125 | movl %eax, %cr4 | 116 | movl %eax, %cr4 |
126 | 1: | 117 | 1: |
127 | btl $WAKEUP_BEHAVIOR_RESTORE_EFER, %edi | 118 | btl $WAKEUP_BEHAVIOR_RESTORE_EFER, %edi |
128 | jz 1f | 119 | jnc 1f |
129 | movl pmode_efer, %eax | 120 | movl pmode_efer, %eax |
130 | movl pmode_efer + 4, %edx | 121 | movl pmode_efer + 4, %edx |
131 | movl $MSR_EFER, %ecx | 122 | movl $MSR_EFER, %ecx |