Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 339115
b: refs/heads/master
c: 28696f4
h: refs/heads/master
i:
  339113: f0a2966
  339111: 1999037
v: v3
  • Loading branch information
Salman Qazi authored and Steven Rostedt committed Nov 2, 2012
1 parent 0463664 commit a918a88
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 269833bd5a0f4443873da358b71675a890b47c3c
refs/heads/master: 28696f434fef0efa97534b59986ad33b9c4df7f8
41 changes: 27 additions & 14 deletions trunk/arch/x86/kernel/entry_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -1699,18 +1699,19 @@ nested_nmi:

1:
/* Set up the interrupted NMIs stack to jump to repeat_nmi */
leaq -6*8(%rsp), %rdx
leaq -1*8(%rsp), %rdx
movq %rdx, %rsp
CFI_ADJUST_CFA_OFFSET 6*8
CFI_ADJUST_CFA_OFFSET 1*8
leaq -10*8(%rsp), %rdx
pushq_cfi $__KERNEL_DS
pushq_cfi %rdx
pushfq_cfi
pushq_cfi $__KERNEL_CS
pushq_cfi $repeat_nmi

/* Put stack back */
addq $(11*8), %rsp
CFI_ADJUST_CFA_OFFSET -11*8
addq $(6*8), %rsp
CFI_ADJUST_CFA_OFFSET -6*8

nested_nmi_out:
popq_cfi %rdx
Expand All @@ -1736,18 +1737,18 @@ first_nmi:
* +-------------------------+
* | NMI executing variable |
* +-------------------------+
* | Saved SS |
* | Saved Return RSP |
* | Saved RFLAGS |
* | Saved CS |
* | Saved RIP |
* +-------------------------+
* | copied SS |
* | copied Return RSP |
* | copied RFLAGS |
* | copied CS |
* | copied RIP |
* +-------------------------+
* | Saved SS |
* | Saved Return RSP |
* | Saved RFLAGS |
* | Saved CS |
* | Saved RIP |
* +-------------------------+
* | pt_regs |
* +-------------------------+
*
Expand All @@ -1763,9 +1764,14 @@ first_nmi:
/* Set the NMI executing variable on the stack. */
pushq_cfi $1

/*
* Leave room for the "copied" frame
*/
subq $(5*8), %rsp

/* Copy the stack frame to the Saved frame */
.rept 5
pushq_cfi 6*8(%rsp)
pushq_cfi 11*8(%rsp)
.endr
CFI_DEF_CFA_OFFSET SS+8-RIP

Expand All @@ -1786,12 +1792,15 @@ repeat_nmi:
* is benign for the non-repeat case, where 1 was pushed just above
* to this very stack slot).
*/
movq $1, 5*8(%rsp)
movq $1, 10*8(%rsp)

/* Make another copy, this one may be modified by nested NMIs */
addq $(10*8), %rsp
CFI_ADJUST_CFA_OFFSET -10*8
.rept 5
pushq_cfi 4*8(%rsp)
pushq_cfi -6*8(%rsp)
.endr
subq $(5*8), %rsp
CFI_DEF_CFA_OFFSET SS+8-RIP
end_repeat_nmi:

Expand Down Expand Up @@ -1842,8 +1851,12 @@ nmi_swapgs:
SWAPGS_UNSAFE_STACK
nmi_restore:
RESTORE_ALL 8

/* Pop the extra iret frame */
addq $(5*8), %rsp

/* Clear the NMI executing stack variable */
movq $0, 10*8(%rsp)
movq $0, 5*8(%rsp)
jmp irq_return
CFI_ENDPROC
END(nmi)
Expand Down

0 comments on commit a918a88

Please sign in to comment.