Thread (1 message) 1 message, 1 author, 2018-03-14

Re: [PATCH v2 06/27] x86/entry/64: Adapt assembly for PIE support

From: Peter Zijlstra <peterz@infradead.org>
Date: 2018-03-14 10:29:51
Also in: kvm, linux-arch, linux-crypto, linux-pm, lkml

On Tue, Mar 13, 2018 at 01:59:24PM -0700, Thomas Garnier wrote:
quoted hunk
@@ -1576,7 +1578,9 @@ first_nmi:
 	addq	$8, (%rsp)	/* Fix up RSP */
 	pushfq			/* RFLAGS */
 	pushq	$__KERNEL_CS	/* CS */
-	pushq	$1f		/* RIP */
+	pushq	%rax		/* Support Position Independent Code */
+	leaq	1f(%rip), %rax	/* RIP */
+	xchgq	%rax, (%rsp)	/* Restore RAX, put 1f */
 	iretq			/* continues at repeat_nmi below */
 	UNWIND_HINT_IRET_REGS
 1:
Urgh, xchg with a memop has an implicit LOCK prefix.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help