Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 35974
b: refs/heads/master
c: 658fdbe
h: refs/heads/master
v: v3
  • Loading branch information
Andi Kleen authored and Andi Kleen committed Sep 26, 2006
1 parent 29b8281 commit cb2f123
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 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: adf1423698f00d00b267f7dca8231340ce7d65ef
refs/heads/master: 658fdbef66e5e9be79b457edc2cbbb3add840aa9
4 changes: 4 additions & 0 deletions trunk/arch/x86_64/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@
/* rdi: prev */
ENTRY(ret_from_fork)
CFI_DEFAULT_STACK
push kernel_eflags(%rip)
CFI_ADJUST_CFA_OFFSET 4
popf # reset kernel eflags
CFI_ADJUST_CFA_OFFSET -4
call schedule_tail
GET_THREAD_INFO(%rcx)
testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT),threadinfo_flags(%rcx)
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/x86_64/kernel/setup64.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ void __cpuinit check_efer(void)
}
}

unsigned long kernel_eflags;

/*
* cpu_init() initializes state that is per-CPU. Some data is already
* initialized (naturally) in the bootstrap process, such as the GDT
Expand Down Expand Up @@ -281,4 +283,6 @@ void __cpuinit cpu_init (void)
set_debugreg(0UL, 7);

fpu_init();

raw_local_save_flags(kernel_eflags);
}
5 changes: 3 additions & 2 deletions trunk/include/asm-x86_64/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
#define __RESTORE(reg,offset) "movq (14-" #offset ")*8(%%rsp),%%" #reg "\n\t"

/* frame pointer must be last for get_wchan */
#define SAVE_CONTEXT "pushq %%rbp ; movq %%rsi,%%rbp\n\t"
#define RESTORE_CONTEXT "movq %%rbp,%%rsi ; popq %%rbp\n\t"
#define SAVE_CONTEXT "pushf ; pushq %%rbp ; movq %%rsi,%%rbp\n\t"
#define RESTORE_CONTEXT "movq %%rbp,%%rsi ; popq %%rbp ; popf\t"

#define __EXTRA_CLOBBER \
,"rcx","rbx","rdx","r8","r9","r10","r11","r12","r13","r14","r15"

/* Save restore flags to clear handle leaking NT */
#define switch_to(prev,next,last) \
asm volatile(SAVE_CONTEXT \
"movq %%rsp,%P[threadrsp](%[prev])\n\t" /* save RSP */ \
Expand Down

0 comments on commit cb2f123

Please sign in to comment.