public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/3] x86: verify_cpu: restore flags later
@ 2018-05-17 21:33 Alexey Dobriyan
  0 siblings, 0 replies; only message in thread
From: Alexey Dobriyan @ 2018-05-17 21:33 UTC (permalink / raw)
  To: tglx, mingo, hpa; +Cc: x86, linux-kernel

	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(-)

--- 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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-05-17 21:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-17 21:33 [PATCH 3/3] x86: verify_cpu: restore flags later Alexey Dobriyan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox