]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'x86/vdso'
authorIngo Molnar <mingo@kernel.org>
Thu, 22 May 2014 11:56:14 +0000 (13:56 +0200)
committerIngo Molnar <mingo@kernel.org>
Thu, 22 May 2014 11:56:14 +0000 (13:56 +0200)
Conflicts:
arch/x86/kernel/entry_64.S

1  2 
arch/x86/Kconfig
arch/x86/kernel/cpu/common.c
arch/x86/kernel/entry_32.S
arch/x86/kernel/entry_64.S
arch/x86/kernel/hpet.c
arch/x86/mm/fault.c

Simple merge
Simple merge
Simple merge
index 43bb389516601678fdfaa79726ebb3551203568c,da0b9bdcc32eb9adc699ce2a442f011a6467b1d4..b585c38d2488a966f3b93a1fa0df96e1d4316206
@@@ -1106,7 -1150,47 +1143,43 @@@ ENTRY(retint_kernel
        CFI_ENDPROC
  END(common_interrupt)
  
 -/*
 - * End of kprobes section
 - */
 -       .popsection
+       /*
+        * If IRET takes a fault on the espfix stack, then we
+        * end up promoting it to a doublefault.  In that case,
+        * modify the stack to make it look like we just entered
+        * the #GP handler from user space, similar to bad_iret.
+        */
+ #ifdef CONFIG_X86_ESPFIX64
+       ALIGN
+ __do_double_fault:
+       XCPT_FRAME 1 RDI+8
+       movq RSP(%rdi),%rax             /* Trap on the espfix stack? */
+       sarq $PGDIR_SHIFT,%rax
+       cmpl $ESPFIX_PGD_ENTRY,%eax
+       jne do_double_fault             /* No, just deliver the fault */
+       cmpl $__KERNEL_CS,CS(%rdi)
+       jne do_double_fault
+       movq RIP(%rdi),%rax
+       cmpq $irq_return_iret,%rax
+ #ifdef CONFIG_PARAVIRT
+       je 1f
+       cmpq $native_iret,%rax
+ #endif
+       jne do_double_fault             /* This shouldn't happen... */
+ 1:
+       movq PER_CPU_VAR(kernel_stack),%rax
+       subq $(6*8-KERNEL_STACK_OFFSET),%rax    /* Reset to original stack */
+       movq %rax,RSP(%rdi)
+       movq $0,(%rax)                  /* Missing (lost) #GP error code */
+       movq $general_protection,RIP(%rdi)
+       retq
+       CFI_ENDPROC
+ END(__do_double_fault)
+ #else
+ # define __do_double_fault do_double_fault
+ #endif
  /*
   * APIC interrupts.
   */
Simple merge
Simple merge