[3/3] x86: verify_cpu: restore flags later
diff mbox series

Message ID 20180517213343.GC4047@avx2
State New, archived
Headers show
Series
  • [1/3] x86: verify_cpu: use 32-bit arithmetic
Related show

Commit Message

Alexey Dobriyan May 17, 2018, 9:33 p.m. UTC
popf
	xor	eax, eax

formally doesn't restore flags because XOR clobber flags.

Do POPF as last instruction and rearrange the other case for symmetry.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 arch/x86/kernel/verify_cpu.S |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch
diff mbox series

--- a/arch/x86/kernel/verify_cpu.S
+++ b/arch/x86/kernel/verify_cpu.S
@@ -132,11 +132,11 @@  ENTRY(verify_cpu)
 	jmp	.Lverify_cpu_sse_test	# try again
 
 .Lverify_cpu_no_longmode:
-	popf				# Restore caller passed flags
 	movl $1,%eax
+	popf				# Restore caller passed flags
 	ret
 .Lverify_cpu_sse_ok:
-	popf				# Restore caller passed flags
 	xorl %eax, %eax
+	popf				# Restore caller passed flags
 	ret
 ENDPROC(verify_cpu)