Merge branch 'timers/for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[cascardo/linux.git] / include / asm-x86 / irqflags.h
index 0e22924..424acb4 100644 (file)
@@ -12,25 +12,21 @@ static inline unsigned long native_save_fl(void)
 {
        unsigned long flags;
 
-       __asm__ __volatile__(
-               "# __raw_save_flags\n\t"
-               "pushf ; pop %0"
-               : "=g" (flags)
-               : /* no input */
-               : "memory"
-       );
+       asm volatile("# __raw_save_flags\n\t"
+                    "pushf ; pop %0"
+                    : "=g" (flags)
+                    : /* no input */
+                    : "memory");
 
        return flags;
 }
 
 static inline void native_restore_fl(unsigned long flags)
 {
-       __asm__ __volatile__(
-               "push %0 ; popf"
-               : /* no output */
-               :"g" (flags)
-               :"memory", "cc"
-       );
+       asm volatile("push %0 ; popf"
+                    : /* no output */
+                    :"g" (flags)
+                    :"memory", "cc");
 }
 
 static inline void native_irq_disable(void)
@@ -70,26 +66,6 @@ static inline void raw_local_irq_restore(unsigned long flags)
        native_restore_fl(flags);
 }
 
-#ifdef CONFIG_X86_VSMP
-
-/*
- * Interrupt control for the VSMP architecture:
- */
-
-static inline void raw_local_irq_disable(void)
-{
-       unsigned long flags = __raw_local_save_flags();
-       raw_local_irq_restore((flags & ~X86_EFLAGS_IF) | X86_EFLAGS_AC);
-}
-
-static inline void raw_local_irq_enable(void)
-{
-       unsigned long flags = __raw_local_save_flags();
-       raw_local_irq_restore((flags | X86_EFLAGS_IF) & (~X86_EFLAGS_AC));
-}
-
-#else
-
 static inline void raw_local_irq_disable(void)
 {
        native_irq_disable();
@@ -100,8 +76,6 @@ static inline void raw_local_irq_enable(void)
        native_irq_enable();
 }
 
-#endif
-
 /*
  * Used in the idle loop; sti takes one instruction cycle
  * to complete:
@@ -137,14 +111,35 @@ static inline unsigned long __raw_local_irq_save(void)
 #define DISABLE_INTERRUPTS(x)  cli
 
 #ifdef CONFIG_X86_64
+#define SWAPGS swapgs
+/*
+ * Currently paravirt can't handle swapgs nicely when we
+ * don't have a stack we can rely on (such as a user space
+ * stack).  So we either find a way around these or just fault
+ * and emulate if a guest tries to call swapgs directly.
+ *
+ * Either way, this is a good way to document that we don't
+ * have a reliable stack. x86_64 only.
+ */
+#define SWAPGS_UNSAFE_STACK    swapgs
+
+#define PARAVIRT_ADJUST_EXCEPTION_FRAME        /*  */
+
 #define INTERRUPT_RETURN       iretq
-#define ENABLE_INTERRUPTS_SYSCALL_RET                  \
-                       movq    %gs:pda_oldrsp, %rsp;   \
-                       swapgs;                         \
-                       sysretq;
+#define USERGS_SYSRET64                                \
+       swapgs;                                 \
+       sysretq;
+#define USERGS_SYSRET32                                \
+       swapgs;                                 \
+       sysretl
+#define ENABLE_INTERRUPTS_SYSEXIT32            \
+       swapgs;                                 \
+       sti;                                    \
+       sysexit
+
 #else
 #define INTERRUPT_RETURN               iret
-#define ENABLE_INTERRUPTS_SYSCALL_RET  sti; sysexit
+#define ENABLE_INTERRUPTS_SYSEXIT      sti; sysexit
 #define GET_CR0_INTO_EAX               movl %cr0, %eax
 #endif
 
@@ -153,23 +148,16 @@ static inline unsigned long __raw_local_irq_save(void)
 #endif /* CONFIG_PARAVIRT */
 
 #ifndef __ASSEMBLY__
-#define raw_local_save_flags(flags) \
-               do { (flags) = __raw_local_save_flags(); } while (0)
+#define raw_local_save_flags(flags)                            \
+       do { (flags) = __raw_local_save_flags(); } while (0)
 
-#define raw_local_irq_save(flags) \
-               do { (flags) = __raw_local_irq_save(); } while (0)
+#define raw_local_irq_save(flags)                              \
+       do { (flags) = __raw_local_irq_save(); } while (0)
 
-#ifdef CONFIG_X86_VSMP
-static inline int raw_irqs_disabled_flags(unsigned long flags)
-{
-       return !(flags & X86_EFLAGS_IF) || (flags & X86_EFLAGS_AC);
-}
-#else
 static inline int raw_irqs_disabled_flags(unsigned long flags)
 {
        return !(flags & X86_EFLAGS_IF);
 }
-#endif
 
 static inline int raw_irqs_disabled(void)
 {
@@ -202,18 +190,6 @@ static inline void trace_hardirqs_fixup(void)
 #else
 
 #ifdef CONFIG_X86_64
-/*
- * Currently paravirt can't handle swapgs nicely when we
- * don't have a stack we can rely on (such as a user space
- * stack).  So we either find a way around these or just fault
- * and emulate if a guest tries to call swapgs directly.
- *
- * Either way, this is a good way to document that we don't
- * have a reliable stack. x86_64 only.
- */
-#define SWAPGS_UNSAFE_STACK    swapgs
-#define ARCH_TRACE_IRQS_ON             call trace_hardirqs_on_thunk
-#define ARCH_TRACE_IRQS_OFF            call trace_hardirqs_off_thunk
 #define ARCH_LOCKDEP_SYS_EXIT          call lockdep_sys_exit_thunk
 #define ARCH_LOCKDEP_SYS_EXIT_IRQ      \
        TRACE_IRQS_ON; \
@@ -225,24 +201,6 @@ static inline void trace_hardirqs_fixup(void)
        TRACE_IRQS_OFF;
 
 #else
-#define ARCH_TRACE_IRQS_ON                     \
-       pushl %eax;                             \
-       pushl %ecx;                             \
-       pushl %edx;                             \
-       call trace_hardirqs_on;                 \
-       popl %edx;                              \
-       popl %ecx;                              \
-       popl %eax;
-
-#define ARCH_TRACE_IRQS_OFF                    \
-       pushl %eax;                             \
-       pushl %ecx;                             \
-       pushl %edx;                             \
-       call trace_hardirqs_off;                \
-       popl %edx;                              \
-       popl %ecx;                              \
-       popl %eax;
-
 #define ARCH_LOCKDEP_SYS_EXIT                  \
        pushl %eax;                             \
        pushl %ecx;                             \
@@ -256,8 +214,8 @@ static inline void trace_hardirqs_fixup(void)
 #endif
 
 #ifdef CONFIG_TRACE_IRQFLAGS
-#  define TRACE_IRQS_ON                ARCH_TRACE_IRQS_ON
-#  define TRACE_IRQS_OFF       ARCH_TRACE_IRQS_OFF
+#  define TRACE_IRQS_ON                call trace_hardirqs_on_thunk;
+#  define TRACE_IRQS_OFF       call trace_hardirqs_off_thunk;
 #else
 #  define TRACE_IRQS_ON
 #  define TRACE_IRQS_OFF