LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [RFC 0/8] rework of extended state handling, LWP support
@ 2011-03-09 19:14 Hans Rosenfeld
  2011-03-09 19:14 ` [RFC 1/8] x86, xsave: cleanup fpu/xsave support Hans Rosenfeld
                   ` (7 more replies)
  0 siblings, 8 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-03-09 19:14 UTC (permalink / raw)
  To: hpa, tglx, mingo
  Cc: linux-kernel, x86, brgerst, robert.richter, Andreas.Herrmann3,
	eranian, suresh.b.siddha, Hans Rosenfeld

This patch set is a general cleanup and rework of the code related to
handling of FPU and otherextended states.

All handling of extended states, including the FPU state, is now handled
by xsave/xrstor wrappers that fall back to fxsave/fxrstor, or even
fsave/frstor, if hardware support for those features is lacking.

Non-lazy xstates, which cannot be restored lazily, can now be easily
supported with almost no processing overhead. This makes adding basic
support for AMDs LWP almost trivial.

Since non-lazy xstates are inherently incompatible with lazy allocation
of the xstate area, the complete removal of lazy allocation to further
reduce code complexity should be considered. Since SSE-optimized library
functions are widely used today, most processes would have an xstate
area anyway, so the memory overhead wouldn't be big enough to be much of
an issue.


Hans Rosenfeld (8):
  x86, xsave: cleanup fpu/xsave support
  x86, xsave: rework fpu/xsave support
  x86, xsave: cleanup fpu/xsave signal frame setup
  x86, xsave: remove unused code
  x86, xsave: more cleanups
  x86, xsave: add support for non-lazy xstates
  x86, xsave: add kernel support for AMDs Lightweight Profiling (LWP)
  x86, xsave: remove lazy allocation of xstate area

 arch/x86/ia32/ia32_signal.c        |    4 +-
 arch/x86/include/asm/i387.h        |  226 +++++++-------------------
 arch/x86/include/asm/processor.h   |   12 ++
 arch/x86/include/asm/sigcontext.h  |   12 ++
 arch/x86/include/asm/thread_info.h |    4 +-
 arch/x86/include/asm/xsave.h       |   99 ++---------
 arch/x86/kernel/i387.c             |  310 ++++--------------------------------
 arch/x86/kernel/process_32.c       |   29 ++---
 arch/x86/kernel/process_64.c       |   28 +---
 arch/x86/kernel/signal.c           |    4 +-
 arch/x86/kernel/traps.c            |   47 +-----
 arch/x86/kernel/xsave.c            |  313 +++++++++++++++++++++++-------------
 arch/x86/kvm/vmx.c                 |    2 +-
 arch/x86/kvm/x86.c                 |   11 +-
 arch/x86/math-emu/fpu_entry.c      |    8 +-
 drivers/lguest/x86/core.c          |    2 +-
 16 files changed, 373 insertions(+), 738 deletions(-)



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC 1/8] x86, xsave: cleanup fpu/xsave support
  2011-03-09 19:14 [RFC 0/8] rework of extended state handling, LWP support Hans Rosenfeld
@ 2011-03-09 19:14 ` Hans Rosenfeld
  2011-03-09 19:14 ` [RFC 2/8] x86, xsave: rework " Hans Rosenfeld
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-03-09 19:14 UTC (permalink / raw)
  To: hpa, tglx, mingo
  Cc: linux-kernel, x86, brgerst, robert.richter, Andreas.Herrmann3,
	eranian, suresh.b.siddha, Hans Rosenfeld

Removed the functions fpu_fxrstor_checking() and restore_fpu_checking()
because they weren't doing anything. Removed redundant xsave/xrstor
implementations. Since xsave/xrstor is not specific to the FPU, and also
for consistency, all xsave/xrstor functions now take a xsave_struct
argument.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/include/asm/i387.h  |   20 +++-------
 arch/x86/include/asm/xsave.h |   81 +++++++++++++++---------------------------
 arch/x86/kernel/traps.c      |    2 +-
 arch/x86/kernel/xsave.c      |    4 +-
 4 files changed, 38 insertions(+), 69 deletions(-)

diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index ef32890..d908383 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -227,12 +227,14 @@ static inline void fpu_fxsave(struct fpu *fpu)
 static inline void fpu_save_init(struct fpu *fpu)
 {
 	if (use_xsave()) {
-		fpu_xsave(fpu);
+		struct xsave_struct *xstate = &fpu->state->xsave;
+
+		fpu_xsave(xstate);
 
 		/*
 		 * xsave header may indicate the init state of the FP.
 		 */
-		if (!(fpu->state->xsave.xsave_hdr.xstate_bv & XSTATE_FP))
+		if (!(xstate->xsave_hdr.xstate_bv & XSTATE_FP))
 			return;
 	} else if (use_fxsr()) {
 		fpu_fxsave(fpu);
@@ -262,22 +264,12 @@ static inline void __save_init_fpu(struct task_struct *tsk)
 	task_thread_info(tsk)->status &= ~TS_USEDFPU;
 }
 
-static inline int fpu_fxrstor_checking(struct fpu *fpu)
-{
-	return fxrstor_checking(&fpu->state->fxsave);
-}
-
 static inline int fpu_restore_checking(struct fpu *fpu)
 {
 	if (use_xsave())
-		return fpu_xrstor_checking(fpu);
+		return xrstor_checking(&fpu->state->xsave, -1);
 	else
-		return fpu_fxrstor_checking(fpu);
-}
-
-static inline int restore_fpu_checking(struct task_struct *tsk)
-{
-	return fpu_restore_checking(&tsk->thread.fpu);
+		return fxrstor_checking(&fpu->state->fxsave);
 }
 
 /*
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
index c6ce245..8bcbbce 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
@@ -42,10 +42,11 @@ extern int check_for_xstate(struct i387_fxsave_struct __user *buf,
 			    void __user *fpstate,
 			    struct _fpx_sw_bytes *sw);
 
-static inline int fpu_xrstor_checking(struct fpu *fpu)
+static inline int xrstor_checking(struct xsave_struct *fx, u64 mask)
 {
-	struct xsave_struct *fx = &fpu->state->xsave;
 	int err;
+	u32 lmask = mask;
+	u32 hmask = mask >> 32;
 
 	asm volatile("1: .byte " REX_PREFIX "0x0f,0xae,0x2f\n\t"
 		     "2:\n"
@@ -55,13 +56,23 @@ static inline int fpu_xrstor_checking(struct fpu *fpu)
 		     ".previous\n"
 		     _ASM_EXTABLE(1b, 3b)
 		     : [err] "=r" (err)
-		     : "D" (fx), "m" (*fx), "a" (-1), "d" (-1), "0" (0)
+		     : "D" (fx), "m" (*fx), "a" (lmask), "d" (hmask), "0" (0)
 		     : "memory");
 
 	return err;
 }
 
-static inline int xsave_user(struct xsave_struct __user *buf)
+static inline void xrstor_state(struct xsave_struct *fx, u64 mask)
+{
+	u32 lmask = mask;
+	u32 hmask = mask >> 32;
+
+	asm volatile(".byte " REX_PREFIX "0x0f,0xae,0x2f\n\t"
+		     : : "D" (fx), "m" (*fx), "a" (lmask), "d" (hmask)
+		     :   "memory");
+}
+
+static inline int xsave_checking(struct xsave_struct __user *buf)
 {
 	int err;
 
@@ -74,58 +85,24 @@ static inline int xsave_user(struct xsave_struct __user *buf)
 	if (unlikely(err))
 		return -EFAULT;
 
-	__asm__ __volatile__("1: .byte " REX_PREFIX "0x0f,0xae,0x27\n"
-			     "2:\n"
-			     ".section .fixup,\"ax\"\n"
-			     "3:  movl $-1,%[err]\n"
-			     "    jmp  2b\n"
-			     ".previous\n"
-			     ".section __ex_table,\"a\"\n"
-			     _ASM_ALIGN "\n"
-			     _ASM_PTR "1b,3b\n"
-			     ".previous"
-			     : [err] "=r" (err)
-			     : "D" (buf), "a" (-1), "d" (-1), "0" (0)
-			     : "memory");
+	asm volatile("1: .byte " REX_PREFIX "0x0f,0xae,0x27\n"
+		     "2:\n"
+		     ".section .fixup,\"ax\"\n"
+		     "3:  movl $-1,%[err]\n"
+		     "    jmp  2b\n"
+		     ".previous\n"
+		     _ASM_EXTABLE(1b,3b)
+		     : [err] "=r" (err)
+		     : "D" (buf), "a" (-1), "d" (-1), "0" (0)
+		     : "memory");
+
 	if (unlikely(err) && __clear_user(buf, xstate_size))
 		err = -EFAULT;
-	/* No need to clear here because the caller clears USED_MATH */
-	return err;
-}
-
-static inline int xrestore_user(struct xsave_struct __user *buf, u64 mask)
-{
-	int err;
-	struct xsave_struct *xstate = ((__force struct xsave_struct *)buf);
-	u32 lmask = mask;
-	u32 hmask = mask >> 32;
 
-	__asm__ __volatile__("1: .byte " REX_PREFIX "0x0f,0xae,0x2f\n"
-			     "2:\n"
-			     ".section .fixup,\"ax\"\n"
-			     "3:  movl $-1,%[err]\n"
-			     "    jmp  2b\n"
-			     ".previous\n"
-			     ".section __ex_table,\"a\"\n"
-			     _ASM_ALIGN "\n"
-			     _ASM_PTR "1b,3b\n"
-			     ".previous"
-			     : [err] "=r" (err)
-			     : "D" (xstate), "a" (lmask), "d" (hmask), "0" (0)
-			     : "memory");	/* memory required? */
+	/* No need to clear here because the caller clears USED_MATH */
 	return err;
 }
 
-static inline void xrstor_state(struct xsave_struct *fx, u64 mask)
-{
-	u32 lmask = mask;
-	u32 hmask = mask >> 32;
-
-	asm volatile(".byte " REX_PREFIX "0x0f,0xae,0x2f\n\t"
-		     : : "D" (fx), "m" (*fx), "a" (lmask), "d" (hmask)
-		     :   "memory");
-}
-
 static inline void xsave_state(struct xsave_struct *fx, u64 mask)
 {
 	u32 lmask = mask;
@@ -136,7 +113,7 @@ static inline void xsave_state(struct xsave_struct *fx, u64 mask)
 		     :   "memory");
 }
 
-static inline void fpu_xsave(struct fpu *fpu)
+static inline void fpu_xsave(struct xsave_struct *fx)
 {
 	/* This, however, we can work around by forcing the compiler to select
 	   an addressing mode that doesn't require extended registers. */
@@ -144,7 +121,7 @@ static inline void fpu_xsave(struct fpu *fpu)
 		".byte " REX_PREFIX "0x0f,0xae,0x27",
 		".byte " REX_PREFIX "0x0f,0xae,0x37",
 		X86_FEATURE_XSAVEOPT,
-		[fx] "D" (&fpu->state->xsave), "a" (-1), "d" (-1) :
+		[fx] "D" (fx), "a" (-1), "d" (-1) :
 		"memory");
 }
 #endif
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index b9b6716..32f3043 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -728,7 +728,7 @@ void __math_state_restore(void)
 	/*
 	 * Paranoid restore. send a SIGSEGV if we fail to restore the state.
 	 */
-	if (unlikely(restore_fpu_checking(tsk))) {
+	if (unlikely(fpu_restore_checking(&tsk->thread.fpu))) {
 		stts();
 		force_sig(SIGSEGV, tsk);
 		return;
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index 5471285..e204b07 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -170,7 +170,7 @@ int save_i387_xstate(void __user *buf)
 
 	if (task_thread_info(tsk)->status & TS_USEDFPU) {
 		if (use_xsave())
-			err = xsave_user(buf);
+			err = xsave_checking(buf);
 		else
 			err = fxsave_user(buf);
 
@@ -247,7 +247,7 @@ static int restore_user_xstate(void __user *buf)
 	/*
 	 * restore the state passed by the user.
 	 */
-	err = xrestore_user(buf, mask);
+	err = xrstor_checking((__force struct xsave_struct *)buf, mask);
 	if (err)
 		return err;
 
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC 2/8] x86, xsave: rework fpu/xsave support
  2011-03-09 19:14 [RFC 0/8] rework of extended state handling, LWP support Hans Rosenfeld
  2011-03-09 19:14 ` [RFC 1/8] x86, xsave: cleanup fpu/xsave support Hans Rosenfeld
@ 2011-03-09 19:14 ` Hans Rosenfeld
  2011-03-09 19:14 ` [RFC 3/8] x86, xsave: cleanup fpu/xsave signal frame setup Hans Rosenfeld
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-03-09 19:14 UTC (permalink / raw)
  To: hpa, tglx, mingo
  Cc: linux-kernel, x86, brgerst, robert.richter, Andreas.Herrmann3,
	eranian, suresh.b.siddha, Hans Rosenfeld

This is a complete rework of the code that handles FPU and related
extended states. Since FPU, XMM and YMM states are just variants of what
xsave handles, all of the old FPU-specific state handling code will be
hidden behind a set of functions that resemble xsave and xrstor. For
hardware that does not support xsave, the code falls back to
fxsave/fxrstor or even fsave/frstor.

A xstate_mask member will be added to the thread_info structure that
will control which states are to be saved by xsave. It is set to include
all "lazy" states (that is, all states currently supported: FPU, XMM and
YMM) by the #NM handler when a lazy restore is triggered or by
switch_to() when the tasks FPU context is preloaded. Xstate_mask is
intended to completely replace TS_USEDFPU in a later cleanup patch.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/include/asm/i387.h        |   44 +++++++++++++++++++---
 arch/x86/include/asm/thread_info.h |    2 +
 arch/x86/include/asm/xsave.h       |   14 ++++++-
 arch/x86/kernel/i387.c             |   11 ++++--
 arch/x86/kernel/process_32.c       |   27 +++++---------
 arch/x86/kernel/process_64.c       |   26 ++++----------
 arch/x86/kernel/traps.c            |   11 +++---
 arch/x86/kernel/xsave.c            |   71 ++++++++++++++++++++++++++++++++++++
 arch/x86/kvm/x86.c                 |    7 ++--
 drivers/lguest/x86/core.c          |    2 +-
 10 files changed, 158 insertions(+), 57 deletions(-)

diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index d908383..939af08 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -224,12 +224,46 @@ static inline void fpu_fxsave(struct fpu *fpu)
 /*
  * These must be called with preempt disabled
  */
+static inline void fpu_restore(struct fpu *fpu)
+{
+	fxrstor_checking(&fpu->state->fxsave);
+}
+
+static inline void fpu_save(struct fpu *fpu)
+{
+	if (use_fxsr()) {
+		fpu_fxsave(fpu);
+	} else {
+		asm volatile("fsave %[fx]; fwait"
+			     : [fx] "=m" (fpu->state->fsave));
+	}
+}
+
+static inline void fpu_clean(struct fpu *fpu)
+{
+	u32 swd = (use_fxsr() || use_xsave()) ?
+		fpu->state->fxsave.swd : fpu->state->fsave.swd;
+
+	if (unlikely(swd & X87_FSW_ES))
+		asm volatile("fnclex");
+
+	/* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
+	   is pending.  Clear the x87 state here by setting it to fixed
+	   values. safe_address is a random variable that should be in L1 */
+	alternative_input(
+		ASM_NOP8 ASM_NOP2,
+		"emms\n\t"	  	/* clear stack tags */
+		"fildl %P[addr]",	/* set F?P to defined value */
+		X86_FEATURE_FXSAVE_LEAK,
+		[addr] "m" (safe_address));
+}
+
 static inline void fpu_save_init(struct fpu *fpu)
 {
 	if (use_xsave()) {
 		struct xsave_struct *xstate = &fpu->state->xsave;
 
-		fpu_xsave(xstate);
+		fpu_xsave(xstate, -1);
 
 		/*
 		 * xsave header may indicate the init state of the FP.
@@ -295,18 +329,16 @@ static inline void __clear_fpu(struct task_struct *tsk)
 			     "2:\n"
 			     _ASM_EXTABLE(1b, 2b));
 		task_thread_info(tsk)->status &= ~TS_USEDFPU;
+		task_thread_info(tsk)->xstate_mask &= ~XCNTXT_LAZY;
 		stts();
 	}
 }
 
 static inline void kernel_fpu_begin(void)
 {
-	struct thread_info *me = current_thread_info();
 	preempt_disable();
-	if (me->status & TS_USEDFPU)
-		__save_init_fpu(me->task);
-	else
-		clts();
+	save_xstates(current_thread_info()->task);
+	clts();
 }
 
 static inline void kernel_fpu_end(void)
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index f0b6e5d..5c92d21 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -26,6 +26,7 @@ struct exec_domain;
 struct thread_info {
 	struct task_struct	*task;		/* main task structure */
 	struct exec_domain	*exec_domain;	/* execution domain */
+	__u64			xstate_mask;	/* xstates in use */
 	__u32			flags;		/* low level flags */
 	__u32			status;		/* thread synchronous flags */
 	__u32			cpu;		/* current CPU */
@@ -47,6 +48,7 @@ struct thread_info {
 {						\
 	.task		= &tsk,			\
 	.exec_domain	= &default_exec_domain,	\
+	.xstate_mask	= 0,			\
 	.flags		= 0,			\
 	.cpu		= 0,			\
 	.preempt_count	= INIT_PREEMPT_COUNT,	\
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
index 8bcbbce..6052a84 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
@@ -25,6 +25,8 @@
  */
 #define XCNTXT_MASK	(XSTATE_FP | XSTATE_SSE | XSTATE_YMM)
 
+#define XCNTXT_LAZY	XCNTXT_MASK
+
 #ifdef CONFIG_X86_64
 #define REX_PREFIX	"0x48, "
 #else
@@ -35,6 +37,11 @@ extern unsigned int xstate_size;
 extern u64 pcntxt_mask;
 extern u64 xstate_fx_sw_bytes[USER_XSTATE_FX_SW_WORDS];
 
+extern void xsave(struct fpu *, u64);
+extern void xrstor(struct fpu *, u64);
+extern void save_xstates(struct task_struct *);
+extern void restore_xstates(struct task_struct *, u64);
+
 extern void xsave_init(void);
 extern void update_regset_xstate_info(unsigned int size, u64 xstate_mask);
 extern int init_fpu(struct task_struct *child);
@@ -113,15 +120,18 @@ static inline void xsave_state(struct xsave_struct *fx, u64 mask)
 		     :   "memory");
 }
 
-static inline void fpu_xsave(struct xsave_struct *fx)
+static inline void fpu_xsave(struct xsave_struct *fx, u64 mask)
 {
+	u32 lmask = mask;
+	u32 hmask = mask >> 32;
+
 	/* This, however, we can work around by forcing the compiler to select
 	   an addressing mode that doesn't require extended registers. */
 	alternative_input(
 		".byte " REX_PREFIX "0x0f,0xae,0x27",
 		".byte " REX_PREFIX "0x0f,0xae,0x37",
 		X86_FEATURE_XSAVEOPT,
-		[fx] "D" (fx), "a" (-1), "d" (-1) :
+		[fx] "D" (fx), "a" (lmask), "d" (hmask) :
 		"memory");
 }
 #endif
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
index e60c38c..5ab66ec 100644
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -152,8 +152,11 @@ int init_fpu(struct task_struct *tsk)
 	int ret;
 
 	if (tsk_used_math(tsk)) {
-		if (HAVE_HWFP && tsk == current)
-			unlazy_fpu(tsk);
+		if (HAVE_HWFP && tsk == current) {
+			preempt_disable();
+			save_xstates(tsk);
+			preempt_enable();
+		}
 		return 0;
 	}
 
@@ -600,7 +603,9 @@ int save_i387_xstate_ia32(void __user *buf)
 				       NULL, fp) ? -1 : 1;
 	}
 
-	unlazy_fpu(tsk);
+	preempt_disable();
+	save_xstates(tsk);
+	preempt_enable();
 
 	if (cpu_has_xsave)
 		return save_i387_xsave(fp);
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 8d12878..8df07c3 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -185,7 +185,9 @@ void release_thread(struct task_struct *dead_task)
  */
 void prepare_to_copy(struct task_struct *tsk)
 {
-	unlazy_fpu(tsk);
+	preempt_disable();
+	save_xstates(tsk);
+	preempt_enable();
 }
 
 int copy_thread(unsigned long clone_flags, unsigned long sp,
@@ -294,21 +296,13 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 				 *next = &next_p->thread;
 	int cpu = smp_processor_id();
 	struct tss_struct *tss = &per_cpu(init_tss, cpu);
-	bool preload_fpu;
 
 	/* never put a printk in __switch_to... printk() calls wake_up*() indirectly */
 
-	/*
-	 * If the task has used fpu the last 5 timeslices, just do a full
-	 * restore of the math state immediately to avoid the trap; the
-	 * chances of needing FPU soon are obviously high now
-	 */
-	preload_fpu = tsk_used_math(next_p) && next_p->fpu_counter > 5;
-
-	__unlazy_fpu(prev_p);
+	save_xstates(prev_p);
 
 	/* we're going to use this soon, after a few expensive things */
-	if (preload_fpu)
+	if (task_thread_info(next_p)->xstate_mask)
 		prefetch(next->fpu.state);
 
 	/*
@@ -349,11 +343,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 		     task_thread_info(next_p)->flags & _TIF_WORK_CTXSW_NEXT))
 		__switch_to_xtra(prev_p, next_p, tss);
 
-	/* If we're going to preload the fpu context, make sure clts
-	   is run while we're batching the cpu state updates. */
-	if (preload_fpu)
-		clts();
-
 	/*
 	 * Leave lazy mode, flushing any hypercalls made here.
 	 * This must be done before restoring TLS segments so
@@ -363,8 +352,10 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 	 */
 	arch_end_context_switch(next_p);
 
-	if (preload_fpu)
-		__math_state_restore();
+	/*
+	 * Restore enabled extended states for the task.
+	 */
+	restore_xstates(next_p, task_thread_info(next_p)->xstate_mask);
 
 	/*
 	 * Restore %gs if needed (which is common)
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index bd387e8..67c5838 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -249,7 +249,9 @@ static inline u32 read_32bit_tls(struct task_struct *t, int tls)
  */
 void prepare_to_copy(struct task_struct *tsk)
 {
-	unlazy_fpu(tsk);
+	preempt_disable();
+	save_xstates(tsk);
+	preempt_enable();
 }
 
 int copy_thread(unsigned long clone_flags, unsigned long sp,
@@ -378,17 +380,9 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 	int cpu = smp_processor_id();
 	struct tss_struct *tss = &per_cpu(init_tss, cpu);
 	unsigned fsindex, gsindex;
-	bool preload_fpu;
-
-	/*
-	 * If the task has used fpu the last 5 timeslices, just do a full
-	 * restore of the math state immediately to avoid the trap; the
-	 * chances of needing FPU soon are obviously high now
-	 */
-	preload_fpu = tsk_used_math(next_p) && next_p->fpu_counter > 5;
 
 	/* we're going to use this soon, after a few expensive things */
-	if (preload_fpu)
+	if (task_thread_info(next_p)->xstate_mask)
 		prefetch(next->fpu.state);
 
 	/*
@@ -420,11 +414,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 	load_TLS(next, cpu);
 
 	/* Must be after DS reload */
-	__unlazy_fpu(prev_p);
-
-	/* Make sure cpu is ready for new context */
-	if (preload_fpu)
-		clts();
+	save_xstates(prev_p);
 
 	/*
 	 * Leave lazy mode, flushing any hypercalls made here.
@@ -485,11 +475,9 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 		__switch_to_xtra(prev_p, next_p, tss);
 
 	/*
-	 * Preload the FPU context, now that we've determined that the
-	 * task is likely to be using it. 
+	 * Restore enabled extended states for the task.
 	 */
-	if (preload_fpu)
-		__math_state_restore();
+	restore_xstates(next_p, task_thread_info(next_p)->xstate_mask);
 
 	return prev_p;
 }
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 32f3043..072c30e 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -625,7 +625,10 @@ void math_error(struct pt_regs *regs, int error_code, int trapnr)
 	/*
 	 * Save the info for the exception handler and clear the error.
 	 */
-	save_init_fpu(task);
+	preempt_disable();
+	save_xstates(task);
+	preempt_enable();
+
 	task->thread.trap_no = trapnr;
 	task->thread.error_code = error_code;
 	info.si_signo = SIGFPE;
@@ -734,7 +737,7 @@ void __math_state_restore(void)
 		return;
 	}
 
-	thread->status |= TS_USEDFPU;	/* So we fnsave on switch_to() */
+	thread->status |= TS_USEDFPU;   /* So we fnsave on switch_to() */
 	tsk->fpu_counter++;
 }
 
@@ -768,9 +771,7 @@ asmlinkage void math_state_restore(void)
 		local_irq_disable();
 	}
 
-	clts();				/* Allow maths ops (or we recurse) */
-
-	__math_state_restore();
+	restore_xstates(tsk, XCNTXT_LAZY);
 }
 EXPORT_SYMBOL_GPL(math_state_restore);
 
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index e204b07..c422527 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -5,6 +5,7 @@
  */
 #include <linux/bootmem.h>
 #include <linux/compat.h>
+#include <linux/module.h>
 #include <asm/i387.h>
 #ifdef CONFIG_IA32_EMULATION
 #include <asm/sigcontext32.h>
@@ -474,3 +475,73 @@ void __cpuinit xsave_init(void)
 	next_func = xstate_enable;
 	this_func();
 }
+
+void xsave(struct fpu *fpu, u64 mask)
+{
+	clts();
+
+	if (use_xsave())
+		fpu_xsave(&fpu->state->xsave, mask);
+	else if (mask & XCNTXT_LAZY)
+		fpu_save(fpu);
+
+	if (mask & XCNTXT_LAZY)
+		fpu_clean(fpu);
+
+	stts();
+}
+EXPORT_SYMBOL(xsave);
+
+void save_xstates(struct task_struct *tsk)
+{
+	struct thread_info *ti = task_thread_info(tsk);
+
+	if (!fpu_allocated(&tsk->thread.fpu))
+		return;
+
+	xsave(&tsk->thread.fpu, ti->xstate_mask);
+
+	if (!(ti->xstate_mask & XCNTXT_LAZY))
+		tsk->fpu_counter = 0;
+
+	/*
+	 * If the task hasn't used the fpu the last 5 timeslices,
+	 * force a lazy restore of the math states by clearing them
+	 * from xstate_mask.
+	 */
+	if (tsk->fpu_counter < 5)
+		ti->xstate_mask &= ~XCNTXT_LAZY;
+
+	ti->status &= ~TS_USEDFPU;
+}
+EXPORT_SYMBOL(save_xstates);
+
+void xrstor(struct fpu *fpu, u64 mask)
+{
+	clts();
+
+	if (use_xsave())
+		xrstor_state(&fpu->state->xsave, mask);
+	else if (mask & XCNTXT_LAZY)
+		fpu_restore(fpu);
+
+	if (!(mask & XCNTXT_LAZY))
+		stts();
+}
+EXPORT_SYMBOL(xrstor);
+
+void restore_xstates(struct task_struct *tsk, u64 mask)
+{
+	struct thread_info *ti = task_thread_info(tsk);
+
+	if (!fpu_allocated(&tsk->thread.fpu))
+		return;
+
+	xrstor(&tsk->thread.fpu, mask);
+
+	ti->xstate_mask |= mask;
+	ti->status |= TS_USEDFPU;
+	if (mask & XCNTXT_LAZY)
+		tsk->fpu_counter++;
+}
+EXPORT_SYMBOL(restore_xstates);
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index bcc0efc..8fb21ea 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -58,6 +58,7 @@
 #include <asm/xcr.h>
 #include <asm/pvclock.h>
 #include <asm/div64.h>
+#include <asm/xsave.h>
 
 #define MAX_IO_MSRS 256
 #define CR0_RESERVED_BITS						\
@@ -5793,8 +5794,8 @@ void kvm_load_guest_fpu(struct kvm_vcpu *vcpu)
 	 */
 	kvm_put_guest_xcr0(vcpu);
 	vcpu->guest_fpu_loaded = 1;
-	unlazy_fpu(current);
-	fpu_restore_checking(&vcpu->arch.guest_fpu);
+	save_xstates(current);
+	xrstor(&vcpu->arch.guest_fpu, -1);
 	trace_kvm_fpu(1);
 }
 
@@ -5806,7 +5807,7 @@ void kvm_put_guest_fpu(struct kvm_vcpu *vcpu)
 		return;
 
 	vcpu->guest_fpu_loaded = 0;
-	fpu_save_init(&vcpu->arch.guest_fpu);
+	xsave(&vcpu->arch.guest_fpu, -1);
 	++vcpu->stat.fpu_reload;
 	kvm_make_request(KVM_REQ_DEACTIVATE_FPU, vcpu);
 	trace_kvm_fpu(0);
diff --git a/drivers/lguest/x86/core.c b/drivers/lguest/x86/core.c
index 9f1659c..ef62289 100644
--- a/drivers/lguest/x86/core.c
+++ b/drivers/lguest/x86/core.c
@@ -204,7 +204,7 @@ void lguest_arch_run_guest(struct lg_cpu *cpu)
 	 * uses the FPU.
 	 */
 	if (cpu->ts)
-		unlazy_fpu(current);
+		save_xstates(current);
 
 	/*
 	 * SYSENTER is an optimized way of doing system calls.  We can't allow
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC 3/8] x86, xsave: cleanup fpu/xsave signal frame setup
  2011-03-09 19:14 [RFC 0/8] rework of extended state handling, LWP support Hans Rosenfeld
  2011-03-09 19:14 ` [RFC 1/8] x86, xsave: cleanup fpu/xsave support Hans Rosenfeld
  2011-03-09 19:14 ` [RFC 2/8] x86, xsave: rework " Hans Rosenfeld
@ 2011-03-09 19:14 ` Hans Rosenfeld
  2011-03-09 19:14 ` [RFC 4/8] x86, xsave: remove unused code Hans Rosenfeld
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-03-09 19:14 UTC (permalink / raw)
  To: hpa, tglx, mingo
  Cc: linux-kernel, x86, brgerst, robert.richter, Andreas.Herrmann3,
	eranian, suresh.b.siddha, Hans Rosenfeld

There are currently two code paths that handle the fpu/xsave context in
a signal frame for 32bit and 64bit tasks. These two code paths differ
only in that they have or lack certain micro-optimizations or do some
additional work (fsave compatibility for 32bit). The code is complex,
mostly duplicate and hard to understand and maintain.

This patch creates a set of two new, unified and cleaned up functions to
replace them. Besides avoiding the duplicate code, it is now obvious
what is done in which situations. The micro-optimization w.r.t xsave
(saving and restoring directly from the user buffer) is gone, and with
it the headaches caused by it about validating the buffer alignment and
contents and catching possible xsave/xrstor faults.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/ia32/ia32_signal.c  |    4 +-
 arch/x86/include/asm/i387.h  |   20 ++++
 arch/x86/include/asm/xsave.h |    4 +-
 arch/x86/kernel/i387.c       |   32 ++-----
 arch/x86/kernel/signal.c     |    4 +-
 arch/x86/kernel/xsave.c      |  199 ++++++++++++++++++++++++++++++++++++++++--
 6 files changed, 227 insertions(+), 36 deletions(-)

diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c
index 588a7aa..2605fae 100644
--- a/arch/x86/ia32/ia32_signal.c
+++ b/arch/x86/ia32/ia32_signal.c
@@ -255,7 +255,7 @@ static int ia32_restore_sigcontext(struct pt_regs *regs,
 
 		get_user_ex(tmp, &sc->fpstate);
 		buf = compat_ptr(tmp);
-		err |= restore_i387_xstate_ia32(buf);
+		err |= restore_xstates_sigframe(buf, sig_xstate_ia32_size);
 
 		get_user_ex(*pax, &sc->ax);
 	} get_user_catch(err);
@@ -396,7 +396,7 @@ static void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
 	if (used_math()) {
 		sp = sp - sig_xstate_ia32_size;
 		*fpstate = (struct _fpstate_ia32 *) sp;
-		if (save_i387_xstate_ia32(*fpstate) < 0)
+		if (save_xstates_sigframe(*fpstate, sig_xstate_ia32_size) < 0)
 			return (void __user *) -1L;
 	}
 
diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index 939af08..30930bf 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -25,6 +25,20 @@
 #include <asm/uaccess.h>
 #include <asm/xsave.h>
 
+#ifdef CONFIG_X86_64
+# include <asm/sigcontext32.h>
+# include <asm/user32.h>
+#else
+# define save_i387_xstate_ia32		save_i387_xstate
+# define restore_i387_xstate_ia32	restore_i387_xstate
+# define _fpstate_ia32		_fpstate
+# define _xstate_ia32		_xstate
+# define sig_xstate_ia32_size   sig_xstate_size
+# define fx_sw_reserved_ia32	fx_sw_reserved
+# define user_i387_ia32_struct	user_i387_struct
+# define user32_fxsr_struct	user_fxsr_struct
+#endif
+
 extern unsigned int sig_xstate_size;
 extern void fpu_init(void);
 extern void mxcsr_feature_mask_init(void);
@@ -33,6 +47,9 @@ extern asmlinkage void math_state_restore(void);
 extern void __math_state_restore(void);
 extern int dump_fpu(struct pt_regs *, struct user_i387_struct *);
 
+extern void convert_from_fxsr(struct user_i387_ia32_struct *, struct task_struct *);
+extern void convert_to_fxsr(struct task_struct *, const struct user_i387_ia32_struct *);
+
 extern user_regset_active_fn fpregs_active, xfpregs_active;
 extern user_regset_get_fn fpregs_get, xfpregs_get, fpregs_soft_get,
 				xstateregs_get;
@@ -46,6 +63,7 @@ extern user_regset_set_fn fpregs_set, xfpregs_set, fpregs_soft_set,
 #define xstateregs_active	fpregs_active
 
 extern struct _fpx_sw_bytes fx_sw_reserved;
+extern unsigned int mxcsr_feature_mask;
 #ifdef CONFIG_IA32_EMULATION
 extern unsigned int sig_xstate_ia32_size;
 extern struct _fpx_sw_bytes fx_sw_reserved_ia32;
@@ -56,8 +74,10 @@ extern int restore_i387_xstate_ia32(void __user *buf);
 #endif
 
 #ifdef CONFIG_MATH_EMULATION
+# define HAVE_HWFP		(boot_cpu_data.hard_math)
 extern void finit_soft_fpu(struct i387_soft_struct *soft);
 #else
+# define HAVE_HWFP		1
 static inline void finit_soft_fpu(struct i387_soft_struct *soft) {}
 #endif
 
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
index 6052a84..200c56d 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
@@ -41,12 +41,14 @@ extern void xsave(struct fpu *, u64);
 extern void xrstor(struct fpu *, u64);
 extern void save_xstates(struct task_struct *);
 extern void restore_xstates(struct task_struct *, u64);
+extern int save_xstates_sigframe(void __user *, unsigned int);
+extern int restore_xstates_sigframe(void __user *, unsigned int);
 
 extern void xsave_init(void);
 extern void update_regset_xstate_info(unsigned int size, u64 xstate_mask);
 extern int init_fpu(struct task_struct *child);
 extern int check_for_xstate(struct i387_fxsave_struct __user *buf,
-			    void __user *fpstate,
+			    unsigned int size,
 			    struct _fpx_sw_bytes *sw);
 
 static inline int xrstor_checking(struct xsave_struct *fx, u64 mask)
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
index 5ab66ec..5cec7c2 100644
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -18,27 +18,7 @@
 #include <asm/i387.h>
 #include <asm/user.h>
 
-#ifdef CONFIG_X86_64
-# include <asm/sigcontext32.h>
-# include <asm/user32.h>
-#else
-# define save_i387_xstate_ia32		save_i387_xstate
-# define restore_i387_xstate_ia32	restore_i387_xstate
-# define _fpstate_ia32		_fpstate
-# define _xstate_ia32		_xstate
-# define sig_xstate_ia32_size   sig_xstate_size
-# define fx_sw_reserved_ia32	fx_sw_reserved
-# define user_i387_ia32_struct	user_i387_struct
-# define user32_fxsr_struct	user_fxsr_struct
-#endif
-
-#ifdef CONFIG_MATH_EMULATION
-# define HAVE_HWFP		(boot_cpu_data.hard_math)
-#else
-# define HAVE_HWFP		1
-#endif
-
-static unsigned int		mxcsr_feature_mask __read_mostly = 0xffffffffu;
+unsigned int mxcsr_feature_mask __read_mostly = 0xffffffffu;
 unsigned int xstate_size;
 EXPORT_SYMBOL_GPL(xstate_size);
 unsigned int sig_xstate_ia32_size = sizeof(struct _fpstate_ia32);
@@ -375,7 +355,7 @@ static inline u32 twd_fxsr_to_i387(struct i387_fxsave_struct *fxsave)
  * FXSR floating point environment conversions.
  */
 
-static void
+void
 convert_from_fxsr(struct user_i387_ia32_struct *env, struct task_struct *tsk)
 {
 	struct i387_fxsave_struct *fxsave = &tsk->thread.fpu.state->fxsave;
@@ -412,8 +392,8 @@ convert_from_fxsr(struct user_i387_ia32_struct *env, struct task_struct *tsk)
 		memcpy(&to[i], &from[i], sizeof(to[0]));
 }
 
-static void convert_to_fxsr(struct task_struct *tsk,
-			    const struct user_i387_ia32_struct *env)
+void convert_to_fxsr(struct task_struct *tsk,
+		     const struct user_i387_ia32_struct *env)
 
 {
 	struct i387_fxsave_struct *fxsave = &tsk->thread.fpu.state->fxsave;
@@ -653,7 +633,9 @@ static int restore_i387_xsave(void __user *buf)
 	u64 mask;
 	int err;
 
-	if (check_for_xstate(fx, buf, &fx_sw_user))
+	if (check_for_xstate(fx, sig_xstate_ia32_size -
+			     offsetof(struct _fpstate_ia32, _fxsr_env),
+			     &fx_sw_user))
 		goto fx_only;
 
 	mask = fx_sw_user.xstate_bv;
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index 4fd173c..f6705ff 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -117,7 +117,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc,
 		regs->orig_ax = -1;		/* disable syscall checks */
 
 		get_user_ex(buf, &sc->fpstate);
-		err |= restore_i387_xstate(buf);
+		err |= restore_xstates_sigframe(buf, sig_xstate_size);
 
 		get_user_ex(*pax, &sc->ax);
 	} get_user_catch(err);
@@ -252,7 +252,7 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size,
 		return (void __user *)-1L;
 
 	/* save i387 state */
-	if (used_math() && save_i387_xstate(*fpstate) < 0)
+	if (used_math() && save_xstates_sigframe(*fpstate, sig_xstate_size) < 0)
 		return (void __user *)-1L;
 
 	return (void __user *)sp;
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index c422527..df9b0bb 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -103,8 +103,7 @@ void __sanitize_i387_state(struct task_struct *tsk)
  * Check for the presence of extended state information in the
  * user fpstate pointer in the sigcontext.
  */
-int check_for_xstate(struct i387_fxsave_struct __user *buf,
-		     void __user *fpstate,
+int check_for_xstate(struct i387_fxsave_struct __user *buf, unsigned int size,
 		     struct _fpx_sw_bytes *fx_sw_user)
 {
 	int min_xstate_size = sizeof(struct i387_fxsave_struct) +
@@ -131,11 +130,11 @@ int check_for_xstate(struct i387_fxsave_struct __user *buf,
 	    fx_sw_user->xstate_size > fx_sw_user->extended_size)
 		return -EINVAL;
 
-	err = __get_user(magic2, (__u32 *) (((void *)fpstate) +
-					    fx_sw_user->extended_size -
+	err = __get_user(magic2, (__u32 *) (((void *)buf) + size -
 					    FP_XSTATE_MAGIC2_SIZE));
 	if (err)
 		return err;
+
 	/*
 	 * Check for the presence of second magic word at the end of memory
 	 * layout. This detects the case where the user just copied the legacy
@@ -148,11 +147,109 @@ int check_for_xstate(struct i387_fxsave_struct __user *buf,
 	return 0;
 }
 
-#ifdef CONFIG_X86_64
 /*
  * Signal frame handlers.
  */
+int save_xstates_sigframe(void __user *buf, unsigned int size)
+{
+	void __user *buf_fxsave = buf;
+	struct task_struct *tsk = current;
+	struct xsave_struct *xsave = &tsk->thread.fpu.state->xsave;
+#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
+	int ia32 = size == sig_xstate_ia32_size;
+#endif
+	int err;
+
+	if (!access_ok(VERIFY_WRITE, buf, size))
+		return -EACCES;
+
+	BUG_ON(size < xstate_size);
+
+	if (!used_math())
+		return 0;
+
+	clear_used_math(); /* trigger finit */
+
+	if (!HAVE_HWFP)
+		return fpregs_soft_get(current, NULL, 0,
+			sizeof(struct user_i387_ia32_struct), NULL,
+			(struct _fpstate_ia32 __user *) buf) ? -1 : 1;
+
+	save_xstates(tsk);
+	sanitize_i387_state(tsk);
+
+#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
+	if (ia32) {
+		if (cpu_has_xsave || cpu_has_fxsr) {
+			struct user_i387_ia32_struct env;
+			struct _fpstate_ia32 __user *fp = buf;
+
+			convert_from_fxsr(&env, tsk);
+			if (__copy_to_user(buf, &env, sizeof(env)))
+				return -1;
+
+			err  = __put_user(xsave->i387.swd, &fp->status);
+			err |= __put_user(X86_FXSR_MAGIC, &fp->magic);
+
+			if (err)
+				return -1;
+
+			buf_fxsave = fp->_fxsr_env;
+			size -= offsetof(struct _fpstate_ia32, _fxsr_env);
+#if defined(CONFIG_X86_64)
+			buf = buf_fxsave;
+#endif
+		} else {
+			struct i387_fsave_struct *fsave =
+				&tsk->thread.fpu.state->fsave;
+
+			fsave->status = fsave->swd;
+		}
+	}
+#endif
+
+	if (__copy_to_user(buf_fxsave, xsave, size))
+		return -1;
+
+	if (cpu_has_xsave) {
+		struct _fpstate __user *fp = buf;
+		struct _xstate __user *x = buf;
+		u64 xstate_bv = xsave->xsave_hdr.xstate_bv;
+
+		err = __copy_to_user(&fp->sw_reserved,
+#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
+				     ia32 ? &fx_sw_reserved_ia32 :
+#endif
+				     &fx_sw_reserved,
+				     sizeof (struct _fpx_sw_bytes));
+
+		err |= __put_user(FP_XSTATE_MAGIC2,
+				  (__u32 __user *) (buf_fxsave + size
+						    - FP_XSTATE_MAGIC2_SIZE));
+
+		/*
+		 * For legacy compatible, we always set FP/SSE bits in the bit
+		 * vector while saving the state to the user context. This will
+		 * enable us capturing any changes(during sigreturn) to
+		 * the FP/SSE bits by the legacy applications which don't touch
+		 * xstate_bv in the xsave header.
+		 *
+		 * xsave aware apps can change the xstate_bv in the xsave
+		 * header as well as change any contents in the memory layout.
+		 * xrestore as part of sigreturn will capture all the changes.
+		 */
+		xstate_bv |= XSTATE_FPSSE;
+
+		err |= __put_user(xstate_bv, &x->xstate_hdr.xstate_bv);
+
+		if (err)
+			return err;
+	}
 
+	return 1;
+}
+
+#ifdef CONFIG_X86_64
 int save_i387_xstate(void __user *buf)
 {
 	struct task_struct *tsk = current;
@@ -240,7 +337,7 @@ static int restore_user_xstate(void __user *buf)
 	int err;
 
 	if (((unsigned long)buf % 64) ||
-	     check_for_xstate(buf, buf, &fx_sw_user))
+	     check_for_xstate(buf, sig_xstate_size, &fx_sw_user))
 		goto fx_only;
 
 	mask = fx_sw_user.xstate_bv;
@@ -315,6 +412,96 @@ clear:
 }
 #endif
 
+int restore_xstates_sigframe(void __user *buf, unsigned int size)
+{
+#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
+	struct user_i387_ia32_struct env;
+	int ia32 = size == sig_xstate_ia32_size;
+#endif
+	struct _fpx_sw_bytes fx_sw_user;
+	struct task_struct *tsk = current;
+	struct _fpstate_ia32 __user *fp = buf;
+	struct xsave_struct *xsave;
+	int xstate_invalid = 0;
+	int err;
+
+	if (!buf) {
+		if (used_math()) {
+			clear_fpu(tsk);
+			clear_used_math();
+		}
+		return 0;
+	}
+
+	if (!access_ok(VERIFY_READ, buf, size))
+		return -EACCES;
+
+	if (!used_math()) {
+		err = init_fpu(tsk);
+		if (err)
+			return err;
+	}
+
+	if (!HAVE_HWFP) {
+		set_used_math();
+		return fpregs_soft_set(current, NULL,
+				       0, sizeof(struct user_i387_ia32_struct),
+				       NULL, fp) != 0;
+	}
+
+#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
+	if (ia32 && (cpu_has_xsave || cpu_has_fxsr)) {
+		if (__copy_from_user(&env, buf, sizeof(env)))
+			return -1;
+		buf = fp->_fxsr_env;
+		size -= offsetof(struct _fpstate_ia32, _fxsr_env);
+	}
+#endif
+
+	if (cpu_has_xsave)
+		xstate_invalid = check_for_xstate(buf, size, &fx_sw_user);
+
+	xsave = &tsk->thread.fpu.state->xsave;
+	if (__copy_from_user(xsave, buf, xstate_size))
+		return -1;
+
+	if (cpu_has_xsave) {
+		u64 *xstate_bv = &xsave->xsave_hdr.xstate_bv;
+
+		/*
+		 * If this is no valid xstate, disable all extended states.
+		 *
+		 * For valid xstates, clear any illegal bits and any bits
+		 * that have been cleared in fx_sw_user.xstate_bv.
+		 */
+		if (xstate_invalid)
+			*xstate_bv = XSTATE_FPSSE;
+		else
+			*xstate_bv &= pcntxt_mask & fx_sw_user.xstate_bv;
+
+		task_thread_info(tsk)->xstate_mask |= *xstate_bv;
+
+		xsave->xsave_hdr.reserved1[0] =
+			xsave->xsave_hdr.reserved1[1] = 0;
+	} else {
+		task_thread_info(tsk)->xstate_mask |= XCNTXT_LAZY;
+	}
+
+	if (cpu_has_xsave || cpu_has_fxsr) {
+		xsave->i387.mxcsr &= mxcsr_feature_mask;
+
+#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
+		if (ia32)
+			convert_to_fxsr(tsk, &env);
+#endif
+	}
+
+	set_used_math();
+	restore_xstates(tsk, task_thread_info(tsk)->xstate_mask);
+
+	return 0;
+}
+
 /*
  * Prepare the SW reserved portion of the fxsave memory layout, indicating
  * the presence of the extended state information in the memory layout
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC 4/8] x86, xsave: remove unused code
  2011-03-09 19:14 [RFC 0/8] rework of extended state handling, LWP support Hans Rosenfeld
                   ` (2 preceding siblings ...)
  2011-03-09 19:14 ` [RFC 3/8] x86, xsave: cleanup fpu/xsave signal frame setup Hans Rosenfeld
@ 2011-03-09 19:14 ` Hans Rosenfeld
  2011-03-09 19:14 ` [RFC 5/8] x86, xsave: more cleanups Hans Rosenfeld
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-03-09 19:14 UTC (permalink / raw)
  To: hpa, tglx, mingo
  Cc: linux-kernel, x86, brgerst, robert.richter, Andreas.Herrmann3,
	eranian, suresh.b.siddha, Hans Rosenfeld

The patches to rework the fpu/xsave handling and signal frame setup have
made a lot of code unused. This patch removes all this now useless stuff.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/include/asm/i387.h  |  155 ++----------------------------
 arch/x86/include/asm/xsave.h |   51 ----------
 arch/x86/kernel/i387.c       |  221 ------------------------------------------
 arch/x86/kernel/traps.c      |   22 ----
 arch/x86/kernel/xsave.c      |  163 -------------------------------
 5 files changed, 7 insertions(+), 605 deletions(-)

diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index 30930bf..97867ea 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -29,8 +29,6 @@
 # include <asm/sigcontext32.h>
 # include <asm/user32.h>
 #else
-# define save_i387_xstate_ia32		save_i387_xstate
-# define restore_i387_xstate_ia32	restore_i387_xstate
 # define _fpstate_ia32		_fpstate
 # define _xstate_ia32		_xstate
 # define sig_xstate_ia32_size   sig_xstate_size
@@ -108,75 +106,16 @@ static inline void sanitize_i387_state(struct task_struct *tsk)
 }
 
 #ifdef CONFIG_X86_64
-static inline int fxrstor_checking(struct i387_fxsave_struct *fx)
+static inline void fxrstor(struct i387_fxsave_struct *fx)
 {
-	int err;
-
-	/* See comment in fxsave() below. */
-#ifdef CONFIG_AS_FXSAVEQ
-	asm volatile("1:  fxrstorq %[fx]\n\t"
-		     "2:\n"
-		     ".section .fixup,\"ax\"\n"
-		     "3:  movl $-1,%[err]\n"
-		     "    jmp  2b\n"
-		     ".previous\n"
-		     _ASM_EXTABLE(1b, 3b)
-		     : [err] "=r" (err)
-		     : [fx] "m" (*fx), "0" (0));
-#else
-	asm volatile("1:  rex64/fxrstor (%[fx])\n\t"
-		     "2:\n"
-		     ".section .fixup,\"ax\"\n"
-		     "3:  movl $-1,%[err]\n"
-		     "    jmp  2b\n"
-		     ".previous\n"
-		     _ASM_EXTABLE(1b, 3b)
-		     : [err] "=r" (err)
-		     : [fx] "R" (fx), "m" (*fx), "0" (0));
-#endif
-	return err;
-}
-
-static inline int fxsave_user(struct i387_fxsave_struct __user *fx)
-{
-	int err;
-
-	/*
-	 * Clear the bytes not touched by the fxsave and reserved
-	 * for the SW usage.
-	 */
-	err = __clear_user(&fx->sw_reserved,
-			   sizeof(struct _fpx_sw_bytes));
-	if (unlikely(err))
-		return -EFAULT;
-
 	/* See comment in fxsave() below. */
 #ifdef CONFIG_AS_FXSAVEQ
-	asm volatile("1:  fxsaveq %[fx]\n\t"
-		     "2:\n"
-		     ".section .fixup,\"ax\"\n"
-		     "3:  movl $-1,%[err]\n"
-		     "    jmp  2b\n"
-		     ".previous\n"
-		     _ASM_EXTABLE(1b, 3b)
-		     : [err] "=r" (err), [fx] "=m" (*fx)
-		     : "0" (0));
+	asm volatile("fxrstorq %[fx]\n\t"
+		     : : [fx] "m" (*fx));
 #else
-	asm volatile("1:  rex64/fxsave (%[fx])\n\t"
-		     "2:\n"
-		     ".section .fixup,\"ax\"\n"
-		     "3:  movl $-1,%[err]\n"
-		     "    jmp  2b\n"
-		     ".previous\n"
-		     _ASM_EXTABLE(1b, 3b)
-		     : [err] "=r" (err), "=m" (*fx)
-		     : [fx] "R" (fx), "0" (0));
+	asm volatile("rex64/fxrstor (%[fx])\n\t"
+		     : : [fx] "R" (fx), "m" (*fx));
 #endif
-	if (unlikely(err) &&
-	    __clear_user(fx, sizeof(struct i387_fxsave_struct)))
-		err = -EFAULT;
-	/* No need to clear here because the caller clears USED_MATH */
-	return err;
 }
 
 static inline void fpu_fxsave(struct fpu *fpu)
@@ -209,7 +148,7 @@ static inline void fpu_fxsave(struct fpu *fpu)
 #else  /* CONFIG_X86_32 */
 
 /* perform fxrstor iff the processor has extended states, otherwise frstor */
-static inline int fxrstor_checking(struct i387_fxsave_struct *fx)
+static inline void fxrstor(struct i387_fxsave_struct *fx)
 {
 	/*
 	 * The "nop" is needed to make the instructions the same
@@ -220,8 +159,6 @@ static inline int fxrstor_checking(struct i387_fxsave_struct *fx)
 		"fxrstor %1",
 		X86_FEATURE_FXSR,
 		"m" (*fx));
-
-	return 0;
 }
 
 static inline void fpu_fxsave(struct fpu *fpu)
@@ -246,7 +183,7 @@ static inline void fpu_fxsave(struct fpu *fpu)
  */
 static inline void fpu_restore(struct fpu *fpu)
 {
-	fxrstor_checking(&fpu->state->fxsave);
+	fxrstor(&fpu->state->fxsave);
 }
 
 static inline void fpu_save(struct fpu *fpu)
@@ -278,69 +215,6 @@ static inline void fpu_clean(struct fpu *fpu)
 		[addr] "m" (safe_address));
 }
 
-static inline void fpu_save_init(struct fpu *fpu)
-{
-	if (use_xsave()) {
-		struct xsave_struct *xstate = &fpu->state->xsave;
-
-		fpu_xsave(xstate, -1);
-
-		/*
-		 * xsave header may indicate the init state of the FP.
-		 */
-		if (!(xstate->xsave_hdr.xstate_bv & XSTATE_FP))
-			return;
-	} else if (use_fxsr()) {
-		fpu_fxsave(fpu);
-	} else {
-		asm volatile("fsave %[fx]; fwait"
-			     : [fx] "=m" (fpu->state->fsave));
-		return;
-	}
-
-	if (unlikely(fpu->state->fxsave.swd & X87_FSW_ES))
-		asm volatile("fnclex");
-
-	/* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
-	   is pending.  Clear the x87 state here by setting it to fixed
-	   values. safe_address is a random variable that should be in L1 */
-	alternative_input(
-		ASM_NOP8 ASM_NOP2,
-		"emms\n\t"	  	/* clear stack tags */
-		"fildl %P[addr]",	/* set F?P to defined value */
-		X86_FEATURE_FXSAVE_LEAK,
-		[addr] "m" (safe_address));
-}
-
-static inline void __save_init_fpu(struct task_struct *tsk)
-{
-	fpu_save_init(&tsk->thread.fpu);
-	task_thread_info(tsk)->status &= ~TS_USEDFPU;
-}
-
-static inline int fpu_restore_checking(struct fpu *fpu)
-{
-	if (use_xsave())
-		return xrstor_checking(&fpu->state->xsave, -1);
-	else
-		return fxrstor_checking(&fpu->state->fxsave);
-}
-
-/*
- * Signal frame handlers...
- */
-extern int save_i387_xstate(void __user *buf);
-extern int restore_i387_xstate(void __user *buf);
-
-static inline void __unlazy_fpu(struct task_struct *tsk)
-{
-	if (task_thread_info(tsk)->status & TS_USEDFPU) {
-		__save_init_fpu(tsk);
-		stts();
-	} else
-		tsk->fpu_counter = 0;
-}
-
 static inline void __clear_fpu(struct task_struct *tsk)
 {
 	if (task_thread_info(tsk)->status & TS_USEDFPU) {
@@ -409,21 +283,6 @@ static inline void irq_ts_restore(int TS_state)
 /*
  * These disable preemption on their own and are safe
  */
-static inline void save_init_fpu(struct task_struct *tsk)
-{
-	preempt_disable();
-	__save_init_fpu(tsk);
-	stts();
-	preempt_enable();
-}
-
-static inline void unlazy_fpu(struct task_struct *tsk)
-{
-	preempt_disable();
-	__unlazy_fpu(tsk);
-	preempt_enable();
-}
-
 static inline void clear_fpu(struct task_struct *tsk)
 {
 	preempt_disable();
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
index 200c56d..742da4a 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
@@ -51,26 +51,6 @@ extern int check_for_xstate(struct i387_fxsave_struct __user *buf,
 			    unsigned int size,
 			    struct _fpx_sw_bytes *sw);
 
-static inline int xrstor_checking(struct xsave_struct *fx, u64 mask)
-{
-	int err;
-	u32 lmask = mask;
-	u32 hmask = mask >> 32;
-
-	asm volatile("1: .byte " REX_PREFIX "0x0f,0xae,0x2f\n\t"
-		     "2:\n"
-		     ".section .fixup,\"ax\"\n"
-		     "3:  movl $-1,%[err]\n"
-		     "    jmp  2b\n"
-		     ".previous\n"
-		     _ASM_EXTABLE(1b, 3b)
-		     : [err] "=r" (err)
-		     : "D" (fx), "m" (*fx), "a" (lmask), "d" (hmask), "0" (0)
-		     : "memory");
-
-	return err;
-}
-
 static inline void xrstor_state(struct xsave_struct *fx, u64 mask)
 {
 	u32 lmask = mask;
@@ -81,37 +61,6 @@ static inline void xrstor_state(struct xsave_struct *fx, u64 mask)
 		     :   "memory");
 }
 
-static inline int xsave_checking(struct xsave_struct __user *buf)
-{
-	int err;
-
-	/*
-	 * Clear the xsave header first, so that reserved fields are
-	 * initialized to zero.
-	 */
-	err = __clear_user(&buf->xsave_hdr,
-			   sizeof(struct xsave_hdr_struct));
-	if (unlikely(err))
-		return -EFAULT;
-
-	asm volatile("1: .byte " REX_PREFIX "0x0f,0xae,0x27\n"
-		     "2:\n"
-		     ".section .fixup,\"ax\"\n"
-		     "3:  movl $-1,%[err]\n"
-		     "    jmp  2b\n"
-		     ".previous\n"
-		     _ASM_EXTABLE(1b,3b)
-		     : [err] "=r" (err)
-		     : "D" (buf), "a" (-1), "d" (-1), "0" (0)
-		     : "memory");
-
-	if (unlikely(err) && __clear_user(buf, xstate_size))
-		err = -EFAULT;
-
-	/* No need to clear here because the caller clears USED_MATH */
-	return err;
-}
-
 static inline void xsave_state(struct xsave_struct *fx, u64 mask)
 {
 	u32 lmask = mask;
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
index 5cec7c2..d2d2b69 100644
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -490,227 +490,6 @@ int fpregs_set(struct task_struct *target, const struct user_regset *regset,
 }
 
 /*
- * Signal frame handlers.
- */
-
-static inline int save_i387_fsave(struct _fpstate_ia32 __user *buf)
-{
-	struct task_struct *tsk = current;
-	struct i387_fsave_struct *fp = &tsk->thread.fpu.state->fsave;
-
-	fp->status = fp->swd;
-	if (__copy_to_user(buf, fp, sizeof(struct i387_fsave_struct)))
-		return -1;
-	return 1;
-}
-
-static int save_i387_fxsave(struct _fpstate_ia32 __user *buf)
-{
-	struct task_struct *tsk = current;
-	struct i387_fxsave_struct *fx = &tsk->thread.fpu.state->fxsave;
-	struct user_i387_ia32_struct env;
-	int err = 0;
-
-	convert_from_fxsr(&env, tsk);
-	if (__copy_to_user(buf, &env, sizeof(env)))
-		return -1;
-
-	err |= __put_user(fx->swd, &buf->status);
-	err |= __put_user(X86_FXSR_MAGIC, &buf->magic);
-	if (err)
-		return -1;
-
-	if (__copy_to_user(&buf->_fxsr_env[0], fx, xstate_size))
-		return -1;
-	return 1;
-}
-
-static int save_i387_xsave(void __user *buf)
-{
-	struct task_struct *tsk = current;
-	struct _fpstate_ia32 __user *fx = buf;
-	int err = 0;
-
-
-	sanitize_i387_state(tsk);
-
-	/*
-	 * For legacy compatible, we always set FP/SSE bits in the bit
-	 * vector while saving the state to the user context.
-	 * This will enable us capturing any changes(during sigreturn) to
-	 * the FP/SSE bits by the legacy applications which don't touch
-	 * xstate_bv in the xsave header.
-	 *
-	 * xsave aware applications can change the xstate_bv in the xsave
-	 * header as well as change any contents in the memory layout.
-	 * xrestore as part of sigreturn will capture all the changes.
-	 */
-	tsk->thread.fpu.state->xsave.xsave_hdr.xstate_bv |= XSTATE_FPSSE;
-
-	if (save_i387_fxsave(fx) < 0)
-		return -1;
-
-	err = __copy_to_user(&fx->sw_reserved, &fx_sw_reserved_ia32,
-			     sizeof(struct _fpx_sw_bytes));
-	err |= __put_user(FP_XSTATE_MAGIC2,
-			  (__u32 __user *) (buf + sig_xstate_ia32_size
-					    - FP_XSTATE_MAGIC2_SIZE));
-	if (err)
-		return -1;
-
-	return 1;
-}
-
-int save_i387_xstate_ia32(void __user *buf)
-{
-	struct _fpstate_ia32 __user *fp = (struct _fpstate_ia32 __user *) buf;
-	struct task_struct *tsk = current;
-
-	if (!used_math())
-		return 0;
-
-	if (!access_ok(VERIFY_WRITE, buf, sig_xstate_ia32_size))
-		return -EACCES;
-	/*
-	 * This will cause a "finit" to be triggered by the next
-	 * attempted FPU operation by the 'current' process.
-	 */
-	clear_used_math();
-
-	if (!HAVE_HWFP) {
-		return fpregs_soft_get(current, NULL,
-				       0, sizeof(struct user_i387_ia32_struct),
-				       NULL, fp) ? -1 : 1;
-	}
-
-	preempt_disable();
-	save_xstates(tsk);
-	preempt_enable();
-
-	if (cpu_has_xsave)
-		return save_i387_xsave(fp);
-	if (cpu_has_fxsr)
-		return save_i387_fxsave(fp);
-	else
-		return save_i387_fsave(fp);
-}
-
-static inline int restore_i387_fsave(struct _fpstate_ia32 __user *buf)
-{
-	struct task_struct *tsk = current;
-
-	return __copy_from_user(&tsk->thread.fpu.state->fsave, buf,
-				sizeof(struct i387_fsave_struct));
-}
-
-static int restore_i387_fxsave(struct _fpstate_ia32 __user *buf,
-			       unsigned int size)
-{
-	struct task_struct *tsk = current;
-	struct user_i387_ia32_struct env;
-	int err;
-
-	err = __copy_from_user(&tsk->thread.fpu.state->fxsave, &buf->_fxsr_env[0],
-			       size);
-	/* mxcsr reserved bits must be masked to zero for security reasons */
-	tsk->thread.fpu.state->fxsave.mxcsr &= mxcsr_feature_mask;
-	if (err || __copy_from_user(&env, buf, sizeof(env)))
-		return 1;
-	convert_to_fxsr(tsk, &env);
-
-	return 0;
-}
-
-static int restore_i387_xsave(void __user *buf)
-{
-	struct _fpx_sw_bytes fx_sw_user;
-	struct _fpstate_ia32 __user *fx_user =
-			((struct _fpstate_ia32 __user *) buf);
-	struct i387_fxsave_struct __user *fx =
-		(struct i387_fxsave_struct __user *) &fx_user->_fxsr_env[0];
-	struct xsave_hdr_struct *xsave_hdr =
-				&current->thread.fpu.state->xsave.xsave_hdr;
-	u64 mask;
-	int err;
-
-	if (check_for_xstate(fx, sig_xstate_ia32_size -
-			     offsetof(struct _fpstate_ia32, _fxsr_env),
-			     &fx_sw_user))
-		goto fx_only;
-
-	mask = fx_sw_user.xstate_bv;
-
-	err = restore_i387_fxsave(buf, fx_sw_user.xstate_size);
-
-	xsave_hdr->xstate_bv &= pcntxt_mask;
-	/*
-	 * These bits must be zero.
-	 */
-	xsave_hdr->reserved1[0] = xsave_hdr->reserved1[1] = 0;
-
-	/*
-	 * Init the state that is not present in the memory layout
-	 * and enabled by the OS.
-	 */
-	mask = ~(pcntxt_mask & ~mask);
-	xsave_hdr->xstate_bv &= mask;
-
-	return err;
-fx_only:
-	/*
-	 * Couldn't find the extended state information in the memory
-	 * layout. Restore the FP/SSE and init the other extended state
-	 * enabled by the OS.
-	 */
-	xsave_hdr->xstate_bv = XSTATE_FPSSE;
-	return restore_i387_fxsave(buf, sizeof(struct i387_fxsave_struct));
-}
-
-int restore_i387_xstate_ia32(void __user *buf)
-{
-	int err;
-	struct task_struct *tsk = current;
-	struct _fpstate_ia32 __user *fp = (struct _fpstate_ia32 __user *) buf;
-
-	if (HAVE_HWFP)
-		clear_fpu(tsk);
-
-	if (!buf) {
-		if (used_math()) {
-			clear_fpu(tsk);
-			clear_used_math();
-		}
-
-		return 0;
-	} else
-		if (!access_ok(VERIFY_READ, buf, sig_xstate_ia32_size))
-			return -EACCES;
-
-	if (!used_math()) {
-		err = init_fpu(tsk);
-		if (err)
-			return err;
-	}
-
-	if (HAVE_HWFP) {
-		if (cpu_has_xsave)
-			err = restore_i387_xsave(buf);
-		else if (cpu_has_fxsr)
-			err = restore_i387_fxsave(fp, sizeof(struct
-							   i387_fxsave_struct));
-		else
-			err = restore_i387_fsave(fp);
-	} else {
-		err = fpregs_soft_set(current, NULL,
-				      0, sizeof(struct user_i387_ia32_struct),
-				      NULL, fp) != 0;
-	}
-	set_used_math();
-
-	return err;
-}
-
-/*
  * FPU state for core dumps.
  * This is only used for a.out dumps now.
  * It is declared generically using elf_fpregset_t (which is
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 072c30e..872fc78 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -720,28 +720,6 @@ asmlinkage void __attribute__((weak)) smp_threshold_interrupt(void)
 }
 
 /*
- * __math_state_restore assumes that cr0.TS is already clear and the
- * fpu state is all ready for use.  Used during context switch.
- */
-void __math_state_restore(void)
-{
-	struct thread_info *thread = current_thread_info();
-	struct task_struct *tsk = thread->task;
-
-	/*
-	 * Paranoid restore. send a SIGSEGV if we fail to restore the state.
-	 */
-	if (unlikely(fpu_restore_checking(&tsk->thread.fpu))) {
-		stts();
-		force_sig(SIGSEGV, tsk);
-		return;
-	}
-
-	thread->status |= TS_USEDFPU;   /* So we fnsave on switch_to() */
-	tsk->fpu_counter++;
-}
-
-/*
  * 'math_state_restore()' saves the current math information in the
  * old math state array, and gets the new ones from the current task
  *
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index df9b0bb..a10c13e 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -249,169 +249,6 @@ int save_xstates_sigframe(void __user *buf, unsigned int size)
 	return 1;
 }
 
-#ifdef CONFIG_X86_64
-int save_i387_xstate(void __user *buf)
-{
-	struct task_struct *tsk = current;
-	int err = 0;
-
-	if (!access_ok(VERIFY_WRITE, buf, sig_xstate_size))
-		return -EACCES;
-
-	BUG_ON(sig_xstate_size < xstate_size);
-
-	if ((unsigned long)buf % 64)
-		printk("save_i387_xstate: bad fpstate %p\n", buf);
-
-	if (!used_math())
-		return 0;
-
-	if (task_thread_info(tsk)->status & TS_USEDFPU) {
-		if (use_xsave())
-			err = xsave_checking(buf);
-		else
-			err = fxsave_user(buf);
-
-		if (err)
-			return err;
-		task_thread_info(tsk)->status &= ~TS_USEDFPU;
-		stts();
-	} else {
-		sanitize_i387_state(tsk);
-		if (__copy_to_user(buf, &tsk->thread.fpu.state->fxsave,
-				   xstate_size))
-			return -1;
-	}
-
-	clear_used_math(); /* trigger finit */
-
-	if (use_xsave()) {
-		struct _fpstate __user *fx = buf;
-		struct _xstate __user *x = buf;
-		u64 xstate_bv;
-
-		err = __copy_to_user(&fx->sw_reserved, &fx_sw_reserved,
-				     sizeof(struct _fpx_sw_bytes));
-
-		err |= __put_user(FP_XSTATE_MAGIC2,
-				  (__u32 __user *) (buf + sig_xstate_size
-						    - FP_XSTATE_MAGIC2_SIZE));
-
-		/*
-		 * Read the xstate_bv which we copied (directly from the cpu or
-		 * from the state in task struct) to the user buffers and
-		 * set the FP/SSE bits.
-		 */
-		err |= __get_user(xstate_bv, &x->xstate_hdr.xstate_bv);
-
-		/*
-		 * For legacy compatible, we always set FP/SSE bits in the bit
-		 * vector while saving the state to the user context. This will
-		 * enable us capturing any changes(during sigreturn) to
-		 * the FP/SSE bits by the legacy applications which don't touch
-		 * xstate_bv in the xsave header.
-		 *
-		 * xsave aware apps can change the xstate_bv in the xsave
-		 * header as well as change any contents in the memory layout.
-		 * xrestore as part of sigreturn will capture all the changes.
-		 */
-		xstate_bv |= XSTATE_FPSSE;
-
-		err |= __put_user(xstate_bv, &x->xstate_hdr.xstate_bv);
-
-		if (err)
-			return err;
-	}
-
-	return 1;
-}
-
-/*
- * Restore the extended state if present. Otherwise, restore the FP/SSE
- * state.
- */
-static int restore_user_xstate(void __user *buf)
-{
-	struct _fpx_sw_bytes fx_sw_user;
-	u64 mask;
-	int err;
-
-	if (((unsigned long)buf % 64) ||
-	     check_for_xstate(buf, sig_xstate_size, &fx_sw_user))
-		goto fx_only;
-
-	mask = fx_sw_user.xstate_bv;
-
-	/*
-	 * restore the state passed by the user.
-	 */
-	err = xrstor_checking((__force struct xsave_struct *)buf, mask);
-	if (err)
-		return err;
-
-	/*
-	 * init the state skipped by the user.
-	 */
-	mask = pcntxt_mask & ~mask;
-	if (unlikely(mask))
-		xrstor_state(init_xstate_buf, mask);
-
-	return 0;
-
-fx_only:
-	/*
-	 * couldn't find the extended state information in the
-	 * memory layout. Restore just the FP/SSE and init all
-	 * the other extended state.
-	 */
-	xrstor_state(init_xstate_buf, pcntxt_mask & ~XSTATE_FPSSE);
-	return fxrstor_checking((__force struct i387_fxsave_struct *)buf);
-}
-
-/*
- * This restores directly out of user space. Exceptions are handled.
- */
-int restore_i387_xstate(void __user *buf)
-{
-	struct task_struct *tsk = current;
-	int err = 0;
-
-	if (!buf) {
-		if (used_math())
-			goto clear;
-		return 0;
-	} else
-		if (!access_ok(VERIFY_READ, buf, sig_xstate_size))
-			return -EACCES;
-
-	if (!used_math()) {
-		err = init_fpu(tsk);
-		if (err)
-			return err;
-	}
-
-	if (!(task_thread_info(current)->status & TS_USEDFPU)) {
-		clts();
-		task_thread_info(current)->status |= TS_USEDFPU;
-	}
-	if (use_xsave())
-		err = restore_user_xstate(buf);
-	else
-		err = fxrstor_checking((__force struct i387_fxsave_struct *)
-				       buf);
-	if (unlikely(err)) {
-		/*
-		 * Encountered an error while doing the restore from the
-		 * user buffer, clear the fpu state.
-		 */
-clear:
-		clear_fpu(tsk);
-		clear_used_math();
-	}
-	return err;
-}
-#endif
-
 int restore_xstates_sigframe(void __user *buf, unsigned int size)
 {
 #if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC 5/8] x86, xsave: more cleanups
  2011-03-09 19:14 [RFC 0/8] rework of extended state handling, LWP support Hans Rosenfeld
                   ` (3 preceding siblings ...)
  2011-03-09 19:14 ` [RFC 4/8] x86, xsave: remove unused code Hans Rosenfeld
@ 2011-03-09 19:14 ` Hans Rosenfeld
  2011-03-09 19:15 ` [RFC 6/8] x86, xsave: add support for non-lazy xstates Hans Rosenfeld
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-03-09 19:14 UTC (permalink / raw)
  To: hpa, tglx, mingo
  Cc: linux-kernel, x86, brgerst, robert.richter, Andreas.Herrmann3,
	eranian, suresh.b.siddha, Hans Rosenfeld

Removed some declarations from headers that weren't used.

Retired TS_USEDFPU, it has been replaced by the XCNTXT_* bits in
xstate_mask.

There is no reason functions like fpu_fxsave() etc. need to know or
handle anything else than a buffer to save/restore their stuff to/from.

Sanitize_i387_state() is extra work that is only needed when xsaveopt is
used. There is no point in hiding this in an inline function, adding
extra code lines just to save a single if() in the five places it is
used. Also, it is obscuring a fact that might well be interesting to
whoever is reading the code, but it is not gaining anything.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/include/asm/i387.h        |   48 ++++++++++++------------------------
 arch/x86/include/asm/thread_info.h |    2 -
 arch/x86/include/asm/xsave.h       |    9 ++----
 arch/x86/kernel/i387.c             |   12 ++++++---
 arch/x86/kernel/xsave.c            |   32 +++++++++++------------
 arch/x86/kvm/vmx.c                 |    2 +-
 arch/x86/kvm/x86.c                 |    4 +-
 7 files changed, 45 insertions(+), 64 deletions(-)

diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index 97867ea..c81b63e 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -42,7 +42,6 @@ extern void fpu_init(void);
 extern void mxcsr_feature_mask_init(void);
 extern int init_fpu(struct task_struct *child);
 extern asmlinkage void math_state_restore(void);
-extern void __math_state_restore(void);
 extern int dump_fpu(struct pt_regs *, struct user_i387_struct *);
 
 extern void convert_from_fxsr(struct user_i387_ia32_struct *, struct task_struct *);
@@ -60,15 +59,10 @@ extern user_regset_set_fn fpregs_set, xfpregs_set, fpregs_soft_set,
  */
 #define xstateregs_active	fpregs_active
 
-extern struct _fpx_sw_bytes fx_sw_reserved;
 extern unsigned int mxcsr_feature_mask;
+
 #ifdef CONFIG_IA32_EMULATION
 extern unsigned int sig_xstate_ia32_size;
-extern struct _fpx_sw_bytes fx_sw_reserved_ia32;
-struct _fpstate_ia32;
-struct _xstate_ia32;
-extern int save_i387_xstate_ia32(void __user *buf);
-extern int restore_i387_xstate_ia32(void __user *buf);
 #endif
 
 #ifdef CONFIG_MATH_EMULATION
@@ -76,7 +70,7 @@ extern int restore_i387_xstate_ia32(void __user *buf);
 extern void finit_soft_fpu(struct i387_soft_struct *soft);
 #else
 # define HAVE_HWFP		1
-static inline void finit_soft_fpu(struct i387_soft_struct *soft) {}
+# define finit_soft_fpu(x)
 #endif
 
 #define X87_FSW_ES (1 << 7)	/* Exception Summary */
@@ -96,15 +90,6 @@ static __always_inline __pure bool use_fxsr(void)
         return static_cpu_has(X86_FEATURE_FXSR);
 }
 
-extern void __sanitize_i387_state(struct task_struct *);
-
-static inline void sanitize_i387_state(struct task_struct *tsk)
-{
-	if (!use_xsaveopt())
-		return;
-	__sanitize_i387_state(tsk);
-}
-
 #ifdef CONFIG_X86_64
 static inline void fxrstor(struct i387_fxsave_struct *fx)
 {
@@ -118,7 +103,7 @@ static inline void fxrstor(struct i387_fxsave_struct *fx)
 #endif
 }
 
-static inline void fpu_fxsave(struct fpu *fpu)
+static inline void fpu_fxsave(struct i387_fxsave_struct *fx)
 {
 	/* Using "rex64; fxsave %0" is broken because, if the memory operand
 	   uses any extended registers for addressing, a second REX prefix
@@ -129,7 +114,7 @@ static inline void fpu_fxsave(struct fpu *fpu)
 	/* Using "fxsaveq %0" would be the ideal choice, but is only supported
 	   starting with gas 2.16. */
 	__asm__ __volatile__("fxsaveq %0"
-			     : "=m" (fpu->state->fxsave));
+			     : "=m" (*fx));
 #else
 	/* Using, as a workaround, the properly prefixed form below isn't
 	   accepted by any binutils version so far released, complaining that
@@ -140,8 +125,8 @@ static inline void fpu_fxsave(struct fpu *fpu)
 	   This, however, we can work around by forcing the compiler to select
 	   an addressing mode that doesn't require extended registers. */
 	asm volatile("rex64/fxsave (%[fx])"
-		     : "=m" (fpu->state->fxsave)
-		     : [fx] "R" (&fpu->state->fxsave));
+		     : "=m" (*fx)
+		     : [fx] "R" (fx));
 #endif
 }
 
@@ -161,10 +146,10 @@ static inline void fxrstor(struct i387_fxsave_struct *fx)
 		"m" (*fx));
 }
 
-static inline void fpu_fxsave(struct fpu *fpu)
+static inline void fpu_fxsave(struct i387_fxsave_struct *fx)
 {
 	asm volatile("fxsave %[fx]"
-		     : [fx] "=m" (fpu->state->fxsave));
+		     : [fx] "=m" (*fx));
 }
 
 #endif	/* CONFIG_X86_64 */
@@ -181,25 +166,25 @@ static inline void fpu_fxsave(struct fpu *fpu)
 /*
  * These must be called with preempt disabled
  */
-static inline void fpu_restore(struct fpu *fpu)
+static inline void fpu_restore(struct i387_fxsave_struct *fx)
 {
-	fxrstor(&fpu->state->fxsave);
+	fxrstor(fx);
 }
 
-static inline void fpu_save(struct fpu *fpu)
+static inline void fpu_save(struct i387_fxsave_struct *fx)
 {
 	if (use_fxsr()) {
-		fpu_fxsave(fpu);
+		fpu_fxsave(fx);
 	} else {
 		asm volatile("fsave %[fx]; fwait"
-			     : [fx] "=m" (fpu->state->fsave));
+			     : [fx] "=m" (*fx));
 	}
 }
 
-static inline void fpu_clean(struct fpu *fpu)
+static inline void fpu_clean(struct i387_fxsave_struct *fx)
 {
 	u32 swd = (use_fxsr() || use_xsave()) ?
-		fpu->state->fxsave.swd : fpu->state->fsave.swd;
+		fx->swd : ((struct i387_fsave_struct *)fx)->swd;
 
 	if (unlikely(swd & X87_FSW_ES))
 		asm volatile("fnclex");
@@ -217,12 +202,11 @@ static inline void fpu_clean(struct fpu *fpu)
 
 static inline void __clear_fpu(struct task_struct *tsk)
 {
-	if (task_thread_info(tsk)->status & TS_USEDFPU) {
+	if (task_thread_info(tsk)->xstate_mask & XCNTXT_LAZY) {
 		/* Ignore delayed exceptions from user space */
 		asm volatile("1: fwait\n"
 			     "2:\n"
 			     _ASM_EXTABLE(1b, 2b));
-		task_thread_info(tsk)->status &= ~TS_USEDFPU;
 		task_thread_info(tsk)->xstate_mask &= ~XCNTXT_LAZY;
 		stts();
 	}
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index 5c92d21..13de316 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -238,8 +238,6 @@ static inline struct thread_info *current_thread_info(void)
  * ever touches our thread-synchronous status, so we don't
  * have to worry about atomic accesses.
  */
-#define TS_USEDFPU		0x0001	/* FPU was used by this task
-					   this quantum (SMP) */
 #define TS_COMPAT		0x0002	/* 32bit syscall active (64BIT)*/
 #define TS_POLLING		0x0004	/* idle task polling need_resched,
 					   skip sending interrupt */
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
index 742da4a..fbbc7db 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
@@ -37,8 +37,8 @@ extern unsigned int xstate_size;
 extern u64 pcntxt_mask;
 extern u64 xstate_fx_sw_bytes[USER_XSTATE_FX_SW_WORDS];
 
-extern void xsave(struct fpu *, u64);
-extern void xrstor(struct fpu *, u64);
+extern void xsave(struct xsave_struct *, u64);
+extern void xrstor(struct xsave_struct *, u64);
 extern void save_xstates(struct task_struct *);
 extern void restore_xstates(struct task_struct *, u64);
 extern int save_xstates_sigframe(void __user *, unsigned int);
@@ -46,10 +46,7 @@ extern int restore_xstates_sigframe(void __user *, unsigned int);
 
 extern void xsave_init(void);
 extern void update_regset_xstate_info(unsigned int size, u64 xstate_mask);
-extern int init_fpu(struct task_struct *child);
-extern int check_for_xstate(struct i387_fxsave_struct __user *buf,
-			    unsigned int size,
-			    struct _fpx_sw_bytes *sw);
+extern void sanitize_i387_state(struct task_struct *);
 
 static inline void xrstor_state(struct xsave_struct *fx, u64 mask)
 {
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
index d2d2b69..88fefba 100644
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -182,7 +182,8 @@ int xfpregs_get(struct task_struct *target, const struct user_regset *regset,
 	if (ret)
 		return ret;
 
-	sanitize_i387_state(target);
+	if (use_xsaveopt())
+		sanitize_i387_state(target);
 
 	return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
 				   &target->thread.fpu.state->fxsave, 0, -1);
@@ -201,7 +202,8 @@ int xfpregs_set(struct task_struct *target, const struct user_regset *regset,
 	if (ret)
 		return ret;
 
-	sanitize_i387_state(target);
+	if (use_xsaveopt())
+		sanitize_i387_state(target);
 
 	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
 				 &target->thread.fpu.state->fxsave, 0, -1);
@@ -440,7 +442,8 @@ int fpregs_get(struct task_struct *target, const struct user_regset *regset,
 					   -1);
 	}
 
-	sanitize_i387_state(target);
+	if (use_xsaveopt())
+		sanitize_i387_state(target);
 
 	if (kbuf && pos == 0 && count == sizeof(env)) {
 		convert_from_fxsr(kbuf, target);
@@ -463,7 +466,8 @@ int fpregs_set(struct task_struct *target, const struct user_regset *regset,
 	if (ret)
 		return ret;
 
-	sanitize_i387_state(target);
+	if (use_xsaveopt())
+		sanitize_i387_state(target);
 
 	if (!HAVE_HWFP)
 		return fpregs_soft_set(target, regset, pos, count, kbuf, ubuf);
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index a10c13e..b6d6f38 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -39,7 +39,7 @@ static unsigned int *xstate_offsets, *xstate_sizes, xstate_features;
  * that the user doesn't see some stale state in the memory layout during
  * signal handling, debugging etc.
  */
-void __sanitize_i387_state(struct task_struct *tsk)
+void sanitize_i387_state(struct task_struct *tsk)
 {
 	u64 xstate_bv;
 	int feature_bit = 0x2;
@@ -48,7 +48,7 @@ void __sanitize_i387_state(struct task_struct *tsk)
 	if (!fx)
 		return;
 
-	BUG_ON(task_thread_info(tsk)->status & TS_USEDFPU);
+	BUG_ON(task_thread_info(tsk)->xstate_mask & XCNTXT_LAZY);
 
 	xstate_bv = tsk->thread.fpu.state->xsave.xsave_hdr.xstate_bv;
 
@@ -103,8 +103,8 @@ void __sanitize_i387_state(struct task_struct *tsk)
  * Check for the presence of extended state information in the
  * user fpstate pointer in the sigcontext.
  */
-int check_for_xstate(struct i387_fxsave_struct __user *buf, unsigned int size,
-		     struct _fpx_sw_bytes *fx_sw_user)
+static int check_for_xstate(struct i387_fxsave_struct __user *buf, unsigned int size,
+			    struct _fpx_sw_bytes *fx_sw_user)
 {
 	int min_xstate_size = sizeof(struct i387_fxsave_struct) +
 			      sizeof(struct xsave_hdr_struct);
@@ -176,7 +176,8 @@ int save_xstates_sigframe(void __user *buf, unsigned int size)
 			(struct _fpstate_ia32 __user *) buf) ? -1 : 1;
 
 	save_xstates(tsk);
-	sanitize_i387_state(tsk);
+	if (use_xsaveopt())
+		sanitize_i387_state(tsk);
 
 #if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
 	if (ia32) {
@@ -500,17 +501,17 @@ void __cpuinit xsave_init(void)
 	this_func();
 }
 
-void xsave(struct fpu *fpu, u64 mask)
+void xsave(struct xsave_struct *x, u64 mask)
 {
 	clts();
 
 	if (use_xsave())
-		fpu_xsave(&fpu->state->xsave, mask);
+		fpu_xsave(x, mask);
 	else if (mask & XCNTXT_LAZY)
-		fpu_save(fpu);
+		fpu_save(&x->i387);
 
 	if (mask & XCNTXT_LAZY)
-		fpu_clean(fpu);
+		fpu_clean(&x->i387);
 
 	stts();
 }
@@ -523,7 +524,7 @@ void save_xstates(struct task_struct *tsk)
 	if (!fpu_allocated(&tsk->thread.fpu))
 		return;
 
-	xsave(&tsk->thread.fpu, ti->xstate_mask);
+	xsave(&tsk->thread.fpu.state->xsave, ti->xstate_mask);
 
 	if (!(ti->xstate_mask & XCNTXT_LAZY))
 		tsk->fpu_counter = 0;
@@ -535,19 +536,17 @@ void save_xstates(struct task_struct *tsk)
 	 */
 	if (tsk->fpu_counter < 5)
 		ti->xstate_mask &= ~XCNTXT_LAZY;
-
-	ti->status &= ~TS_USEDFPU;
 }
 EXPORT_SYMBOL(save_xstates);
 
-void xrstor(struct fpu *fpu, u64 mask)
+void xrstor(struct xsave_struct *x, u64 mask)
 {
 	clts();
 
 	if (use_xsave())
-		xrstor_state(&fpu->state->xsave, mask);
+		xrstor_state(x, mask);
 	else if (mask & XCNTXT_LAZY)
-		fpu_restore(fpu);
+		fpu_restore(&x->i387);
 
 	if (!(mask & XCNTXT_LAZY))
 		stts();
@@ -561,10 +560,9 @@ void restore_xstates(struct task_struct *tsk, u64 mask)
 	if (!fpu_allocated(&tsk->thread.fpu))
 		return;
 
-	xrstor(&tsk->thread.fpu, mask);
+	xrstor(&tsk->thread.fpu.state->xsave, mask);
 
 	ti->xstate_mask |= mask;
-	ti->status |= TS_USEDFPU;
 	if (mask & XCNTXT_LAZY)
 		tsk->fpu_counter++;
 }
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index bf89ec2..d79bf2f 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -876,7 +876,7 @@ static void __vmx_load_host_state(struct vcpu_vmx *vmx)
 #ifdef CONFIG_X86_64
 	wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base);
 #endif
-	if (current_thread_info()->status & TS_USEDFPU)
+	if (current_thread_info()->xstate_mask & XCNTXT_LAZY)
 		clts();
 	load_gdt(&__get_cpu_var(host_gdt));
 }
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 8fb21ea..10aeb04 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5795,7 +5795,7 @@ void kvm_load_guest_fpu(struct kvm_vcpu *vcpu)
 	kvm_put_guest_xcr0(vcpu);
 	vcpu->guest_fpu_loaded = 1;
 	save_xstates(current);
-	xrstor(&vcpu->arch.guest_fpu, -1);
+	xrstor(&vcpu->arch.guest_fpu.state->xsave, -1);
 	trace_kvm_fpu(1);
 }
 
@@ -5807,7 +5807,7 @@ void kvm_put_guest_fpu(struct kvm_vcpu *vcpu)
 		return;
 
 	vcpu->guest_fpu_loaded = 0;
-	xsave(&vcpu->arch.guest_fpu, -1);
+	xsave(&vcpu->arch.guest_fpu.state->xsave, -1);
 	++vcpu->stat.fpu_reload;
 	kvm_make_request(KVM_REQ_DEACTIVATE_FPU, vcpu);
 	trace_kvm_fpu(0);
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC 6/8] x86, xsave: add support for non-lazy xstates
  2011-03-09 19:14 [RFC 0/8] rework of extended state handling, LWP support Hans Rosenfeld
                   ` (4 preceding siblings ...)
  2011-03-09 19:14 ` [RFC 5/8] x86, xsave: more cleanups Hans Rosenfeld
@ 2011-03-09 19:15 ` Hans Rosenfeld
  2011-03-09 19:15 ` [RFC 7/8] x86, xsave: add kernel support for AMDs Lightweight Profiling (LWP) Hans Rosenfeld
  2011-03-09 19:15 ` [RFC 8/8] x86, xsave: remove lazy allocation of xstate area Hans Rosenfeld
  7 siblings, 0 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-03-09 19:15 UTC (permalink / raw)
  To: hpa, tglx, mingo
  Cc: linux-kernel, x86, brgerst, robert.richter, Andreas.Herrmann3,
	eranian, suresh.b.siddha, Hans Rosenfeld

Non-lazy xstates are, as the name suggests,  extended states that cannot
be saved or restored lazily. The state for AMDs LWP feature is an
example of this.

This patch adds support for this kind of xstates. If any such states are
present and supported on the running system, they will always be enabled
in xstate_mask so that they are always restored in switch_to. Since lazy
allocation of the xstate area won't work when non-lazy xstates are used,
all tasks will always have a xstate area preallocated.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/include/asm/i387.h  |   11 +++++++++++
 arch/x86/include/asm/xsave.h |    5 +++--
 arch/x86/kernel/process_32.c |    2 +-
 arch/x86/kernel/process_64.c |    2 +-
 arch/x86/kernel/xsave.c      |    9 +++++++++
 5 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index c81b63e..b3b3f17 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -335,6 +335,17 @@ static inline void fpu_copy(struct fpu *dst, struct fpu *src)
 
 extern void fpu_finit(struct fpu *fpu);
 
+static inline void fpu_clear(struct fpu *fpu)
+{
+	if (pcntxt_mask & XCNTXT_NONLAZY) {
+		memset(fpu->state, 0, xstate_size);
+		fpu_finit(fpu);
+		set_used_math();
+	} else {
+		fpu_free(fpu);
+	}
+}
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* _ASM_X86_I387_H */
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
index fbbc7db..18401cc 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
@@ -23,9 +23,10 @@
 /*
  * These are the features that the OS can handle currently.
  */
-#define XCNTXT_MASK	(XSTATE_FP | XSTATE_SSE | XSTATE_YMM)
+#define XCNTXT_LAZY	(XSTATE_FP | XSTATE_SSE | XSTATE_YMM)
+#define XCNTXT_NONLAZY	0
 
-#define XCNTXT_LAZY	XCNTXT_MASK
+#define XCNTXT_MASK	(XCNTXT_LAZY | XCNTXT_NONLAZY)
 
 #ifdef CONFIG_X86_64
 #define REX_PREFIX	"0x48, "
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 8df07c3..a878736 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -257,7 +257,7 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)
 	/*
 	 * Free the old FP and other extended state
 	 */
-	free_thread_xstate(current);
+	fpu_clear(&current->thread.fpu);
 }
 EXPORT_SYMBOL_GPL(start_thread);
 
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 67c5838..67a6bc9 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -344,7 +344,7 @@ start_thread_common(struct pt_regs *regs, unsigned long new_ip,
 	/*
 	 * Free the old FP and other extended state
 	 */
-	free_thread_xstate(current);
+	fpu_clear(&current->thread.fpu);
 }
 
 void
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index b6d6f38..d4050fa 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -16,6 +16,7 @@
  * Supported feature mask by the CPU and the kernel.
  */
 u64 pcntxt_mask;
+EXPORT_SYMBOL(pcntxt_mask);
 
 /*
  * Represents init state for the supported extended state.
@@ -479,6 +480,14 @@ static void __init xstate_enable_boot_cpu(void)
 	printk(KERN_INFO "xsave/xrstor: enabled xstate_bv 0x%llx, "
 	       "cntxt size 0x%x\n",
 	       pcntxt_mask, xstate_size);
+
+	if (pcntxt_mask & XCNTXT_NONLAZY) {
+		static union thread_xstate x;
+
+		task_thread_info(&init_task)->xstate_mask |= XCNTXT_NONLAZY;
+		init_task.thread.fpu.state = &x;
+		fpu_finit(&init_task.thread.fpu);
+	}
 }
 
 /*
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC 7/8] x86, xsave: add kernel support for AMDs Lightweight Profiling (LWP)
  2011-03-09 19:14 [RFC 0/8] rework of extended state handling, LWP support Hans Rosenfeld
                   ` (5 preceding siblings ...)
  2011-03-09 19:15 ` [RFC 6/8] x86, xsave: add support for non-lazy xstates Hans Rosenfeld
@ 2011-03-09 19:15 ` Hans Rosenfeld
  2011-03-09 19:15 ` [RFC 8/8] x86, xsave: remove lazy allocation of xstate area Hans Rosenfeld
  7 siblings, 0 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-03-09 19:15 UTC (permalink / raw)
  To: hpa, tglx, mingo
  Cc: linux-kernel, x86, brgerst, robert.richter, Andreas.Herrmann3,
	eranian, suresh.b.siddha, Hans Rosenfeld

This patch extends the xsave structure to support the LWP state. The
xstate feature bit for LWP is added to XCNTXT_NONLAZY, thereby enabling
kernel support for saving/restoring LWP state.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/include/asm/processor.h  |   12 ++++++++++++
 arch/x86/include/asm/sigcontext.h |   12 ++++++++++++
 arch/x86/include/asm/xsave.h      |    3 ++-
 3 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 4c25ab4..df2cbd4 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -353,6 +353,17 @@ struct ymmh_struct {
 	u32 ymmh_space[64];
 };
 
+struct lwp_struct {
+	u64 lwpcb_addr;
+	u32 flags;
+	u32 buf_head_offset;
+	u64 buf_base;
+	u32 buf_size;
+	u32 filters;
+	u64 saved_event_record[4];
+	u32 event_counter[16];
+};
+
 struct xsave_hdr_struct {
 	u64 xstate_bv;
 	u64 reserved1[2];
@@ -363,6 +374,7 @@ struct xsave_struct {
 	struct i387_fxsave_struct i387;
 	struct xsave_hdr_struct xsave_hdr;
 	struct ymmh_struct ymmh;
+	struct lwp_struct lwp;
 	/* new processor state extensions will go here */
 } __attribute__ ((packed, aligned (64)));
 
diff --git a/arch/x86/include/asm/sigcontext.h b/arch/x86/include/asm/sigcontext.h
index 04459d2..0a58b82 100644
--- a/arch/x86/include/asm/sigcontext.h
+++ b/arch/x86/include/asm/sigcontext.h
@@ -274,6 +274,17 @@ struct _ymmh_state {
 	__u32 ymmh_space[64];
 };
 
+struct _lwp_state {
+	__u64 lwpcb_addr;
+	__u32 flags;
+	__u32 buf_head_offset;
+	__u64 buf_base;
+	__u32 buf_size;
+	__u32 filters;
+	__u64 saved_event_record[4];
+	__u32 event_counter[16];
+};
+
 /*
  * Extended state pointed by the fpstate pointer in the sigcontext.
  * In addition to the fpstate, information encoded in the xstate_hdr
@@ -284,6 +295,7 @@ struct _xstate {
 	struct _fpstate fpstate;
 	struct _xsave_hdr xstate_hdr;
 	struct _ymmh_state ymmh;
+	struct _lwp_state lwp;
 	/* new processor state extensions go here */
 };
 
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
index 18401cc..a169115 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
@@ -9,6 +9,7 @@
 #define XSTATE_FP	0x1
 #define XSTATE_SSE	0x2
 #define XSTATE_YMM	0x4
+#define XSTATE_LWP	(1ULL << 62)
 
 #define XSTATE_FPSSE	(XSTATE_FP | XSTATE_SSE)
 
@@ -24,7 +25,7 @@
  * These are the features that the OS can handle currently.
  */
 #define XCNTXT_LAZY	(XSTATE_FP | XSTATE_SSE | XSTATE_YMM)
-#define XCNTXT_NONLAZY	0
+#define XCNTXT_NONLAZY	(XSTATE_LWP)
 
 #define XCNTXT_MASK	(XCNTXT_LAZY | XCNTXT_NONLAZY)
 
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC 8/8] x86, xsave: remove lazy allocation of xstate area
  2011-03-09 19:14 [RFC 0/8] rework of extended state handling, LWP support Hans Rosenfeld
                   ` (6 preceding siblings ...)
  2011-03-09 19:15 ` [RFC 7/8] x86, xsave: add kernel support for AMDs Lightweight Profiling (LWP) Hans Rosenfeld
@ 2011-03-09 19:15 ` Hans Rosenfeld
  2011-03-23 15:27   ` [RFC v2 0/8] x86, xsave: rework of extended state handling, LWP support Hans Rosenfeld
                     ` (8 more replies)
  7 siblings, 9 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-03-09 19:15 UTC (permalink / raw)
  To: hpa, tglx, mingo
  Cc: linux-kernel, x86, brgerst, robert.richter, Andreas.Herrmann3,
	eranian, suresh.b.siddha, Hans Rosenfeld

This patch completely removes lazy allocation of the xstate area. All
tasks will always have an xstate area preallocated, just like they
already do when non-lazy features are present. The size of the xsave
area ranges from 112 to 960 bytes, depending on the xstates present and
enabled. Since it is common to use SSE etc. for optimization, the actual
overhead is expected to negligible.

This removes some of the special-case handling of non-lazy xstates. It
also greatly simplifies init_fpu() by removing the allocation code, the
check for presence of the xstate area or init_fpu() return value.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/include/asm/i387.h   |   12 +++-------
 arch/x86/kernel/i387.c        |   46 +++++++++++-----------------------------
 arch/x86/kernel/traps.c       |   16 +------------
 arch/x86/kernel/xsave.c       |   21 ++----------------
 arch/x86/kvm/x86.c            |    4 +-
 arch/x86/math-emu/fpu_entry.c |    8 +-----
 6 files changed, 26 insertions(+), 81 deletions(-)

diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index b3b3f17..70136e3 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -40,7 +40,7 @@
 extern unsigned int sig_xstate_size;
 extern void fpu_init(void);
 extern void mxcsr_feature_mask_init(void);
-extern int init_fpu(struct task_struct *child);
+extern void init_fpu(struct task_struct *child);
 extern asmlinkage void math_state_restore(void);
 extern int dump_fpu(struct pt_regs *, struct user_i387_struct *);
 
@@ -337,13 +337,9 @@ extern void fpu_finit(struct fpu *fpu);
 
 static inline void fpu_clear(struct fpu *fpu)
 {
-	if (pcntxt_mask & XCNTXT_NONLAZY) {
-		memset(fpu->state, 0, xstate_size);
-		fpu_finit(fpu);
-		set_used_math();
-	} else {
-		fpu_free(fpu);
-	}
+	memset(fpu->state, 0, xstate_size);
+	fpu_finit(fpu);
+	set_used_math();
 }
 
 #endif /* __ASSEMBLY__ */
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
index 88fefba..32b3c8d 100644
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -42,6 +42,8 @@ void __cpuinit mxcsr_feature_mask_init(void)
 
 static void __cpuinit init_thread_xstate(void)
 {
+	static union thread_xstate x;
+
 	/*
 	 * Note that xstate_size might be overwriten later during
 	 * xsave_init().
@@ -62,6 +64,9 @@ static void __cpuinit init_thread_xstate(void)
 		xstate_size = sizeof(struct i387_fxsave_struct);
 	else
 		xstate_size = sizeof(struct i387_fsave_struct);
+
+	init_task.thread.fpu.state = &x;
+	fpu_finit(&init_task.thread.fpu);
 }
 
 /*
@@ -127,30 +132,20 @@ EXPORT_SYMBOL_GPL(fpu_finit);
  * value at reset if we support XMM instructions and then
  * remeber the current task has used the FPU.
  */
-int init_fpu(struct task_struct *tsk)
+void init_fpu(struct task_struct *tsk)
 {
-	int ret;
-
 	if (tsk_used_math(tsk)) {
 		if (HAVE_HWFP && tsk == current) {
 			preempt_disable();
 			save_xstates(tsk);
 			preempt_enable();
 		}
-		return 0;
+		return;
 	}
 
-	/*
-	 * Memory allocation at the first usage of the FPU and other state.
-	 */
-	ret = fpu_alloc(&tsk->thread.fpu);
-	if (ret)
-		return ret;
-
 	fpu_finit(&tsk->thread.fpu);
 
 	set_stopped_child_used_math(tsk);
-	return 0;
 }
 EXPORT_SYMBOL_GPL(init_fpu);
 
@@ -173,14 +168,10 @@ int xfpregs_get(struct task_struct *target, const struct user_regset *regset,
 		unsigned int pos, unsigned int count,
 		void *kbuf, void __user *ubuf)
 {
-	int ret;
-
 	if (!cpu_has_fxsr)
 		return -ENODEV;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	if (use_xsaveopt())
 		sanitize_i387_state(target);
@@ -198,9 +189,7 @@ int xfpregs_set(struct task_struct *target, const struct user_regset *regset,
 	if (!cpu_has_fxsr)
 		return -ENODEV;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	if (use_xsaveopt())
 		sanitize_i387_state(target);
@@ -232,9 +221,7 @@ int xstateregs_get(struct task_struct *target, const struct user_regset *regset,
 	if (!cpu_has_xsave)
 		return -ENODEV;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	/*
 	 * Copy the 48bytes defined by the software first into the xstate
@@ -262,9 +249,7 @@ int xstateregs_set(struct task_struct *target, const struct user_regset *regset,
 	if (!cpu_has_xsave)
 		return -ENODEV;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
 				 &target->thread.fpu.state->xsave, 0, -1);
@@ -427,11 +412,8 @@ int fpregs_get(struct task_struct *target, const struct user_regset *regset,
 	       void *kbuf, void __user *ubuf)
 {
 	struct user_i387_ia32_struct env;
-	int ret;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	if (!HAVE_HWFP)
 		return fpregs_soft_get(target, regset, pos, count, kbuf, ubuf);
@@ -462,9 +444,7 @@ int fpregs_set(struct task_struct *target, const struct user_regset *regset,
 	struct user_i387_ia32_struct env;
 	int ret;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	if (use_xsaveopt())
 		sanitize_i387_state(target);
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 872fc78..c8fbd04 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -734,20 +734,8 @@ asmlinkage void math_state_restore(void)
 	struct thread_info *thread = current_thread_info();
 	struct task_struct *tsk = thread->task;
 
-	if (!tsk_used_math(tsk)) {
-		local_irq_enable();
-		/*
-		 * does a slab alloc which can sleep
-		 */
-		if (init_fpu(tsk)) {
-			/*
-			 * ran out of memory!
-			 */
-			do_group_exit(SIGKILL);
-			return;
-		}
-		local_irq_disable();
-	}
+	if (!tsk_used_math(tsk))
+		init_fpu(tsk);
 
 	restore_xstates(tsk, XCNTXT_LAZY);
 }
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index d4050fa..78f7a1c 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -262,7 +262,6 @@ int restore_xstates_sigframe(void __user *buf, unsigned int size)
 	struct _fpstate_ia32 __user *fp = buf;
 	struct xsave_struct *xsave;
 	int xstate_invalid = 0;
-	int err;
 
 	if (!buf) {
 		if (used_math()) {
@@ -275,11 +274,8 @@ int restore_xstates_sigframe(void __user *buf, unsigned int size)
 	if (!access_ok(VERIFY_READ, buf, size))
 		return -EACCES;
 
-	if (!used_math()) {
-		err = init_fpu(tsk);
-		if (err)
-			return err;
-	}
+	if (!used_math())
+		init_fpu(tsk);
 
 	if (!HAVE_HWFP) {
 		set_used_math();
@@ -481,13 +477,8 @@ static void __init xstate_enable_boot_cpu(void)
 	       "cntxt size 0x%x\n",
 	       pcntxt_mask, xstate_size);
 
-	if (pcntxt_mask & XCNTXT_NONLAZY) {
-		static union thread_xstate x;
-
+	if (pcntxt_mask & XCNTXT_NONLAZY)
 		task_thread_info(&init_task)->xstate_mask |= XCNTXT_NONLAZY;
-		init_task.thread.fpu.state = &x;
-		fpu_finit(&init_task.thread.fpu);
-	}
 }
 
 /*
@@ -530,9 +521,6 @@ void save_xstates(struct task_struct *tsk)
 {
 	struct thread_info *ti = task_thread_info(tsk);
 
-	if (!fpu_allocated(&tsk->thread.fpu))
-		return;
-
 	xsave(&tsk->thread.fpu.state->xsave, ti->xstate_mask);
 
 	if (!(ti->xstate_mask & XCNTXT_LAZY))
@@ -566,9 +554,6 @@ void restore_xstates(struct task_struct *tsk, u64 mask)
 {
 	struct thread_info *ti = task_thread_info(tsk);
 
-	if (!fpu_allocated(&tsk->thread.fpu))
-		return;
-
 	xrstor(&tsk->thread.fpu.state->xsave, mask);
 
 	ti->xstate_mask |= mask;
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 10aeb04..bd71b12 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5377,8 +5377,8 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
 	int r;
 	sigset_t sigsaved;
 
-	if (!tsk_used_math(current) && init_fpu(current))
-		return -ENOMEM;
+	if (!tsk_used_math(current))
+		init_fpu(current);
 
 	if (vcpu->sigset_active)
 		sigprocmask(SIG_SETMASK, &vcpu->sigset, &sigsaved);
diff --git a/arch/x86/math-emu/fpu_entry.c b/arch/x86/math-emu/fpu_entry.c
index 7718541..472e2b9 100644
--- a/arch/x86/math-emu/fpu_entry.c
+++ b/arch/x86/math-emu/fpu_entry.c
@@ -147,12 +147,8 @@ void math_emulate(struct math_emu_info *info)
 	unsigned long code_limit = 0;	/* Initialized to stop compiler warnings */
 	struct desc_struct code_descriptor;
 
-	if (!used_math()) {
-		if (init_fpu(current)) {
-			do_group_exit(SIGKILL);
-			return;
-		}
-	}
+	if (!used_math())
+		init_fpu(current);
 
 #ifdef RE_ENTRANT_CHECKING
 	if (emulating) {
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC v2 0/8] x86, xsave: rework of extended state handling, LWP support
  2011-03-09 19:15 ` [RFC 8/8] x86, xsave: remove lazy allocation of xstate area Hans Rosenfeld
@ 2011-03-23 15:27   ` Hans Rosenfeld
  2011-03-23 15:27   ` [RFC v2 1/8] x86, xsave: cleanup fpu/xsave support Hans Rosenfeld
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-03-23 15:27 UTC (permalink / raw)
  To: hpa, tglx, mingo
  Cc: x86, linux-kernel, brgerst, suresh.b.siddha, eranian,
	robert.richter, Andreas.Herrmann3, Hans Rosenfeld

Changes since last patch set:
* fixed race in signal return path that could lead to xstate corruptions
* avoid LWP state inconsitency after signal return by disabling LWP
  when entering a signal handler


This patch set is a general cleanup and rework of the code related to
handling of FPU and other extended states.

All handling of extended states, including the FPU state, is now handled
by xsave/xrstor wrappers that fall back to fxsave/fxrstor, or even
fsave/frstor, if hardware support for those features is lacking.

Non-lazy xstates, which cannot be restored lazily, can now be easily
supported with almost no processing overhead. This makes adding basic
support for AMDs LWP almost trivial.

Since non-lazy xstates are inherently incompatible with lazy allocation
of the xstate area, the complete removal of lazy allocation to further
reduce code complexity should be considered. Since SSE-optimized library
functions are widely used today, most processes will have an xstate area
anyway, so the memory overhead wouldn't be big enough to be much of an
issue.


Hans Rosenfeld (8):
  x86, xsave: cleanup fpu/xsave support
  x86, xsave: rework fpu/xsave support
  x86, xsave: cleanup fpu/xsave signal frame setup
  x86, xsave: remove unused code
  x86, xsave: more cleanups
  x86, xsave: add support for non-lazy xstates
  x86, xsave: add kernel support for AMDs Lightweight Profiling (LWP)
  x86, xsave: remove lazy allocation of xstate area

 arch/x86/ia32/ia32_signal.c        |    4 +-
 arch/x86/include/asm/i387.h        |  243 ++++++++--------------------
 arch/x86/include/asm/msr-index.h   |    1 +
 arch/x86/include/asm/processor.h   |   12 ++
 arch/x86/include/asm/sigcontext.h  |   12 ++
 arch/x86/include/asm/thread_info.h |    4 +-
 arch/x86/include/asm/xsave.h       |  100 +++----------
 arch/x86/kernel/i387.c             |  310 ++++--------------------------------
 arch/x86/kernel/process_32.c       |   29 ++---
 arch/x86/kernel/process_64.c       |   28 +---
 arch/x86/kernel/signal.c           |    4 +-
 arch/x86/kernel/traps.c            |   47 +-----
 arch/x86/kernel/xsave.c            |  311 +++++++++++++++++++++++-------------
 arch/x86/kvm/vmx.c                 |    2 +-
 arch/x86/kvm/x86.c                 |   11 +-
 arch/x86/math-emu/fpu_entry.c      |    8 +-
 drivers/lguest/x86/core.c          |    2 +-
 17 files changed, 380 insertions(+), 748 deletions(-)



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC v2 1/8] x86, xsave: cleanup fpu/xsave support
  2011-03-09 19:15 ` [RFC 8/8] x86, xsave: remove lazy allocation of xstate area Hans Rosenfeld
  2011-03-23 15:27   ` [RFC v2 0/8] x86, xsave: rework of extended state handling, LWP support Hans Rosenfeld
@ 2011-03-23 15:27   ` Hans Rosenfeld
  2011-03-23 15:27   ` [RFC v2 2/8] x86, xsave: rework " Hans Rosenfeld
                     ` (6 subsequent siblings)
  8 siblings, 0 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-03-23 15:27 UTC (permalink / raw)
  To: hpa, tglx, mingo
  Cc: x86, linux-kernel, brgerst, suresh.b.siddha, eranian,
	robert.richter, Andreas.Herrmann3, Hans Rosenfeld

Removed the functions fpu_fxrstor_checking() and restore_fpu_checking()
because they weren't doing anything. Removed redundant xsave/xrstor
implementations. Since xsave/xrstor is not specific to the FPU, and also
for consistency, all xsave/xrstor functions now take a xsave_struct
argument.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/include/asm/i387.h  |   20 +++-------
 arch/x86/include/asm/xsave.h |   81 +++++++++++++++---------------------------
 arch/x86/kernel/traps.c      |    2 +-
 arch/x86/kernel/xsave.c      |    4 +-
 4 files changed, 38 insertions(+), 69 deletions(-)

diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index ef32890..d908383 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -227,12 +227,14 @@ static inline void fpu_fxsave(struct fpu *fpu)
 static inline void fpu_save_init(struct fpu *fpu)
 {
 	if (use_xsave()) {
-		fpu_xsave(fpu);
+		struct xsave_struct *xstate = &fpu->state->xsave;
+
+		fpu_xsave(xstate);
 
 		/*
 		 * xsave header may indicate the init state of the FP.
 		 */
-		if (!(fpu->state->xsave.xsave_hdr.xstate_bv & XSTATE_FP))
+		if (!(xstate->xsave_hdr.xstate_bv & XSTATE_FP))
 			return;
 	} else if (use_fxsr()) {
 		fpu_fxsave(fpu);
@@ -262,22 +264,12 @@ static inline void __save_init_fpu(struct task_struct *tsk)
 	task_thread_info(tsk)->status &= ~TS_USEDFPU;
 }
 
-static inline int fpu_fxrstor_checking(struct fpu *fpu)
-{
-	return fxrstor_checking(&fpu->state->fxsave);
-}
-
 static inline int fpu_restore_checking(struct fpu *fpu)
 {
 	if (use_xsave())
-		return fpu_xrstor_checking(fpu);
+		return xrstor_checking(&fpu->state->xsave, -1);
 	else
-		return fpu_fxrstor_checking(fpu);
-}
-
-static inline int restore_fpu_checking(struct task_struct *tsk)
-{
-	return fpu_restore_checking(&tsk->thread.fpu);
+		return fxrstor_checking(&fpu->state->fxsave);
 }
 
 /*
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
index c6ce245..8bcbbce 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
@@ -42,10 +42,11 @@ extern int check_for_xstate(struct i387_fxsave_struct __user *buf,
 			    void __user *fpstate,
 			    struct _fpx_sw_bytes *sw);
 
-static inline int fpu_xrstor_checking(struct fpu *fpu)
+static inline int xrstor_checking(struct xsave_struct *fx, u64 mask)
 {
-	struct xsave_struct *fx = &fpu->state->xsave;
 	int err;
+	u32 lmask = mask;
+	u32 hmask = mask >> 32;
 
 	asm volatile("1: .byte " REX_PREFIX "0x0f,0xae,0x2f\n\t"
 		     "2:\n"
@@ -55,13 +56,23 @@ static inline int fpu_xrstor_checking(struct fpu *fpu)
 		     ".previous\n"
 		     _ASM_EXTABLE(1b, 3b)
 		     : [err] "=r" (err)
-		     : "D" (fx), "m" (*fx), "a" (-1), "d" (-1), "0" (0)
+		     : "D" (fx), "m" (*fx), "a" (lmask), "d" (hmask), "0" (0)
 		     : "memory");
 
 	return err;
 }
 
-static inline int xsave_user(struct xsave_struct __user *buf)
+static inline void xrstor_state(struct xsave_struct *fx, u64 mask)
+{
+	u32 lmask = mask;
+	u32 hmask = mask >> 32;
+
+	asm volatile(".byte " REX_PREFIX "0x0f,0xae,0x2f\n\t"
+		     : : "D" (fx), "m" (*fx), "a" (lmask), "d" (hmask)
+		     :   "memory");
+}
+
+static inline int xsave_checking(struct xsave_struct __user *buf)
 {
 	int err;
 
@@ -74,58 +85,24 @@ static inline int xsave_user(struct xsave_struct __user *buf)
 	if (unlikely(err))
 		return -EFAULT;
 
-	__asm__ __volatile__("1: .byte " REX_PREFIX "0x0f,0xae,0x27\n"
-			     "2:\n"
-			     ".section .fixup,\"ax\"\n"
-			     "3:  movl $-1,%[err]\n"
-			     "    jmp  2b\n"
-			     ".previous\n"
-			     ".section __ex_table,\"a\"\n"
-			     _ASM_ALIGN "\n"
-			     _ASM_PTR "1b,3b\n"
-			     ".previous"
-			     : [err] "=r" (err)
-			     : "D" (buf), "a" (-1), "d" (-1), "0" (0)
-			     : "memory");
+	asm volatile("1: .byte " REX_PREFIX "0x0f,0xae,0x27\n"
+		     "2:\n"
+		     ".section .fixup,\"ax\"\n"
+		     "3:  movl $-1,%[err]\n"
+		     "    jmp  2b\n"
+		     ".previous\n"
+		     _ASM_EXTABLE(1b,3b)
+		     : [err] "=r" (err)
+		     : "D" (buf), "a" (-1), "d" (-1), "0" (0)
+		     : "memory");
+
 	if (unlikely(err) && __clear_user(buf, xstate_size))
 		err = -EFAULT;
-	/* No need to clear here because the caller clears USED_MATH */
-	return err;
-}
-
-static inline int xrestore_user(struct xsave_struct __user *buf, u64 mask)
-{
-	int err;
-	struct xsave_struct *xstate = ((__force struct xsave_struct *)buf);
-	u32 lmask = mask;
-	u32 hmask = mask >> 32;
 
-	__asm__ __volatile__("1: .byte " REX_PREFIX "0x0f,0xae,0x2f\n"
-			     "2:\n"
-			     ".section .fixup,\"ax\"\n"
-			     "3:  movl $-1,%[err]\n"
-			     "    jmp  2b\n"
-			     ".previous\n"
-			     ".section __ex_table,\"a\"\n"
-			     _ASM_ALIGN "\n"
-			     _ASM_PTR "1b,3b\n"
-			     ".previous"
-			     : [err] "=r" (err)
-			     : "D" (xstate), "a" (lmask), "d" (hmask), "0" (0)
-			     : "memory");	/* memory required? */
+	/* No need to clear here because the caller clears USED_MATH */
 	return err;
 }
 
-static inline void xrstor_state(struct xsave_struct *fx, u64 mask)
-{
-	u32 lmask = mask;
-	u32 hmask = mask >> 32;
-
-	asm volatile(".byte " REX_PREFIX "0x0f,0xae,0x2f\n\t"
-		     : : "D" (fx), "m" (*fx), "a" (lmask), "d" (hmask)
-		     :   "memory");
-}
-
 static inline void xsave_state(struct xsave_struct *fx, u64 mask)
 {
 	u32 lmask = mask;
@@ -136,7 +113,7 @@ static inline void xsave_state(struct xsave_struct *fx, u64 mask)
 		     :   "memory");
 }
 
-static inline void fpu_xsave(struct fpu *fpu)
+static inline void fpu_xsave(struct xsave_struct *fx)
 {
 	/* This, however, we can work around by forcing the compiler to select
 	   an addressing mode that doesn't require extended registers. */
@@ -144,7 +121,7 @@ static inline void fpu_xsave(struct fpu *fpu)
 		".byte " REX_PREFIX "0x0f,0xae,0x27",
 		".byte " REX_PREFIX "0x0f,0xae,0x37",
 		X86_FEATURE_XSAVEOPT,
-		[fx] "D" (&fpu->state->xsave), "a" (-1), "d" (-1) :
+		[fx] "D" (fx), "a" (-1), "d" (-1) :
 		"memory");
 }
 #endif
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index b9b6716..32f3043 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -728,7 +728,7 @@ void __math_state_restore(void)
 	/*
 	 * Paranoid restore. send a SIGSEGV if we fail to restore the state.
 	 */
-	if (unlikely(restore_fpu_checking(tsk))) {
+	if (unlikely(fpu_restore_checking(&tsk->thread.fpu))) {
 		stts();
 		force_sig(SIGSEGV, tsk);
 		return;
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index 5471285..e204b07 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -170,7 +170,7 @@ int save_i387_xstate(void __user *buf)
 
 	if (task_thread_info(tsk)->status & TS_USEDFPU) {
 		if (use_xsave())
-			err = xsave_user(buf);
+			err = xsave_checking(buf);
 		else
 			err = fxsave_user(buf);
 
@@ -247,7 +247,7 @@ static int restore_user_xstate(void __user *buf)
 	/*
 	 * restore the state passed by the user.
 	 */
-	err = xrestore_user(buf, mask);
+	err = xrstor_checking((__force struct xsave_struct *)buf, mask);
 	if (err)
 		return err;
 
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC v2 2/8] x86, xsave: rework fpu/xsave support
  2011-03-09 19:15 ` [RFC 8/8] x86, xsave: remove lazy allocation of xstate area Hans Rosenfeld
  2011-03-23 15:27   ` [RFC v2 0/8] x86, xsave: rework of extended state handling, LWP support Hans Rosenfeld
  2011-03-23 15:27   ` [RFC v2 1/8] x86, xsave: cleanup fpu/xsave support Hans Rosenfeld
@ 2011-03-23 15:27   ` Hans Rosenfeld
  2011-03-23 15:27   ` [RFC v2 3/8] x86, xsave: cleanup fpu/xsave signal frame setup Hans Rosenfeld
                     ` (5 subsequent siblings)
  8 siblings, 0 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-03-23 15:27 UTC (permalink / raw)
  To: hpa, tglx, mingo
  Cc: x86, linux-kernel, brgerst, suresh.b.siddha, eranian,
	robert.richter, Andreas.Herrmann3, Hans Rosenfeld

This is a complete rework of the code that handles FPU and related
extended states. Since FPU, XMM and YMM states are just variants of what
xsave handles, all of the old FPU-specific state handling code will be
hidden behind a set of functions that resemble xsave and xrstor. For
hardware that does not support xsave, the code falls back to
fxsave/fxrstor or even fsave/frstor.

A xstate_mask member will be added to the thread_info structure that
will control which states are to be saved by xsave. It is set to include
all "lazy" states (that is, all states currently supported: FPU, XMM and
YMM) by the #NM handler when a lazy restore is triggered or by
switch_to() when the tasks FPU context is preloaded. Xstate_mask is
intended to completely replace TS_USEDFPU in a later cleanup patch.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/include/asm/i387.h        |   44 +++++++++++++++++++---
 arch/x86/include/asm/thread_info.h |    2 +
 arch/x86/include/asm/xsave.h       |   14 ++++++-
 arch/x86/kernel/i387.c             |   11 ++++--
 arch/x86/kernel/process_32.c       |   27 +++++---------
 arch/x86/kernel/process_64.c       |   26 ++++----------
 arch/x86/kernel/traps.c            |   11 +++---
 arch/x86/kernel/xsave.c            |   71 ++++++++++++++++++++++++++++++++++++
 arch/x86/kvm/x86.c                 |    7 ++--
 drivers/lguest/x86/core.c          |    2 +-
 10 files changed, 158 insertions(+), 57 deletions(-)

diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index d908383..939af08 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -224,12 +224,46 @@ static inline void fpu_fxsave(struct fpu *fpu)
 /*
  * These must be called with preempt disabled
  */
+static inline void fpu_restore(struct fpu *fpu)
+{
+	fxrstor_checking(&fpu->state->fxsave);
+}
+
+static inline void fpu_save(struct fpu *fpu)
+{
+	if (use_fxsr()) {
+		fpu_fxsave(fpu);
+	} else {
+		asm volatile("fsave %[fx]; fwait"
+			     : [fx] "=m" (fpu->state->fsave));
+	}
+}
+
+static inline void fpu_clean(struct fpu *fpu)
+{
+	u32 swd = (use_fxsr() || use_xsave()) ?
+		fpu->state->fxsave.swd : fpu->state->fsave.swd;
+
+	if (unlikely(swd & X87_FSW_ES))
+		asm volatile("fnclex");
+
+	/* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
+	   is pending.  Clear the x87 state here by setting it to fixed
+	   values. safe_address is a random variable that should be in L1 */
+	alternative_input(
+		ASM_NOP8 ASM_NOP2,
+		"emms\n\t"	  	/* clear stack tags */
+		"fildl %P[addr]",	/* set F?P to defined value */
+		X86_FEATURE_FXSAVE_LEAK,
+		[addr] "m" (safe_address));
+}
+
 static inline void fpu_save_init(struct fpu *fpu)
 {
 	if (use_xsave()) {
 		struct xsave_struct *xstate = &fpu->state->xsave;
 
-		fpu_xsave(xstate);
+		fpu_xsave(xstate, -1);
 
 		/*
 		 * xsave header may indicate the init state of the FP.
@@ -295,18 +329,16 @@ static inline void __clear_fpu(struct task_struct *tsk)
 			     "2:\n"
 			     _ASM_EXTABLE(1b, 2b));
 		task_thread_info(tsk)->status &= ~TS_USEDFPU;
+		task_thread_info(tsk)->xstate_mask &= ~XCNTXT_LAZY;
 		stts();
 	}
 }
 
 static inline void kernel_fpu_begin(void)
 {
-	struct thread_info *me = current_thread_info();
 	preempt_disable();
-	if (me->status & TS_USEDFPU)
-		__save_init_fpu(me->task);
-	else
-		clts();
+	save_xstates(current_thread_info()->task);
+	clts();
 }
 
 static inline void kernel_fpu_end(void)
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index f0b6e5d..5c92d21 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -26,6 +26,7 @@ struct exec_domain;
 struct thread_info {
 	struct task_struct	*task;		/* main task structure */
 	struct exec_domain	*exec_domain;	/* execution domain */
+	__u64			xstate_mask;	/* xstates in use */
 	__u32			flags;		/* low level flags */
 	__u32			status;		/* thread synchronous flags */
 	__u32			cpu;		/* current CPU */
@@ -47,6 +48,7 @@ struct thread_info {
 {						\
 	.task		= &tsk,			\
 	.exec_domain	= &default_exec_domain,	\
+	.xstate_mask	= 0,			\
 	.flags		= 0,			\
 	.cpu		= 0,			\
 	.preempt_count	= INIT_PREEMPT_COUNT,	\
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
index 8bcbbce..6052a84 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
@@ -25,6 +25,8 @@
  */
 #define XCNTXT_MASK	(XSTATE_FP | XSTATE_SSE | XSTATE_YMM)
 
+#define XCNTXT_LAZY	XCNTXT_MASK
+
 #ifdef CONFIG_X86_64
 #define REX_PREFIX	"0x48, "
 #else
@@ -35,6 +37,11 @@ extern unsigned int xstate_size;
 extern u64 pcntxt_mask;
 extern u64 xstate_fx_sw_bytes[USER_XSTATE_FX_SW_WORDS];
 
+extern void xsave(struct fpu *, u64);
+extern void xrstor(struct fpu *, u64);
+extern void save_xstates(struct task_struct *);
+extern void restore_xstates(struct task_struct *, u64);
+
 extern void xsave_init(void);
 extern void update_regset_xstate_info(unsigned int size, u64 xstate_mask);
 extern int init_fpu(struct task_struct *child);
@@ -113,15 +120,18 @@ static inline void xsave_state(struct xsave_struct *fx, u64 mask)
 		     :   "memory");
 }
 
-static inline void fpu_xsave(struct xsave_struct *fx)
+static inline void fpu_xsave(struct xsave_struct *fx, u64 mask)
 {
+	u32 lmask = mask;
+	u32 hmask = mask >> 32;
+
 	/* This, however, we can work around by forcing the compiler to select
 	   an addressing mode that doesn't require extended registers. */
 	alternative_input(
 		".byte " REX_PREFIX "0x0f,0xae,0x27",
 		".byte " REX_PREFIX "0x0f,0xae,0x37",
 		X86_FEATURE_XSAVEOPT,
-		[fx] "D" (fx), "a" (-1), "d" (-1) :
+		[fx] "D" (fx), "a" (lmask), "d" (hmask) :
 		"memory");
 }
 #endif
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
index e60c38c..5ab66ec 100644
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -152,8 +152,11 @@ int init_fpu(struct task_struct *tsk)
 	int ret;
 
 	if (tsk_used_math(tsk)) {
-		if (HAVE_HWFP && tsk == current)
-			unlazy_fpu(tsk);
+		if (HAVE_HWFP && tsk == current) {
+			preempt_disable();
+			save_xstates(tsk);
+			preempt_enable();
+		}
 		return 0;
 	}
 
@@ -600,7 +603,9 @@ int save_i387_xstate_ia32(void __user *buf)
 				       NULL, fp) ? -1 : 1;
 	}
 
-	unlazy_fpu(tsk);
+	preempt_disable();
+	save_xstates(tsk);
+	preempt_enable();
 
 	if (cpu_has_xsave)
 		return save_i387_xsave(fp);
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 8d12878..8df07c3 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -185,7 +185,9 @@ void release_thread(struct task_struct *dead_task)
  */
 void prepare_to_copy(struct task_struct *tsk)
 {
-	unlazy_fpu(tsk);
+	preempt_disable();
+	save_xstates(tsk);
+	preempt_enable();
 }
 
 int copy_thread(unsigned long clone_flags, unsigned long sp,
@@ -294,21 +296,13 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 				 *next = &next_p->thread;
 	int cpu = smp_processor_id();
 	struct tss_struct *tss = &per_cpu(init_tss, cpu);
-	bool preload_fpu;
 
 	/* never put a printk in __switch_to... printk() calls wake_up*() indirectly */
 
-	/*
-	 * If the task has used fpu the last 5 timeslices, just do a full
-	 * restore of the math state immediately to avoid the trap; the
-	 * chances of needing FPU soon are obviously high now
-	 */
-	preload_fpu = tsk_used_math(next_p) && next_p->fpu_counter > 5;
-
-	__unlazy_fpu(prev_p);
+	save_xstates(prev_p);
 
 	/* we're going to use this soon, after a few expensive things */
-	if (preload_fpu)
+	if (task_thread_info(next_p)->xstate_mask)
 		prefetch(next->fpu.state);
 
 	/*
@@ -349,11 +343,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 		     task_thread_info(next_p)->flags & _TIF_WORK_CTXSW_NEXT))
 		__switch_to_xtra(prev_p, next_p, tss);
 
-	/* If we're going to preload the fpu context, make sure clts
-	   is run while we're batching the cpu state updates. */
-	if (preload_fpu)
-		clts();
-
 	/*
 	 * Leave lazy mode, flushing any hypercalls made here.
 	 * This must be done before restoring TLS segments so
@@ -363,8 +352,10 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 	 */
 	arch_end_context_switch(next_p);
 
-	if (preload_fpu)
-		__math_state_restore();
+	/*
+	 * Restore enabled extended states for the task.
+	 */
+	restore_xstates(next_p, task_thread_info(next_p)->xstate_mask);
 
 	/*
 	 * Restore %gs if needed (which is common)
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index bd387e8..67c5838 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -249,7 +249,9 @@ static inline u32 read_32bit_tls(struct task_struct *t, int tls)
  */
 void prepare_to_copy(struct task_struct *tsk)
 {
-	unlazy_fpu(tsk);
+	preempt_disable();
+	save_xstates(tsk);
+	preempt_enable();
 }
 
 int copy_thread(unsigned long clone_flags, unsigned long sp,
@@ -378,17 +380,9 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 	int cpu = smp_processor_id();
 	struct tss_struct *tss = &per_cpu(init_tss, cpu);
 	unsigned fsindex, gsindex;
-	bool preload_fpu;
-
-	/*
-	 * If the task has used fpu the last 5 timeslices, just do a full
-	 * restore of the math state immediately to avoid the trap; the
-	 * chances of needing FPU soon are obviously high now
-	 */
-	preload_fpu = tsk_used_math(next_p) && next_p->fpu_counter > 5;
 
 	/* we're going to use this soon, after a few expensive things */
-	if (preload_fpu)
+	if (task_thread_info(next_p)->xstate_mask)
 		prefetch(next->fpu.state);
 
 	/*
@@ -420,11 +414,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 	load_TLS(next, cpu);
 
 	/* Must be after DS reload */
-	__unlazy_fpu(prev_p);
-
-	/* Make sure cpu is ready for new context */
-	if (preload_fpu)
-		clts();
+	save_xstates(prev_p);
 
 	/*
 	 * Leave lazy mode, flushing any hypercalls made here.
@@ -485,11 +475,9 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 		__switch_to_xtra(prev_p, next_p, tss);
 
 	/*
-	 * Preload the FPU context, now that we've determined that the
-	 * task is likely to be using it. 
+	 * Restore enabled extended states for the task.
 	 */
-	if (preload_fpu)
-		__math_state_restore();
+	restore_xstates(next_p, task_thread_info(next_p)->xstate_mask);
 
 	return prev_p;
 }
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 32f3043..072c30e 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -625,7 +625,10 @@ void math_error(struct pt_regs *regs, int error_code, int trapnr)
 	/*
 	 * Save the info for the exception handler and clear the error.
 	 */
-	save_init_fpu(task);
+	preempt_disable();
+	save_xstates(task);
+	preempt_enable();
+
 	task->thread.trap_no = trapnr;
 	task->thread.error_code = error_code;
 	info.si_signo = SIGFPE;
@@ -734,7 +737,7 @@ void __math_state_restore(void)
 		return;
 	}
 
-	thread->status |= TS_USEDFPU;	/* So we fnsave on switch_to() */
+	thread->status |= TS_USEDFPU;   /* So we fnsave on switch_to() */
 	tsk->fpu_counter++;
 }
 
@@ -768,9 +771,7 @@ asmlinkage void math_state_restore(void)
 		local_irq_disable();
 	}
 
-	clts();				/* Allow maths ops (or we recurse) */
-
-	__math_state_restore();
+	restore_xstates(tsk, XCNTXT_LAZY);
 }
 EXPORT_SYMBOL_GPL(math_state_restore);
 
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index e204b07..c422527 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -5,6 +5,7 @@
  */
 #include <linux/bootmem.h>
 #include <linux/compat.h>
+#include <linux/module.h>
 #include <asm/i387.h>
 #ifdef CONFIG_IA32_EMULATION
 #include <asm/sigcontext32.h>
@@ -474,3 +475,73 @@ void __cpuinit xsave_init(void)
 	next_func = xstate_enable;
 	this_func();
 }
+
+void xsave(struct fpu *fpu, u64 mask)
+{
+	clts();
+
+	if (use_xsave())
+		fpu_xsave(&fpu->state->xsave, mask);
+	else if (mask & XCNTXT_LAZY)
+		fpu_save(fpu);
+
+	if (mask & XCNTXT_LAZY)
+		fpu_clean(fpu);
+
+	stts();
+}
+EXPORT_SYMBOL(xsave);
+
+void save_xstates(struct task_struct *tsk)
+{
+	struct thread_info *ti = task_thread_info(tsk);
+
+	if (!fpu_allocated(&tsk->thread.fpu))
+		return;
+
+	xsave(&tsk->thread.fpu, ti->xstate_mask);
+
+	if (!(ti->xstate_mask & XCNTXT_LAZY))
+		tsk->fpu_counter = 0;
+
+	/*
+	 * If the task hasn't used the fpu the last 5 timeslices,
+	 * force a lazy restore of the math states by clearing them
+	 * from xstate_mask.
+	 */
+	if (tsk->fpu_counter < 5)
+		ti->xstate_mask &= ~XCNTXT_LAZY;
+
+	ti->status &= ~TS_USEDFPU;
+}
+EXPORT_SYMBOL(save_xstates);
+
+void xrstor(struct fpu *fpu, u64 mask)
+{
+	clts();
+
+	if (use_xsave())
+		xrstor_state(&fpu->state->xsave, mask);
+	else if (mask & XCNTXT_LAZY)
+		fpu_restore(fpu);
+
+	if (!(mask & XCNTXT_LAZY))
+		stts();
+}
+EXPORT_SYMBOL(xrstor);
+
+void restore_xstates(struct task_struct *tsk, u64 mask)
+{
+	struct thread_info *ti = task_thread_info(tsk);
+
+	if (!fpu_allocated(&tsk->thread.fpu))
+		return;
+
+	xrstor(&tsk->thread.fpu, mask);
+
+	ti->xstate_mask |= mask;
+	ti->status |= TS_USEDFPU;
+	if (mask & XCNTXT_LAZY)
+		tsk->fpu_counter++;
+}
+EXPORT_SYMBOL(restore_xstates);
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index bcc0efc..8fb21ea 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -58,6 +58,7 @@
 #include <asm/xcr.h>
 #include <asm/pvclock.h>
 #include <asm/div64.h>
+#include <asm/xsave.h>
 
 #define MAX_IO_MSRS 256
 #define CR0_RESERVED_BITS						\
@@ -5793,8 +5794,8 @@ void kvm_load_guest_fpu(struct kvm_vcpu *vcpu)
 	 */
 	kvm_put_guest_xcr0(vcpu);
 	vcpu->guest_fpu_loaded = 1;
-	unlazy_fpu(current);
-	fpu_restore_checking(&vcpu->arch.guest_fpu);
+	save_xstates(current);
+	xrstor(&vcpu->arch.guest_fpu, -1);
 	trace_kvm_fpu(1);
 }
 
@@ -5806,7 +5807,7 @@ void kvm_put_guest_fpu(struct kvm_vcpu *vcpu)
 		return;
 
 	vcpu->guest_fpu_loaded = 0;
-	fpu_save_init(&vcpu->arch.guest_fpu);
+	xsave(&vcpu->arch.guest_fpu, -1);
 	++vcpu->stat.fpu_reload;
 	kvm_make_request(KVM_REQ_DEACTIVATE_FPU, vcpu);
 	trace_kvm_fpu(0);
diff --git a/drivers/lguest/x86/core.c b/drivers/lguest/x86/core.c
index 9f1659c..ef62289 100644
--- a/drivers/lguest/x86/core.c
+++ b/drivers/lguest/x86/core.c
@@ -204,7 +204,7 @@ void lguest_arch_run_guest(struct lg_cpu *cpu)
 	 * uses the FPU.
 	 */
 	if (cpu->ts)
-		unlazy_fpu(current);
+		save_xstates(current);
 
 	/*
 	 * SYSENTER is an optimized way of doing system calls.  We can't allow
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC v2 3/8] x86, xsave: cleanup fpu/xsave signal frame setup
  2011-03-09 19:15 ` [RFC 8/8] x86, xsave: remove lazy allocation of xstate area Hans Rosenfeld
                     ` (2 preceding siblings ...)
  2011-03-23 15:27   ` [RFC v2 2/8] x86, xsave: rework " Hans Rosenfeld
@ 2011-03-23 15:27   ` Hans Rosenfeld
  2011-03-23 15:27   ` [RFC v2 4/8] x86, xsave: remove unused code Hans Rosenfeld
                     ` (4 subsequent siblings)
  8 siblings, 0 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-03-23 15:27 UTC (permalink / raw)
  To: hpa, tglx, mingo
  Cc: x86, linux-kernel, brgerst, suresh.b.siddha, eranian,
	robert.richter, Andreas.Herrmann3, Hans Rosenfeld

There are currently two code paths that handle the fpu/xsave context in
a signal frame for 32bit and 64bit tasks. These two code paths differ
only in that they have or lack certain micro-optimizations or do some
additional work (fsave compatibility for 32bit). The code is complex,
mostly duplicate and hard to understand and maintain.

This patch creates a set of two new, unified and cleaned up functions to
replace them. Besides avoiding the duplicate code, it is now obvious
what is done in which situations. The micro-optimization w.r.t xsave
(saving and restoring directly from the user buffer) is gone, and with
it the headaches caused by it about validating the buffer alignment and
contents and catching possible xsave/xrstor faults.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/ia32/ia32_signal.c  |    4 +-
 arch/x86/include/asm/i387.h  |   20 ++++
 arch/x86/include/asm/xsave.h |    4 +-
 arch/x86/kernel/i387.c       |   32 ++------
 arch/x86/kernel/signal.c     |    4 +-
 arch/x86/kernel/xsave.c      |  197 ++++++++++++++++++++++++++++++++++++++++--
 6 files changed, 225 insertions(+), 36 deletions(-)

diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c
index 588a7aa..2605fae 100644
--- a/arch/x86/ia32/ia32_signal.c
+++ b/arch/x86/ia32/ia32_signal.c
@@ -255,7 +255,7 @@ static int ia32_restore_sigcontext(struct pt_regs *regs,
 
 		get_user_ex(tmp, &sc->fpstate);
 		buf = compat_ptr(tmp);
-		err |= restore_i387_xstate_ia32(buf);
+		err |= restore_xstates_sigframe(buf, sig_xstate_ia32_size);
 
 		get_user_ex(*pax, &sc->ax);
 	} get_user_catch(err);
@@ -396,7 +396,7 @@ static void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
 	if (used_math()) {
 		sp = sp - sig_xstate_ia32_size;
 		*fpstate = (struct _fpstate_ia32 *) sp;
-		if (save_i387_xstate_ia32(*fpstate) < 0)
+		if (save_xstates_sigframe(*fpstate, sig_xstate_ia32_size) < 0)
 			return (void __user *) -1L;
 	}
 
diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index 939af08..30930bf 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -25,6 +25,20 @@
 #include <asm/uaccess.h>
 #include <asm/xsave.h>
 
+#ifdef CONFIG_X86_64
+# include <asm/sigcontext32.h>
+# include <asm/user32.h>
+#else
+# define save_i387_xstate_ia32		save_i387_xstate
+# define restore_i387_xstate_ia32	restore_i387_xstate
+# define _fpstate_ia32		_fpstate
+# define _xstate_ia32		_xstate
+# define sig_xstate_ia32_size   sig_xstate_size
+# define fx_sw_reserved_ia32	fx_sw_reserved
+# define user_i387_ia32_struct	user_i387_struct
+# define user32_fxsr_struct	user_fxsr_struct
+#endif
+
 extern unsigned int sig_xstate_size;
 extern void fpu_init(void);
 extern void mxcsr_feature_mask_init(void);
@@ -33,6 +47,9 @@ extern asmlinkage void math_state_restore(void);
 extern void __math_state_restore(void);
 extern int dump_fpu(struct pt_regs *, struct user_i387_struct *);
 
+extern void convert_from_fxsr(struct user_i387_ia32_struct *, struct task_struct *);
+extern void convert_to_fxsr(struct task_struct *, const struct user_i387_ia32_struct *);
+
 extern user_regset_active_fn fpregs_active, xfpregs_active;
 extern user_regset_get_fn fpregs_get, xfpregs_get, fpregs_soft_get,
 				xstateregs_get;
@@ -46,6 +63,7 @@ extern user_regset_set_fn fpregs_set, xfpregs_set, fpregs_soft_set,
 #define xstateregs_active	fpregs_active
 
 extern struct _fpx_sw_bytes fx_sw_reserved;
+extern unsigned int mxcsr_feature_mask;
 #ifdef CONFIG_IA32_EMULATION
 extern unsigned int sig_xstate_ia32_size;
 extern struct _fpx_sw_bytes fx_sw_reserved_ia32;
@@ -56,8 +74,10 @@ extern int restore_i387_xstate_ia32(void __user *buf);
 #endif
 
 #ifdef CONFIG_MATH_EMULATION
+# define HAVE_HWFP		(boot_cpu_data.hard_math)
 extern void finit_soft_fpu(struct i387_soft_struct *soft);
 #else
+# define HAVE_HWFP		1
 static inline void finit_soft_fpu(struct i387_soft_struct *soft) {}
 #endif
 
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
index 6052a84..200c56d 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
@@ -41,12 +41,14 @@ extern void xsave(struct fpu *, u64);
 extern void xrstor(struct fpu *, u64);
 extern void save_xstates(struct task_struct *);
 extern void restore_xstates(struct task_struct *, u64);
+extern int save_xstates_sigframe(void __user *, unsigned int);
+extern int restore_xstates_sigframe(void __user *, unsigned int);
 
 extern void xsave_init(void);
 extern void update_regset_xstate_info(unsigned int size, u64 xstate_mask);
 extern int init_fpu(struct task_struct *child);
 extern int check_for_xstate(struct i387_fxsave_struct __user *buf,
-			    void __user *fpstate,
+			    unsigned int size,
 			    struct _fpx_sw_bytes *sw);
 
 static inline int xrstor_checking(struct xsave_struct *fx, u64 mask)
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
index 5ab66ec..5cec7c2 100644
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -18,27 +18,7 @@
 #include <asm/i387.h>
 #include <asm/user.h>
 
-#ifdef CONFIG_X86_64
-# include <asm/sigcontext32.h>
-# include <asm/user32.h>
-#else
-# define save_i387_xstate_ia32		save_i387_xstate
-# define restore_i387_xstate_ia32	restore_i387_xstate
-# define _fpstate_ia32		_fpstate
-# define _xstate_ia32		_xstate
-# define sig_xstate_ia32_size   sig_xstate_size
-# define fx_sw_reserved_ia32	fx_sw_reserved
-# define user_i387_ia32_struct	user_i387_struct
-# define user32_fxsr_struct	user_fxsr_struct
-#endif
-
-#ifdef CONFIG_MATH_EMULATION
-# define HAVE_HWFP		(boot_cpu_data.hard_math)
-#else
-# define HAVE_HWFP		1
-#endif
-
-static unsigned int		mxcsr_feature_mask __read_mostly = 0xffffffffu;
+unsigned int mxcsr_feature_mask __read_mostly = 0xffffffffu;
 unsigned int xstate_size;
 EXPORT_SYMBOL_GPL(xstate_size);
 unsigned int sig_xstate_ia32_size = sizeof(struct _fpstate_ia32);
@@ -375,7 +355,7 @@ static inline u32 twd_fxsr_to_i387(struct i387_fxsave_struct *fxsave)
  * FXSR floating point environment conversions.
  */
 
-static void
+void
 convert_from_fxsr(struct user_i387_ia32_struct *env, struct task_struct *tsk)
 {
 	struct i387_fxsave_struct *fxsave = &tsk->thread.fpu.state->fxsave;
@@ -412,8 +392,8 @@ convert_from_fxsr(struct user_i387_ia32_struct *env, struct task_struct *tsk)
 		memcpy(&to[i], &from[i], sizeof(to[0]));
 }
 
-static void convert_to_fxsr(struct task_struct *tsk,
-			    const struct user_i387_ia32_struct *env)
+void convert_to_fxsr(struct task_struct *tsk,
+		     const struct user_i387_ia32_struct *env)
 
 {
 	struct i387_fxsave_struct *fxsave = &tsk->thread.fpu.state->fxsave;
@@ -653,7 +633,9 @@ static int restore_i387_xsave(void __user *buf)
 	u64 mask;
 	int err;
 
-	if (check_for_xstate(fx, buf, &fx_sw_user))
+	if (check_for_xstate(fx, sig_xstate_ia32_size -
+			     offsetof(struct _fpstate_ia32, _fxsr_env),
+			     &fx_sw_user))
 		goto fx_only;
 
 	mask = fx_sw_user.xstate_bv;
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index 4fd173c..f6705ff 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -117,7 +117,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc,
 		regs->orig_ax = -1;		/* disable syscall checks */
 
 		get_user_ex(buf, &sc->fpstate);
-		err |= restore_i387_xstate(buf);
+		err |= restore_xstates_sigframe(buf, sig_xstate_size);
 
 		get_user_ex(*pax, &sc->ax);
 	} get_user_catch(err);
@@ -252,7 +252,7 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size,
 		return (void __user *)-1L;
 
 	/* save i387 state */
-	if (used_math() && save_i387_xstate(*fpstate) < 0)
+	if (used_math() && save_xstates_sigframe(*fpstate, sig_xstate_size) < 0)
 		return (void __user *)-1L;
 
 	return (void __user *)sp;
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index c422527..5d07a88 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -103,8 +103,7 @@ void __sanitize_i387_state(struct task_struct *tsk)
  * Check for the presence of extended state information in the
  * user fpstate pointer in the sigcontext.
  */
-int check_for_xstate(struct i387_fxsave_struct __user *buf,
-		     void __user *fpstate,
+int check_for_xstate(struct i387_fxsave_struct __user *buf, unsigned int size,
 		     struct _fpx_sw_bytes *fx_sw_user)
 {
 	int min_xstate_size = sizeof(struct i387_fxsave_struct) +
@@ -131,11 +130,11 @@ int check_for_xstate(struct i387_fxsave_struct __user *buf,
 	    fx_sw_user->xstate_size > fx_sw_user->extended_size)
 		return -EINVAL;
 
-	err = __get_user(magic2, (__u32 *) (((void *)fpstate) +
-					    fx_sw_user->extended_size -
+	err = __get_user(magic2, (__u32 *) (((void *)buf) + size -
 					    FP_XSTATE_MAGIC2_SIZE));
 	if (err)
 		return err;
+
 	/*
 	 * Check for the presence of second magic word at the end of memory
 	 * layout. This detects the case where the user just copied the legacy
@@ -148,11 +147,109 @@ int check_for_xstate(struct i387_fxsave_struct __user *buf,
 	return 0;
 }
 
-#ifdef CONFIG_X86_64
 /*
  * Signal frame handlers.
  */
+int save_xstates_sigframe(void __user *buf, unsigned int size)
+{
+	void __user *buf_fxsave = buf;
+	struct task_struct *tsk = current;
+	struct xsave_struct *xsave = &tsk->thread.fpu.state->xsave;
+#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
+	int ia32 = size == sig_xstate_ia32_size;
+#endif
+	int err;
+
+	if (!access_ok(VERIFY_WRITE, buf, size))
+		return -EACCES;
+
+	BUG_ON(size < xstate_size);
+
+	if (!used_math())
+		return 0;
+
+	clear_used_math(); /* trigger finit */
+
+	if (!HAVE_HWFP)
+		return fpregs_soft_get(current, NULL, 0,
+			sizeof(struct user_i387_ia32_struct), NULL,
+			(struct _fpstate_ia32 __user *) buf) ? -1 : 1;
+
+	save_xstates(tsk);
+	sanitize_i387_state(tsk);
+
+#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
+	if (ia32) {
+		if (use_xsave() || use_fxsr()) {
+			struct user_i387_ia32_struct env;
+			struct _fpstate_ia32 __user *fp = buf;
+
+			convert_from_fxsr(&env, tsk);
+			if (__copy_to_user(buf, &env, sizeof(env)))
+				return -1;
+
+			err  = __put_user(xsave->i387.swd, &fp->status);
+			err |= __put_user(X86_FXSR_MAGIC, &fp->magic);
+
+			if (err)
+				return -1;
+
+			buf_fxsave = fp->_fxsr_env;
+			size -= offsetof(struct _fpstate_ia32, _fxsr_env);
+#if defined(CONFIG_X86_64)
+			buf = buf_fxsave;
+#endif
+		} else {
+			struct i387_fsave_struct *fsave =
+				&tsk->thread.fpu.state->fsave;
+
+			fsave->status = fsave->swd;
+		}
+	}
+#endif
 
+	if (__copy_to_user(buf_fxsave, xsave, size))
+		return -1;
+
+	if (use_xsave()) {
+		struct _fpstate __user *fp = buf;
+		struct _xstate __user *x = buf;
+		u64 xstate_bv = xsave->xsave_hdr.xstate_bv;
+
+		err = __copy_to_user(&fp->sw_reserved,
+#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
+				     ia32 ? &fx_sw_reserved_ia32 :
+#endif
+				     &fx_sw_reserved,
+				     sizeof (struct _fpx_sw_bytes));
+
+		err |= __put_user(FP_XSTATE_MAGIC2,
+				  (__u32 __user *) (buf_fxsave + size
+						    - FP_XSTATE_MAGIC2_SIZE));
+
+		/*
+		 * For legacy compatible, we always set FP/SSE bits in the bit
+		 * vector while saving the state to the user context. This will
+		 * enable us capturing any changes(during sigreturn) to
+		 * the FP/SSE bits by the legacy applications which don't touch
+		 * xstate_bv in the xsave header.
+		 *
+		 * xsave aware apps can change the xstate_bv in the xsave
+		 * header as well as change any contents in the memory layout.
+		 * xrestore as part of sigreturn will capture all the changes.
+		 */
+		xstate_bv |= XSTATE_FPSSE;
+
+		err |= __put_user(xstate_bv, &x->xstate_hdr.xstate_bv);
+
+		if (err)
+			return err;
+	}
+
+	return 1;
+}
+
+#ifdef CONFIG_X86_64
 int save_i387_xstate(void __user *buf)
 {
 	struct task_struct *tsk = current;
@@ -240,7 +337,7 @@ static int restore_user_xstate(void __user *buf)
 	int err;
 
 	if (((unsigned long)buf % 64) ||
-	     check_for_xstate(buf, buf, &fx_sw_user))
+	     check_for_xstate(buf, sig_xstate_size, &fx_sw_user))
 		goto fx_only;
 
 	mask = fx_sw_user.xstate_bv;
@@ -315,6 +412,94 @@ clear:
 }
 #endif
 
+int restore_xstates_sigframe(void __user *buf, unsigned int size)
+{
+#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
+	struct user_i387_ia32_struct env;
+	int ia32 = size == sig_xstate_ia32_size;
+#endif
+	struct _fpx_sw_bytes fx_sw_user;
+	struct task_struct *tsk = current;
+	struct _fpstate_ia32 __user *fp = buf;
+	struct xsave_struct *xsave;
+	u64 xstate_mask = 0;
+	int err;
+
+	if (!buf) {
+		if (used_math()) {
+			clear_fpu(tsk);
+			clear_used_math();
+		}
+		return 0;
+	}
+
+	if (!access_ok(VERIFY_READ, buf, size))
+		return -EACCES;
+
+	if (!used_math()) {
+		err = init_fpu(tsk);
+		if (err)
+			return err;
+	}
+
+	if (!HAVE_HWFP) {
+		set_used_math();
+		return fpregs_soft_set(current, NULL,
+				       0, sizeof(struct user_i387_ia32_struct),
+				       NULL, fp) != 0;
+	}
+
+#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
+	if (ia32 && (use_xsave() || use_fxsr())) {
+		if (__copy_from_user(&env, buf, sizeof(env)))
+			return -1;
+		buf = fp->_fxsr_env;
+		size -= offsetof(struct _fpstate_ia32, _fxsr_env);
+	}
+#endif
+
+	xsave = &tsk->thread.fpu.state->xsave;
+	task_thread_info(tsk)->xstate_mask = 0;
+	if (__copy_from_user(xsave, buf, xstate_size))
+		return -1;
+
+	if (use_xsave()) {
+		u64 *xstate_bv = &xsave->xsave_hdr.xstate_bv;
+
+		/*
+		 * If this is no valid xstate, disable all extended states.
+		 *
+		 * For valid xstates, clear any illegal bits and any bits
+		 * that have been cleared in fx_sw_user.xstate_bv.
+		 */
+		if (check_for_xstate(buf, size, &fx_sw_user))
+			*xstate_bv = XSTATE_FPSSE;
+		else
+			*xstate_bv &= pcntxt_mask & fx_sw_user.xstate_bv;
+
+		xstate_mask |= *xstate_bv;
+
+		xsave->xsave_hdr.reserved1[0] =
+			xsave->xsave_hdr.reserved1[1] = 0;
+	} else {
+		xstate_mask |= XCNTXT_LAZY;
+	}
+
+	if (use_xsave() || use_fxsr()) {
+		xsave->i387.mxcsr &= mxcsr_feature_mask;
+
+#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
+		if (ia32)
+			convert_to_fxsr(tsk, &env);
+#endif
+	}
+
+	set_used_math();
+	restore_xstates(tsk, xstate_mask);
+
+	return 0;
+}
+
 /*
  * Prepare the SW reserved portion of the fxsave memory layout, indicating
  * the presence of the extended state information in the memory layout
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC v2 4/8] x86, xsave: remove unused code
  2011-03-09 19:15 ` [RFC 8/8] x86, xsave: remove lazy allocation of xstate area Hans Rosenfeld
                     ` (3 preceding siblings ...)
  2011-03-23 15:27   ` [RFC v2 3/8] x86, xsave: cleanup fpu/xsave signal frame setup Hans Rosenfeld
@ 2011-03-23 15:27   ` Hans Rosenfeld
  2011-03-23 15:27   ` [RFC v2 5/8] x86, xsave: more cleanups Hans Rosenfeld
                     ` (3 subsequent siblings)
  8 siblings, 0 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-03-23 15:27 UTC (permalink / raw)
  To: hpa, tglx, mingo
  Cc: x86, linux-kernel, brgerst, suresh.b.siddha, eranian,
	robert.richter, Andreas.Herrmann3, Hans Rosenfeld

The patches to rework the fpu/xsave handling and signal frame setup have
made a lot of code unused. This patch removes all this now useless stuff.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/include/asm/i387.h  |  155 ++----------------------------
 arch/x86/include/asm/xsave.h |   51 ----------
 arch/x86/kernel/i387.c       |  221 ------------------------------------------
 arch/x86/kernel/traps.c      |   22 ----
 arch/x86/kernel/xsave.c      |  163 -------------------------------
 5 files changed, 7 insertions(+), 605 deletions(-)

diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index 30930bf..97867ea 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -29,8 +29,6 @@
 # include <asm/sigcontext32.h>
 # include <asm/user32.h>
 #else
-# define save_i387_xstate_ia32		save_i387_xstate
-# define restore_i387_xstate_ia32	restore_i387_xstate
 # define _fpstate_ia32		_fpstate
 # define _xstate_ia32		_xstate
 # define sig_xstate_ia32_size   sig_xstate_size
@@ -108,75 +106,16 @@ static inline void sanitize_i387_state(struct task_struct *tsk)
 }
 
 #ifdef CONFIG_X86_64
-static inline int fxrstor_checking(struct i387_fxsave_struct *fx)
+static inline void fxrstor(struct i387_fxsave_struct *fx)
 {
-	int err;
-
-	/* See comment in fxsave() below. */
-#ifdef CONFIG_AS_FXSAVEQ
-	asm volatile("1:  fxrstorq %[fx]\n\t"
-		     "2:\n"
-		     ".section .fixup,\"ax\"\n"
-		     "3:  movl $-1,%[err]\n"
-		     "    jmp  2b\n"
-		     ".previous\n"
-		     _ASM_EXTABLE(1b, 3b)
-		     : [err] "=r" (err)
-		     : [fx] "m" (*fx), "0" (0));
-#else
-	asm volatile("1:  rex64/fxrstor (%[fx])\n\t"
-		     "2:\n"
-		     ".section .fixup,\"ax\"\n"
-		     "3:  movl $-1,%[err]\n"
-		     "    jmp  2b\n"
-		     ".previous\n"
-		     _ASM_EXTABLE(1b, 3b)
-		     : [err] "=r" (err)
-		     : [fx] "R" (fx), "m" (*fx), "0" (0));
-#endif
-	return err;
-}
-
-static inline int fxsave_user(struct i387_fxsave_struct __user *fx)
-{
-	int err;
-
-	/*
-	 * Clear the bytes not touched by the fxsave and reserved
-	 * for the SW usage.
-	 */
-	err = __clear_user(&fx->sw_reserved,
-			   sizeof(struct _fpx_sw_bytes));
-	if (unlikely(err))
-		return -EFAULT;
-
 	/* See comment in fxsave() below. */
 #ifdef CONFIG_AS_FXSAVEQ
-	asm volatile("1:  fxsaveq %[fx]\n\t"
-		     "2:\n"
-		     ".section .fixup,\"ax\"\n"
-		     "3:  movl $-1,%[err]\n"
-		     "    jmp  2b\n"
-		     ".previous\n"
-		     _ASM_EXTABLE(1b, 3b)
-		     : [err] "=r" (err), [fx] "=m" (*fx)
-		     : "0" (0));
+	asm volatile("fxrstorq %[fx]\n\t"
+		     : : [fx] "m" (*fx));
 #else
-	asm volatile("1:  rex64/fxsave (%[fx])\n\t"
-		     "2:\n"
-		     ".section .fixup,\"ax\"\n"
-		     "3:  movl $-1,%[err]\n"
-		     "    jmp  2b\n"
-		     ".previous\n"
-		     _ASM_EXTABLE(1b, 3b)
-		     : [err] "=r" (err), "=m" (*fx)
-		     : [fx] "R" (fx), "0" (0));
+	asm volatile("rex64/fxrstor (%[fx])\n\t"
+		     : : [fx] "R" (fx), "m" (*fx));
 #endif
-	if (unlikely(err) &&
-	    __clear_user(fx, sizeof(struct i387_fxsave_struct)))
-		err = -EFAULT;
-	/* No need to clear here because the caller clears USED_MATH */
-	return err;
 }
 
 static inline void fpu_fxsave(struct fpu *fpu)
@@ -209,7 +148,7 @@ static inline void fpu_fxsave(struct fpu *fpu)
 #else  /* CONFIG_X86_32 */
 
 /* perform fxrstor iff the processor has extended states, otherwise frstor */
-static inline int fxrstor_checking(struct i387_fxsave_struct *fx)
+static inline void fxrstor(struct i387_fxsave_struct *fx)
 {
 	/*
 	 * The "nop" is needed to make the instructions the same
@@ -220,8 +159,6 @@ static inline int fxrstor_checking(struct i387_fxsave_struct *fx)
 		"fxrstor %1",
 		X86_FEATURE_FXSR,
 		"m" (*fx));
-
-	return 0;
 }
 
 static inline void fpu_fxsave(struct fpu *fpu)
@@ -246,7 +183,7 @@ static inline void fpu_fxsave(struct fpu *fpu)
  */
 static inline void fpu_restore(struct fpu *fpu)
 {
-	fxrstor_checking(&fpu->state->fxsave);
+	fxrstor(&fpu->state->fxsave);
 }
 
 static inline void fpu_save(struct fpu *fpu)
@@ -278,69 +215,6 @@ static inline void fpu_clean(struct fpu *fpu)
 		[addr] "m" (safe_address));
 }
 
-static inline void fpu_save_init(struct fpu *fpu)
-{
-	if (use_xsave()) {
-		struct xsave_struct *xstate = &fpu->state->xsave;
-
-		fpu_xsave(xstate, -1);
-
-		/*
-		 * xsave header may indicate the init state of the FP.
-		 */
-		if (!(xstate->xsave_hdr.xstate_bv & XSTATE_FP))
-			return;
-	} else if (use_fxsr()) {
-		fpu_fxsave(fpu);
-	} else {
-		asm volatile("fsave %[fx]; fwait"
-			     : [fx] "=m" (fpu->state->fsave));
-		return;
-	}
-
-	if (unlikely(fpu->state->fxsave.swd & X87_FSW_ES))
-		asm volatile("fnclex");
-
-	/* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
-	   is pending.  Clear the x87 state here by setting it to fixed
-	   values. safe_address is a random variable that should be in L1 */
-	alternative_input(
-		ASM_NOP8 ASM_NOP2,
-		"emms\n\t"	  	/* clear stack tags */
-		"fildl %P[addr]",	/* set F?P to defined value */
-		X86_FEATURE_FXSAVE_LEAK,
-		[addr] "m" (safe_address));
-}
-
-static inline void __save_init_fpu(struct task_struct *tsk)
-{
-	fpu_save_init(&tsk->thread.fpu);
-	task_thread_info(tsk)->status &= ~TS_USEDFPU;
-}
-
-static inline int fpu_restore_checking(struct fpu *fpu)
-{
-	if (use_xsave())
-		return xrstor_checking(&fpu->state->xsave, -1);
-	else
-		return fxrstor_checking(&fpu->state->fxsave);
-}
-
-/*
- * Signal frame handlers...
- */
-extern int save_i387_xstate(void __user *buf);
-extern int restore_i387_xstate(void __user *buf);
-
-static inline void __unlazy_fpu(struct task_struct *tsk)
-{
-	if (task_thread_info(tsk)->status & TS_USEDFPU) {
-		__save_init_fpu(tsk);
-		stts();
-	} else
-		tsk->fpu_counter = 0;
-}
-
 static inline void __clear_fpu(struct task_struct *tsk)
 {
 	if (task_thread_info(tsk)->status & TS_USEDFPU) {
@@ -409,21 +283,6 @@ static inline void irq_ts_restore(int TS_state)
 /*
  * These disable preemption on their own and are safe
  */
-static inline void save_init_fpu(struct task_struct *tsk)
-{
-	preempt_disable();
-	__save_init_fpu(tsk);
-	stts();
-	preempt_enable();
-}
-
-static inline void unlazy_fpu(struct task_struct *tsk)
-{
-	preempt_disable();
-	__unlazy_fpu(tsk);
-	preempt_enable();
-}
-
 static inline void clear_fpu(struct task_struct *tsk)
 {
 	preempt_disable();
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
index 200c56d..742da4a 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
@@ -51,26 +51,6 @@ extern int check_for_xstate(struct i387_fxsave_struct __user *buf,
 			    unsigned int size,
 			    struct _fpx_sw_bytes *sw);
 
-static inline int xrstor_checking(struct xsave_struct *fx, u64 mask)
-{
-	int err;
-	u32 lmask = mask;
-	u32 hmask = mask >> 32;
-
-	asm volatile("1: .byte " REX_PREFIX "0x0f,0xae,0x2f\n\t"
-		     "2:\n"
-		     ".section .fixup,\"ax\"\n"
-		     "3:  movl $-1,%[err]\n"
-		     "    jmp  2b\n"
-		     ".previous\n"
-		     _ASM_EXTABLE(1b, 3b)
-		     : [err] "=r" (err)
-		     : "D" (fx), "m" (*fx), "a" (lmask), "d" (hmask), "0" (0)
-		     : "memory");
-
-	return err;
-}
-
 static inline void xrstor_state(struct xsave_struct *fx, u64 mask)
 {
 	u32 lmask = mask;
@@ -81,37 +61,6 @@ static inline void xrstor_state(struct xsave_struct *fx, u64 mask)
 		     :   "memory");
 }
 
-static inline int xsave_checking(struct xsave_struct __user *buf)
-{
-	int err;
-
-	/*
-	 * Clear the xsave header first, so that reserved fields are
-	 * initialized to zero.
-	 */
-	err = __clear_user(&buf->xsave_hdr,
-			   sizeof(struct xsave_hdr_struct));
-	if (unlikely(err))
-		return -EFAULT;
-
-	asm volatile("1: .byte " REX_PREFIX "0x0f,0xae,0x27\n"
-		     "2:\n"
-		     ".section .fixup,\"ax\"\n"
-		     "3:  movl $-1,%[err]\n"
-		     "    jmp  2b\n"
-		     ".previous\n"
-		     _ASM_EXTABLE(1b,3b)
-		     : [err] "=r" (err)
-		     : "D" (buf), "a" (-1), "d" (-1), "0" (0)
-		     : "memory");
-
-	if (unlikely(err) && __clear_user(buf, xstate_size))
-		err = -EFAULT;
-
-	/* No need to clear here because the caller clears USED_MATH */
-	return err;
-}
-
 static inline void xsave_state(struct xsave_struct *fx, u64 mask)
 {
 	u32 lmask = mask;
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
index 5cec7c2..d2d2b69 100644
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -490,227 +490,6 @@ int fpregs_set(struct task_struct *target, const struct user_regset *regset,
 }
 
 /*
- * Signal frame handlers.
- */
-
-static inline int save_i387_fsave(struct _fpstate_ia32 __user *buf)
-{
-	struct task_struct *tsk = current;
-	struct i387_fsave_struct *fp = &tsk->thread.fpu.state->fsave;
-
-	fp->status = fp->swd;
-	if (__copy_to_user(buf, fp, sizeof(struct i387_fsave_struct)))
-		return -1;
-	return 1;
-}
-
-static int save_i387_fxsave(struct _fpstate_ia32 __user *buf)
-{
-	struct task_struct *tsk = current;
-	struct i387_fxsave_struct *fx = &tsk->thread.fpu.state->fxsave;
-	struct user_i387_ia32_struct env;
-	int err = 0;
-
-	convert_from_fxsr(&env, tsk);
-	if (__copy_to_user(buf, &env, sizeof(env)))
-		return -1;
-
-	err |= __put_user(fx->swd, &buf->status);
-	err |= __put_user(X86_FXSR_MAGIC, &buf->magic);
-	if (err)
-		return -1;
-
-	if (__copy_to_user(&buf->_fxsr_env[0], fx, xstate_size))
-		return -1;
-	return 1;
-}
-
-static int save_i387_xsave(void __user *buf)
-{
-	struct task_struct *tsk = current;
-	struct _fpstate_ia32 __user *fx = buf;
-	int err = 0;
-
-
-	sanitize_i387_state(tsk);
-
-	/*
-	 * For legacy compatible, we always set FP/SSE bits in the bit
-	 * vector while saving the state to the user context.
-	 * This will enable us capturing any changes(during sigreturn) to
-	 * the FP/SSE bits by the legacy applications which don't touch
-	 * xstate_bv in the xsave header.
-	 *
-	 * xsave aware applications can change the xstate_bv in the xsave
-	 * header as well as change any contents in the memory layout.
-	 * xrestore as part of sigreturn will capture all the changes.
-	 */
-	tsk->thread.fpu.state->xsave.xsave_hdr.xstate_bv |= XSTATE_FPSSE;
-
-	if (save_i387_fxsave(fx) < 0)
-		return -1;
-
-	err = __copy_to_user(&fx->sw_reserved, &fx_sw_reserved_ia32,
-			     sizeof(struct _fpx_sw_bytes));
-	err |= __put_user(FP_XSTATE_MAGIC2,
-			  (__u32 __user *) (buf + sig_xstate_ia32_size
-					    - FP_XSTATE_MAGIC2_SIZE));
-	if (err)
-		return -1;
-
-	return 1;
-}
-
-int save_i387_xstate_ia32(void __user *buf)
-{
-	struct _fpstate_ia32 __user *fp = (struct _fpstate_ia32 __user *) buf;
-	struct task_struct *tsk = current;
-
-	if (!used_math())
-		return 0;
-
-	if (!access_ok(VERIFY_WRITE, buf, sig_xstate_ia32_size))
-		return -EACCES;
-	/*
-	 * This will cause a "finit" to be triggered by the next
-	 * attempted FPU operation by the 'current' process.
-	 */
-	clear_used_math();
-
-	if (!HAVE_HWFP) {
-		return fpregs_soft_get(current, NULL,
-				       0, sizeof(struct user_i387_ia32_struct),
-				       NULL, fp) ? -1 : 1;
-	}
-
-	preempt_disable();
-	save_xstates(tsk);
-	preempt_enable();
-
-	if (cpu_has_xsave)
-		return save_i387_xsave(fp);
-	if (cpu_has_fxsr)
-		return save_i387_fxsave(fp);
-	else
-		return save_i387_fsave(fp);
-}
-
-static inline int restore_i387_fsave(struct _fpstate_ia32 __user *buf)
-{
-	struct task_struct *tsk = current;
-
-	return __copy_from_user(&tsk->thread.fpu.state->fsave, buf,
-				sizeof(struct i387_fsave_struct));
-}
-
-static int restore_i387_fxsave(struct _fpstate_ia32 __user *buf,
-			       unsigned int size)
-{
-	struct task_struct *tsk = current;
-	struct user_i387_ia32_struct env;
-	int err;
-
-	err = __copy_from_user(&tsk->thread.fpu.state->fxsave, &buf->_fxsr_env[0],
-			       size);
-	/* mxcsr reserved bits must be masked to zero for security reasons */
-	tsk->thread.fpu.state->fxsave.mxcsr &= mxcsr_feature_mask;
-	if (err || __copy_from_user(&env, buf, sizeof(env)))
-		return 1;
-	convert_to_fxsr(tsk, &env);
-
-	return 0;
-}
-
-static int restore_i387_xsave(void __user *buf)
-{
-	struct _fpx_sw_bytes fx_sw_user;
-	struct _fpstate_ia32 __user *fx_user =
-			((struct _fpstate_ia32 __user *) buf);
-	struct i387_fxsave_struct __user *fx =
-		(struct i387_fxsave_struct __user *) &fx_user->_fxsr_env[0];
-	struct xsave_hdr_struct *xsave_hdr =
-				&current->thread.fpu.state->xsave.xsave_hdr;
-	u64 mask;
-	int err;
-
-	if (check_for_xstate(fx, sig_xstate_ia32_size -
-			     offsetof(struct _fpstate_ia32, _fxsr_env),
-			     &fx_sw_user))
-		goto fx_only;
-
-	mask = fx_sw_user.xstate_bv;
-
-	err = restore_i387_fxsave(buf, fx_sw_user.xstate_size);
-
-	xsave_hdr->xstate_bv &= pcntxt_mask;
-	/*
-	 * These bits must be zero.
-	 */
-	xsave_hdr->reserved1[0] = xsave_hdr->reserved1[1] = 0;
-
-	/*
-	 * Init the state that is not present in the memory layout
-	 * and enabled by the OS.
-	 */
-	mask = ~(pcntxt_mask & ~mask);
-	xsave_hdr->xstate_bv &= mask;
-
-	return err;
-fx_only:
-	/*
-	 * Couldn't find the extended state information in the memory
-	 * layout. Restore the FP/SSE and init the other extended state
-	 * enabled by the OS.
-	 */
-	xsave_hdr->xstate_bv = XSTATE_FPSSE;
-	return restore_i387_fxsave(buf, sizeof(struct i387_fxsave_struct));
-}
-
-int restore_i387_xstate_ia32(void __user *buf)
-{
-	int err;
-	struct task_struct *tsk = current;
-	struct _fpstate_ia32 __user *fp = (struct _fpstate_ia32 __user *) buf;
-
-	if (HAVE_HWFP)
-		clear_fpu(tsk);
-
-	if (!buf) {
-		if (used_math()) {
-			clear_fpu(tsk);
-			clear_used_math();
-		}
-
-		return 0;
-	} else
-		if (!access_ok(VERIFY_READ, buf, sig_xstate_ia32_size))
-			return -EACCES;
-
-	if (!used_math()) {
-		err = init_fpu(tsk);
-		if (err)
-			return err;
-	}
-
-	if (HAVE_HWFP) {
-		if (cpu_has_xsave)
-			err = restore_i387_xsave(buf);
-		else if (cpu_has_fxsr)
-			err = restore_i387_fxsave(fp, sizeof(struct
-							   i387_fxsave_struct));
-		else
-			err = restore_i387_fsave(fp);
-	} else {
-		err = fpregs_soft_set(current, NULL,
-				      0, sizeof(struct user_i387_ia32_struct),
-				      NULL, fp) != 0;
-	}
-	set_used_math();
-
-	return err;
-}
-
-/*
  * FPU state for core dumps.
  * This is only used for a.out dumps now.
  * It is declared generically using elf_fpregset_t (which is
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 072c30e..872fc78 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -720,28 +720,6 @@ asmlinkage void __attribute__((weak)) smp_threshold_interrupt(void)
 }
 
 /*
- * __math_state_restore assumes that cr0.TS is already clear and the
- * fpu state is all ready for use.  Used during context switch.
- */
-void __math_state_restore(void)
-{
-	struct thread_info *thread = current_thread_info();
-	struct task_struct *tsk = thread->task;
-
-	/*
-	 * Paranoid restore. send a SIGSEGV if we fail to restore the state.
-	 */
-	if (unlikely(fpu_restore_checking(&tsk->thread.fpu))) {
-		stts();
-		force_sig(SIGSEGV, tsk);
-		return;
-	}
-
-	thread->status |= TS_USEDFPU;   /* So we fnsave on switch_to() */
-	tsk->fpu_counter++;
-}
-
-/*
  * 'math_state_restore()' saves the current math information in the
  * old math state array, and gets the new ones from the current task
  *
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index 5d07a88..f2714ea 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -249,169 +249,6 @@ int save_xstates_sigframe(void __user *buf, unsigned int size)
 	return 1;
 }
 
-#ifdef CONFIG_X86_64
-int save_i387_xstate(void __user *buf)
-{
-	struct task_struct *tsk = current;
-	int err = 0;
-
-	if (!access_ok(VERIFY_WRITE, buf, sig_xstate_size))
-		return -EACCES;
-
-	BUG_ON(sig_xstate_size < xstate_size);
-
-	if ((unsigned long)buf % 64)
-		printk("save_i387_xstate: bad fpstate %p\n", buf);
-
-	if (!used_math())
-		return 0;
-
-	if (task_thread_info(tsk)->status & TS_USEDFPU) {
-		if (use_xsave())
-			err = xsave_checking(buf);
-		else
-			err = fxsave_user(buf);
-
-		if (err)
-			return err;
-		task_thread_info(tsk)->status &= ~TS_USEDFPU;
-		stts();
-	} else {
-		sanitize_i387_state(tsk);
-		if (__copy_to_user(buf, &tsk->thread.fpu.state->fxsave,
-				   xstate_size))
-			return -1;
-	}
-
-	clear_used_math(); /* trigger finit */
-
-	if (use_xsave()) {
-		struct _fpstate __user *fx = buf;
-		struct _xstate __user *x = buf;
-		u64 xstate_bv;
-
-		err = __copy_to_user(&fx->sw_reserved, &fx_sw_reserved,
-				     sizeof(struct _fpx_sw_bytes));
-
-		err |= __put_user(FP_XSTATE_MAGIC2,
-				  (__u32 __user *) (buf + sig_xstate_size
-						    - FP_XSTATE_MAGIC2_SIZE));
-
-		/*
-		 * Read the xstate_bv which we copied (directly from the cpu or
-		 * from the state in task struct) to the user buffers and
-		 * set the FP/SSE bits.
-		 */
-		err |= __get_user(xstate_bv, &x->xstate_hdr.xstate_bv);
-
-		/*
-		 * For legacy compatible, we always set FP/SSE bits in the bit
-		 * vector while saving the state to the user context. This will
-		 * enable us capturing any changes(during sigreturn) to
-		 * the FP/SSE bits by the legacy applications which don't touch
-		 * xstate_bv in the xsave header.
-		 *
-		 * xsave aware apps can change the xstate_bv in the xsave
-		 * header as well as change any contents in the memory layout.
-		 * xrestore as part of sigreturn will capture all the changes.
-		 */
-		xstate_bv |= XSTATE_FPSSE;
-
-		err |= __put_user(xstate_bv, &x->xstate_hdr.xstate_bv);
-
-		if (err)
-			return err;
-	}
-
-	return 1;
-}
-
-/*
- * Restore the extended state if present. Otherwise, restore the FP/SSE
- * state.
- */
-static int restore_user_xstate(void __user *buf)
-{
-	struct _fpx_sw_bytes fx_sw_user;
-	u64 mask;
-	int err;
-
-	if (((unsigned long)buf % 64) ||
-	     check_for_xstate(buf, sig_xstate_size, &fx_sw_user))
-		goto fx_only;
-
-	mask = fx_sw_user.xstate_bv;
-
-	/*
-	 * restore the state passed by the user.
-	 */
-	err = xrstor_checking((__force struct xsave_struct *)buf, mask);
-	if (err)
-		return err;
-
-	/*
-	 * init the state skipped by the user.
-	 */
-	mask = pcntxt_mask & ~mask;
-	if (unlikely(mask))
-		xrstor_state(init_xstate_buf, mask);
-
-	return 0;
-
-fx_only:
-	/*
-	 * couldn't find the extended state information in the
-	 * memory layout. Restore just the FP/SSE and init all
-	 * the other extended state.
-	 */
-	xrstor_state(init_xstate_buf, pcntxt_mask & ~XSTATE_FPSSE);
-	return fxrstor_checking((__force struct i387_fxsave_struct *)buf);
-}
-
-/*
- * This restores directly out of user space. Exceptions are handled.
- */
-int restore_i387_xstate(void __user *buf)
-{
-	struct task_struct *tsk = current;
-	int err = 0;
-
-	if (!buf) {
-		if (used_math())
-			goto clear;
-		return 0;
-	} else
-		if (!access_ok(VERIFY_READ, buf, sig_xstate_size))
-			return -EACCES;
-
-	if (!used_math()) {
-		err = init_fpu(tsk);
-		if (err)
-			return err;
-	}
-
-	if (!(task_thread_info(current)->status & TS_USEDFPU)) {
-		clts();
-		task_thread_info(current)->status |= TS_USEDFPU;
-	}
-	if (use_xsave())
-		err = restore_user_xstate(buf);
-	else
-		err = fxrstor_checking((__force struct i387_fxsave_struct *)
-				       buf);
-	if (unlikely(err)) {
-		/*
-		 * Encountered an error while doing the restore from the
-		 * user buffer, clear the fpu state.
-		 */
-clear:
-		clear_fpu(tsk);
-		clear_used_math();
-	}
-	return err;
-}
-#endif
-
 int restore_xstates_sigframe(void __user *buf, unsigned int size)
 {
 #if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC v2 5/8] x86, xsave: more cleanups
  2011-03-09 19:15 ` [RFC 8/8] x86, xsave: remove lazy allocation of xstate area Hans Rosenfeld
                     ` (4 preceding siblings ...)
  2011-03-23 15:27   ` [RFC v2 4/8] x86, xsave: remove unused code Hans Rosenfeld
@ 2011-03-23 15:27   ` Hans Rosenfeld
  2011-03-23 15:27   ` [RFC v2 6/8] x86, xsave: add support for non-lazy xstates Hans Rosenfeld
                     ` (2 subsequent siblings)
  8 siblings, 0 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-03-23 15:27 UTC (permalink / raw)
  To: hpa, tglx, mingo
  Cc: x86, linux-kernel, brgerst, suresh.b.siddha, eranian,
	robert.richter, Andreas.Herrmann3, Hans Rosenfeld

Removed some declarations from headers that weren't used.

Retired TS_USEDFPU, it has been replaced by the XCNTXT_* bits in
xstate_mask.

There is no reason functions like fpu_fxsave() etc. need to know or
handle anything else than a buffer to save/restore their stuff to/from.

Sanitize_i387_state() is extra work that is only needed when xsaveopt is
used. There is no point in hiding this in an inline function, adding
extra code lines just to save a single if() in the five places it is
used. Also, it is obscuring a fact that might well be interesting to
whoever is reading the code, but it is not gaining anything.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/include/asm/i387.h        |   67 ++++++++++++-----------------------
 arch/x86/include/asm/thread_info.h |    2 -
 arch/x86/include/asm/xsave.h       |   14 +++----
 arch/x86/kernel/i387.c             |   12 ++++--
 arch/x86/kernel/xsave.c            |   32 ++++++++---------
 arch/x86/kvm/vmx.c                 |    2 +-
 arch/x86/kvm/x86.c                 |    4 +-
 7 files changed, 55 insertions(+), 78 deletions(-)

diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index 97867ea..b8f9617 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -42,7 +42,6 @@ extern void fpu_init(void);
 extern void mxcsr_feature_mask_init(void);
 extern int init_fpu(struct task_struct *child);
 extern asmlinkage void math_state_restore(void);
-extern void __math_state_restore(void);
 extern int dump_fpu(struct pt_regs *, struct user_i387_struct *);
 
 extern void convert_from_fxsr(struct user_i387_ia32_struct *, struct task_struct *);
@@ -60,15 +59,10 @@ extern user_regset_set_fn fpregs_set, xfpregs_set, fpregs_soft_set,
  */
 #define xstateregs_active	fpregs_active
 
-extern struct _fpx_sw_bytes fx_sw_reserved;
 extern unsigned int mxcsr_feature_mask;
+
 #ifdef CONFIG_IA32_EMULATION
 extern unsigned int sig_xstate_ia32_size;
-extern struct _fpx_sw_bytes fx_sw_reserved_ia32;
-struct _fpstate_ia32;
-struct _xstate_ia32;
-extern int save_i387_xstate_ia32(void __user *buf);
-extern int restore_i387_xstate_ia32(void __user *buf);
 #endif
 
 #ifdef CONFIG_MATH_EMULATION
@@ -76,7 +70,7 @@ extern int restore_i387_xstate_ia32(void __user *buf);
 extern void finit_soft_fpu(struct i387_soft_struct *soft);
 #else
 # define HAVE_HWFP		1
-static inline void finit_soft_fpu(struct i387_soft_struct *soft) {}
+# define finit_soft_fpu(x)
 #endif
 
 #define X87_FSW_ES (1 << 7)	/* Exception Summary */
@@ -96,15 +90,6 @@ static __always_inline __pure bool use_fxsr(void)
         return static_cpu_has(X86_FEATURE_FXSR);
 }
 
-extern void __sanitize_i387_state(struct task_struct *);
-
-static inline void sanitize_i387_state(struct task_struct *tsk)
-{
-	if (!use_xsaveopt())
-		return;
-	__sanitize_i387_state(tsk);
-}
-
 #ifdef CONFIG_X86_64
 static inline void fxrstor(struct i387_fxsave_struct *fx)
 {
@@ -118,7 +103,7 @@ static inline void fxrstor(struct i387_fxsave_struct *fx)
 #endif
 }
 
-static inline void fpu_fxsave(struct fpu *fpu)
+static inline void fpu_fxsave(struct i387_fxsave_struct *fx)
 {
 	/* Using "rex64; fxsave %0" is broken because, if the memory operand
 	   uses any extended registers for addressing, a second REX prefix
@@ -129,7 +114,7 @@ static inline void fpu_fxsave(struct fpu *fpu)
 	/* Using "fxsaveq %0" would be the ideal choice, but is only supported
 	   starting with gas 2.16. */
 	__asm__ __volatile__("fxsaveq %0"
-			     : "=m" (fpu->state->fxsave));
+			     : "=m" (*fx));
 #else
 	/* Using, as a workaround, the properly prefixed form below isn't
 	   accepted by any binutils version so far released, complaining that
@@ -140,8 +125,8 @@ static inline void fpu_fxsave(struct fpu *fpu)
 	   This, however, we can work around by forcing the compiler to select
 	   an addressing mode that doesn't require extended registers. */
 	asm volatile("rex64/fxsave (%[fx])"
-		     : "=m" (fpu->state->fxsave)
-		     : [fx] "R" (&fpu->state->fxsave));
+		     : "=m" (*fx)
+		     : [fx] "R" (fx));
 #endif
 }
 
@@ -161,10 +146,10 @@ static inline void fxrstor(struct i387_fxsave_struct *fx)
 		"m" (*fx));
 }
 
-static inline void fpu_fxsave(struct fpu *fpu)
+static inline void fpu_fxsave(struct i387_fxsave_struct *fx)
 {
 	asm volatile("fxsave %[fx]"
-		     : [fx] "=m" (fpu->state->fxsave));
+		     : [fx] "=m" (*fx));
 }
 
 #endif	/* CONFIG_X86_64 */
@@ -181,25 +166,25 @@ static inline void fpu_fxsave(struct fpu *fpu)
 /*
  * These must be called with preempt disabled
  */
-static inline void fpu_restore(struct fpu *fpu)
+static inline void fpu_restore(struct i387_fxsave_struct *fx)
 {
-	fxrstor(&fpu->state->fxsave);
+	fxrstor(fx);
 }
 
-static inline void fpu_save(struct fpu *fpu)
+static inline void fpu_save(struct i387_fxsave_struct *fx)
 {
 	if (use_fxsr()) {
-		fpu_fxsave(fpu);
+		fpu_fxsave(fx);
 	} else {
 		asm volatile("fsave %[fx]; fwait"
-			     : [fx] "=m" (fpu->state->fsave));
+			     : [fx] "=m" (*fx));
 	}
 }
 
-static inline void fpu_clean(struct fpu *fpu)
+static inline void fpu_clean(struct i387_fxsave_struct *fx)
 {
 	u32 swd = (use_fxsr() || use_xsave()) ?
-		fpu->state->fxsave.swd : fpu->state->fsave.swd;
+		fx->swd : ((struct i387_fsave_struct *)fx)->swd;
 
 	if (unlikely(swd & X87_FSW_ES))
 		asm volatile("fnclex");
@@ -215,19 +200,6 @@ static inline void fpu_clean(struct fpu *fpu)
 		[addr] "m" (safe_address));
 }
 
-static inline void __clear_fpu(struct task_struct *tsk)
-{
-	if (task_thread_info(tsk)->status & TS_USEDFPU) {
-		/* Ignore delayed exceptions from user space */
-		asm volatile("1: fwait\n"
-			     "2:\n"
-			     _ASM_EXTABLE(1b, 2b));
-		task_thread_info(tsk)->status &= ~TS_USEDFPU;
-		task_thread_info(tsk)->xstate_mask &= ~XCNTXT_LAZY;
-		stts();
-	}
-}
-
 static inline void kernel_fpu_begin(void)
 {
 	preempt_disable();
@@ -286,7 +258,14 @@ static inline void irq_ts_restore(int TS_state)
 static inline void clear_fpu(struct task_struct *tsk)
 {
 	preempt_disable();
-	__clear_fpu(tsk);
+	if (task_thread_info(tsk)->xstate_mask & XCNTXT_LAZY) {
+		/* Ignore delayed exceptions from user space */
+		asm volatile("1: fwait\n"
+			     "2:\n"
+			     _ASM_EXTABLE(1b, 2b));
+		task_thread_info(tsk)->xstate_mask &= ~XCNTXT_LAZY;
+		stts();
+	}
 	preempt_enable();
 }
 
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index 5c92d21..13de316 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -238,8 +238,6 @@ static inline struct thread_info *current_thread_info(void)
  * ever touches our thread-synchronous status, so we don't
  * have to worry about atomic accesses.
  */
-#define TS_USEDFPU		0x0001	/* FPU was used by this task
-					   this quantum (SMP) */
 #define TS_COMPAT		0x0002	/* 32bit syscall active (64BIT)*/
 #define TS_POLLING		0x0004	/* idle task polling need_resched,
 					   skip sending interrupt */
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
index 742da4a..b8861d4 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
@@ -37,8 +37,8 @@ extern unsigned int xstate_size;
 extern u64 pcntxt_mask;
 extern u64 xstate_fx_sw_bytes[USER_XSTATE_FX_SW_WORDS];
 
-extern void xsave(struct fpu *, u64);
-extern void xrstor(struct fpu *, u64);
+extern void xsave(struct xsave_struct *, u64);
+extern void xrstor(struct xsave_struct *, u64);
 extern void save_xstates(struct task_struct *);
 extern void restore_xstates(struct task_struct *, u64);
 extern int save_xstates_sigframe(void __user *, unsigned int);
@@ -46,10 +46,7 @@ extern int restore_xstates_sigframe(void __user *, unsigned int);
 
 extern void xsave_init(void);
 extern void update_regset_xstate_info(unsigned int size, u64 xstate_mask);
-extern int init_fpu(struct task_struct *child);
-extern int check_for_xstate(struct i387_fxsave_struct __user *buf,
-			    unsigned int size,
-			    struct _fpx_sw_bytes *sw);
+extern void sanitize_i387_state(struct task_struct *);
 
 static inline void xrstor_state(struct xsave_struct *fx, u64 mask)
 {
@@ -71,7 +68,7 @@ static inline void xsave_state(struct xsave_struct *fx, u64 mask)
 		     :   "memory");
 }
 
-static inline void fpu_xsave(struct xsave_struct *fx, u64 mask)
+static inline void xsaveopt_state(struct xsave_struct *fx, u64 mask)
 {
 	u32 lmask = mask;
 	u32 hmask = mask >> 32;
@@ -82,7 +79,8 @@ static inline void fpu_xsave(struct xsave_struct *fx, u64 mask)
 		".byte " REX_PREFIX "0x0f,0xae,0x27",
 		".byte " REX_PREFIX "0x0f,0xae,0x37",
 		X86_FEATURE_XSAVEOPT,
-		[fx] "D" (fx), "a" (lmask), "d" (hmask) :
+		"D" (fx), "a" (lmask), "d" (hmask) :
 		"memory");
 }
+
 #endif
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
index d2d2b69..88fefba 100644
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -182,7 +182,8 @@ int xfpregs_get(struct task_struct *target, const struct user_regset *regset,
 	if (ret)
 		return ret;
 
-	sanitize_i387_state(target);
+	if (use_xsaveopt())
+		sanitize_i387_state(target);
 
 	return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
 				   &target->thread.fpu.state->fxsave, 0, -1);
@@ -201,7 +202,8 @@ int xfpregs_set(struct task_struct *target, const struct user_regset *regset,
 	if (ret)
 		return ret;
 
-	sanitize_i387_state(target);
+	if (use_xsaveopt())
+		sanitize_i387_state(target);
 
 	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
 				 &target->thread.fpu.state->fxsave, 0, -1);
@@ -440,7 +442,8 @@ int fpregs_get(struct task_struct *target, const struct user_regset *regset,
 					   -1);
 	}
 
-	sanitize_i387_state(target);
+	if (use_xsaveopt())
+		sanitize_i387_state(target);
 
 	if (kbuf && pos == 0 && count == sizeof(env)) {
 		convert_from_fxsr(kbuf, target);
@@ -463,7 +466,8 @@ int fpregs_set(struct task_struct *target, const struct user_regset *regset,
 	if (ret)
 		return ret;
 
-	sanitize_i387_state(target);
+	if (use_xsaveopt())
+		sanitize_i387_state(target);
 
 	if (!HAVE_HWFP)
 		return fpregs_soft_set(target, regset, pos, count, kbuf, ubuf);
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index f2714ea..4e5bf58 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -39,7 +39,7 @@ static unsigned int *xstate_offsets, *xstate_sizes, xstate_features;
  * that the user doesn't see some stale state in the memory layout during
  * signal handling, debugging etc.
  */
-void __sanitize_i387_state(struct task_struct *tsk)
+void sanitize_i387_state(struct task_struct *tsk)
 {
 	u64 xstate_bv;
 	int feature_bit = 0x2;
@@ -48,7 +48,7 @@ void __sanitize_i387_state(struct task_struct *tsk)
 	if (!fx)
 		return;
 
-	BUG_ON(task_thread_info(tsk)->status & TS_USEDFPU);
+	BUG_ON(task_thread_info(tsk)->xstate_mask & XCNTXT_LAZY);
 
 	xstate_bv = tsk->thread.fpu.state->xsave.xsave_hdr.xstate_bv;
 
@@ -103,8 +103,8 @@ void __sanitize_i387_state(struct task_struct *tsk)
  * Check for the presence of extended state information in the
  * user fpstate pointer in the sigcontext.
  */
-int check_for_xstate(struct i387_fxsave_struct __user *buf, unsigned int size,
-		     struct _fpx_sw_bytes *fx_sw_user)
+static int check_for_xstate(struct i387_fxsave_struct __user *buf, unsigned int size,
+			    struct _fpx_sw_bytes *fx_sw_user)
 {
 	int min_xstate_size = sizeof(struct i387_fxsave_struct) +
 			      sizeof(struct xsave_hdr_struct);
@@ -176,7 +176,8 @@ int save_xstates_sigframe(void __user *buf, unsigned int size)
 			(struct _fpstate_ia32 __user *) buf) ? -1 : 1;
 
 	save_xstates(tsk);
-	sanitize_i387_state(tsk);
+	if (use_xsaveopt())
+		sanitize_i387_state(tsk);
 
 #if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
 	if (ia32) {
@@ -498,17 +499,17 @@ void __cpuinit xsave_init(void)
 	this_func();
 }
 
-void xsave(struct fpu *fpu, u64 mask)
+void xsave(struct xsave_struct *x, u64 mask)
 {
 	clts();
 
 	if (use_xsave())
-		fpu_xsave(&fpu->state->xsave, mask);
+		xsaveopt_state(x, mask);
 	else if (mask & XCNTXT_LAZY)
-		fpu_save(fpu);
+		fpu_save(&x->i387);
 
 	if (mask & XCNTXT_LAZY)
-		fpu_clean(fpu);
+		fpu_clean(&x->i387);
 
 	stts();
 }
@@ -521,7 +522,7 @@ void save_xstates(struct task_struct *tsk)
 	if (!fpu_allocated(&tsk->thread.fpu))
 		return;
 
-	xsave(&tsk->thread.fpu, ti->xstate_mask);
+	xsave(&tsk->thread.fpu.state->xsave, ti->xstate_mask);
 
 	if (!(ti->xstate_mask & XCNTXT_LAZY))
 		tsk->fpu_counter = 0;
@@ -533,19 +534,17 @@ void save_xstates(struct task_struct *tsk)
 	 */
 	if (tsk->fpu_counter < 5)
 		ti->xstate_mask &= ~XCNTXT_LAZY;
-
-	ti->status &= ~TS_USEDFPU;
 }
 EXPORT_SYMBOL(save_xstates);
 
-void xrstor(struct fpu *fpu, u64 mask)
+void xrstor(struct xsave_struct *x, u64 mask)
 {
 	clts();
 
 	if (use_xsave())
-		xrstor_state(&fpu->state->xsave, mask);
+		xrstor_state(x, mask);
 	else if (mask & XCNTXT_LAZY)
-		fpu_restore(fpu);
+		fpu_restore(&x->i387);
 
 	if (!(mask & XCNTXT_LAZY))
 		stts();
@@ -559,10 +558,9 @@ void restore_xstates(struct task_struct *tsk, u64 mask)
 	if (!fpu_allocated(&tsk->thread.fpu))
 		return;
 
-	xrstor(&tsk->thread.fpu, mask);
+	xrstor(&tsk->thread.fpu.state->xsave, mask);
 
 	ti->xstate_mask |= mask;
-	ti->status |= TS_USEDFPU;
 	if (mask & XCNTXT_LAZY)
 		tsk->fpu_counter++;
 }
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index bf89ec2..d79bf2f 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -876,7 +876,7 @@ static void __vmx_load_host_state(struct vcpu_vmx *vmx)
 #ifdef CONFIG_X86_64
 	wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base);
 #endif
-	if (current_thread_info()->status & TS_USEDFPU)
+	if (current_thread_info()->xstate_mask & XCNTXT_LAZY)
 		clts();
 	load_gdt(&__get_cpu_var(host_gdt));
 }
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 8fb21ea..10aeb04 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5795,7 +5795,7 @@ void kvm_load_guest_fpu(struct kvm_vcpu *vcpu)
 	kvm_put_guest_xcr0(vcpu);
 	vcpu->guest_fpu_loaded = 1;
 	save_xstates(current);
-	xrstor(&vcpu->arch.guest_fpu, -1);
+	xrstor(&vcpu->arch.guest_fpu.state->xsave, -1);
 	trace_kvm_fpu(1);
 }
 
@@ -5807,7 +5807,7 @@ void kvm_put_guest_fpu(struct kvm_vcpu *vcpu)
 		return;
 
 	vcpu->guest_fpu_loaded = 0;
-	xsave(&vcpu->arch.guest_fpu, -1);
+	xsave(&vcpu->arch.guest_fpu.state->xsave, -1);
 	++vcpu->stat.fpu_reload;
 	kvm_make_request(KVM_REQ_DEACTIVATE_FPU, vcpu);
 	trace_kvm_fpu(0);
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC v2 6/8] x86, xsave: add support for non-lazy xstates
  2011-03-09 19:15 ` [RFC 8/8] x86, xsave: remove lazy allocation of xstate area Hans Rosenfeld
                     ` (5 preceding siblings ...)
  2011-03-23 15:27   ` [RFC v2 5/8] x86, xsave: more cleanups Hans Rosenfeld
@ 2011-03-23 15:27   ` Hans Rosenfeld
  2011-03-23 15:27   ` [RFC v2 7/8] x86, xsave: add kernel support for AMDs Lightweight Profiling (LWP) Hans Rosenfeld
  2011-03-23 15:27   ` [RFC v2 8/8] x86, xsave: remove lazy allocation of xstate area Hans Rosenfeld
  8 siblings, 0 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-03-23 15:27 UTC (permalink / raw)
  To: hpa, tglx, mingo
  Cc: x86, linux-kernel, brgerst, suresh.b.siddha, eranian,
	robert.richter, Andreas.Herrmann3, Hans Rosenfeld

Non-lazy xstates are, as the name suggests,  extended states that cannot
be saved or restored lazily. The state for AMDs LWP feature is an
example of this.

This patch adds support for this kind of xstates. If any such states are
present and supported on the running system, they will always be enabled
in xstate_mask so that they are always restored in switch_to. Since lazy
allocation of the xstate area won't work when non-lazy xstates are used,
all tasks will always have a xstate area preallocated.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/include/asm/i387.h  |   11 +++++++++++
 arch/x86/include/asm/xsave.h |    5 +++--
 arch/x86/kernel/process_32.c |    2 +-
 arch/x86/kernel/process_64.c |    2 +-
 arch/x86/kernel/xsave.c      |   11 ++++++++++-
 5 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index b8f9617..22ad24c 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -330,6 +330,17 @@ static inline void fpu_copy(struct fpu *dst, struct fpu *src)
 
 extern void fpu_finit(struct fpu *fpu);
 
+static inline void fpu_clear(struct fpu *fpu)
+{
+	if (pcntxt_mask & XCNTXT_NONLAZY) {
+		memset(fpu->state, 0, xstate_size);
+		fpu_finit(fpu);
+		set_used_math();
+	} else {
+		fpu_free(fpu);
+	}
+}
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* _ASM_X86_I387_H */
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
index b8861d4..4ccee3c 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
@@ -23,9 +23,10 @@
 /*
  * These are the features that the OS can handle currently.
  */
-#define XCNTXT_MASK	(XSTATE_FP | XSTATE_SSE | XSTATE_YMM)
+#define XCNTXT_LAZY	(XSTATE_FP | XSTATE_SSE | XSTATE_YMM)
+#define XCNTXT_NONLAZY	0
 
-#define XCNTXT_LAZY	XCNTXT_MASK
+#define XCNTXT_MASK	(XCNTXT_LAZY | XCNTXT_NONLAZY)
 
 #ifdef CONFIG_X86_64
 #define REX_PREFIX	"0x48, "
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 8df07c3..a878736 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -257,7 +257,7 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)
 	/*
 	 * Free the old FP and other extended state
 	 */
-	free_thread_xstate(current);
+	fpu_clear(&current->thread.fpu);
 }
 EXPORT_SYMBOL_GPL(start_thread);
 
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 67c5838..67a6bc9 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -344,7 +344,7 @@ start_thread_common(struct pt_regs *regs, unsigned long new_ip,
 	/*
 	 * Free the old FP and other extended state
 	 */
-	free_thread_xstate(current);
+	fpu_clear(&current->thread.fpu);
 }
 
 void
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index 4e5bf58..7b08d32 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -16,6 +16,7 @@
  * Supported feature mask by the CPU and the kernel.
  */
 u64 pcntxt_mask;
+EXPORT_SYMBOL(pcntxt_mask);
 
 /*
  * Represents init state for the supported extended state.
@@ -260,7 +261,7 @@ int restore_xstates_sigframe(void __user *buf, unsigned int size)
 	struct task_struct *tsk = current;
 	struct _fpstate_ia32 __user *fp = buf;
 	struct xsave_struct *xsave;
-	u64 xstate_mask = 0;
+	u64 xstate_mask = pcntxt_mask & XCNTXT_NONLAZY;
 	int err;
 
 	if (!buf) {
@@ -477,6 +478,14 @@ static void __init xstate_enable_boot_cpu(void)
 	printk(KERN_INFO "xsave/xrstor: enabled xstate_bv 0x%llx, "
 	       "cntxt size 0x%x\n",
 	       pcntxt_mask, xstate_size);
+
+	if (pcntxt_mask & XCNTXT_NONLAZY) {
+		static union thread_xstate x;
+
+		task_thread_info(&init_task)->xstate_mask |= XCNTXT_NONLAZY;
+		init_task.thread.fpu.state = &x;
+		fpu_finit(&init_task.thread.fpu);
+	}
 }
 
 /*
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC v2 7/8] x86, xsave: add kernel support for AMDs Lightweight Profiling (LWP)
  2011-03-09 19:15 ` [RFC 8/8] x86, xsave: remove lazy allocation of xstate area Hans Rosenfeld
                     ` (6 preceding siblings ...)
  2011-03-23 15:27   ` [RFC v2 6/8] x86, xsave: add support for non-lazy xstates Hans Rosenfeld
@ 2011-03-23 15:27   ` Hans Rosenfeld
  2011-03-23 15:27   ` [RFC v2 8/8] x86, xsave: remove lazy allocation of xstate area Hans Rosenfeld
  8 siblings, 0 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-03-23 15:27 UTC (permalink / raw)
  To: hpa, tglx, mingo
  Cc: x86, linux-kernel, brgerst, suresh.b.siddha, eranian,
	robert.richter, Andreas.Herrmann3, Hans Rosenfeld

This patch extends the xsave structure to support the LWP state. The
xstate feature bit for LWP is added to XCNTXT_NONLAZY, thereby enabling
kernel support for saving/restoring LWP state. The LWP state is also
saved/restored on signal entry/return, just like all other xstates. LWP
state needs to be reset (disabled) when on entry in a signal handler.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/include/asm/msr-index.h  |    1 +
 arch/x86/include/asm/processor.h  |   12 ++++++++++++
 arch/x86/include/asm/sigcontext.h |   12 ++++++++++++
 arch/x86/include/asm/xsave.h      |    3 ++-
 arch/x86/kernel/xsave.c           |    2 ++
 5 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
index 823d482..0ba2150 100644
--- a/arch/x86/include/asm/msr-index.h
+++ b/arch/x86/include/asm/msr-index.h
@@ -130,6 +130,7 @@
 #define MSR_AMD64_IBSDCPHYSAD		0xc0011039
 #define MSR_AMD64_IBSCTL		0xc001103a
 #define MSR_AMD64_IBSBRTARGET		0xc001103b
+#define MSR_AMD64_LWP_CBADDR		0xc0000106
 
 /* Fam 15h MSRs */
 #define MSR_F15H_PERF_CTL		0xc0010200
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 4c25ab4..df2cbd4 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -353,6 +353,17 @@ struct ymmh_struct {
 	u32 ymmh_space[64];
 };
 
+struct lwp_struct {
+	u64 lwpcb_addr;
+	u32 flags;
+	u32 buf_head_offset;
+	u64 buf_base;
+	u32 buf_size;
+	u32 filters;
+	u64 saved_event_record[4];
+	u32 event_counter[16];
+};
+
 struct xsave_hdr_struct {
 	u64 xstate_bv;
 	u64 reserved1[2];
@@ -363,6 +374,7 @@ struct xsave_struct {
 	struct i387_fxsave_struct i387;
 	struct xsave_hdr_struct xsave_hdr;
 	struct ymmh_struct ymmh;
+	struct lwp_struct lwp;
 	/* new processor state extensions will go here */
 } __attribute__ ((packed, aligned (64)));
 
diff --git a/arch/x86/include/asm/sigcontext.h b/arch/x86/include/asm/sigcontext.h
index 04459d2..0a58b82 100644
--- a/arch/x86/include/asm/sigcontext.h
+++ b/arch/x86/include/asm/sigcontext.h
@@ -274,6 +274,17 @@ struct _ymmh_state {
 	__u32 ymmh_space[64];
 };
 
+struct _lwp_state {
+	__u64 lwpcb_addr;
+	__u32 flags;
+	__u32 buf_head_offset;
+	__u64 buf_base;
+	__u32 buf_size;
+	__u32 filters;
+	__u64 saved_event_record[4];
+	__u32 event_counter[16];
+};
+
 /*
  * Extended state pointed by the fpstate pointer in the sigcontext.
  * In addition to the fpstate, information encoded in the xstate_hdr
@@ -284,6 +295,7 @@ struct _xstate {
 	struct _fpstate fpstate;
 	struct _xsave_hdr xstate_hdr;
 	struct _ymmh_state ymmh;
+	struct _lwp_state lwp;
 	/* new processor state extensions go here */
 };
 
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
index 4ccee3c..be89f0e 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
@@ -9,6 +9,7 @@
 #define XSTATE_FP	0x1
 #define XSTATE_SSE	0x2
 #define XSTATE_YMM	0x4
+#define XSTATE_LWP	(1ULL << 62)
 
 #define XSTATE_FPSSE	(XSTATE_FP | XSTATE_SSE)
 
@@ -24,7 +25,7 @@
  * These are the features that the OS can handle currently.
  */
 #define XCNTXT_LAZY	(XSTATE_FP | XSTATE_SSE | XSTATE_YMM)
-#define XCNTXT_NONLAZY	0
+#define XCNTXT_NONLAZY	(XSTATE_LWP)
 
 #define XCNTXT_MASK	(XCNTXT_LAZY | XCNTXT_NONLAZY)
 
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index 7b08d32..d3dc65e 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -177,6 +177,8 @@ int save_xstates_sigframe(void __user *buf, unsigned int size)
 			(struct _fpstate_ia32 __user *) buf) ? -1 : 1;
 
 	save_xstates(tsk);
+	if (pcntxt_mask & XSTATE_LWP)
+		wrmsrl(MSR_AMD64_LWP_CBADDR, 0);
 	if (use_xsaveopt())
 		sanitize_i387_state(tsk);
 
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC v2 8/8] x86, xsave: remove lazy allocation of xstate area
  2011-03-09 19:15 ` [RFC 8/8] x86, xsave: remove lazy allocation of xstate area Hans Rosenfeld
                     ` (7 preceding siblings ...)
  2011-03-23 15:27   ` [RFC v2 7/8] x86, xsave: add kernel support for AMDs Lightweight Profiling (LWP) Hans Rosenfeld
@ 2011-03-23 15:27   ` Hans Rosenfeld
  2011-03-24 11:39     ` Brian Gerst
  8 siblings, 1 reply; 48+ messages in thread
From: Hans Rosenfeld @ 2011-03-23 15:27 UTC (permalink / raw)
  To: hpa, tglx, mingo
  Cc: x86, linux-kernel, brgerst, suresh.b.siddha, eranian,
	robert.richter, Andreas.Herrmann3, Hans Rosenfeld

This patch completely removes lazy allocation of the xstate area. All
tasks will always have an xstate area preallocated, just like they
already do when non-lazy features are present. The size of the xsave
area ranges from 112 to 960 bytes, depending on the xstates present and
enabled. Since it is common to use SSE etc. for optimization, the actual
overhead is expected to negligible.

This removes some of the special-case handling of non-lazy xstates. It
also greatly simplifies init_fpu() by removing the allocation code, the
check for presence of the xstate area or init_fpu() return value.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/include/asm/i387.h   |   12 +++-------
 arch/x86/kernel/i387.c        |   46 +++++++++++-----------------------------
 arch/x86/kernel/traps.c       |   16 +------------
 arch/x86/kernel/xsave.c       |   21 ++----------------
 arch/x86/kvm/x86.c            |    4 +-
 arch/x86/math-emu/fpu_entry.c |    8 +-----
 6 files changed, 26 insertions(+), 81 deletions(-)

diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index 22ad24c..0448f45 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -40,7 +40,7 @@
 extern unsigned int sig_xstate_size;
 extern void fpu_init(void);
 extern void mxcsr_feature_mask_init(void);
-extern int init_fpu(struct task_struct *child);
+extern void init_fpu(struct task_struct *child);
 extern asmlinkage void math_state_restore(void);
 extern int dump_fpu(struct pt_regs *, struct user_i387_struct *);
 
@@ -332,13 +332,9 @@ extern void fpu_finit(struct fpu *fpu);
 
 static inline void fpu_clear(struct fpu *fpu)
 {
-	if (pcntxt_mask & XCNTXT_NONLAZY) {
-		memset(fpu->state, 0, xstate_size);
-		fpu_finit(fpu);
-		set_used_math();
-	} else {
-		fpu_free(fpu);
-	}
+	memset(fpu->state, 0, xstate_size);
+	fpu_finit(fpu);
+	set_used_math();
 }
 
 #endif /* __ASSEMBLY__ */
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
index 88fefba..32b3c8d 100644
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -42,6 +42,8 @@ void __cpuinit mxcsr_feature_mask_init(void)
 
 static void __cpuinit init_thread_xstate(void)
 {
+	static union thread_xstate x;
+
 	/*
 	 * Note that xstate_size might be overwriten later during
 	 * xsave_init().
@@ -62,6 +64,9 @@ static void __cpuinit init_thread_xstate(void)
 		xstate_size = sizeof(struct i387_fxsave_struct);
 	else
 		xstate_size = sizeof(struct i387_fsave_struct);
+
+	init_task.thread.fpu.state = &x;
+	fpu_finit(&init_task.thread.fpu);
 }
 
 /*
@@ -127,30 +132,20 @@ EXPORT_SYMBOL_GPL(fpu_finit);
  * value at reset if we support XMM instructions and then
  * remeber the current task has used the FPU.
  */
-int init_fpu(struct task_struct *tsk)
+void init_fpu(struct task_struct *tsk)
 {
-	int ret;
-
 	if (tsk_used_math(tsk)) {
 		if (HAVE_HWFP && tsk == current) {
 			preempt_disable();
 			save_xstates(tsk);
 			preempt_enable();
 		}
-		return 0;
+		return;
 	}
 
-	/*
-	 * Memory allocation at the first usage of the FPU and other state.
-	 */
-	ret = fpu_alloc(&tsk->thread.fpu);
-	if (ret)
-		return ret;
-
 	fpu_finit(&tsk->thread.fpu);
 
 	set_stopped_child_used_math(tsk);
-	return 0;
 }
 EXPORT_SYMBOL_GPL(init_fpu);
 
@@ -173,14 +168,10 @@ int xfpregs_get(struct task_struct *target, const struct user_regset *regset,
 		unsigned int pos, unsigned int count,
 		void *kbuf, void __user *ubuf)
 {
-	int ret;
-
 	if (!cpu_has_fxsr)
 		return -ENODEV;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	if (use_xsaveopt())
 		sanitize_i387_state(target);
@@ -198,9 +189,7 @@ int xfpregs_set(struct task_struct *target, const struct user_regset *regset,
 	if (!cpu_has_fxsr)
 		return -ENODEV;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	if (use_xsaveopt())
 		sanitize_i387_state(target);
@@ -232,9 +221,7 @@ int xstateregs_get(struct task_struct *target, const struct user_regset *regset,
 	if (!cpu_has_xsave)
 		return -ENODEV;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	/*
 	 * Copy the 48bytes defined by the software first into the xstate
@@ -262,9 +249,7 @@ int xstateregs_set(struct task_struct *target, const struct user_regset *regset,
 	if (!cpu_has_xsave)
 		return -ENODEV;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
 				 &target->thread.fpu.state->xsave, 0, -1);
@@ -427,11 +412,8 @@ int fpregs_get(struct task_struct *target, const struct user_regset *regset,
 	       void *kbuf, void __user *ubuf)
 {
 	struct user_i387_ia32_struct env;
-	int ret;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	if (!HAVE_HWFP)
 		return fpregs_soft_get(target, regset, pos, count, kbuf, ubuf);
@@ -462,9 +444,7 @@ int fpregs_set(struct task_struct *target, const struct user_regset *regset,
 	struct user_i387_ia32_struct env;
 	int ret;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	if (use_xsaveopt())
 		sanitize_i387_state(target);
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 872fc78..c8fbd04 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -734,20 +734,8 @@ asmlinkage void math_state_restore(void)
 	struct thread_info *thread = current_thread_info();
 	struct task_struct *tsk = thread->task;
 
-	if (!tsk_used_math(tsk)) {
-		local_irq_enable();
-		/*
-		 * does a slab alloc which can sleep
-		 */
-		if (init_fpu(tsk)) {
-			/*
-			 * ran out of memory!
-			 */
-			do_group_exit(SIGKILL);
-			return;
-		}
-		local_irq_disable();
-	}
+	if (!tsk_used_math(tsk))
+		init_fpu(tsk);
 
 	restore_xstates(tsk, XCNTXT_LAZY);
 }
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index d3dc65e..81f54e9 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -264,7 +264,6 @@ int restore_xstates_sigframe(void __user *buf, unsigned int size)
 	struct _fpstate_ia32 __user *fp = buf;
 	struct xsave_struct *xsave;
 	u64 xstate_mask = pcntxt_mask & XCNTXT_NONLAZY;
-	int err;
 
 	if (!buf) {
 		if (used_math()) {
@@ -277,11 +276,8 @@ int restore_xstates_sigframe(void __user *buf, unsigned int size)
 	if (!access_ok(VERIFY_READ, buf, size))
 		return -EACCES;
 
-	if (!used_math()) {
-		err = init_fpu(tsk);
-		if (err)
-			return err;
-	}
+	if (!used_math())
+		init_fpu(tsk);
 
 	if (!HAVE_HWFP) {
 		set_used_math();
@@ -481,13 +477,8 @@ static void __init xstate_enable_boot_cpu(void)
 	       "cntxt size 0x%x\n",
 	       pcntxt_mask, xstate_size);
 
-	if (pcntxt_mask & XCNTXT_NONLAZY) {
-		static union thread_xstate x;
-
+	if (pcntxt_mask & XCNTXT_NONLAZY)
 		task_thread_info(&init_task)->xstate_mask |= XCNTXT_NONLAZY;
-		init_task.thread.fpu.state = &x;
-		fpu_finit(&init_task.thread.fpu);
-	}
 }
 
 /*
@@ -530,9 +521,6 @@ void save_xstates(struct task_struct *tsk)
 {
 	struct thread_info *ti = task_thread_info(tsk);
 
-	if (!fpu_allocated(&tsk->thread.fpu))
-		return;
-
 	xsave(&tsk->thread.fpu.state->xsave, ti->xstate_mask);
 
 	if (!(ti->xstate_mask & XCNTXT_LAZY))
@@ -566,9 +554,6 @@ void restore_xstates(struct task_struct *tsk, u64 mask)
 {
 	struct thread_info *ti = task_thread_info(tsk);
 
-	if (!fpu_allocated(&tsk->thread.fpu))
-		return;
-
 	xrstor(&tsk->thread.fpu.state->xsave, mask);
 
 	ti->xstate_mask |= mask;
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 10aeb04..bd71b12 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5377,8 +5377,8 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
 	int r;
 	sigset_t sigsaved;
 
-	if (!tsk_used_math(current) && init_fpu(current))
-		return -ENOMEM;
+	if (!tsk_used_math(current))
+		init_fpu(current);
 
 	if (vcpu->sigset_active)
 		sigprocmask(SIG_SETMASK, &vcpu->sigset, &sigsaved);
diff --git a/arch/x86/math-emu/fpu_entry.c b/arch/x86/math-emu/fpu_entry.c
index 7718541..472e2b9 100644
--- a/arch/x86/math-emu/fpu_entry.c
+++ b/arch/x86/math-emu/fpu_entry.c
@@ -147,12 +147,8 @@ void math_emulate(struct math_emu_info *info)
 	unsigned long code_limit = 0;	/* Initialized to stop compiler warnings */
 	struct desc_struct code_descriptor;
 
-	if (!used_math()) {
-		if (init_fpu(current)) {
-			do_group_exit(SIGKILL);
-			return;
-		}
-	}
+	if (!used_math())
+		init_fpu(current);
 
 #ifdef RE_ENTRANT_CHECKING
 	if (emulating) {
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [RFC v2 8/8] x86, xsave: remove lazy allocation of xstate area
  2011-03-23 15:27   ` [RFC v2 8/8] x86, xsave: remove lazy allocation of xstate area Hans Rosenfeld
@ 2011-03-24 11:39     ` Brian Gerst
  2011-03-29 14:17       ` Hans Rosenfeld
  0 siblings, 1 reply; 48+ messages in thread
From: Brian Gerst @ 2011-03-24 11:39 UTC (permalink / raw)
  To: Hans Rosenfeld
  Cc: hpa, tglx, mingo, x86, linux-kernel, suresh.b.siddha, eranian,
	robert.richter, Andreas.Herrmann3

On Wed, Mar 23, 2011 at 11:27 AM, Hans Rosenfeld <hans.rosenfeld@amd.com> wrote:
> This patch completely removes lazy allocation of the xstate area. All
> tasks will always have an xstate area preallocated, just like they
> already do when non-lazy features are present. The size of the xsave
> area ranges from 112 to 960 bytes, depending on the xstates present and
> enabled. Since it is common to use SSE etc. for optimization, the actual
> overhead is expected to negligible.
>
> This removes some of the special-case handling of non-lazy xstates. It
> also greatly simplifies init_fpu() by removing the allocation code, the
> check for presence of the xstate area or init_fpu() return value.
>
> Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>

I'm not sure I like this.  I did a quick test on 64-bit, and found
that while most if not all user processes allocated the fpu save area
(probably because of glibc blindly initializing the fpu), kernel
threads did not.  This patch would force kernel threads to allocate
memory they would never use.

--
Brian Gerst

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [RFC v2 8/8] x86, xsave: remove lazy allocation of xstate area
  2011-03-24 11:39     ` Brian Gerst
@ 2011-03-29 14:17       ` Hans Rosenfeld
  2011-03-29 15:27         ` H. Peter Anvin
  0 siblings, 1 reply; 48+ messages in thread
From: Hans Rosenfeld @ 2011-03-29 14:17 UTC (permalink / raw)
  To: Brian Gerst
  Cc: hpa, tglx, mingo, x86, linux-kernel, suresh.b.siddha, eranian,
	Richter, Robert, Herrmann3, Andreas

On Thu, Mar 24, 2011 at 07:39:13AM -0400, Brian Gerst wrote:
> On Wed, Mar 23, 2011 at 11:27 AM, Hans Rosenfeld <hans.rosenfeld@amd.com> wrote:
> > This patch completely removes lazy allocation of the xstate area. All
> > tasks will always have an xstate area preallocated, just like they
> > already do when non-lazy features are present. The size of the xsave
> > area ranges from 112 to 960 bytes, depending on the xstates present and
> > enabled. Since it is common to use SSE etc. for optimization, the actual
> > overhead is expected to negligible.
> >
> > This removes some of the special-case handling of non-lazy xstates. It
> > also greatly simplifies init_fpu() by removing the allocation code, the
> > check for presence of the xstate area or init_fpu() return value.
> >
> > Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
> 
> I'm not sure I like this.  I did a quick test on 64-bit, and found
> that while most if not all user processes allocated the fpu save area
> (probably because of glibc blindly initializing the fpu), kernel
> threads did not.  This patch would force kernel threads to allocate
> memory they would never use.

Yes, up to a few kilobytes would be wasted by kernel threads. The
related code gets much simpler. I think that is a good thing.

Anyway, the patch is not essential for the rework and LWP support, so I
don't really care that much about it.


Did you take a look at the other patches? I haven't yet received a
single comment on them.


Hans


-- 
%SYSTEM-F-ANARCHISM, The operating system has been overthrown


^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [RFC v2 8/8] x86, xsave: remove lazy allocation of xstate area
  2011-03-29 14:17       ` Hans Rosenfeld
@ 2011-03-29 15:27         ` H. Peter Anvin
  2011-03-30 13:11           ` Hans Rosenfeld
                             ` (9 more replies)
  0 siblings, 10 replies; 48+ messages in thread
From: H. Peter Anvin @ 2011-03-29 15:27 UTC (permalink / raw)
  To: Hans Rosenfeld
  Cc: Brian Gerst, tglx, mingo, x86, linux-kernel, suresh.b.siddha,
	eranian, Richter, Robert, Herrmann3, Andreas

On 03/29/2011 07:17 AM, Hans Rosenfeld wrote:
>>
>> I'm not sure I like this.  I did a quick test on 64-bit, and found
>> that while most if not all user processes allocated the fpu save area
>> (probably because of glibc blindly initializing the fpu), kernel
>> threads did not.  This patch would force kernel threads to allocate
>> memory they would never use.
> 
> Yes, up to a few kilobytes would be wasted by kernel threads. The
> related code gets much simpler. I think that is a good thing.
> 

This is silly.  It shouldn't be very hard to allocate this for user
threads while avoiding the allocation for kernel threads.  The only
excuse for allocating it for user threads is if it becomes part of the
kernel stack allocation.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [RFC v2 8/8] x86, xsave: remove lazy allocation of xstate area
  2011-03-29 15:27         ` H. Peter Anvin
@ 2011-03-30 13:11           ` Hans Rosenfeld
  2011-04-05 15:50           ` [RFC v3 0/8] x86, xsave: rework of extended state handling, LWP support Hans Rosenfeld
                             ` (8 subsequent siblings)
  9 siblings, 0 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-03-30 13:11 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Brian Gerst, tglx, mingo, x86, linux-kernel, suresh.b.siddha,
	eranian, Richter, Robert, Herrmann3, Andreas

On Tue, Mar 29, 2011 at 11:27:50AM -0400, H. Peter Anvin wrote:
> On 03/29/2011 07:17 AM, Hans Rosenfeld wrote:
> >>
> >> I'm not sure I like this.  I did a quick test on 64-bit, and found
> >> that while most if not all user processes allocated the fpu save area
> >> (probably because of glibc blindly initializing the fpu), kernel
> >> threads did not.  This patch would force kernel threads to allocate
> >> memory they would never use.
> > 
> > Yes, up to a few kilobytes would be wasted by kernel threads. The
> > related code gets much simpler. I think that is a good thing.
> > 
> 
> This is silly.  It shouldn't be very hard to allocate this for user
> threads while avoiding the allocation for kernel threads.  The only
> excuse for allocating it for user threads is if it becomes part of the
> kernel stack allocation.

The allocation itself is not what I'm concerned about. I'm more worried
about the code that always has to check whether a thread has a xstate
area allocated or not. But I will try and find out to get this done the
way you suggested.


Meanwhile, could you please review the other patches? They are much more
important to me.


Hans


-- 
%SYSTEM-F-ANARCHISM, The operating system has been overthrown


^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC v3 0/8] x86, xsave: rework of extended state handling, LWP support
  2011-03-29 15:27         ` H. Peter Anvin
  2011-03-30 13:11           ` Hans Rosenfeld
@ 2011-04-05 15:50           ` Hans Rosenfeld
  2011-04-07  7:23             ` Ingo Molnar
  2011-04-05 15:50           ` [RFC v3 1/8] x86, xsave: cleanup fpu/xsave support Hans Rosenfeld
                             ` (7 subsequent siblings)
  9 siblings, 1 reply; 48+ messages in thread
From: Hans Rosenfeld @ 2011-04-05 15:50 UTC (permalink / raw)
  To: hpa
  Cc: brgerst, tglx, mingo, suresh.b.siddha, eranian, robert.richter,
	Andreas.Herrmann3, x86, linux-kernel, Hans Rosenfeld

Changes since last patch set:
* fixed pre-allocation of xsave area to exclude kernel threads


This patch set is a general cleanup and rework of the code related to
handling of FPU and other extended states.

All handling of extended states, including the FPU state, is now handled
by xsave/xrstor wrappers that fall back to fxsave/fxrstor, or even
fsave/frstor, if hardware support for those features is lacking.  

Non-lazy xstates, which cannot be restored lazily, can now be easily 
supported with almost no processing overhead. This makes adding basic
support for AMDs LWP almost trivial.

Since non-lazy xstates are inherently incompatible with lazy allocation 
of the xstate area, the complete removal of lazy allocation to further  
reduce code complexity should be considered. Since SSE-optimized library
functions are widely used today, most processes will have an xstate area
anyway, so the memory overhead wouldn't be big enough to be much of an
issue.

Hans Rosenfeld (8):
  x86, xsave: cleanup fpu/xsave support
  x86, xsave: rework fpu/xsave support
  x86, xsave: cleanup fpu/xsave signal frame setup
  x86, xsave: remove unused code
  x86, xsave: more cleanups
  x86, xsave: add support for non-lazy xstates
  x86, xsave: add kernel support for AMDs Lightweight Profiling (LWP)
  x86, xsave: remove lazy allocation of xstate area

 arch/x86/ia32/ia32_signal.c        |    4 +-
 arch/x86/include/asm/i387.h        |  249 ++++++++--------------------
 arch/x86/include/asm/msr-index.h   |    1 +
 arch/x86/include/asm/processor.h   |   12 ++
 arch/x86/include/asm/sigcontext.h  |   12 ++
 arch/x86/include/asm/thread_info.h |    4 +-
 arch/x86/include/asm/xsave.h       |  100 ++---------
 arch/x86/kernel/i387.c             |  305 +++-------------------------------
 arch/x86/kernel/process_32.c       |   29 +--
 arch/x86/kernel/process_64.c       |   28 +---
 arch/x86/kernel/signal.c           |    4 +-
 arch/x86/kernel/traps.c            |   47 +-----
 arch/x86/kernel/xsave.c            |  317 +++++++++++++++++++++++-------------
 arch/x86/kvm/vmx.c                 |    2 +-
 arch/x86/kvm/x86.c                 |   11 +-
 arch/x86/math-emu/fpu_entry.c      |    8 +-
 drivers/lguest/x86/core.c          |    2 +-
 17 files changed, 388 insertions(+), 747 deletions(-)



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC v3 1/8] x86, xsave: cleanup fpu/xsave support
  2011-03-29 15:27         ` H. Peter Anvin
  2011-03-30 13:11           ` Hans Rosenfeld
  2011-04-05 15:50           ` [RFC v3 0/8] x86, xsave: rework of extended state handling, LWP support Hans Rosenfeld
@ 2011-04-05 15:50           ` Hans Rosenfeld
  2011-04-05 15:50           ` [RFC v3 2/8] x86, xsave: rework " Hans Rosenfeld
                             ` (6 subsequent siblings)
  9 siblings, 0 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-04-05 15:50 UTC (permalink / raw)
  To: hpa
  Cc: brgerst, tglx, mingo, suresh.b.siddha, eranian, robert.richter,
	Andreas.Herrmann3, x86, linux-kernel, Hans Rosenfeld

Removed the functions fpu_fxrstor_checking() and restore_fpu_checking()
because they weren't doing anything. Removed redundant xsave/xrstor
implementations. Since xsave/xrstor is not specific to the FPU, and also
for consistency, all xsave/xrstor functions now take a xsave_struct
argument.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/include/asm/i387.h  |   20 +++-------
 arch/x86/include/asm/xsave.h |   81 +++++++++++++++---------------------------
 arch/x86/kernel/traps.c      |    2 +-
 arch/x86/kernel/xsave.c      |    4 +-
 4 files changed, 38 insertions(+), 69 deletions(-)

diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index ef32890..d908383 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -227,12 +227,14 @@ static inline void fpu_fxsave(struct fpu *fpu)
 static inline void fpu_save_init(struct fpu *fpu)
 {
 	if (use_xsave()) {
-		fpu_xsave(fpu);
+		struct xsave_struct *xstate = &fpu->state->xsave;
+
+		fpu_xsave(xstate);
 
 		/*
 		 * xsave header may indicate the init state of the FP.
 		 */
-		if (!(fpu->state->xsave.xsave_hdr.xstate_bv & XSTATE_FP))
+		if (!(xstate->xsave_hdr.xstate_bv & XSTATE_FP))
 			return;
 	} else if (use_fxsr()) {
 		fpu_fxsave(fpu);
@@ -262,22 +264,12 @@ static inline void __save_init_fpu(struct task_struct *tsk)
 	task_thread_info(tsk)->status &= ~TS_USEDFPU;
 }
 
-static inline int fpu_fxrstor_checking(struct fpu *fpu)
-{
-	return fxrstor_checking(&fpu->state->fxsave);
-}
-
 static inline int fpu_restore_checking(struct fpu *fpu)
 {
 	if (use_xsave())
-		return fpu_xrstor_checking(fpu);
+		return xrstor_checking(&fpu->state->xsave, -1);
 	else
-		return fpu_fxrstor_checking(fpu);
-}
-
-static inline int restore_fpu_checking(struct task_struct *tsk)
-{
-	return fpu_restore_checking(&tsk->thread.fpu);
+		return fxrstor_checking(&fpu->state->fxsave);
 }
 
 /*
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
index c6ce245..8bcbbce 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
@@ -42,10 +42,11 @@ extern int check_for_xstate(struct i387_fxsave_struct __user *buf,
 			    void __user *fpstate,
 			    struct _fpx_sw_bytes *sw);
 
-static inline int fpu_xrstor_checking(struct fpu *fpu)
+static inline int xrstor_checking(struct xsave_struct *fx, u64 mask)
 {
-	struct xsave_struct *fx = &fpu->state->xsave;
 	int err;
+	u32 lmask = mask;
+	u32 hmask = mask >> 32;
 
 	asm volatile("1: .byte " REX_PREFIX "0x0f,0xae,0x2f\n\t"
 		     "2:\n"
@@ -55,13 +56,23 @@ static inline int fpu_xrstor_checking(struct fpu *fpu)
 		     ".previous\n"
 		     _ASM_EXTABLE(1b, 3b)
 		     : [err] "=r" (err)
-		     : "D" (fx), "m" (*fx), "a" (-1), "d" (-1), "0" (0)
+		     : "D" (fx), "m" (*fx), "a" (lmask), "d" (hmask), "0" (0)
 		     : "memory");
 
 	return err;
 }
 
-static inline int xsave_user(struct xsave_struct __user *buf)
+static inline void xrstor_state(struct xsave_struct *fx, u64 mask)
+{
+	u32 lmask = mask;
+	u32 hmask = mask >> 32;
+
+	asm volatile(".byte " REX_PREFIX "0x0f,0xae,0x2f\n\t"
+		     : : "D" (fx), "m" (*fx), "a" (lmask), "d" (hmask)
+		     :   "memory");
+}
+
+static inline int xsave_checking(struct xsave_struct __user *buf)
 {
 	int err;
 
@@ -74,58 +85,24 @@ static inline int xsave_user(struct xsave_struct __user *buf)
 	if (unlikely(err))
 		return -EFAULT;
 
-	__asm__ __volatile__("1: .byte " REX_PREFIX "0x0f,0xae,0x27\n"
-			     "2:\n"
-			     ".section .fixup,\"ax\"\n"
-			     "3:  movl $-1,%[err]\n"
-			     "    jmp  2b\n"
-			     ".previous\n"
-			     ".section __ex_table,\"a\"\n"
-			     _ASM_ALIGN "\n"
-			     _ASM_PTR "1b,3b\n"
-			     ".previous"
-			     : [err] "=r" (err)
-			     : "D" (buf), "a" (-1), "d" (-1), "0" (0)
-			     : "memory");
+	asm volatile("1: .byte " REX_PREFIX "0x0f,0xae,0x27\n"
+		     "2:\n"
+		     ".section .fixup,\"ax\"\n"
+		     "3:  movl $-1,%[err]\n"
+		     "    jmp  2b\n"
+		     ".previous\n"
+		     _ASM_EXTABLE(1b,3b)
+		     : [err] "=r" (err)
+		     : "D" (buf), "a" (-1), "d" (-1), "0" (0)
+		     : "memory");
+
 	if (unlikely(err) && __clear_user(buf, xstate_size))
 		err = -EFAULT;
-	/* No need to clear here because the caller clears USED_MATH */
-	return err;
-}
-
-static inline int xrestore_user(struct xsave_struct __user *buf, u64 mask)
-{
-	int err;
-	struct xsave_struct *xstate = ((__force struct xsave_struct *)buf);
-	u32 lmask = mask;
-	u32 hmask = mask >> 32;
 
-	__asm__ __volatile__("1: .byte " REX_PREFIX "0x0f,0xae,0x2f\n"
-			     "2:\n"
-			     ".section .fixup,\"ax\"\n"
-			     "3:  movl $-1,%[err]\n"
-			     "    jmp  2b\n"
-			     ".previous\n"
-			     ".section __ex_table,\"a\"\n"
-			     _ASM_ALIGN "\n"
-			     _ASM_PTR "1b,3b\n"
-			     ".previous"
-			     : [err] "=r" (err)
-			     : "D" (xstate), "a" (lmask), "d" (hmask), "0" (0)
-			     : "memory");	/* memory required? */
+	/* No need to clear here because the caller clears USED_MATH */
 	return err;
 }
 
-static inline void xrstor_state(struct xsave_struct *fx, u64 mask)
-{
-	u32 lmask = mask;
-	u32 hmask = mask >> 32;
-
-	asm volatile(".byte " REX_PREFIX "0x0f,0xae,0x2f\n\t"
-		     : : "D" (fx), "m" (*fx), "a" (lmask), "d" (hmask)
-		     :   "memory");
-}
-
 static inline void xsave_state(struct xsave_struct *fx, u64 mask)
 {
 	u32 lmask = mask;
@@ -136,7 +113,7 @@ static inline void xsave_state(struct xsave_struct *fx, u64 mask)
 		     :   "memory");
 }
 
-static inline void fpu_xsave(struct fpu *fpu)
+static inline void fpu_xsave(struct xsave_struct *fx)
 {
 	/* This, however, we can work around by forcing the compiler to select
 	   an addressing mode that doesn't require extended registers. */
@@ -144,7 +121,7 @@ static inline void fpu_xsave(struct fpu *fpu)
 		".byte " REX_PREFIX "0x0f,0xae,0x27",
 		".byte " REX_PREFIX "0x0f,0xae,0x37",
 		X86_FEATURE_XSAVEOPT,
-		[fx] "D" (&fpu->state->xsave), "a" (-1), "d" (-1) :
+		[fx] "D" (fx), "a" (-1), "d" (-1) :
 		"memory");
 }
 #endif
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index b9b6716..32f3043 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -728,7 +728,7 @@ void __math_state_restore(void)
 	/*
 	 * Paranoid restore. send a SIGSEGV if we fail to restore the state.
 	 */
-	if (unlikely(restore_fpu_checking(tsk))) {
+	if (unlikely(fpu_restore_checking(&tsk->thread.fpu))) {
 		stts();
 		force_sig(SIGSEGV, tsk);
 		return;
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index a391134..6b063d7 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -170,7 +170,7 @@ int save_i387_xstate(void __user *buf)
 
 	if (task_thread_info(tsk)->status & TS_USEDFPU) {
 		if (use_xsave())
-			err = xsave_user(buf);
+			err = xsave_checking(buf);
 		else
 			err = fxsave_user(buf);
 
@@ -247,7 +247,7 @@ static int restore_user_xstate(void __user *buf)
 	/*
 	 * restore the state passed by the user.
 	 */
-	err = xrestore_user(buf, mask);
+	err = xrstor_checking((__force struct xsave_struct *)buf, mask);
 	if (err)
 		return err;
 
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC v3 2/8] x86, xsave: rework fpu/xsave support
  2011-03-29 15:27         ` H. Peter Anvin
                             ` (2 preceding siblings ...)
  2011-04-05 15:50           ` [RFC v3 1/8] x86, xsave: cleanup fpu/xsave support Hans Rosenfeld
@ 2011-04-05 15:50           ` Hans Rosenfeld
  2011-04-05 15:50           ` [RFC v3 3/8] x86, xsave: cleanup fpu/xsave signal frame setup Hans Rosenfeld
                             ` (5 subsequent siblings)
  9 siblings, 0 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-04-05 15:50 UTC (permalink / raw)
  To: hpa
  Cc: brgerst, tglx, mingo, suresh.b.siddha, eranian, robert.richter,
	Andreas.Herrmann3, x86, linux-kernel, Hans Rosenfeld

This is a complete rework of the code that handles FPU and related
extended states. Since FPU, XMM and YMM states are just variants of what
xsave handles, all of the old FPU-specific state handling code will be
hidden behind a set of functions that resemble xsave and xrstor. For
hardware that does not support xsave, the code falls back to
fxsave/fxrstor or even fsave/frstor.

A xstate_mask member will be added to the thread_info structure that
will control which states are to be saved by xsave. It is set to include
all "lazy" states (that is, all states currently supported: FPU, XMM and
YMM) by the #NM handler when a lazy restore is triggered or by
switch_to() when the tasks FPU context is preloaded. Xstate_mask is
intended to completely replace TS_USEDFPU in a later cleanup patch.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/include/asm/i387.h        |   44 +++++++++++++++++++---
 arch/x86/include/asm/thread_info.h |    2 +
 arch/x86/include/asm/xsave.h       |   14 ++++++-
 arch/x86/kernel/i387.c             |   11 ++++--
 arch/x86/kernel/process_32.c       |   27 +++++---------
 arch/x86/kernel/process_64.c       |   26 ++++----------
 arch/x86/kernel/traps.c            |   11 +++---
 arch/x86/kernel/xsave.c            |   71 ++++++++++++++++++++++++++++++++++++
 arch/x86/kvm/x86.c                 |    7 ++--
 drivers/lguest/x86/core.c          |    2 +-
 10 files changed, 158 insertions(+), 57 deletions(-)

diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index d908383..939af08 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -224,12 +224,46 @@ static inline void fpu_fxsave(struct fpu *fpu)
 /*
  * These must be called with preempt disabled
  */
+static inline void fpu_restore(struct fpu *fpu)
+{
+	fxrstor_checking(&fpu->state->fxsave);
+}
+
+static inline void fpu_save(struct fpu *fpu)
+{
+	if (use_fxsr()) {
+		fpu_fxsave(fpu);
+	} else {
+		asm volatile("fsave %[fx]; fwait"
+			     : [fx] "=m" (fpu->state->fsave));
+	}
+}
+
+static inline void fpu_clean(struct fpu *fpu)
+{
+	u32 swd = (use_fxsr() || use_xsave()) ?
+		fpu->state->fxsave.swd : fpu->state->fsave.swd;
+
+	if (unlikely(swd & X87_FSW_ES))
+		asm volatile("fnclex");
+
+	/* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
+	   is pending.  Clear the x87 state here by setting it to fixed
+	   values. safe_address is a random variable that should be in L1 */
+	alternative_input(
+		ASM_NOP8 ASM_NOP2,
+		"emms\n\t"	  	/* clear stack tags */
+		"fildl %P[addr]",	/* set F?P to defined value */
+		X86_FEATURE_FXSAVE_LEAK,
+		[addr] "m" (safe_address));
+}
+
 static inline void fpu_save_init(struct fpu *fpu)
 {
 	if (use_xsave()) {
 		struct xsave_struct *xstate = &fpu->state->xsave;
 
-		fpu_xsave(xstate);
+		fpu_xsave(xstate, -1);
 
 		/*
 		 * xsave header may indicate the init state of the FP.
@@ -295,18 +329,16 @@ static inline void __clear_fpu(struct task_struct *tsk)
 			     "2:\n"
 			     _ASM_EXTABLE(1b, 2b));
 		task_thread_info(tsk)->status &= ~TS_USEDFPU;
+		task_thread_info(tsk)->xstate_mask &= ~XCNTXT_LAZY;
 		stts();
 	}
 }
 
 static inline void kernel_fpu_begin(void)
 {
-	struct thread_info *me = current_thread_info();
 	preempt_disable();
-	if (me->status & TS_USEDFPU)
-		__save_init_fpu(me->task);
-	else
-		clts();
+	save_xstates(current_thread_info()->task);
+	clts();
 }
 
 static inline void kernel_fpu_end(void)
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index 1f2e61e..ec12d62 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -26,6 +26,7 @@ struct exec_domain;
 struct thread_info {
 	struct task_struct	*task;		/* main task structure */
 	struct exec_domain	*exec_domain;	/* execution domain */
+	__u64			xstate_mask;	/* xstates in use */
 	__u32			flags;		/* low level flags */
 	__u32			status;		/* thread synchronous flags */
 	__u32			cpu;		/* current CPU */
@@ -47,6 +48,7 @@ struct thread_info {
 {						\
 	.task		= &tsk,			\
 	.exec_domain	= &default_exec_domain,	\
+	.xstate_mask	= 0,			\
 	.flags		= 0,			\
 	.cpu		= 0,			\
 	.preempt_count	= INIT_PREEMPT_COUNT,	\
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
index 8bcbbce..6052a84 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
@@ -25,6 +25,8 @@
  */
 #define XCNTXT_MASK	(XSTATE_FP | XSTATE_SSE | XSTATE_YMM)
 
+#define XCNTXT_LAZY	XCNTXT_MASK
+
 #ifdef CONFIG_X86_64
 #define REX_PREFIX	"0x48, "
 #else
@@ -35,6 +37,11 @@ extern unsigned int xstate_size;
 extern u64 pcntxt_mask;
 extern u64 xstate_fx_sw_bytes[USER_XSTATE_FX_SW_WORDS];
 
+extern void xsave(struct fpu *, u64);
+extern void xrstor(struct fpu *, u64);
+extern void save_xstates(struct task_struct *);
+extern void restore_xstates(struct task_struct *, u64);
+
 extern void xsave_init(void);
 extern void update_regset_xstate_info(unsigned int size, u64 xstate_mask);
 extern int init_fpu(struct task_struct *child);
@@ -113,15 +120,18 @@ static inline void xsave_state(struct xsave_struct *fx, u64 mask)
 		     :   "memory");
 }
 
-static inline void fpu_xsave(struct xsave_struct *fx)
+static inline void fpu_xsave(struct xsave_struct *fx, u64 mask)
 {
+	u32 lmask = mask;
+	u32 hmask = mask >> 32;
+
 	/* This, however, we can work around by forcing the compiler to select
 	   an addressing mode that doesn't require extended registers. */
 	alternative_input(
 		".byte " REX_PREFIX "0x0f,0xae,0x27",
 		".byte " REX_PREFIX "0x0f,0xae,0x37",
 		X86_FEATURE_XSAVEOPT,
-		[fx] "D" (fx), "a" (-1), "d" (-1) :
+		[fx] "D" (fx), "a" (lmask), "d" (hmask) :
 		"memory");
 }
 #endif
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
index 12aff25..1088ac5 100644
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -152,8 +152,11 @@ int init_fpu(struct task_struct *tsk)
 	int ret;
 
 	if (tsk_used_math(tsk)) {
-		if (HAVE_HWFP && tsk == current)
-			unlazy_fpu(tsk);
+		if (HAVE_HWFP && tsk == current) {
+			preempt_disable();
+			save_xstates(tsk);
+			preempt_enable();
+		}
 		return 0;
 	}
 
@@ -600,7 +603,9 @@ int save_i387_xstate_ia32(void __user *buf)
 				       NULL, fp) ? -1 : 1;
 	}
 
-	unlazy_fpu(tsk);
+	preempt_disable();
+	save_xstates(tsk);
+	preempt_enable();
 
 	if (cpu_has_xsave)
 		return save_i387_xsave(fp);
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 8d12878..8df07c3 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -185,7 +185,9 @@ void release_thread(struct task_struct *dead_task)
  */
 void prepare_to_copy(struct task_struct *tsk)
 {
-	unlazy_fpu(tsk);
+	preempt_disable();
+	save_xstates(tsk);
+	preempt_enable();
 }
 
 int copy_thread(unsigned long clone_flags, unsigned long sp,
@@ -294,21 +296,13 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 				 *next = &next_p->thread;
 	int cpu = smp_processor_id();
 	struct tss_struct *tss = &per_cpu(init_tss, cpu);
-	bool preload_fpu;
 
 	/* never put a printk in __switch_to... printk() calls wake_up*() indirectly */
 
-	/*
-	 * If the task has used fpu the last 5 timeslices, just do a full
-	 * restore of the math state immediately to avoid the trap; the
-	 * chances of needing FPU soon are obviously high now
-	 */
-	preload_fpu = tsk_used_math(next_p) && next_p->fpu_counter > 5;
-
-	__unlazy_fpu(prev_p);
+	save_xstates(prev_p);
 
 	/* we're going to use this soon, after a few expensive things */
-	if (preload_fpu)
+	if (task_thread_info(next_p)->xstate_mask)
 		prefetch(next->fpu.state);
 
 	/*
@@ -349,11 +343,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 		     task_thread_info(next_p)->flags & _TIF_WORK_CTXSW_NEXT))
 		__switch_to_xtra(prev_p, next_p, tss);
 
-	/* If we're going to preload the fpu context, make sure clts
-	   is run while we're batching the cpu state updates. */
-	if (preload_fpu)
-		clts();
-
 	/*
 	 * Leave lazy mode, flushing any hypercalls made here.
 	 * This must be done before restoring TLS segments so
@@ -363,8 +352,10 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 	 */
 	arch_end_context_switch(next_p);
 
-	if (preload_fpu)
-		__math_state_restore();
+	/*
+	 * Restore enabled extended states for the task.
+	 */
+	restore_xstates(next_p, task_thread_info(next_p)->xstate_mask);
 
 	/*
 	 * Restore %gs if needed (which is common)
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 6c9dd92..cbf1a67 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -249,7 +249,9 @@ static inline u32 read_32bit_tls(struct task_struct *t, int tls)
  */
 void prepare_to_copy(struct task_struct *tsk)
 {
-	unlazy_fpu(tsk);
+	preempt_disable();
+	save_xstates(tsk);
+	preempt_enable();
 }
 
 int copy_thread(unsigned long clone_flags, unsigned long sp,
@@ -378,17 +380,9 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 	int cpu = smp_processor_id();
 	struct tss_struct *tss = &per_cpu(init_tss, cpu);
 	unsigned fsindex, gsindex;
-	bool preload_fpu;
-
-	/*
-	 * If the task has used fpu the last 5 timeslices, just do a full
-	 * restore of the math state immediately to avoid the trap; the
-	 * chances of needing FPU soon are obviously high now
-	 */
-	preload_fpu = tsk_used_math(next_p) && next_p->fpu_counter > 5;
 
 	/* we're going to use this soon, after a few expensive things */
-	if (preload_fpu)
+	if (task_thread_info(next_p)->xstate_mask)
 		prefetch(next->fpu.state);
 
 	/*
@@ -420,11 +414,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 	load_TLS(next, cpu);
 
 	/* Must be after DS reload */
-	__unlazy_fpu(prev_p);
-
-	/* Make sure cpu is ready for new context */
-	if (preload_fpu)
-		clts();
+	save_xstates(prev_p);
 
 	/*
 	 * Leave lazy mode, flushing any hypercalls made here.
@@ -485,11 +475,9 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 		__switch_to_xtra(prev_p, next_p, tss);
 
 	/*
-	 * Preload the FPU context, now that we've determined that the
-	 * task is likely to be using it. 
+	 * Restore enabled extended states for the task.
 	 */
-	if (preload_fpu)
-		__math_state_restore();
+	restore_xstates(next_p, task_thread_info(next_p)->xstate_mask);
 
 	return prev_p;
 }
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 32f3043..072c30e 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -625,7 +625,10 @@ void math_error(struct pt_regs *regs, int error_code, int trapnr)
 	/*
 	 * Save the info for the exception handler and clear the error.
 	 */
-	save_init_fpu(task);
+	preempt_disable();
+	save_xstates(task);
+	preempt_enable();
+
 	task->thread.trap_no = trapnr;
 	task->thread.error_code = error_code;
 	info.si_signo = SIGFPE;
@@ -734,7 +737,7 @@ void __math_state_restore(void)
 		return;
 	}
 
-	thread->status |= TS_USEDFPU;	/* So we fnsave on switch_to() */
+	thread->status |= TS_USEDFPU;   /* So we fnsave on switch_to() */
 	tsk->fpu_counter++;
 }
 
@@ -768,9 +771,7 @@ asmlinkage void math_state_restore(void)
 		local_irq_disable();
 	}
 
-	clts();				/* Allow maths ops (or we recurse) */
-
-	__math_state_restore();
+	restore_xstates(tsk, XCNTXT_LAZY);
 }
 EXPORT_SYMBOL_GPL(math_state_restore);
 
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index 6b063d7..d9fa41f 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -5,6 +5,7 @@
  */
 #include <linux/bootmem.h>
 #include <linux/compat.h>
+#include <linux/module.h>
 #include <asm/i387.h>
 #ifdef CONFIG_IA32_EMULATION
 #include <asm/sigcontext32.h>
@@ -474,3 +475,73 @@ void __cpuinit xsave_init(void)
 	next_func = xstate_enable;
 	this_func();
 }
+
+void xsave(struct fpu *fpu, u64 mask)
+{
+	clts();
+
+	if (use_xsave())
+		fpu_xsave(&fpu->state->xsave, mask);
+	else if (mask & XCNTXT_LAZY)
+		fpu_save(fpu);
+
+	if (mask & XCNTXT_LAZY)
+		fpu_clean(fpu);
+
+	stts();
+}
+EXPORT_SYMBOL(xsave);
+
+void save_xstates(struct task_struct *tsk)
+{
+	struct thread_info *ti = task_thread_info(tsk);
+
+	if (!fpu_allocated(&tsk->thread.fpu))
+		return;
+
+	xsave(&tsk->thread.fpu, ti->xstate_mask);
+
+	if (!(ti->xstate_mask & XCNTXT_LAZY))
+		tsk->fpu_counter = 0;
+
+	/*
+	 * If the task hasn't used the fpu the last 5 timeslices,
+	 * force a lazy restore of the math states by clearing them
+	 * from xstate_mask.
+	 */
+	if (tsk->fpu_counter < 5)
+		ti->xstate_mask &= ~XCNTXT_LAZY;
+
+	ti->status &= ~TS_USEDFPU;
+}
+EXPORT_SYMBOL(save_xstates);
+
+void xrstor(struct fpu *fpu, u64 mask)
+{
+	clts();
+
+	if (use_xsave())
+		xrstor_state(&fpu->state->xsave, mask);
+	else if (mask & XCNTXT_LAZY)
+		fpu_restore(fpu);
+
+	if (!(mask & XCNTXT_LAZY))
+		stts();
+}
+EXPORT_SYMBOL(xrstor);
+
+void restore_xstates(struct task_struct *tsk, u64 mask)
+{
+	struct thread_info *ti = task_thread_info(tsk);
+
+	if (!fpu_allocated(&tsk->thread.fpu))
+		return;
+
+	xrstor(&tsk->thread.fpu, mask);
+
+	ti->xstate_mask |= mask;
+	ti->status |= TS_USEDFPU;
+	if (mask & XCNTXT_LAZY)
+		tsk->fpu_counter++;
+}
+EXPORT_SYMBOL(restore_xstates);
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 58f517b..aae9e8f 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -58,6 +58,7 @@
 #include <asm/xcr.h>
 #include <asm/pvclock.h>
 #include <asm/div64.h>
+#include <asm/xsave.h>
 
 #define MAX_IO_MSRS 256
 #define CR0_RESERVED_BITS						\
@@ -5803,8 +5804,8 @@ void kvm_load_guest_fpu(struct kvm_vcpu *vcpu)
 	 */
 	kvm_put_guest_xcr0(vcpu);
 	vcpu->guest_fpu_loaded = 1;
-	unlazy_fpu(current);
-	fpu_restore_checking(&vcpu->arch.guest_fpu);
+	save_xstates(current);
+	xrstor(&vcpu->arch.guest_fpu, -1);
 	trace_kvm_fpu(1);
 }
 
@@ -5816,7 +5817,7 @@ void kvm_put_guest_fpu(struct kvm_vcpu *vcpu)
 		return;
 
 	vcpu->guest_fpu_loaded = 0;
-	fpu_save_init(&vcpu->arch.guest_fpu);
+	xsave(&vcpu->arch.guest_fpu, -1);
 	++vcpu->stat.fpu_reload;
 	kvm_make_request(KVM_REQ_DEACTIVATE_FPU, vcpu);
 	trace_kvm_fpu(0);
diff --git a/drivers/lguest/x86/core.c b/drivers/lguest/x86/core.c
index 9f1659c..ef62289 100644
--- a/drivers/lguest/x86/core.c
+++ b/drivers/lguest/x86/core.c
@@ -204,7 +204,7 @@ void lguest_arch_run_guest(struct lg_cpu *cpu)
 	 * uses the FPU.
 	 */
 	if (cpu->ts)
-		unlazy_fpu(current);
+		save_xstates(current);
 
 	/*
 	 * SYSENTER is an optimized way of doing system calls.  We can't allow
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC v3 3/8] x86, xsave: cleanup fpu/xsave signal frame setup
  2011-03-29 15:27         ` H. Peter Anvin
                             ` (3 preceding siblings ...)
  2011-04-05 15:50           ` [RFC v3 2/8] x86, xsave: rework " Hans Rosenfeld
@ 2011-04-05 15:50           ` Hans Rosenfeld
  2011-04-05 15:50           ` [RFC v3 4/8] x86, xsave: remove unused code Hans Rosenfeld
                             ` (4 subsequent siblings)
  9 siblings, 0 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-04-05 15:50 UTC (permalink / raw)
  To: hpa
  Cc: brgerst, tglx, mingo, suresh.b.siddha, eranian, robert.richter,
	Andreas.Herrmann3, x86, linux-kernel, Hans Rosenfeld

There are currently two code paths that handle the fpu/xsave context in
a signal frame for 32bit and 64bit tasks. These two code paths differ
only in that they have or lack certain micro-optimizations or do some
additional work (fsave compatibility for 32bit). The code is complex,
mostly duplicate and hard to understand and maintain.

This patch creates a set of two new, unified and cleaned up functions to
replace them. Besides avoiding the duplicate code, it is now obvious
what is done in which situations. The micro-optimization w.r.t xsave
(saving and restoring directly from the user buffer) is gone, and with
it the headaches caused by it about validating the buffer alignment and
contents and catching possible xsave/xrstor faults.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/ia32/ia32_signal.c  |    4 +-
 arch/x86/include/asm/i387.h  |   20 ++++
 arch/x86/include/asm/xsave.h |    4 +-
 arch/x86/kernel/i387.c       |   32 ++------
 arch/x86/kernel/signal.c     |    4 +-
 arch/x86/kernel/xsave.c      |  197 ++++++++++++++++++++++++++++++++++++++++--
 6 files changed, 225 insertions(+), 36 deletions(-)

diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c
index 588a7aa..2605fae 100644
--- a/arch/x86/ia32/ia32_signal.c
+++ b/arch/x86/ia32/ia32_signal.c
@@ -255,7 +255,7 @@ static int ia32_restore_sigcontext(struct pt_regs *regs,
 
 		get_user_ex(tmp, &sc->fpstate);
 		buf = compat_ptr(tmp);
-		err |= restore_i387_xstate_ia32(buf);
+		err |= restore_xstates_sigframe(buf, sig_xstate_ia32_size);
 
 		get_user_ex(*pax, &sc->ax);
 	} get_user_catch(err);
@@ -396,7 +396,7 @@ static void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
 	if (used_math()) {
 		sp = sp - sig_xstate_ia32_size;
 		*fpstate = (struct _fpstate_ia32 *) sp;
-		if (save_i387_xstate_ia32(*fpstate) < 0)
+		if (save_xstates_sigframe(*fpstate, sig_xstate_ia32_size) < 0)
 			return (void __user *) -1L;
 	}
 
diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index 939af08..30930bf 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -25,6 +25,20 @@
 #include <asm/uaccess.h>
 #include <asm/xsave.h>
 
+#ifdef CONFIG_X86_64
+# include <asm/sigcontext32.h>
+# include <asm/user32.h>
+#else
+# define save_i387_xstate_ia32		save_i387_xstate
+# define restore_i387_xstate_ia32	restore_i387_xstate
+# define _fpstate_ia32		_fpstate
+# define _xstate_ia32		_xstate
+# define sig_xstate_ia32_size   sig_xstate_size
+# define fx_sw_reserved_ia32	fx_sw_reserved
+# define user_i387_ia32_struct	user_i387_struct
+# define user32_fxsr_struct	user_fxsr_struct
+#endif
+
 extern unsigned int sig_xstate_size;
 extern void fpu_init(void);
 extern void mxcsr_feature_mask_init(void);
@@ -33,6 +47,9 @@ extern asmlinkage void math_state_restore(void);
 extern void __math_state_restore(void);
 extern int dump_fpu(struct pt_regs *, struct user_i387_struct *);
 
+extern void convert_from_fxsr(struct user_i387_ia32_struct *, struct task_struct *);
+extern void convert_to_fxsr(struct task_struct *, const struct user_i387_ia32_struct *);
+
 extern user_regset_active_fn fpregs_active, xfpregs_active;
 extern user_regset_get_fn fpregs_get, xfpregs_get, fpregs_soft_get,
 				xstateregs_get;
@@ -46,6 +63,7 @@ extern user_regset_set_fn fpregs_set, xfpregs_set, fpregs_soft_set,
 #define xstateregs_active	fpregs_active
 
 extern struct _fpx_sw_bytes fx_sw_reserved;
+extern unsigned int mxcsr_feature_mask;
 #ifdef CONFIG_IA32_EMULATION
 extern unsigned int sig_xstate_ia32_size;
 extern struct _fpx_sw_bytes fx_sw_reserved_ia32;
@@ -56,8 +74,10 @@ extern int restore_i387_xstate_ia32(void __user *buf);
 #endif
 
 #ifdef CONFIG_MATH_EMULATION
+# define HAVE_HWFP		(boot_cpu_data.hard_math)
 extern void finit_soft_fpu(struct i387_soft_struct *soft);
 #else
+# define HAVE_HWFP		1
 static inline void finit_soft_fpu(struct i387_soft_struct *soft) {}
 #endif
 
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
index 6052a84..200c56d 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
@@ -41,12 +41,14 @@ extern void xsave(struct fpu *, u64);
 extern void xrstor(struct fpu *, u64);
 extern void save_xstates(struct task_struct *);
 extern void restore_xstates(struct task_struct *, u64);
+extern int save_xstates_sigframe(void __user *, unsigned int);
+extern int restore_xstates_sigframe(void __user *, unsigned int);
 
 extern void xsave_init(void);
 extern void update_regset_xstate_info(unsigned int size, u64 xstate_mask);
 extern int init_fpu(struct task_struct *child);
 extern int check_for_xstate(struct i387_fxsave_struct __user *buf,
-			    void __user *fpstate,
+			    unsigned int size,
 			    struct _fpx_sw_bytes *sw);
 
 static inline int xrstor_checking(struct xsave_struct *fx, u64 mask)
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
index 1088ac5..69625a8 100644
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -18,27 +18,7 @@
 #include <asm/i387.h>
 #include <asm/user.h>
 
-#ifdef CONFIG_X86_64
-# include <asm/sigcontext32.h>
-# include <asm/user32.h>
-#else
-# define save_i387_xstate_ia32		save_i387_xstate
-# define restore_i387_xstate_ia32	restore_i387_xstate
-# define _fpstate_ia32		_fpstate
-# define _xstate_ia32		_xstate
-# define sig_xstate_ia32_size   sig_xstate_size
-# define fx_sw_reserved_ia32	fx_sw_reserved
-# define user_i387_ia32_struct	user_i387_struct
-# define user32_fxsr_struct	user_fxsr_struct
-#endif
-
-#ifdef CONFIG_MATH_EMULATION
-# define HAVE_HWFP		(boot_cpu_data.hard_math)
-#else
-# define HAVE_HWFP		1
-#endif
-
-static unsigned int		mxcsr_feature_mask __read_mostly = 0xffffffffu;
+unsigned int mxcsr_feature_mask __read_mostly = 0xffffffffu;
 unsigned int xstate_size;
 EXPORT_SYMBOL_GPL(xstate_size);
 unsigned int sig_xstate_ia32_size = sizeof(struct _fpstate_ia32);
@@ -375,7 +355,7 @@ static inline u32 twd_fxsr_to_i387(struct i387_fxsave_struct *fxsave)
  * FXSR floating point environment conversions.
  */
 
-static void
+void
 convert_from_fxsr(struct user_i387_ia32_struct *env, struct task_struct *tsk)
 {
 	struct i387_fxsave_struct *fxsave = &tsk->thread.fpu.state->fxsave;
@@ -412,8 +392,8 @@ convert_from_fxsr(struct user_i387_ia32_struct *env, struct task_struct *tsk)
 		memcpy(&to[i], &from[i], sizeof(to[0]));
 }
 
-static void convert_to_fxsr(struct task_struct *tsk,
-			    const struct user_i387_ia32_struct *env)
+void convert_to_fxsr(struct task_struct *tsk,
+		     const struct user_i387_ia32_struct *env)
 
 {
 	struct i387_fxsave_struct *fxsave = &tsk->thread.fpu.state->fxsave;
@@ -653,7 +633,9 @@ static int restore_i387_xsave(void __user *buf)
 	u64 mask;
 	int err;
 
-	if (check_for_xstate(fx, buf, &fx_sw_user))
+	if (check_for_xstate(fx, sig_xstate_ia32_size -
+			     offsetof(struct _fpstate_ia32, _fxsr_env),
+			     &fx_sw_user))
 		goto fx_only;
 
 	mask = fx_sw_user.xstate_bv;
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index 4fd173c..f6705ff 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -117,7 +117,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc,
 		regs->orig_ax = -1;		/* disable syscall checks */
 
 		get_user_ex(buf, &sc->fpstate);
-		err |= restore_i387_xstate(buf);
+		err |= restore_xstates_sigframe(buf, sig_xstate_size);
 
 		get_user_ex(*pax, &sc->ax);
 	} get_user_catch(err);
@@ -252,7 +252,7 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size,
 		return (void __user *)-1L;
 
 	/* save i387 state */
-	if (used_math() && save_i387_xstate(*fpstate) < 0)
+	if (used_math() && save_xstates_sigframe(*fpstate, sig_xstate_size) < 0)
 		return (void __user *)-1L;
 
 	return (void __user *)sp;
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index d9fa41f..08b2fe8 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -103,8 +103,7 @@ void __sanitize_i387_state(struct task_struct *tsk)
  * Check for the presence of extended state information in the
  * user fpstate pointer in the sigcontext.
  */
-int check_for_xstate(struct i387_fxsave_struct __user *buf,
-		     void __user *fpstate,
+int check_for_xstate(struct i387_fxsave_struct __user *buf, unsigned int size,
 		     struct _fpx_sw_bytes *fx_sw_user)
 {
 	int min_xstate_size = sizeof(struct i387_fxsave_struct) +
@@ -131,11 +130,11 @@ int check_for_xstate(struct i387_fxsave_struct __user *buf,
 	    fx_sw_user->xstate_size > fx_sw_user->extended_size)
 		return -EINVAL;
 
-	err = __get_user(magic2, (__u32 *) (((void *)fpstate) +
-					    fx_sw_user->extended_size -
+	err = __get_user(magic2, (__u32 *) (((void *)buf) + size -
 					    FP_XSTATE_MAGIC2_SIZE));
 	if (err)
 		return err;
+
 	/*
 	 * Check for the presence of second magic word at the end of memory
 	 * layout. This detects the case where the user just copied the legacy
@@ -148,11 +147,109 @@ int check_for_xstate(struct i387_fxsave_struct __user *buf,
 	return 0;
 }
 
-#ifdef CONFIG_X86_64
 /*
  * Signal frame handlers.
  */
+int save_xstates_sigframe(void __user *buf, unsigned int size)
+{
+	void __user *buf_fxsave = buf;
+	struct task_struct *tsk = current;
+	struct xsave_struct *xsave = &tsk->thread.fpu.state->xsave;
+#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
+	int ia32 = size == sig_xstate_ia32_size;
+#endif
+	int err;
+
+	if (!access_ok(VERIFY_WRITE, buf, size))
+		return -EACCES;
+
+	BUG_ON(size < xstate_size);
+
+	if (!used_math())
+		return 0;
+
+	clear_used_math(); /* trigger finit */
+
+	if (!HAVE_HWFP)
+		return fpregs_soft_get(current, NULL, 0,
+			sizeof(struct user_i387_ia32_struct), NULL,
+			(struct _fpstate_ia32 __user *) buf) ? -1 : 1;
+
+	save_xstates(tsk);
+	sanitize_i387_state(tsk);
+
+#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
+	if (ia32) {
+		if (use_xsave() || use_fxsr()) {
+			struct user_i387_ia32_struct env;
+			struct _fpstate_ia32 __user *fp = buf;
+
+			convert_from_fxsr(&env, tsk);
+			if (__copy_to_user(buf, &env, sizeof(env)))
+				return -1;
+
+			err  = __put_user(xsave->i387.swd, &fp->status);
+			err |= __put_user(X86_FXSR_MAGIC, &fp->magic);
+
+			if (err)
+				return -1;
+
+			buf_fxsave = fp->_fxsr_env;
+			size -= offsetof(struct _fpstate_ia32, _fxsr_env);
+#if defined(CONFIG_X86_64)
+			buf = buf_fxsave;
+#endif
+		} else {
+			struct i387_fsave_struct *fsave =
+				&tsk->thread.fpu.state->fsave;
+
+			fsave->status = fsave->swd;
+		}
+	}
+#endif
 
+	if (__copy_to_user(buf_fxsave, xsave, size))
+		return -1;
+
+	if (use_xsave()) {
+		struct _fpstate __user *fp = buf;
+		struct _xstate __user *x = buf;
+		u64 xstate_bv = xsave->xsave_hdr.xstate_bv;
+
+		err = __copy_to_user(&fp->sw_reserved,
+#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
+				     ia32 ? &fx_sw_reserved_ia32 :
+#endif
+				     &fx_sw_reserved,
+				     sizeof (struct _fpx_sw_bytes));
+
+		err |= __put_user(FP_XSTATE_MAGIC2,
+				  (__u32 __user *) (buf_fxsave + size
+						    - FP_XSTATE_MAGIC2_SIZE));
+
+		/*
+		 * For legacy compatible, we always set FP/SSE bits in the bit
+		 * vector while saving the state to the user context. This will
+		 * enable us capturing any changes(during sigreturn) to
+		 * the FP/SSE bits by the legacy applications which don't touch
+		 * xstate_bv in the xsave header.
+		 *
+		 * xsave aware apps can change the xstate_bv in the xsave
+		 * header as well as change any contents in the memory layout.
+		 * xrestore as part of sigreturn will capture all the changes.
+		 */
+		xstate_bv |= XSTATE_FPSSE;
+
+		err |= __put_user(xstate_bv, &x->xstate_hdr.xstate_bv);
+
+		if (err)
+			return err;
+	}
+
+	return 1;
+}
+
+#ifdef CONFIG_X86_64
 int save_i387_xstate(void __user *buf)
 {
 	struct task_struct *tsk = current;
@@ -240,7 +337,7 @@ static int restore_user_xstate(void __user *buf)
 	int err;
 
 	if (((unsigned long)buf % 64) ||
-	     check_for_xstate(buf, buf, &fx_sw_user))
+	     check_for_xstate(buf, sig_xstate_size, &fx_sw_user))
 		goto fx_only;
 
 	mask = fx_sw_user.xstate_bv;
@@ -315,6 +412,94 @@ clear:
 }
 #endif
 
+int restore_xstates_sigframe(void __user *buf, unsigned int size)
+{
+#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
+	struct user_i387_ia32_struct env;
+	int ia32 = size == sig_xstate_ia32_size;
+#endif
+	struct _fpx_sw_bytes fx_sw_user;
+	struct task_struct *tsk = current;
+	struct _fpstate_ia32 __user *fp = buf;
+	struct xsave_struct *xsave;
+	u64 xstate_mask = 0;
+	int err;
+
+	if (!buf) {
+		if (used_math()) {
+			clear_fpu(tsk);
+			clear_used_math();
+		}
+		return 0;
+	}
+
+	if (!access_ok(VERIFY_READ, buf, size))
+		return -EACCES;
+
+	if (!used_math()) {
+		err = init_fpu(tsk);
+		if (err)
+			return err;
+	}
+
+	if (!HAVE_HWFP) {
+		set_used_math();
+		return fpregs_soft_set(current, NULL,
+				       0, sizeof(struct user_i387_ia32_struct),
+				       NULL, fp) != 0;
+	}
+
+#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
+	if (ia32 && (use_xsave() || use_fxsr())) {
+		if (__copy_from_user(&env, buf, sizeof(env)))
+			return -1;
+		buf = fp->_fxsr_env;
+		size -= offsetof(struct _fpstate_ia32, _fxsr_env);
+	}
+#endif
+
+	xsave = &tsk->thread.fpu.state->xsave;
+	task_thread_info(tsk)->xstate_mask = 0;
+	if (__copy_from_user(xsave, buf, xstate_size))
+		return -1;
+
+	if (use_xsave()) {
+		u64 *xstate_bv = &xsave->xsave_hdr.xstate_bv;
+
+		/*
+		 * If this is no valid xstate, disable all extended states.
+		 *
+		 * For valid xstates, clear any illegal bits and any bits
+		 * that have been cleared in fx_sw_user.xstate_bv.
+		 */
+		if (check_for_xstate(buf, size, &fx_sw_user))
+			*xstate_bv = XSTATE_FPSSE;
+		else
+			*xstate_bv &= pcntxt_mask & fx_sw_user.xstate_bv;
+
+		xstate_mask |= *xstate_bv;
+
+		xsave->xsave_hdr.reserved1[0] =
+			xsave->xsave_hdr.reserved1[1] = 0;
+	} else {
+		xstate_mask |= XCNTXT_LAZY;
+	}
+
+	if (use_xsave() || use_fxsr()) {
+		xsave->i387.mxcsr &= mxcsr_feature_mask;
+
+#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
+		if (ia32)
+			convert_to_fxsr(tsk, &env);
+#endif
+	}
+
+	set_used_math();
+	restore_xstates(tsk, xstate_mask);
+
+	return 0;
+}
+
 /*
  * Prepare the SW reserved portion of the fxsave memory layout, indicating
  * the presence of the extended state information in the memory layout
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC v3 4/8] x86, xsave: remove unused code
  2011-03-29 15:27         ` H. Peter Anvin
                             ` (4 preceding siblings ...)
  2011-04-05 15:50           ` [RFC v3 3/8] x86, xsave: cleanup fpu/xsave signal frame setup Hans Rosenfeld
@ 2011-04-05 15:50           ` Hans Rosenfeld
  2011-04-05 15:50           ` [RFC v3 5/8] x86, xsave: more cleanups Hans Rosenfeld
                             ` (3 subsequent siblings)
  9 siblings, 0 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-04-05 15:50 UTC (permalink / raw)
  To: hpa
  Cc: brgerst, tglx, mingo, suresh.b.siddha, eranian, robert.richter,
	Andreas.Herrmann3, x86, linux-kernel, Hans Rosenfeld

The patches to rework the fpu/xsave handling and signal frame setup have
made a lot of code unused. This patch removes all this now useless stuff.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/include/asm/i387.h  |  155 ++----------------------------
 arch/x86/include/asm/xsave.h |   51 ----------
 arch/x86/kernel/i387.c       |  221 ------------------------------------------
 arch/x86/kernel/traps.c      |   22 ----
 arch/x86/kernel/xsave.c      |  163 -------------------------------
 5 files changed, 7 insertions(+), 605 deletions(-)

diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index 30930bf..97867ea 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -29,8 +29,6 @@
 # include <asm/sigcontext32.h>
 # include <asm/user32.h>
 #else
-# define save_i387_xstate_ia32		save_i387_xstate
-# define restore_i387_xstate_ia32	restore_i387_xstate
 # define _fpstate_ia32		_fpstate
 # define _xstate_ia32		_xstate
 # define sig_xstate_ia32_size   sig_xstate_size
@@ -108,75 +106,16 @@ static inline void sanitize_i387_state(struct task_struct *tsk)
 }
 
 #ifdef CONFIG_X86_64
-static inline int fxrstor_checking(struct i387_fxsave_struct *fx)
+static inline void fxrstor(struct i387_fxsave_struct *fx)
 {
-	int err;
-
-	/* See comment in fxsave() below. */
-#ifdef CONFIG_AS_FXSAVEQ
-	asm volatile("1:  fxrstorq %[fx]\n\t"
-		     "2:\n"
-		     ".section .fixup,\"ax\"\n"
-		     "3:  movl $-1,%[err]\n"
-		     "    jmp  2b\n"
-		     ".previous\n"
-		     _ASM_EXTABLE(1b, 3b)
-		     : [err] "=r" (err)
-		     : [fx] "m" (*fx), "0" (0));
-#else
-	asm volatile("1:  rex64/fxrstor (%[fx])\n\t"
-		     "2:\n"
-		     ".section .fixup,\"ax\"\n"
-		     "3:  movl $-1,%[err]\n"
-		     "    jmp  2b\n"
-		     ".previous\n"
-		     _ASM_EXTABLE(1b, 3b)
-		     : [err] "=r" (err)
-		     : [fx] "R" (fx), "m" (*fx), "0" (0));
-#endif
-	return err;
-}
-
-static inline int fxsave_user(struct i387_fxsave_struct __user *fx)
-{
-	int err;
-
-	/*
-	 * Clear the bytes not touched by the fxsave and reserved
-	 * for the SW usage.
-	 */
-	err = __clear_user(&fx->sw_reserved,
-			   sizeof(struct _fpx_sw_bytes));
-	if (unlikely(err))
-		return -EFAULT;
-
 	/* See comment in fxsave() below. */
 #ifdef CONFIG_AS_FXSAVEQ
-	asm volatile("1:  fxsaveq %[fx]\n\t"
-		     "2:\n"
-		     ".section .fixup,\"ax\"\n"
-		     "3:  movl $-1,%[err]\n"
-		     "    jmp  2b\n"
-		     ".previous\n"
-		     _ASM_EXTABLE(1b, 3b)
-		     : [err] "=r" (err), [fx] "=m" (*fx)
-		     : "0" (0));
+	asm volatile("fxrstorq %[fx]\n\t"
+		     : : [fx] "m" (*fx));
 #else
-	asm volatile("1:  rex64/fxsave (%[fx])\n\t"
-		     "2:\n"
-		     ".section .fixup,\"ax\"\n"
-		     "3:  movl $-1,%[err]\n"
-		     "    jmp  2b\n"
-		     ".previous\n"
-		     _ASM_EXTABLE(1b, 3b)
-		     : [err] "=r" (err), "=m" (*fx)
-		     : [fx] "R" (fx), "0" (0));
+	asm volatile("rex64/fxrstor (%[fx])\n\t"
+		     : : [fx] "R" (fx), "m" (*fx));
 #endif
-	if (unlikely(err) &&
-	    __clear_user(fx, sizeof(struct i387_fxsave_struct)))
-		err = -EFAULT;
-	/* No need to clear here because the caller clears USED_MATH */
-	return err;
 }
 
 static inline void fpu_fxsave(struct fpu *fpu)
@@ -209,7 +148,7 @@ static inline void fpu_fxsave(struct fpu *fpu)
 #else  /* CONFIG_X86_32 */
 
 /* perform fxrstor iff the processor has extended states, otherwise frstor */
-static inline int fxrstor_checking(struct i387_fxsave_struct *fx)
+static inline void fxrstor(struct i387_fxsave_struct *fx)
 {
 	/*
 	 * The "nop" is needed to make the instructions the same
@@ -220,8 +159,6 @@ static inline int fxrstor_checking(struct i387_fxsave_struct *fx)
 		"fxrstor %1",
 		X86_FEATURE_FXSR,
 		"m" (*fx));
-
-	return 0;
 }
 
 static inline void fpu_fxsave(struct fpu *fpu)
@@ -246,7 +183,7 @@ static inline void fpu_fxsave(struct fpu *fpu)
  */
 static inline void fpu_restore(struct fpu *fpu)
 {
-	fxrstor_checking(&fpu->state->fxsave);
+	fxrstor(&fpu->state->fxsave);
 }
 
 static inline void fpu_save(struct fpu *fpu)
@@ -278,69 +215,6 @@ static inline void fpu_clean(struct fpu *fpu)
 		[addr] "m" (safe_address));
 }
 
-static inline void fpu_save_init(struct fpu *fpu)
-{
-	if (use_xsave()) {
-		struct xsave_struct *xstate = &fpu->state->xsave;
-
-		fpu_xsave(xstate, -1);
-
-		/*
-		 * xsave header may indicate the init state of the FP.
-		 */
-		if (!(xstate->xsave_hdr.xstate_bv & XSTATE_FP))
-			return;
-	} else if (use_fxsr()) {
-		fpu_fxsave(fpu);
-	} else {
-		asm volatile("fsave %[fx]; fwait"
-			     : [fx] "=m" (fpu->state->fsave));
-		return;
-	}
-
-	if (unlikely(fpu->state->fxsave.swd & X87_FSW_ES))
-		asm volatile("fnclex");
-
-	/* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
-	   is pending.  Clear the x87 state here by setting it to fixed
-	   values. safe_address is a random variable that should be in L1 */
-	alternative_input(
-		ASM_NOP8 ASM_NOP2,
-		"emms\n\t"	  	/* clear stack tags */
-		"fildl %P[addr]",	/* set F?P to defined value */
-		X86_FEATURE_FXSAVE_LEAK,
-		[addr] "m" (safe_address));
-}
-
-static inline void __save_init_fpu(struct task_struct *tsk)
-{
-	fpu_save_init(&tsk->thread.fpu);
-	task_thread_info(tsk)->status &= ~TS_USEDFPU;
-}
-
-static inline int fpu_restore_checking(struct fpu *fpu)
-{
-	if (use_xsave())
-		return xrstor_checking(&fpu->state->xsave, -1);
-	else
-		return fxrstor_checking(&fpu->state->fxsave);
-}
-
-/*
- * Signal frame handlers...
- */
-extern int save_i387_xstate(void __user *buf);
-extern int restore_i387_xstate(void __user *buf);
-
-static inline void __unlazy_fpu(struct task_struct *tsk)
-{
-	if (task_thread_info(tsk)->status & TS_USEDFPU) {
-		__save_init_fpu(tsk);
-		stts();
-	} else
-		tsk->fpu_counter = 0;
-}
-
 static inline void __clear_fpu(struct task_struct *tsk)
 {
 	if (task_thread_info(tsk)->status & TS_USEDFPU) {
@@ -409,21 +283,6 @@ static inline void irq_ts_restore(int TS_state)
 /*
  * These disable preemption on their own and are safe
  */
-static inline void save_init_fpu(struct task_struct *tsk)
-{
-	preempt_disable();
-	__save_init_fpu(tsk);
-	stts();
-	preempt_enable();
-}
-
-static inline void unlazy_fpu(struct task_struct *tsk)
-{
-	preempt_disable();
-	__unlazy_fpu(tsk);
-	preempt_enable();
-}
-
 static inline void clear_fpu(struct task_struct *tsk)
 {
 	preempt_disable();
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
index 200c56d..742da4a 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
@@ -51,26 +51,6 @@ extern int check_for_xstate(struct i387_fxsave_struct __user *buf,
 			    unsigned int size,
 			    struct _fpx_sw_bytes *sw);
 
-static inline int xrstor_checking(struct xsave_struct *fx, u64 mask)
-{
-	int err;
-	u32 lmask = mask;
-	u32 hmask = mask >> 32;
-
-	asm volatile("1: .byte " REX_PREFIX "0x0f,0xae,0x2f\n\t"
-		     "2:\n"
-		     ".section .fixup,\"ax\"\n"
-		     "3:  movl $-1,%[err]\n"
-		     "    jmp  2b\n"
-		     ".previous\n"
-		     _ASM_EXTABLE(1b, 3b)
-		     : [err] "=r" (err)
-		     : "D" (fx), "m" (*fx), "a" (lmask), "d" (hmask), "0" (0)
-		     : "memory");
-
-	return err;
-}
-
 static inline void xrstor_state(struct xsave_struct *fx, u64 mask)
 {
 	u32 lmask = mask;
@@ -81,37 +61,6 @@ static inline void xrstor_state(struct xsave_struct *fx, u64 mask)
 		     :   "memory");
 }
 
-static inline int xsave_checking(struct xsave_struct __user *buf)
-{
-	int err;
-
-	/*
-	 * Clear the xsave header first, so that reserved fields are
-	 * initialized to zero.
-	 */
-	err = __clear_user(&buf->xsave_hdr,
-			   sizeof(struct xsave_hdr_struct));
-	if (unlikely(err))
-		return -EFAULT;
-
-	asm volatile("1: .byte " REX_PREFIX "0x0f,0xae,0x27\n"
-		     "2:\n"
-		     ".section .fixup,\"ax\"\n"
-		     "3:  movl $-1,%[err]\n"
-		     "    jmp  2b\n"
-		     ".previous\n"
-		     _ASM_EXTABLE(1b,3b)
-		     : [err] "=r" (err)
-		     : "D" (buf), "a" (-1), "d" (-1), "0" (0)
-		     : "memory");
-
-	if (unlikely(err) && __clear_user(buf, xstate_size))
-		err = -EFAULT;
-
-	/* No need to clear here because the caller clears USED_MATH */
-	return err;
-}
-
 static inline void xsave_state(struct xsave_struct *fx, u64 mask)
 {
 	u32 lmask = mask;
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
index 69625a8..ca33c0b 100644
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -490,227 +490,6 @@ int fpregs_set(struct task_struct *target, const struct user_regset *regset,
 }
 
 /*
- * Signal frame handlers.
- */
-
-static inline int save_i387_fsave(struct _fpstate_ia32 __user *buf)
-{
-	struct task_struct *tsk = current;
-	struct i387_fsave_struct *fp = &tsk->thread.fpu.state->fsave;
-
-	fp->status = fp->swd;
-	if (__copy_to_user(buf, fp, sizeof(struct i387_fsave_struct)))
-		return -1;
-	return 1;
-}
-
-static int save_i387_fxsave(struct _fpstate_ia32 __user *buf)
-{
-	struct task_struct *tsk = current;
-	struct i387_fxsave_struct *fx = &tsk->thread.fpu.state->fxsave;
-	struct user_i387_ia32_struct env;
-	int err = 0;
-
-	convert_from_fxsr(&env, tsk);
-	if (__copy_to_user(buf, &env, sizeof(env)))
-		return -1;
-
-	err |= __put_user(fx->swd, &buf->status);
-	err |= __put_user(X86_FXSR_MAGIC, &buf->magic);
-	if (err)
-		return -1;
-
-	if (__copy_to_user(&buf->_fxsr_env[0], fx, xstate_size))
-		return -1;
-	return 1;
-}
-
-static int save_i387_xsave(void __user *buf)
-{
-	struct task_struct *tsk = current;
-	struct _fpstate_ia32 __user *fx = buf;
-	int err = 0;
-
-
-	sanitize_i387_state(tsk);
-
-	/*
-	 * For legacy compatible, we always set FP/SSE bits in the bit
-	 * vector while saving the state to the user context.
-	 * This will enable us capturing any changes(during sigreturn) to
-	 * the FP/SSE bits by the legacy applications which don't touch
-	 * xstate_bv in the xsave header.
-	 *
-	 * xsave aware applications can change the xstate_bv in the xsave
-	 * header as well as change any contents in the memory layout.
-	 * xrestore as part of sigreturn will capture all the changes.
-	 */
-	tsk->thread.fpu.state->xsave.xsave_hdr.xstate_bv |= XSTATE_FPSSE;
-
-	if (save_i387_fxsave(fx) < 0)
-		return -1;
-
-	err = __copy_to_user(&fx->sw_reserved, &fx_sw_reserved_ia32,
-			     sizeof(struct _fpx_sw_bytes));
-	err |= __put_user(FP_XSTATE_MAGIC2,
-			  (__u32 __user *) (buf + sig_xstate_ia32_size
-					    - FP_XSTATE_MAGIC2_SIZE));
-	if (err)
-		return -1;
-
-	return 1;
-}
-
-int save_i387_xstate_ia32(void __user *buf)
-{
-	struct _fpstate_ia32 __user *fp = (struct _fpstate_ia32 __user *) buf;
-	struct task_struct *tsk = current;
-
-	if (!used_math())
-		return 0;
-
-	if (!access_ok(VERIFY_WRITE, buf, sig_xstate_ia32_size))
-		return -EACCES;
-	/*
-	 * This will cause a "finit" to be triggered by the next
-	 * attempted FPU operation by the 'current' process.
-	 */
-	clear_used_math();
-
-	if (!HAVE_HWFP) {
-		return fpregs_soft_get(current, NULL,
-				       0, sizeof(struct user_i387_ia32_struct),
-				       NULL, fp) ? -1 : 1;
-	}
-
-	preempt_disable();
-	save_xstates(tsk);
-	preempt_enable();
-
-	if (cpu_has_xsave)
-		return save_i387_xsave(fp);
-	if (cpu_has_fxsr)
-		return save_i387_fxsave(fp);
-	else
-		return save_i387_fsave(fp);
-}
-
-static inline int restore_i387_fsave(struct _fpstate_ia32 __user *buf)
-{
-	struct task_struct *tsk = current;
-
-	return __copy_from_user(&tsk->thread.fpu.state->fsave, buf,
-				sizeof(struct i387_fsave_struct));
-}
-
-static int restore_i387_fxsave(struct _fpstate_ia32 __user *buf,
-			       unsigned int size)
-{
-	struct task_struct *tsk = current;
-	struct user_i387_ia32_struct env;
-	int err;
-
-	err = __copy_from_user(&tsk->thread.fpu.state->fxsave, &buf->_fxsr_env[0],
-			       size);
-	/* mxcsr reserved bits must be masked to zero for security reasons */
-	tsk->thread.fpu.state->fxsave.mxcsr &= mxcsr_feature_mask;
-	if (err || __copy_from_user(&env, buf, sizeof(env)))
-		return 1;
-	convert_to_fxsr(tsk, &env);
-
-	return 0;
-}
-
-static int restore_i387_xsave(void __user *buf)
-{
-	struct _fpx_sw_bytes fx_sw_user;
-	struct _fpstate_ia32 __user *fx_user =
-			((struct _fpstate_ia32 __user *) buf);
-	struct i387_fxsave_struct __user *fx =
-		(struct i387_fxsave_struct __user *) &fx_user->_fxsr_env[0];
-	struct xsave_hdr_struct *xsave_hdr =
-				&current->thread.fpu.state->xsave.xsave_hdr;
-	u64 mask;
-	int err;
-
-	if (check_for_xstate(fx, sig_xstate_ia32_size -
-			     offsetof(struct _fpstate_ia32, _fxsr_env),
-			     &fx_sw_user))
-		goto fx_only;
-
-	mask = fx_sw_user.xstate_bv;
-
-	err = restore_i387_fxsave(buf, fx_sw_user.xstate_size);
-
-	xsave_hdr->xstate_bv &= pcntxt_mask;
-	/*
-	 * These bits must be zero.
-	 */
-	xsave_hdr->reserved1[0] = xsave_hdr->reserved1[1] = 0;
-
-	/*
-	 * Init the state that is not present in the memory layout
-	 * and enabled by the OS.
-	 */
-	mask = ~(pcntxt_mask & ~mask);
-	xsave_hdr->xstate_bv &= mask;
-
-	return err;
-fx_only:
-	/*
-	 * Couldn't find the extended state information in the memory
-	 * layout. Restore the FP/SSE and init the other extended state
-	 * enabled by the OS.
-	 */
-	xsave_hdr->xstate_bv = XSTATE_FPSSE;
-	return restore_i387_fxsave(buf, sizeof(struct i387_fxsave_struct));
-}
-
-int restore_i387_xstate_ia32(void __user *buf)
-{
-	int err;
-	struct task_struct *tsk = current;
-	struct _fpstate_ia32 __user *fp = (struct _fpstate_ia32 __user *) buf;
-
-	if (HAVE_HWFP)
-		clear_fpu(tsk);
-
-	if (!buf) {
-		if (used_math()) {
-			clear_fpu(tsk);
-			clear_used_math();
-		}
-
-		return 0;
-	} else
-		if (!access_ok(VERIFY_READ, buf, sig_xstate_ia32_size))
-			return -EACCES;
-
-	if (!used_math()) {
-		err = init_fpu(tsk);
-		if (err)
-			return err;
-	}
-
-	if (HAVE_HWFP) {
-		if (cpu_has_xsave)
-			err = restore_i387_xsave(buf);
-		else if (cpu_has_fxsr)
-			err = restore_i387_fxsave(fp, sizeof(struct
-							   i387_fxsave_struct));
-		else
-			err = restore_i387_fsave(fp);
-	} else {
-		err = fpregs_soft_set(current, NULL,
-				      0, sizeof(struct user_i387_ia32_struct),
-				      NULL, fp) != 0;
-	}
-	set_used_math();
-
-	return err;
-}
-
-/*
  * FPU state for core dumps.
  * This is only used for a.out dumps now.
  * It is declared generically using elf_fpregset_t (which is
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 072c30e..872fc78 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -720,28 +720,6 @@ asmlinkage void __attribute__((weak)) smp_threshold_interrupt(void)
 }
 
 /*
- * __math_state_restore assumes that cr0.TS is already clear and the
- * fpu state is all ready for use.  Used during context switch.
- */
-void __math_state_restore(void)
-{
-	struct thread_info *thread = current_thread_info();
-	struct task_struct *tsk = thread->task;
-
-	/*
-	 * Paranoid restore. send a SIGSEGV if we fail to restore the state.
-	 */
-	if (unlikely(fpu_restore_checking(&tsk->thread.fpu))) {
-		stts();
-		force_sig(SIGSEGV, tsk);
-		return;
-	}
-
-	thread->status |= TS_USEDFPU;   /* So we fnsave on switch_to() */
-	tsk->fpu_counter++;
-}
-
-/*
  * 'math_state_restore()' saves the current math information in the
  * old math state array, and gets the new ones from the current task
  *
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index 08b2fe8..9ecc791 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -249,169 +249,6 @@ int save_xstates_sigframe(void __user *buf, unsigned int size)
 	return 1;
 }
 
-#ifdef CONFIG_X86_64
-int save_i387_xstate(void __user *buf)
-{
-	struct task_struct *tsk = current;
-	int err = 0;
-
-	if (!access_ok(VERIFY_WRITE, buf, sig_xstate_size))
-		return -EACCES;
-
-	BUG_ON(sig_xstate_size < xstate_size);
-
-	if ((unsigned long)buf % 64)
-		printk("save_i387_xstate: bad fpstate %p\n", buf);
-
-	if (!used_math())
-		return 0;
-
-	if (task_thread_info(tsk)->status & TS_USEDFPU) {
-		if (use_xsave())
-			err = xsave_checking(buf);
-		else
-			err = fxsave_user(buf);
-
-		if (err)
-			return err;
-		task_thread_info(tsk)->status &= ~TS_USEDFPU;
-		stts();
-	} else {
-		sanitize_i387_state(tsk);
-		if (__copy_to_user(buf, &tsk->thread.fpu.state->fxsave,
-				   xstate_size))
-			return -1;
-	}
-
-	clear_used_math(); /* trigger finit */
-
-	if (use_xsave()) {
-		struct _fpstate __user *fx = buf;
-		struct _xstate __user *x = buf;
-		u64 xstate_bv;
-
-		err = __copy_to_user(&fx->sw_reserved, &fx_sw_reserved,
-				     sizeof(struct _fpx_sw_bytes));
-
-		err |= __put_user(FP_XSTATE_MAGIC2,
-				  (__u32 __user *) (buf + sig_xstate_size
-						    - FP_XSTATE_MAGIC2_SIZE));
-
-		/*
-		 * Read the xstate_bv which we copied (directly from the cpu or
-		 * from the state in task struct) to the user buffers and
-		 * set the FP/SSE bits.
-		 */
-		err |= __get_user(xstate_bv, &x->xstate_hdr.xstate_bv);
-
-		/*
-		 * For legacy compatible, we always set FP/SSE bits in the bit
-		 * vector while saving the state to the user context. This will
-		 * enable us capturing any changes(during sigreturn) to
-		 * the FP/SSE bits by the legacy applications which don't touch
-		 * xstate_bv in the xsave header.
-		 *
-		 * xsave aware apps can change the xstate_bv in the xsave
-		 * header as well as change any contents in the memory layout.
-		 * xrestore as part of sigreturn will capture all the changes.
-		 */
-		xstate_bv |= XSTATE_FPSSE;
-
-		err |= __put_user(xstate_bv, &x->xstate_hdr.xstate_bv);
-
-		if (err)
-			return err;
-	}
-
-	return 1;
-}
-
-/*
- * Restore the extended state if present. Otherwise, restore the FP/SSE
- * state.
- */
-static int restore_user_xstate(void __user *buf)
-{
-	struct _fpx_sw_bytes fx_sw_user;
-	u64 mask;
-	int err;
-
-	if (((unsigned long)buf % 64) ||
-	     check_for_xstate(buf, sig_xstate_size, &fx_sw_user))
-		goto fx_only;
-
-	mask = fx_sw_user.xstate_bv;
-
-	/*
-	 * restore the state passed by the user.
-	 */
-	err = xrstor_checking((__force struct xsave_struct *)buf, mask);
-	if (err)
-		return err;
-
-	/*
-	 * init the state skipped by the user.
-	 */
-	mask = pcntxt_mask & ~mask;
-	if (unlikely(mask))
-		xrstor_state(init_xstate_buf, mask);
-
-	return 0;
-
-fx_only:
-	/*
-	 * couldn't find the extended state information in the
-	 * memory layout. Restore just the FP/SSE and init all
-	 * the other extended state.
-	 */
-	xrstor_state(init_xstate_buf, pcntxt_mask & ~XSTATE_FPSSE);
-	return fxrstor_checking((__force struct i387_fxsave_struct *)buf);
-}
-
-/*
- * This restores directly out of user space. Exceptions are handled.
- */
-int restore_i387_xstate(void __user *buf)
-{
-	struct task_struct *tsk = current;
-	int err = 0;
-
-	if (!buf) {
-		if (used_math())
-			goto clear;
-		return 0;
-	} else
-		if (!access_ok(VERIFY_READ, buf, sig_xstate_size))
-			return -EACCES;
-
-	if (!used_math()) {
-		err = init_fpu(tsk);
-		if (err)
-			return err;
-	}
-
-	if (!(task_thread_info(current)->status & TS_USEDFPU)) {
-		clts();
-		task_thread_info(current)->status |= TS_USEDFPU;
-	}
-	if (use_xsave())
-		err = restore_user_xstate(buf);
-	else
-		err = fxrstor_checking((__force struct i387_fxsave_struct *)
-				       buf);
-	if (unlikely(err)) {
-		/*
-		 * Encountered an error while doing the restore from the
-		 * user buffer, clear the fpu state.
-		 */
-clear:
-		clear_fpu(tsk);
-		clear_used_math();
-	}
-	return err;
-}
-#endif
-
 int restore_xstates_sigframe(void __user *buf, unsigned int size)
 {
 #if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC v3 5/8] x86, xsave: more cleanups
  2011-03-29 15:27         ` H. Peter Anvin
                             ` (5 preceding siblings ...)
  2011-04-05 15:50           ` [RFC v3 4/8] x86, xsave: remove unused code Hans Rosenfeld
@ 2011-04-05 15:50           ` Hans Rosenfeld
  2011-04-05 15:50           ` [RFC v3 6/8] x86, xsave: add support for non-lazy xstates Hans Rosenfeld
                             ` (2 subsequent siblings)
  9 siblings, 0 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-04-05 15:50 UTC (permalink / raw)
  To: hpa
  Cc: brgerst, tglx, mingo, suresh.b.siddha, eranian, robert.richter,
	Andreas.Herrmann3, x86, linux-kernel, Hans Rosenfeld

Removed some declarations from headers that weren't used.

Retired TS_USEDFPU, it has been replaced by the XCNTXT_* bits in
xstate_mask.

There is no reason functions like fpu_fxsave() etc. need to know or
handle anything else than a buffer to save/restore their stuff to/from.

Sanitize_i387_state() is extra work that is only needed when xsaveopt is
used. There is no point in hiding this in an inline function, adding
extra code lines just to save a single if() in the five places it is
used. Also, it is obscuring a fact that might well be interesting to
whoever is reading the code, but it is not gaining anything.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/include/asm/i387.h        |   67 ++++++++++++-----------------------
 arch/x86/include/asm/thread_info.h |    2 -
 arch/x86/include/asm/xsave.h       |   14 +++----
 arch/x86/kernel/i387.c             |   12 ++++--
 arch/x86/kernel/xsave.c            |   32 ++++++++---------
 arch/x86/kvm/vmx.c                 |    2 +-
 arch/x86/kvm/x86.c                 |    4 +-
 7 files changed, 55 insertions(+), 78 deletions(-)

diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index 97867ea..b8f9617 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -42,7 +42,6 @@ extern void fpu_init(void);
 extern void mxcsr_feature_mask_init(void);
 extern int init_fpu(struct task_struct *child);
 extern asmlinkage void math_state_restore(void);
-extern void __math_state_restore(void);
 extern int dump_fpu(struct pt_regs *, struct user_i387_struct *);
 
 extern void convert_from_fxsr(struct user_i387_ia32_struct *, struct task_struct *);
@@ -60,15 +59,10 @@ extern user_regset_set_fn fpregs_set, xfpregs_set, fpregs_soft_set,
  */
 #define xstateregs_active	fpregs_active
 
-extern struct _fpx_sw_bytes fx_sw_reserved;
 extern unsigned int mxcsr_feature_mask;
+
 #ifdef CONFIG_IA32_EMULATION
 extern unsigned int sig_xstate_ia32_size;
-extern struct _fpx_sw_bytes fx_sw_reserved_ia32;
-struct _fpstate_ia32;
-struct _xstate_ia32;
-extern int save_i387_xstate_ia32(void __user *buf);
-extern int restore_i387_xstate_ia32(void __user *buf);
 #endif
 
 #ifdef CONFIG_MATH_EMULATION
@@ -76,7 +70,7 @@ extern int restore_i387_xstate_ia32(void __user *buf);
 extern void finit_soft_fpu(struct i387_soft_struct *soft);
 #else
 # define HAVE_HWFP		1
-static inline void finit_soft_fpu(struct i387_soft_struct *soft) {}
+# define finit_soft_fpu(x)
 #endif
 
 #define X87_FSW_ES (1 << 7)	/* Exception Summary */
@@ -96,15 +90,6 @@ static __always_inline __pure bool use_fxsr(void)
         return static_cpu_has(X86_FEATURE_FXSR);
 }
 
-extern void __sanitize_i387_state(struct task_struct *);
-
-static inline void sanitize_i387_state(struct task_struct *tsk)
-{
-	if (!use_xsaveopt())
-		return;
-	__sanitize_i387_state(tsk);
-}
-
 #ifdef CONFIG_X86_64
 static inline void fxrstor(struct i387_fxsave_struct *fx)
 {
@@ -118,7 +103,7 @@ static inline void fxrstor(struct i387_fxsave_struct *fx)
 #endif
 }
 
-static inline void fpu_fxsave(struct fpu *fpu)
+static inline void fpu_fxsave(struct i387_fxsave_struct *fx)
 {
 	/* Using "rex64; fxsave %0" is broken because, if the memory operand
 	   uses any extended registers for addressing, a second REX prefix
@@ -129,7 +114,7 @@ static inline void fpu_fxsave(struct fpu *fpu)
 	/* Using "fxsaveq %0" would be the ideal choice, but is only supported
 	   starting with gas 2.16. */
 	__asm__ __volatile__("fxsaveq %0"
-			     : "=m" (fpu->state->fxsave));
+			     : "=m" (*fx));
 #else
 	/* Using, as a workaround, the properly prefixed form below isn't
 	   accepted by any binutils version so far released, complaining that
@@ -140,8 +125,8 @@ static inline void fpu_fxsave(struct fpu *fpu)
 	   This, however, we can work around by forcing the compiler to select
 	   an addressing mode that doesn't require extended registers. */
 	asm volatile("rex64/fxsave (%[fx])"
-		     : "=m" (fpu->state->fxsave)
-		     : [fx] "R" (&fpu->state->fxsave));
+		     : "=m" (*fx)
+		     : [fx] "R" (fx));
 #endif
 }
 
@@ -161,10 +146,10 @@ static inline void fxrstor(struct i387_fxsave_struct *fx)
 		"m" (*fx));
 }
 
-static inline void fpu_fxsave(struct fpu *fpu)
+static inline void fpu_fxsave(struct i387_fxsave_struct *fx)
 {
 	asm volatile("fxsave %[fx]"
-		     : [fx] "=m" (fpu->state->fxsave));
+		     : [fx] "=m" (*fx));
 }
 
 #endif	/* CONFIG_X86_64 */
@@ -181,25 +166,25 @@ static inline void fpu_fxsave(struct fpu *fpu)
 /*
  * These must be called with preempt disabled
  */
-static inline void fpu_restore(struct fpu *fpu)
+static inline void fpu_restore(struct i387_fxsave_struct *fx)
 {
-	fxrstor(&fpu->state->fxsave);
+	fxrstor(fx);
 }
 
-static inline void fpu_save(struct fpu *fpu)
+static inline void fpu_save(struct i387_fxsave_struct *fx)
 {
 	if (use_fxsr()) {
-		fpu_fxsave(fpu);
+		fpu_fxsave(fx);
 	} else {
 		asm volatile("fsave %[fx]; fwait"
-			     : [fx] "=m" (fpu->state->fsave));
+			     : [fx] "=m" (*fx));
 	}
 }
 
-static inline void fpu_clean(struct fpu *fpu)
+static inline void fpu_clean(struct i387_fxsave_struct *fx)
 {
 	u32 swd = (use_fxsr() || use_xsave()) ?
-		fpu->state->fxsave.swd : fpu->state->fsave.swd;
+		fx->swd : ((struct i387_fsave_struct *)fx)->swd;
 
 	if (unlikely(swd & X87_FSW_ES))
 		asm volatile("fnclex");
@@ -215,19 +200,6 @@ static inline void fpu_clean(struct fpu *fpu)
 		[addr] "m" (safe_address));
 }
 
-static inline void __clear_fpu(struct task_struct *tsk)
-{
-	if (task_thread_info(tsk)->status & TS_USEDFPU) {
-		/* Ignore delayed exceptions from user space */
-		asm volatile("1: fwait\n"
-			     "2:\n"
-			     _ASM_EXTABLE(1b, 2b));
-		task_thread_info(tsk)->status &= ~TS_USEDFPU;
-		task_thread_info(tsk)->xstate_mask &= ~XCNTXT_LAZY;
-		stts();
-	}
-}
-
 static inline void kernel_fpu_begin(void)
 {
 	preempt_disable();
@@ -286,7 +258,14 @@ static inline void irq_ts_restore(int TS_state)
 static inline void clear_fpu(struct task_struct *tsk)
 {
 	preempt_disable();
-	__clear_fpu(tsk);
+	if (task_thread_info(tsk)->xstate_mask & XCNTXT_LAZY) {
+		/* Ignore delayed exceptions from user space */
+		asm volatile("1: fwait\n"
+			     "2:\n"
+			     _ASM_EXTABLE(1b, 2b));
+		task_thread_info(tsk)->xstate_mask &= ~XCNTXT_LAZY;
+		stts();
+	}
 	preempt_enable();
 }
 
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index ec12d62..0e691c6 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -244,8 +244,6 @@ static inline struct thread_info *current_thread_info(void)
  * ever touches our thread-synchronous status, so we don't
  * have to worry about atomic accesses.
  */
-#define TS_USEDFPU		0x0001	/* FPU was used by this task
-					   this quantum (SMP) */
 #define TS_COMPAT		0x0002	/* 32bit syscall active (64BIT)*/
 #define TS_POLLING		0x0004	/* idle task polling need_resched,
 					   skip sending interrupt */
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
index 742da4a..b8861d4 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
@@ -37,8 +37,8 @@ extern unsigned int xstate_size;
 extern u64 pcntxt_mask;
 extern u64 xstate_fx_sw_bytes[USER_XSTATE_FX_SW_WORDS];
 
-extern void xsave(struct fpu *, u64);
-extern void xrstor(struct fpu *, u64);
+extern void xsave(struct xsave_struct *, u64);
+extern void xrstor(struct xsave_struct *, u64);
 extern void save_xstates(struct task_struct *);
 extern void restore_xstates(struct task_struct *, u64);
 extern int save_xstates_sigframe(void __user *, unsigned int);
@@ -46,10 +46,7 @@ extern int restore_xstates_sigframe(void __user *, unsigned int);
 
 extern void xsave_init(void);
 extern void update_regset_xstate_info(unsigned int size, u64 xstate_mask);
-extern int init_fpu(struct task_struct *child);
-extern int check_for_xstate(struct i387_fxsave_struct __user *buf,
-			    unsigned int size,
-			    struct _fpx_sw_bytes *sw);
+extern void sanitize_i387_state(struct task_struct *);
 
 static inline void xrstor_state(struct xsave_struct *fx, u64 mask)
 {
@@ -71,7 +68,7 @@ static inline void xsave_state(struct xsave_struct *fx, u64 mask)
 		     :   "memory");
 }
 
-static inline void fpu_xsave(struct xsave_struct *fx, u64 mask)
+static inline void xsaveopt_state(struct xsave_struct *fx, u64 mask)
 {
 	u32 lmask = mask;
 	u32 hmask = mask >> 32;
@@ -82,7 +79,8 @@ static inline void fpu_xsave(struct xsave_struct *fx, u64 mask)
 		".byte " REX_PREFIX "0x0f,0xae,0x27",
 		".byte " REX_PREFIX "0x0f,0xae,0x37",
 		X86_FEATURE_XSAVEOPT,
-		[fx] "D" (fx), "a" (lmask), "d" (hmask) :
+		"D" (fx), "a" (lmask), "d" (hmask) :
 		"memory");
 }
+
 #endif
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
index ca33c0b..dd9644a 100644
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -182,7 +182,8 @@ int xfpregs_get(struct task_struct *target, const struct user_regset *regset,
 	if (ret)
 		return ret;
 
-	sanitize_i387_state(target);
+	if (use_xsaveopt())
+		sanitize_i387_state(target);
 
 	return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
 				   &target->thread.fpu.state->fxsave, 0, -1);
@@ -201,7 +202,8 @@ int xfpregs_set(struct task_struct *target, const struct user_regset *regset,
 	if (ret)
 		return ret;
 
-	sanitize_i387_state(target);
+	if (use_xsaveopt())
+		sanitize_i387_state(target);
 
 	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
 				 &target->thread.fpu.state->fxsave, 0, -1);
@@ -440,7 +442,8 @@ int fpregs_get(struct task_struct *target, const struct user_regset *regset,
 					   -1);
 	}
 
-	sanitize_i387_state(target);
+	if (use_xsaveopt())
+		sanitize_i387_state(target);
 
 	if (kbuf && pos == 0 && count == sizeof(env)) {
 		convert_from_fxsr(kbuf, target);
@@ -463,7 +466,8 @@ int fpregs_set(struct task_struct *target, const struct user_regset *regset,
 	if (ret)
 		return ret;
 
-	sanitize_i387_state(target);
+	if (use_xsaveopt())
+		sanitize_i387_state(target);
 
 	if (!HAVE_HWFP)
 		return fpregs_soft_set(target, regset, pos, count, kbuf, ubuf);
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index 9ecc791..d42810f 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -39,7 +39,7 @@ static unsigned int *xstate_offsets, *xstate_sizes, xstate_features;
  * that the user doesn't see some stale state in the memory layout during
  * signal handling, debugging etc.
  */
-void __sanitize_i387_state(struct task_struct *tsk)
+void sanitize_i387_state(struct task_struct *tsk)
 {
 	u64 xstate_bv;
 	int feature_bit = 0x2;
@@ -48,7 +48,7 @@ void __sanitize_i387_state(struct task_struct *tsk)
 	if (!fx)
 		return;
 
-	BUG_ON(task_thread_info(tsk)->status & TS_USEDFPU);
+	BUG_ON(task_thread_info(tsk)->xstate_mask & XCNTXT_LAZY);
 
 	xstate_bv = tsk->thread.fpu.state->xsave.xsave_hdr.xstate_bv;
 
@@ -103,8 +103,8 @@ void __sanitize_i387_state(struct task_struct *tsk)
  * Check for the presence of extended state information in the
  * user fpstate pointer in the sigcontext.
  */
-int check_for_xstate(struct i387_fxsave_struct __user *buf, unsigned int size,
-		     struct _fpx_sw_bytes *fx_sw_user)
+static int check_for_xstate(struct i387_fxsave_struct __user *buf, unsigned int size,
+			    struct _fpx_sw_bytes *fx_sw_user)
 {
 	int min_xstate_size = sizeof(struct i387_fxsave_struct) +
 			      sizeof(struct xsave_hdr_struct);
@@ -176,7 +176,8 @@ int save_xstates_sigframe(void __user *buf, unsigned int size)
 			(struct _fpstate_ia32 __user *) buf) ? -1 : 1;
 
 	save_xstates(tsk);
-	sanitize_i387_state(tsk);
+	if (use_xsaveopt())
+		sanitize_i387_state(tsk);
 
 #if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
 	if (ia32) {
@@ -498,17 +499,17 @@ void __cpuinit xsave_init(void)
 	this_func();
 }
 
-void xsave(struct fpu *fpu, u64 mask)
+void xsave(struct xsave_struct *x, u64 mask)
 {
 	clts();
 
 	if (use_xsave())
-		fpu_xsave(&fpu->state->xsave, mask);
+		xsaveopt_state(x, mask);
 	else if (mask & XCNTXT_LAZY)
-		fpu_save(fpu);
+		fpu_save(&x->i387);
 
 	if (mask & XCNTXT_LAZY)
-		fpu_clean(fpu);
+		fpu_clean(&x->i387);
 
 	stts();
 }
@@ -521,7 +522,7 @@ void save_xstates(struct task_struct *tsk)
 	if (!fpu_allocated(&tsk->thread.fpu))
 		return;
 
-	xsave(&tsk->thread.fpu, ti->xstate_mask);
+	xsave(&tsk->thread.fpu.state->xsave, ti->xstate_mask);
 
 	if (!(ti->xstate_mask & XCNTXT_LAZY))
 		tsk->fpu_counter = 0;
@@ -533,19 +534,17 @@ void save_xstates(struct task_struct *tsk)
 	 */
 	if (tsk->fpu_counter < 5)
 		ti->xstate_mask &= ~XCNTXT_LAZY;
-
-	ti->status &= ~TS_USEDFPU;
 }
 EXPORT_SYMBOL(save_xstates);
 
-void xrstor(struct fpu *fpu, u64 mask)
+void xrstor(struct xsave_struct *x, u64 mask)
 {
 	clts();
 
 	if (use_xsave())
-		xrstor_state(&fpu->state->xsave, mask);
+		xrstor_state(x, mask);
 	else if (mask & XCNTXT_LAZY)
-		fpu_restore(fpu);
+		fpu_restore(&x->i387);
 
 	if (!(mask & XCNTXT_LAZY))
 		stts();
@@ -559,10 +558,9 @@ void restore_xstates(struct task_struct *tsk, u64 mask)
 	if (!fpu_allocated(&tsk->thread.fpu))
 		return;
 
-	xrstor(&tsk->thread.fpu, mask);
+	xrstor(&tsk->thread.fpu.state->xsave, mask);
 
 	ti->xstate_mask |= mask;
-	ti->status |= TS_USEDFPU;
 	if (mask & XCNTXT_LAZY)
 		tsk->fpu_counter++;
 }
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 5b4cdcb..f756c95 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -876,7 +876,7 @@ static void __vmx_load_host_state(struct vcpu_vmx *vmx)
 #ifdef CONFIG_X86_64
 	wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base);
 #endif
-	if (current_thread_info()->status & TS_USEDFPU)
+	if (current_thread_info()->xstate_mask & XCNTXT_LAZY)
 		clts();
 	load_gdt(&__get_cpu_var(host_gdt));
 }
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index aae9e8f..bc04e15 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5805,7 +5805,7 @@ void kvm_load_guest_fpu(struct kvm_vcpu *vcpu)
 	kvm_put_guest_xcr0(vcpu);
 	vcpu->guest_fpu_loaded = 1;
 	save_xstates(current);
-	xrstor(&vcpu->arch.guest_fpu, -1);
+	xrstor(&vcpu->arch.guest_fpu.state->xsave, -1);
 	trace_kvm_fpu(1);
 }
 
@@ -5817,7 +5817,7 @@ void kvm_put_guest_fpu(struct kvm_vcpu *vcpu)
 		return;
 
 	vcpu->guest_fpu_loaded = 0;
-	xsave(&vcpu->arch.guest_fpu, -1);
+	xsave(&vcpu->arch.guest_fpu.state->xsave, -1);
 	++vcpu->stat.fpu_reload;
 	kvm_make_request(KVM_REQ_DEACTIVATE_FPU, vcpu);
 	trace_kvm_fpu(0);
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC v3 6/8] x86, xsave: add support for non-lazy xstates
  2011-03-29 15:27         ` H. Peter Anvin
                             ` (6 preceding siblings ...)
  2011-04-05 15:50           ` [RFC v3 5/8] x86, xsave: more cleanups Hans Rosenfeld
@ 2011-04-05 15:50           ` Hans Rosenfeld
  2011-04-05 15:50           ` [RFC v3 7/8] x86, xsave: add kernel support for AMDs Lightweight Profiling (LWP) Hans Rosenfeld
  2011-04-05 15:50           ` [RFC v3 8/8] x86, xsave: remove lazy allocation of xstate area Hans Rosenfeld
  9 siblings, 0 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-04-05 15:50 UTC (permalink / raw)
  To: hpa
  Cc: brgerst, tglx, mingo, suresh.b.siddha, eranian, robert.richter,
	Andreas.Herrmann3, x86, linux-kernel, Hans Rosenfeld

Non-lazy xstates are, as the name suggests, extended states that cannot
be saved or restored lazily. The state for AMDs LWP feature is an
example of this.

This patch adds support for this kind of xstates. If any such states are
present and supported on the running system, they will always be enabled
in xstate_mask so that they are always restored in switch_to. Since lazy
allocation of the xstate area won't work when non-lazy xstates are used,
all user tasks will always have a xstate area preallocated.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/include/asm/i387.h  |   17 +++++++++++++++++
 arch/x86/include/asm/xsave.h |    5 +++--
 arch/x86/kernel/process_32.c |    2 +-
 arch/x86/kernel/process_64.c |    2 +-
 arch/x86/kernel/xsave.c      |    6 +++++-
 5 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index b8f9617..efe1476 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -329,6 +329,23 @@ static inline void fpu_copy(struct fpu *dst, struct fpu *src)
 }
 
 extern void fpu_finit(struct fpu *fpu);
+static union thread_xstate __init_xstate, *init_xstate = &__init_xstate;
+
+static inline void fpu_clear(struct fpu *fpu)
+{
+	if (pcntxt_mask & XCNTXT_NONLAZY) {
+		if (!fpu_allocated(fpu)) {
+			BUG_ON(init_xstate == NULL);
+			fpu->state = init_xstate;
+			init_xstate = NULL;
+		}
+		memset(fpu->state, 0, xstate_size);
+		fpu_finit(fpu);
+		set_used_math();
+	} else {
+		fpu_free(fpu);
+	}
+}
 
 #endif /* __ASSEMBLY__ */
 
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
index b8861d4..4ccee3c 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
@@ -23,9 +23,10 @@
 /*
  * These are the features that the OS can handle currently.
  */
-#define XCNTXT_MASK	(XSTATE_FP | XSTATE_SSE | XSTATE_YMM)
+#define XCNTXT_LAZY	(XSTATE_FP | XSTATE_SSE | XSTATE_YMM)
+#define XCNTXT_NONLAZY	0
 
-#define XCNTXT_LAZY	XCNTXT_MASK
+#define XCNTXT_MASK	(XCNTXT_LAZY | XCNTXT_NONLAZY)
 
 #ifdef CONFIG_X86_64
 #define REX_PREFIX	"0x48, "
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 8df07c3..a878736 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -257,7 +257,7 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)
 	/*
 	 * Free the old FP and other extended state
 	 */
-	free_thread_xstate(current);
+	fpu_clear(&current->thread.fpu);
 }
 EXPORT_SYMBOL_GPL(start_thread);
 
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index cbf1a67..8ff35fc 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -344,7 +344,7 @@ start_thread_common(struct pt_regs *regs, unsigned long new_ip,
 	/*
 	 * Free the old FP and other extended state
 	 */
-	free_thread_xstate(current);
+	fpu_clear(&current->thread.fpu);
 }
 
 void
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index d42810f..56ab3d3 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -16,6 +16,7 @@
  * Supported feature mask by the CPU and the kernel.
  */
 u64 pcntxt_mask;
+EXPORT_SYMBOL(pcntxt_mask);
 
 /*
  * Represents init state for the supported extended state.
@@ -260,7 +261,7 @@ int restore_xstates_sigframe(void __user *buf, unsigned int size)
 	struct task_struct *tsk = current;
 	struct _fpstate_ia32 __user *fp = buf;
 	struct xsave_struct *xsave;
-	u64 xstate_mask = 0;
+	u64 xstate_mask = pcntxt_mask & XCNTXT_NONLAZY;
 	int err;
 
 	if (!buf) {
@@ -477,6 +478,9 @@ static void __init xstate_enable_boot_cpu(void)
 	printk(KERN_INFO "xsave/xrstor: enabled xstate_bv 0x%llx, "
 	       "cntxt size 0x%x\n",
 	       pcntxt_mask, xstate_size);
+
+	if (pcntxt_mask & XCNTXT_NONLAZY)
+		task_thread_info(&init_task)->xstate_mask |= XCNTXT_NONLAZY;
 }
 
 /*
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC v3 7/8] x86, xsave: add kernel support for AMDs Lightweight Profiling (LWP)
  2011-03-29 15:27         ` H. Peter Anvin
                             ` (7 preceding siblings ...)
  2011-04-05 15:50           ` [RFC v3 6/8] x86, xsave: add support for non-lazy xstates Hans Rosenfeld
@ 2011-04-05 15:50           ` Hans Rosenfeld
  2011-04-06 22:06             ` [tip:x86/xsave] " tip-bot for Hans Rosenfeld
  2011-04-05 15:50           ` [RFC v3 8/8] x86, xsave: remove lazy allocation of xstate area Hans Rosenfeld
  9 siblings, 1 reply; 48+ messages in thread
From: Hans Rosenfeld @ 2011-04-05 15:50 UTC (permalink / raw)
  To: hpa
  Cc: brgerst, tglx, mingo, suresh.b.siddha, eranian, robert.richter,
	Andreas.Herrmann3, x86, linux-kernel, Hans Rosenfeld

This patch extends the xsave structure to support the LWP state. The
xstate feature bit for LWP is added to XCNTXT_NONLAZY, thereby enabling
kernel support for saving/restoring LWP state. The LWP state is also
saved/restored on signal entry/return, just like all other xstates. LWP
state needs to be reset (disabled) when entering a signal handler.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/include/asm/msr-index.h  |    1 +
 arch/x86/include/asm/processor.h  |   12 ++++++++++++
 arch/x86/include/asm/sigcontext.h |   12 ++++++++++++
 arch/x86/include/asm/xsave.h      |    3 ++-
 arch/x86/kernel/xsave.c           |    2 ++
 5 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
index fd5a1f3..55edab6 100644
--- a/arch/x86/include/asm/msr-index.h
+++ b/arch/x86/include/asm/msr-index.h
@@ -131,6 +131,7 @@
 #define MSR_AMD64_IBSDCPHYSAD		0xc0011039
 #define MSR_AMD64_IBSCTL		0xc001103a
 #define MSR_AMD64_IBSBRTARGET		0xc001103b
+#define MSR_AMD64_LWP_CBADDR		0xc0000106
 
 /* Fam 15h MSRs */
 #define MSR_F15H_PERF_CTL		0xc0010200
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 4c25ab4..df2cbd4 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -353,6 +353,17 @@ struct ymmh_struct {
 	u32 ymmh_space[64];
 };
 
+struct lwp_struct {
+	u64 lwpcb_addr;
+	u32 flags;
+	u32 buf_head_offset;
+	u64 buf_base;
+	u32 buf_size;
+	u32 filters;
+	u64 saved_event_record[4];
+	u32 event_counter[16];
+};
+
 struct xsave_hdr_struct {
 	u64 xstate_bv;
 	u64 reserved1[2];
@@ -363,6 +374,7 @@ struct xsave_struct {
 	struct i387_fxsave_struct i387;
 	struct xsave_hdr_struct xsave_hdr;
 	struct ymmh_struct ymmh;
+	struct lwp_struct lwp;
 	/* new processor state extensions will go here */
 } __attribute__ ((packed, aligned (64)));
 
diff --git a/arch/x86/include/asm/sigcontext.h b/arch/x86/include/asm/sigcontext.h
index 04459d2..0a58b82 100644
--- a/arch/x86/include/asm/sigcontext.h
+++ b/arch/x86/include/asm/sigcontext.h
@@ -274,6 +274,17 @@ struct _ymmh_state {
 	__u32 ymmh_space[64];
 };
 
+struct _lwp_state {
+	__u64 lwpcb_addr;
+	__u32 flags;
+	__u32 buf_head_offset;
+	__u64 buf_base;
+	__u32 buf_size;
+	__u32 filters;
+	__u64 saved_event_record[4];
+	__u32 event_counter[16];
+};
+
 /*
  * Extended state pointed by the fpstate pointer in the sigcontext.
  * In addition to the fpstate, information encoded in the xstate_hdr
@@ -284,6 +295,7 @@ struct _xstate {
 	struct _fpstate fpstate;
 	struct _xsave_hdr xstate_hdr;
 	struct _ymmh_state ymmh;
+	struct _lwp_state lwp;
 	/* new processor state extensions go here */
 };
 
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
index 4ccee3c..be89f0e 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
@@ -9,6 +9,7 @@
 #define XSTATE_FP	0x1
 #define XSTATE_SSE	0x2
 #define XSTATE_YMM	0x4
+#define XSTATE_LWP	(1ULL << 62)
 
 #define XSTATE_FPSSE	(XSTATE_FP | XSTATE_SSE)
 
@@ -24,7 +25,7 @@
  * These are the features that the OS can handle currently.
  */
 #define XCNTXT_LAZY	(XSTATE_FP | XSTATE_SSE | XSTATE_YMM)
-#define XCNTXT_NONLAZY	0
+#define XCNTXT_NONLAZY	(XSTATE_LWP)
 
 #define XCNTXT_MASK	(XCNTXT_LAZY | XCNTXT_NONLAZY)
 
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index 56ab3d3..a188362 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -177,6 +177,8 @@ int save_xstates_sigframe(void __user *buf, unsigned int size)
 			(struct _fpstate_ia32 __user *) buf) ? -1 : 1;
 
 	save_xstates(tsk);
+	if (pcntxt_mask & XSTATE_LWP)
+		wrmsrl(MSR_AMD64_LWP_CBADDR, 0);
 	if (use_xsaveopt())
 		sanitize_i387_state(tsk);
 
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC v3 8/8] x86, xsave: remove lazy allocation of xstate area
  2011-03-29 15:27         ` H. Peter Anvin
                             ` (8 preceding siblings ...)
  2011-04-05 15:50           ` [RFC v3 7/8] x86, xsave: add kernel support for AMDs Lightweight Profiling (LWP) Hans Rosenfeld
@ 2011-04-05 15:50           ` Hans Rosenfeld
  2011-04-06 22:06             ` [tip:x86/xsave] " tip-bot for Hans Rosenfeld
  9 siblings, 1 reply; 48+ messages in thread
From: Hans Rosenfeld @ 2011-04-05 15:50 UTC (permalink / raw)
  To: hpa
  Cc: brgerst, tglx, mingo, suresh.b.siddha, eranian, robert.richter,
	Andreas.Herrmann3, x86, linux-kernel, Hans Rosenfeld

This patch completely removes lazy allocation of the xstate area. All
user tasks will always have an xstate area preallocated, just like they
already do when non-lazy features are present. The size of the xsave
area ranges from 112 to 960 bytes, depending on the xstates present and
enabled. Since it is common to use SSE etc. for optimization, the actual
overhead is expected to negligible.

This removes some of the special-case handling of non-lazy xstates. It
also greatly simplifies init_fpu() by removing the allocation code, the
check for presence of the xstate area or init_fpu() return value.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/include/asm/i387.h   |   20 ++++++++------------
 arch/x86/kernel/i387.c        |   41 +++++++++--------------------------------
 arch/x86/kernel/traps.c       |   16 ++--------------
 arch/x86/kernel/xsave.c       |    8 ++------
 arch/x86/kvm/x86.c            |    4 ++--
 arch/x86/math-emu/fpu_entry.c |    8 ++------
 6 files changed, 25 insertions(+), 72 deletions(-)

diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index efe1476..989c0ac 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -40,7 +40,7 @@
 extern unsigned int sig_xstate_size;
 extern void fpu_init(void);
 extern void mxcsr_feature_mask_init(void);
-extern int init_fpu(struct task_struct *child);
+extern void init_fpu(struct task_struct *child);
 extern asmlinkage void math_state_restore(void);
 extern int dump_fpu(struct pt_regs *, struct user_i387_struct *);
 
@@ -333,18 +333,14 @@ static union thread_xstate __init_xstate, *init_xstate = &__init_xstate;
 
 static inline void fpu_clear(struct fpu *fpu)
 {
-	if (pcntxt_mask & XCNTXT_NONLAZY) {
-		if (!fpu_allocated(fpu)) {
-			BUG_ON(init_xstate == NULL);
-			fpu->state = init_xstate;
-			init_xstate = NULL;
-		}
-		memset(fpu->state, 0, xstate_size);
-		fpu_finit(fpu);
-		set_used_math();
-	} else {
-		fpu_free(fpu);
+	if (!fpu_allocated(fpu)) {
+		BUG_ON(init_xstate == NULL);
+		fpu->state = init_xstate;
+		init_xstate = NULL;
 	}
+	memset(fpu->state, 0, xstate_size);
+	fpu_finit(fpu);
+	set_used_math();
 }
 
 #endif /* __ASSEMBLY__ */
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
index dd9644a..df0b139 100644
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -127,9 +127,9 @@ EXPORT_SYMBOL_GPL(fpu_finit);
  * value at reset if we support XMM instructions and then
  * remember the current task has used the FPU.
  */
-int init_fpu(struct task_struct *tsk)
+void init_fpu(struct task_struct *tsk)
 {
-	int ret;
+	BUG_ON(tsk->flags & PF_KTHREAD);
 
 	if (tsk_used_math(tsk)) {
 		if (HAVE_HWFP && tsk == current) {
@@ -137,20 +137,12 @@ int init_fpu(struct task_struct *tsk)
 			save_xstates(tsk);
 			preempt_enable();
 		}
-		return 0;
+		return;
 	}
 
-	/*
-	 * Memory allocation at the first usage of the FPU and other state.
-	 */
-	ret = fpu_alloc(&tsk->thread.fpu);
-	if (ret)
-		return ret;
-
 	fpu_finit(&tsk->thread.fpu);
 
 	set_stopped_child_used_math(tsk);
-	return 0;
 }
 EXPORT_SYMBOL_GPL(init_fpu);
 
@@ -173,14 +165,10 @@ int xfpregs_get(struct task_struct *target, const struct user_regset *regset,
 		unsigned int pos, unsigned int count,
 		void *kbuf, void __user *ubuf)
 {
-	int ret;
-
 	if (!cpu_has_fxsr)
 		return -ENODEV;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	if (use_xsaveopt())
 		sanitize_i387_state(target);
@@ -198,9 +186,7 @@ int xfpregs_set(struct task_struct *target, const struct user_regset *regset,
 	if (!cpu_has_fxsr)
 		return -ENODEV;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	if (use_xsaveopt())
 		sanitize_i387_state(target);
@@ -232,9 +218,7 @@ int xstateregs_get(struct task_struct *target, const struct user_regset *regset,
 	if (!cpu_has_xsave)
 		return -ENODEV;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	/*
 	 * Copy the 48bytes defined by the software first into the xstate
@@ -262,9 +246,7 @@ int xstateregs_set(struct task_struct *target, const struct user_regset *regset,
 	if (!cpu_has_xsave)
 		return -ENODEV;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
 				 &target->thread.fpu.state->xsave, 0, -1);
@@ -427,11 +409,8 @@ int fpregs_get(struct task_struct *target, const struct user_regset *regset,
 	       void *kbuf, void __user *ubuf)
 {
 	struct user_i387_ia32_struct env;
-	int ret;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	if (!HAVE_HWFP)
 		return fpregs_soft_get(target, regset, pos, count, kbuf, ubuf);
@@ -462,9 +441,7 @@ int fpregs_set(struct task_struct *target, const struct user_regset *regset,
 	struct user_i387_ia32_struct env;
 	int ret;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	if (use_xsaveopt())
 		sanitize_i387_state(target);
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 872fc78..c8fbd04 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -734,20 +734,8 @@ asmlinkage void math_state_restore(void)
 	struct thread_info *thread = current_thread_info();
 	struct task_struct *tsk = thread->task;
 
-	if (!tsk_used_math(tsk)) {
-		local_irq_enable();
-		/*
-		 * does a slab alloc which can sleep
-		 */
-		if (init_fpu(tsk)) {
-			/*
-			 * ran out of memory!
-			 */
-			do_group_exit(SIGKILL);
-			return;
-		}
-		local_irq_disable();
-	}
+	if (!tsk_used_math(tsk))
+		init_fpu(tsk);
 
 	restore_xstates(tsk, XCNTXT_LAZY);
 }
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index a188362..62f2df8 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -264,7 +264,6 @@ int restore_xstates_sigframe(void __user *buf, unsigned int size)
 	struct _fpstate_ia32 __user *fp = buf;
 	struct xsave_struct *xsave;
 	u64 xstate_mask = pcntxt_mask & XCNTXT_NONLAZY;
-	int err;
 
 	if (!buf) {
 		if (used_math()) {
@@ -277,11 +276,8 @@ int restore_xstates_sigframe(void __user *buf, unsigned int size)
 	if (!access_ok(VERIFY_READ, buf, size))
 		return -EACCES;
 
-	if (!used_math()) {
-		err = init_fpu(tsk);
-		if (err)
-			return err;
-	}
+	if (!used_math())
+		init_fpu(tsk);
 
 	if (!HAVE_HWFP) {
 		set_used_math();
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index bc04e15..17e52a9 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5386,8 +5386,8 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
 	int r;
 	sigset_t sigsaved;
 
-	if (!tsk_used_math(current) && init_fpu(current))
-		return -ENOMEM;
+	if (!tsk_used_math(current))
+		init_fpu(current);
 
 	if (vcpu->sigset_active)
 		sigprocmask(SIG_SETMASK, &vcpu->sigset, &sigsaved);
diff --git a/arch/x86/math-emu/fpu_entry.c b/arch/x86/math-emu/fpu_entry.c
index 7718541..472e2b9 100644
--- a/arch/x86/math-emu/fpu_entry.c
+++ b/arch/x86/math-emu/fpu_entry.c
@@ -147,12 +147,8 @@ void math_emulate(struct math_emu_info *info)
 	unsigned long code_limit = 0;	/* Initialized to stop compiler warnings */
 	struct desc_struct code_descriptor;
 
-	if (!used_math()) {
-		if (init_fpu(current)) {
-			do_group_exit(SIGKILL);
-			return;
-		}
-	}
+	if (!used_math())
+		init_fpu(current);
 
 #ifdef RE_ENTRANT_CHECKING
 	if (emulating) {
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [tip:x86/xsave] x86, xsave: add kernel support for AMDs Lightweight Profiling (LWP)
  2011-04-05 15:50           ` [RFC v3 7/8] x86, xsave: add kernel support for AMDs Lightweight Profiling (LWP) Hans Rosenfeld
@ 2011-04-06 22:06             ` tip-bot for Hans Rosenfeld
  0 siblings, 0 replies; 48+ messages in thread
From: tip-bot for Hans Rosenfeld @ 2011-04-06 22:06 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hans.rosenfeld, hpa, mingo, tglx, hpa

Commit-ID:  1039b306b1c68c2b4183b22a131c5f031dfedc2b
Gitweb:     http://git.kernel.org/tip/1039b306b1c68c2b4183b22a131c5f031dfedc2b
Author:     Hans Rosenfeld <hans.rosenfeld@amd.com>
AuthorDate: Tue, 5 Apr 2011 17:50:55 +0200
Committer:  H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Wed, 6 Apr 2011 14:15:20 -0700

x86, xsave: add kernel support for AMDs Lightweight Profiling (LWP)

This patch extends the xsave structure to support the LWP state. The
xstate feature bit for LWP is added to XCNTXT_NONLAZY, thereby enabling
kernel support for saving/restoring LWP state. The LWP state is also
saved/restored on signal entry/return, just like all other xstates. LWP
state needs to be reset (disabled) when entering a signal handler.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
Link: http://lkml.kernel.org/r/1302018656-586370-8-git-send-email-hans.rosenfeld@amd.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/include/asm/msr-index.h  |    1 +
 arch/x86/include/asm/processor.h  |   12 ++++++++++++
 arch/x86/include/asm/sigcontext.h |   12 ++++++++++++
 arch/x86/include/asm/xsave.h      |    3 ++-
 arch/x86/kernel/xsave.c           |    2 ++
 5 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
index fd5a1f3..55edab6 100644
--- a/arch/x86/include/asm/msr-index.h
+++ b/arch/x86/include/asm/msr-index.h
@@ -131,6 +131,7 @@
 #define MSR_AMD64_IBSDCPHYSAD		0xc0011039
 #define MSR_AMD64_IBSCTL		0xc001103a
 #define MSR_AMD64_IBSBRTARGET		0xc001103b
+#define MSR_AMD64_LWP_CBADDR		0xc0000106
 
 /* Fam 15h MSRs */
 #define MSR_F15H_PERF_CTL		0xc0010200
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 4c25ab4..df2cbd4 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -353,6 +353,17 @@ struct ymmh_struct {
 	u32 ymmh_space[64];
 };
 
+struct lwp_struct {
+	u64 lwpcb_addr;
+	u32 flags;
+	u32 buf_head_offset;
+	u64 buf_base;
+	u32 buf_size;
+	u32 filters;
+	u64 saved_event_record[4];
+	u32 event_counter[16];
+};
+
 struct xsave_hdr_struct {
 	u64 xstate_bv;
 	u64 reserved1[2];
@@ -363,6 +374,7 @@ struct xsave_struct {
 	struct i387_fxsave_struct i387;
 	struct xsave_hdr_struct xsave_hdr;
 	struct ymmh_struct ymmh;
+	struct lwp_struct lwp;
 	/* new processor state extensions will go here */
 } __attribute__ ((packed, aligned (64)));
 
diff --git a/arch/x86/include/asm/sigcontext.h b/arch/x86/include/asm/sigcontext.h
index 04459d2..0a58b82 100644
--- a/arch/x86/include/asm/sigcontext.h
+++ b/arch/x86/include/asm/sigcontext.h
@@ -274,6 +274,17 @@ struct _ymmh_state {
 	__u32 ymmh_space[64];
 };
 
+struct _lwp_state {
+	__u64 lwpcb_addr;
+	__u32 flags;
+	__u32 buf_head_offset;
+	__u64 buf_base;
+	__u32 buf_size;
+	__u32 filters;
+	__u64 saved_event_record[4];
+	__u32 event_counter[16];
+};
+
 /*
  * Extended state pointed by the fpstate pointer in the sigcontext.
  * In addition to the fpstate, information encoded in the xstate_hdr
@@ -284,6 +295,7 @@ struct _xstate {
 	struct _fpstate fpstate;
 	struct _xsave_hdr xstate_hdr;
 	struct _ymmh_state ymmh;
+	struct _lwp_state lwp;
 	/* new processor state extensions go here */
 };
 
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
index 4ccee3c..be89f0e 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
@@ -9,6 +9,7 @@
 #define XSTATE_FP	0x1
 #define XSTATE_SSE	0x2
 #define XSTATE_YMM	0x4
+#define XSTATE_LWP	(1ULL << 62)
 
 #define XSTATE_FPSSE	(XSTATE_FP | XSTATE_SSE)
 
@@ -24,7 +25,7 @@
  * These are the features that the OS can handle currently.
  */
 #define XCNTXT_LAZY	(XSTATE_FP | XSTATE_SSE | XSTATE_YMM)
-#define XCNTXT_NONLAZY	0
+#define XCNTXT_NONLAZY	(XSTATE_LWP)
 
 #define XCNTXT_MASK	(XCNTXT_LAZY | XCNTXT_NONLAZY)
 
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index 56ab3d3..a188362 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -177,6 +177,8 @@ int save_xstates_sigframe(void __user *buf, unsigned int size)
 			(struct _fpstate_ia32 __user *) buf) ? -1 : 1;
 
 	save_xstates(tsk);
+	if (pcntxt_mask & XSTATE_LWP)
+		wrmsrl(MSR_AMD64_LWP_CBADDR, 0);
 	if (use_xsaveopt())
 		sanitize_i387_state(tsk);
 

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [tip:x86/xsave] x86, xsave: remove lazy allocation of xstate area
  2011-04-05 15:50           ` [RFC v3 8/8] x86, xsave: remove lazy allocation of xstate area Hans Rosenfeld
@ 2011-04-06 22:06             ` tip-bot for Hans Rosenfeld
  0 siblings, 0 replies; 48+ messages in thread
From: tip-bot for Hans Rosenfeld @ 2011-04-06 22:06 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hans.rosenfeld, hpa, mingo, tglx, hpa

Commit-ID:  66beba27e8b5c3f61818cc58bd6c9e0e3cfd7711
Gitweb:     http://git.kernel.org/tip/66beba27e8b5c3f61818cc58bd6c9e0e3cfd7711
Author:     Hans Rosenfeld <hans.rosenfeld@amd.com>
AuthorDate: Tue, 5 Apr 2011 17:50:56 +0200
Committer:  H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Wed, 6 Apr 2011 14:15:21 -0700

x86, xsave: remove lazy allocation of xstate area

This patch completely removes lazy allocation of the xstate area. All
user tasks will always have an xstate area preallocated, just like they
already do when non-lazy features are present. The size of the xsave
area ranges from 112 to 960 bytes, depending on the xstates present and
enabled. Since it is common to use SSE etc. for optimization, the actual
overhead is expected to negligible.

This removes some of the special-case handling of non-lazy xstates. It
also greatly simplifies init_fpu() by removing the allocation code, the
check for presence of the xstate area or init_fpu() return value.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
Link: http://lkml.kernel.org/r/1302018656-586370-9-git-send-email-hans.rosenfeld@amd.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/include/asm/i387.h   |   20 ++++++++------------
 arch/x86/kernel/i387.c        |   41 +++++++++--------------------------------
 arch/x86/kernel/traps.c       |   16 ++--------------
 arch/x86/kernel/xsave.c       |    8 ++------
 arch/x86/kvm/x86.c            |    4 ++--
 arch/x86/math-emu/fpu_entry.c |    8 ++------
 6 files changed, 25 insertions(+), 72 deletions(-)

diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index da55ab6..3ca900b 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -40,7 +40,7 @@
 extern unsigned int sig_xstate_size;
 extern void fpu_init(void);
 extern void mxcsr_feature_mask_init(void);
-extern int init_fpu(struct task_struct *child);
+extern void init_fpu(struct task_struct *child);
 extern asmlinkage void math_state_restore(void);
 extern int dump_fpu(struct pt_regs *, struct user_i387_struct *);
 
@@ -333,18 +333,14 @@ static union thread_xstate __init_xstate, *init_xstate = &__init_xstate;
 
 static inline void fpu_clear(struct fpu *fpu)
 {
-	if (pcntxt_mask & XCNTXT_NONLAZY) {
-		if (!fpu_allocated(fpu)) {
-			BUG_ON(init_xstate == NULL);
-			fpu->state = init_xstate;
-			init_xstate = NULL;
-		}
-		memset(fpu->state, 0, xstate_size);
-		fpu_finit(fpu);
-		set_used_math();
-	} else {
-		fpu_free(fpu);
+	if (!fpu_allocated(fpu)) {
+		BUG_ON(init_xstate == NULL);
+		fpu->state = init_xstate;
+		init_xstate = NULL;
 	}
+	memset(fpu->state, 0, xstate_size);
+	fpu_finit(fpu);
+	set_used_math();
 }
 
 #endif /* __ASSEMBLY__ */
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
index dd9644a..df0b139 100644
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -127,9 +127,9 @@ EXPORT_SYMBOL_GPL(fpu_finit);
  * value at reset if we support XMM instructions and then
  * remember the current task has used the FPU.
  */
-int init_fpu(struct task_struct *tsk)
+void init_fpu(struct task_struct *tsk)
 {
-	int ret;
+	BUG_ON(tsk->flags & PF_KTHREAD);
 
 	if (tsk_used_math(tsk)) {
 		if (HAVE_HWFP && tsk == current) {
@@ -137,20 +137,12 @@ int init_fpu(struct task_struct *tsk)
 			save_xstates(tsk);
 			preempt_enable();
 		}
-		return 0;
+		return;
 	}
 
-	/*
-	 * Memory allocation at the first usage of the FPU and other state.
-	 */
-	ret = fpu_alloc(&tsk->thread.fpu);
-	if (ret)
-		return ret;
-
 	fpu_finit(&tsk->thread.fpu);
 
 	set_stopped_child_used_math(tsk);
-	return 0;
 }
 EXPORT_SYMBOL_GPL(init_fpu);
 
@@ -173,14 +165,10 @@ int xfpregs_get(struct task_struct *target, const struct user_regset *regset,
 		unsigned int pos, unsigned int count,
 		void *kbuf, void __user *ubuf)
 {
-	int ret;
-
 	if (!cpu_has_fxsr)
 		return -ENODEV;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	if (use_xsaveopt())
 		sanitize_i387_state(target);
@@ -198,9 +186,7 @@ int xfpregs_set(struct task_struct *target, const struct user_regset *regset,
 	if (!cpu_has_fxsr)
 		return -ENODEV;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	if (use_xsaveopt())
 		sanitize_i387_state(target);
@@ -232,9 +218,7 @@ int xstateregs_get(struct task_struct *target, const struct user_regset *regset,
 	if (!cpu_has_xsave)
 		return -ENODEV;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	/*
 	 * Copy the 48bytes defined by the software first into the xstate
@@ -262,9 +246,7 @@ int xstateregs_set(struct task_struct *target, const struct user_regset *regset,
 	if (!cpu_has_xsave)
 		return -ENODEV;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
 				 &target->thread.fpu.state->xsave, 0, -1);
@@ -427,11 +409,8 @@ int fpregs_get(struct task_struct *target, const struct user_regset *regset,
 	       void *kbuf, void __user *ubuf)
 {
 	struct user_i387_ia32_struct env;
-	int ret;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	if (!HAVE_HWFP)
 		return fpregs_soft_get(target, regset, pos, count, kbuf, ubuf);
@@ -462,9 +441,7 @@ int fpregs_set(struct task_struct *target, const struct user_regset *regset,
 	struct user_i387_ia32_struct env;
 	int ret;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	if (use_xsaveopt())
 		sanitize_i387_state(target);
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 872fc78..c8fbd04 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -734,20 +734,8 @@ asmlinkage void math_state_restore(void)
 	struct thread_info *thread = current_thread_info();
 	struct task_struct *tsk = thread->task;
 
-	if (!tsk_used_math(tsk)) {
-		local_irq_enable();
-		/*
-		 * does a slab alloc which can sleep
-		 */
-		if (init_fpu(tsk)) {
-			/*
-			 * ran out of memory!
-			 */
-			do_group_exit(SIGKILL);
-			return;
-		}
-		local_irq_disable();
-	}
+	if (!tsk_used_math(tsk))
+		init_fpu(tsk);
 
 	restore_xstates(tsk, XCNTXT_LAZY);
 }
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index a188362..62f2df8 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -264,7 +264,6 @@ int restore_xstates_sigframe(void __user *buf, unsigned int size)
 	struct _fpstate_ia32 __user *fp = buf;
 	struct xsave_struct *xsave;
 	u64 xstate_mask = pcntxt_mask & XCNTXT_NONLAZY;
-	int err;
 
 	if (!buf) {
 		if (used_math()) {
@@ -277,11 +276,8 @@ int restore_xstates_sigframe(void __user *buf, unsigned int size)
 	if (!access_ok(VERIFY_READ, buf, size))
 		return -EACCES;
 
-	if (!used_math()) {
-		err = init_fpu(tsk);
-		if (err)
-			return err;
-	}
+	if (!used_math())
+		init_fpu(tsk);
 
 	if (!HAVE_HWFP) {
 		set_used_math();
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index bc04e15..17e52a9 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5386,8 +5386,8 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
 	int r;
 	sigset_t sigsaved;
 
-	if (!tsk_used_math(current) && init_fpu(current))
-		return -ENOMEM;
+	if (!tsk_used_math(current))
+		init_fpu(current);
 
 	if (vcpu->sigset_active)
 		sigprocmask(SIG_SETMASK, &vcpu->sigset, &sigsaved);
diff --git a/arch/x86/math-emu/fpu_entry.c b/arch/x86/math-emu/fpu_entry.c
index 7718541..472e2b9 100644
--- a/arch/x86/math-emu/fpu_entry.c
+++ b/arch/x86/math-emu/fpu_entry.c
@@ -147,12 +147,8 @@ void math_emulate(struct math_emu_info *info)
 	unsigned long code_limit = 0;	/* Initialized to stop compiler warnings */
 	struct desc_struct code_descriptor;
 
-	if (!used_math()) {
-		if (init_fpu(current)) {
-			do_group_exit(SIGKILL);
-			return;
-		}
-	}
+	if (!used_math())
+		init_fpu(current);
 
 #ifdef RE_ENTRANT_CHECKING
 	if (emulating) {

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [RFC v3 0/8] x86, xsave: rework of extended state handling, LWP support
  2011-04-05 15:50           ` [RFC v3 0/8] x86, xsave: rework of extended state handling, LWP support Hans Rosenfeld
@ 2011-04-07  7:23             ` Ingo Molnar
  2011-04-07 15:30               ` Hans Rosenfeld
  2011-05-16 19:10               ` [RFC v3 0/8] x86, xsave: rework of extended state handling, LWP support Hans Rosenfeld
  0 siblings, 2 replies; 48+ messages in thread
From: Ingo Molnar @ 2011-04-07  7:23 UTC (permalink / raw)
  To: Hans Rosenfeld
  Cc: hpa, brgerst, tglx, suresh.b.siddha, eranian, robert.richter,
	Andreas.Herrmann3, x86, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 3090 bytes --]


FYI, the bits in tip:x86/xsave crash on boot on an AMD X2 testbox:

[   10.823492] Freeing unused kernel memory: 616k freed
[   11.087787] ------------[ cut here ]------------
[   11.088312] Kernel BUG at ffffffff8100a140 [verbose debug info unavailable]
[   11.088312] invalid opcode: 0000 [#1] SMP 
[   11.088312] last sysfs file: 
[   11.088312] CPU 1 
[   11.088312] Modules linked in:
[   11.088312] 
[   11.088312] Pid: 41, comm: modprobe Not tainted 2.6.39-rc2-tip+ #113394  
[   11.088312] RIP: 0010:[<ffffffff8100a140>]  [<ffffffff8100a140>] start_thread_common.constprop.1+0x100/0x110
[   11.088312] RSP: 0018:ffff88003d7c5c40  EFLAGS: 00010246
[   11.088312] RAX: ffff88003d7c5fd8 RBX: ffff88003d74bd40 RCX: 0000000000000033
[   11.088312] RDX: 00007ffffffff000 RSI: 000000310f600ac0 RDI: 0000000000000000
[   11.088312] RBP: ffff88003d7c5c60 R08: 0000000000000000 R09: 0000000000000004
[   11.088312] R10: 00007fff4ae4dd68 R11: 0000000000000000 R12: 00007fff4ae4dd60
[   11.088312] R13: 000000310f600ac0 R14: 0000000000000033 R15: ffff88003d74bd40
[   11.088312] FS:  00007f48d909f780(0000) GS:ffff88003fd00000(0000) knlGS:0000000000000000
[   11.088312] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[   11.088312] CR2: 00007fff4ae4def9 CR3: 000000003d7af000 CR4: 00000000000006e0
[   11.088312] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   11.088312] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[   11.088312] Process modprobe (pid: 41, threadinfo ffff88003d7c4000, task ffff88003d74bd40)
[   11.088312] Stack:
[   11.088312]  ffff88003d72c400 ffff88003d60a400 0000000000000000 ffff88003d7c5e80
[   11.088312]  ffff88003d7c5c70 ffffffff8100a546 ffff88003d7c5d90 ffffffff8117c7de
[   11.088312]  ffff88003d74bd40 0000000000000004 00007fff4ae4dda8 00007fff4ae4dd68
[   11.088312] Call Trace:
[   11.088312]  [<ffffffff8100a546>] start_thread+0x16/0x20
[   11.088312]  [<ffffffff8117c7de>] load_elf_binary+0x14fe/0x1980
[   11.088312]  [<ffffffff81138392>] search_binary_handler+0xc2/0x2a0
[   11.088312]  [<ffffffff8117b2e0>] ? load_elf_library+0x2b0/0x2b0
[   11.088312]  [<ffffffff8113a35c>] do_execve+0x24c/0x2d0
[   11.088312]  [<ffffffff81014b97>] sys_execve+0x47/0x80
[   11.088312]  [<ffffffff8145b698>] kernel_execve+0x68/0xd0
[   11.088312]  [<ffffffff8106ca83>] ? ____call_usermodehelper+0x93/0xa0
[   11.088312]  [<ffffffff8145b624>] kernel_thread_helper+0x4/0x10
[   11.088312]  [<ffffffff81459f54>] ? retint_restore_args+0x13/0x13
[   11.088312]  [<ffffffff8106c9f0>] ? call_usermodehelper_setup+0xe0/0xe0
[   11.088312]  [<ffffffff8145b620>] ? gs_change+0x13/0x13
[   11.088312] Code: f0 4c 8b 75 f8 c9 c3 0f 1f 40 00 48 8b 3d 19 01 64 00 48 85 ff 74 14 48 89 bb a0 04 00 00 48 c7 05 02 01 64 00 00 00 00 00 eb a1 <0f> 0b 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 55 48 89 e5 66 
[   11.088312] RIP  [<ffffffff8100a140>] start_thread_common.constprop.1+0x100/0x110
[   11.088312]  RSP <ffff88003d7c5c40>

Full crashlog and kernel config attached. I've excluded x86/save from 
tip:master for now.

Thanks,

	Ingo

[-- Attachment #2: config-Thu_Apr__7_09_46_14_CEST_2011.bad --]
[-- Type: text/plain, Size: 73163 bytes --]

# a669804d
#
# Automatically generated make config: don't edit
# Linux/x86_64 2.6.39-rc2 Kernel Configuration
# Thu Apr  7 09:46:14 2011
#
CONFIG_64BIT=y
# CONFIG_X86_32 is not set
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_MMU=y
CONFIG_ZONE_DMA=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_IOMAP=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_GPIO=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
# CONFIG_RWSEM_GENERIC_SPINLOCK is not set
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_ARCH_HAS_CPU_RELAX=y
CONFIG_ARCH_HAS_DEFAULT_IDLE=y
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
CONFIG_HAVE_CPUMASK_OF_CPU_MAP=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ZONE_DMA32=y
CONFIG_ARCH_POPULATES_NODE_MAP=y
CONFIG_AUDIT_ARCH=y
CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_X86_64_SMP=y
CONFIG_X86_HT=y
CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi -fcall-saved-rsi -fcall-saved-rdx -fcall-saved-rcx -fcall-saved-r8 -fcall-saved-r9 -fcall-saved-r10 -fcall-saved-r11"
# CONFIG_KTIME_SCALAR is not set
# CONFIG_BOOTPARAM_SUPPORT_NOT_WANTED is not set
# CONFIG_BOOTPARAM_SUPPORT is not set
CONFIG_ARCH_CPU_PROBE_RELEASE=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_CONSTRUCTORS=y
CONFIG_HAVE_IRQ_WORK=y
CONFIG_IRQ_WORK=y

#
# General setup
#
CONFIG_EXPERIMENTAL=y
CONFIG_BROKEN_BOOT_ALLOWED4=y
CONFIG_BROKEN_BOOT_ALLOWED3=y
CONFIG_BROKEN_BOOT_ALLOWED2=y
CONFIG_BROKEN_BOOT_DISALLOWED=y
# CONFIG_BROKEN_BOOT_EUROPE is not set
# CONFIG_BROKEN_BOOT_TITAN is not set
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_CROSS_COMPILE=""
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_BZIP2=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_KERNEL_LZO=y
# CONFIG_KERNEL_GZIP is not set
# CONFIG_KERNEL_BZIP2 is not set
# CONFIG_KERNEL_LZMA is not set
CONFIG_KERNEL_XZ=y
# CONFIG_KERNEL_LZO is not set
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
# CONFIG_POSIX_MQUEUE is not set
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_FHANDLE is not set
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
# CONFIG_TASK_XACCT is not set
CONFIG_AUDIT=y
# CONFIG_AUDITSYSCALL is not set
CONFIG_HAVE_GENERIC_HARDIRQS=y

#
# IRQ subsystem
#
CONFIG_GENERIC_HARDIRQS=y
CONFIG_HAVE_SPARSE_IRQ=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_PENDING_IRQ=y
CONFIG_IRQ_FORCED_THREADING=y
# CONFIG_SPARSE_IRQ is not set

#
# RCU Subsystem
#
CONFIG_TREE_RCU=y
# CONFIG_PREEMPT_RCU is not set
# CONFIG_RCU_TRACE is not set
CONFIG_RCU_FANOUT=64
CONFIG_RCU_FANOUT_EXACT=y
# CONFIG_TREE_RCU_TRACE is not set
CONFIG_IKCONFIG=m
# CONFIG_IKCONFIG_PROC is not set
CONFIG_LOG_BUF_SHIFT=20
CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
CONFIG_CGROUPS=y
CONFIG_CGROUP_DEBUG=y
CONFIG_CGROUP_NS=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
# CONFIG_CPUSETS is not set
# CONFIG_CGROUP_CPUACCT is not set
# CONFIG_RESOURCE_COUNTERS is not set
CONFIG_CGROUP_PERF=y
# CONFIG_CGROUP_SCHED is not set
# CONFIG_BLK_CGROUP is not set
# CONFIG_NAMESPACES is not set
# CONFIG_SCHED_AUTOGROUP is not set
CONFIG_SYSFS_DEPRECATED=y
# CONFIG_SYSFS_DEPRECATED_V2 is not set
CONFIG_RELAY=y
# CONFIG_BLK_DEV_INITRD is not set
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_ANON_INODES=y
CONFIG_EXPERT=y
CONFIG_EMBEDDED=y
# CONFIG_UID16 is not set
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
# CONFIG_KALLSYMS_EXTRA_PASS is not set
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
# CONFIG_ELF_CORE is not set
# CONFIG_PCSPKR_PLATFORM is not set
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
# CONFIG_EPOLL is not set
# CONFIG_SIGNALFD is not set
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
# CONFIG_SHMEM is not set
# CONFIG_AIO is not set
CONFIG_HAVE_PERF_EVENTS=y
CONFIG_PERF_USE_VMALLOC=y

#
# Kernel Performance Events And Counters
#
CONFIG_PERF_EVENTS=y
# CONFIG_PERF_COUNTERS is not set
CONFIG_DEBUG_PERF_USE_VMALLOC=y
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_PCI_QUIRKS=y
CONFIG_SLUB_DEBUG=y
CONFIG_COMPAT_BRK=y
# CONFIG_SLAB is not set
CONFIG_SLUB=y
# CONFIG_SLOB is not set
CONFIG_PROFILING=y
CONFIG_TRACEPOINTS=y
CONFIG_OPROFILE=m
# CONFIG_OPROFILE_EVENT_MULTIPLEX is not set
CONFIG_HAVE_OPROFILE=y
# CONFIG_KPROBES is not set
CONFIG_JUMP_LABEL=y
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
CONFIG_USER_RETURN_NOTIFIER=y
CONFIG_HAVE_IOREMAP_PROT=y
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=y
CONFIG_HAVE_OPTPROBES=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
CONFIG_HAVE_DMA_ATTRS=y
CONFIG_USE_GENERIC_SMP_HELPERS=y
CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
CONFIG_HAVE_DMA_API_DEBUG=y
CONFIG_HAVE_HW_BREAKPOINT=y
CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y
CONFIG_HAVE_USER_RETURN_NOTIFIER=y
CONFIG_HAVE_PERF_EVENTS_NMI=y
CONFIG_HAVE_ARCH_JUMP_LABEL=y

#
# GCOV-based kernel profiling
#
# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
# CONFIG_MODULE_FORCE_LOAD is not set
# CONFIG_MODULE_UNLOAD is not set
# CONFIG_MODVERSIONS is not set
# CONFIG_MODULE_SRCVERSION_ALL is not set
CONFIG_STOP_MACHINE=y
CONFIG_BLOCK=y
CONFIG_BLK_DEV_BSG=y
CONFIG_BLK_DEV_INTEGRITY=y
CONFIG_BLOCK_COMPAT=y

#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_DEADLINE=m
# CONFIG_IOSCHED_CFQ is not set
CONFIG_DEFAULT_NOOP=y
CONFIG_DEFAULT_IOSCHED="noop"
CONFIG_PREEMPT_NOTIFIERS=y
# CONFIG_INLINE_SPIN_TRYLOCK is not set
# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
# CONFIG_INLINE_SPIN_LOCK is not set
# CONFIG_INLINE_SPIN_LOCK_BH is not set
# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
# CONFIG_INLINE_SPIN_UNLOCK is not set
# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
# CONFIG_INLINE_READ_TRYLOCK is not set
# CONFIG_INLINE_READ_LOCK is not set
# CONFIG_INLINE_READ_LOCK_BH is not set
# CONFIG_INLINE_READ_LOCK_IRQ is not set
# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
# CONFIG_INLINE_READ_UNLOCK is not set
# CONFIG_INLINE_READ_UNLOCK_BH is not set
# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
# CONFIG_INLINE_WRITE_TRYLOCK is not set
# CONFIG_INLINE_WRITE_LOCK is not set
# CONFIG_INLINE_WRITE_LOCK_BH is not set
# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
# CONFIG_INLINE_WRITE_UNLOCK is not set
# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
# CONFIG_MUTEX_SPIN_ON_OWNER is not set
CONFIG_FREEZER=y

#
# Processor type and features
#
CONFIG_TICK_ONESHOT=y
# CONFIG_NO_HZ is not set
CONFIG_HIGH_RES_TIMERS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_SMP_SUPPORT=y
CONFIG_X86_MPPARSE=y
CONFIG_X86_EXTENDED_PLATFORM=y
# CONFIG_X86_VSMP is not set
CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y
CONFIG_SCHED_OMIT_FRAME_POINTER=y
CONFIG_PARAVIRT_GUEST=y
CONFIG_XEN=y
CONFIG_XEN_DOM0=y
CONFIG_XEN_PRIVILEGED_GUEST=y
CONFIG_XEN_PVHVM=y
CONFIG_XEN_MAX_DOMAIN_MEMORY=128
CONFIG_XEN_SAVE_RESTORE=y
# CONFIG_XEN_DEBUG_FS is not set
CONFIG_XEN_DEBUG=y
CONFIG_KVM_CLOCK=y
# CONFIG_KVM_GUEST is not set
CONFIG_PARAVIRT=y
# CONFIG_PARAVIRT_SPINLOCKS is not set
CONFIG_PARAVIRT_CLOCK=y
# CONFIG_PARAVIRT_DEBUG is not set
CONFIG_NO_BOOTMEM=y
CONFIG_MEMTEST=y
# CONFIG_MK8 is not set
# CONFIG_MPSC is not set
# CONFIG_MCORE2 is not set
# CONFIG_MATOM is not set
CONFIG_GENERIC_CPU=y
CONFIG_X86_INTERNODE_CACHE_SHIFT=7
CONFIG_X86_CMPXCHG=y
CONFIG_CMPXCHG_LOCAL=y
CONFIG_X86_L1_CACHE_SHIFT=6
CONFIG_X86_XADD=y
CONFIG_X86_WP_WORKS_OK=y
CONFIG_X86_TSC=y
CONFIG_X86_CMPXCHG64=y
CONFIG_X86_CMOV=y
CONFIG_X86_MINIMUM_CPU_FAMILY=64
CONFIG_X86_DEBUGCTLMSR=y
CONFIG_PROCESSOR_SELECT=y
CONFIG_CPU_SUP_INTEL=y
CONFIG_CPU_SUP_AMD=y
CONFIG_CPU_SUP_CENTAUR=y
CONFIG_HPET_TIMER=y
# CONFIG_DMI is not set
# CONFIG_GART_IOMMU is not set
# CONFIG_CALGARY_IOMMU is not set
CONFIG_AMD_IOMMU=y
CONFIG_AMD_IOMMU_STATS=y
CONFIG_SWIOTLB=y
CONFIG_IOMMU_HELPER=y
CONFIG_IOMMU_API=y
# CONFIG_MAXSMP is not set
CONFIG_NR_CPUS=8
CONFIG_SCHED_SMT=y
CONFIG_SCHED_MC=y
# CONFIG_IRQ_TIME_ACCOUNTING is not set
# CONFIG_PREEMPT_NONE is not set
CONFIG_PREEMPT_VOLUNTARY=y
# CONFIG_PREEMPT is not set
CONFIG_X86_LOCAL_APIC=y
CONFIG_X86_IO_APIC=y
# CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS is not set
CONFIG_X86_MCE=y
CONFIG_X86_MCE_INTEL=y
CONFIG_X86_MCE_AMD=y
CONFIG_X86_MCE_THRESHOLD=y
CONFIG_X86_MCE_INJECT=m
CONFIG_X86_THERMAL_VECTOR=y
CONFIG_I8K=m
CONFIG_MICROCODE=m
CONFIG_MICROCODE_INTEL=y
# CONFIG_MICROCODE_AMD is not set
CONFIG_MICROCODE_OLD_INTERFACE=y
CONFIG_X86_MSR=m
# CONFIG_X86_CPUID is not set
# CONFIG_UP_WANTED_1 is not set
CONFIG_SMP=y
CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
# CONFIG_DIRECT_GBPAGES is not set
CONFIG_NUMA=y
CONFIG_AMD_NUMA=y
CONFIG_X86_64_ACPI_NUMA=y
CONFIG_NODES_SPAN_OTHER_NODES=y
CONFIG_NUMA_EMU=y
CONFIG_NODES_SHIFT=6
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_SPARSEMEM_DEFAULT=y
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
CONFIG_ARCH_MEMORY_PROBE=y
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_SPARSEMEM_MANUAL=y
CONFIG_SPARSEMEM=y
CONFIG_NEED_MULTIPLE_NODES=y
CONFIG_HAVE_MEMORY_PRESENT=y
CONFIG_SPARSEMEM_EXTREME=y
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER=y
# CONFIG_SPARSEMEM_VMEMMAP is not set
CONFIG_HAVE_MEMBLOCK=y
CONFIG_MEMORY_HOTPLUG=y
CONFIG_MEMORY_HOTPLUG_SPARSE=y
# CONFIG_MEMORY_HOTREMOVE is not set
CONFIG_PAGEFLAGS_EXTENDED=y
CONFIG_SPLIT_PTLOCK_CPUS=999999
CONFIG_COMPACTION=y
CONFIG_MIGRATION=y
CONFIG_PHYS_ADDR_T_64BIT=y
CONFIG_ZONE_DMA_FLAG=1
CONFIG_BOUNCE=y
CONFIG_VIRT_TO_BUS=y
CONFIG_MMU_NOTIFIER=y
CONFIG_KSM=y
CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y
# CONFIG_MEMORY_FAILURE is not set
# CONFIG_TRANSPARENT_HUGEPAGE is not set
CONFIG_X86_CHECK_BIOS_CORRUPTION=y
# CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK is not set
CONFIG_X86_RESERVE_LOW=64
CONFIG_MTRR=y
CONFIG_MTRR_SANITIZER=y
CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=0
CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
# CONFIG_X86_PAT is not set
CONFIG_EFI=y
# CONFIG_SECCOMP is not set
# CONFIG_CC_STACKPROTECTOR is not set
# CONFIG_HZ_100 is not set
# CONFIG_HZ_250 is not set
# CONFIG_HZ_300 is not set
CONFIG_HZ_1000=y
CONFIG_HZ=1000
CONFIG_SCHED_HRTICK=y
CONFIG_KEXEC=y
# CONFIG_CRASH_DUMP is not set
# CONFIG_KEXEC_JUMP is not set
CONFIG_PHYSICAL_START=0x1000000
CONFIG_RELOCATABLE=y
CONFIG_PHYSICAL_ALIGN=0x1000000
CONFIG_HOTPLUG_CPU=y
CONFIG_COMPAT_VDSO=y
# CONFIG_CMDLINE_BOOL is not set
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
CONFIG_USE_PERCPU_NUMA_NODE_ID=y

#
# Power management and ACPI options
#
CONFIG_ARCH_HIBERNATION_HEADER=y
# CONFIG_SUSPEND is not set
CONFIG_HIBERNATION=y
CONFIG_PM_STD_PARTITION=""
CONFIG_PM_SLEEP=y
CONFIG_PM_SLEEP_SMP=y
# CONFIG_PM_RUNTIME is not set
CONFIG_PM=y
CONFIG_PM_DEBUG=y
CONFIG_PM_VERBOSE=y
CONFIG_PM_ADVANCED_DEBUG=y
CONFIG_CAN_PM_TRACE=y
# CONFIG_PM_TRACE_RTC is not set
CONFIG_ACPI=y
CONFIG_ACPI_SLEEP=y
# CONFIG_ACPI_PROCFS is not set
CONFIG_ACPI_PROCFS_POWER=y
CONFIG_ACPI_EC_DEBUGFS=m
CONFIG_ACPI_PROC_EVENT=y
CONFIG_ACPI_AC=m
CONFIG_ACPI_BATTERY=m
CONFIG_ACPI_BUTTON=m
CONFIG_ACPI_FAN=m
# CONFIG_ACPI_DOCK is not set
# CONFIG_ACPI_PROCESSOR is not set
CONFIG_ACPI_NUMA=y
# CONFIG_ACPI_CUSTOM_DSDT is not set
CONFIG_ACPI_BLACKLIST_YEAR=0
# CONFIG_ACPI_DEBUG is not set
CONFIG_ACPI_PCI_SLOT=m
# CONFIG_X86_PM_TIMER is not set
CONFIG_ACPI_CONTAINER=m
CONFIG_ACPI_HOTPLUG_MEMORY=m
# CONFIG_ACPI_SBS is not set
# CONFIG_ACPI_HED is not set
# CONFIG_ACPI_APEI is not set
CONFIG_SFI=y

#
# CPU Frequency scaling
#
# CONFIG_CPU_FREQ is not set
CONFIG_CPU_IDLE=y
CONFIG_CPU_IDLE_GOV_LADDER=y
CONFIG_INTEL_IDLE=y

#
# Memory power savings
#
# CONFIG_I7300_IDLE is not set

#
# Bus options (PCI etc.)
#
CONFIG_PCI=y
CONFIG_PCI_DIRECT=y
CONFIG_PCI_MMCONFIG=y
CONFIG_PCI_XEN=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCI_CNB20LE_QUIRK=y
# CONFIG_DMAR is not set
# CONFIG_INTR_REMAP is not set
# CONFIG_PCIEPORTBUS is not set
CONFIG_ARCH_SUPPORTS_MSI=y
CONFIG_PCI_MSI=y
# CONFIG_PCI_DEBUG is not set
# CONFIG_PCI_STUB is not set
CONFIG_XEN_PCIDEV_FRONTEND=m
# CONFIG_HT_IRQ is not set
# CONFIG_PCI_IOV is not set
CONFIG_PCI_IOAPIC=y
CONFIG_ISA_DMA_API=y
CONFIG_AMD_NB=y
CONFIG_PCCARD=m
# CONFIG_PCMCIA is not set
# CONFIG_CARDBUS is not set

#
# PC-card bridges
#
CONFIG_YENTA=m
# CONFIG_YENTA_O2 is not set
CONFIG_YENTA_RICOH=y
# CONFIG_YENTA_TI is not set
# CONFIG_YENTA_TOSHIBA is not set
# CONFIG_HOTPLUG_PCI is not set
CONFIG_RAPIDIO=y
CONFIG_RAPIDIO_DISC_TIMEOUT=30
# CONFIG_RAPIDIO_ENABLE_RX_TX_PORTS is not set
CONFIG_RAPIDIO_TSI57X=y
CONFIG_RAPIDIO_CPS_XX=y
CONFIG_RAPIDIO_TSI568=y
# CONFIG_RAPIDIO_CPS_GEN2 is not set
# CONFIG_RAPIDIO_TSI500 is not set
CONFIG_RAPIDIO_DEBUG=y

#
# Executable file formats / Emulations
#
CONFIG_BINFMT_ELF=y
CONFIG_COMPAT_BINFMT_ELF=y
# CONFIG_HAVE_AOUT is not set
# CONFIG_BINFMT_MISC is not set
CONFIG_IA32_EMULATION=y
# CONFIG_IA32_AOUT is not set
CONFIG_COMPAT=y
CONFIG_COMPAT_FOR_U64_ALIGNMENT=y
CONFIG_SYSVIPC_COMPAT=y
CONFIG_KEYS_COMPAT=y
CONFIG_HAVE_TEXT_POKE_SMP=y
CONFIG_NET=y
CONFIG_COMPAT_NETLINK_MESSAGES=y

#
# Networking options
#
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_XFRM=y
# CONFIG_XFRM_USER is not set
# CONFIG_XFRM_SUB_POLICY is not set
CONFIG_XFRM_MIGRATE=y
CONFIG_XFRM_STATISTICS=y
CONFIG_XFRM_IPCOMP=m
CONFIG_NET_KEY=m
CONFIG_NET_KEY_MIGRATE=y
CONFIG_INET=y
# CONFIG_IP_MULTICAST is not set
# CONFIG_IP_ADVANCED_ROUTER is not set
# CONFIG_IP_PNP is not set
CONFIG_NET_IPIP=m
# CONFIG_NET_IPGRE_DEMUX is not set
# CONFIG_ARPD is not set
CONFIG_SYN_COOKIES=y
# CONFIG_INET_AH is not set
CONFIG_INET_ESP=m
# CONFIG_INET_IPCOMP is not set
# CONFIG_INET_XFRM_TUNNEL is not set
CONFIG_INET_TUNNEL=m
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
CONFIG_INET_XFRM_MODE_TUNNEL=m
CONFIG_INET_XFRM_MODE_BEET=m
CONFIG_INET_LRO=m
# CONFIG_INET_DIAG is not set
CONFIG_TCP_CONG_ADVANCED=y
CONFIG_TCP_CONG_BIC=m
CONFIG_TCP_CONG_CUBIC=m
CONFIG_TCP_CONG_WESTWOOD=m
# CONFIG_TCP_CONG_HTCP is not set
CONFIG_TCP_CONG_HSTCP=m
CONFIG_TCP_CONG_HYBLA=m
# CONFIG_TCP_CONG_VEGAS is not set
# CONFIG_TCP_CONG_SCALABLE is not set
# CONFIG_TCP_CONG_LP is not set
# CONFIG_TCP_CONG_VENO is not set
# CONFIG_TCP_CONG_YEAH is not set
CONFIG_TCP_CONG_ILLINOIS=m
CONFIG_DEFAULT_RENO=y
CONFIG_DEFAULT_TCP_CONG="reno"
CONFIG_TCP_MD5SIG=y
CONFIG_IPV6=m
CONFIG_IPV6_PRIVACY=y
# CONFIG_IPV6_ROUTER_PREF is not set
CONFIG_IPV6_OPTIMISTIC_DAD=y
# CONFIG_INET6_AH is not set
# CONFIG_INET6_ESP is not set
CONFIG_INET6_IPCOMP=m
# CONFIG_IPV6_MIP6 is not set
CONFIG_INET6_XFRM_TUNNEL=m
CONFIG_INET6_TUNNEL=m
# CONFIG_INET6_XFRM_MODE_TRANSPORT is not set
# CONFIG_INET6_XFRM_MODE_TUNNEL is not set
CONFIG_INET6_XFRM_MODE_BEET=m
CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
# CONFIG_IPV6_SIT is not set
# CONFIG_IPV6_TUNNEL is not set
CONFIG_IPV6_MULTIPLE_TABLES=y
CONFIG_IPV6_SUBTREES=y
# CONFIG_IPV6_MROUTE is not set
# CONFIG_NETLABEL is not set
CONFIG_NETWORK_SECMARK=y
CONFIG_NETWORK_PHY_TIMESTAMPING=y
CONFIG_NETFILTER=y
# CONFIG_NETFILTER_DEBUG is not set
CONFIG_NETFILTER_ADVANCED=y
CONFIG_BRIDGE_NETFILTER=y

#
# Core Netfilter Configuration
#
CONFIG_NETFILTER_NETLINK=m
CONFIG_NETFILTER_NETLINK_QUEUE=m
# CONFIG_NETFILTER_NETLINK_LOG is not set
CONFIG_NF_CONNTRACK=m
CONFIG_NF_CONNTRACK_MARK=y
CONFIG_NF_CONNTRACK_SECMARK=y
CONFIG_NF_CONNTRACK_EVENTS=y
CONFIG_NF_CONNTRACK_TIMESTAMP=y
# CONFIG_NF_CT_PROTO_DCCP is not set
CONFIG_NF_CT_PROTO_GRE=m
CONFIG_NF_CT_PROTO_SCTP=m
CONFIG_NF_CT_PROTO_UDPLITE=m
# CONFIG_NF_CONNTRACK_AMANDA is not set
CONFIG_NF_CONNTRACK_FTP=m
# CONFIG_NF_CONNTRACK_H323 is not set
CONFIG_NF_CONNTRACK_IRC=m
CONFIG_NF_CONNTRACK_BROADCAST=m
# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set
CONFIG_NF_CONNTRACK_SNMP=m
CONFIG_NF_CONNTRACK_PPTP=m
CONFIG_NF_CONNTRACK_SANE=m
CONFIG_NF_CONNTRACK_SIP=m
CONFIG_NF_CONNTRACK_TFTP=m
CONFIG_NF_CT_NETLINK=m
CONFIG_NETFILTER_XTABLES=m

#
# Xtables combined modules
#
CONFIG_NETFILTER_XT_MARK=m
CONFIG_NETFILTER_XT_CONNMARK=m
CONFIG_NETFILTER_XT_SET=m

#
# Xtables targets
#
# CONFIG_NETFILTER_XT_TARGET_AUDIT is not set
CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
# CONFIG_NETFILTER_XT_TARGET_CT is not set
# CONFIG_NETFILTER_XT_TARGET_IDLETIMER is not set
# CONFIG_NETFILTER_XT_TARGET_MARK is not set
# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set
CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
# CONFIG_NETFILTER_XT_TARGET_NOTRACK is not set
CONFIG_NETFILTER_XT_TARGET_RATEEST=m
CONFIG_NETFILTER_XT_TARGET_TEE=m
CONFIG_NETFILTER_XT_TARGET_TRACE=m
# CONFIG_NETFILTER_XT_TARGET_SECMARK is not set
# CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set

#
# Xtables matches
#
# CONFIG_NETFILTER_XT_MATCH_ADDRTYPE is not set
# CONFIG_NETFILTER_XT_MATCH_CLUSTER is not set
# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set
CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m
CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
CONFIG_NETFILTER_XT_MATCH_CPU=m
# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
# CONFIG_NETFILTER_XT_MATCH_DEVGROUP is not set
# CONFIG_NETFILTER_XT_MATCH_DSCP is not set
CONFIG_NETFILTER_XT_MATCH_ESP=m
CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
CONFIG_NETFILTER_XT_MATCH_HELPER=m
CONFIG_NETFILTER_XT_MATCH_HL=m
# CONFIG_NETFILTER_XT_MATCH_IPRANGE is not set
CONFIG_NETFILTER_XT_MATCH_IPVS=m
CONFIG_NETFILTER_XT_MATCH_LENGTH=m
CONFIG_NETFILTER_XT_MATCH_LIMIT=m
CONFIG_NETFILTER_XT_MATCH_MAC=m
# CONFIG_NETFILTER_XT_MATCH_MARK is not set
CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
CONFIG_NETFILTER_XT_MATCH_OSF=m
# CONFIG_NETFILTER_XT_MATCH_OWNER is not set
CONFIG_NETFILTER_XT_MATCH_POLICY=m
CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
CONFIG_NETFILTER_XT_MATCH_QUOTA=m
# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set
# CONFIG_NETFILTER_XT_MATCH_REALM is not set
# CONFIG_NETFILTER_XT_MATCH_RECENT is not set
# CONFIG_NETFILTER_XT_MATCH_SCTP is not set
# CONFIG_NETFILTER_XT_MATCH_STATE is not set
# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set
# CONFIG_NETFILTER_XT_MATCH_STRING is not set
CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
CONFIG_NETFILTER_XT_MATCH_TIME=m
# CONFIG_NETFILTER_XT_MATCH_U32 is not set
CONFIG_IP_SET=m
CONFIG_IP_SET_MAX=256
CONFIG_IP_SET_BITMAP_IP=m
# CONFIG_IP_SET_BITMAP_IPMAC is not set
CONFIG_IP_SET_BITMAP_PORT=m
CONFIG_IP_SET_HASH_IP=m
CONFIG_IP_SET_HASH_IPPORT=m
CONFIG_IP_SET_HASH_IPPORTIP=m
CONFIG_IP_SET_HASH_IPPORTNET=m
# CONFIG_IP_SET_HASH_NET is not set
# CONFIG_IP_SET_HASH_NETPORT is not set
# CONFIG_IP_SET_LIST_SET is not set
CONFIG_IP_VS=m
# CONFIG_IP_VS_IPV6 is not set
CONFIG_IP_VS_DEBUG=y
CONFIG_IP_VS_TAB_BITS=12

#
# IPVS transport protocol load balancing support
#
CONFIG_IP_VS_PROTO_TCP=y
# CONFIG_IP_VS_PROTO_UDP is not set
CONFIG_IP_VS_PROTO_AH_ESP=y
CONFIG_IP_VS_PROTO_ESP=y
CONFIG_IP_VS_PROTO_AH=y
CONFIG_IP_VS_PROTO_SCTP=y

#
# IPVS scheduler
#
CONFIG_IP_VS_RR=m
CONFIG_IP_VS_WRR=m
CONFIG_IP_VS_LC=m
CONFIG_IP_VS_WLC=m
# CONFIG_IP_VS_LBLC is not set
# CONFIG_IP_VS_LBLCR is not set
# CONFIG_IP_VS_DH is not set
# CONFIG_IP_VS_SH is not set
CONFIG_IP_VS_SED=m
CONFIG_IP_VS_NQ=m

#
# IPVS application helper
#
CONFIG_IP_VS_NFCT=y

#
# IP: Netfilter Configuration
#
CONFIG_NF_DEFRAG_IPV4=m
CONFIG_NF_CONNTRACK_IPV4=m
# CONFIG_NF_CONNTRACK_PROC_COMPAT is not set
# CONFIG_IP_NF_QUEUE is not set
CONFIG_IP_NF_IPTABLES=m
CONFIG_IP_NF_MATCH_AH=m
CONFIG_IP_NF_MATCH_ECN=m
CONFIG_IP_NF_MATCH_TTL=m
# CONFIG_IP_NF_FILTER is not set
# CONFIG_IP_NF_TARGET_LOG is not set
CONFIG_IP_NF_TARGET_ULOG=m
# CONFIG_NF_NAT is not set
# CONFIG_IP_NF_MANGLE is not set
CONFIG_IP_NF_RAW=m
# CONFIG_IP_NF_SECURITY is not set
CONFIG_IP_NF_ARPTABLES=m
# CONFIG_IP_NF_ARPFILTER is not set
# CONFIG_IP_NF_ARP_MANGLE is not set

#
# IPv6: Netfilter Configuration
#
CONFIG_NF_DEFRAG_IPV6=m
CONFIG_NF_CONNTRACK_IPV6=m
CONFIG_IP6_NF_QUEUE=m
# CONFIG_IP6_NF_IPTABLES is not set

#
# DECnet: Netfilter Configuration
#
CONFIG_DECNET_NF_GRABULATOR=m
# CONFIG_BRIDGE_NF_EBTABLES is not set
# CONFIG_IP_DCCP is not set
CONFIG_IP_SCTP=m
CONFIG_SCTP_DBG_MSG=y
CONFIG_SCTP_DBG_OBJCNT=y
CONFIG_SCTP_HMAC_NONE=y
# CONFIG_SCTP_HMAC_SHA1 is not set
# CONFIG_SCTP_HMAC_MD5 is not set
# CONFIG_RDS is not set
# CONFIG_TIPC is not set
CONFIG_ATM=m
CONFIG_ATM_CLIP=m
# CONFIG_ATM_CLIP_NO_ICMP is not set
# CONFIG_ATM_LANE is not set
# CONFIG_ATM_BR2684 is not set
# CONFIG_L2TP is not set
CONFIG_STP=m
CONFIG_GARP=m
CONFIG_BRIDGE=m
# CONFIG_BRIDGE_IGMP_SNOOPING is not set
CONFIG_NET_DSA=y
CONFIG_NET_DSA_TAG_DSA=y
CONFIG_NET_DSA_TAG_EDSA=y
# CONFIG_NET_DSA_TAG_TRAILER is not set
CONFIG_NET_DSA_MV88E6XXX=y
# CONFIG_NET_DSA_MV88E6060 is not set
CONFIG_NET_DSA_MV88E6XXX_NEED_PPU=y
CONFIG_NET_DSA_MV88E6131=y
CONFIG_NET_DSA_MV88E6123_61_65=y
CONFIG_VLAN_8021Q=m
CONFIG_VLAN_8021Q_GVRP=y
CONFIG_DECNET=m
CONFIG_DECNET_ROUTER=y
CONFIG_LLC=m
CONFIG_LLC2=m
# CONFIG_IPX is not set
CONFIG_ATALK=m
# CONFIG_DEV_APPLETALK is not set
# CONFIG_X25 is not set
CONFIG_LAPB=m
CONFIG_ECONET=m
# CONFIG_ECONET_AUNUDP is not set
CONFIG_ECONET_NATIVE=y
CONFIG_WAN_ROUTER=m
# CONFIG_PHONET is not set
# CONFIG_IEEE802154 is not set
# CONFIG_NET_SCHED is not set
CONFIG_DCB=y
CONFIG_DNS_RESOLVER=m
CONFIG_BATMAN_ADV=m
CONFIG_BATMAN_ADV_DEBUG=y
CONFIG_RPS=y
CONFIG_RFS_ACCEL=y
CONFIG_XPS=y

#
# Network testing
#
CONFIG_NET_PKTGEN=m
# CONFIG_NET_DROP_MONITOR is not set
CONFIG_HAMRADIO=y

#
# Packet Radio protocols
#
CONFIG_AX25=m
# CONFIG_AX25_DAMA_SLAVE is not set
CONFIG_NETROM=m
CONFIG_ROSE=m

#
# AX.25 network device drivers
#
CONFIG_MKISS=m
CONFIG_6PACK=m
CONFIG_BPQETHER=m
CONFIG_BAYCOM_SER_FDX=m
CONFIG_BAYCOM_SER_HDX=m
# CONFIG_YAM is not set
# CONFIG_CAN is not set
# CONFIG_IRDA is not set
# CONFIG_BT is not set
CONFIG_AF_RXRPC=m
CONFIG_AF_RXRPC_DEBUG=y
CONFIG_RXKAD=m
CONFIG_FIB_RULES=y
CONFIG_WIRELESS=y
CONFIG_WIRELESS_EXT=y
CONFIG_WEXT_CORE=y
CONFIG_WEXT_PROC=y
CONFIG_WEXT_SPY=y
CONFIG_WEXT_PRIV=y
CONFIG_CFG80211=m
# CONFIG_NL80211_TESTMODE is not set
CONFIG_CFG80211_DEVELOPER_WARNINGS=y
# CONFIG_CFG80211_REG_DEBUG is not set
# CONFIG_CFG80211_DEFAULT_PS is not set
# CONFIG_CFG80211_DEBUGFS is not set
CONFIG_CFG80211_INTERNAL_REGDB=y
# CONFIG_CFG80211_WEXT is not set
# CONFIG_WIRELESS_EXT_SYSFS is not set
CONFIG_LIB80211=m
CONFIG_LIB80211_CRYPT_WEP=m
CONFIG_LIB80211_CRYPT_CCMP=m
CONFIG_LIB80211_CRYPT_TKIP=m
# CONFIG_LIB80211_DEBUG is not set
# CONFIG_MAC80211 is not set
# CONFIG_WIMAX is not set
# CONFIG_RFKILL is not set
CONFIG_CAIF=m
# CONFIG_CAIF_DEBUG is not set
# CONFIG_CAIF_NETDEV is not set
CONFIG_CEPH_LIB=m
CONFIG_CEPH_LIB_PRETTYDEBUG=y

#
# Device Drivers
#

#
# Generic Driver Options
#
CONFIG_UEVENT_HELPER_PATH=""
CONFIG_DEVTMPFS=y
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=m
CONFIG_FIRMWARE_IN_KERNEL=y
CONFIG_EXTRA_FIRMWARE=""
CONFIG_DEBUG_DRIVER=y
CONFIG_DEBUG_DEVRES=y
CONFIG_SYS_HYPERVISOR=y
CONFIG_ARCH_NO_SYSDEV_OPS=y
CONFIG_CONNECTOR=m
# CONFIG_PARPORT is not set
CONFIG_PNP=y
# CONFIG_PNP_DEBUG_MESSAGES is not set

#
# Protocols
#
CONFIG_PNPACPI=y
CONFIG_BLK_DEV=y
# CONFIG_BLK_DEV_FD is not set
CONFIG_BLK_CPQ_DA=y
CONFIG_BLK_CPQ_CISS_DA=m
# CONFIG_CISS_SCSI_TAPE is not set
# CONFIG_BLK_DEV_DAC960 is not set
CONFIG_BLK_DEV_UMEM=m
# CONFIG_BLK_DEV_COW_COMMON is not set
CONFIG_BLK_DEV_LOOP=m
# CONFIG_BLK_DEV_CRYPTOLOOP is not set
CONFIG_BLK_DEV_DRBD=m
# CONFIG_DRBD_FAULT_INJECTION is not set
# CONFIG_BLK_DEV_NBD is not set
CONFIG_BLK_DEV_SX8=m
CONFIG_BLK_DEV_UB=m
CONFIG_BLK_DEV_RAM=m
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=4096
CONFIG_BLK_DEV_XIP=y
# CONFIG_CDROM_PKTCDVD is not set
# CONFIG_ATA_OVER_ETH is not set
# CONFIG_XEN_BLKDEV_FRONTEND is not set
# CONFIG_VIRTIO_BLK is not set
# CONFIG_BLK_DEV_HD is not set
CONFIG_BLK_DEV_RBD=m
# CONFIG_SENSORS_LIS3LV02D is not set
# CONFIG_MISC_DEVICES is not set
CONFIG_TIFM_CORE=m
CONFIG_HAVE_IDE=y

#
# SCSI device support
#
CONFIG_SCSI_MOD=y
# CONFIG_RAID_ATTRS is not set
CONFIG_SCSI=y
CONFIG_SCSI_DMA=y
CONFIG_SCSI_TGT=m
CONFIG_SCSI_NETLINK=y
# CONFIG_SCSI_PROC_FS is not set

#
# SCSI support type (disk, tape, CD-ROM)
#
CONFIG_BLK_DEV_SD=y
# CONFIG_CHR_DEV_ST is not set
CONFIG_CHR_DEV_OSST=m
# CONFIG_BLK_DEV_SR is not set
# CONFIG_CHR_DEV_SG is not set
# CONFIG_CHR_DEV_SCH is not set
# CONFIG_SCSI_MULTI_LUN is not set
# CONFIG_SCSI_CONSTANTS is not set
CONFIG_SCSI_LOGGING=y
# CONFIG_SCSI_SCAN_ASYNC is not set
CONFIG_SCSI_WAIT_SCAN=m

#
# SCSI Transports
#
CONFIG_SCSI_SPI_ATTRS=y
CONFIG_SCSI_FC_ATTRS=m
# CONFIG_SCSI_FC_TGT_ATTRS is not set
CONFIG_SCSI_ISCSI_ATTRS=m
CONFIG_SCSI_SAS_ATTRS=m
CONFIG_SCSI_SAS_LIBSAS=m
# CONFIG_SCSI_SAS_ATA is not set
# CONFIG_SCSI_SAS_HOST_SMP is not set
# CONFIG_SCSI_LOWLEVEL is not set
CONFIG_SCSI_AIC7XXX=y
CONFIG_SCSI_DH=m
# CONFIG_SCSI_DH_RDAC is not set
# CONFIG_SCSI_DH_HP_SW is not set
# CONFIG_SCSI_DH_EMC is not set
# CONFIG_SCSI_DH_ALUA is not set
CONFIG_SCSI_OSD_INITIATOR=m
# CONFIG_SCSI_OSD_ULD is not set
CONFIG_SCSI_OSD_DPRINT_SENSE=1
# CONFIG_SCSI_OSD_DEBUG is not set
CONFIG_ATA=y
# CONFIG_ATA_NONSTANDARD is not set
CONFIG_ATA_VERBOSE_ERROR=y
# CONFIG_ATA_ACPI is not set
# CONFIG_SATA_PMP is not set

#
# Controllers with non-SFF native interface
#
CONFIG_SATA_AHCI=y
# CONFIG_SATA_AHCI_PLATFORM is not set
CONFIG_SATA_INIC162X=m
CONFIG_SATA_ACARD_AHCI=m
# CONFIG_SATA_SIL24 is not set
CONFIG_ATA_SFF=y

#
# SFF controllers with custom DMA interface
#
CONFIG_PDC_ADMA=m
CONFIG_SATA_QSTOR=m
# CONFIG_SATA_SX4 is not set
CONFIG_ATA_BMDMA=y

#
# SATA SFF controllers with BMDMA
#
CONFIG_ATA_PIIX=y
# CONFIG_SATA_MV is not set
CONFIG_SATA_NV=y
# CONFIG_SATA_PROMISE is not set
# CONFIG_SATA_SIL is not set
CONFIG_SATA_SIS=m
# CONFIG_SATA_SVW is not set
# CONFIG_SATA_ULI is not set
CONFIG_SATA_VIA=m
CONFIG_SATA_VITESSE=m

#
# PATA SFF controllers with BMDMA
#
# CONFIG_PATA_ALI is not set
CONFIG_PATA_AMD=y
CONFIG_PATA_ARASAN_CF=m
# CONFIG_PATA_ARTOP is not set
CONFIG_PATA_ATIIXP=m
# CONFIG_PATA_ATP867X is not set
# CONFIG_PATA_CMD64X is not set
# CONFIG_PATA_CS5520 is not set
# CONFIG_PATA_CS5530 is not set
# CONFIG_PATA_CS5536 is not set
# CONFIG_PATA_CYPRESS is not set
CONFIG_PATA_EFAR=m
CONFIG_PATA_HPT366=m
CONFIG_PATA_HPT37X=m
CONFIG_PATA_HPT3X2N=m
# CONFIG_PATA_HPT3X3 is not set
# CONFIG_PATA_IT8213 is not set
# CONFIG_PATA_IT821X is not set
# CONFIG_PATA_JMICRON is not set
# CONFIG_PATA_MARVELL is not set
CONFIG_PATA_NETCELL=m
CONFIG_PATA_NINJA32=m
CONFIG_PATA_NS87415=m
CONFIG_PATA_OLDPIIX=y
CONFIG_PATA_OPTIDMA=m
CONFIG_PATA_PDC2027X=m
# CONFIG_PATA_PDC_OLD is not set
# CONFIG_PATA_RADISYS is not set
CONFIG_PATA_RDC=m
CONFIG_PATA_SC1200=m
# CONFIG_PATA_SCH is not set
# CONFIG_PATA_SERVERWORKS is not set
CONFIG_PATA_SIL680=m
CONFIG_PATA_SIS=m
CONFIG_PATA_TOSHIBA=m
# CONFIG_PATA_TRIFLEX is not set
CONFIG_PATA_VIA=y
CONFIG_PATA_WINBOND=m

#
# PIO-only SFF controllers
#
CONFIG_PATA_CMD640_PCI=m
CONFIG_PATA_MPIIX=m
# CONFIG_PATA_NS87410 is not set
CONFIG_PATA_OPTI=m
CONFIG_PATA_PLATFORM=m
CONFIG_PATA_RZ1000=m

#
# Generic fallback / legacy drivers
#
CONFIG_ATA_GENERIC=m
CONFIG_PATA_LEGACY=m
# CONFIG_MD is not set
CONFIG_TARGET_CORE=m
# CONFIG_TCM_IBLOCK is not set
CONFIG_TCM_FILEIO=m
CONFIG_TCM_PSCSI=m
# CONFIG_LOOPBACK_TARGET is not set
CONFIG_FUSION=y
CONFIG_FUSION_SPI=m
CONFIG_FUSION_FC=m
CONFIG_FUSION_SAS=m
CONFIG_FUSION_MAX_SGE=128
# CONFIG_FUSION_CTL is not set
# CONFIG_FUSION_LOGGING is not set

#
# IEEE 1394 (FireWire) support
#
# CONFIG_FIREWIRE is not set
# CONFIG_FIREWIRE_NOSY is not set
CONFIG_I2O=m
# CONFIG_I2O_LCT_NOTIFY_ON_CHANGES is not set
CONFIG_I2O_EXT_ADAPTEC=y
CONFIG_I2O_EXT_ADAPTEC_DMA64=y
# CONFIG_I2O_CONFIG is not set
CONFIG_I2O_BUS=m
# CONFIG_I2O_BLOCK is not set
# CONFIG_I2O_SCSI is not set
# CONFIG_I2O_PROC is not set
# CONFIG_MACINTOSH_DRIVERS is not set
CONFIG_NETDEVICES=y
# CONFIG_DUMMY is not set
# CONFIG_BONDING is not set
# CONFIG_MACVLAN is not set
CONFIG_EQUALIZER=m
# CONFIG_TUN is not set
# CONFIG_VETH is not set
# CONFIG_NET_SB1000 is not set
# CONFIG_ARCNET is not set
CONFIG_MII=y
CONFIG_PHYLIB=y

#
# MII PHY device drivers
#
CONFIG_MARVELL_PHY=m
CONFIG_DAVICOM_PHY=m
# CONFIG_QSEMI_PHY is not set
CONFIG_LXT_PHY=m
# CONFIG_CICADA_PHY is not set
CONFIG_VITESSE_PHY=m
CONFIG_SMSC_PHY=m
CONFIG_BROADCOM_PHY=m
# CONFIG_BCM63XX_PHY is not set
CONFIG_ICPLUS_PHY=m
CONFIG_REALTEK_PHY=m
CONFIG_NATIONAL_PHY=m
# CONFIG_STE10XP is not set
# CONFIG_LSI_ET1011C_PHY is not set
# CONFIG_MICREL_PHY is not set
CONFIG_FIXED_PHY=y
# CONFIG_MDIO_BITBANG is not set
CONFIG_NET_ETHERNET=y
# CONFIG_HAPPYMEAL is not set
CONFIG_SUNGEM=m
CONFIG_CASSINI=m
# CONFIG_NET_VENDOR_3COM is not set
CONFIG_VORTEX=y
# CONFIG_ETHOC is not set
CONFIG_DNET=m
CONFIG_NET_TULIP=y
CONFIG_DE2104X=m
CONFIG_DE2104X_DSL=0
# CONFIG_TULIP is not set
# CONFIG_DE4X5 is not set
# CONFIG_WINBOND_840 is not set
CONFIG_DM9102=m
# CONFIG_ULI526X is not set
# CONFIG_HP100 is not set
# CONFIG_IBM_NEW_EMAC_ZMII is not set
# CONFIG_IBM_NEW_EMAC_RGMII is not set
# CONFIG_IBM_NEW_EMAC_TAH is not set
# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
CONFIG_NET_PCI=y
# CONFIG_PCNET32 is not set
# CONFIG_AMD8111_ETH is not set
# CONFIG_ADAPTEC_STARFIRE is not set
# CONFIG_KSZ884X_PCI is not set
# CONFIG_B44 is not set
CONFIG_FORCEDETH=y
CONFIG_E100=y
CONFIG_FEALNX=m
CONFIG_NATSEMI=m
# CONFIG_NE2K_PCI is not set
CONFIG_8139CP=m
CONFIG_8139TOO=y
# CONFIG_8139TOO_PIO is not set
CONFIG_8139TOO_TUNE_TWISTER=y
# CONFIG_8139TOO_8129 is not set
# CONFIG_8139_OLD_RX_RESET is not set
CONFIG_R6040=m
CONFIG_SIS900=m
CONFIG_EPIC100=m
CONFIG_SMSC9420=m
CONFIG_SUNDANCE=m
# CONFIG_SUNDANCE_MMIO is not set
# CONFIG_TLAN is not set
# CONFIG_KS8842 is not set
CONFIG_KS8851_MLL=m
CONFIG_VIA_RHINE=m
CONFIG_VIA_RHINE_MMIO=y
# CONFIG_SC92031 is not set
CONFIG_ATL2=m
CONFIG_NETDEV_1000=y
CONFIG_ACENIC=m
# CONFIG_ACENIC_OMIT_TIGON_I is not set
# CONFIG_DL2K is not set
# CONFIG_E1000 is not set
CONFIG_E1000E=y
# CONFIG_IP1000 is not set
# CONFIG_IGB is not set
CONFIG_IGBVF=m
# CONFIG_NS83820 is not set
# CONFIG_HAMACHI is not set
# CONFIG_YELLOWFIN is not set
CONFIG_R8169=m
CONFIG_SIS190=m
CONFIG_SKGE=y
# CONFIG_SKGE_DEBUG is not set
CONFIG_SKY2=m
# CONFIG_SKY2_DEBUG is not set
# CONFIG_VIA_VELOCITY is not set
CONFIG_TIGON3=y
# CONFIG_BNX2 is not set
# CONFIG_CNIC is not set
CONFIG_QLA3XXX=m
CONFIG_ATL1=m
# CONFIG_ATL1E is not set
# CONFIG_ATL1C is not set
# CONFIG_JME is not set
CONFIG_STMMAC_ETH=m
CONFIG_STMMAC_DA=y
CONFIG_STMMAC_DUAL_MAC=y
CONFIG_PCH_GBE=m
CONFIG_NETDEV_10000=y
CONFIG_MDIO=m
# CONFIG_CHELSIO_T1 is not set
CONFIG_CHELSIO_T3=m
CONFIG_CHELSIO_T4=m
CONFIG_CHELSIO_T4VF=m
CONFIG_ENIC=m
# CONFIG_IXGBE is not set
CONFIG_IXGBEVF=m
CONFIG_IXGB=m
CONFIG_S2IO=m
# CONFIG_MYRI10GE is not set
# CONFIG_NIU is not set
CONFIG_MLX4_EN=m
CONFIG_MLX4_CORE=m
# CONFIG_MLX4_DEBUG is not set
CONFIG_TEHUTI=m
CONFIG_BNX2X=m
CONFIG_QLCNIC=m
# CONFIG_QLGE is not set
# CONFIG_BNA is not set
CONFIG_SFC=m
CONFIG_BE2NET=m
CONFIG_TR=m
# CONFIG_IBMOL is not set
CONFIG_3C359=m
# CONFIG_TMS380TR is not set
CONFIG_WLAN=y
# CONFIG_AIRO is not set
CONFIG_ATMEL=m
CONFIG_PCI_ATMEL=m
CONFIG_PRISM54=m
# CONFIG_USB_ZD1201 is not set
# CONFIG_USB_NET_RNDIS_WLAN is not set
# CONFIG_ATH_COMMON is not set
# CONFIG_HOSTAP is not set
CONFIG_IPW2100=m
CONFIG_IPW2100_MONITOR=y
CONFIG_IPW2100_DEBUG=y
CONFIG_LIBIPW=m
# CONFIG_LIBIPW_DEBUG is not set
# CONFIG_IWM is not set
CONFIG_LIBERTAS=m
CONFIG_LIBERTAS_USB=m
CONFIG_LIBERTAS_SDIO=m
# CONFIG_LIBERTAS_DEBUG is not set
CONFIG_LIBERTAS_MESH=y

#
# Enable WiMAX (Networking options) to see the WiMAX drivers
#

#
# USB Network Adapters
#
# CONFIG_USB_CATC is not set
# CONFIG_USB_KAWETH is not set
CONFIG_USB_PEGASUS=m
CONFIG_USB_RTL8150=m
# CONFIG_USB_USBNET is not set
CONFIG_USB_IPHETH=m
# CONFIG_WAN is not set
# CONFIG_ATM_DRIVERS is not set

#
# CAIF transport drivers
#
CONFIG_CAIF_TTY=m
CONFIG_CAIF_SPI_SLAVE=m
CONFIG_CAIF_SPI_SYNC=y
CONFIG_XEN_NETDEV_FRONTEND=m
# CONFIG_XEN_NETDEV_BACKEND is not set
# CONFIG_RIONET is not set
CONFIG_FDDI=m
# CONFIG_DEFXX is not set
# CONFIG_SKFP is not set
CONFIG_HIPPI=y
CONFIG_ROADRUNNER=m
CONFIG_ROADRUNNER_LARGE_RINGS=y
# CONFIG_PPP is not set
# CONFIG_SLIP is not set
# CONFIG_NET_FC is not set
CONFIG_NETCONSOLE=y
# CONFIG_NETCONSOLE_DYNAMIC is not set
CONFIG_NETPOLL=y
CONFIG_NETPOLL_TRAP=y
CONFIG_NET_POLL_CONTROLLER=y
CONFIG_VIRTIO_NET=m
CONFIG_VMXNET3=m
CONFIG_ISDN=y
CONFIG_ISDN_I4L=m
# CONFIG_ISDN_PPP is not set
# CONFIG_ISDN_AUDIO is not set

#
# ISDN feature submodules
#
CONFIG_ISDN_DIVERSION=m

#
# ISDN4Linux hardware drivers
#

#
# Passive cards
#
CONFIG_ISDN_DRV_HISAX=m

#
# D-channel protocol features
#
# CONFIG_HISAX_EURO is not set
CONFIG_HISAX_1TR6=y
CONFIG_HISAX_NI1=y
CONFIG_HISAX_MAX_CARDS=8

#
# HiSax supported cards
#
# CONFIG_HISAX_16_3 is not set
# CONFIG_HISAX_TELESPCI is not set
# CONFIG_HISAX_S0BOX is not set
CONFIG_HISAX_FRITZPCI=y
# CONFIG_HISAX_AVM_A1_PCMCIA is not set
# CONFIG_HISAX_ELSA is not set
# CONFIG_HISAX_DIEHLDIVA is not set
# CONFIG_HISAX_SEDLBAUER is not set
# CONFIG_HISAX_NETJET is not set
CONFIG_HISAX_NETJET_U=y
# CONFIG_HISAX_NICCY is not set
# CONFIG_HISAX_BKM_A4T is not set
# CONFIG_HISAX_SCT_QUADRO is not set
CONFIG_HISAX_GAZEL=y
# CONFIG_HISAX_HFC_PCI is not set
CONFIG_HISAX_W6692=y
CONFIG_HISAX_HFC_SX=y
# CONFIG_HISAX_DEBUG is not set

#
# HiSax PCMCIA card service modules
#

#
# HiSax sub driver modules
#
CONFIG_HISAX_ST5481=m
# CONFIG_HISAX_HFCUSB is not set
# CONFIG_HISAX_HFC4S8S is not set
# CONFIG_HISAX_FRITZ_PCIPNP is not set

#
# Active cards
#
# CONFIG_ISDN_CAPI is not set
CONFIG_ISDN_DRV_GIGASET=m
CONFIG_GIGASET_I4L=y
# CONFIG_GIGASET_DUMMYLL is not set
# CONFIG_GIGASET_BASE is not set
CONFIG_GIGASET_M105=m
# CONFIG_GIGASET_M101 is not set
# CONFIG_GIGASET_DEBUG is not set
# CONFIG_HYSDN is not set
CONFIG_ISDN_HDLC=m
# CONFIG_PHONE is not set

#
# Input device support
#
CONFIG_INPUT=y
CONFIG_INPUT_FF_MEMLESS=m
CONFIG_INPUT_POLLDEV=y
# CONFIG_INPUT_SPARSEKMAP is not set

#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=y
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
# CONFIG_INPUT_JOYDEV is not set
# CONFIG_INPUT_EVDEV is not set
# CONFIG_INPUT_EVBUG is not set

#
# Input Device Drivers
#
CONFIG_INPUT_KEYBOARD=y
CONFIG_KEYBOARD_ADP5588=m
CONFIG_KEYBOARD_ATKBD=y
CONFIG_KEYBOARD_QT1070=m
CONFIG_KEYBOARD_QT2160=m
CONFIG_KEYBOARD_LKKBD=m
CONFIG_KEYBOARD_GPIO=m
CONFIG_KEYBOARD_GPIO_POLLED=m
# CONFIG_KEYBOARD_TCA6416 is not set
# CONFIG_KEYBOARD_MATRIX is not set
CONFIG_KEYBOARD_MAX7359=m
# CONFIG_KEYBOARD_MCS is not set
CONFIG_KEYBOARD_NEWTON=m
CONFIG_KEYBOARD_OPENCORES=m
CONFIG_KEYBOARD_STOWAWAY=m
CONFIG_KEYBOARD_SUNKBD=m
CONFIG_KEYBOARD_XTKBD=m
CONFIG_INPUT_MOUSE=y
CONFIG_MOUSE_PS2=m
CONFIG_MOUSE_PS2_ALPS=y
CONFIG_MOUSE_PS2_LOGIPS2PP=y
# CONFIG_MOUSE_PS2_SYNAPTICS is not set
CONFIG_MOUSE_PS2_TRACKPOINT=y
CONFIG_MOUSE_PS2_ELANTECH=y
# CONFIG_MOUSE_PS2_SENTELIC is not set
# CONFIG_MOUSE_PS2_TOUCHKIT is not set
# CONFIG_MOUSE_SERIAL is not set
CONFIG_MOUSE_APPLETOUCH=m
CONFIG_MOUSE_BCM5974=m
# CONFIG_MOUSE_VSXXXAA is not set
CONFIG_MOUSE_GPIO=m
# CONFIG_MOUSE_SYNAPTICS_I2C is not set
CONFIG_INPUT_JOYSTICK=y
# CONFIG_JOYSTICK_ANALOG is not set
# CONFIG_JOYSTICK_A3D is not set
# CONFIG_JOYSTICK_ADI is not set
CONFIG_JOYSTICK_COBRA=m
# CONFIG_JOYSTICK_GF2K is not set
# CONFIG_JOYSTICK_GRIP is not set
CONFIG_JOYSTICK_GRIP_MP=m
CONFIG_JOYSTICK_GUILLEMOT=m
# CONFIG_JOYSTICK_INTERACT is not set
# CONFIG_JOYSTICK_SIDEWINDER is not set
CONFIG_JOYSTICK_TMDC=m
CONFIG_JOYSTICK_IFORCE=m
CONFIG_JOYSTICK_IFORCE_USB=y
CONFIG_JOYSTICK_IFORCE_232=y
# CONFIG_JOYSTICK_WARRIOR is not set
# CONFIG_JOYSTICK_MAGELLAN is not set
# CONFIG_JOYSTICK_SPACEORB is not set
# CONFIG_JOYSTICK_SPACEBALL is not set
CONFIG_JOYSTICK_STINGER=m
CONFIG_JOYSTICK_TWIDJOY=m
CONFIG_JOYSTICK_ZHENHUA=m
# CONFIG_JOYSTICK_AS5011 is not set
# CONFIG_JOYSTICK_JOYDUMP is not set
CONFIG_JOYSTICK_XPAD=m
# CONFIG_JOYSTICK_XPAD_FF is not set
CONFIG_INPUT_TABLET=y
CONFIG_TABLET_USB_ACECAD=m
# CONFIG_TABLET_USB_AIPTEK is not set
CONFIG_TABLET_USB_GTCO=m
# CONFIG_TABLET_USB_HANWANG is not set
CONFIG_TABLET_USB_KBTAB=m
CONFIG_TABLET_USB_WACOM=m
# CONFIG_INPUT_TOUCHSCREEN is not set
# CONFIG_INPUT_MISC is not set

#
# Hardware I/O ports
#
CONFIG_SERIO=y
CONFIG_SERIO_I8042=y
# CONFIG_SERIO_SERPORT is not set
CONFIG_SERIO_CT82C710=m
CONFIG_SERIO_PCIPS2=m
CONFIG_SERIO_LIBPS2=y
CONFIG_SERIO_RAW=m
# CONFIG_SERIO_ALTERA_PS2 is not set
CONFIG_SERIO_PS2MULT=m
CONFIG_GAMEPORT=m
# CONFIG_GAMEPORT_NS558 is not set
# CONFIG_GAMEPORT_L4 is not set
CONFIG_GAMEPORT_EMU10K1=m
# CONFIG_GAMEPORT_FM801 is not set

#
# Character devices
#
CONFIG_VT=y
# CONFIG_CONSOLE_TRANSLATIONS is not set
CONFIG_VT_CONSOLE=y
CONFIG_HW_CONSOLE=y
# CONFIG_VT_HW_CONSOLE_BINDING is not set
CONFIG_UNIX98_PTYS=y
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=256
# CONFIG_SERIAL_NONSTANDARD is not set
# CONFIG_NOZOMI is not set
CONFIG_N_GSM=m
CONFIG_DEVKMEM=y

#
# Serial drivers
#
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_SERIAL_8250_PCI=m
CONFIG_SERIAL_8250_PNP=m
CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
# CONFIG_SERIAL_8250_EXTENDED is not set

#
# Non-8250 serial port support
#
CONFIG_SERIAL_MFD_HSU=m
CONFIG_SERIAL_UARTLITE=m
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_CONSOLE_POLL=y
CONFIG_SERIAL_JSM=m
CONFIG_SERIAL_TIMBERDALE=m
# CONFIG_SERIAL_ALTERA_JTAGUART is not set
# CONFIG_SERIAL_ALTERA_UART is not set
# CONFIG_SERIAL_PCH_UART is not set
# CONFIG_TTY_PRINTK is not set
CONFIG_HVC_DRIVER=y
CONFIG_HVC_IRQ=y
CONFIG_HVC_XEN=y
# CONFIG_VIRTIO_CONSOLE is not set
# CONFIG_IPMI_HANDLER is not set
# CONFIG_HW_RANDOM is not set
# CONFIG_NVRAM is not set
# CONFIG_RTC is not set
CONFIG_GEN_RTC=m
CONFIG_GEN_RTC_X=y
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
CONFIG_MWAVE=m
# CONFIG_RAW_DRIVER is not set
# CONFIG_HPET is not set
CONFIG_HANGCHECK_TIMER=m
CONFIG_TCG_TPM=m
# CONFIG_TCG_TIS is not set
# CONFIG_TCG_NSC is not set
CONFIG_TCG_ATMEL=m
CONFIG_TCG_INFINEON=m
# CONFIG_TELCLOCK is not set
CONFIG_DEVPORT=y
# CONFIG_RAMOOPS is not set
CONFIG_I2C=m
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_COMPAT=y
# CONFIG_I2C_CHARDEV is not set
CONFIG_I2C_MUX=m

#
# Multiplexer I2C Chip support
#
# CONFIG_I2C_MUX_GPIO is not set
CONFIG_I2C_MUX_PCA9541=m
# CONFIG_I2C_MUX_PCA954x is not set
# CONFIG_I2C_HELPER_AUTO is not set
CONFIG_I2C_SMBUS=m

#
# I2C Algorithms
#
CONFIG_I2C_ALGOBIT=m
CONFIG_I2C_ALGOPCF=m
CONFIG_I2C_ALGOPCA=m

#
# I2C Hardware Bus support
#

#
# PC SMBus host controller drivers
#
CONFIG_I2C_ALI1535=m
# CONFIG_I2C_ALI1563 is not set
CONFIG_I2C_ALI15X3=m
CONFIG_I2C_AMD756=m
CONFIG_I2C_AMD8111=m
# CONFIG_I2C_I801 is not set
CONFIG_I2C_ISCH=m
# CONFIG_I2C_PIIX4 is not set
CONFIG_I2C_NFORCE2=m
CONFIG_I2C_SIS5595=m
# CONFIG_I2C_SIS630 is not set
# CONFIG_I2C_SIS96X is not set
CONFIG_I2C_VIA=m
# CONFIG_I2C_VIAPRO is not set

#
# ACPI drivers
#
CONFIG_I2C_SCMI=m

#
# I2C system bus drivers (mostly embedded / system-on-chip)
#
# CONFIG_I2C_GPIO is not set
# CONFIG_I2C_INTEL_MID is not set
CONFIG_I2C_OCORES=m
# CONFIG_I2C_PCA_PLATFORM is not set
# CONFIG_I2C_PXA_PCI is not set
# CONFIG_I2C_SIMTEC is not set
# CONFIG_I2C_XILINX is not set
CONFIG_I2C_EG20T=m

#
# External I2C/SMBus adapter drivers
#
CONFIG_I2C_DIOLAN_U2C=m
# CONFIG_I2C_PARPORT_LIGHT is not set
# CONFIG_I2C_TAOS_EVM is not set
CONFIG_I2C_TINY_USB=m

#
# Other I2C/SMBus bus drivers
#
# CONFIG_I2C_STUB is not set
CONFIG_I2C_DEBUG_CORE=y
CONFIG_I2C_DEBUG_ALGO=y
CONFIG_I2C_DEBUG_BUS=y
# CONFIG_SPI is not set

#
# PPS support
#
# CONFIG_PPS is not set

#
# PPS generators support
#
CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
CONFIG_GPIOLIB=y
# CONFIG_DEBUG_GPIO is not set
CONFIG_GPIO_SYSFS=y

#
# Memory mapped GPIO expanders:
#
# CONFIG_GPIO_BASIC_MMIO is not set
CONFIG_GPIO_IT8761E=m
CONFIG_GPIO_SCH=m
CONFIG_GPIO_VX855=m

#
# I2C GPIO expanders:
#
# CONFIG_GPIO_MAX7300 is not set
CONFIG_GPIO_MAX732X=m
CONFIG_GPIO_PCA953X=m
# CONFIG_GPIO_PCF857X is not set
# CONFIG_GPIO_ADP5588 is not set

#
# PCI GPIO expanders:
#
# CONFIG_GPIO_CS5535 is not set
# CONFIG_GPIO_BT8XX is not set
CONFIG_GPIO_LANGWELL=y
# CONFIG_GPIO_PCH is not set
# CONFIG_GPIO_ML_IOH is not set
CONFIG_GPIO_TIMBERDALE=y
CONFIG_GPIO_RDC321X=m

#
# SPI GPIO expanders:
#

#
# AC97 GPIO expanders:
#
# CONFIG_GPIO_UCB1400 is not set

#
# MODULbus GPIO expanders:
#
# CONFIG_GPIO_JANZ_TTL is not set
# CONFIG_W1 is not set
CONFIG_POWER_SUPPLY=m
# CONFIG_POWER_SUPPLY_DEBUG is not set
# CONFIG_PDA_POWER is not set
# CONFIG_TEST_POWER is not set
CONFIG_BATTERY_DS2782=m
# CONFIG_BATTERY_BQ20Z75 is not set
# CONFIG_BATTERY_BQ27x00 is not set
# CONFIG_BATTERY_MAX17040 is not set
CONFIG_BATTERY_MAX17042=m
# CONFIG_CHARGER_PCF50633 is not set
CONFIG_CHARGER_GPIO=m
# CONFIG_HWMON is not set
CONFIG_THERMAL=m
CONFIG_WATCHDOG=y
# CONFIG_WATCHDOG_NOWAYOUT is not set

#
# Watchdog Device Drivers
#
# CONFIG_SOFT_WATCHDOG is not set
# CONFIG_ACQUIRE_WDT is not set
CONFIG_ADVANTECH_WDT=m
# CONFIG_ALIM1535_WDT is not set
CONFIG_ALIM7101_WDT=m
# CONFIG_F71808E_WDT is not set
# CONFIG_SP5100_TCO is not set
# CONFIG_SC520_WDT is not set
CONFIG_IB700_WDT=m
# CONFIG_IBMASR is not set
# CONFIG_WAFER_WDT is not set
# CONFIG_I6300ESB_WDT is not set
# CONFIG_ITCO_WDT is not set
CONFIG_IT8712F_WDT=m
CONFIG_IT87_WDT=m
CONFIG_HP_WATCHDOG=m
# CONFIG_HPWDT_NMI_DECODING is not set
CONFIG_SC1200_WDT=m
CONFIG_PC87413_WDT=m
CONFIG_NV_TCO=m
CONFIG_60XX_WDT=m
CONFIG_SBC8360_WDT=m
# CONFIG_CPU5_WDT is not set
CONFIG_SMSC_SCH311X_WDT=m
CONFIG_SMSC37B787_WDT=m
CONFIG_W83627HF_WDT=m
# CONFIG_W83877F_WDT is not set
# CONFIG_W83977F_WDT is not set
# CONFIG_MACHZ_WDT is not set
CONFIG_SBC_EPX_C3_WATCHDOG=m
# CONFIG_XEN_WDT is not set

#
# PCI-based Watchdog Cards
#
CONFIG_PCIPCWATCHDOG=m
# CONFIG_WDTPCI is not set

#
# USB-based Watchdog Cards
#
# CONFIG_USBPCWATCHDOG is not set
CONFIG_SSB_POSSIBLE=y

#
# Sonics Silicon Backplane
#
CONFIG_SSB=m
CONFIG_SSB_SPROM=y
CONFIG_SSB_PCIHOST_POSSIBLE=y
CONFIG_SSB_PCIHOST=y
# CONFIG_SSB_B43_PCI_BRIDGE is not set
CONFIG_SSB_SDIOHOST_POSSIBLE=y
CONFIG_SSB_SDIOHOST=y
# CONFIG_SSB_SILENT is not set
CONFIG_SSB_DEBUG=y
CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y
CONFIG_SSB_DRIVER_PCICORE=y
CONFIG_MFD_SUPPORT=y
CONFIG_MFD_CORE=m
CONFIG_MFD_SM501=m
# CONFIG_MFD_SM501_GPIO is not set
# CONFIG_HTC_PASIC3 is not set
CONFIG_UCB1400_CORE=m
# CONFIG_TPS6105X is not set
# CONFIG_TPS65010 is not set
CONFIG_TPS6507X=m
# CONFIG_MFD_TMIO is not set
# CONFIG_MFD_WM8400 is not set
CONFIG_MFD_PCF50633=m
# CONFIG_PCF50633_ADC is not set
# CONFIG_PCF50633_GPIO is not set
CONFIG_ABX500_CORE=y
# CONFIG_AB8500_CORE is not set
CONFIG_MFD_CS5535=m
CONFIG_MFD_TIMBERDALE=m
CONFIG_LPC_SCH=m
CONFIG_MFD_RDC321X=m
CONFIG_MFD_JANZ_CMODIO=m
CONFIG_MFD_VX855=m
# CONFIG_MFD_WL1273_CORE is not set
# CONFIG_REGULATOR is not set
CONFIG_MEDIA_SUPPORT=m

#
# Multimedia core support
#
CONFIG_MEDIA_CONTROLLER=y
# CONFIG_VIDEO_DEV is not set
CONFIG_DVB_CORE=m
CONFIG_VIDEO_MEDIA=m

#
# Multimedia drivers
#
CONFIG_VIDEO_SAA7146=m
# CONFIG_RC_CORE is not set
CONFIG_MEDIA_ATTACH=y
CONFIG_MEDIA_TUNER=m
# CONFIG_MEDIA_TUNER_CUSTOMISE is not set
CONFIG_MEDIA_TUNER_SIMPLE=m
CONFIG_MEDIA_TUNER_TDA8290=m
CONFIG_MEDIA_TUNER_TDA827X=m
CONFIG_MEDIA_TUNER_TDA18271=m
CONFIG_MEDIA_TUNER_TDA9887=m
CONFIG_MEDIA_TUNER_TEA5761=m
CONFIG_MEDIA_TUNER_TEA5767=m
CONFIG_MEDIA_TUNER_MT20XX=m
CONFIG_MEDIA_TUNER_MT2131=m
CONFIG_MEDIA_TUNER_XC2028=m
CONFIG_MEDIA_TUNER_XC5000=m
CONFIG_MEDIA_TUNER_MC44S803=m
CONFIG_DVB_MAX_ADAPTERS=8
CONFIG_DVB_DYNAMIC_MINORS=y
CONFIG_DVB_CAPTURE_DRIVERS=y

#
# Supported SAA7146 based PCI Adapters
#
CONFIG_TTPCI_EEPROM=m
CONFIG_DVB_BUDGET_CORE=m
CONFIG_DVB_BUDGET=m

#
# Supported USB Adapters
#
# CONFIG_DVB_TTUSB_BUDGET is not set
CONFIG_DVB_TTUSB_DEC=m

#
# Supported FlexCopII (B2C2) Adapters
#
CONFIG_DVB_B2C2_FLEXCOP=m
CONFIG_DVB_B2C2_FLEXCOP_PCI=m
CONFIG_DVB_B2C2_FLEXCOP_USB=m
# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set

#
# Supported BT878 Adapters
#

#
# Supported Pluto2 Adapters
#
# CONFIG_DVB_PLUTO2 is not set

#
# Supported SDMC DM1105 Adapters
#

#
# Supported Earthsoft PT1 Adapters
#
# CONFIG_DVB_PT1 is not set

#
# Supported Mantis Adapters
#

#
# Supported nGene Adapters
#
CONFIG_DVB_NGENE=m

#
# Supported DVB Frontends
#
CONFIG_DVB_FE_CUSTOMISE=y

#
# Customise DVB Frontends
#

#
# Multistandard (satellite) frontends
#
# CONFIG_DVB_STB0899 is not set
# CONFIG_DVB_STB6100 is not set
# CONFIG_DVB_STV090x is not set
# CONFIG_DVB_STV6110x is not set

#
# DVB-S (satellite) frontends
#
CONFIG_DVB_CX24110=m
CONFIG_DVB_CX24123=m
CONFIG_DVB_MT312=m
# CONFIG_DVB_ZL10036 is not set
# CONFIG_DVB_ZL10039 is not set
CONFIG_DVB_S5H1420=m
CONFIG_DVB_STV0288=m
# CONFIG_DVB_STB6000 is not set
# CONFIG_DVB_STV0299 is not set
CONFIG_DVB_STV6110=m
CONFIG_DVB_STV0900=m
# CONFIG_DVB_TDA8083 is not set
CONFIG_DVB_TDA10086=m
# CONFIG_DVB_TDA8261 is not set
# CONFIG_DVB_VES1X93 is not set
# CONFIG_DVB_TUNER_ITD1000 is not set
# CONFIG_DVB_TUNER_CX24113 is not set
# CONFIG_DVB_TDA826X is not set
# CONFIG_DVB_TUA6100 is not set
# CONFIG_DVB_CX24116 is not set
CONFIG_DVB_SI21XX=m
# CONFIG_DVB_DS3000 is not set
CONFIG_DVB_MB86A16=m

#
# DVB-T (terrestrial) frontends
#
CONFIG_DVB_SP8870=m
# CONFIG_DVB_SP887X is not set
# CONFIG_DVB_CX22700 is not set
# CONFIG_DVB_CX22702 is not set
# CONFIG_DVB_S5H1432 is not set
# CONFIG_DVB_DRX397XD is not set
CONFIG_DVB_L64781=m
CONFIG_DVB_TDA1004X=m
# CONFIG_DVB_NXT6000 is not set
CONFIG_DVB_MT352=m
CONFIG_DVB_ZL10353=m
# CONFIG_DVB_DIB3000MB is not set
CONFIG_DVB_DIB3000MC=m
# CONFIG_DVB_DIB7000M is not set
# CONFIG_DVB_DIB7000P is not set
# CONFIG_DVB_DIB9000 is not set
# CONFIG_DVB_TDA10048 is not set
CONFIG_DVB_AF9013=m
# CONFIG_DVB_EC100 is not set
# CONFIG_DVB_STV0367 is not set

#
# DVB-C (cable) frontends
#
# CONFIG_DVB_VES1820 is not set
CONFIG_DVB_TDA10021=m
# CONFIG_DVB_TDA10023 is not set
CONFIG_DVB_STV0297=m

#
# ATSC (North American/Korean Terrestrial/Cable DTV) frontends
#
# CONFIG_DVB_NXT200X is not set
# CONFIG_DVB_OR51211 is not set
CONFIG_DVB_OR51132=m
CONFIG_DVB_BCM3510=m
# CONFIG_DVB_LGDT330X is not set
# CONFIG_DVB_LGDT3305 is not set
# CONFIG_DVB_S5H1409 is not set
# CONFIG_DVB_S5H1411 is not set

#
# ISDB-T (terrestrial) frontends
#
CONFIG_DVB_S921=m
# CONFIG_DVB_DIB8000 is not set
CONFIG_DVB_MB86A20S=m

#
# Digital terrestrial only tuners/PLL
#
# CONFIG_DVB_PLL is not set
# CONFIG_DVB_TUNER_DIB0070 is not set
# CONFIG_DVB_TUNER_DIB0090 is not set

#
# SEC control devices for DVB-S
#
# CONFIG_DVB_LNBP21 is not set
# CONFIG_DVB_ISL6405 is not set
# CONFIG_DVB_ISL6421 is not set
# CONFIG_DVB_ISL6423 is not set
# CONFIG_DVB_LGS8GL5 is not set
CONFIG_DVB_LGS8GXX=m
# CONFIG_DVB_ATBM8830 is not set
CONFIG_DVB_TDA665x=m
# CONFIG_DVB_IX2505V is not set

#
# Tools to develop new frontends
#
CONFIG_DVB_DUMMY_FE=m

#
# Graphics support
#
CONFIG_AGP=m
CONFIG_AGP_AMD64=m
CONFIG_AGP_INTEL=m
CONFIG_AGP_SIS=m
# CONFIG_AGP_VIA is not set
# CONFIG_VGA_ARB is not set
CONFIG_VGA_SWITCHEROO=y
# CONFIG_DRM is not set
# CONFIG_STUB_POULSBO is not set
CONFIG_VGASTATE=m
# CONFIG_VIDEO_OUTPUT_CONTROL is not set
CONFIG_FB=m
CONFIG_FIRMWARE_EDID=y
CONFIG_FB_DDC=m
# CONFIG_FB_BOOT_VESA_SUPPORT is not set
CONFIG_FB_CFB_FILLRECT=m
CONFIG_FB_CFB_COPYAREA=m
CONFIG_FB_CFB_IMAGEBLIT=m
# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
CONFIG_FB_SYS_FILLRECT=m
CONFIG_FB_SYS_COPYAREA=m
CONFIG_FB_SYS_IMAGEBLIT=m
# CONFIG_FB_FOREIGN_ENDIAN is not set
CONFIG_FB_SYS_FOPS=m
# CONFIG_FB_WMT_GE_ROPS is not set
CONFIG_FB_DEFERRED_IO=y
CONFIG_FB_SVGALIB=m
# CONFIG_FB_MACMODES is not set
CONFIG_FB_BACKLIGHT=y
CONFIG_FB_MODE_HELPERS=y
CONFIG_FB_TILEBLITTING=y

#
# Frame buffer hardware drivers
#
CONFIG_FB_PM2=m
CONFIG_FB_PM2_FIFO_DISCONNECT=y
# CONFIG_FB_CYBER2000 is not set
# CONFIG_FB_ARC is not set
CONFIG_FB_UVESA=m
# CONFIG_FB_N411 is not set
# CONFIG_FB_HGA is not set
# CONFIG_FB_S1D13XXX is not set
CONFIG_FB_NVIDIA=m
CONFIG_FB_NVIDIA_I2C=y
CONFIG_FB_NVIDIA_DEBUG=y
# CONFIG_FB_NVIDIA_BACKLIGHT is not set
CONFIG_FB_RIVA=m
# CONFIG_FB_RIVA_I2C is not set
# CONFIG_FB_RIVA_DEBUG is not set
CONFIG_FB_RIVA_BACKLIGHT=y
# CONFIG_FB_LE80578 is not set
# CONFIG_FB_INTEL is not set
# CONFIG_FB_MATROX is not set
# CONFIG_FB_ATY128 is not set
CONFIG_FB_ATY=m
# CONFIG_FB_ATY_CT is not set
CONFIG_FB_ATY_GX=y
# CONFIG_FB_ATY_BACKLIGHT is not set
CONFIG_FB_S3=m
# CONFIG_FB_SAVAGE is not set
CONFIG_FB_SIS=m
# CONFIG_FB_SIS_300 is not set
CONFIG_FB_SIS_315=y
CONFIG_FB_VIA=m
# CONFIG_FB_VIA_DIRECT_PROCFS is not set
CONFIG_FB_NEOMAGIC=m
# CONFIG_FB_KYRO is not set
CONFIG_FB_3DFX=m
# CONFIG_FB_3DFX_ACCEL is not set
CONFIG_FB_3DFX_I2C=y
CONFIG_FB_VOODOO1=m
CONFIG_FB_VT8623=m
CONFIG_FB_TRIDENT=m
# CONFIG_FB_ARK is not set
# CONFIG_FB_PM3 is not set
CONFIG_FB_CARMINE=m
# CONFIG_FB_CARMINE_DRAM_EVAL is not set
CONFIG_CARMINE_DRAM_CUSTOM=y
# CONFIG_FB_GEODE is not set
CONFIG_FB_TMIO=m
CONFIG_FB_TMIO_ACCELL=y
CONFIG_FB_SM501=m
# CONFIG_FB_UDL is not set
# CONFIG_XEN_FBDEV_FRONTEND is not set
CONFIG_FB_METRONOME=m
CONFIG_FB_MB862XX=m
CONFIG_FB_MB862XX_PCI_GDC=y
CONFIG_FB_BROADSHEET=m
CONFIG_BACKLIGHT_LCD_SUPPORT=y
# CONFIG_LCD_CLASS_DEVICE is not set
CONFIG_BACKLIGHT_CLASS_DEVICE=m
CONFIG_BACKLIGHT_GENERIC=m
CONFIG_BACKLIGHT_PROGEAR=m
# CONFIG_BACKLIGHT_APPLE is not set
# CONFIG_BACKLIGHT_SAHARA is not set
# CONFIG_BACKLIGHT_ADP8860 is not set
# CONFIG_BACKLIGHT_PCF50633 is not set

#
# Display device support
#
CONFIG_DISPLAY_SUPPORT=m

#
# Display hardware drivers
#

#
# Console display driver support
#
CONFIG_VGA_CONSOLE=y
CONFIG_VGACON_SOFT_SCROLLBACK=y
CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64
CONFIG_DUMMY_CONSOLE=y
CONFIG_LOGO=y
# CONFIG_LOGO_LINUX_MONO is not set
# CONFIG_LOGO_LINUX_VGA16 is not set
# CONFIG_LOGO_LINUX_CLUT224 is not set
CONFIG_SOUND=m
CONFIG_SOUND_OSS_CORE=y
CONFIG_SOUND_OSS_CORE_PRECLAIM=y
CONFIG_SND=m
CONFIG_SND_TIMER=m
CONFIG_SND_PCM=m
CONFIG_SND_HWDEP=m
CONFIG_SND_RAWMIDI=m
CONFIG_SND_JACK=y
CONFIG_SND_SEQUENCER=m
# CONFIG_SND_SEQ_DUMMY is not set
CONFIG_SND_OSSEMUL=y
CONFIG_SND_MIXER_OSS=m
CONFIG_SND_PCM_OSS=m
CONFIG_SND_PCM_OSS_PLUGINS=y
# CONFIG_SND_SEQUENCER_OSS is not set
CONFIG_SND_HRTIMER=m
# CONFIG_SND_SEQ_HRTIMER_DEFAULT is not set
CONFIG_SND_DYNAMIC_MINORS=y
CONFIG_SND_SUPPORT_OLD_API=y
# CONFIG_SND_VERBOSE_PROCFS is not set
CONFIG_SND_VERBOSE_PRINTK=y
# CONFIG_SND_DEBUG is not set
CONFIG_SND_VMASTER=y
CONFIG_SND_DMA_SGBUF=y
CONFIG_SND_RAWMIDI_SEQ=m
CONFIG_SND_OPL3_LIB_SEQ=m
# CONFIG_SND_OPL4_LIB_SEQ is not set
# CONFIG_SND_SBAWE_SEQ is not set
CONFIG_SND_EMU10K1_SEQ=m
CONFIG_SND_MPU401_UART=m
CONFIG_SND_OPL3_LIB=m
CONFIG_SND_AC97_CODEC=m
CONFIG_SND_DRIVERS=y
# CONFIG_SND_DUMMY is not set
CONFIG_SND_ALOOP=m
CONFIG_SND_VIRMIDI=m
CONFIG_SND_SERIAL_U16550=m
CONFIG_SND_MPU401=m
CONFIG_SND_AC97_POWER_SAVE=y
CONFIG_SND_AC97_POWER_SAVE_DEFAULT=0
CONFIG_SND_SB_COMMON=m
CONFIG_SND_SB16_DSP=m
CONFIG_SND_PCI=y
# CONFIG_SND_AD1889 is not set
# CONFIG_SND_ALS300 is not set
CONFIG_SND_ALS4000=m
CONFIG_SND_ALI5451=m
CONFIG_SND_ASIHPI=m
# CONFIG_SND_ATIIXP is not set
# CONFIG_SND_ATIIXP_MODEM is not set
# CONFIG_SND_AU8810 is not set
CONFIG_SND_AU8820=m
CONFIG_SND_AU8830=m
CONFIG_SND_AW2=m
# CONFIG_SND_AZT3328 is not set
CONFIG_SND_BT87X=m
# CONFIG_SND_BT87X_OVERCLOCK is not set
# CONFIG_SND_CA0106 is not set
# CONFIG_SND_CMIPCI is not set
CONFIG_SND_OXYGEN_LIB=m
CONFIG_SND_OXYGEN=m
# CONFIG_SND_CS4281 is not set
CONFIG_SND_CS46XX=m
CONFIG_SND_CS46XX_NEW_DSP=y
CONFIG_SND_CS5530=m
# CONFIG_SND_CS5535AUDIO is not set
# CONFIG_SND_CTXFI is not set
# CONFIG_SND_DARLA20 is not set
CONFIG_SND_GINA20=m
# CONFIG_SND_LAYLA20 is not set
# CONFIG_SND_DARLA24 is not set
# CONFIG_SND_GINA24 is not set
CONFIG_SND_LAYLA24=m
CONFIG_SND_MONA=m
# CONFIG_SND_MIA is not set
# CONFIG_SND_ECHO3G is not set
CONFIG_SND_INDIGO=m
CONFIG_SND_INDIGOIO=m
# CONFIG_SND_INDIGODJ is not set
# CONFIG_SND_INDIGOIOX is not set
CONFIG_SND_INDIGODJX=m
CONFIG_SND_EMU10K1=m
CONFIG_SND_EMU10K1X=m
CONFIG_SND_ENS1370=m
# CONFIG_SND_ENS1371 is not set
CONFIG_SND_ES1938=m
CONFIG_SND_ES1968=m
CONFIG_SND_ES1968_INPUT=y
# CONFIG_SND_FM801 is not set
# CONFIG_SND_HDA_INTEL is not set
# CONFIG_SND_HDSP is not set
CONFIG_SND_HDSPM=m
# CONFIG_SND_ICE1712 is not set
# CONFIG_SND_ICE1724 is not set
CONFIG_SND_INTEL8X0=m
CONFIG_SND_INTEL8X0M=m
CONFIG_SND_KORG1212=m
CONFIG_SND_LX6464ES=m
# CONFIG_SND_MAESTRO3 is not set
# CONFIG_SND_MIXART is not set
CONFIG_SND_NM256=m
# CONFIG_SND_PCXHR is not set
# CONFIG_SND_RIPTIDE is not set
CONFIG_SND_RME32=m
# CONFIG_SND_RME96 is not set
CONFIG_SND_RME9652=m
CONFIG_SND_SONICVIBES=m
CONFIG_SND_TRIDENT=m
CONFIG_SND_VIA82XX=m
CONFIG_SND_VIA82XX_MODEM=m
CONFIG_SND_VIRTUOSO=m
# CONFIG_SND_VX222 is not set
# CONFIG_SND_YMFPCI is not set
CONFIG_SND_USB=y
CONFIG_SND_USB_AUDIO=m
CONFIG_SND_USB_UA101=m
CONFIG_SND_USB_USX2Y=m
# CONFIG_SND_USB_CAIAQ is not set
CONFIG_SND_USB_US122L=m
CONFIG_SND_USB_6FIRE=m
# CONFIG_SND_SOC is not set
CONFIG_SOUND_PRIME=m
CONFIG_SOUND_OSS=m
CONFIG_SOUND_TRACEINIT=y
CONFIG_SOUND_DMAP=y
CONFIG_SOUND_VMIDI=m
# CONFIG_SOUND_TRIX is not set
CONFIG_SOUND_MSS=m
CONFIG_SOUND_MPU401=m
CONFIG_SOUND_PAS=m
CONFIG_SOUND_PSS=m
CONFIG_PSS_MIXER=y
# CONFIG_SOUND_SB is not set
# CONFIG_SOUND_YM3812 is not set
# CONFIG_SOUND_UART6850 is not set
# CONFIG_SOUND_AEDSP16 is not set
CONFIG_AC97_BUS=m
CONFIG_HID_SUPPORT=y
CONFIG_HID=m
# CONFIG_HIDRAW is not set

#
# USB Input Devices
#
CONFIG_USB_HID=m
# CONFIG_HID_PID is not set
CONFIG_USB_HIDDEV=y

#
# USB HID Boot Protocol drivers
#
# CONFIG_USB_KBD is not set
CONFIG_USB_MOUSE=y

#
# Special HID drivers
#
CONFIG_HID_3M_PCT=m
CONFIG_HID_A4TECH=m
CONFIG_HID_ACRUX=m
# CONFIG_HID_ACRUX_FF is not set
CONFIG_HID_APPLE=m
# CONFIG_HID_BELKIN is not set
CONFIG_HID_CANDO=m
CONFIG_HID_CHERRY=m
CONFIG_HID_CHICONY=m
CONFIG_HID_PRODIKEYS=m
# CONFIG_HID_CYPRESS is not set
# CONFIG_HID_DRAGONRISE is not set
# CONFIG_HID_EMS_FF is not set
# CONFIG_HID_EZKEY is not set
# CONFIG_HID_KEYTOUCH is not set
CONFIG_HID_KYE=m
CONFIG_HID_UCLOGIC=m
# CONFIG_HID_WALTOP is not set
# CONFIG_HID_GYRATION is not set
CONFIG_HID_TWINHAN=m
# CONFIG_HID_KENSINGTON is not set
CONFIG_HID_LCPOWER=m
CONFIG_HID_LOGITECH=m
CONFIG_LOGITECH_FF=y
CONFIG_LOGIRUMBLEPAD2_FF=y
# CONFIG_LOGIG940_FF is not set
CONFIG_LOGIWII_FF=y
CONFIG_HID_MICROSOFT=m
# CONFIG_HID_MOSART is not set
CONFIG_HID_MONTEREY=m
CONFIG_HID_MULTITOUCH=m
CONFIG_HID_NTRIG=m
# CONFIG_HID_ORTEK is not set
# CONFIG_HID_PANTHERLORD is not set
# CONFIG_HID_PETALYNX is not set
CONFIG_HID_PICOLCD=m
CONFIG_HID_PICOLCD_FB=y
CONFIG_HID_PICOLCD_BACKLIGHT=y
# CONFIG_HID_QUANTA is not set
CONFIG_HID_ROCCAT=m
CONFIG_HID_ROCCAT_COMMON=m
CONFIG_HID_ROCCAT_ARVO=m
# CONFIG_HID_ROCCAT_KONE is not set
# CONFIG_HID_ROCCAT_KONEPLUS is not set
CONFIG_HID_ROCCAT_KOVAPLUS=m
CONFIG_HID_ROCCAT_PYRA=m
# CONFIG_HID_SAMSUNG is not set
# CONFIG_HID_SONY is not set
# CONFIG_HID_STANTUM is not set
CONFIG_HID_SUNPLUS=m
# CONFIG_HID_GREENASIA is not set
CONFIG_HID_SMARTJOYPLUS=m
CONFIG_SMARTJOYPLUS_FF=y
CONFIG_HID_TOPSEED=m
CONFIG_HID_THRUSTMASTER=m
CONFIG_THRUSTMASTER_FF=y
# CONFIG_HID_ZEROPLUS is not set
CONFIG_HID_ZYDACRON=m
CONFIG_USB_SUPPORT=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB_ARCH_HAS_OHCI=y
CONFIG_USB_ARCH_HAS_EHCI=y
CONFIG_USB=y
# CONFIG_USB_DEBUG is not set
# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set

#
# Miscellaneous USB options
#
# CONFIG_USB_DEVICEFS is not set
CONFIG_USB_DEVICE_CLASS=y
CONFIG_USB_DYNAMIC_MINORS=y
# CONFIG_USB_OTG_WHITELIST is not set
CONFIG_USB_OTG_BLACKLIST_HUB=y
# CONFIG_USB_MON is not set
# CONFIG_USB_WUSB is not set
# CONFIG_USB_WUSB_CBAF is not set

#
# USB Host Controller Drivers
#
CONFIG_USB_C67X00_HCD=m
CONFIG_USB_XHCI_HCD=m
# CONFIG_USB_XHCI_HCD_DEBUGGING is not set
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_ROOT_HUB_TT=y
CONFIG_USB_EHCI_TT_NEWSCHED=y
CONFIG_USB_OXU210HP_HCD=m
CONFIG_USB_ISP116X_HCD=m
CONFIG_USB_ISP1760_HCD=m
# CONFIG_USB_ISP1362_HCD is not set
CONFIG_USB_OHCI_HCD=y
# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_UHCI_HCD=y
# CONFIG_USB_U132_HCD is not set
CONFIG_USB_SL811_HCD=m
CONFIG_USB_R8A66597_HCD=m
# CONFIG_USB_HWA_HCD is not set

#
# USB Device Class drivers
#
# CONFIG_USB_ACM is not set
CONFIG_USB_PRINTER=m
# CONFIG_USB_WDM is not set
CONFIG_USB_TMC=m

#
# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
#

#
# also be needed; see USB_STORAGE Help for more info
#
# CONFIG_USB_STORAGE is not set
CONFIG_USB_UAS=m
CONFIG_USB_LIBUSUAL=y

#
# USB Imaging devices
#
# CONFIG_USB_MDC800 is not set
CONFIG_USB_MICROTEK=m

#
# USB port drivers
#
# CONFIG_USB_SERIAL is not set

#
# USB Miscellaneous drivers
#
CONFIG_USB_EMI62=m
# CONFIG_USB_EMI26 is not set
CONFIG_USB_ADUTUX=m
CONFIG_USB_SEVSEG=m
CONFIG_USB_RIO500=m
CONFIG_USB_LEGOTOWER=m
CONFIG_USB_LCD=m
CONFIG_USB_LED=m
# CONFIG_USB_CYPRESS_CY7C63 is not set
CONFIG_USB_CYTHERM=m
# CONFIG_USB_IDMOUSE is not set
CONFIG_USB_FTDI_ELAN=m
# CONFIG_USB_APPLEDISPLAY is not set
CONFIG_USB_SISUSBVGA=m
# CONFIG_USB_SISUSBVGA_CON is not set
# CONFIG_USB_LD is not set
CONFIG_USB_TRANCEVIBRATOR=m
CONFIG_USB_IOWARRIOR=m
CONFIG_USB_TEST=m
CONFIG_USB_ISIGHTFW=m
# CONFIG_USB_YUREX is not set
# CONFIG_USB_ATM is not set
# CONFIG_USB_GADGET is not set

#
# OTG and related infrastructure
#
# CONFIG_USB_GPIO_VBUS is not set
# CONFIG_NOP_USB_XCEIV is not set
CONFIG_UWB=m
# CONFIG_UWB_HWA is not set
CONFIG_UWB_WHCI=m
CONFIG_MMC=m
# CONFIG_MMC_DEBUG is not set
CONFIG_MMC_UNSAFE_RESUME=y
CONFIG_MMC_CLKGATE=y

#
# MMC/SD/SDIO Card Drivers
#
CONFIG_MMC_BLOCK=m
CONFIG_MMC_BLOCK_MINORS=8
CONFIG_MMC_BLOCK_BOUNCE=y
CONFIG_SDIO_UART=m
CONFIG_MMC_TEST=m

#
# MMC/SD/SDIO Host Controller Drivers
#
# CONFIG_MMC_SDHCI is not set
# CONFIG_MMC_WBSD is not set
CONFIG_MMC_TIFM_SD=m
# CONFIG_MMC_CB710 is not set
# CONFIG_MMC_VIA_SDMMC is not set
CONFIG_MMC_USHC=m
# CONFIG_MEMSTICK is not set
# CONFIG_NEW_LEDS is not set
CONFIG_NFC_DEVICES=y
# CONFIG_PN544_NFC is not set
CONFIG_ACCESSIBILITY=y
# CONFIG_A11Y_BRAILLE_CONSOLE is not set
CONFIG_INFINIBAND=m
# CONFIG_INFINIBAND_USER_MAD is not set
# CONFIG_INFINIBAND_USER_ACCESS is not set
CONFIG_INFINIBAND_ADDR_TRANS=y
# CONFIG_INFINIBAND_MTHCA is not set
CONFIG_INFINIBAND_QIB=m
# CONFIG_INFINIBAND_AMSO1100 is not set
# CONFIG_INFINIBAND_CXGB3 is not set
# CONFIG_INFINIBAND_CXGB4 is not set
# CONFIG_MLX4_INFINIBAND is not set
# CONFIG_INFINIBAND_NES is not set
CONFIG_INFINIBAND_IPOIB=m
CONFIG_INFINIBAND_IPOIB_CM=y
CONFIG_INFINIBAND_IPOIB_DEBUG=y
# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set
# CONFIG_INFINIBAND_SRP is not set
CONFIG_INFINIBAND_ISER=m
CONFIG_EDAC=y

#
# Reporting subsystems
#
CONFIG_EDAC_DEBUG=y
# CONFIG_EDAC_DECODE_MCE is not set
# CONFIG_EDAC_MM_EDAC is not set
# CONFIG_RTC_CLASS is not set
CONFIG_DMADEVICES=y
# CONFIG_DMADEVICES_DEBUG is not set

#
# DMA Devices
#
CONFIG_INTEL_MID_DMAC=m
# CONFIG_INTEL_IOATDMA is not set
# CONFIG_TIMB_DMA is not set
CONFIG_PCH_DMA=m
CONFIG_DMA_ENGINE=y

#
# DMA Clients
#
# CONFIG_NET_DMA is not set
# CONFIG_ASYNC_TX_DMA is not set
# CONFIG_DMATEST is not set
CONFIG_AUXDISPLAY=y
# CONFIG_UIO is not set

#
# Xen driver support
#
# CONFIG_XEN_BALLOON is not set
# CONFIG_XEN_DEV_EVTCHN is not set
CONFIG_XEN_BACKEND=y
# CONFIG_XENFS is not set
CONFIG_XEN_SYS_HYPERVISOR=y
CONFIG_XEN_XENBUS_FRONTEND=m
# CONFIG_XEN_GNTDEV is not set
# CONFIG_XEN_GRANT_DEV_ALLOC is not set
# CONFIG_XEN_PLATFORM_PCI is not set
CONFIG_SWIOTLB_XEN=y
# CONFIG_X86_PLATFORM_DEVICES is not set

#
# Firmware Drivers
#
CONFIG_EDD=m
# CONFIG_EDD_OFF is not set
# CONFIG_FIRMWARE_MEMMAP is not set
# CONFIG_EFI_VARS is not set
CONFIG_DELL_RBU=m
CONFIG_DCDBAS=m
# CONFIG_ISCSI_IBFT_FIND is not set
# CONFIG_SIGMA is not set

#
# File systems
#
# CONFIG_EXT2_FS is not set
CONFIG_EXT3_FS=y
CONFIG_EXT3_DEFAULTS_TO_ORDERED=y
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y
CONFIG_EXT3_FS_SECURITY=y
CONFIG_EXT4_FS=m
# CONFIG_EXT4_USE_FOR_EXT23 is not set
CONFIG_EXT4_FS_XATTR=y
CONFIG_EXT4_FS_POSIX_ACL=y
# CONFIG_EXT4_FS_SECURITY is not set
CONFIG_EXT4_DEBUG=y
CONFIG_JBD=y
# CONFIG_JBD_DEBUG is not set
CONFIG_JBD2=m
CONFIG_JBD2_DEBUG=y
CONFIG_FS_MBCACHE=y
CONFIG_REISERFS_FS=m
# CONFIG_REISERFS_CHECK is not set
# CONFIG_REISERFS_PROC_INFO is not set
CONFIG_REISERFS_FS_XATTR=y
# CONFIG_REISERFS_FS_POSIX_ACL is not set
CONFIG_REISERFS_FS_SECURITY=y
CONFIG_JFS_FS=m
CONFIG_JFS_POSIX_ACL=y
# CONFIG_JFS_SECURITY is not set
CONFIG_JFS_DEBUG=y
CONFIG_JFS_STATISTICS=y
# CONFIG_XFS_FS is not set
CONFIG_GFS2_FS=m
CONFIG_GFS2_FS_LOCKING_DLM=y
# CONFIG_OCFS2_FS is not set
# CONFIG_BTRFS_FS is not set
CONFIG_NILFS2_FS=m
CONFIG_FS_POSIX_ACL=y
CONFIG_FILE_LOCKING=y
CONFIG_FSNOTIFY=y
# CONFIG_DNOTIFY is not set
CONFIG_INOTIFY_USER=y
CONFIG_FANOTIFY=y
# CONFIG_FANOTIFY_ACCESS_PERMISSIONS is not set
# CONFIG_QUOTA is not set
CONFIG_QUOTA_NETLINK_INTERFACE=y
CONFIG_QUOTACTL=y
CONFIG_QUOTACTL_COMPAT=y
# CONFIG_AUTOFS4_FS is not set
# CONFIG_FUSE_FS is not set

#
# Caches
#
# CONFIG_FSCACHE is not set

#
# CD-ROM/DVD Filesystems
#
# CONFIG_ISO9660_FS is not set
CONFIG_UDF_FS=m
CONFIG_UDF_NLS=y

#
# DOS/FAT/NT Filesystems
#
# CONFIG_MSDOS_FS is not set
# CONFIG_VFAT_FS is not set
# CONFIG_NTFS_FS is not set

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
# CONFIG_PROC_KCORE is not set
# CONFIG_PROC_SYSCTL is not set
# CONFIG_PROC_PAGE_MONITOR is not set
CONFIG_SYSFS=y
CONFIG_HUGETLBFS=y
CONFIG_HUGETLB_PAGE=y
CONFIG_CONFIGFS_FS=m
# CONFIG_MISC_FILESYSTEMS is not set
CONFIG_NETWORK_FILESYSTEMS=y
# CONFIG_NFS_FS is not set
# CONFIG_NFSD is not set
CONFIG_CEPH_FS=m
# CONFIG_CIFS is not set
# CONFIG_NCP_FS is not set
CONFIG_CODA_FS=m
CONFIG_AFS_FS=m
CONFIG_AFS_DEBUG=y

#
# Partition Types
#
CONFIG_PARTITION_ADVANCED=y
CONFIG_ACORN_PARTITION=y
# CONFIG_ACORN_PARTITION_CUMANA is not set
CONFIG_ACORN_PARTITION_EESOX=y
# CONFIG_ACORN_PARTITION_ICS is not set
# CONFIG_ACORN_PARTITION_ADFS is not set
# CONFIG_ACORN_PARTITION_POWERTEC is not set
CONFIG_ACORN_PARTITION_RISCIX=y
# CONFIG_OSF_PARTITION is not set
CONFIG_AMIGA_PARTITION=y
# CONFIG_ATARI_PARTITION is not set
# CONFIG_MAC_PARTITION is not set
CONFIG_MSDOS_PARTITION=y
CONFIG_BSD_DISKLABEL=y
CONFIG_MINIX_SUBPARTITION=y
# CONFIG_SOLARIS_X86_PARTITION is not set
CONFIG_UNIXWARE_DISKLABEL=y
CONFIG_LDM_PARTITION=y
CONFIG_LDM_DEBUG=y
CONFIG_SGI_PARTITION=y
# CONFIG_ULTRIX_PARTITION is not set
CONFIG_SUN_PARTITION=y
CONFIG_KARMA_PARTITION=y
# CONFIG_EFI_PARTITION is not set
# CONFIG_SYSV68_PARTITION is not set
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="iso8859-1"
# CONFIG_NLS_CODEPAGE_437 is not set
CONFIG_NLS_CODEPAGE_737=m
CONFIG_NLS_CODEPAGE_775=m
# CONFIG_NLS_CODEPAGE_850 is not set
# CONFIG_NLS_CODEPAGE_852 is not set
# CONFIG_NLS_CODEPAGE_855 is not set
CONFIG_NLS_CODEPAGE_857=m
# CONFIG_NLS_CODEPAGE_860 is not set
# CONFIG_NLS_CODEPAGE_861 is not set
# CONFIG_NLS_CODEPAGE_862 is not set
CONFIG_NLS_CODEPAGE_863=m
# CONFIG_NLS_CODEPAGE_864 is not set
# CONFIG_NLS_CODEPAGE_865 is not set
CONFIG_NLS_CODEPAGE_866=m
CONFIG_NLS_CODEPAGE_869=m
# CONFIG_NLS_CODEPAGE_936 is not set
CONFIG_NLS_CODEPAGE_950=m
# CONFIG_NLS_CODEPAGE_932 is not set
CONFIG_NLS_CODEPAGE_949=m
# CONFIG_NLS_CODEPAGE_874 is not set
CONFIG_NLS_ISO8859_8=m
# CONFIG_NLS_CODEPAGE_1250 is not set
CONFIG_NLS_CODEPAGE_1251=m
CONFIG_NLS_ASCII=m
# CONFIG_NLS_ISO8859_1 is not set
# CONFIG_NLS_ISO8859_2 is not set
CONFIG_NLS_ISO8859_3=m
# CONFIG_NLS_ISO8859_4 is not set
# CONFIG_NLS_ISO8859_5 is not set
# CONFIG_NLS_ISO8859_6 is not set
CONFIG_NLS_ISO8859_7=m
# CONFIG_NLS_ISO8859_9 is not set
CONFIG_NLS_ISO8859_13=m
CONFIG_NLS_ISO8859_14=m
CONFIG_NLS_ISO8859_15=m
# CONFIG_NLS_KOI8_R is not set
# CONFIG_NLS_KOI8_U is not set
# CONFIG_NLS_UTF8 is not set
CONFIG_DLM=m
CONFIG_DLM_DEBUG=y

#
# Kernel hacking
#
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_PRINTK_TIME=y
CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
# CONFIG_ENABLE_WARN_DEPRECATED is not set
CONFIG_ENABLE_MUST_CHECK=y
CONFIG_FRAME_WARN=2048
CONFIG_MAGIC_SYSRQ=y
# CONFIG_STRIP_ASM_SYMS is not set
CONFIG_UNUSED_SYMBOLS=y
CONFIG_DEBUG_FS=y
# CONFIG_HEADERS_CHECK is not set
# CONFIG_DEBUG_SECTION_MISMATCH is not set
CONFIG_DEBUG_KERNEL=y
# CONFIG_DEBUG_SHIRQ is not set
CONFIG_LOCKUP_DETECTOR=y
CONFIG_HARDLOCKUP_DETECTOR=y
CONFIG_BOOTPARAM_HARDLOCKUP_PANIC=y
CONFIG_BOOTPARAM_HARDLOCKUP_PANIC_VALUE=1
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=1
CONFIG_DETECT_HUNG_TASK=y
CONFIG_BOOTPARAM_HUNG_TASK_PANIC=y
CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=1
CONFIG_SCHED_DEBUG=y
CONFIG_SCHEDSTATS=y
CONFIG_TIMER_STATS=y
# CONFIG_DEBUG_OBJECTS is not set
# CONFIG_SLUB_DEBUG_ON is not set
CONFIG_SLUB_STATS=y
# CONFIG_DEBUG_RT_MUTEXES is not set
# CONFIG_RT_MUTEX_TESTER is not set
CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_MUTEXES=y
CONFIG_DEBUG_LOCK_ALLOC=y
# CONFIG_PROVE_LOCKING is not set
CONFIG_SPARSE_RCU_POINTER=y
CONFIG_LOCKDEP=y
# CONFIG_LOCK_STAT is not set
CONFIG_DEBUG_LOCKDEP=y
CONFIG_TRACE_IRQFLAGS=y
CONFIG_DEBUG_SPINLOCK_SLEEP=y
CONFIG_DEBUG_LOCKING_API_SELFTESTS=y
CONFIG_STACKTRACE=y
# CONFIG_DEBUG_BUGVERBOSE is not set
# CONFIG_DEBUG_VM is not set
CONFIG_DEBUG_VIRTUAL=y
# CONFIG_DEBUG_WRITECOUNT is not set
# CONFIG_DEBUG_MEMORY_INIT is not set
# CONFIG_DEBUG_LIST is not set
CONFIG_TEST_LIST_SORT=y
CONFIG_DEBUG_SG=y
CONFIG_DEBUG_NOTIFIERS=y
# CONFIG_DEBUG_CREDENTIALS is not set
CONFIG_ARCH_WANT_FRAME_POINTERS=y
CONFIG_FRAME_POINTER=y
CONFIG_BOOT_PRINTK_DELAY=y
CONFIG_RCU_TORTURE_TEST=m
# CONFIG_RCU_CPU_STALL_DETECTOR is not set
# CONFIG_BACKTRACE_SELF_TEST is not set
CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y
# CONFIG_LKDTM is not set
CONFIG_CPU_NOTIFIER_ERROR_INJECT=m
# CONFIG_FAULT_INJECTION is not set
CONFIG_LATENCYTOP=y
# CONFIG_DEBUG_PAGEALLOC is not set
CONFIG_USER_STACKTRACE_SUPPORT=y
CONFIG_NOP_TRACER=y
CONFIG_HAVE_FTRACE_NMI_ENTER=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST=y
CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_HAVE_C_RECORDMCOUNT=y
CONFIG_TRACER_MAX_TRACE=y
CONFIG_RING_BUFFER=y
CONFIG_FTRACE_NMI_ENTER=y
CONFIG_EVENT_TRACING=y
# CONFIG_EVENT_POWER_TRACING_DEPRECATED is not set
CONFIG_CONTEXT_SWITCH_TRACER=y
CONFIG_RING_BUFFER_ALLOW_SWAP=y
CONFIG_TRACING=y
CONFIG_GENERIC_TRACER=y
CONFIG_TRACING_SUPPORT=y
CONFIG_FTRACE=y
CONFIG_FUNCTION_TRACER=y
# CONFIG_FUNCTION_GRAPH_TRACER is not set
CONFIG_IRQSOFF_TRACER=y
# CONFIG_SCHED_TRACER is not set
# CONFIG_FTRACE_SYSCALLS is not set
CONFIG_BRANCH_PROFILE_NONE=y
# CONFIG_STACK_TRACER is not set
# CONFIG_BLK_DEV_IO_TRACE is not set
CONFIG_DYNAMIC_FTRACE=y
CONFIG_FUNCTION_PROFILER=y
CONFIG_FTRACE_MCOUNT_RECORD=y
CONFIG_MMIOTRACE=y
# CONFIG_MMIOTRACE_TEST is not set
CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
# CONFIG_DYNAMIC_DEBUG is not set
CONFIG_DMA_API_DEBUG=y
CONFIG_ATOMIC64_SELFTEST=y
CONFIG_SAMPLES=y
CONFIG_SAMPLE_TRACEPOINTS=m
# CONFIG_SAMPLE_TRACE_EVENTS is not set
# CONFIG_SAMPLE_KOBJECT is not set
CONFIG_SAMPLE_HW_BREAKPOINT=m
# CONFIG_SAMPLE_KFIFO is not set
# CONFIG_SAMPLE_KDB is not set
CONFIG_HAVE_ARCH_KGDB=y
CONFIG_KGDB=y
CONFIG_KGDB_SERIAL_CONSOLE=m
CONFIG_KGDB_TESTS=y
# CONFIG_KGDB_LOW_LEVEL_TRAP is not set
CONFIG_KGDB_KDB=y
# CONFIG_KDB_KEYBOARD is not set
CONFIG_HAVE_ARCH_KMEMCHECK=y
# CONFIG_TEST_KSTRTOX is not set
# CONFIG_STRICT_DEVMEM is not set
# CONFIG_X86_VERBOSE_BOOTUP is not set
CONFIG_EARLY_PRINTK=y
# CONFIG_EARLY_PRINTK_DBGP is not set
# CONFIG_DEBUG_STACKOVERFLOW is not set
CONFIG_DEBUG_STACK_USAGE=y
# CONFIG_DEBUG_PER_CPU_MAPS is not set
CONFIG_X86_PTDUMP=y
# CONFIG_DEBUG_RODATA is not set
# CONFIG_DEBUG_SET_MODULE_RONX is not set
CONFIG_DEBUG_NX_TEST=m
# CONFIG_IOMMU_STRESS is not set
CONFIG_HAVE_MMIOTRACE_SUPPORT=y
CONFIG_IO_DELAY_TYPE_0X80=0
CONFIG_IO_DELAY_TYPE_0XED=1
CONFIG_IO_DELAY_TYPE_UDELAY=2
CONFIG_IO_DELAY_TYPE_NONE=3
# CONFIG_IO_DELAY_0X80 is not set
CONFIG_IO_DELAY_0XED=y
# CONFIG_IO_DELAY_UDELAY is not set
# CONFIG_IO_DELAY_NONE is not set
CONFIG_DEFAULT_IO_DELAY_TYPE=1
CONFIG_DEBUG_BOOT_PARAMS=y
# CONFIG_CPA_DEBUG is not set
# CONFIG_OPTIMIZE_INLINING is not set

#
# Security options
#
CONFIG_KEYS=y
CONFIG_TRUSTED_KEYS=m
CONFIG_ENCRYPTED_KEYS=m
CONFIG_KEYS_DEBUG_PROC_KEYS=y
CONFIG_SECURITY_DMESG_RESTRICT=y
CONFIG_SECURITY=y
CONFIG_SECURITYFS=y
CONFIG_SECURITY_NETWORK=y
# CONFIG_SECURITY_NETWORK_XFRM is not set
CONFIG_SECURITY_PATH=y
CONFIG_LSM_MMAP_MIN_ADDR=65536
CONFIG_SECURITY_SELINUX=y
CONFIG_SECURITY_SELINUX_BOOTPARAM=y
CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1
CONFIG_SECURITY_SELINUX_DISABLE=y
# CONFIG_SECURITY_SELINUX_DEVELOP is not set
CONFIG_SECURITY_SELINUX_AVC_STATS=y
CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
# CONFIG_SECURITY_TOMOYO is not set
CONFIG_SECURITY_APPARMOR=y
CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=1
# CONFIG_IMA is not set
# CONFIG_DEFAULT_SECURITY_SELINUX is not set
CONFIG_DEFAULT_SECURITY_APPARMOR=y
# CONFIG_DEFAULT_SECURITY_DAC is not set
CONFIG_DEFAULT_SECURITY="apparmor"
CONFIG_CRYPTO=y

#
# Crypto core or helper
#
CONFIG_CRYPTO_FIPS=y
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_ALGAPI2=y
CONFIG_CRYPTO_AEAD=m
CONFIG_CRYPTO_AEAD2=y
CONFIG_CRYPTO_BLKCIPHER=m
CONFIG_CRYPTO_BLKCIPHER2=y
CONFIG_CRYPTO_HASH=y
CONFIG_CRYPTO_HASH2=y
CONFIG_CRYPTO_RNG=m
CONFIG_CRYPTO_RNG2=y
CONFIG_CRYPTO_PCOMP=m
CONFIG_CRYPTO_PCOMP2=y
CONFIG_CRYPTO_MANAGER=m
CONFIG_CRYPTO_MANAGER2=y
# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
CONFIG_CRYPTO_GF128MUL=m
CONFIG_CRYPTO_NULL=m
# CONFIG_CRYPTO_PCRYPT is not set
CONFIG_CRYPTO_WORKQUEUE=y
# CONFIG_CRYPTO_CRYPTD is not set
CONFIG_CRYPTO_AUTHENC=m
CONFIG_CRYPTO_TEST=m

#
# Authenticated Encryption with Associated Data
#
# CONFIG_CRYPTO_CCM is not set
CONFIG_CRYPTO_GCM=m
CONFIG_CRYPTO_SEQIV=m

#
# Block modes
#
CONFIG_CRYPTO_CBC=m
CONFIG_CRYPTO_CTR=m
# CONFIG_CRYPTO_CTS is not set
CONFIG_CRYPTO_ECB=m
CONFIG_CRYPTO_LRW=m
CONFIG_CRYPTO_PCBC=m
# CONFIG_CRYPTO_XTS is not set

#
# Hash modes
#
CONFIG_CRYPTO_HMAC=m
# CONFIG_CRYPTO_XCBC is not set
# CONFIG_CRYPTO_VMAC is not set

#
# Digest
#
CONFIG_CRYPTO_CRC32C=m
# CONFIG_CRYPTO_CRC32C_INTEL is not set
CONFIG_CRYPTO_GHASH=m
# CONFIG_CRYPTO_MD4 is not set
CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_MICHAEL_MIC=m
CONFIG_CRYPTO_RMD128=m
CONFIG_CRYPTO_RMD160=m
# CONFIG_CRYPTO_RMD256 is not set
CONFIG_CRYPTO_RMD320=m
CONFIG_CRYPTO_SHA1=m
CONFIG_CRYPTO_SHA256=m
CONFIG_CRYPTO_SHA512=m
CONFIG_CRYPTO_TGR192=m
CONFIG_CRYPTO_WP512=m
# CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL is not set

#
# Ciphers
#
CONFIG_CRYPTO_AES=m
CONFIG_CRYPTO_AES_X86_64=m
# CONFIG_CRYPTO_AES_NI_INTEL is not set
CONFIG_CRYPTO_ANUBIS=m
CONFIG_CRYPTO_ARC4=m
CONFIG_CRYPTO_BLOWFISH=m
# CONFIG_CRYPTO_CAMELLIA is not set
# CONFIG_CRYPTO_CAST5 is not set
CONFIG_CRYPTO_CAST6=m
CONFIG_CRYPTO_DES=m
CONFIG_CRYPTO_FCRYPT=m
# CONFIG_CRYPTO_KHAZAD is not set
# CONFIG_CRYPTO_SALSA20 is not set
# CONFIG_CRYPTO_SALSA20_X86_64 is not set
CONFIG_CRYPTO_SEED=m
# CONFIG_CRYPTO_SERPENT is not set
# CONFIG_CRYPTO_TEA is not set
# CONFIG_CRYPTO_TWOFISH is not set
# CONFIG_CRYPTO_TWOFISH_X86_64 is not set

#
# Compression
#
CONFIG_CRYPTO_DEFLATE=m
CONFIG_CRYPTO_ZLIB=m
# CONFIG_CRYPTO_LZO is not set

#
# Random Number Generation
#
CONFIG_CRYPTO_ANSI_CPRNG=m
CONFIG_CRYPTO_USER_API=m
CONFIG_CRYPTO_USER_API_HASH=m
# CONFIG_CRYPTO_USER_API_SKCIPHER is not set
# CONFIG_CRYPTO_HW is not set
CONFIG_HAVE_KVM=y
CONFIG_HAVE_KVM_IRQCHIP=y
CONFIG_HAVE_KVM_EVENTFD=y
CONFIG_KVM_APIC_ARCHITECTURE=y
CONFIG_KVM_MMIO=y
CONFIG_KVM_ASYNC_PF=y
CONFIG_VIRTUALIZATION=y
CONFIG_KVM=m
# CONFIG_KVM_INTEL is not set
CONFIG_KVM_AMD=m
# CONFIG_KVM_MMU_AUDIT is not set
# CONFIG_VHOST_NET is not set
CONFIG_VIRTIO=m
CONFIG_VIRTIO_RING=m
# CONFIG_VIRTIO_PCI is not set
CONFIG_VIRTIO_BALLOON=m
CONFIG_BINARY_PRINTF=y

#
# Library routines
#
CONFIG_BITREVERSE=y
CONFIG_GENERIC_FIND_FIRST_BIT=y
CONFIG_GENERIC_FIND_NEXT_BIT=y
CONFIG_GENERIC_FIND_LAST_BIT=y
CONFIG_CRC_CCITT=m
CONFIG_CRC16=m
CONFIG_CRC_T10DIF=y
CONFIG_CRC_ITU_T=m
CONFIG_CRC32=y
# CONFIG_CRC7 is not set
CONFIG_LIBCRC32C=m
CONFIG_ZLIB_INFLATE=m
CONFIG_ZLIB_DEFLATE=m
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
CONFIG_XZ_DEC=m
# CONFIG_XZ_DEC_X86 is not set
# CONFIG_XZ_DEC_POWERPC is not set
# CONFIG_XZ_DEC_IA64 is not set
CONFIG_XZ_DEC_ARM=y
CONFIG_XZ_DEC_ARMTHUMB=y
CONFIG_XZ_DEC_SPARC=y
CONFIG_XZ_DEC_BCJ=y
# CONFIG_XZ_DEC_TEST is not set
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_DMA=y
CONFIG_CPU_RMAP=y
CONFIG_NLATTR=y
CONFIG_LRU_CACHE=m
CONFIG_AVERAGE=y
CONFIG_FORCE_SUCCESSFUL_BUILD=y
CONFIG_FORCE_MINIMAL_CONFIG=y
CONFIG_FORCE_MINIMAL_CONFIG_64=y
CONFIG_FORCE_MINIMAL_CONFIG_PHYS=y

[-- Attachment #3: crash.log --]
[-- Type: text/plain, Size: 192198 bytes --]

early console in setup code
Probing EDD (edd=off to disable)... ok
[    0.000000] Linux version 2.6.39-rc2-tip+ (mingo@sirius) (gcc version 4.6.0 20110304 (Red Hat 4.6.0-0.12) (GCC) ) #113394 SMP Thu Apr 7 09:47:00 CEST 2011
[    0.000000] Command line: root=/dev/sda6 earlyprintk=ttyS0,115200 console=ttyS0,115200 debug initcall_debug sysrq_always_enabled ignore_loglevel selinux=0 nmi_watchdog=1 panic=1 3
[    0.000000] KERNEL supported cpus:
[    0.000000]   Intel GenuineIntel
[    0.000000]   AMD AuthenticAMD
[    0.000000]   Centaur CentaurHauls
[    0.000000] BIOS-provided physical RAM map:
[    0.000000]  BIOS-e820: 0000000000000000 - 000000000009f800 (usable)
[    0.000000]  BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved)
[    0.000000]  BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
[    0.000000]  BIOS-e820: 0000000000100000 - 000000003fff0000 (usable)
[    0.000000]  BIOS-e820: 000000003fff0000 - 000000003fff3000 (ACPI NVS)
[    0.000000]  BIOS-e820: 000000003fff3000 - 0000000040000000 (ACPI data)
[    0.000000]  BIOS-e820: 00000000e0000000 - 00000000f0000000 (reserved)
[    0.000000]  BIOS-e820: 00000000fec00000 - 0000000100000000 (reserved)
[    0.000000] bootconsole [earlyser0] enabled
[    0.000000] debug: ignoring loglevel setting.
[    0.000000] NX (Execute Disable) protection: active
[    0.000000] e820 update range: 0000000000000000 - 0000000000010000 (usable) ==> (reserved)
[    0.000000] e820 remove range: 00000000000a0000 - 0000000000100000 (usable)
[    0.000000] last_pfn = 0x3fff0 max_arch_pfn = 0x400000000
[    0.000000] MTRR default type: uncachable
[    0.000000] MTRR fixed ranges enabled:
[    0.000000]   00000-9FFFF write-back
[    0.000000]   A0000-BFFFF uncachable
[    0.000000]   C0000-C7FFF write-protect
[    0.000000]   C8000-FFFFF uncachable
[    0.000000] MTRR variable ranges enabled:
[    0.000000]   0 base 0000000000 mask FFC0000000 write-back
[    0.000000]   1 disabled
[    0.000000]   2 disabled
[    0.000000]   3 disabled
[    0.000000]   4 disabled
[    0.000000]   5 disabled
[    0.000000]   6 disabled
[    0.000000]   7 disabled
[    0.000000] found SMP MP-table at [ffff8800000f5680] f5680
[    0.000000] initial memory mapped : 0 - 20000000
[    0.000000] Base memory trampoline at [ffff88000009a000] 9a000 size 20480
[    0.000000] init_memory_mapping: 0000000000000000-000000003fff0000
[    0.000000]  0000000000 - 003fe00000 page 2M
[    0.000000]  003fe00000 - 003fff0000 page 4k
[    0.000000] kernel direct mapping tables up to 3fff0000 @ 3ffed000-3fff0000
[    0.000000] ACPI: RSDP 00000000000f76f0 00014 (v00 Nvidia)
[    0.000000] ACPI: RSDT 000000003fff3040 00034 (v01 Nvidia AWRDACPI 42302E31 AWRD 00000000)
[    0.000000] ACPI: FACP 000000003fff30c0 00074 (v01 Nvidia AWRDACPI 42302E31 AWRD 00000000)
[    0.000000] ACPI: DSDT 000000003fff3180 06264 (v01 NVIDIA AWRDACPI 00001000 MSFT 0100000E)
[    0.000000] ACPI: FACS 000000003fff0000 00040
[    0.000000] ACPI: SRAT 000000003fff9500 000A0 (v01 AMD    HAMMER   00000001 AMD  00000001)
[    0.000000] ACPI: MCFG 000000003fff9600 0003C (v01 Nvidia AWRDACPI 42302E31 AWRD 00000000)
[    0.000000] ACPI: APIC 000000003fff9440 0007C (v01 Nvidia AWRDACPI 42302E31 AWRD 00000000)
[    0.000000] ACPI: Local APIC address 0xfee00000
[    0.000000] SRAT: PXM 0 -> APIC 0x00 -> Node 0
[    0.000000] SRAT: PXM 0 -> APIC 0x01 -> Node 0
[    0.000000] SRAT: Node 0 PXM 0 0-a0000
[    0.000000] SRAT: Node 0 PXM 0 100000-40000000
[    0.000000] NUMA: Node 0 [0,a0000) + [100000,40000000) -> [0,3fff0000)
[    0.000000] Initmem setup node 0 0000000000000000-000000003fff0000
[    0.000000]   NODE_DATA [000000003ffe8000 - 000000003ffecfff]
[    0.000000] Zone PFN ranges:
[    0.000000]   DMA      0x00000010 -> 0x00001000
[    0.000000]   DMA32    0x00001000 -> 0x00100000
[    0.000000]   Normal   empty
[    0.000000] Movable zone start PFN for each node
[    0.000000] early_node_map[2] active PFN ranges
[    0.000000]     0: 0x00000010 -> 0x0000009f
[    0.000000]     0: 0x00000100 -> 0x0003fff0
[    0.000000] On node 0 totalpages: 262015
[    0.000000]   DMA zone: 56 pages used for memmap
[    0.000000]   DMA zone: 5 pages reserved
[    0.000000]   DMA zone: 3922 pages, LIFO batch:0
[    0.000000]   DMA32 zone: 3528 pages used for memmap
[    0.000000]   DMA32 zone: 254504 pages, LIFO batch:31
[    0.000000] Nvidia board detected. Ignoring ACPI timer override.
[    0.000000] If you got timer trouble try acpi_use_timer_override
[    0.000000] ACPI: Local APIC address 0xfee00000
[    0.000000] ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x01] lapic_id[0x01] enabled)
[    0.000000] ACPI: LAPIC_NMI (acpi_id[0x00] high edge lint[0x1])
[    0.000000] ACPI: LAPIC_NMI (acpi_id[0x01] high edge lint[0x1])
[    0.000000] ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base[0])
[    0.000000] IOAPIC[0]: apic_id 2, version 17, address 0xfec00000, GSI 0-23
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
[    0.000000] ACPI: BIOS IRQ0 pin2 override ignored.
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 14 global_irq 14 high edge)
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 15 global_irq 15 high edge)
[    0.000000] ACPI: IRQ9 used by override.
[    0.000000] ACPI: IRQ14 used by override.
[    0.000000] ACPI: IRQ15 used by override.
[    0.000000] Using ACPI (MADT) for SMP configuration information
[    0.000000] SMP: Allowing 2 CPUs, 0 hotplug CPUs
[    0.000000] nr_irqs_gsi: 40
[    0.000000] PM: Registered nosave memory: 000000000009f000 - 00000000000a0000
[    0.000000] PM: Registered nosave memory: 00000000000a0000 - 00000000000f0000
[    0.000000] PM: Registered nosave memory: 00000000000f0000 - 0000000000100000
[    0.000000] Allocating PCI resources starting at 40000000 (gap: 40000000:a0000000)
[    0.000000] Booting paravirtualized kernel on bare hardware
[    0.000000] setup_percpu: NR_CPUS:8 nr_cpumask_bits:8 nr_cpu_ids:2 nr_node_ids:1
[    0.000000] PERCPU: Embedded 28 pages/cpu @ffff88003fc00000 s83264 r8192 d23232 u1048576
[    0.000000] pcpu-alloc: s83264 r8192 d23232 u1048576 alloc=1*2097152
[    0.000000] pcpu-alloc: [0] 0 1 
[    0.000000] Built 1 zonelists in Node order, mobility grouping on.  Total pages: 258426
[    0.000000] Policy zone: DMA32
[    0.000000] Kernel command line: root=/dev/sda6 earlyprintk=ttyS0,115200 console=ttyS0,115200 debug initcall_debug sysrq_always_enabled ignore_loglevel selinux=0 nmi_watchdog=1 panic=1 3
[    0.000000] sysrq: sysrq always enabled.
[    0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
[    0.000000] Memory: 1016188k/1048512k available (4471k kernel code, 452k absent, 31872k reserved, 2474k data, 616k init)
[    0.000000] SLUB: Genslabs=15, HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000] 	Hierarchical RCU autobalancing is disabled.
[    0.000000] 	RCU-based detection of stalled CPUs is disabled.
[    0.000000] NR_IRQS:512
[    0.000000] spurious 8259A interrupt: IRQ7.
[    0.000000] Console: colour VGA+ 80x25
[    0.000000] console [ttyS0] enabled, bootconsole disabled
[    0.000000] console [ttyS0] enabled, bootconsole disabled
[    0.000000] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
[    0.000000] ... MAX_LOCKDEP_SUBCLASSES:  8
[    0.000000] ... MAX_LOCK_DEPTH:          48
[    0.000000] ... MAX_LOCKDEP_KEYS:        8191
[    0.000000] ... CLASSHASH_SIZE:          4096
[    0.000000] ... MAX_LOCKDEP_ENTRIES:     16384
[    0.000000] ... MAX_LOCKDEP_CHAINS:      32768
[    0.000000] ... CHAINHASH_SIZE:          16384
[    0.000000]  memory used by lock dependency info: 5823 kB
[    0.000000]  per task-struct memory footprint: 1920 bytes
[    0.000000] ------------------------
[    0.000000] | Locking API testsuite:
[    0.000000] ----------------------------------------------------------------------------
[    0.000000]                                  | spin |wlock |rlock |mutex | wsem | rsem |
[    0.000000]   --------------------------------------------------------------------------
[    0.000000]                      A-A deadlock:failed|failed|  ok  |failed|failed|failed|
[    0.000000]                  A-B-B-A deadlock:failed|failed|  ok  |failed|failed|failed|
[    0.000000]              A-B-B-C-C-A deadlock:failed|failed|  ok  |failed|failed|failed|
[    0.000000]              A-B-C-A-B-C deadlock:failed|failed|  ok  |failed|failed|failed|
[    0.000000]          A-B-B-C-C-D-D-A deadlock:failed|failed|  ok  |failed|failed|failed|
[    0.000000]          A-B-C-D-B-D-D-A deadlock:failed|failed|  ok  |failed|failed|failed|
[    0.000000]          A-B-C-D-B-C-D-A deadlock:failed|failed|  ok  |failed|failed|failed|
[    0.000000]                     double unlock:  ok  |  ok  |  ok  |  ok  |  ok  |  ok  |
[    0.000000]                   initialize held:  ok  |  ok  |  ok  |  ok  |  ok  |  ok  |
[    0.000000]                  bad unlock order:  ok  |  ok  |  ok  |  ok  |  ok  |  ok  |
[    0.000000]   --------------------------------------------------------------------------
[    0.000000]               recursive read-lock:             |  ok  |             |failed|
[    0.000000]            recursive read-lock #2:             |  ok  |             |failed|
[    0.000000]             mixed read-write-lock:             |failed|             |failed|
[    0.000000]             mixed write-read-lock:             |failed|             |failed|
[    0.000000]   --------------------------------------------------------------------------
[    0.000000]      hard-irqs-on + irq-safe-A/12:failed|failed|  ok  |
[    0.000000]      soft-irqs-on + irq-safe-A/12:failed|failed|  ok  |
[    0.000000]      hard-irqs-on + irq-safe-A/21:failed|failed|  ok  |
[    0.000000]      soft-irqs-on + irq-safe-A/21:failed|failed|  ok  |
[    0.000000]        sirq-safe-A => hirqs-on/12:failed|failed|  ok  |
[    0.000000]        sirq-safe-A => hirqs-on/21:failed|failed|  ok  |
[    0.000000]          hard-safe-A + irqs-on/12:failed|failed|  ok  |
[    0.000000]          soft-safe-A + irqs-on/12:failed|failed|  ok  |
[    0.000000]          hard-safe-A + irqs-on/21:failed|failed|  ok  |
[    0.000000]          soft-safe-A + irqs-on/21:failed|failed|  ok  |
[    0.000000]     hard-safe-A + unsafe-B #1/123:failed|failed|  ok  |
[    0.000000]     soft-safe-A + unsafe-B #1/123:failed|failed|  ok  |
[    0.000000]     hard-safe-A + unsafe-B #1/132:failed|failed|  ok  |
[    0.000000]     soft-safe-A + unsafe-B #1/132:failed|failed|  ok  |
[    0.000000]     hard-safe-A + unsafe-B #1/213:failed|failed|  ok  |
[    0.000000]     soft-safe-A + unsafe-B #1/213:failed|failed|  ok  |
[    0.000000]     hard-safe-A + unsafe-B #1/231:failed|failed|  ok  |
[    0.000000]     soft-safe-A + unsafe-B #1/231:failed|failed|  ok  |
[    0.000000]     hard-safe-A + unsafe-B #1/312:failed|failed|  ok  |
[    0.000000]     soft-safe-A + unsafe-B #1/312:failed|failed|  ok  |
[    0.000000]     hard-safe-A + unsafe-B #1/321:failed|failed|  ok  |
[    0.000000]     soft-safe-A + unsafe-B #1/321:failed|failed|  ok  |
[    0.000000]     hard-safe-A + unsafe-B #2/123:failed|failed|  ok  |
[    0.000000]     soft-safe-A + unsafe-B #2/123:failed|failed|  ok  |
[    0.000000]     hard-safe-A + unsafe-B #2/132:failed|failed|  ok  |
[    0.000000]     soft-safe-A + unsafe-B #2/132:failed|failed|  ok  |
[    0.000000]     hard-safe-A + unsafe-B #2/213:failed|failed|  ok  |
[    0.000000]     soft-safe-A + unsafe-B #2/213:failed|failed|  ok  |
[    0.000000]     hard-safe-A + unsafe-B #2/231:failed|failed|  ok  |
[    0.000000]     soft-safe-A + unsafe-B #2/231:failed|failed|  ok  |
[    0.000000]     hard-safe-A + unsafe-B #2/312:failed|failed|  ok  |
[    0.000000]     soft-safe-A + unsafe-B #2/312:failed|failed|  ok  |
[    0.000000]     hard-safe-A + unsafe-B #2/321:failed|failed|  ok  |
[    0.000000]     soft-safe-A + unsafe-B #2/321:failed|failed|  ok  |
[    0.000000]       hard-irq lock-inversion/123:failed|failed|  ok  |
[    0.000000]       soft-irq lock-inversion/123:failed|failed|  ok  |
[    0.000000]       hard-irq lock-inversion/132:failed|failed|  ok  |
[    0.000000]       soft-irq lock-inversion/132:failed|failed|  ok  |
[    0.000000]       hard-irq lock-inversion/213:failed|failed|  ok  |
[    0.000000]       soft-irq lock-inversion/213:failed|failed|  ok  |
[    0.000000]       hard-irq lock-inversion/231:failed|failed|  ok  |
[    0.000000]       soft-irq lock-inversion/231:failed|failed|  ok  |
[    0.000000]       hard-irq lock-inversion/312:failed|failed|  ok  |
[    0.000000]       soft-irq lock-inversion/312:failed|failed|  ok  |
[    0.000000]       hard-irq lock-inversion/321:failed|failed|  ok  |
[    0.000000]       soft-irq lock-inversion/321:failed|failed|  ok  |
[    0.000000]       hard-irq read-recursion/123:  ok  |
[    0.000000]       soft-irq read-recursion/123:  ok  |
[    0.000000]       hard-irq read-recursion/132:  ok  |
[    0.000000]       soft-irq read-recursion/132:  ok  |
[    0.000000]       hard-irq read-recursion/213:  ok  |
[    0.000000]       soft-irq read-recursion/213:  ok  |
[    0.000000]       hard-irq read-recursion/231:  ok  |
[    0.000000]       soft-irq read-recursion/231:  ok  |
[    0.000000]       hard-irq read-recursion/312:  ok  |
[    0.000000]       soft-irq read-recursion/312:  ok  |
[    0.000000]       hard-irq read-recursion/321:  ok  |
[    0.000000]       soft-irq read-recursion/321:  ok  |
[    0.000000] --------------------------------------------------------
[    0.000000] 133 out of 218 testcases failed, as expected. |
[    0.000000] ----------------------------------------------------
[    0.000000] Fast TSC calibration using PIT
[    0.000000] Detected 2010.462 MHz processor.
[    0.000000] Marking TSC unstable due to TSCs unsynchronized
[    0.004999] Calibrating delay loop (skipped), value calculated using timer frequency.. 4020.92 BogoMIPS (lpj=2010462)
[    0.006003] pid_max: default: 32768 minimum: 301
[    0.007078] Security Framework initialized
[    0.008028] AppArmor: AppArmor initialized
[    0.009199] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes)
[    0.011596] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
[    0.012368] Mount-cache hash table entries: 256
[    0.013559] Initializing cgroup subsys debug
[    0.014004] Initializing cgroup subsys ns
[    0.015004] ns_cgroup deprecated: consider using the 'clone_children' flag without the ns_cgroup.
[    0.016002] Initializing cgroup subsys devices
[    0.017003] Initializing cgroup subsys freezer
[    0.018003] Initializing cgroup subsys perf_event
[    0.019062] tseg: 0000000000
[    0.020039] CPU: Physical Processor ID: 0
[    0.021002] CPU: Processor Core ID: 0
[    0.022002] mce: CPU supports 5 MCE banks
[    0.024275] ACPI: Core revision 20110316
[    0.031011] ftrace: allocating 16614 entries in 66 pages
[    0.034181] Setting APIC routing to flat
[    0.035346] ..TIMER: vector=0x30 apic1=0 pin1=0 apic2=-1 pin2=-1
[    0.046614] CPU0: AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ stepping 02
[    0.150985] calling  trace_init_flags_sys_exit+0x0/0x12 @ 1
[    0.150989] initcall trace_init_flags_sys_exit+0x0/0x12 returned 0 after 0 usecs
[    0.151988] calling  trace_init_flags_sys_enter+0x0/0x12 @ 1
[    0.152988] initcall trace_init_flags_sys_enter+0x0/0x12 returned 0 after 0 usecs
[    0.153988] calling  init_hw_perf_events+0x0/0xe64 @ 1
[    0.154986] Performance Events: AMD PMU driver.
[    0.156988] ... version:                0
[    0.157985] ... bit width:              48
[    0.158985] ... generic registers:      4
[    0.159985] ... value mask:             0000ffffffffffff
[    0.160985] ... max period:             00007fffffffffff
[    0.161986] ... fixed-purpose events:   0
[    0.162985] ... event mask:             000000000000000f
[    0.164007] initcall init_hw_perf_events+0x0/0xe64 returned 0 after 8787 usecs
[    0.164987] calling  register_trigger_all_cpu_backtrace+0x0/0x14 @ 1
[    0.165987] initcall register_trigger_all_cpu_backtrace+0x0/0x14 returned 0 after 0 usecs
[    0.166986] calling  migration_init+0x0/0x6e @ 1
[    0.167988] initcall migration_init+0x0/0x6e returned 0 after 0 usecs
[    0.168985] calling  spawn_ksoftirqd+0x0/0x51 @ 1
[    0.170040] initcall spawn_ksoftirqd+0x0/0x51 returned 0 after 0 usecs
[    0.170986] calling  init_workqueues+0x0/0x379 @ 1
[    0.172125] initcall init_workqueues+0x0/0x379 returned 0 after 0 usecs
[    0.172985] calling  init_jump_label_module+0x0/0x12 @ 1
[    0.173985] initcall init_jump_label_module+0x0/0x12 returned 0 after 0 usecs
[    0.174984] calling  init_jump_label+0x0/0x103 @ 1
[    0.176151] initcall init_jump_label+0x0/0x103 returned 0 after 0 usecs
[    0.176986] calling  init_call_single_data+0x0/0xaf @ 1
[    0.177985] initcall init_call_single_data+0x0/0xaf returned 0 after 0 usecs
[    0.178984] calling  cpu_stop_init+0x0/0xc4 @ 1
[    0.180026] initcall cpu_stop_init+0x0/0xc4 returned 0 after 0 usecs
[    0.180984] calling  relay_init+0x0/0x14 @ 1
[    0.181984] initcall relay_init+0x0/0x14 returned 0 after 0 usecs
[    0.182984] calling  tracer_alloc_buffers+0x0/0x1bf @ 1
[    0.184091] initcall tracer_alloc_buffers+0x0/0x1bf returned 0 after 0 usecs
[    0.184983] calling  init_trace_printk+0x0/0x12 @ 1
[    0.185983] initcall init_trace_printk+0x0/0x12 returned 0 after 0 usecs
[    0.187023] NMI watchdog enabled, takes one hw-pmu counter.
[    0.188187] lockdep: fixing up alternatives.
[    0.189078] Booting Node   0, Processors  #1 Ok.
[    0.190783] smpboot cpu 1: start_ip = 9a000
[    0.262105] NMI watchdog enabled, takes one hw-pmu counter.
[    0.263013] Brought up 2 CPUs
[    0.263973] Total of 2 processors activated (8040.83 BogoMIPS).
[    0.266244] devtmpfs: initialized
[    0.269008] device: 'platform': device_add
[    0.272985] PM: Adding info for No Bus:platform
[    0.278005] bus: 'platform': registered
[    0.281972] Registering sysdev class 'cpu'
[    0.285980] Registering sysdev class 'memory'
[    0.289983] Registering sys device of class 'memory'
[    0.294970] Registering sys device 'memory0'
[    0.298982] Registering sys device of class 'memory'
[    0.303968] Registering sys device 'memory1'
[    0.308977] Registering sys device of class 'memory'
[    0.313967] Registering sys device 'memory2'
[    0.317973] Registering sys device of class 'memory'
[    0.322965] Registering sys device 'memory3'
[    0.326971] Registering sys device of class 'memory'
[    0.331964] Registering sys device 'memory4'
[    0.335970] Registering sys device of class 'memory'
[    0.340962] Registering sys device 'memory5'
[    0.345969] Registering sys device of class 'memory'
[    0.350961] Registering sys device 'memory6'
[    0.354967] Registering sys device of class 'memory'
[    0.359959] Registering sys device 'memory7'
[    0.366318] calling  init_mmap_min_addr+0x0/0x27 @ 1
[    0.370958] initcall init_mmap_min_addr+0x0/0x27 returned 0 after 0 usecs
[    0.377957] calling  net_ns_init+0x0/0x1bd @ 1
[    0.381964] initcall net_ns_init+0x0/0x1bd returned 0 after 0 usecs
[    0.387956] calling  e820_mark_nvs_memory+0x0/0x3d @ 1
[    0.393953] PM: Registering ACPI NVS region at 3fff0000 (12288 bytes)
[    0.399954] initcall e820_mark_nvs_memory+0x0/0x3d returned 0 after 5858 usecs
[    0.406952] calling  pci_reboot_init+0x0/0x8 @ 1
[    0.411951] initcall pci_reboot_init+0x0/0x8 returned 0 after 0 usecs
[    0.417950] calling  init_lapic_sysfs+0x0/0x20 @ 1
[    0.422955] initcall init_lapic_sysfs+0x0/0x20 returned 0 after 0 usecs
[    0.429949] calling  init_smp_flush+0x0/0x4c @ 1
[    0.433951] initcall init_smp_flush+0x0/0x4c returned 0 after 0 usecs
[    0.440948] calling  alloc_frozen_cpus+0x0/0x10 @ 1
[    0.445946] initcall alloc_frozen_cpus+0x0/0x10 returned 0 after 0 usecs
[    0.451945] calling  ksysfs_init+0x0/0x91 @ 1
[    0.456953] initcall ksysfs_init+0x0/0x91 returned 0 after 0 usecs
[    0.462943] calling  init_jiffies_clocksource+0x0/0x12 @ 1
[    0.467954] initcall init_jiffies_clocksource+0x0/0x12 returned 0 after 0 usecs
[    0.475941] calling  pm_init+0x0/0x39 @ 1
[    0.479946] initcall pm_init+0x0/0x39 returned 0 after 0 usecs
[    0.485940] calling  pm_disk_init+0x0/0x19 @ 1
[    0.489941] initcall pm_disk_init+0x0/0x19 returned 0 after 0 usecs
[    0.495939] calling  swsusp_header_init+0x0/0x40 @ 1
[    0.500938] initcall swsusp_header_init+0x0/0x40 returned 0 after 0 usecs
[    0.507936] calling  init_zero_pfn+0x0/0x97 @ 1
[    0.512936] initcall init_zero_pfn+0x0/0x97 returned 0 after 0 usecs
[    0.518934] calling  fsnotify_init+0x0/0x34 @ 1
[    0.522938] initcall fsnotify_init+0x0/0x34 returned 0 after 0 usecs
[    0.529932] calling  filelock_init+0x0/0x2e @ 1
[    0.533943] initcall filelock_init+0x0/0x2e returned 0 after 0 usecs
[    0.540931] calling  init_script_binfmt+0x0/0x14 @ 1
[    0.545935] initcall init_script_binfmt+0x0/0x14 returned 0 after 0 usecs
[    0.551929] calling  init_elf_binfmt+0x0/0x14 @ 1
[    0.556928] initcall init_elf_binfmt+0x0/0x14 returned 0 after 0 usecs
[    0.563927] calling  init_compat_elf_binfmt+0x0/0x14 @ 1
[    0.568927] initcall init_compat_elf_binfmt+0x0/0x14 returned 0 after 0 usecs
[    0.575926] calling  debugfs_init+0x0/0x57 @ 1
[    0.580928] initcall debugfs_init+0x0/0x57 returned 0 after 0 usecs
[    0.586924] calling  securityfs_init+0x0/0x4e @ 1
[    0.591926] initcall securityfs_init+0x0/0x4e returned 0 after 0 usecs
[    0.597922] calling  random32_init+0x0/0xd5 @ 1
[    0.602922] initcall random32_init+0x0/0xd5 returned 0 after 0 usecs
[    0.608920] calling  test_atomic64+0x0/0x465 @ 1
[    0.613920] atomic64 test passed for x86-64 platform with CX8 and with SSE
[    0.619919] initcall test_atomic64+0x0/0x465 returned 0 after 5858 usecs
[    0.626917] calling  sfi_sysfs_init+0x0/0xda @ 1
[    0.631917] initcall sfi_sysfs_init+0x0/0xda returned 0 after 0 usecs
[    0.637917] calling  __gnttab_init+0x0/0x26 @ 1
[    0.642916] initcall __gnttab_init+0x0/0x26 returned -19 after 0 usecs
[    0.648915] calling  cpuidle_init+0x0/0x3d @ 1
[    0.653918] initcall cpuidle_init+0x0/0x3d returned 0 after 0 usecs
[    0.659913] calling  sock_init+0x0/0x87 @ 1
[    0.663978] initcall sock_init+0x0/0x87 returned 0 after 0 usecs
[    0.669912] calling  netpoll_init+0x0/0x41 @ 1
[    0.674911] initcall netpoll_init+0x0/0x41 returned 0 after 0 usecs
[    0.680910] calling  netlink_proto_init+0x0/0x1dc @ 1
[    0.685932] NET: Registered protocol family 16
[    0.689924] initcall netlink_proto_init+0x0/0x1dc returned 0 after 3905 usecs
[    0.697907] calling  bdi_class_init+0x0/0x49 @ 1
[    0.701906] device class 'bdi': registering
[    0.705978] initcall bdi_class_init+0x0/0x49 returned 0 after 3905 usecs
[    0.712905] calling  kobject_uevent_init+0x0/0x21 @ 1
[    0.717910] initcall kobject_uevent_init+0x0/0x21 returned 0 after 0 usecs
[    0.724903] calling  gpiolib_sysfs_init+0x0/0x92 @ 1
[    0.729901] device class 'gpio': registering
[    0.733923] initcall gpiolib_sysfs_init+0x0/0x92 returned 0 after 3905 usecs
[    0.740901] calling  pcibus_class_init+0x0/0x19 @ 1
[    0.745898] device class 'pci_bus': registering
[    0.750906] initcall pcibus_class_init+0x0/0x19 returned 0 after 4882 usecs
[    0.757898] calling  pci_driver_init+0x0/0x12 @ 1
[    0.761913] bus: 'pci': registered
[    0.765897] initcall pci_driver_init+0x0/0x12 returned 0 after 3905 usecs
[    0.772896] calling  rio_bus_init+0x0/0x30 @ 1
[    0.776896] device: 'rapidio': device_add
[    0.780897] PM: Adding info for No Bus:rapidio
[    0.785905] bus: 'rapidio': registered
[    0.788894] initcall rio_bus_init+0x0/0x30 returned 0 after 11716 usecs
[    0.795891] calling  xenbus_init+0x0/0x372 @ 1
[    0.799891] initcall xenbus_init+0x0/0x372 returned -19 after 0 usecs
[    0.806890] calling  tty_class_init+0x0/0x34 @ 1
[    0.810888] device class 'tty': registering
[    0.815896] initcall tty_class_init+0x0/0x34 returned 0 after 4882 usecs
[    0.821888] calling  vtconsole_class_init+0x0/0xe2 @ 1
[    0.827886] device class 'vtconsole': registering
[    0.831894] device: 'vtcon0': device_add
[    0.835912] PM: Adding info for No Bus:vtcon0
[    0.840914] initcall vtconsole_class_init+0x0/0xe2 returned 0 after 12693 usecs
[    0.847884] calling  wakeup_sources_debugfs_init+0x0/0x2b @ 1
[    0.853889] initcall wakeup_sources_debugfs_init+0x0/0x2b returned 0 after 0 usecs
[    0.860882] calling  register_node_type+0x0/0x2a @ 1
[    0.865880] Registering sysdev class 'node'
[    0.869891] initcall register_node_type+0x0/0x2a returned 0 after 3905 usecs
[    0.876880] calling  amd_postcore_init+0x0/0x154 @ 1
[    0.881883] node 0 link 0: io port [1000, fffff]
[    0.886878] TOM: 0000000040000000 aka 1024M
[    0.890877] node 0 link 0: mmio [e0000000, efffffff]
[    0.896072] node 0 link 0: mmio [feb00000, fec0ffff]
[    0.901063] node 0 link 0: mmio [a0000, bffff]
[    0.905874] node 0 link 0: mmio [40000000, fed3ffff]
[    0.910874] bus: [00, ff] on node 0 link 0
[    0.914873] bus: 00 index 0 [io  0x0000-0xffff]
[    0.918872] bus: 00 index 1 [mem 0x40000000-0xfcffffffff]
[    0.924871] bus: 00 index 2 [mem 0xfeb00000-0xfec0ffff]
[    0.929870] bus: 00 index 3 [mem 0x000a0000-0x000bffff]
[    0.934871] initcall amd_postcore_init+0x0/0x154 returned 0 after 51749 usecs
[    0.941870] calling  arch_kdebugfs_init+0x0/0x201 @ 1
[    0.946891] initcall arch_kdebugfs_init+0x0/0x201 returned 0 after 0 usecs
[    0.953868] calling  configure_trampolines+0x0/0x26 @ 1
[    0.958874] initcall configure_trampolines+0x0/0x26 returned 0 after 0 usecs
[    0.965866] calling  mtrr_if_init+0x0/0x64 @ 1
[    0.970868] initcall mtrr_if_init+0x0/0x64 returned 0 after 0 usecs
[    0.976865] calling  acpi_pci_init+0x0/0x57 @ 1
[    0.981869] ACPI: bus type pci registered
[    0.985864] initcall acpi_pci_init+0x0/0x57 returned 0 after 3905 usecs
[    0.991862] calling  setup_vcpu_hotplug_event+0x0/0x22 @ 1
[    0.997861] initcall setup_vcpu_hotplug_event+0x0/0x22 returned -19 after 0 usecs
[    1.004860] calling  register_xen_pci_notifier+0x0/0x31 @ 1
[    1.010859] initcall register_xen_pci_notifier+0x0/0x31 returned 0 after 0 usecs
[    1.017858] calling  dma_bus_init+0x0/0x3f @ 1
[    1.022857] device class 'dma': registering
[    1.026865] initcall dma_bus_init+0x0/0x3f returned 0 after 3905 usecs
[    1.032856] calling  dma_channel_table_init+0x0/0x117 @ 1
[    1.038894] initcall dma_channel_table_init+0x0/0x117 returned 0 after 0 usecs
[    1.045854] calling  pci_arch_init+0x0/0x66 @ 1
[    1.051168] PCI: MMCONFIG for domain 0000 [bus 00-ff] at [mem 0xe0000000-0xefffffff] (base 0xe0000000)
[    1.059852] PCI: MMCONFIG at [mem 0xe0000000-0xefffffff] reserved in E820
[    1.089168] PCI: Using configuration type 1 for base access
[    1.093851] initcall pci_arch_init+0x0/0x66 returned 0 after 41985 usecs
[    1.100848] calling  topology_init+0x0/0x96 @ 1
[    1.105844] Registering sys device of class 'node'
[    1.109851] Registering sys device 'node0'
[    1.114900] Registering sys device of class 'cpu'
[    1.118845] Registering sys device 'cpu0'
[    1.122849] Registering sys device of class 'cpu'
[    1.127842] Registering sys device 'cpu1'
[    1.131850] initcall topology_init+0x0/0x96 returned 0 after 25386 usecs
[    1.138840] calling  mtrr_init_finialize+0x0/0x36 @ 1
[    1.143839] initcall mtrr_init_finialize+0x0/0x36 returned 0 after 0 usecs
[    1.150840] calling  init_vdso_vars+0x0/0x238 @ 1
[    1.154851] initcall init_vdso_vars+0x0/0x238 returned 0 after 0 usecs
[    1.161837] calling  sysenter_setup+0x0/0x2e7 @ 1
[    1.166841] initcall sysenter_setup+0x0/0x2e7 returned 0 after 0 usecs
[    1.172835] calling  param_sysfs_init+0x0/0x189 @ 1
[    1.179444] initcall param_sysfs_init+0x0/0x189 returned 0 after 976 usecs
[    1.185835] calling  pm_sysrq_init+0x0/0x20 @ 1
[    1.190839] initcall pm_sysrq_init+0x0/0x20 returned 0 after 0 usecs
[    1.196831] calling  default_bdi_init+0x0/0xaf @ 1
[    1.202153] device: 'default': device_add
[    1.202850] PM: Adding info for No Bus:default
[    1.203916] initcall default_bdi_init+0x0/0xaf returned 0 after 1952 usecs
[    1.210830] calling  init_bio+0x0/0x11a @ 1
[    1.215928] bio: create slab <bio-0> at 0
[    1.216840] initcall init_bio+0x0/0x11a returned 0 after 976 usecs
[    1.217828] calling  fsnotify_notification_init+0x0/0x8b @ 1
[    1.218831] initcall fsnotify_notification_init+0x0/0x8b returned 0 after 0 usecs
[    1.219827] calling  cryptomgr_init+0x0/0x12 @ 1
[    1.220827] initcall cryptomgr_init+0x0/0x12 returned 0 after 0 usecs
[    1.221826] calling  blk_settings_init+0x0/0x2a @ 1
[    1.222826] initcall blk_settings_init+0x0/0x2a returned 0 after 0 usecs
[    1.223826] calling  blk_ioc_init+0x0/0x2a @ 1
[    1.224834] initcall blk_ioc_init+0x0/0x2a returned 0 after 0 usecs
[    1.225826] calling  blk_softirq_init+0x0/0x6d @ 1
[    1.226827] initcall blk_softirq_init+0x0/0x6d returned 0 after 0 usecs
[    1.227825] calling  blk_iopoll_setup+0x0/0x6d @ 1
[    1.228826] initcall blk_iopoll_setup+0x0/0x6d returned 0 after 0 usecs
[    1.229825] calling  genhd_device_init+0x0/0x84 @ 1
[    1.230824] device class 'block': registering
[    1.231882] initcall genhd_device_init+0x0/0x84 returned 0 after 976 usecs
[    1.238825] calling  blk_dev_integrity_init+0x0/0x2a @ 1
[    1.244825] initcall blk_dev_integrity_init+0x0/0x2a returned 0 after 0 usecs
[    1.251823] calling  gpiolib_debugfs_init+0x0/0x24 @ 1
[    1.256828] initcall gpiolib_debugfs_init+0x0/0x24 returned 0 after 0 usecs
[    1.263823] calling  pci_slot_init+0x0/0x50 @ 1
[    1.267823] initcall pci_slot_init+0x0/0x50 returned 0 after 0 usecs
[    1.274819] calling  acpi_init+0x0/0x1c4 @ 1
[    1.282857] ACPI: EC: Look up EC in DSDT
[    1.296189] ACPI: Interpreter enabled
[    1.299814] ACPI: (supports S0 S4 S5)
[    1.303376] ACPI: Using IOAPIC for interrupt routing
[    1.307858] bus: 'acpi': registered
[    1.311814] bus: 'acpi': add driver power
[    1.315859] device: 'LNXSYSTM:00': device_add
[    1.319817] bus: 'acpi': add device LNXSYSTM:00
[    1.324816] PM: Adding info for acpi:LNXSYSTM:00
[    1.328867] device: 'LNXCPU:00': device_add
[    1.333812] bus: 'acpi': add device LNXCPU:00
[    1.337812] PM: Adding info for acpi:LNXCPU:00
[    1.341836] device: 'LNXCPU:01': device_add
[    1.346810] bus: 'acpi': add device LNXCPU:01
[    1.350810] PM: Adding info for acpi:LNXCPU:01
[    1.354852] device: 'device:00': device_add
[    1.359808] bus: 'acpi': add device device:00
[    1.363808] PM: Adding info for acpi:device:00
[    1.368850] device: 'PNP0C0C:00': device_add
[    1.372806] bus: 'acpi': add device PNP0C0C:00
[    1.376806] PM: Adding info for acpi:PNP0C0C:00
[    1.381897] device: 'PNP0A08:00': device_add
[    1.385807] bus: 'acpi': add device PNP0A08:00
[    1.390805] PM: Adding info for acpi:PNP0A08:00
[    1.394860] device: 'PNP0C02:00': device_add
[    1.399802] bus: 'acpi': add device PNP0C02:00
[    1.403802] PM: Adding info for acpi:PNP0C02:00
[    1.408855] device: 'device:01': device_add
[    1.412800] bus: 'acpi': add device device:01
[    1.416801] PM: Adding info for acpi:device:01
[    1.421846] device: 'device:02': device_add
[    1.425798] bus: 'acpi': add device device:02
[    1.429798] PM: Adding info for acpi:device:02
[    1.434841] device: 'device:03': device_add
[    1.438796] bus: 'acpi': add device device:03
[    1.442799] PM: Adding info for acpi:device:03
[    1.447839] device: 'device:04': device_add
[    1.451794] bus: 'acpi': add device device:04
[    1.455794] PM: Adding info for acpi:device:04
[    1.460835] device: 'device:05': device_add
[    1.464795] bus: 'acpi': add device device:05
[    1.468792] PM: Adding info for acpi:device:05
[    1.473835] device: 'device:06': device_add
[    1.477790] bus: 'acpi': add device device:06
[    1.481790] PM: Adding info for acpi:device:06
[    1.486833] device: 'device:07': device_add
[    1.490788] bus: 'acpi': add device device:07
[    1.494789] PM: Adding info for acpi:device:07
[    1.499827] device: 'device:08': device_add
[    1.503786] bus: 'acpi': add device device:08
[    1.507786] PM: Adding info for acpi:device:08
[    1.512832] device: 'device:09': device_add
[    1.516784] bus: 'acpi': add device device:09
[    1.520785] PM: Adding info for acpi:device:09
[    1.525826] device: 'device:0a': device_add
[    1.529782] bus: 'acpi': add device device:0a
[    1.534783] PM: Adding info for acpi:device:0a
[    1.538825] device: 'device:0b': device_add
[    1.542779] bus: 'acpi': add device device:0b
[    1.547780] PM: Adding info for acpi:device:0b
[    1.551824] device: 'device:0c': device_add
[    1.555778] bus: 'acpi': add device device:0c
[    1.560779] PM: Adding info for acpi:device:0c
[    1.564837] device: 'device:0d': device_add
[    1.568776] bus: 'acpi': add device device:0d
[    1.573777] PM: Adding info for acpi:device:0d
[    1.577818] device: 'device:0e': device_add
[    1.581780] bus: 'acpi': add device device:0e
[    1.586775] PM: Adding info for acpi:device:0e
[    1.590815] device: 'device:0f': device_add
[    1.594772] bus: 'acpi': add device device:0f
[    1.599773] PM: Adding info for acpi:device:0f
[    1.603816] device: 'device:10': device_add
[    1.607770] bus: 'acpi': add device device:10
[    1.612771] PM: Adding info for acpi:device:10
[    1.616812] device: 'device:11': device_add
[    1.620768] bus: 'acpi': add device device:11
[    1.625769] PM: Adding info for acpi:device:11
[    1.629809] device: 'device:12': device_add
[    1.633766] bus: 'acpi': add device device:12
[    1.638767] PM: Adding info for acpi:device:12
[    1.642824] device: 'device:13': device_add
[    1.647767] bus: 'acpi': add device device:13
[    1.651766] PM: Adding info for acpi:device:13
[    1.655819] device: 'device:14': device_add
[    1.660762] bus: 'acpi': add device device:14
[    1.664765] PM: Adding info for acpi:device:14
[    1.668816] device: 'device:15': device_add
[    1.673760] bus: 'acpi': add device device:15
[    1.677762] PM: Adding info for acpi:device:15
[    1.681814] device: 'device:16': device_add
[    1.686758] bus: 'acpi': add device device:16
[    1.690759] PM: Adding info for acpi:device:16
[    1.694801] device: 'device:17': device_add
[    1.699756] bus: 'acpi': add device device:17
[    1.703757] PM: Adding info for acpi:device:17
[    1.708762] device: 'device:18': device_add
[    1.712754] bus: 'acpi': add device device:18
[    1.716759] PM: Adding info for acpi:device:18
[    1.721844] device: 'device:19': device_add
[    1.725753] bus: 'acpi': add device device:19
[    1.729753] PM: Adding info for acpi:device:19
[    1.736029] device: 'device:1a': device_add
[    1.739750] bus: 'acpi': add device device:1a
[    1.743751] PM: Adding info for acpi:device:1a
[    1.748810] device: 'device:1b': device_add
[    1.752748] bus: 'acpi': add device device:1b
[    1.756749] PM: Adding info for acpi:device:1b
[    1.761819] device: 'device:1c': device_add
[    1.765747] bus: 'acpi': add device device:1c
[    1.769748] PM: Adding info for acpi:device:1c
[    1.774814] device: 'device:1d': device_add
[    1.778744] bus: 'acpi': add device device:1d
[    1.783749] PM: Adding info for acpi:device:1d
[    1.787825] device: 'ATK0110:00': device_add
[    1.791742] bus: 'acpi': add device ATK0110:00
[    1.796743] PM: Adding info for acpi:ATK0110:00
[    1.801802] device: 'PNP0C0F:00': device_add
[    1.805740] bus: 'acpi': add device PNP0C0F:00
[    1.809741] PM: Adding info for acpi:PNP0C0F:00
[    1.814831] device: 'PNP0C0F:01': device_add
[    1.818738] bus: 'acpi': add device PNP0C0F:01
[    1.823739] PM: Adding info for acpi:PNP0C0F:01
[    1.827825] device: 'PNP0C0F:02': device_add
[    1.832736] bus: 'acpi': add device PNP0C0F:02
[    1.836740] PM: Adding info for acpi:PNP0C0F:02
[    1.841825] device: 'PNP0C0F:03': device_add
[    1.845734] bus: 'acpi': add device PNP0C0F:03
[    1.849735] PM: Adding info for acpi:PNP0C0F:03
[    1.854824] device: 'PNP0C0F:04': device_add
[    1.858732] bus: 'acpi': add device PNP0C0F:04
[    1.863733] PM: Adding info for acpi:PNP0C0F:04
[    1.867821] device: 'PNP0C0F:05': device_add
[    1.872730] bus: 'acpi': add device PNP0C0F:05
[    1.876731] PM: Adding info for acpi:PNP0C0F:05
[    1.881817] device: 'PNP0C0F:06': device_add
[    1.885728] bus: 'acpi': add device PNP0C0F:06
[    1.889732] PM: Adding info for acpi:PNP0C0F:06
[    1.894816] device: 'PNP0C0F:07': device_add
[    1.898726] bus: 'acpi': add device PNP0C0F:07
[    1.903727] PM: Adding info for acpi:PNP0C0F:07
[    1.907813] device: 'PNP0C0F:08': device_add
[    1.912724] bus: 'acpi': add device PNP0C0F:08
[    1.916725] PM: Adding info for acpi:PNP0C0F:08
[    1.921812] device: 'PNP0C0F:09': device_add
[    1.925722] bus: 'acpi': add device PNP0C0F:09
[    1.929723] PM: Adding info for acpi:PNP0C0F:09
[    1.934810] device: 'PNP0C0F:0a': device_add
[    1.938720] bus: 'acpi': add device PNP0C0F:0a
[    1.943724] PM: Adding info for acpi:PNP0C0F:0a
[    1.947808] device: 'PNP0C0F:0b': device_add
[    1.952718] bus: 'acpi': add device PNP0C0F:0b
[    1.956719] PM: Adding info for acpi:PNP0C0F:0b
[    1.961805] device: 'PNP0C0F:0c': device_add
[    1.965716] bus: 'acpi': add device PNP0C0F:0c
[    1.969717] PM: Adding info for acpi:PNP0C0F:0c
[    1.974803] device: 'PNP0C0F:0d': device_add
[    1.978714] bus: 'acpi': add device PNP0C0F:0d
[    1.983715] PM: Adding info for acpi:PNP0C0F:0d
[    1.987802] device: 'PNP0C0F:0e': device_add
[    1.992712] bus: 'acpi': add device PNP0C0F:0e
[    1.996716] PM: Adding info for acpi:PNP0C0F:0e
[    2.001800] device: 'PNP0C0F:0f': device_add
[    2.005710] bus: 'acpi': add device PNP0C0F:0f
[    2.009710] PM: Adding info for acpi:PNP0C0F:0f
[    2.014820] device: 'PNP0C0F:10': device_add
[    2.018708] bus: 'acpi': add device PNP0C0F:10
[    2.023709] PM: Adding info for acpi:PNP0C0F:10
[    2.027808] device: 'PNP0C0F:11': device_add
[    2.032706] bus: 'acpi': add device PNP0C0F:11
[    2.036707] PM: Adding info for acpi:PNP0C0F:11
[    2.041804] device: 'PNP0C0F:12': device_add
[    2.045704] bus: 'acpi': add device PNP0C0F:12
[    2.050707] PM: Adding info for acpi:PNP0C0F:12
[    2.054804] device: 'PNP0C0F:13': device_add
[    2.058702] bus: 'acpi': add device PNP0C0F:13
[    2.063703] PM: Adding info for acpi:PNP0C0F:13
[    2.068738] device: 'PNP0C0F:14': device_add
[    2.072700] bus: 'acpi': add device PNP0C0F:14
[    2.076701] PM: Adding info for acpi:PNP0C0F:14
[    2.081799] device: 'PNP0C0F:15': device_add
[    2.085698] bus: 'acpi': add device PNP0C0F:15
[    2.090699] PM: Adding info for acpi:PNP0C0F:15
[    2.094797] device: 'PNP0C0F:16': device_add
[    2.099696] bus: 'acpi': add device PNP0C0F:16
[    2.103700] PM: Adding info for acpi:PNP0C0F:16
[    2.108794] device: 'PNP0C0F:17': device_add
[    2.112694] bus: 'acpi': add device PNP0C0F:17
[    2.116707] PM: Adding info for acpi:PNP0C0F:17
[    2.121794] device: 'PNP0C0F:18': device_add
[    2.125693] bus: 'acpi': add device PNP0C0F:18
[    2.130695] PM: Adding info for acpi:PNP0C0F:18
[    2.134792] device: 'PNP0C0F:19': device_add
[    2.139690] bus: 'acpi': add device PNP0C0F:19
[    2.143691] PM: Adding info for acpi:PNP0C0F:19
[    2.148788] device: 'PNP0C0F:1a': device_add
[    2.152688] bus: 'acpi': add device PNP0C0F:1a
[    2.156692] PM: Adding info for acpi:PNP0C0F:1a
[    2.161787] device: 'PNP0C0F:1b': device_add
[    2.165686] bus: 'acpi': add device PNP0C0F:1b
[    2.170687] PM: Adding info for acpi:PNP0C0F:1b
[    2.174784] device: 'PNP0C0F:1c': device_add
[    2.179684] bus: 'acpi': add device PNP0C0F:1c
[    2.183685] PM: Adding info for acpi:PNP0C0F:1c
[    2.188783] device: 'PNP0C0F:1d': device_add
[    2.192682] bus: 'acpi': add device PNP0C0F:1d
[    2.197683] PM: Adding info for acpi:PNP0C0F:1d
[    2.201780] device: 'PNP0C0F:1e': device_add
[    2.205680] bus: 'acpi': add device PNP0C0F:1e
[    2.210684] PM: Adding info for acpi:PNP0C0F:1e
[    2.215708] device: 'PNP0C0F:1f': device_add
[    2.219678] bus: 'acpi': add device PNP0C0F:1f
[    2.223679] PM: Adding info for acpi:PNP0C0F:1f
[    2.228732] device: 'PNP0C02:01': device_add
[    2.232675] bus: 'acpi': add device PNP0C02:01
[    2.237677] PM: Adding info for acpi:PNP0C02:01
[    2.241722] device: 'PNP0000:00': device_add
[    2.245673] bus: 'acpi': add device PNP0000:00
[    2.250674] PM: Adding info for acpi:PNP0000:00
[    2.254716] device: 'PNP0200:00': device_add
[    2.259671] bus: 'acpi': add device PNP0200:00
[    2.263675] PM: Adding info for acpi:PNP0200:00
[    2.268715] device: 'PNP0100:00': device_add
[    2.272669] bus: 'acpi': add device PNP0100:00
[    2.277670] PM: Adding info for acpi:PNP0100:00
[    2.281715] device: 'PNP0B00:00': device_add
[    2.285667] bus: 'acpi': add device PNP0B00:00
[    2.290668] PM: Adding info for acpi:PNP0B00:00
[    2.294711] device: 'PNP0800:00': device_add
[    2.299665] bus: 'acpi': add device PNP0800:00
[    2.303666] PM: Adding info for acpi:PNP0800:00
[    2.308709] device: 'PNP0C04:00': device_add
[    2.312663] bus: 'acpi': add device PNP0C04:00
[    2.316667] PM: Adding info for acpi:PNP0C04:00
[    2.321879] device: 'PNP0700:00': device_add
[    2.325662] bus: 'acpi': add device PNP0700:00
[    2.330662] PM: Adding info for acpi:PNP0700:00
[    2.335793] device: 'PNP0501:00': device_add
[    2.339660] bus: 'acpi': add device PNP0501:00
[    2.343660] PM: Adding info for acpi:PNP0501:00
[    2.349127] device: 'PNP0401:00': device_add
[    2.353658] bus: 'acpi': add device PNP0401:00
[    2.357659] PM: Adding info for acpi:PNP0401:00
[    2.362773] device: 'PNP0303:00': device_add
[    2.366655] bus: 'acpi': add device PNP0303:00
[    2.371659] PM: Adding info for acpi:PNP0303:00
[    2.375889] device: 'PNPB006:00': device_add
[    2.380653] bus: 'acpi': add device PNPB006:00
[    2.384654] PM: Adding info for acpi:PNPB006:00
[    2.389861] device: 'PNPB02F:00': device_add
[    2.393651] bus: 'acpi': add device PNPB02F:00
[    2.397653] PM: Adding info for acpi:PNPB02F:00
[    2.402703] device: 'PNP0C02:02': device_add
[    2.406649] bus: 'acpi': add device PNP0C02:02
[    2.411651] PM: Adding info for acpi:PNP0C02:02
[    2.415724] device: 'PNP0C01:00': device_add
[    2.420646] bus: 'acpi': add device PNP0C01:00
[    2.424651] PM: Adding info for acpi:PNP0C01:00
[    2.429693] device: 'device:1e': device_add
[    2.433644] bus: 'acpi': add device device:1e
[    2.437646] PM: Adding info for acpi:device:1e
[    2.442683] device: 'PNP0C0B:00': device_add
[    2.446642] bus: 'acpi': add device PNP0C0B:00
[    2.450645] PM: Adding info for acpi:PNP0C0B:00
[    2.455670] device: 'LNXTHERM:00': device_add
[    2.459640] bus: 'acpi': add device LNXTHERM:00
[    2.464642] PM: Adding info for acpi:LNXTHERM:00
[    2.470045] device: 'LNXPWRBN:00': device_add
[    2.473637] bus: 'acpi': add device LNXPWRBN:00
[    2.478639] PM: Adding info for acpi:LNXPWRBN:00
[    2.482653] bus: 'acpi': add driver ec
[    2.486718] initcall acpi_init+0x0/0x1c4 returned 0 after 1179507 usecs
[    2.493634] calling  acpi_pci_root_init+0x0/0x28 @ 1
[    2.498630] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
[    2.507629] bus: 'acpi': add driver pci_root
[    2.511634] bus: 'acpi': driver_probe_device: matched device PNP0A08:00 with driver pci_root
[    2.520627] bus: 'acpi': really_probe: probing driver pci_root with device PNP0A08:00
[    2.528698] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
[    2.534666] device: 'pci0000:00': device_add
[    2.538639] PM: Adding info for No Bus:pci0000:00
[    2.543626] device: '0000:00': device_add
[    2.547636] PM: Adding info for No Bus:0000:00
[    2.551734] pci_root PNP0A08:00: host bridge window [io  0x0000-0x0cf7]
[    2.558623] pci_root PNP0A08:00: host bridge window [io  0x0d00-0xffff]
[    2.565621] pci_root PNP0A08:00: host bridge window [mem 0x000a0000-0x000bffff]
[    2.572620] pci_root PNP0A08:00: host bridge window [mem 0x000c0000-0x000dffff]
[    2.579619] pci_root PNP0A08:00: host bridge window [mem 0x40000000-0xfebfffff]
[    2.587648] pci 0000:00:00.0: [10de:005e] type 0 class 0x000580
[    2.593708] pci 0000:00:01.0: [10de:0050] type 0 class 0x000601
[    2.599654] HPET not enabled in BIOS. You might try hpet=force boot option
[    2.605627] pci 0000:00:01.1: [10de:0052] type 0 class 0x000c05
[    2.611624] pci 0000:00:01.1: reg 10: [io  0xdc00-0xdc1f]
[    2.617633] pci 0000:00:01.1: reg 20: [io  0x4c00-0x4c3f]
[    2.622617] pci 0000:00:01.1: reg 24: [io  0x4c40-0x4c7f]
[    2.628628] pci 0000:00:01.1: PME# supported from D3hot D3cold
[    2.633612] pci 0000:00:01.1: PME# disabled
[    2.638629] pci 0000:00:02.0: [10de:005a] type 0 class 0x000c03
[    2.644618] pci 0000:00:02.0: reg 10: [mem 0xda102000-0xda102fff]
[    2.650649] pci 0000:00:02.0: supports D1 D2
[    2.654607] pci 0000:00:02.0: PME# supported from D0 D1 D2 D3hot D3cold
[    2.661607] pci 0000:00:02.0: PME# disabled
[    2.665619] pci 0000:00:02.1: [10de:005b] type 0 class 0x000c03
[    2.671618] pci 0000:00:02.1: reg 10: [mem 0xfeb00000-0xfeb000ff]
[    2.677651] pci 0000:00:02.1: supports D1 D2
[    2.681603] pci 0000:00:02.1: PME# supported from D0 D1 D2 D3hot D3cold
[    2.688603] pci 0000:00:02.1: PME# disabled
[    2.692624] pci 0000:00:04.0: [10de:0059] type 0 class 0x000401
[    2.698610] pci 0000:00:04.0: reg 10: [io  0xd400-0xd4ff]
[    2.703605] pci 0000:00:04.0: reg 14: [io  0xd800-0xd8ff]
[    2.709604] pci 0000:00:04.0: reg 18: [mem 0xda101000-0xda101fff]
[    2.715629] pci 0000:00:04.0: supports D1 D2
[    2.719610] pci 0000:00:06.0: [10de:0053] type 0 class 0x000101
[    2.725625] pci 0000:00:06.0: reg 20: [io  0xf000-0xf00f]
[    2.730630] pci 0000:00:09.0: [10de:005c] type 1 class 0x000604
[    2.736624] pci 0000:00:0a.0: [10de:0057] type 0 class 0x000680
[    2.742604] pci 0000:00:0a.0: reg 10: [mem 0xda100000-0xda100fff]
[    2.748598] pci 0000:00:0a.0: reg 14: [io  0xd000-0xd007]
[    2.754628] pci 0000:00:0a.0: supports D1 D2
[    2.758591] pci 0000:00:0a.0: PME# supported from D0 D1 D2 D3hot D3cold
[    2.765591] pci 0000:00:0a.0: PME# disabled
[    2.769605] pci 0000:00:0b.0: [10de:005d] type 1 class 0x000604
[    2.775630] pci 0000:00:0b.0: PME# supported from D0 D1 D2 D3hot D3cold
[    2.782586] pci 0000:00:0b.0: PME# disabled
[    2.786606] pci 0000:00:0c.0: [10de:005d] type 1 class 0x000604
[    2.792627] pci 0000:00:0c.0: PME# supported from D0 D1 D2 D3hot D3cold
[    2.798586] pci 0000:00:0c.0: PME# disabled
[    2.803603] pci 0000:00:0d.0: [10de:005d] type 1 class 0x000604
[    2.808624] pci 0000:00:0d.0: PME# supported from D0 D1 D2 D3hot D3cold
[    2.815583] pci 0000:00:0d.0: PME# disabled
[    2.819601] pci 0000:00:0e.0: [10de:005d] type 1 class 0x000604
[    2.825621] pci 0000:00:0e.0: PME# supported from D0 D1 D2 D3hot D3cold
[    2.832581] pci 0000:00:0e.0: PME# disabled
[    2.836605] pci 0000:00:18.0: [1022:1100] type 0 class 0x000600
[    2.842614] pci 0000:00:18.1: [1022:1101] type 0 class 0x000600
[    2.848606] pci 0000:00:18.2: [1022:1102] type 0 class 0x000600
[    2.854605] pci 0000:00:18.3: [1022:1103] type 0 class 0x000600
[    2.860642] pci 0000:05:07.0: [10ec:8139] type 0 class 0x000200
[    2.866589] pci 0000:05:07.0: reg 10: [io  0xc000-0xc0ff]
[    2.871583] pci 0000:05:07.0: reg 14: [mem 0xda000000-0xda0000ff]
[    2.877624] pci 0000:05:07.0: supports D1 D2
[    2.882572] pci 0000:05:07.0: PME# supported from D1 D2 D3hot
[    2.887586] pci 0000:05:07.0: PME# disabled
[    2.892607] pci 0000:00:09.0: PCI bridge to [bus 05-05] (subtractive decode)
[    2.899571] pci 0000:00:09.0:   bridge window [io  0xc000-0xcfff]
[    2.905570] pci 0000:00:09.0:   bridge window [mem 0xda000000-0xda0fffff]
[    2.912569] pci 0000:00:09.0:   bridge window [mem 0xfff00000-0x000fffff pref] (disabled)
[    2.920567] pci 0000:00:09.0:   bridge window [io  0x0000-0x0cf7] (subtractive decode)
[    2.928566] pci 0000:00:09.0:   bridge window [io  0x0d00-0xffff] (subtractive decode)
[    2.936564] pci 0000:00:09.0:   bridge window [mem 0x000a0000-0x000bffff] (subtractive decode)
[    2.944563] pci 0000:00:09.0:   bridge window [mem 0x000c0000-0x000dffff] (subtractive decode)
[    2.953562] pci 0000:00:09.0:   bridge window [mem 0x40000000-0xfebfffff] (subtractive decode)
[    2.961596] pci 0000:00:0b.0: PCI bridge to [bus 04-04]
[    2.967562] pci 0000:00:0b.0:   bridge window [io  0xf000-0x0000] (disabled)
[    2.974559] pci 0000:00:0b.0:   bridge window [mem 0xfff00000-0x000fffff] (disabled)
[    2.981560] pci 0000:00:0b.0:   bridge window [mem 0xfff00000-0x000fffff pref] (disabled)
[    2.990591] pci 0000:00:0c.0: PCI bridge to [bus 03-03]
[    2.995558] pci 0000:00:0c.0:   bridge window [io  0xf000-0x0000] (disabled)
[    3.002555] pci 0000:00:0c.0:   bridge window [mem 0xfff00000-0x000fffff] (disabled)
[    3.010555] pci 0000:00:0c.0:   bridge window [mem 0xfff00000-0x000fffff pref] (disabled)
[    3.018586] pci 0000:00:0d.0: PCI bridge to [bus 02-02]
[    3.023553] pci 0000:00:0d.0:   bridge window [io  0xf000-0x0000] (disabled)
[    3.030551] pci 0000:00:0d.0:   bridge window [mem 0xfff00000-0x000fffff] (disabled)
[    3.038551] pci 0000:00:0d.0:   bridge window [mem 0xfff00000-0x000fffff pref] (disabled)
[    3.046592] pci 0000:01:00.0: [1002:5b60] type 0 class 0x000300
[    3.052556] pci 0000:01:00.0: reg 10: [mem 0xd0000000-0xd7ffffff pref]
[    3.059552] pci 0000:01:00.0: reg 14: [io  0xb000-0xb0ff]
[    3.064551] pci 0000:01:00.0: reg 18: [mem 0xd9000000-0xd900ffff]
[    3.070570] pci 0000:01:00.0: reg 30: [mem 0x00000000-0x0001ffff pref]
[    3.077563] pci 0000:01:00.0: supports D1 D2
[    3.081563] pci 0000:01:00.1: [1002:5b70] type 0 class 0x000380
[    3.087550] pci 0000:01:00.1: reg 10: [mem 0xd9010000-0xd901ffff]
[    3.093597] pci 0000:01:00.1: supports D1 D2
[    3.097553] pci 0000:00:0e.0: PCI bridge to [bus 01-01]
[    3.103541] pci 0000:00:0e.0:   bridge window [io  0xb000-0xbfff]
[    3.109539] pci 0000:00:0e.0:   bridge window [mem 0xd8000000-0xd9ffffff]
[    3.115539] pci 0000:00:0e.0:   bridge window [mem 0xd0000000-0xd7ffffff 64bit pref]
[    3.123552] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]
[    3.129763] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.HUB0._PRT]
[    3.136810] device: '0000:00:00.0': device_add
[    3.144230] bus: 'pci': add device 0000:00:00.0
[    3.148561] PM: Adding info for pci:0000:00:00.0
[    3.152544] device: '0000:00:01.0': device_add
[    3.160675] bus: 'pci': add device 0000:00:01.0
[    3.164557] PM: Adding info for pci:0000:00:01.0
[    3.169539] device: '0000:00:01.1': device_add
[    3.177121] bus: 'pci': add device 0000:00:01.1
[    3.181561] PM: Adding info for pci:0000:00:01.1
[    3.185536] device: '0000:00:02.0': device_add
[    3.193575] bus: 'pci': add device 0000:00:02.0
[    3.197562] PM: Adding info for pci:0000:00:02.0
[    3.202533] device: '0000:00:02.1': device_add
[    3.210033] bus: 'pci': add device 0000:00:02.1
[    3.214556] PM: Adding info for pci:0000:00:02.1
[    3.218531] device: '0000:00:04.0': device_add
[    3.226485] bus: 'pci': add device 0000:00:04.0
[    3.230553] PM: Adding info for pci:0000:00:04.0
[    3.235528] device: '0000:00:06.0': device_add
[    3.242971] bus: 'pci': add device 0000:00:06.0
[    3.247535] PM: Adding info for pci:0000:00:06.0
[    3.251525] device: '0000:00:09.0': device_add
[    3.259468] bus: 'pci': add device 0000:00:09.0
[    3.263543] PM: Adding info for pci:0000:00:09.0
[    3.268525] device: '0000:00:0a.0': device_add
[    3.275965] bus: 'pci': add device 0000:00:0a.0
[    3.280536] PM: Adding info for pci:0000:00:0a.0
[    3.284521] device: '0000:00:0b.0': device_add
[    3.292475] bus: 'pci': add device 0000:00:0b.0
[    3.296545] PM: Adding info for pci:0000:00:0b.0
[    3.301518] device: '0000:00:0c.0': device_add
[    3.308990] bus: 'pci': add device 0000:00:0c.0
[    3.313542] PM: Adding info for pci:0000:00:0c.0
[    3.317516] device: '0000:00:0d.0': device_add
[    3.325492] bus: 'pci': add device 0000:00:0d.0
[    3.329542] PM: Adding info for pci:0000:00:0d.0
[    3.334513] device: '0000:00:0e.0': device_add
[    3.342001] bus: 'pci': add device 0000:00:0e.0
[    3.346540] PM: Adding info for pci:0000:00:0e.0
[    3.350511] device: '0000:00:18.0': device_add
[    3.358502] bus: 'pci': add device 0000:00:18.0
[    3.362528] PM: Adding info for pci:0000:00:18.0
[    3.367509] device: '0000:00:18.1': device_add
[    3.374998] bus: 'pci': add device 0000:00:18.1
[    3.379526] PM: Adding info for pci:0000:00:18.1
[    3.383505] device: '0000:00:18.2': device_add
[    3.391487] bus: 'pci': add device 0000:00:18.2
[    3.395520] PM: Adding info for pci:0000:00:18.2
[    3.400503] device: '0000:00:18.3': device_add
[    3.407984] bus: 'pci': add device 0000:00:18.3
[    3.412521] PM: Adding info for pci:0000:00:18.3
[    3.416501] device: '0000:05:07.0': device_add
[    3.421495] bus: 'pci': add device 0000:05:07.0
[    3.425527] PM: Adding info for pci:0000:05:07.0
[    3.430499] device: '0000:05': device_add
[    3.434501] PM: Adding info for No Bus:0000:05
[    3.438497] device: '0000:04': device_add
[    3.442498] PM: Adding info for No Bus:0000:04
[    3.447495] device: '0000:03': device_add
[    3.451500] PM: Adding info for No Bus:0000:03
[    3.455494] device: '0000:02': device_add
[    3.459502] PM: Adding info for No Bus:0000:02
[    3.464492] device: '0000:01:00.0': device_add
[    3.468488] bus: 'pci': add device 0000:01:00.0
[    3.473510] PM: Adding info for pci:0000:01:00.0
[    3.477491] device: '0000:01:00.1': device_add
[    3.482487] bus: 'pci': add device 0000:01:00.1
[    3.486506] PM: Adding info for pci:0000:01:00.1
[    3.491491] device: '0000:01': device_add
[    3.495490] PM: Adding info for No Bus:0000:01
[    3.500480] driver: 'PNP0A08:00': driver_bound: bound to device 'pci_root'
[    3.506477] bus: 'acpi': really_probe: bound device PNP0A08:00 to driver pci_root
[    3.514533] initcall acpi_pci_root_init+0x0/0x28 returned 0 after 992035 usecs
[    3.521476] calling  acpi_pci_link_init+0x0/0x3e @ 1
[    3.526474] bus: 'acpi': add driver pci_link
[    3.530486] bus: 'acpi': driver_probe_device: matched device PNP0C0F:00 with driver pci_link
[    3.539472] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:00
[    3.547534] ACPI: PCI Interrupt Link [LNK1] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
[    3.555674] driver: 'PNP0C0F:00': driver_bound: bound to device 'pci_link'
[    3.562469] bus: 'acpi': really_probe: bound device PNP0C0F:00 to driver pci_link
[    3.570468] bus: 'acpi': driver_probe_device: matched device PNP0C0F:01 with driver pci_link
[    3.578465] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:01
[    3.586516] ACPI: PCI Interrupt Link [LNK2] (IRQs 3 4 5 7 9 10 *11 12 14 15)
[    3.593772] driver: 'PNP0C0F:01': driver_bound: bound to device 'pci_link'
[    3.600463] bus: 'acpi': really_probe: bound device PNP0C0F:01 to driver pci_link
[    3.607462] bus: 'acpi': driver_probe_device: matched device PNP0C0F:02 with driver pci_link
[    3.616459] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:02
[    3.624508] ACPI: PCI Interrupt Link [LNK3] (IRQs 3 4 *5 7 9 10 11 12 14 15)
[    3.631773] driver: 'PNP0C0F:02': driver_bound: bound to device 'pci_link'
[    3.638457] bus: 'acpi': really_probe: bound device PNP0C0F:02 to driver pci_link
[    3.645457] bus: 'acpi': driver_probe_device: matched device PNP0C0F:03 with driver pci_link
[    3.654454] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:03
[    3.662501] ACPI: PCI Interrupt Link [LNK4] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
[    3.670656] driver: 'PNP0C0F:03': driver_bound: bound to device 'pci_link'
[    3.677451] bus: 'acpi': really_probe: bound device PNP0C0F:03 to driver pci_link
[    3.685452] bus: 'acpi': driver_probe_device: matched device PNP0C0F:04 with driver pci_link
[    3.693448] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:04
[    3.701495] ACPI: PCI Interrupt Link [LNK5] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
[    3.709652] driver: 'PNP0C0F:04': driver_bound: bound to device 'pci_link'
[    3.716445] bus: 'acpi': really_probe: bound device PNP0C0F:04 to driver pci_link
[    3.724444] bus: 'acpi': driver_probe_device: matched device PNP0C0F:05 with driver pci_link
[    3.732442] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:05
[    3.740489] ACPI: PCI Interrupt Link [LUBA] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
[    3.748644] driver: 'PNP0C0F:05': driver_bound: bound to device 'pci_link'
[    3.755439] bus: 'acpi': really_probe: bound device PNP0C0F:05 to driver pci_link
[    3.763438] bus: 'acpi': driver_probe_device: matched device PNP0C0F:06 with driver pci_link
[    3.771436] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:06
[    3.779483] ACPI: PCI Interrupt Link [LUBB] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
[    3.787638] driver: 'PNP0C0F:06': driver_bound: bound to device 'pci_link'
[    3.794433] bus: 'acpi': really_probe: bound device PNP0C0F:06 to driver pci_link
[    3.802433] bus: 'acpi': driver_probe_device: matched device PNP0C0F:07 with driver pci_link
[    3.810430] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:07
[    3.818479] ACPI: PCI Interrupt Link [LMAC] (IRQs 3 4 5 7 9 10 *11 12 14 15)
[    3.826016] driver: 'PNP0C0F:07': driver_bound: bound to device 'pci_link'
[    3.832427] bus: 'acpi': really_probe: bound device PNP0C0F:07 to driver pci_link
[    3.840427] bus: 'acpi': driver_probe_device: matched device PNP0C0F:08 with driver pci_link
[    3.848424] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:08
[    3.856473] ACPI: PCI Interrupt Link [LACI] (IRQs *3 4 5 7 9 10 11 12 14 15)
[    3.864012] driver: 'PNP0C0F:08': driver_bound: bound to device 'pci_link'
[    3.870422] bus: 'acpi': really_probe: bound device PNP0C0F:08 to driver pci_link
[    3.878421] bus: 'acpi': driver_probe_device: matched device PNP0C0F:09 with driver pci_link
[    3.886419] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:09
[    3.894467] ACPI: PCI Interrupt Link [LMCI] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
[    3.902620] driver: 'PNP0C0F:09': driver_bound: bound to device 'pci_link'
[    3.909416] bus: 'acpi': really_probe: bound device PNP0C0F:09 to driver pci_link
[    3.917415] bus: 'acpi': driver_probe_device: matched device PNP0C0F:0a with driver pci_link
[    3.925412] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:0a
[    3.933460] ACPI: PCI Interrupt Link [LSMB] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
[    3.941614] driver: 'PNP0C0F:0a': driver_bound: bound to device 'pci_link'
[    3.948410] bus: 'acpi': really_probe: bound device PNP0C0F:0a to driver pci_link
[    3.956409] bus: 'acpi': driver_probe_device: matched device PNP0C0F:0b with driver pci_link
[    3.964406] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:0b
[    3.972454] ACPI: PCI Interrupt Link [LUB2] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
[    3.981421] driver: 'PNP0C0F:0b': driver_bound: bound to device 'pci_link'
[    3.987404] bus: 'acpi': really_probe: bound device PNP0C0F:0b to driver pci_link
[    3.995403] bus: 'acpi': driver_probe_device: matched device PNP0C0F:0c with driver pci_link
[    4.003400] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:0c
[    4.011453] ACPI: PCI Interrupt Link [LIDE] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
[    4.020424] driver: 'PNP0C0F:0c': driver_bound: bound to device 'pci_link'
[    4.027398] bus: 'acpi': really_probe: bound device PNP0C0F:0c to driver pci_link
[    4.034397] bus: 'acpi': driver_probe_device: matched device PNP0C0F:0d with driver pci_link
[    4.043394] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:0d
[    4.050443] ACPI: PCI Interrupt Link [LSID] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
[    4.059604] driver: 'PNP0C0F:0d': driver_bound: bound to device 'pci_link'
[    4.066392] bus: 'acpi': really_probe: bound device PNP0C0F:0d to driver pci_link
[    4.073391] bus: 'acpi': driver_probe_device: matched device PNP0C0F:0e with driver pci_link
[    4.082388] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:0e
[    4.089438] ACPI: PCI Interrupt Link [LFID] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
[    4.098598] driver: 'PNP0C0F:0e': driver_bound: bound to device 'pci_link'
[    4.105386] bus: 'acpi': really_probe: bound device PNP0C0F:0e to driver pci_link
[    4.112385] bus: 'acpi': driver_probe_device: matched device PNP0C0F:0f with driver pci_link
[    4.121382] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:0f
[    4.129434] ACPI: PCI Interrupt Link [LPCA] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
[    4.137585] driver: 'PNP0C0F:0f': driver_bound: bound to device 'pci_link'
[    4.144380] bus: 'acpi': really_probe: bound device PNP0C0F:0f to driver pci_link
[    4.151379] bus: 'acpi': driver_probe_device: matched device PNP0C0F:10 with driver pci_link
[    4.160376] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:10
[    4.168449] ACPI: PCI Interrupt Link [APC1] (IRQs 16) *0, disabled.
[    4.174581] driver: 'PNP0C0F:10': driver_bound: bound to device 'pci_link'
[    4.181374] bus: 'acpi': really_probe: bound device PNP0C0F:10 to driver pci_link
[    4.188373] bus: 'acpi': driver_probe_device: matched device PNP0C0F:11 with driver pci_link
[    4.197370] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:11
[    4.205440] ACPI: PCI Interrupt Link [APC2] (IRQs 17) *0
[    4.210953] driver: 'PNP0C0F:11': driver_bound: bound to device 'pci_link'
[    4.217369] bus: 'acpi': really_probe: bound device PNP0C0F:11 to driver pci_link
[    4.225368] bus: 'acpi': driver_probe_device: matched device PNP0C0F:12 with driver pci_link
[    4.233365] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:12
[    4.241433] ACPI: PCI Interrupt Link [APC3] (IRQs 18) *0
[    4.246951] driver: 'PNP0C0F:12': driver_bound: bound to device 'pci_link'
[    4.253363] bus: 'acpi': really_probe: bound device PNP0C0F:12 to driver pci_link
[    4.261362] bus: 'acpi': driver_probe_device: matched device PNP0C0F:13 with driver pci_link
[    4.269359] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:13
[    4.277428] ACPI: PCI Interrupt Link [APC4] (IRQs 19) *0, disabled.
[    4.283562] driver: 'PNP0C0F:13': driver_bound: bound to device 'pci_link'
[    4.290358] bus: 'acpi': really_probe: bound device PNP0C0F:13 to driver pci_link
[    4.298357] bus: 'acpi': driver_probe_device: matched device PNP0C0F:14 with driver pci_link
[    4.306354] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:14
[    4.314384] ACPI: PCI Interrupt Link [APC5] (IRQs *16), disabled.
[    4.320557] driver: 'PNP0C0F:14': driver_bound: bound to device 'pci_link'
[    4.327352] bus: 'acpi': really_probe: bound device PNP0C0F:14 to driver pci_link
[    4.334351] bus: 'acpi': driver_probe_device: matched device PNP0C0F:15 with driver pci_link
[    4.343348] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:15
[    4.351428] ACPI: PCI Interrupt Link [APCF] (IRQs 20 21 22 23) *0, disabled.
[    4.358552] driver: 'PNP0C0F:15': driver_bound: bound to device 'pci_link'
[    4.365346] bus: 'acpi': really_probe: bound device PNP0C0F:15 to driver pci_link
[    4.372345] bus: 'acpi': driver_probe_device: matched device PNP0C0F:16 with driver pci_link
[    4.381342] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:16
[    4.389418] ACPI: PCI Interrupt Link [APCG] (IRQs 20 21 22 23) *0, disabled.
[    4.396545] driver: 'PNP0C0F:16': driver_bound: bound to device 'pci_link'
[    4.403340] bus: 'acpi': really_probe: bound device PNP0C0F:16 to driver pci_link
[    4.410340] bus: 'acpi': driver_probe_device: matched device PNP0C0F:17 with driver pci_link
[    4.419337] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:17
[    4.427412] ACPI: PCI Interrupt Link [APCH] (IRQs 20 21 22 23) *0
[    4.433539] driver: 'PNP0C0F:17': driver_bound: bound to device 'pci_link'
[    4.440334] bus: 'acpi': really_probe: bound device PNP0C0F:17 to driver pci_link
[    4.447334] bus: 'acpi': driver_probe_device: matched device PNP0C0F:18 with driver pci_link
[    4.456331] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:18
[    4.464334] ACPI: PCI Interrupt Link [APCJ] (IRQs 20 21 22 23) *0
[    4.470534] driver: 'PNP0C0F:18': driver_bound: bound to device 'pci_link'
[    4.477329] bus: 'acpi': really_probe: bound device PNP0C0F:18 to driver pci_link
[    4.484328] bus: 'acpi': driver_probe_device: matched device PNP0C0F:19 with driver pci_link
[    4.493326] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:19
[    4.500401] ACPI: PCI Interrupt Link [APCK] (IRQs 20 21 22 23) *0, disabled.
[    4.508341] driver: 'PNP0C0F:19': driver_bound: bound to device 'pci_link'
[    4.515323] bus: 'acpi': really_probe: bound device PNP0C0F:19 to driver pci_link
[    4.522322] bus: 'acpi': driver_probe_device: matched device PNP0C0F:1a with driver pci_link
[    4.530320] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:1a
[    4.538394] ACPI: PCI Interrupt Link [APCS] (IRQs 20 21 22 23) *0, disabled.
[    4.546336] driver: 'PNP0C0F:1a': driver_bound: bound to device 'pci_link'
[    4.552317] bus: 'acpi': really_probe: bound device PNP0C0F:1a to driver pci_link
[    4.560317] bus: 'acpi': driver_probe_device: matched device PNP0C0F:1b with driver pci_link
[    4.568314] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:1b
[    4.576389] ACPI: PCI Interrupt Link [APCL] (IRQs 20 21 22 23) *0, disabled.
[    4.583516] driver: 'PNP0C0F:1b': driver_bound: bound to device 'pci_link'
[    4.590311] bus: 'acpi': really_probe: bound device PNP0C0F:1b to driver pci_link
[    4.598311] bus: 'acpi': driver_probe_device: matched device PNP0C0F:1c with driver pci_link
[    4.606308] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:1c
[    4.614384] ACPI: PCI Interrupt Link [APCZ] (IRQs 20 21 22 23) *0, disabled.
[    4.621518] driver: 'PNP0C0F:1c': driver_bound: bound to device 'pci_link'
[    4.628306] bus: 'acpi': really_probe: bound device PNP0C0F:1c to driver pci_link
[    4.636305] bus: 'acpi': driver_probe_device: matched device PNP0C0F:1d with driver pci_link
[    4.644302] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:1d
[    4.652377] ACPI: PCI Interrupt Link [APSI] (IRQs 20 21 22 23) *0, disabled.
[    4.659512] driver: 'PNP0C0F:1d': driver_bound: bound to device 'pci_link'
[    4.666300] bus: 'acpi': really_probe: bound device PNP0C0F:1d to driver pci_link
[    4.674299] bus: 'acpi': driver_probe_device: matched device PNP0C0F:1e with driver pci_link
[    4.682296] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:1e
[    4.690372] ACPI: PCI Interrupt Link [APSJ] (IRQs 20 21 22 23) *0, disabled.
[    4.697506] driver: 'PNP0C0F:1e': driver_bound: bound to device 'pci_link'
[    4.704294] bus: 'acpi': really_probe: bound device PNP0C0F:1e to driver pci_link
[    4.712293] bus: 'acpi': driver_probe_device: matched device PNP0C0F:1f with driver pci_link
[    4.720290] bus: 'acpi': really_probe: probing driver pci_link with device PNP0C0F:1f
[    4.728366] ACPI: PCI Interrupt Link [APCP] (IRQs 20 21 22 23) *0, disabled.
[    4.735493] driver: 'PNP0C0F:1f': driver_bound: bound to device 'pci_link'
[    4.742288] bus: 'acpi': really_probe: bound device PNP0C0F:1f to driver pci_link
[    4.749314] initcall acpi_pci_link_init+0x0/0x3e returned 0 after 1194153 usecs
[    4.757286] calling  pnp_init+0x0/0x12 @ 1
[    4.761306] bus: 'pnp': registered
[    4.764285] initcall pnp_init+0x0/0x12 returned 0 after 2929 usecs
[    4.770285] calling  xen_setup_shutdown_event+0x0/0x30 @ 1
[    4.776283] initcall xen_setup_shutdown_event+0x0/0x30 returned -19 after 0 usecs
[    4.783281] calling  balloon_init+0x0/0x148 @ 1
[    4.788281] initcall balloon_init+0x0/0x148 returned -19 after 0 usecs
[    4.794280] calling  xenbus_probe_backend_init+0x0/0x2a @ 1
[    4.800292] bus: 'xen-backend': registered
[    4.804279] initcall xenbus_probe_backend_init+0x0/0x2a returned 0 after 3905 usecs
[    4.812277] calling  misc_init+0x0/0xb6 @ 1
[    4.816281] device class 'misc': registering
[    4.820299] initcall misc_init+0x0/0xb6 returned 0 after 3905 usecs
[    4.827275] calling  init_scsi+0x0/0x6e @ 1
[    4.831366] device class 'scsi_host': registering
[    4.836282] bus: 'scsi': registered
[    4.839272] device class 'scsi_device': registering
[    4.844306] SCSI subsystem initialized
[    4.848273] initcall init_scsi+0x0/0x6e returned 0 after 16599 usecs
[    4.854271] calling  ata_init+0x0/0x452 @ 1
[    4.859090] device class 'ata_link': registering
[    4.859282] device class 'ata_port': registering
[    4.860276] device class 'ata_device': registering
[    4.861291] libata version 3.00 loaded.
[    4.862271] initcall ata_init+0x0/0x452 returned 0 after 3905 usecs
[    4.864269] calling  phy_init+0x0/0x2e @ 1
[    4.865268] device class 'mdio_bus': registering
[    4.866290] bus: 'mdio_bus': registered
[    4.867269] bus: 'mdio_bus': add driver Generic PHY
[    4.868280] initcall phy_init+0x0/0x2e returned 0 after 2929 usecs
[    4.869268] calling  usb_init+0x0/0x15c @ 1
[    4.870298] bus: 'usb': registered
[    4.871271] bus: 'usb': add driver usbfs
[    4.872290] usbcore: registered new interface driver usbfs
[    4.873268] device class 'usb_device': registering
[    4.874274] bus: 'usb': add driver hub
[    4.875282] usbcore: registered new interface driver hub
[    4.876318] bus: 'usb': add driver usb
[    4.880282] usbcore: registered new device driver usb
[    4.885267] initcall usb_init+0x0/0x15c returned 0 after 14646 usecs
[    4.891265] calling  serio_init+0x0/0x2e @ 1
[    4.896280] bus: 'serio': registered
[    4.899265] initcall serio_init+0x0/0x2e returned 0 after 2929 usecs
[    4.906263] calling  input_init+0x0/0x10b @ 1
[    4.910261] device class 'input': registering
[    4.914285] initcall input_init+0x0/0x10b returned 0 after 3905 usecs
[    4.921261] calling  pci_subsys_init+0x0/0x4a @ 1
[    4.925259] PCI: Using ACPI for IRQ routing
[    4.930261] PCI: pci_cache_line_size set to 64 bytes
[    4.935356] reserve RAM buffer: 000000000009f800 - 000000000009ffff 
[    4.941258] reserve RAM buffer: 000000003fff0000 - 000000003fffffff 
[    4.947259] initcall pci_subsys_init+0x0/0x4a returned 0 after 21481 usecs
[    4.954256] calling  proto_init+0x0/0x12 @ 1
[    4.959260] initcall proto_init+0x0/0x12 returned 0 after 0 usecs
[    4.965254] calling  net_dev_init+0x0/0x279 @ 1
[    4.969262] device class 'net': registering
[    4.973285] device: 'lo': device_add
[    4.977317] PM: Adding info for No Bus:lo
[    4.981318] initcall net_dev_init+0x0/0x279 returned 0 after 11716 usecs
[    4.988251] calling  neigh_init+0x0/0x71 @ 1
[    4.992250] initcall neigh_init+0x0/0x71 returned 0 after 0 usecs
[    4.998249] calling  fib_rules_init+0x0/0xa3 @ 1
[    5.003251] initcall fib_rules_init+0x0/0xa3 returned 0 after 0 usecs
[    5.009248] calling  genl_init+0x0/0x91 @ 1
[    5.013270] initcall genl_init+0x0/0x91 returned 0 after 0 usecs
[    5.019246] calling  wireless_nlevent_init+0x0/0x12 @ 1
[    5.025245] initcall wireless_nlevent_init+0x0/0x12 returned 0 after 0 usecs
[    5.032245] calling  print_ICs+0x0/0x53b @ 1
[    5.036243] initcall print_ICs+0x0/0x53b returned 0 after 0 usecs
[    5.042242] calling  hpet_late_init+0x0/0xf6 @ 1
[    5.047242] initcall hpet_late_init+0x0/0xf6 returned -19 after 0 usecs
[    5.053241] calling  init_amd_nbs+0x0/0xb6 @ 1
[    5.058309] initcall init_amd_nbs+0x0/0xb6 returned 0 after 0 usecs
[    5.064239] calling  clocksource_done_booting+0x0/0x5e @ 1
[    5.070240] initcall clocksource_done_booting+0x0/0x5e returned 0 after 0 usecs
[    5.077237] calling  ftrace_init_debugfs+0x0/0x1f2 @ 1
[    5.082302] initcall ftrace_init_debugfs+0x0/0x1f2 returned 0 after 0 usecs
[    5.089236] calling  rb_init_debugfs+0x0/0x2f @ 1
[    5.094239] initcall rb_init_debugfs+0x0/0x2f returned 0 after 0 usecs
[    5.100235] calling  tracer_init_debugfs+0x0/0x385 @ 1
[    5.106424] initcall tracer_init_debugfs+0x0/0x385 returned 0 after 976 usecs
[    5.113232] calling  init_trace_printk_function_export+0x0/0x2f @ 1
[    5.119235] initcall init_trace_printk_function_export+0x0/0x2f returned 0 after 0 usecs
[    5.127230] calling  event_trace_init+0x0/0x27c @ 1
[    5.137238] initcall event_trace_init+0x0/0x27c returned 0 after 4882 usecs
[    5.144228] calling  init_pipe_fs+0x0/0x4a @ 1
[    5.148302] initcall init_pipe_fs+0x0/0x4a returned 0 after 0 usecs
[    5.154226] calling  anon_inode_init+0x0/0x131 @ 1
[    5.159260] initcall anon_inode_init+0x0/0x131 returned 0 after 0 usecs
[    5.166224] calling  aa_create_aafs+0x0/0x100 @ 1
[    5.170285] AppArmor: AppArmor Filesystem Enabled
[    5.175223] initcall aa_create_aafs+0x0/0x100 returned 0 after 4882 usecs
[    5.182221] calling  blk_scsi_ioctl_init+0x0/0x289 @ 1
[    5.187221] initcall blk_scsi_ioctl_init+0x0/0x289 returned 0 after 0 usecs
[    5.194220] calling  acpi_event_init+0x0/0x7d @ 1
[    5.199238] initcall acpi_event_init+0x0/0x7d returned 0 after 0 usecs
[    5.205217] calling  pnp_system_init+0x0/0x12 @ 1
[    5.210218] bus: 'pnp': add driver system
[    5.214238] initcall pnp_system_init+0x0/0x12 returned 0 after 3905 usecs
[    5.221215] calling  pnpacpi_init+0x0/0x8c @ 1
[    5.225213] pnp: PnP ACPI init
[    5.228223] device: 'pnp0': device_add
[    5.232224] PM: Adding info for No Bus:pnp0
[    5.236213] ACPI: bus type pnp registered
[    5.240360] pnp 00:00: [bus 00-ff]
[    5.244212] pnp 00:00: [io  0x0cf8-0x0cff]
[    5.248210] pnp 00:00: [io  0x0000-0x0cf7 window]
[    5.253210] pnp 00:00: [io  0x0d00-0xffff window]
[    5.257209] pnp 00:00: [mem 0x000a0000-0x000bffff window]
[    5.263208] pnp 00:00: [mem 0x000c0000-0x000dffff window]
[    5.268207] pnp 00:00: [mem 0x40000000-0xfebfffff window]
[    5.274210] device: '00:00': device_add
[    5.278248] bus: 'pnp': add device 00:00
[    5.282214] PM: Adding info for pnp:00:00
[    5.286205] pnp 00:00: Plug and Play ACPI device, IDs PNP0a08 PNP0a03 (active)
[    5.293233] pnp 00:01: [io  0x4000-0x407f]
[    5.297203] pnp 00:01: [io  0x4080-0x40ff]
[    5.301206] pnp 00:01: [io  0x4400-0x447f]
[    5.305201] pnp 00:01: [io  0x4480-0x44ff]
[    5.309201] pnp 00:01: [io  0x4800-0x487f]
[    5.313200] pnp 00:01: [io  0x4880-0x48ff]
[    5.317243] device: '00:01': device_add
[    5.321218] bus: 'pnp': add device 00:01
[    5.325206] PM: Adding info for pnp:00:01
[    5.329204] bus: 'pnp': driver_probe_device: matched device 00:01 with driver system
[    5.337197] bus: 'pnp': really_probe: probing driver system with device 00:01
[    5.344202] system 00:01: [io  0x4000-0x407f] has been reserved
[    5.350196] system 00:01: [io  0x4080-0x40ff] has been reserved
[    5.356194] system 00:01: [io  0x4400-0x447f] has been reserved
[    5.362193] system 00:01: [io  0x4480-0x44ff] has been reserved
[    5.368192] system 00:01: [io  0x4800-0x487f] has been reserved
[    5.374192] system 00:01: [io  0x4880-0x48ff] has been reserved
[    5.380190] driver: '00:01': driver_bound: bound to device 'system'
[    5.386189] bus: 'pnp': really_probe: bound device 00:01 to driver system
[    5.393190] system 00:01: Plug and Play ACPI device, IDs PNP0c02 (active)
[    5.401057] pnp 00:02: [io  0x0010-0x001f]
[    5.405187] pnp 00:02: [io  0x0022-0x003f]
[    5.409185] pnp 00:02: [io  0x0044-0x005f]
[    5.413185] pnp 00:02: [io  0x0062-0x0063]
[    5.417184] pnp 00:02: [io  0x0065-0x006f]
[    5.421183] pnp 00:02: [io  0x0074-0x007f]
[    5.425187] pnp 00:02: [io  0x0091-0x0093]
[    5.429182] pnp 00:02: [io  0x00a2-0x00bf]
[    5.433182] pnp 00:02: [io  0x00e0-0x00ef]
[    5.437181] pnp 00:02: [io  0x04d0-0x04d1]
[    5.441181] pnp 00:02: [io  0x0800-0x0805]
[    5.446180] pnp 00:02: [io  0x0290-0x0297]
[    5.450216] device: '00:02': device_add
[    5.454191] bus: 'pnp': add device 00:02
[    5.457186] PM: Adding info for pnp:00:02
[    5.462184] bus: 'pnp': driver_probe_device: matched device 00:02 with driver system
[    5.469176] bus: 'pnp': really_probe: probing driver system with device 00:02
[    5.476181] system 00:02: [io  0x04d0-0x04d1] has been reserved
[    5.482175] system 00:02: [io  0x0800-0x0805] has been reserved
[    5.488174] system 00:02: [io  0x0290-0x0297] has been reserved
[    5.494172] driver: '00:02': driver_bound: bound to device 'system'
[    5.500171] bus: 'pnp': really_probe: bound device 00:02 to driver system
[    5.507173] system 00:02: Plug and Play ACPI device, IDs PNP0c02 (active)
[    5.514189] pnp 00:03: [dma 4]
[    5.517169] pnp 00:03: [io  0x0000-0x000f]
[    5.521169] pnp 00:03: [io  0x0080-0x0090]
[    5.525168] pnp 00:03: [io  0x0094-0x009f]
[    5.529167] pnp 00:03: [io  0x00c0-0x00df]
[    5.533169] device: '00:03': device_add
[    5.537231] bus: 'pnp': add device 00:03
[    5.541173] PM: Adding info for pnp:00:03
[    5.545172] pnp 00:03: Plug and Play ACPI device, IDs PNP0200 (active)
[    5.552181] pnp 00:04: [io  0x0070-0x0073]
[    5.556176] pnp 00:04: [irq 8]
[    5.559165] device: '00:04': device_add
[    5.563233] bus: 'pnp': add device 00:04
[    5.567169] PM: Adding info for pnp:00:04
[    5.571168] pnp 00:04: Plug and Play ACPI device, IDs PNP0b00 (active)
[    5.577172] pnp 00:05: [io  0x0061]
[    5.581161] device: '00:05': device_add
[    5.585225] bus: 'pnp': add device 00:05
[    5.589166] PM: Adding info for pnp:00:05
[    5.593165] pnp 00:05: Plug and Play ACPI device, IDs PNP0800 (active)
[    5.599170] pnp 00:06: [io  0x00f0-0x00ff]
[    5.603162] pnp 00:06: [irq 13]
[    5.607157] device: '00:06': device_add
[    5.610222] bus: 'pnp': add device 00:06
[    5.614162] PM: Adding info for pnp:00:06
[    5.618163] pnp 00:06: Plug and Play ACPI device, IDs PNP0c04 (active)
[    5.625372] pnp 00:07: [io  0x03f0-0x03f5]
[    5.629152] pnp 00:07: [io  0x03f7]
[    5.633157] pnp 00:07: [irq 6]
[    5.636151] pnp 00:07: [dma 2]
[    5.639168] device: '00:07': device_add
[    5.643224] bus: 'pnp': add device 00:07
[    5.647157] PM: Adding info for pnp:00:07
[    5.651157] pnp 00:07: Plug and Play ACPI device, IDs PNP0700 (active)
[    5.658175] pnp 00:08: [io  0x03f8-0x03ff]
[    5.662153] pnp 00:08: [irq 4]
[    5.665176] device: '00:08': device_add
[    5.669218] bus: 'pnp': add device 00:08
[    5.673153] PM: Adding info for pnp:00:08
[    5.677152] pnp 00:08: Plug and Play ACPI device, IDs PNP0501 (active)
[    5.684351] pnp 00:09: [io  0x0378-0x037f]
[    5.688144] pnp 00:09: [io  0x0778-0x077b]
[    5.692148] pnp 00:09: [irq 7]
[    5.695142] pnp 00:09: [dma 3]
[    5.698177] device: '00:09': device_add
[    5.702213] bus: 'pnp': add device 00:09
[    5.706148] PM: Adding info for pnp:00:09
[    5.710149] pnp 00:09: Plug and Play ACPI device, IDs PNP0401 (active)
[    5.717146] pnp 00:0a: [io  0x0060]
[    5.720138] pnp 00:0a: [io  0x0064]
[    5.724141] pnp 00:0a: [irq 1]
[    5.727140] device: '00:0a': device_add
[    5.730209] bus: 'pnp': add device 00:0a
[    5.734147] PM: Adding info for pnp:00:0a
[    5.738143] pnp 00:0a: Plug and Play ACPI device, IDs PNP0303 PNP030b (active)
[    5.746421] pnp 00:0b: [io  0x0330-0x0331]
[    5.750140] pnp 00:0b: [irq 10]
[    5.753151] device: '00:0b': device_add
[    5.757205] bus: 'pnp': add device 00:0b
[    5.761140] PM: Adding info for pnp:00:0b
[    5.765139] pnp 00:0b: Plug and Play ACPI device, IDs PNPb006 (active)
[    5.772382] pnp 00:0c: [io  0x0201]
[    5.775141] device: '00:0c': device_add
[    5.779203] bus: 'pnp': add device 00:0c
[    5.783136] PM: Adding info for pnp:00:0c
[    5.787135] pnp 00:0c: Plug and Play ACPI device, IDs PNPb02f (active)
[    5.794154] pnp 00:0d: [mem 0xe0000000-0xefffffff]
[    5.799157] device: '00:0d': device_add
[    5.803134] bus: 'pnp': add device 00:0d
[    5.806136] PM: Adding info for pnp:00:0d
[    5.811131] bus: 'pnp': driver_probe_device: matched device 00:0d with driver system
[    5.818123] bus: 'pnp': really_probe: probing driver system with device 00:0d
[    5.825127] system 00:0d: [mem 0xe0000000-0xefffffff] has been reserved
[    5.832121] driver: '00:0d': driver_bound: bound to device 'system'
[    5.838120] bus: 'pnp': really_probe: bound device 00:0d to driver system
[    5.845120] system 00:0d: Plug and Play ACPI device, IDs PNP0c02 (active)
[    5.852244] pnp 00:0e: [mem 0x000f0000-0x000f3fff]
[    5.857118] pnp 00:0e: [mem 0x000f4000-0x000f7fff]
[    5.862116] pnp 00:0e: [mem 0x000f8000-0x000fbfff]
[    5.866116] pnp 00:0e: [mem 0x000fc000-0x000fffff]
[    5.871115] pnp 00:0e: [mem 0x3fff0000-0x3fffffff]
[    5.876114] pnp 00:0e: [mem 0xffff0000-0xffffffff]
[    5.881114] pnp 00:0e: [mem 0x00000000-0x0009ffff]
[    5.886113] pnp 00:0e: [mem 0x00100000-0x3ffeffff]
[    5.890112] pnp 00:0e: [mem 0xfec00000-0xfec00fff]
[    5.895112] pnp 00:0e: [mem 0xfee00000-0xfeefffff]
[    5.900111] pnp 00:0e: [mem 0xfefff000-0xfeffffff]
[    5.905110] pnp 00:0e: [mem 0xfff80000-0xfff80fff]
[    5.909109] pnp 00:0e: [mem 0xfff90000-0xfffbffff]
[    5.914110] pnp 00:0e: [mem 0xfffed000-0xfffeffff]
[    5.919146] device: '00:0e': device_add
[    5.923185] bus: 'pnp': add device 00:0e
[    5.927115] PM: Adding info for pnp:00:0e
[    5.931112] bus: 'pnp': driver_probe_device: matched device 00:0e with driver system
[    5.939104] bus: 'pnp': really_probe: probing driver system with device 00:0e
[    5.946108] system 00:0e: [mem 0x000f0000-0x000f3fff] could not be reserved
[    5.953104] system 00:0e: [mem 0x000f4000-0x000f7fff] could not be reserved
[    5.960102] system 00:0e: [mem 0x000f8000-0x000fbfff] could not be reserved
[    5.967101] system 00:0e: [mem 0x000fc000-0x000fffff] could not be reserved
[    5.974100] system 00:0e: [mem 0x3fff0000-0x3fffffff] could not be reserved
[    5.981099] system 00:0e: [mem 0xffff0000-0xffffffff] has been reserved
[    5.987098] system 00:0e: [mem 0x00000000-0x0009ffff] could not be reserved
[    5.994097] system 00:0e: [mem 0x00100000-0x3ffeffff] could not be reserved
[    6.001096] system 00:0e: [mem 0xfec00000-0xfec00fff] could not be reserved
[    6.008095] system 00:0e: [mem 0xfee00000-0xfeefffff] has been reserved
[    6.015094] system 00:0e: [mem 0xfefff000-0xfeffffff] has been reserved
[    6.021093] system 00:0e: [mem 0xfff80000-0xfff80fff] has been reserved
[    6.028092] system 00:0e: [mem 0xfff90000-0xfffbffff] has been reserved
[    6.035090] system 00:0e: [mem 0xfffed000-0xfffeffff] has been reserved
[    6.041088] driver: '00:0e': driver_bound: bound to device 'system'
[    6.047088] bus: 'pnp': really_probe: bound device 00:0e to driver system
[    6.054088] system 00:0e: Plug and Play ACPI device, IDs PNP0c01 (active)
[    6.061101] pnp: PnP ACPI: found 15 devices
[    6.065085] ACPI: ACPI bus type pnp unregistered
[    6.070086] initcall pnpacpi_init+0x0/0x8c returned 0 after 825069 usecs
[    6.077084] calling  chr_dev_init+0x0/0xc1 @ 1
[    6.081103] device class 'mem': registering
[    6.085094] device: 'mem': device_add
[    6.089148] PM: Adding info for No Bus:mem
[    6.093098] device: 'kmem': device_add
[    6.097100] PM: Adding info for No Bus:kmem
[    6.101088] device: 'null': device_add
[    6.105102] PM: Adding info for No Bus:null
[    6.109087] device: 'port': device_add
[    6.113098] PM: Adding info for No Bus:port
[    6.117087] device: 'zero': device_add
[    6.121122] PM: Adding info for No Bus:zero
[    6.125085] device: 'full': device_add
[    6.129095] PM: Adding info for No Bus:full
[    6.133083] device: 'random': device_add
[    6.137096] PM: Adding info for No Bus:random
[    6.141082] device: 'urandom': device_add
[    6.145093] PM: Adding info for No Bus:urandom
[    6.150083] device: 'kmsg': device_add
[    6.153092] PM: Adding info for No Bus:kmsg
[    6.158081] device: 'tty': device_add
[    6.161092] PM: Adding info for No Bus:tty
[    6.165090] device: 'console': device_add
[    6.170089] PM: Adding info for No Bus:console
[    6.174083] device: 'tty0': device_add
[    6.178087] PM: Adding info for No Bus:tty0
[    6.182077] device class 'vc': registering
[    6.186076] device: 'vcs': device_add
[    6.190090] PM: Adding info for No Bus:vcs
[    6.194086] device: 'vcsa': device_add
[    6.198085] PM: Adding info for No Bus:vcsa
[    6.202073] device: 'vcs1': device_add
[    6.206085] PM: Adding info for No Bus:vcs1
[    6.210072] device: 'vcsa1': device_add
[    6.214085] PM: Adding info for No Bus:vcsa1
[    6.218082] device: 'tty1': device_add
[    6.222081] PM: Adding info for No Bus:tty1
[    6.226069] device: 'tty2': device_add
[    6.230079] PM: Adding info for No Bus:tty2
[    6.234068] device: 'tty3': device_add
[    6.238078] PM: Adding info for No Bus:tty3
[    6.242067] device: 'tty4': device_add
[    6.246080] PM: Adding info for No Bus:tty4
[    6.250065] device: 'tty5': device_add
[    6.254075] PM: Adding info for No Bus:tty5
[    6.258064] device: 'tty6': device_add
[    6.262073] PM: Adding info for No Bus:tty6
[    6.266063] device: 'tty7': device_add
[    6.270073] PM: Adding info for No Bus:tty7
[    6.274062] device: 'tty8': device_add
[    6.277072] PM: Adding info for No Bus:tty8
[    6.282063] device: 'tty9': device_add
[    6.285074] PM: Adding info for No Bus:tty9
[    6.290060] device: 'tty10': device_add
[    6.294070] PM: Adding info for No Bus:tty10
[    6.298058] device: 'tty11': device_add
[    6.302069] PM: Adding info for No Bus:tty11
[    6.306057] device: 'tty12': device_add
[    6.310068] PM: Adding info for No Bus:tty12
[    6.314058] device: 'tty13': device_add
[    6.318071] PM: Adding info for No Bus:tty13
[    6.322055] device: 'tty14': device_add
[    6.326065] PM: Adding info for No Bus:tty14
[    6.330053] device: 'tty15': device_add
[    6.334066] PM: Adding info for No Bus:tty15
[    6.338052] device: 'tty16': device_add
[    6.342063] PM: Adding info for No Bus:tty16
[    6.347051] device: 'tty17': device_add
[    6.350062] PM: Adding info for No Bus:tty17
[    6.355049] device: 'tty18': device_add
[    6.359087] PM: Adding info for No Bus:tty18
[    6.363049] device: 'tty19': device_add
[    6.367060] PM: Adding info for No Bus:tty19
[    6.371047] device: 'tty20': device_add
[    6.375058] PM: Adding info for No Bus:tty20
[    6.379046] device: 'tty21': device_add
[    6.383057] PM: Adding info for No Bus:tty21
[    6.387044] device: 'tty22': device_add
[    6.391059] PM: Adding info for No Bus:tty22
[    6.396043] device: 'tty23': device_add
[    6.399054] PM: Adding info for No Bus:tty23
[    6.404042] device: 'tty24': device_add
[    6.407053] PM: Adding info for No Bus:tty24
[    6.412043] device: 'tty25': device_add
[    6.416052] PM: Adding info for No Bus:tty25
[    6.420039] device: 'tty26': device_add
[    6.424051] PM: Adding info for No Bus:tty26
[    6.428038] device: 'tty27': device_add
[    6.432052] PM: Adding info for No Bus:tty27
[    6.436037] device: 'tty28': device_add
[    6.440048] PM: Adding info for No Bus:tty28
[    6.444038] device: 'tty29': device_add
[    6.448048] PM: Adding info for No Bus:tty29
[    6.452035] device: 'tty30': device_add
[    6.456046] PM: Adding info for No Bus:tty30
[    6.461033] device: 'tty31': device_add
[    6.464049] PM: Adding info for No Bus:tty31
[    6.469032] device: 'tty32': device_add
[    6.473044] PM: Adding info for No Bus:tty32
[    6.477031] device: 'tty33': device_add
[    6.481042] PM: Adding info for No Bus:tty33
[    6.485030] device: 'tty34': device_add
[    6.489041] PM: Adding info for No Bus:tty34
[    6.493028] device: 'tty35': device_add
[    6.497040] PM: Adding info for No Bus:tty35
[    6.501027] device: 'tty36': device_add
[    6.505041] PM: Adding info for No Bus:tty36
[    6.509026] device: 'tty37': device_add
[    6.513038] PM: Adding info for No Bus:tty37
[    6.518026] device: 'tty38': device_add
[    6.521037] PM: Adding info for No Bus:tty38
[    6.526023] device: 'tty39': device_add
[    6.530035] PM: Adding info for No Bus:tty39
[    6.534022] device: 'tty40': device_add
[    6.538039] PM: Adding info for No Bus:tty40
[    6.542023] device: 'tty41': device_add
[    6.546033] PM: Adding info for No Bus:tty41
[    6.550020] device: 'tty42': device_add
[    6.554032] PM: Adding info for No Bus:tty42
[    6.558018] device: 'tty43': device_add
[    6.562030] PM: Adding info for No Bus:tty43
[    6.566017] device: 'tty44': device_add
[    6.570029] PM: Adding info for No Bus:tty44
[    6.575018] device: 'tty45': device_add
[    6.578031] PM: Adding info for No Bus:tty45
[    6.583015] device: 'tty46': device_add
[    6.587027] PM: Adding info for No Bus:tty46
[    6.591013] device: 'tty47': device_add
[    6.595051] PM: Adding info for No Bus:tty47
[    6.599014] device: 'tty48': device_add
[    6.603025] PM: Adding info for No Bus:tty48
[    6.607011] device: 'tty49': device_add
[    6.611026] PM: Adding info for No Bus:tty49
[    6.615010] device: 'tty50': device_add
[    6.619022] PM: Adding info for No Bus:tty50
[    6.623009] device: 'tty51': device_add
[    6.627021] PM: Adding info for No Bus:tty51
[    6.632007] device: 'tty52': device_add
[    6.635019] PM: Adding info for No Bus:tty52
[    6.640006] device: 'tty53': device_add
[    6.644018] PM: Adding info for No Bus:tty53
[    6.648005] device: 'tty54': device_add
[    6.652020] PM: Adding info for No Bus:tty54
[    6.656004] device: 'tty55': device_add
[    6.660016] PM: Adding info for No Bus:tty55
[    6.664002] device: 'tty56': device_add
[    6.668015] PM: Adding info for No Bus:tty56
[    6.672003] device: 'tty57': device_add
[    6.676015] PM: Adding info for No Bus:tty57
[    6.680000] device: 'tty58': device_add
[    6.684016] PM: Adding info for No Bus:tty58
[    6.688999] device: 'tty59': device_add
[    6.692012] PM: Adding info for No Bus:tty59
[    6.696997] device: 'tty60': device_add
[    6.701011] PM: Adding info for No Bus:tty60
[    6.704998] device: 'tty61': device_add
[    6.709010] PM: Adding info for No Bus:tty61
[    6.712995] device: 'tty62': device_add
[    6.717008] PM: Adding info for No Bus:tty62
[    6.720995] device: 'tty63': device_add
[    6.725012] PM: Adding info for No Bus:tty63
[    6.729023] initcall chr_dev_init+0x0/0xc1 returned 0 after 632715 usecs
[    6.735987] calling  pcibios_assign_resources+0x0/0x76 @ 1
[    6.742074] pci 0000:00:09.0: PCI bridge to [bus 05-05]
[    6.742983] pci 0000:00:09.0:   bridge window [io  0xc000-0xcfff]
[    6.743983] pci 0000:00:09.0:   bridge window [mem 0xda000000-0xda0fffff]
[    6.744981] pci 0000:00:09.0:   bridge window [mem pref disabled]
[    6.745983] pci 0000:00:0b.0: PCI bridge to [bus 04-04]
[    6.746980] pci 0000:00:0b.0:   bridge window [io  disabled]
[    6.747981] pci 0000:00:0b.0:   bridge window [mem disabled]
[    6.748981] pci 0000:00:0b.0:   bridge window [mem pref disabled]
[    6.749982] pci 0000:00:0c.0: PCI bridge to [bus 03-03]
[    6.750979] pci 0000:00:0c.0:   bridge window [io  disabled]
[    6.751981] pci 0000:00:0c.0:   bridge window [mem disabled]
[    6.752980] pci 0000:00:0c.0:   bridge window [mem pref disabled]
[    6.753981] pci 0000:00:0d.0: PCI bridge to [bus 02-02]
[    6.754978] pci 0000:00:0d.0:   bridge window [io  disabled]
[    6.755980] pci 0000:00:0d.0:   bridge window [mem disabled]
[    6.756979] pci 0000:00:0d.0:   bridge window [mem pref disabled]
[    6.757985] pci 0000:01:00.0: BAR 6: assigned [mem 0xd8000000-0xd801ffff pref]
[    6.758979] pci 0000:00:0e.0: PCI bridge to [bus 01-01]
[    6.759979] pci 0000:00:0e.0:   bridge window [io  0xb000-0xbfff]
[    6.760980] pci 0000:00:0e.0:   bridge window [mem 0xd8000000-0xd9ffffff]
[    6.761979] pci 0000:00:0e.0:   bridge window [mem 0xd0000000-0xd7ffffff 64bit pref]
[    6.762988] pci 0000:00:09.0: setting latency timer to 64
[    6.763982] pci 0000:00:0b.0: setting latency timer to 64
[    6.764982] pci 0000:00:0c.0: setting latency timer to 64
[    6.765982] pci 0000:00:0d.0: setting latency timer to 64
[    6.766981] pci 0000:00:0e.0: setting latency timer to 64
[    6.767978] pci_bus 0000:00: resource 4 [io  0x0000-0x0cf7]
[    6.768977] pci_bus 0000:00: resource 5 [io  0x0d00-0xffff]
[    6.769977] pci_bus 0000:00: resource 6 [mem 0x000a0000-0x000bffff]
[    6.770977] pci_bus 0000:00: resource 7 [mem 0x000c0000-0x000dffff]
[    6.771977] pci_bus 0000:00: resource 8 [mem 0x40000000-0xfebfffff]
[    6.772976] pci_bus 0000:05: resource 0 [io  0xc000-0xcfff]
[    6.773977] pci_bus 0000:05: resource 1 [mem 0xda000000-0xda0fffff]
[    6.774976] pci_bus 0000:05: resource 4 [io  0x0000-0x0cf7]
[    6.775976] pci_bus 0000:05: resource 5 [io  0x0d00-0xffff]
[    6.776976] pci_bus 0000:05: resource 6 [mem 0x000a0000-0x000bffff]
[    6.777976] pci_bus 0000:05: resource 7 [mem 0x000c0000-0x000dffff]
[    6.778976] pci_bus 0000:05: resource 8 [mem 0x40000000-0xfebfffff]
[    6.779975] pci_bus 0000:01: resource 0 [io  0xb000-0xbfff]
[    6.780975] pci_bus 0000:01: resource 1 [mem 0xd8000000-0xd9ffffff]
[    6.781975] pci_bus 0000:01: resource 2 [mem 0xd0000000-0xd7ffffff 64bit pref]
[    6.782976] initcall pcibios_assign_resources+0x0/0x76 returned 0 after 40032 usecs
[    6.783976] calling  inet_init+0x0/0x204 @ 1
[    6.785013] NET: Registered protocol family 2
[    6.786098] IP route cache hash table entries: 32768 (order: 6, 262144 bytes)
[    6.787171] IPv4 FIB: Using LC-trie version 0.409
[    6.788328] TCP established hash table entries: 131072 (order: 9, 2097152 bytes)
[    6.790885] TCP bind hash table entries: 65536 (order: 10, 4194304 bytes)
[    6.795303] TCP: Hash tables configured (established 131072 bind 65536)
[    6.796009] TCP reno registered
[    6.796991] UDP hash table entries: 512 (order: 4, 81920 bytes)
[    6.798050] UDP-Lite hash table entries: 512 (order: 4, 81920 bytes)
[    6.799214] initcall inet_init+0x0/0x204 returned 0 after 13669 usecs
[    6.799974] calling  af_unix_init+0x0/0x52 @ 1
[    6.800987] NET: Registered protocol family 1
[    6.802983] initcall af_unix_init+0x0/0x52 returned 0 after 1952 usecs
[    6.803974] calling  pci_apply_final_quirks+0x0/0x105 @ 1
[    6.816083] pci 0000:00:00.0: Found enabled HT MSI Mapping
[    6.816976] pci 0000:00:0b.0: Found disabled HT MSI Mapping
[    6.817977] pci 0000:00:00.0: Found enabled HT MSI Mapping
[    6.818971] pci 0000:00:0b.0: Linking AER extended capability
[    6.820024] pci 0000:00:00.0: Found enabled HT MSI Mapping
[    6.820975] pci 0000:00:0c.0: Found disabled HT MSI Mapping
[    6.821976] pci 0000:00:00.0: Found enabled HT MSI Mapping
[    6.822969] pci 0000:00:0c.0: Linking AER extended capability
[    6.824030] pci 0000:00:00.0: Found enabled HT MSI Mapping
[    6.824974] pci 0000:00:0d.0: Found disabled HT MSI Mapping
[    6.825975] pci 0000:00:00.0: Found enabled HT MSI Mapping
[    6.826968] pci 0000:00:0d.0: Linking AER extended capability
[    6.828036] pci 0000:00:00.0: Found enabled HT MSI Mapping
[    6.828973] pci 0000:00:0e.0: Found disabled HT MSI Mapping
[    6.829975] pci 0000:00:00.0: Found enabled HT MSI Mapping
[    6.830968] pci 0000:00:0e.0: Linking AER extended capability
[    6.831990] pci 0000:01:00.0: Boot video device
[    6.832972] PCI: CLS 32 bytes, default 64
[    6.833968] initcall pci_apply_final_quirks+0x0/0x105 returned 0 after 28315 usecs
[    6.834968] calling  default_rootfs+0x0/0x68 @ 1
[    6.836025] initcall default_rootfs+0x0/0x68 returned 0 after 0 usecs
[    6.836968] calling  pci_iommu_init+0x0/0x54 @ 1
[    6.844022] DMA-API: preallocated 32768 debug entries
[    6.844965] DMA-API: debugging enabled by kernel config
[    6.845972] initcall pci_iommu_init+0x0/0x54 returned 0 after 7811 usecs
[    6.846966] calling  i8259A_init_ops+0x0/0x21 @ 1
[    6.847967] initcall i8259A_init_ops+0x0/0x21 returned 0 after 0 usecs
[    6.848965] calling  vsyscall_init+0x0/0x56 @ 1
[    6.849973] initcall vsyscall_init+0x0/0x56 returned 0 after 0 usecs
[    6.850965] calling  sbf_init+0x0/0xf2 @ 1
[    6.851965] initcall sbf_init+0x0/0xf2 returned 0 after 0 usecs
[    6.852965] calling  init_tsc_clocksource+0x0/0x5f @ 1
[    6.853975] initcall init_tsc_clocksource+0x0/0x5f returned 0 after 0 usecs
[    6.854965] calling  add_rtc_cmos+0x0/0x96 @ 1
[    6.855968] initcall add_rtc_cmos+0x0/0x96 returned 0 after 0 usecs
[    6.856964] calling  i8237A_init_ops+0x0/0x14 @ 1
[    6.858021] initcall i8237A_init_ops+0x0/0x14 returned 0 after 0 usecs
[    6.858967] calling  cache_sysfs_init+0x0/0x70 @ 1
[    6.860117] initcall cache_sysfs_init+0x0/0x70 returned 0 after 0 usecs
[    6.860965] calling  mcheck_init_device+0x0/0x106 @ 1
[    6.861964] Registering sysdev class 'machinecheck'
[    6.862971] Registering sys device of class 'machinecheck'
[    6.863964] Registering sys device 'machinecheck0'
[    6.864980] Registering sys device of class 'machinecheck'
[    6.865964] Registering sys device 'machinecheck1'
[    6.866994] device: 'mcelog': device_add
[    6.868021] PM: Adding info for No Bus:mcelog
[    6.868989] initcall mcheck_init_device+0x0/0x106 returned 0 after 6834 usecs
[    6.869964] calling  threshold_init_device+0x0/0x56 @ 1
[    6.870963] initcall threshold_init_device+0x0/0x56 returned 0 after 0 usecs
[    6.871962] calling  thermal_throttle_init_device+0x0/0xa2 @ 1
[    6.872962] initcall thermal_throttle_init_device+0x0/0xa2 returned 0 after 0 usecs
[    6.873962] calling  ioapic_init_ops+0x0/0x58 @ 1
[    6.874962] initcall ioapic_init_ops+0x0/0x58 returned 0 after 0 usecs
[    6.875962] calling  start_periodic_check_for_corruption+0x0/0x50 @ 1
[    6.876961] initcall start_periodic_check_for_corruption+0x0/0x50 returned 0 after 0 usecs
[    6.877961] calling  audit_classes_init+0x0/0xaf @ 1
[    6.878965] initcall audit_classes_init+0x0/0xaf returned 0 after 0 usecs
[    6.879961] calling  pt_dump_init+0x0/0x30 @ 1
[    6.880968] initcall pt_dump_init+0x0/0x30 returned 0 after 0 usecs
[    6.881960] calling  init_sched_debug_procfs+0x0/0x2c @ 1
[    6.882967] initcall init_sched_debug_procfs+0x0/0x2c returned 0 after 0 usecs
[    6.883960] calling  proc_schedstat_init+0x0/0x22 @ 1
[    6.884962] initcall proc_schedstat_init+0x0/0x22 returned 0 after 0 usecs
[    6.885960] calling  proc_execdomains_init+0x0/0x22 @ 1
[    6.886964] initcall proc_execdomains_init+0x0/0x22 returned 0 after 0 usecs
[    6.887959] calling  ioresources_init+0x0/0x3c @ 1
[    6.888963] initcall ioresources_init+0x0/0x3c returned 0 after 0 usecs
[    6.889959] calling  uid_cache_init+0x0/0x8c @ 1
[    6.890977] initcall uid_cache_init+0x0/0x8c returned 0 after 0 usecs
[    6.891958] calling  init_posix_timers+0x0/0x203 @ 1
[    6.892978] initcall init_posix_timers+0x0/0x203 returned 0 after 0 usecs
[    6.893958] calling  init_posix_cpu_timers+0x0/0xc2 @ 1
[    6.894958] initcall init_posix_cpu_timers+0x0/0xc2 returned 0 after 0 usecs
[    6.895958] calling  nsproxy_cache_init+0x0/0x2d @ 1
[    6.896959] initcall nsproxy_cache_init+0x0/0x2d returned 0 after 0 usecs
[    6.897958] calling  create_proc_profile+0x0/0x390 @ 1
[    6.898957] initcall create_proc_profile+0x0/0x390 returned 0 after 0 usecs
[    6.899957] calling  timekeeping_init_ops+0x0/0x14 @ 1
[    6.900958] initcall timekeeping_init_ops+0x0/0x14 returned 0 after 0 usecs
[    6.901957] calling  init_clocksource_sysfs+0x0/0x50 @ 1
[    6.902956] Registering sysdev class 'clocksource'
[    6.903964] Registering sys device of class 'clocksource'
[    6.904958] Registering sys device 'clocksource0'
[    6.905964] initcall init_clocksource_sysfs+0x0/0x50 returned 0 after 2929 usecs
[    6.906957] calling  init_timer_list_procfs+0x0/0x2c @ 1
[    6.907959] initcall init_timer_list_procfs+0x0/0x2c returned 0 after 0 usecs
[    6.908956] calling  init_tstats_procfs+0x0/0x2c @ 1
[    6.909958] initcall init_tstats_procfs+0x0/0x2c returned 0 after 0 usecs
[    6.910956] calling  lockdep_proc_init+0x0/0x42 @ 1
[    6.911960] initcall lockdep_proc_init+0x0/0x42 returned 0 after 0 usecs
[    6.912955] calling  futex_init+0x0/0x6f @ 1
[    6.913975] initcall futex_init+0x0/0x6f returned 0 after 0 usecs
[    6.914955] calling  proc_dma_init+0x0/0x22 @ 1
[    6.915957] initcall proc_dma_init+0x0/0x22 returned 0 after 0 usecs
[    6.916955] calling  proc_modules_init+0x0/0x22 @ 1
[    6.917957] initcall proc_modules_init+0x0/0x22 returned 0 after 0 usecs
[    6.918955] calling  kallsyms_init+0x0/0x25 @ 1
[    6.919957] initcall kallsyms_init+0x0/0x25 returned 0 after 0 usecs
[    6.920954] calling  snapshot_device_init+0x0/0x12 @ 1
[    6.921956] device: 'snapshot': device_add
[    6.922976] PM: Adding info for No Bus:snapshot
[    6.923963] initcall snapshot_device_init+0x0/0x12 returned 0 after 1952 usecs
[    6.924954] calling  crash_save_vmcoreinfo_init+0x0/0x46d @ 1
[    6.925978] initcall crash_save_vmcoreinfo_init+0x0/0x46d returned 0 after 0 usecs
[    6.926953] calling  crash_notes_memory_init+0x0/0x37 @ 1
[    6.927959] initcall crash_notes_memory_init+0x0/0x37 returned 0 after 0 usecs
[    6.928953] calling  audit_init+0x0/0x160 @ 1
[    6.929952] audit: initializing netlink socket (disabled)
[    6.930993] type=2000 audit(1302203725.930:1): initialized
[    6.931955] initcall audit_init+0x0/0x160 returned 0 after 1952 usecs
[    6.932952] calling  hung_task_init+0x0/0x53 @ 1
[    6.934017] initcall hung_task_init+0x0/0x53 returned 0 after 0 usecs
[    6.940955] calling  init_tracepoints+0x0/0x20 @ 1
[    6.945952] initcall init_tracepoints+0x0/0x20 returned 0 after 0 usecs
[    6.951950] calling  init_lstats_procfs+0x0/0x25 @ 1
[    6.956960] initcall init_lstats_procfs+0x0/0x25 returned 0 after 0 usecs
[    6.963948] calling  ftrace_mod_cmd_init+0x0/0x12 @ 1
[    6.968963] initcall ftrace_mod_cmd_init+0x0/0x12 returned 0 after 0 usecs
[    6.975946] calling  init_events+0x0/0x60 @ 1
[    6.979949] initcall init_events+0x0/0x60 returned 0 after 0 usecs
[    6.986945] calling  init_function_trace+0x0/0x3e @ 1
[    6.991946] initcall init_function_trace+0x0/0x3e returned 0 after 0 usecs
[    6.998943] calling  init_irqsoff_tracer+0x0/0x14 @ 1
[    7.003943] initcall init_irqsoff_tracer+0x0/0x14 returned 0 after 0 usecs
[    7.009941] calling  init_mmio_trace+0x0/0x12 @ 1
[    7.014942] initcall init_mmio_trace+0x0/0x12 returned 0 after 0 usecs
[    7.021939] calling  perf_event_sysfs_init+0x0/0x9b @ 1
[    7.026963] bus: 'event_source': registered
[    7.030940] device: 'cpu': device_add
[    7.034942] bus: 'event_source': add device cpu
[    7.038942] PM: Adding info for event_source:cpu
[    7.043944] device: 'breakpoint': device_add
[    7.047938] bus: 'event_source': add device breakpoint
[    7.052940] PM: Adding info for event_source:breakpoint
[    7.058940] device: 'tracepoint': device_add
[    7.062935] bus: 'event_source': add device tracepoint
[    7.067937] PM: Adding info for event_source:tracepoint
[    7.072938] device: 'software': device_add
[    7.076936] bus: 'event_source': add device software
[    7.081935] PM: Adding info for event_source:software
[    7.086936] initcall perf_event_sysfs_init+0x0/0x9b returned 0 after 58584 usecs
[    7.094929] calling  init_per_zone_wmark_min+0x0/0x67 @ 1
[    7.099989] initcall init_per_zone_wmark_min+0x0/0x67 returned 0 after 0 usecs
[    7.106926] calling  kswapd_init+0x0/0x75 @ 1
[    7.112304] initcall kswapd_init+0x0/0x75 returned 0 after 0 usecs
[    7.112926] calling  extfrag_debug_init+0x0/0x77 @ 1
[    7.113941] initcall extfrag_debug_init+0x0/0x77 returned 0 after 0 usecs
[    7.114925] calling  setup_vmstat+0x0/0xcc @ 1
[    7.115940] initcall setup_vmstat+0x0/0xcc returned 0 after 0 usecs
[    7.116925] calling  mm_sysfs_init+0x0/0x29 @ 1
[    7.117929] initcall mm_sysfs_init+0x0/0x29 returned 0 after 0 usecs
[    7.118925] calling  proc_vmalloc_init+0x0/0x25 @ 1
[    7.119929] initcall proc_vmalloc_init+0x0/0x25 returned 0 after 0 usecs
[    7.120923] calling  procswaps_init+0x0/0x22 @ 1
[    7.121926] initcall procswaps_init+0x0/0x22 returned 0 after 0 usecs
[    7.122923] calling  hugetlb_init+0x0/0x4e7 @ 1
[    7.123924] HugeTLB registered 2 MB page size, pre-allocated 0 pages
[    7.124942] initcall hugetlb_init+0x0/0x4e7 returned 0 after 976 usecs
[    7.125923] calling  ksm_init+0x0/0x15c @ 1
[    7.126961] initcall ksm_init+0x0/0x15c returned 0 after 0 usecs
[    7.132924] calling  slab_proc_init+0x0/0x25 @ 1
[    7.136927] initcall slab_proc_init+0x0/0x25 returned 0 after 0 usecs
[    7.143921] calling  slab_sysfs_init+0x0/0x111 @ 1
[    7.154311] initcall slab_sysfs_init+0x0/0x111 returned 0 after 4882 usecs
[    7.160918] calling  fcntl_init+0x0/0x2a @ 1
[    7.164925] initcall fcntl_init+0x0/0x2a returned 0 after 0 usecs
[    7.170916] calling  proc_filesystems_init+0x0/0x22 @ 1
[    7.175920] initcall proc_filesystems_init+0x0/0x22 returned 0 after 0 usecs
[    7.182914] calling  fsnotify_mark_init+0x0/0x40 @ 1
[    7.188894] initcall fsnotify_mark_init+0x0/0x40 returned 0 after 0 usecs
[    7.188914] calling  inotify_user_setup+0x0/0x70 @ 1
[    7.189948] initcall inotify_user_setup+0x0/0x70 returned 0 after 0 usecs
[    7.190913] calling  fanotify_user_setup+0x0/0x52 @ 1
[    7.192026] initcall fanotify_user_setup+0x0/0x52 returned 0 after 0 usecs
[    7.192915] calling  proc_locks_init+0x0/0x22 @ 1
[    7.193917] initcall proc_locks_init+0x0/0x22 returned 0 after 0 usecs
[    7.194912] calling  init_sys32_ioctl+0x0/0x28 @ 1
[    7.196019] initcall init_sys32_ioctl+0x0/0x28 returned 0 after 0 usecs
[    7.196913] calling  init_mbcache+0x0/0x14 @ 1
[    7.197913] initcall init_mbcache+0x0/0x14 returned 0 after 0 usecs
[    7.198912] calling  quota_init+0x0/0x26 @ 1
[    7.199919] initcall quota_init+0x0/0x26 returned 0 after 0 usecs
[    7.200911] calling  proc_cmdline_init+0x0/0x22 @ 1
[    7.201915] initcall proc_cmdline_init+0x0/0x22 returned 0 after 0 usecs
[    7.202912] calling  proc_consoles_init+0x0/0x22 @ 1
[    7.203914] initcall proc_consoles_init+0x0/0x22 returned 0 after 0 usecs
[    7.204911] calling  proc_cpuinfo_init+0x0/0x22 @ 1
[    7.205913] initcall proc_cpuinfo_init+0x0/0x22 returned 0 after 0 usecs
[    7.206910] calling  proc_devices_init+0x0/0x22 @ 1
[    7.207913] initcall proc_devices_init+0x0/0x22 returned 0 after 0 usecs
[    7.208910] calling  proc_interrupts_init+0x0/0x22 @ 1
[    7.209912] initcall proc_interrupts_init+0x0/0x22 returned 0 after 0 usecs
[    7.210910] calling  proc_loadavg_init+0x0/0x22 @ 1
[    7.211912] initcall proc_loadavg_init+0x0/0x22 returned 0 after 0 usecs
[    7.212910] calling  proc_meminfo_init+0x0/0x22 @ 1
[    7.213912] initcall proc_meminfo_init+0x0/0x22 returned 0 after 0 usecs
[    7.214909] calling  proc_stat_init+0x0/0x22 @ 1
[    7.215912] initcall proc_stat_init+0x0/0x22 returned 0 after 0 usecs
[    7.216909] calling  proc_uptime_init+0x0/0x22 @ 1
[    7.217911] initcall proc_uptime_init+0x0/0x22 returned 0 after 0 usecs
[    7.218908] calling  proc_version_init+0x0/0x22 @ 1
[    7.219911] initcall proc_version_init+0x0/0x22 returned 0 after 0 usecs
[    7.220908] calling  proc_softirqs_init+0x0/0x22 @ 1
[    7.221911] initcall proc_softirqs_init+0x0/0x22 returned 0 after 0 usecs
[    7.223908] calling  proc_kmsg_init+0x0/0x25 @ 1
[    7.224910] initcall proc_kmsg_init+0x0/0x25 returned 0 after 0 usecs
[    7.225908] calling  init_devpts_fs+0x0/0x4a @ 1
[    7.226972] initcall init_devpts_fs+0x0/0x4a returned 0 after 0 usecs
[    7.227907] calling  init_ext3_fs+0x0/0x76 @ 1
[    7.229095] initcall init_ext3_fs+0x0/0x76 returned 0 after 0 usecs
[    7.229908] calling  journal_init+0x0/0x9e @ 1
[    7.231235] initcall journal_init+0x0/0x9e returned 0 after 0 usecs
[    7.231907] calling  init_ramfs_fs+0x0/0x12 @ 1
[    7.232908] initcall init_ramfs_fs+0x0/0x12 returned 0 after 0 usecs
[    7.233906] calling  init_hugetlbfs_fs+0x0/0x95 @ 1
[    7.235957] initcall init_hugetlbfs_fs+0x0/0x95 returned 0 after 976 usecs
[    7.236906] calling  ipc_init+0x0/0x2f @ 1
[    7.237911] msgmni has been set to 1984
[    7.238912] initcall ipc_init+0x0/0x2f returned 0 after 976 usecs
[    7.239906] calling  key_proc_init+0x0/0x5e @ 1
[    7.240910] initcall key_proc_init+0x0/0x5e returned 0 after 0 usecs
[    7.241905] calling  selinux_nf_ip_init+0x0/0x69 @ 1
[    7.242905] initcall selinux_nf_ip_init+0x0/0x69 returned 0 after 0 usecs
[    7.243905] calling  init_sel_fs+0x0/0x65 @ 1
[    7.244905] initcall init_sel_fs+0x0/0x65 returned 0 after 0 usecs
[    7.245904] calling  selnl_init+0x0/0x4d @ 1
[    7.246912] initcall selnl_init+0x0/0x4d returned 0 after 0 usecs
[    7.247904] calling  sel_netif_init+0x0/0x73 @ 1
[    7.248904] initcall sel_netif_init+0x0/0x73 returned 0 after 0 usecs
[    7.249904] calling  sel_netnode_init+0x0/0x74 @ 1
[    7.250904] initcall sel_netnode_init+0x0/0x74 returned 0 after 0 usecs
[    7.251904] calling  sel_netport_init+0x0/0x74 @ 1
[    7.252903] initcall sel_netport_init+0x0/0x74 returned 0 after 0 usecs
[    7.253903] calling  aurule_init+0x0/0x37 @ 1
[    7.254903] initcall aurule_init+0x0/0x37 returned 0 after 0 usecs
[    7.255903] calling  crypto_wq_init+0x0/0x36 @ 1
[    7.256965] initcall crypto_wq_init+0x0/0x36 returned 0 after 0 usecs
[    7.263903] calling  crypto_algapi_init+0x0/0xd @ 1
[    7.267909] initcall crypto_algapi_init+0x0/0xd returned 0 after 0 usecs
[    7.274901] calling  skcipher_module_init+0x0/0x39 @ 1
[    7.279900] initcall skcipher_module_init+0x0/0x39 returned 0 after 0 usecs
[    7.286899] calling  chainiv_module_init+0x0/0x12 @ 1
[    7.291918] initcall chainiv_module_init+0x0/0x12 returned 0 after 0 usecs
[    7.298897] calling  eseqiv_module_init+0x0/0x12 @ 1
[    7.303897] initcall eseqiv_module_init+0x0/0x12 returned 0 after 0 usecs
[    7.310895] calling  md5_mod_init+0x0/0x12 @ 1
[    7.315908] initcall md5_mod_init+0x0/0x12 returned 0 after 976 usecs
[    7.315890] cryptomgr_test used greatest stack depth: 6136 bytes left
[    7.316895] calling  krng_mod_init+0x0/0x12 @ 1
[    7.317946] alg: No test for stdrng (krng)
[    7.318896] initcall krng_mod_init+0x0/0x12 returned 0 after 976 usecs
[    7.325899] calling  proc_genhd_init+0x0/0x3c @ 1
[    7.329901] initcall proc_genhd_init+0x0/0x3c returned 0 after 0 usecs
[    7.336893] calling  bsg_init+0x0/0x12e @ 1
[    7.340993] device class 'bsg': registering
[    7.344905] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
[    7.352889] initcall bsg_init+0x0/0x12e returned 0 after 11716 usecs
[    7.358888] calling  noop_init+0x0/0x14 @ 1
[    7.362897] io scheduler noop registered (default)
[    7.367887] initcall noop_init+0x0/0x14 returned 0 after 4882 usecs
[    7.373886] calling  list_sort_test+0x0/0x25a @ 1
[    7.378883] list_sort_test: start testing list_sort()
[    7.384194] initcall list_sort_test+0x0/0x25a returned 0 after 4882 usecs
[    7.390885] calling  percpu_counter_startup+0x0/0x19 @ 1
[    7.396886] initcall percpu_counter_startup+0x0/0x19 returned 0 after 0 usecs
[    7.403881] calling  lnw_gpio_init+0x0/0x45 @ 1
[    7.407881] bus: 'pci': add driver langwell_gpio
[    7.412924] bus: 'platform': add driver wp_gpio
[    7.416892] initcall lnw_gpio_init+0x0/0x45 returned 0 after 8787 usecs
[    7.423878] calling  timbgpio_init+0x0/0x12 @ 1
[    7.428876] bus: 'platform': add driver timb-gpio
[    7.432887] initcall timbgpio_init+0x0/0x12 returned 0 after 3905 usecs
[    7.439876] calling  pci_proc_init+0x0/0x69 @ 1
[    7.443958] initcall pci_proc_init+0x0/0x69 returned 0 after 976 usecs
[    7.450874] calling  ioapic_init+0x0/0x1b @ 1
[    7.454872] bus: 'pci': add driver ioapic
[    7.458894] initcall ioapic_init+0x0/0x1b returned 0 after 3905 usecs
[    7.465872] calling  intel_idle_init+0x0/0x38b @ 1
[    7.470872] initcall intel_idle_init+0x0/0x38b returned -19 after 0 usecs
[    7.476870] calling  acpi_reserve_resources+0x0/0xeb @ 1
[    7.482875] initcall acpi_reserve_resources+0x0/0xeb returned 0 after 0 usecs
[    7.489872] calling  irqrouter_init_ops+0x0/0x26 @ 1
[    7.494869] initcall irqrouter_init_ops+0x0/0x26 returned 0 after 0 usecs
[    7.501866] calling  xenbus_probe_initcall+0x0/0x39 @ 1
[    7.506865] initcall xenbus_probe_initcall+0x0/0x39 returned -19 after 0 usecs
[    7.513864] calling  hypervisor_subsys_init+0x0/0x25 @ 1
[    7.518863] initcall hypervisor_subsys_init+0x0/0x25 returned -19 after 0 usecs
[    7.526862] calling  hyper_sysfs_init+0x0/0xfb @ 1
[    7.531861] initcall hyper_sysfs_init+0x0/0xfb returned -19 after 0 usecs
[    7.537861] calling  pty_init+0x0/0x458 @ 1
[    7.541868] device: 'ptyp0': device_add
[    7.545923] PM: Adding info for No Bus:ptyp0
[    7.550873] device: 'ptyp1': device_add
[    7.554860] PM: Adding info for No Bus:ptyp1
[    7.558866] device: 'ptyp2': device_add
[    7.562880] PM: Adding info for No Bus:ptyp2
[    7.566864] device: 'ptyp3': device_add
[    7.570877] PM: Adding info for No Bus:ptyp3
[    7.574863] device: 'ptyp4': device_add
[    7.578875] PM: Adding info for No Bus:ptyp4
[    7.582862] device: 'ptyp5': device_add
[    7.586874] PM: Adding info for No Bus:ptyp5
[    7.590861] device: 'ptyp6': device_add
[    7.594872] PM: Adding info for No Bus:ptyp6
[    7.599863] device: 'ptyp7': device_add
[    7.602874] PM: Adding info for No Bus:ptyp7
[    7.607858] device: 'ptyp8': device_add
[    7.611871] PM: Adding info for No Bus:ptyp8
[    7.615857] device: 'ptyp9': device_add
[    7.619869] PM: Adding info for No Bus:ptyp9
[    7.623856] device: 'ptypa': device_add
[    7.627868] PM: Adding info for No Bus:ptypa
[    7.631854] device: 'ptypb': device_add
[    7.635869] PM: Adding info for No Bus:ptypb
[    7.639853] device: 'ptypc': device_add
[    7.643893] PM: Adding info for No Bus:ptypc
[    7.647853] device: 'ptypd': device_add
[    7.651865] PM: Adding info for No Bus:ptypd
[    7.656851] device: 'ptype': device_add
[    7.659864] PM: Adding info for No Bus:ptype
[    7.664850] device: 'ptypf': device_add
[    7.668856] PM: Adding info for No Bus:ptypf
[    7.672848] device: 'ptyq0': device_add
[    7.676863] PM: Adding info for No Bus:ptyq0
[    7.680848] device: 'ptyq1': device_add
[    7.684861] PM: Adding info for No Bus:ptyq1
[    7.688846] device: 'ptyq2': device_add
[    7.692859] PM: Adding info for No Bus:ptyq2
[    7.696844] device: 'ptyq3': device_add
[    7.700858] PM: Adding info for No Bus:ptyq3
[    7.704843] device: 'ptyq4': device_add
[    7.708858] PM: Adding info for No Bus:ptyq4
[    7.713841] device: 'ptyq5': device_add
[    7.716856] PM: Adding info for No Bus:ptyq5
[    7.721841] device: 'ptyq6': device_add
[    7.725850] PM: Adding info for No Bus:ptyq6
[    7.729842] device: 'ptyq7': device_add
[    7.733853] PM: Adding info for No Bus:ptyq7
[    7.737839] device: 'ptyq8': device_add
[    7.741852] PM: Adding info for No Bus:ptyq8
[    7.745837] device: 'ptyq9': device_add
[    7.749856] PM: Adding info for No Bus:ptyq9
[    7.753836] device: 'ptyqa': device_add
[    7.757850] PM: Adding info for No Bus:ptyqa
[    7.761834] device: 'ptyqb': device_add
[    7.765848] PM: Adding info for No Bus:ptyqb
[    7.770833] device: 'ptyqc': device_add
[    7.773849] PM: Adding info for No Bus:ptyqc
[    7.778832] device: 'ptyqd': device_add
[    7.782847] PM: Adding info for No Bus:ptyqd
[    7.786831] device: 'ptyqe': device_add
[    7.790845] PM: Adding info for No Bus:ptyqe
[    7.794829] device: 'ptyqf': device_add
[    7.798845] PM: Adding info for No Bus:ptyqf
[    7.802828] device: 'ptyr0': device_add
[    7.806842] PM: Adding info for No Bus:ptyr0
[    7.810829] device: 'ptyr1': device_add
[    7.814842] PM: Adding info for No Bus:ptyr1
[    7.818826] device: 'ptyr2': device_add
[    7.822843] PM: Adding info for No Bus:ptyr2
[    7.827825] device: 'ptyr3': device_add
[    7.830840] PM: Adding info for No Bus:ptyr3
[    7.835823] device: 'ptyr4': device_add
[    7.839838] PM: Adding info for No Bus:ptyr4
[    7.843822] device: 'ptyr5': device_add
[    7.847836] PM: Adding info for No Bus:ptyr5
[    7.851821] device: 'ptyr6': device_add
[    7.855838] PM: Adding info for No Bus:ptyr6
[    7.859822] device: 'ptyr7': device_add
[    7.863835] PM: Adding info for No Bus:ptyr7
[    7.867818] device: 'ptyr8': device_add
[    7.871833] PM: Adding info for No Bus:ptyr8
[    7.875817] device: 'ptyr9': device_add
[    7.879857] PM: Adding info for No Bus:ptyr9
[    7.884817] device: 'ptyra': device_add
[    7.887832] PM: Adding info for No Bus:ptyra
[    7.892815] device: 'ptyrb': device_add
[    7.896832] PM: Adding info for No Bus:ptyrb
[    7.900814] device: 'ptyrc': device_add
[    7.904829] PM: Adding info for No Bus:ptyrc
[    7.908812] device: 'ptyrd': device_add
[    7.912827] PM: Adding info for No Bus:ptyrd
[    7.916811] device: 'ptyre': device_add
[    7.920826] PM: Adding info for No Bus:ptyre
[    7.924810] device: 'ptyrf': device_add
[    7.928831] PM: Adding info for No Bus:ptyrf
[    7.933809] device: 'ptys0': device_add
[    7.936824] PM: Adding info for No Bus:ptys0
[    7.941810] device: 'ptys1': device_add
[    7.945823] PM: Adding info for No Bus:ptys1
[    7.949806] device: 'ptys2': device_add
[    7.953821] PM: Adding info for No Bus:ptys2
[    7.957804] device: 'ptys3': device_add
[    7.961820] PM: Adding info for No Bus:ptys3
[    7.965803] device: 'ptys4': device_add
[    7.969821] PM: Adding info for No Bus:ptys4
[    7.973803] device: 'ptys5': device_add
[    7.977818] PM: Adding info for No Bus:ptys5
[    7.981801] device: 'ptys6': device_add
[    7.985817] PM: Adding info for No Bus:ptys6
[    7.990802] device: 'ptys7': device_add
[    7.993816] PM: Adding info for No Bus:ptys7
[    7.998798] device: 'ptys8': device_add
[    8.002817] PM: Adding info for No Bus:ptys8
[    8.006797] device: 'ptys9': device_add
[    8.010813] PM: Adding info for No Bus:ptys9
[    8.014796] device: 'ptysa': device_add
[    8.018812] PM: Adding info for No Bus:ptysa
[    8.022795] device: 'ptysb': device_add
[    8.026810] PM: Adding info for No Bus:ptysb
[    8.030793] device: 'ptysc': device_add
[    8.034810] PM: Adding info for No Bus:ptysc
[    8.038792] device: 'ptysd': device_add
[    8.042811] PM: Adding info for No Bus:ptysd
[    8.047791] device: 'ptyse': device_add
[    8.050807] PM: Adding info for No Bus:ptyse
[    8.055790] device: 'ptysf': device_add
[    8.059808] PM: Adding info for No Bus:ptysf
[    8.063789] device: 'ptyt0': device_add
[    8.067805] PM: Adding info for No Bus:ptyt0
[    8.071789] device: 'ptyt1': device_add
[    8.075807] PM: Adding info for No Bus:ptyt1
[    8.079786] device: 'ptyt2': device_add
[    8.083803] PM: Adding info for No Bus:ptyt2
[    8.087785] device: 'ptyt3': device_add
[    8.091801] PM: Adding info for No Bus:ptyt3
[    8.095784] device: 'ptyt4': device_add
[    8.099800] PM: Adding info for No Bus:ptyt4
[    8.104782] device: 'ptyt5': device_add
[    8.107799] PM: Adding info for No Bus:ptyt5
[    8.112781] device: 'ptyt6': device_add
[    8.116826] PM: Adding info for No Bus:ptyt6
[    8.120782] device: 'ptyt7': device_add
[    8.124798] PM: Adding info for No Bus:ptyt7
[    8.128778] device: 'ptyt8': device_add
[    8.132806] PM: Adding info for No Bus:ptyt8
[    8.136777] device: 'ptyt9': device_add
[    8.140797] PM: Adding info for No Bus:ptyt9
[    8.144777] device: 'ptyta': device_add
[    8.148796] PM: Adding info for No Bus:ptyta
[    8.153775] device: 'ptytb': device_add
[    8.156792] PM: Adding info for No Bus:ptytb
[    8.161774] device: 'ptytc': device_add
[    8.165791] PM: Adding info for No Bus:ptytc
[    8.169772] device: 'ptytd': device_add
[    8.173790] PM: Adding info for No Bus:ptytd
[    8.177771] device: 'ptyte': device_add
[    8.181788] PM: Adding info for No Bus:ptyte
[    8.185770] device: 'ptytf': device_add
[    8.189792] PM: Adding info for No Bus:ptytf
[    8.193769] device: 'ptyu0': device_add
[    8.197786] PM: Adding info for No Bus:ptyu0
[    8.201769] device: 'ptyu1': device_add
[    8.205785] PM: Adding info for No Bus:ptyu1
[    8.210766] device: 'ptyu2': device_add
[    8.213783] PM: Adding info for No Bus:ptyu2
[    8.218765] device: 'ptyu3': device_add
[    8.222785] PM: Adding info for No Bus:ptyu3
[    8.226764] device: 'ptyu4': device_add
[    8.230782] PM: Adding info for No Bus:ptyu4
[    8.234762] device: 'ptyu5': device_add
[    8.238780] PM: Adding info for No Bus:ptyu5
[    8.242761] device: 'ptyu6': device_add
[    8.246779] PM: Adding info for No Bus:ptyu6
[    8.250762] device: 'ptyu7': device_add
[    8.254778] PM: Adding info for No Bus:ptyu7
[    8.258759] device: 'ptyu8': device_add
[    8.262779] PM: Adding info for No Bus:ptyu8
[    8.267758] device: 'ptyu9': device_add
[    8.270775] PM: Adding info for No Bus:ptyu9
[    8.275756] device: 'ptyua': device_add
[    8.279774] PM: Adding info for No Bus:ptyua
[    8.283755] device: 'ptyub': device_add
[    8.287773] PM: Adding info for No Bus:ptyub
[    8.291754] device: 'ptyuc': device_add
[    8.295775] PM: Adding info for No Bus:ptyuc
[    8.299752] device: 'ptyud': device_add
[    8.303771] PM: Adding info for No Bus:ptyud
[    8.307751] device: 'ptyue': device_add
[    8.311770] PM: Adding info for No Bus:ptyue
[    8.316750] device: 'ptyuf': device_add
[    8.319770] PM: Adding info for No Bus:ptyuf
[    8.324749] device: 'ptyv0': device_add
[    8.328767] PM: Adding info for No Bus:ptyv0
[    8.332755] device: 'ptyv1': device_add
[    8.336769] PM: Adding info for No Bus:ptyv1
[    8.340746] device: 'ptyv2': device_add
[    8.344766] PM: Adding info for No Bus:ptyv2
[    8.348745] device: 'ptyv3': device_add
[    8.352789] PM: Adding info for No Bus:ptyv3
[    8.356744] device: 'ptyv4': device_add
[    8.360764] PM: Adding info for No Bus:ptyv4
[    8.364742] device: 'ptyv5': device_add
[    8.368765] PM: Adding info for No Bus:ptyv5
[    8.373741] device: 'ptyv6': device_add
[    8.376761] PM: Adding info for No Bus:ptyv6
[    8.381742] device: 'ptyv7': device_add
[    8.385759] PM: Adding info for No Bus:ptyv7
[    8.389739] device: 'ptyv8': device_add
[    8.393758] PM: Adding info for No Bus:ptyv8
[    8.397737] device: 'ptyv9': device_add
[    8.401757] PM: Adding info for No Bus:ptyv9
[    8.405736] device: 'ptyva': device_add
[    8.409759] PM: Adding info for No Bus:ptyva
[    8.413735] device: 'ptyvb': device_add
[    8.417756] PM: Adding info for No Bus:ptyvb
[    8.421734] device: 'ptyvc': device_add
[    8.425754] PM: Adding info for No Bus:ptyvc
[    8.430732] device: 'ptyvd': device_add
[    8.433752] PM: Adding info for No Bus:ptyvd
[    8.438731] device: 'ptyve': device_add
[    8.442754] PM: Adding info for No Bus:ptyve
[    8.446730] device: 'ptyvf': device_add
[    8.450752] PM: Adding info for No Bus:ptyvf
[    8.454729] device: 'ptyw0': device_add
[    8.458749] PM: Adding info for No Bus:ptyw0
[    8.462729] device: 'ptyw1': device_add
[    8.466748] PM: Adding info for No Bus:ptyw1
[    8.470726] device: 'ptyw2': device_add
[    8.474747] PM: Adding info for No Bus:ptyw2
[    8.479725] device: 'ptyw3': device_add
[    8.482748] PM: Adding info for No Bus:ptyw3
[    8.487724] device: 'ptyw4': device_add
[    8.491745] PM: Adding info for No Bus:ptyw4
[    8.495722] device: 'ptyw5': device_add
[    8.499743] PM: Adding info for No Bus:ptyw5
[    8.503721] device: 'ptyw6': device_add
[    8.507742] PM: Adding info for No Bus:ptyw6
[    8.511723] device: 'ptyw7': device_add
[    8.515744] PM: Adding info for No Bus:ptyw7
[    8.519719] device: 'ptyw8': device_add
[    8.523740] PM: Adding info for No Bus:ptyw8
[    8.527718] device: 'ptyw9': device_add
[    8.531738] PM: Adding info for No Bus:ptyw9
[    8.536716] device: 'ptywa': device_add
[    8.539738] PM: Adding info for No Bus:ptywa
[    8.544716] device: 'ptywb': device_add
[    8.548736] PM: Adding info for No Bus:ptywb
[    8.552714] device: 'ptywc': device_add
[    8.556738] PM: Adding info for No Bus:ptywc
[    8.560713] device: 'ptywd': device_add
[    8.564734] PM: Adding info for No Bus:ptywd
[    8.568711] device: 'ptywe': device_add
[    8.572733] PM: Adding info for No Bus:ptywe
[    8.576710] device: 'ptywf': device_add
[    8.580734] PM: Adding info for No Bus:ptywf
[    8.584709] device: 'ptyx0': device_add
[    8.588760] PM: Adding info for No Bus:ptyx0
[    8.593712] device: 'ptyx1': device_add
[    8.596730] PM: Adding info for No Bus:ptyx1
[    8.601706] device: 'ptyx2': device_add
[    8.605728] PM: Adding info for No Bus:ptyx2
[    8.609705] device: 'ptyx3': device_add
[    8.613727] PM: Adding info for No Bus:ptyx3
[    8.617704] device: 'ptyx4': device_add
[    8.621726] PM: Adding info for No Bus:ptyx4
[    8.625703] device: 'ptyx5': device_add
[    8.629728] PM: Adding info for No Bus:ptyx5
[    8.633702] device: 'ptyx6': device_add
[    8.637724] PM: Adding info for No Bus:ptyx6
[    8.642703] device: 'ptyx7': device_add
[    8.645723] PM: Adding info for No Bus:ptyx7
[    8.650699] device: 'ptyx8': device_add
[    8.654721] PM: Adding info for No Bus:ptyx8
[    8.658697] device: 'ptyx9': device_add
[    8.662724] PM: Adding info for No Bus:ptyx9
[    8.666696] device: 'ptyxa': device_add
[    8.670720] PM: Adding info for No Bus:ptyxa
[    8.674695] device: 'ptyxb': device_add
[    8.678718] PM: Adding info for No Bus:ptyxb
[    8.682694] device: 'ptyxc': device_add
[    8.686717] PM: Adding info for No Bus:ptyxc
[    8.690693] device: 'ptyxd': device_add
[    8.694715] PM: Adding info for No Bus:ptyxd
[    8.699771] device: 'ptyxe': device_add
[    8.703742] PM: Adding info for No Bus:ptyxe
[    8.708105] device: 'ptyxf': device_add
[    8.708792] PM: Adding info for No Bus:ptyxf
[    8.709691] device: 'ptyy0': device_add
[    8.710723] PM: Adding info for No Bus:ptyy0
[    8.711691] device: 'ptyy1': device_add
[    8.712713] PM: Adding info for No Bus:ptyy1
[    8.713689] device: 'ptyy2': device_add
[    8.714712] PM: Adding info for No Bus:ptyy2
[    8.715689] device: 'ptyy3': device_add
[    8.717696] PM: Adding info for No Bus:ptyy3
[    8.718688] device: 'ptyy4': device_add
[    8.719716] PM: Adding info for No Bus:ptyy4
[    8.720688] device: 'ptyy5': device_add
[    8.721738] PM: Adding info for No Bus:ptyy5
[    8.722687] device: 'ptyy6': device_add
[    8.723712] PM: Adding info for No Bus:ptyy6
[    8.724687] device: 'ptyy7': device_add
[    8.725711] PM: Adding info for No Bus:ptyy7
[    8.726687] device: 'ptyy8': device_add
[    8.727711] PM: Adding info for No Bus:ptyy8
[    8.728687] device: 'ptyy9': device_add
[    8.729715] PM: Adding info for No Bus:ptyy9
[    8.730686] device: 'ptyya': device_add
[    8.731711] PM: Adding info for No Bus:ptyya
[    8.732686] device: 'ptyyb': device_add
[    8.733711] PM: Adding info for No Bus:ptyyb
[    8.734688] device: 'ptyyc': device_add
[    8.735710] PM: Adding info for No Bus:ptyyc
[    8.736685] device: 'ptyyd': device_add
[    8.737713] PM: Adding info for No Bus:ptyyd
[    8.738685] device: 'ptyye': device_add
[    8.739710] PM: Adding info for No Bus:ptyye
[    8.740684] device: 'ptyyf': device_add
[    8.741709] PM: Adding info for No Bus:ptyyf
[    8.742684] device: 'ptyz0': device_add
[    8.743709] PM: Adding info for No Bus:ptyz0
[    8.744685] device: 'ptyz1': device_add
[    8.745710] PM: Adding info for No Bus:ptyz1
[    8.746683] device: 'ptyz2': device_add
[    8.747712] PM: Adding info for No Bus:ptyz2
[    8.748683] device: 'ptyz3': device_add
[    8.749709] PM: Adding info for No Bus:ptyz3
[    8.750683] device: 'ptyz4': device_add
[    8.751708] PM: Adding info for No Bus:ptyz4
[    8.752682] device: 'ptyz5': device_add
[    8.753710] PM: Adding info for No Bus:ptyz5
[    8.754683] device: 'ptyz6': device_add
[    8.756701] PM: Adding info for No Bus:ptyz6
[    8.757682] device: 'ptyz7': device_add
[    8.758708] PM: Adding info for No Bus:ptyz7
[    8.759682] device: 'ptyz8': device_add
[    8.760708] PM: Adding info for No Bus:ptyz8
[    8.761681] device: 'ptyz9': device_add
[    8.762708] PM: Adding info for No Bus:ptyz9
[    8.763681] device: 'ptyza': device_add
[    8.764707] PM: Adding info for No Bus:ptyza
[    8.765681] device: 'ptyzb': device_add
[    8.766711] PM: Adding info for No Bus:ptyzb
[    8.767683] device: 'ptyzc': device_add
[    8.768707] PM: Adding info for No Bus:ptyzc
[    8.769680] device: 'ptyzd': device_add
[    8.770706] PM: Adding info for No Bus:ptyzd
[    8.771681] device: 'ptyze': device_add
[    8.772706] PM: Adding info for No Bus:ptyze
[    8.773679] device: 'ptyzf': device_add
[    8.774710] PM: Adding info for No Bus:ptyzf
[    8.775679] device: 'ptya0': device_add
[    8.776706] PM: Adding info for No Bus:ptya0
[    8.777681] device: 'ptya1': device_add
[    8.778706] PM: Adding info for No Bus:ptya1
[    8.779678] device: 'ptya2': device_add
[    8.780731] PM: Adding info for No Bus:ptya2
[    8.781679] device: 'ptya3': device_add
[    8.782706] PM: Adding info for No Bus:ptya3
[    8.783678] device: 'ptya4': device_add
[    8.784709] PM: Adding info for No Bus:ptya4
[    8.785678] device: 'ptya5': device_add
[    8.786707] PM: Adding info for No Bus:ptya5
[    8.787677] device: 'ptya6': device_add
[    8.788705] PM: Adding info for No Bus:ptya6
[    8.789677] device: 'ptya7': device_add
[    8.790705] PM: Adding info for No Bus:ptya7
[    8.792676] device: 'ptya8': device_add
[    8.793707] PM: Adding info for No Bus:ptya8
[    8.794676] device: 'ptya9': device_add
[    8.796705] PM: Adding info for No Bus:ptya9
[    8.797676] device: 'ptyaa': device_add
[    8.798704] PM: Adding info for No Bus:ptyaa
[    8.799675] device: 'ptyab': device_add
[    8.800704] PM: Adding info for No Bus:ptyab
[    8.801678] device: 'ptyac': device_add
[    8.802704] PM: Adding info for No Bus:ptyac
[    8.803675] device: 'ptyad': device_add
[    8.804707] PM: Adding info for No Bus:ptyad
[    8.805674] device: 'ptyae': device_add
[    8.806703] PM: Adding info for No Bus:ptyae
[    8.807674] device: 'ptyaf': device_add
[    8.808703] PM: Adding info for No Bus:ptyaf
[    8.809674] device: 'ptyb0': device_add
[    8.810713] PM: Adding info for No Bus:ptyb0
[    8.811675] device: 'ptyb1': device_add
[    8.812708] PM: Adding info for No Bus:ptyb1
[    8.813673] device: 'ptyb2': device_add
[    8.814702] PM: Adding info for No Bus:ptyb2
[    8.815673] device: 'ptyb3': device_add
[    8.816702] PM: Adding info for No Bus:ptyb3
[    8.817673] device: 'ptyb4': device_add
[    8.818701] PM: Adding info for No Bus:ptyb4
[    8.819672] device: 'ptyb5': device_add
[    8.820703] PM: Adding info for No Bus:ptyb5
[    8.821672] device: 'ptyb6': device_add
[    8.822704] PM: Adding info for No Bus:ptyb6
[    8.823672] device: 'ptyb7': device_add
[    8.824701] PM: Adding info for No Bus:ptyb7
[    8.825672] device: 'ptyb8': device_add
[    8.826700] PM: Adding info for No Bus:ptyb8
[    8.827671] device: 'ptyb9': device_add
[    8.828700] PM: Adding info for No Bus:ptyb9
[    8.829671] device: 'ptyba': device_add
[    8.830703] PM: Adding info for No Bus:ptyba
[    8.831670] device: 'ptybb': device_add
[    8.832700] PM: Adding info for No Bus:ptybb
[    8.833673] device: 'ptybc': device_add
[    8.834699] PM: Adding info for No Bus:ptybc
[    8.835670] device: 'ptybd': device_add
[    8.836699] PM: Adding info for No Bus:ptybd
[    8.837669] device: 'ptybe': device_add
[    8.838699] PM: Adding info for No Bus:ptybe
[    8.839669] device: 'ptybf': device_add
[    8.840727] PM: Adding info for No Bus:ptybf
[    8.841670] device: 'ptyc0': device_add
[    8.842699] PM: Adding info for No Bus:ptyc0
[    8.844660] device: 'ptyc1': device_add
[    8.845698] PM: Adding info for No Bus:ptyc1
[    8.846668] device: 'ptyc2': device_add
[    8.848692] PM: Adding info for No Bus:ptyc2
[    8.849668] device: 'ptyc3': device_add
[    8.850701] PM: Adding info for No Bus:ptyc3
[    8.851667] device: 'ptyc4': device_add
[    8.852698] PM: Adding info for No Bus:ptyc4
[    8.853667] device: 'ptyc5': device_add
[    8.854699] PM: Adding info for No Bus:ptyc5
[    8.855667] device: 'ptyc6': device_add
[    8.856697] PM: Adding info for No Bus:ptyc6
[    8.857666] device: 'ptyc7': device_add
[    8.858697] PM: Adding info for No Bus:ptyc7
[    8.859666] device: 'ptyc8': device_add
[    8.861661] PM: Adding info for No Bus:ptyc8
[    8.862666] device: 'ptyc9': device_add
[    8.863696] PM: Adding info for No Bus:ptyc9
[    8.864665] device: 'ptyca': device_add
[    8.865696] PM: Adding info for No Bus:ptyca
[    8.866665] device: 'ptycb': device_add
[    8.867696] PM: Adding info for No Bus:ptycb
[    8.868668] device: 'ptycc': device_add
[    8.869699] PM: Adding info for No Bus:ptycc
[    8.870665] device: 'ptycd': device_add
[    8.871696] PM: Adding info for No Bus:ptycd
[    8.872664] device: 'ptyce': device_add
[    8.873696] PM: Adding info for No Bus:ptyce
[    8.874664] device: 'ptycf': device_add
[    8.875695] PM: Adding info for No Bus:ptycf
[    8.876664] device: 'ptyd0': device_add
[    8.877695] PM: Adding info for No Bus:ptyd0
[    8.878665] device: 'ptyd1': device_add
[    8.879698] PM: Adding info for No Bus:ptyd1
[    8.880663] device: 'ptyd2': device_add
[    8.881694] PM: Adding info for No Bus:ptyd2
[    8.882663] device: 'ptyd3': device_add
[    8.883700] PM: Adding info for No Bus:ptyd3
[    8.884663] device: 'ptyd4': device_add
[    8.885694] PM: Adding info for No Bus:ptyd4
[    8.886662] device: 'ptyd5': device_add
[    8.887698] PM: Adding info for No Bus:ptyd5
[    8.888662] device: 'ptyd6': device_add
[    8.889693] PM: Adding info for No Bus:ptyd6
[    8.890662] device: 'ptyd7': device_add
[    8.891693] PM: Adding info for No Bus:ptyd7
[    8.892661] device: 'ptyd8': device_add
[    8.893693] PM: Adding info for No Bus:ptyd8
[    8.894661] device: 'ptyd9': device_add
[    8.895693] PM: Adding info for No Bus:ptyd9
[    8.896660] device: 'ptyda': device_add
[    8.897696] PM: Adding info for No Bus:ptyda
[    8.898660] device: 'ptydb': device_add
[    8.900695] PM: Adding info for No Bus:ptydb
[    8.901662] device: 'ptydc': device_add
[    8.902719] PM: Adding info for No Bus:ptydc
[    8.903660] device: 'ptydd': device_add
[    8.904693] PM: Adding info for No Bus:ptydd
[    8.905659] device: 'ptyde': device_add
[    8.906695] PM: Adding info for No Bus:ptyde
[    8.907659] device: 'ptydf': device_add
[    8.908692] PM: Adding info for No Bus:ptydf
[    8.909659] device: 'ptye0': device_add
[    8.910691] PM: Adding info for No Bus:ptye0
[    8.911661] device: 'ptye1': device_add
[    8.912691] PM: Adding info for No Bus:ptye1
[    8.913658] device: 'ptye2': device_add
[    8.914691] PM: Adding info for No Bus:ptye2
[    8.915658] device: 'ptye3': device_add
[    8.916694] PM: Adding info for No Bus:ptye3
[    8.917658] device: 'ptye4': device_add
[    8.918690] PM: Adding info for No Bus:ptye4
[    8.919657] device: 'ptye5': device_add
[    8.920692] PM: Adding info for No Bus:ptye5
[    8.922649] device: 'ptye6': device_add
[    8.923690] PM: Adding info for No Bus:ptye6
[    8.924656] device: 'ptye7': device_add
[    8.925695] PM: Adding info for No Bus:ptye7
[    8.926657] device: 'ptye8': device_add
[    8.927689] PM: Adding info for No Bus:ptye8
[    8.928656] device: 'ptye9': device_add
[    8.929689] PM: Adding info for No Bus:ptye9
[    8.930655] device: 'ptyea': device_add
[    8.931689] PM: Adding info for No Bus:ptyea
[    8.932655] device: 'ptyeb': device_add
[    8.933689] PM: Adding info for No Bus:ptyeb
[    8.934658] device: 'ptyec': device_add
[    8.935694] PM: Adding info for No Bus:ptyec
[    8.936655] device: 'ptyed': device_add
[    8.938692] PM: Adding info for No Bus:ptyed
[    8.939654] device: 'ptyee': device_add
[    8.940689] PM: Adding info for No Bus:ptyee
[    8.941654] device: 'ptyef': device_add
[    8.942688] PM: Adding info for No Bus:ptyef
[    8.943660] device: 'ttyp0': device_add
[    8.944690] PM: Adding info for No Bus:ttyp0
[    8.945657] device: 'ttyp1': device_add
[    8.946685] PM: Adding info for No Bus:ttyp1
[    8.947653] device: 'ttyp2': device_add
[    8.948684] PM: Adding info for No Bus:ttyp2
[    8.949652] device: 'ttyp3': device_add
[    8.951667] PM: Adding info for No Bus:ttyp3
[    8.952652] device: 'ttyp4': device_add
[    8.953684] PM: Adding info for No Bus:ttyp4
[    8.954652] device: 'ttyp5': device_add
[    8.955688] PM: Adding info for No Bus:ttyp5
[    8.956652] device: 'ttyp6': device_add
[    8.957683] PM: Adding info for No Bus:ttyp6
[    8.958651] device: 'ttyp7': device_add
[    8.959683] PM: Adding info for No Bus:ttyp7
[    8.960651] device: 'ttyp8': device_add
[    8.961682] PM: Adding info for No Bus:ttyp8
[    8.962651] device: 'ttyp9': device_add
[    8.964654] PM: Adding info for No Bus:ttyp9
[    8.965650] device: 'ttypa': device_add
[    8.966683] PM: Adding info for No Bus:ttypa
[    8.967650] device: 'ttypb': device_add
[    8.968682] PM: Adding info for No Bus:ttypb
[    8.969652] device: 'ttypc': device_add
[    8.970682] PM: Adding info for No Bus:ttypc
[    8.971649] device: 'ttypd': device_add
[    8.972681] PM: Adding info for No Bus:ttypd
[    8.973649] device: 'ttype': device_add
[    8.974684] PM: Adding info for No Bus:ttype
[    8.975649] device: 'ttypf': device_add
[    8.976681] PM: Adding info for No Bus:ttypf
[    8.977649] device: 'ttyq0': device_add
[    8.978681] PM: Adding info for No Bus:ttyq0
[    8.979650] device: 'ttyq1': device_add
[    8.980680] PM: Adding info for No Bus:ttyq1
[    8.981648] device: 'ttyq2': device_add
[    8.982683] PM: Adding info for No Bus:ttyq2
[    8.983648] device: 'ttyq3': device_add
[    8.984680] PM: Adding info for No Bus:ttyq3
[    8.985647] device: 'ttyq4': device_add
[    8.986680] PM: Adding info for No Bus:ttyq4
[    8.987647] device: 'ttyq5': device_add
[    8.988682] PM: Adding info for No Bus:ttyq5
[    8.989647] device: 'ttyq6': device_add
[    8.990679] PM: Adding info for No Bus:ttyq6
[    8.991646] device: 'ttyq7': device_add
[    8.992683] PM: Adding info for No Bus:ttyq7
[    8.993646] device: 'ttyq8': device_add
[    8.994678] PM: Adding info for No Bus:ttyq8
[    8.995646] device: 'ttyq9': device_add
[    8.996679] PM: Adding info for No Bus:ttyq9
[    8.997645] device: 'ttyqa': device_add
[    8.998678] PM: Adding info for No Bus:ttyqa
[    8.999645] device: 'ttyqb': device_add
[    9.000682] PM: Adding info for No Bus:ttyqb
[    9.001647] device: 'ttyqc': device_add
[    9.002678] PM: Adding info for No Bus:ttyqc
[    9.003644] device: 'ttyqd': device_add
[    9.004678] PM: Adding info for No Bus:ttyqd
[    9.005644] device: 'ttyqe': device_add
[    9.006678] PM: Adding info for No Bus:ttyqe
[    9.007643] device: 'ttyqf': device_add
[    9.008677] PM: Adding info for No Bus:ttyqf
[    9.009644] device: 'ttyr0': device_add
[    9.010682] PM: Adding info for No Bus:ttyr0
[    9.011645] device: 'ttyr1': device_add
[    9.012677] PM: Adding info for No Bus:ttyr1
[    9.013643] device: 'ttyr2': device_add
[    9.014676] PM: Adding info for No Bus:ttyr2
[    9.015643] device: 'ttyr3': device_add
[    9.016676] PM: Adding info for No Bus:ttyr3
[    9.017642] device: 'ttyr4': device_add
[    9.018679] PM: Adding info for No Bus:ttyr4
[    9.019642] device: 'ttyr5': device_add
[    9.020678] PM: Adding info for No Bus:ttyr5
[    9.021642] device: 'ttyr6': device_add
[    9.022704] PM: Adding info for No Bus:ttyr6
[    9.023642] device: 'ttyr7': device_add
[    9.024677] PM: Adding info for No Bus:ttyr7
[    9.025641] device: 'ttyr8': device_add
[    9.026676] PM: Adding info for No Bus:ttyr8
[    9.027641] device: 'ttyr9': device_add
[    9.028679] PM: Adding info for No Bus:ttyr9
[    9.029641] device: 'ttyra': device_add
[    9.030675] PM: Adding info for No Bus:ttyra
[    9.031640] device: 'ttyrb': device_add
[    9.032675] PM: Adding info for No Bus:ttyrb
[    9.033643] device: 'ttyrc': device_add
[    9.034675] PM: Adding info for No Bus:ttyrc
[    9.035639] device: 'ttyrd': device_add
[    9.036678] PM: Adding info for No Bus:ttyrd
[    9.037639] device: 'ttyre': device_add
[    9.038674] PM: Adding info for No Bus:ttyre
[    9.039639] device: 'ttyrf': device_add
[    9.040674] PM: Adding info for No Bus:ttyrf
[    9.041639] device: 'ttys0': device_add
[    9.042673] PM: Adding info for No Bus:ttys0
[    9.043640] device: 'ttys1': device_add
[    9.044674] PM: Adding info for No Bus:ttys1
[    9.045638] device: 'ttys2': device_add
[    9.046677] PM: Adding info for No Bus:ttys2
[    9.047638] device: 'ttys3': device_add
[    9.048674] PM: Adding info for No Bus:ttys3
[    9.049638] device: 'ttys4': device_add
[    9.050673] PM: Adding info for No Bus:ttys4
[    9.051637] device: 'ttys5': device_add
[    9.052675] PM: Adding info for No Bus:ttys5
[    9.053637] device: 'ttys6': device_add
[    9.054675] PM: Adding info for No Bus:ttys6
[    9.055636] device: 'ttys7': device_add
[    9.056672] PM: Adding info for No Bus:ttys7
[    9.057636] device: 'ttys8': device_add
[    9.058683] PM: Adding info for No Bus:ttys8
[    9.059636] device: 'ttys9': device_add
[    9.060675] PM: Adding info for No Bus:ttys9
[    9.061636] device: 'ttysa': device_add
[    9.062671] PM: Adding info for No Bus:ttysa
[    9.063635] device: 'ttysb': device_add
[    9.064675] PM: Adding info for No Bus:ttysb
[    9.065638] device: 'ttysc': device_add
[    9.066671] PM: Adding info for No Bus:ttysc
[    9.067635] device: 'ttysd': device_add
[    9.068671] PM: Adding info for No Bus:ttysd
[    9.069634] device: 'ttyse': device_add
[    9.070670] PM: Adding info for No Bus:ttyse
[    9.071634] device: 'ttysf': device_add
[    9.072673] PM: Adding info for No Bus:ttysf
[    9.073634] device: 'ttyt0': device_add
[    9.074670] PM: Adding info for No Bus:ttyt0
[    9.075635] device: 'ttyt1': device_add
[    9.076671] PM: Adding info for No Bus:ttyt1
[    9.077633] device: 'ttyt2': device_add
[    9.078670] PM: Adding info for No Bus:ttyt2
[    9.079633] device: 'ttyt3': device_add
[    9.080696] PM: Adding info for No Bus:ttyt3
[    9.081633] device: 'ttyt4': device_add
[    9.082675] PM: Adding info for No Bus:ttyt4
[    9.083632] device: 'ttyt5': device_add
[    9.084671] PM: Adding info for No Bus:ttyt5
[    9.085632] device: 'ttyt6': device_add
[    9.086669] PM: Adding info for No Bus:ttyt6
[    9.087632] device: 'ttyt7': device_add
[    9.088668] PM: Adding info for No Bus:ttyt7
[    9.089632] device: 'ttyt8': device_add
[    9.090672] PM: Adding info for No Bus:ttyt8
[    9.091631] device: 'ttyt9': device_add
[    9.092668] PM: Adding info for No Bus:ttyt9
[    9.093631] device: 'ttyta': device_add
[    9.094676] PM: Adding info for No Bus:ttyta
[    9.095630] device: 'ttytb': device_add
[    9.096669] PM: Adding info for No Bus:ttytb
[    9.097633] device: 'ttytc': device_add
[    9.098668] PM: Adding info for No Bus:ttytc
[    9.099630] device: 'ttytd': device_add
[    9.100676] PM: Adding info for No Bus:ttytd
[    9.101630] device: 'ttyte': device_add
[    9.102667] PM: Adding info for No Bus:ttyte
[    9.103629] device: 'ttytf': device_add
[    9.104667] PM: Adding info for No Bus:ttytf
[    9.105629] device: 'ttyu0': device_add
[    9.106666] PM: Adding info for No Bus:ttyu0
[    9.107630] device: 'ttyu1': device_add
[    9.108670] PM: Adding info for No Bus:ttyu1
[    9.109628] device: 'ttyu2': device_add
[    9.110666] PM: Adding info for No Bus:ttyu2
[    9.111628] device: 'ttyu3': device_add
[    9.112666] PM: Adding info for No Bus:ttyu3
[    9.113628] device: 'ttyu4': device_add
[    9.114666] PM: Adding info for No Bus:ttyu4
[    9.115627] device: 'ttyu5': device_add
[    9.116668] PM: Adding info for No Bus:ttyu5
[    9.117627] device: 'ttyu6': device_add
[    9.118669] PM: Adding info for No Bus:ttyu6
[    9.119627] device: 'ttyu7': device_add
[    9.120665] PM: Adding info for No Bus:ttyu7
[    9.121626] device: 'ttyu8': device_add
[    9.122665] PM: Adding info for No Bus:ttyu8
[    9.123626] device: 'ttyu9': device_add
[    9.124665] PM: Adding info for No Bus:ttyu9
[    9.125626] device: 'ttyua': device_add
[    9.126668] PM: Adding info for No Bus:ttyua
[    9.127626] device: 'ttyub': device_add
[    9.128665] PM: Adding info for No Bus:ttyub
[    9.129628] device: 'ttyuc': device_add
[    9.130665] PM: Adding info for No Bus:ttyuc
[    9.131625] device: 'ttyud': device_add
[    9.133622] PM: Adding info for No Bus:ttyud
[    9.134624] device: 'ttyue': device_add
[    9.135665] PM: Adding info for No Bus:ttyue
[    9.136624] device: 'ttyuf': device_add
[    9.137670] PM: Adding info for No Bus:ttyuf
[    9.138624] device: 'ttyv0': device_add
[    9.139692] PM: Adding info for No Bus:ttyv0
[    9.140626] device: 'ttyv1': device_add
[    9.141666] PM: Adding info for No Bus:ttyv1
[    9.142623] device: 'ttyv2': device_add
[    9.143663] PM: Adding info for No Bus:ttyv2
[    9.144623] device: 'ttyv3': device_add
[    9.145665] PM: Adding info for No Bus:ttyv3
[    9.146623] device: 'ttyv4': device_add
[    9.147663] PM: Adding info for No Bus:ttyv4
[    9.148622] device: 'ttyv5': device_add
[    9.149665] PM: Adding info for No Bus:ttyv5
[    9.150622] device: 'ttyv6': device_add
[    9.151663] PM: Adding info for No Bus:ttyv6
[    9.152622] device: 'ttyv7': device_add
[    9.153662] PM: Adding info for No Bus:ttyv7
[    9.154621] device: 'ttyv8': device_add
[    9.155666] PM: Adding info for No Bus:ttyv8
[    9.156621] device: 'ttyv9': device_add
[    9.157661] PM: Adding info for No Bus:ttyv9
[    9.158621] device: 'ttyva': device_add
[    9.159662] PM: Adding info for No Bus:ttyva
[    9.160620] device: 'ttyvb': device_add
[    9.161662] PM: Adding info for No Bus:ttyvb
[    9.162623] device: 'ttyvc': device_add
[    9.163666] PM: Adding info for No Bus:ttyvc
[    9.164620] device: 'ttyvd': device_add
[    9.165662] PM: Adding info for No Bus:ttyvd
[    9.166619] device: 'ttyve': device_add
[    9.167661] PM: Adding info for No Bus:ttyve
[    9.168619] device: 'ttyvf': device_add
[    9.169661] PM: Adding info for No Bus:ttyvf
[    9.170619] device: 'ttyw0': device_add
[    9.171661] PM: Adding info for No Bus:ttyw0
[    9.172620] device: 'ttyw1': device_add
[    9.173664] PM: Adding info for No Bus:ttyw1
[    9.174618] device: 'ttyw2': device_add
[    9.175661] PM: Adding info for No Bus:ttyw2
[    9.176618] device: 'ttyw3': device_add
[    9.177661] PM: Adding info for No Bus:ttyw3
[    9.178618] device: 'ttyw4': device_add
[    9.180616] PM: Adding info for No Bus:ttyw4
[    9.181617] device: 'ttyw5': device_add
[    9.182667] PM: Adding info for No Bus:ttyw5
[    9.183617] device: 'ttyw6': device_add
[    9.184661] PM: Adding info for No Bus:ttyw6
[    9.185617] device: 'ttyw7': device_add
[    9.186660] PM: Adding info for No Bus:ttyw7
[    9.187616] device: 'ttyw8': device_add
[    9.188659] PM: Adding info for No Bus:ttyw8
[    9.189616] device: 'ttyw9': device_add
[    9.190660] PM: Adding info for No Bus:ttyw9
[    9.191616] device: 'ttywa': device_add
[    9.193663] PM: Adding info for No Bus:ttywa
[    9.194615] device: 'ttywb': device_add
[    9.195659] PM: Adding info for No Bus:ttywb
[    9.196618] device: 'ttywc': device_add
[    9.197660] PM: Adding info for No Bus:ttywc
[    9.198615] device: 'ttywd': device_add
[    9.199687] PM: Adding info for No Bus:ttywd
[    9.200614] device: 'ttywe': device_add
[    9.201666] PM: Adding info for No Bus:ttywe
[    9.202614] device: 'ttywf': device_add
[    9.203660] PM: Adding info for No Bus:ttywf
[    9.204614] device: 'ttyx0': device_add
[    9.205658] PM: Adding info for No Bus:ttyx0
[    9.206616] device: 'ttyx1': device_add
[    9.207658] PM: Adding info for No Bus:ttyx1
[    9.208613] device: 'ttyx2': device_add
[    9.209658] PM: Adding info for No Bus:ttyx2
[    9.210613] device: 'ttyx3': device_add
[    9.211660] PM: Adding info for No Bus:ttyx3
[    9.212613] device: 'ttyx4': device_add
[    9.213658] PM: Adding info for No Bus:ttyx4
[    9.214612] device: 'ttyx5': device_add
[    9.216618] PM: Adding info for No Bus:ttyx5
[    9.217611] device: 'ttyx6': device_add
[    9.218658] PM: Adding info for No Bus:ttyx6
[    9.219611] device: 'ttyx7': device_add
[    9.220659] PM: Adding info for No Bus:ttyx7
[    9.221611] device: 'ttyx8': device_add
[    9.222658] PM: Adding info for No Bus:ttyx8
[    9.223611] device: 'ttyx9': device_add
[    9.224656] PM: Adding info for No Bus:ttyx9
[    9.226600] device: 'ttyxa': device_add
[    9.227656] PM: Adding info for No Bus:ttyxa
[    9.228610] device: 'ttyxb': device_add
[    9.229655] PM: Adding info for No Bus:ttyxb
[    9.230613] device: 'ttyxc': device_add
[    9.231660] PM: Adding info for No Bus:ttyxc
[    9.232609] device: 'ttyxd': device_add
[    9.233656] PM: Adding info for No Bus:ttyxd
[    9.234609] device: 'ttyxe': device_add
[    9.235655] PM: Adding info for No Bus:ttyxe
[    9.236609] device: 'ttyxf': device_add
[    9.237654] PM: Adding info for No Bus:ttyxf
[    9.238609] device: 'ttyy0': device_add
[    9.239658] PM: Adding info for No Bus:ttyy0
[    9.240610] device: 'ttyy1': device_add
[    9.241655] PM: Adding info for No Bus:ttyy1
[    9.242608] device: 'ttyy2': device_add
[    9.243654] PM: Adding info for No Bus:ttyy2
[    9.244607] device: 'ttyy3': device_add
[    9.245654] PM: Adding info for No Bus:ttyy3
[    9.246607] device: 'ttyy4': device_add
[    9.247654] PM: Adding info for No Bus:ttyy4
[    9.248607] device: 'ttyy5': device_add
[    9.249659] PM: Adding info for No Bus:ttyy5
[    9.250607] device: 'ttyy6': device_add
[    9.251653] PM: Adding info for No Bus:ttyy6
[    9.252606] device: 'ttyy7': device_add
[    9.253653] PM: Adding info for No Bus:ttyy7
[    9.254606] device: 'ttyy8': device_add
[    9.255653] PM: Adding info for No Bus:ttyy8
[    9.256606] device: 'ttyy9': device_add
[    9.257657] PM: Adding info for No Bus:ttyy9
[    9.258606] device: 'ttyya': device_add
[    9.259681] PM: Adding info for No Bus:ttyya
[    9.260605] device: 'ttyyb': device_add
[    9.261655] PM: Adding info for No Bus:ttyyb
[    9.262608] device: 'ttyyc': device_add
[    9.263653] PM: Adding info for No Bus:ttyyc
[    9.264605] device: 'ttyyd': device_add
[    9.265652] PM: Adding info for No Bus:ttyyd
[    9.266604] device: 'ttyye': device_add
[    9.267656] PM: Adding info for No Bus:ttyye
[    9.268604] device: 'ttyyf': device_add
[    9.269652] PM: Adding info for No Bus:ttyyf
[    9.270604] device: 'ttyz0': device_add
[    9.271651] PM: Adding info for No Bus:ttyz0
[    9.272605] device: 'ttyz1': device_add
[    9.273652] PM: Adding info for No Bus:ttyz1
[    9.274603] device: 'ttyz2': device_add
[    9.275655] PM: Adding info for No Bus:ttyz2
[    9.276603] device: 'ttyz3': device_add
[    9.277652] PM: Adding info for No Bus:ttyz3
[    9.278602] device: 'ttyz4': device_add
[    9.279652] PM: Adding info for No Bus:ttyz4
[    9.280602] device: 'ttyz5': device_add
[    9.281653] PM: Adding info for No Bus:ttyz5
[    9.282602] device: 'ttyz6': device_add
[    9.283650] PM: Adding info for No Bus:ttyz6
[    9.284601] device: 'ttyz7': device_add
[    9.286631] PM: Adding info for No Bus:ttyz7
[    9.287601] device: 'ttyz8': device_add
[    9.288649] PM: Adding info for No Bus:ttyz8
[    9.289600] device: 'ttyz9': device_add
[    9.290649] PM: Adding info for No Bus:ttyz9
[    9.291600] device: 'ttyza': device_add
[    9.292649] PM: Adding info for No Bus:ttyza
[    9.293600] device: 'ttyzb': device_add
[    9.294654] PM: Adding info for No Bus:ttyzb
[    9.295602] device: 'ttyzc': device_add
[    9.296650] PM: Adding info for No Bus:ttyzc
[    9.297599] device: 'ttyzd': device_add
[    9.298649] PM: Adding info for No Bus:ttyzd
[    9.299599] device: 'ttyze': device_add
[    9.300653] PM: Adding info for No Bus:ttyze
[    9.301599] device: 'ttyzf': device_add
[    9.302650] PM: Adding info for No Bus:ttyzf
[    9.303599] device: 'ttya0': device_add
[    9.304669] PM: Adding info for No Bus:ttya0
[    9.305600] device: 'ttya1': device_add
[    9.306653] PM: Adding info for No Bus:ttya1
[    9.307598] device: 'ttya2': device_add
[    9.309628] PM: Adding info for No Bus:ttya2
[    9.310597] device: 'ttya3': device_add
[    9.311647] PM: Adding info for No Bus:ttya3
[    9.312597] device: 'ttya4': device_add
[    9.313650] PM: Adding info for No Bus:ttya4
[    9.314597] device: 'ttya5': device_add
[    9.315651] PM: Adding info for No Bus:ttya5
[    9.316596] device: 'ttya6': device_add
[    9.317647] PM: Adding info for No Bus:ttya6
[    9.318596] device: 'ttya7': device_add
[    9.319675] PM: Adding info for No Bus:ttya7
[    9.320596] device: 'ttya8': device_add
[    9.321650] PM: Adding info for No Bus:ttya8
[    9.322596] device: 'ttya9': device_add
[    9.323651] PM: Adding info for No Bus:ttya9
[    9.324595] device: 'ttyaa': device_add
[    9.325646] PM: Adding info for No Bus:ttyaa
[    9.326595] device: 'ttyab': device_add
[    9.327646] PM: Adding info for No Bus:ttyab
[    9.328598] device: 'ttyac': device_add
[    9.329647] PM: Adding info for No Bus:ttyac
[    9.330594] device: 'ttyad': device_add
[    9.331649] PM: Adding info for No Bus:ttyad
[    9.332594] device: 'ttyae': device_add
[    9.333646] PM: Adding info for No Bus:ttyae
[    9.334594] device: 'ttyaf': device_add
[    9.335645] PM: Adding info for No Bus:ttyaf
[    9.336593] device: 'ttyb0': device_add
[    9.337645] PM: Adding info for No Bus:ttyb0
[    9.338595] device: 'ttyb1': device_add
[    9.339647] PM: Adding info for No Bus:ttyb1
[    9.340593] device: 'ttyb2': device_add
[    9.341650] PM: Adding info for No Bus:ttyb2
[    9.342593] device: 'ttyb3': device_add
[    9.343647] PM: Adding info for No Bus:ttyb3
[    9.344592] device: 'ttyb4': device_add
[    9.345646] PM: Adding info for No Bus:ttyb4
[    9.346592] device: 'ttyb5': device_add
[    9.347648] PM: Adding info for No Bus:ttyb5
[    9.348591] device: 'ttyb6': device_add
[    9.349652] PM: Adding info for No Bus:ttyb6
[    9.350592] device: 'ttyb7': device_add
[    9.351647] PM: Adding info for No Bus:ttyb7
[    9.352591] device: 'ttyb8': device_add
[    9.353645] PM: Adding info for No Bus:ttyb8
[    9.354591] device: 'ttyb9': device_add
[    9.355645] PM: Adding info for No Bus:ttyb9
[    9.356590] device: 'ttyba': device_add
[    9.357644] PM: Adding info for No Bus:ttyba
[    9.358590] device: 'ttybb': device_add
[    9.359647] PM: Adding info for No Bus:ttybb
[    9.360592] device: 'ttybc': device_add
[    9.361646] PM: Adding info for No Bus:ttybc
[    9.362589] device: 'ttybd': device_add
[    9.364597] PM: Adding info for No Bus:ttybd
[    9.365589] device: 'ttybe': device_add
[    9.366646] PM: Adding info for No Bus:ttybe
[    9.367589] device: 'ttybf': device_add
[    9.368647] PM: Adding info for No Bus:ttybf
[    9.369589] device: 'ttyc0': device_add
[    9.370644] PM: Adding info for No Bus:ttyc0
[    9.371590] device: 'ttyc1': device_add
[    9.372644] PM: Adding info for No Bus:ttyc1
[    9.373588] device: 'ttyc2': device_add
[    9.374643] PM: Adding info for No Bus:ttyc2
[    9.375588] device: 'ttyc3': device_add
[    9.376642] PM: Adding info for No Bus:ttyc3
[    9.377588] device: 'ttyc4': device_add
[    9.378675] PM: Adding info for No Bus:ttyc4
[    9.379588] device: 'ttyc5': device_add
[    9.380648] PM: Adding info for No Bus:ttyc5
[    9.381587] device: 'ttyc6': device_add
[    9.382644] PM: Adding info for No Bus:ttyc6
[    9.384579] device: 'ttyc7': device_add
[    9.385643] PM: Adding info for No Bus:ttyc7
[    9.386586] device: 'ttyc8': device_add
[    9.387646] PM: Adding info for No Bus:ttyc8
[    9.388586] device: 'ttyc9': device_add
[    9.389642] PM: Adding info for No Bus:ttyc9
[    9.390586] device: 'ttyca': device_add
[    9.391641] PM: Adding info for No Bus:ttyca
[    9.392585] device: 'ttycb': device_add
[    9.393640] PM: Adding info for No Bus:ttycb
[    9.394589] device: 'ttycc': device_add
[    9.395643] PM: Adding info for No Bus:ttycc
[    9.396584] device: 'ttycd': device_add
[    9.398600] PM: Adding info for No Bus:ttycd
[    9.399584] device: 'ttyce': device_add
[    9.400640] PM: Adding info for No Bus:ttyce
[    9.401583] device: 'ttycf': device_add
[    9.402640] PM: Adding info for No Bus:ttycf
[    9.403584] device: 'ttyd0': device_add
[    9.404640] PM: Adding info for No Bus:ttyd0
[    9.405585] device: 'ttyd1': device_add
[    9.406645] PM: Adding info for No Bus:ttyd1
[    9.407583] device: 'ttyd2': device_add
[    9.408640] PM: Adding info for No Bus:ttyd2
[    9.409583] device: 'ttyd3': device_add
[    9.410640] PM: Adding info for No Bus:ttyd3
[    9.411582] device: 'ttyd4': device_add
[    9.412640] PM: Adding info for No Bus:ttyd4
[    9.413582] device: 'ttyd5': device_add
[    9.414643] PM: Adding info for No Bus:ttyd5
[    9.415582] device: 'ttyd6': device_add
[    9.416643] PM: Adding info for No Bus:ttyd6
[    9.417582] device: 'ttyd7': device_add
[    9.418639] PM: Adding info for No Bus:ttyd7
[    9.419581] device: 'ttyd8': device_add
[    9.420639] PM: Adding info for No Bus:ttyd8
[    9.421580] device: 'ttyd9': device_add
[    9.422638] PM: Adding info for No Bus:ttyd9
[    9.423580] device: 'ttyda': device_add
[    9.424642] PM: Adding info for No Bus:ttyda
[    9.425580] device: 'ttydb': device_add
[    9.426639] PM: Adding info for No Bus:ttydb
[    9.427583] device: 'ttydc': device_add
[    9.428640] PM: Adding info for No Bus:ttydc
[    9.429579] device: 'ttydd': device_add
[    9.431614] PM: Adding info for No Bus:ttydd
[    9.432579] device: 'ttyde': device_add
[    9.433638] PM: Adding info for No Bus:ttyde
[    9.434578] device: 'ttydf': device_add
[    9.435642] PM: Adding info for No Bus:ttydf
[    9.436578] device: 'ttye0': device_add
[    9.437637] PM: Adding info for No Bus:ttye0
[    9.438580] device: 'ttye1': device_add
[    9.439666] PM: Adding info for No Bus:ttye1
[    9.440578] device: 'ttye2': device_add
[    9.442595] PM: Adding info for No Bus:ttye2
[    9.443577] device: 'ttye3': device_add
[    9.444642] PM: Adding info for No Bus:ttye3
[    9.445577] device: 'ttye4': device_add
[    9.446638] PM: Adding info for No Bus:ttye4
[    9.447577] device: 'ttye5': device_add
[    9.448638] PM: Adding info for No Bus:ttye5
[    9.449577] device: 'ttye6': device_add
[    9.450637] PM: Adding info for No Bus:ttye6
[    9.451576] device: 'ttye7': device_add
[    9.452636] PM: Adding info for No Bus:ttye7
[    9.453576] device: 'ttye8': device_add
[    9.454640] PM: Adding info for No Bus:ttye8
[    9.455576] device: 'ttye9': device_add
[    9.456636] PM: Adding info for No Bus:ttye9
[    9.457575] device: 'ttyea': device_add
[    9.458636] PM: Adding info for No Bus:ttyea
[    9.459575] device: 'ttyeb': device_add
[    9.460635] PM: Adding info for No Bus:ttyeb
[    9.461578] device: 'ttyec': device_add
[    9.462639] PM: Adding info for No Bus:ttyec
[    9.463574] device: 'ttyed': device_add
[    9.464642] PM: Adding info for No Bus:ttyed
[    9.465574] device: 'ttyee': device_add
[    9.466637] PM: Adding info for No Bus:ttyee
[    9.467574] device: 'ttyef': device_add
[    9.468636] PM: Adding info for No Bus:ttyef
[    9.469588] device: 'ptmx': device_add
[    9.470635] PM: Adding info for No Bus:ptmx
[    9.471579] initcall pty_init+0x0/0x458 returned 0 after 1884477 usecs
[    9.472564] calling  sysrq_init+0x0/0x78 @ 1
[    9.473581] initcall sysrq_init+0x0/0x78 returned 0 after 0 usecs
[    9.474563] calling  xen_hvc_init+0x0/0x144 @ 1
[    9.475563] initcall xen_hvc_init+0x0/0x144 returned -19 after 0 usecs
[    9.476563] calling  serial8250_init+0x0/0x189 @ 1
[    9.477562] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    9.478574] Registering platform device 'serial8250'. Parent at platform
[    9.479562] device: 'serial8250': device_add
[    9.480569] bus: 'platform': add device serial8250
[    9.481568] PM: Adding info for platform:serial8250
[    9.483563] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[    9.484565] device: 'ttyS0': device_add
[    9.486574] PM: Adding info for No Bus:ttyS0
[    9.493588] device: 'ttyS1': device_add
[    9.494619] PM: Adding info for No Bus:ttyS1
[    9.501572] device: 'ttyS2': device_add
[    9.502614] PM: Adding info for No Bus:ttyS2
[    9.509574] device: 'ttyS3': device_add
[    9.510612] PM: Adding info for No Bus:ttyS3
[    9.517562] bus: 'platform': add driver serial8250
[    9.518561] bus: 'platform': driver_probe_device: matched device serial8250 with driver serial8250
[    9.519556] bus: 'platform': really_probe: probing driver serial8250 with device serial8250
[    9.520559] driver: 'serial8250': driver_bound: bound to device 'serial8250'
[    9.521556] bus: 'platform': really_probe: bound device serial8250 to driver serial8250
[    9.522569] initcall serial8250_init+0x0/0x189 returned 0 after 43938 usecs
[    9.523557] calling  rand_initialize+0x0/0x40 @ 1
[    9.524584] initcall rand_initialize+0x0/0x40 returned 0 after 0 usecs
[    9.525557] calling  topology_sysfs_init+0x0/0x6c @ 1
[    9.526574] initcall topology_sysfs_init+0x0/0x6c returned 0 after 0 usecs
[    9.527555] calling  cpqarray_init+0x0/0x2a1 @ 1
[    9.528554] Compaq SMART2 Driver (v 2.6.0)
[    9.529555] bus: 'pci': add driver cpqarray
[    9.530648] bus: 'pci': remove driver cpqarray
[    9.531563] driver: 'cpqarray': driver_release
[    9.532556] initcall cpqarray_init+0x0/0x2a1 returned -19 after 3905 usecs
[    9.533554] calling  init_kgdbts+0x0/0x16 @ 1
[    9.534554] initcall init_kgdbts+0x0/0x16 returned 0 after 0 usecs
[    9.535554] calling  spi_transport_init+0x0/0x7b @ 1
[    9.536555] device class 'spi_transport': registering
[    9.537565] device class 'spi_host': registering
[    9.538562] initcall spi_transport_init+0x0/0x7b returned 0 after 1952 usecs
[    9.539553] calling  ahc_linux_init+0x0/0x63 @ 1
[    9.540555] bus: 'pci': add driver aic7xxx
[    9.541588] initcall ahc_linux_init+0x0/0x63 returned 0 after 976 usecs
[    9.542553] calling  init_sd+0x0/0x150 @ 1
[    9.543559] device class 'scsi_disk': registering
[    9.544560] bus: 'scsi': add driver sd
[    9.545602] initcall init_sd+0x0/0x150 returned 0 after 1952 usecs
[    9.546553] calling  ahci_init+0x0/0x1b @ 1
[    9.547552] bus: 'pci': add driver ahci
[    9.548594] initcall ahci_init+0x0/0x1b returned 0 after 976 usecs
[    9.549552] calling  piix_init+0x0/0x29 @ 1
[    9.550551] bus: 'pci': add driver ata_piix
[    9.551581] initcall piix_init+0x0/0x29 returned 0 after 976 usecs
[    9.552552] calling  nv_init+0x0/0x1b @ 1
[    9.553551] bus: 'pci': add driver sata_nv
[    9.554579] initcall nv_init+0x0/0x1b returned 0 after 976 usecs
[    9.555551] calling  amd_init+0x0/0x1b @ 1
[    9.556550] bus: 'pci': add driver pata_amd
[    9.557557] bus: 'pci': driver_probe_device: matched device 0000:00:06.0 with driver pata_amd
[    9.558550] bus: 'pci': really_probe: probing driver pata_amd with device 0000:00:06.0
[    9.559641] pata_amd 0000:00:06.0: version 0.4.1
[    9.561561] pata_amd 0000:00:06.0: setting latency timer to 64
[    9.562650] device: 'ata1': device_add
[    9.563559] PM: Adding info for No Bus:ata1
[    9.564551] device: 'ata1': device_add
[    9.565562] PM: Adding info for No Bus:ata1
[    9.566579] device: 'link1': device_add
[    9.567554] PM: Adding info for No Bus:link1
[    9.568550] device: 'link1': device_add
[    9.569560] PM: Adding info for No Bus:link1
[    9.570569] device: 'dev1.0': device_add
[    9.571553] PM: Adding info for No Bus:dev1.0
[    9.572549] device: 'dev1.0': device_add
[    9.573562] PM: Adding info for No Bus:dev1.0
[    9.574571] device: 'dev1.1': device_add
[    9.575553] PM: Adding info for No Bus:dev1.1
[    9.577549] device: 'dev1.1': device_add
[    9.578559] PM: Adding info for No Bus:dev1.1
[    9.579569] device: 'ata2': device_add
[    9.580552] PM: Adding info for No Bus:ata2
[    9.581548] device: 'ata2': device_add
[    9.582561] PM: Adding info for No Bus:ata2
[    9.583561] device: 'link2': device_add
[    9.584551] PM: Adding info for No Bus:link2
[    9.585547] device: 'link2': device_add
[    9.586558] PM: Adding info for No Bus:link2
[    9.587562] device: 'dev2.0': device_add
[    9.588550] PM: Adding info for No Bus:dev2.0
[    9.589547] device: 'dev2.0': device_add
[    9.590559] PM: Adding info for No Bus:dev2.0
[    9.591568] device: 'dev2.1': device_add
[    9.592550] PM: Adding info for No Bus:dev2.1
[    9.593547] device: 'dev2.1': device_add
[    9.594565] PM: Adding info for No Bus:dev2.1
[    9.595612] scsi0 : pata_amd
[    9.596578] device: 'host0': device_add
[    9.597548] bus: 'scsi': add device host0
[    9.598552] PM: Adding info for scsi:host0
[    9.599553] device: 'host0': device_add
[    9.600571] PM: Adding info for No Bus:host0
[    9.601608] scsi1 : pata_amd
[    9.602544] device: 'host1': device_add
[    9.603546] bus: 'scsi': add device host1
[    9.604556] PM: Adding info for scsi:host1
[    9.605551] device: 'host1': device_add
[    9.606576] PM: Adding info for No Bus:host1
[    9.607552] ata1: PATA max UDMA/133 cmd 0x1f0 ctl 0x3f6 bmdma 0xf000 irq 14
[    9.608542] ata2: PATA max UDMA/133 cmd 0x170 ctl 0x376 bmdma 0xf008 irq 15
[    9.609580] work_for_cpu used greatest stack depth: 5408 bytes left
[    9.609580] driver: '0000:00:06.0': driver_bound: bound to device 'pata_amd'
[    9.609580] bus: 'pci': really_probe: bound device 0000:00:06.0 to driver pata_amd
[    9.609580] initcall amd_init+0x0/0x1b returned 0 after 51749 usecs
[    9.609580] calling  oldpiix_init+0x0/0x1b @ 1
[    9.609580] bus: 'pci': add driver pata_oldpiix
[    9.609580] initcall oldpiix_init+0x0/0x1b returned 0 after 0 usecs
[    9.609580] calling  via_init+0x0/0x1b @ 1
[    9.609580] bus: 'pci': add driver pata_via
[    9.609580] initcall via_init+0x0/0x1b returned 0 after 0 usecs
[    9.609580] calling  fixed_mdio_bus_init+0x0/0xfc @ 1
[    9.609580] Registering platform device 'Fixed MDIO bus.0'. Parent at platform
[    9.609580] device: 'Fixed MDIO bus.0': device_add
[    9.609580] bus: 'platform': add device Fixed MDIO bus.0
[    9.609580] PM: Adding info for platform:Fixed MDIO bus.0
[    9.609580] device: '0': device_add
[    9.609580] PM: Adding info for No Bus:0
[    9.609580] Fixed MDIO Bus: probed
[    9.609580] initcall fixed_mdio_bus_init+0x0/0xfc returned 0 after 0 usecs
[    9.609580] calling  e1000_init_module+0x0/0x3e @ 1
[    9.609580] e1000e: Intel(R) PRO/1000 Network Driver - 1.3.10-k2
[    9.609580] e1000e: Copyright(c) 1999 - 2011 Intel Corporation.
[    9.609580] bus: 'pci': add driver e1000e
[    9.609580] initcall e1000_init_module+0x0/0x3e returned 0 after 0 usecs
[    9.609580] calling  vortex_init+0x0/0xb0 @ 1
[    9.609580] bus: 'pci': add driver 3c59x
[    9.609589] initcall vortex_init+0x0/0xb0 returned 0 after 0 usecs
[    9.609592] calling  e100_init_module+0x0/0x5d @ 1
[    9.609594] e100: Intel(R) PRO/100 Network Driver, 3.5.24-k2-NAPI
[    9.609596] e100: Copyright(c) 1999-2006 Intel Corporation
[    9.609598] bus: 'pci': add driver e100
[    9.609628] initcall e100_init_module+0x0/0x5d returned 0 after 0 usecs
[    9.609631] calling  tg3_init+0x0/0x1b @ 1
[    9.609633] bus: 'pci': add driver tg3
[    9.609668] initcall tg3_init+0x0/0x1b returned 0 after 0 usecs
[    9.609671] calling  skge_init_module+0x0/0x1b @ 1
[    9.609673] bus: 'pci': add driver skge
[    9.609701] initcall skge_init_module+0x0/0x1b returned 0 after 0 usecs
[    9.609704] calling  net_olddevs_init+0x0/0x9e @ 1
[    9.609712] initcall net_olddevs_init+0x0/0x9e returned 0 after 0 usecs
[    9.609714] calling  init_nic+0x0/0x1b @ 1
[    9.609716] bus: 'pci': add driver forcedeth
[    9.609727] bus: 'pci': driver_probe_device: matched device 0000:00:0a.0 with driver forcedeth
[    9.609730] bus: 'pci': really_probe: probing driver forcedeth with device 0000:00:0a.0
[    9.609811] calling  1_async_port_probe+0x0/0x70 @ 5
[    9.610019] calling  2_async_port_probe+0x0/0x70 @ 32
[    9.610021] async_waiting @ 32
[    9.610547] forcedeth: Reverse Engineered nForce ethernet driver. Version 0.64.
[    9.611787] ACPI: PCI Interrupt Link [APCH] enabled at IRQ 23
[    9.612555] forcedeth 0000:00:0a.0: PCI INT A -> Link[APCH] -> GSI 23 (level, low) -> IRQ 23
[    9.613544] forcedeth 0000:00:0a.0: setting latency timer to 64
[    9.767034] ata1.00: ATA-6: HDS722525VLAT80, V36OA60A, max UDMA/100
[    9.772519] ata1.00: 488397168 sectors, multi 1: LBA48 
[    9.778522] ata1: nv_mode_filter: 0x3f39f&0x3f3ff->0x3f39f, BIOS=0x3f000 (0xc60000c0) ACPI=0x0
[    9.795944] ata1.00: configured for UDMA/100
[    9.800276] async_waiting @ 5
[    9.800513] async_continuing @ 5 after 0 usec
[    9.801707] scsi 0:0:0:0: Direct-Access     ATA      HDS722525VLAT80  V36O PQ: 0 ANSI: 5
[    9.802516] device: 'target0:0:0': device_add
[    9.803522] bus: 'scsi': add device target0:0:0
[    9.804519] PM: Adding info for scsi:target0:0:0
[    9.805528] device: '0:0:0:0': device_add
[    9.806536] bus: 'scsi': add device 0:0:0:0
[    9.807517] PM: Adding info for scsi:0:0:0:0
[    9.808520] bus: 'scsi': driver_probe_device: matched device 0:0:0:0 with driver sd
[    9.809512] bus: 'scsi': really_probe: probing driver sd with device 0:0:0:0
[    9.810558] device: '0:0:0:0': device_add
[    9.811535] PM: Adding info for No Bus:0:0:0:0
[    9.812538] driver: '0:0:0:0': driver_bound: bound to device 'sd'
[    9.812535] calling  3_sd_probe_async+0x0/0x1f0 @ 34
[    9.812535] sd 0:0:0:0: [sda] 488397168 512-byte logical blocks: (250 GB/232 GiB)
[    9.812535] sd 0:0:0:0: [sda] Write Protect is off
[    9.812535] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    9.812535] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    9.812535] device: '8:0': device_add
[    9.812535] PM: Adding info for No Bus:8:0
[    9.812535] device: 'sda': device_add
[    9.812535] PM: Adding info for No Bus:sda
[    9.813512] bus: 'scsi': really_probe: bound device 0:0:0:0 to driver sd
[    9.814512] device: '0:0:0:0': device_add
[    9.815525] PM: Adding info for No Bus:0:0:0:0
[    9.816569] device: '0:0:0:0': device_add
[    9.817656] PM: Adding info for No Bus:0:0:0:0
[    9.818548] initcall 1_async_port_probe+0x0/0x70 returned 0 after 204070 usecs
[    9.818537]  sda: sda1 sda2 sda3 < sda5 sda6 sda7 sda8 sda9 sda10 >
[    9.818556] device: 'sda1': device_add
[    9.818598] PM: Adding info for No Bus:sda1
[    9.818613] device: 'sda2': device_add
[    9.818647] PM: Adding info for No Bus:sda2
[    9.818660] device: 'sda3': device_add
[    9.818691] PM: Adding info for No Bus:sda3
[    9.818704] device: 'sda5': device_add
[    9.818736] PM: Adding info for No Bus:sda5
[    9.818750] device: 'sda6': device_add
[    9.818780] PM: Adding info for No Bus:sda6
[    9.818794] device: 'sda7': device_add
[    9.818826] PM: Adding info for No Bus:sda7
[    9.818843] device: 'sda8': device_add
[    9.818874] PM: Adding info for No Bus:sda8
[    9.818888] device: 'sda9': device_add
[    9.818920] PM: Adding info for No Bus:sda9
[    9.818934] device: 'sda10': device_add
[    9.818965] PM: Adding info for No Bus:sda10
[    9.819530] async_continuing @ 32 after 205046 usec
[    9.819522] sd 0:0:0:0: [sda] Attached SCSI disk
[    9.819522] initcall 3_sd_probe_async+0x0/0x1f0 returned 0 after 6834 usecs
[    9.985774] ata2.01: ATAPI: DVDRW IDE 16X, VER A079, max UDMA/66
[    9.986489] ata2: nv_mode_filter: 0x1f39f&0x73ff->0x739f, BIOS=0x7000 (0xc60000c0) ACPI=0x0
[    9.993704] ata2.01: configured for UDMA/33
[    9.995573] async_waiting @ 32
[    9.996483] async_continuing @ 32 after 0 usec
[    9.997344] scsi 1:0:1:0: CD-ROM            DVDRW    IDE 16X          A079 PQ: 0 ANSI: 5
[   10.005490] device: 'target1:0:1': device_add
[   10.010487] bus: 'scsi': add device target1:0:1
[   10.014488] PM: Adding info for scsi:target1:0:1
[   10.019493] device: '1:0:1:0': device_add
[   10.023503] bus: 'scsi': add device 1:0:1:0
[   10.027485] PM: Adding info for scsi:1:0:1:0
[   10.032486] bus: 'scsi': driver_probe_device: matched device 1:0:1:0 with driver sd
[   10.039477] bus: 'scsi': really_probe: probing driver sd with device 1:0:1:0
[   10.046487] device: '1:0:1:0': device_add
[   10.050490] PM: Adding info for No Bus:1:0:1:0
[   10.055492] device: '1:0:1:0': device_add
[   10.059576] PM: Adding info for No Bus:1:0:1:0
[   10.063492] initcall 2_async_port_probe+0x0/0x70 returned 0 after 443291 usecs
[   10.136646] device: 'eth0': device_add
[   10.138469] PM: Adding info for No Bus:eth0
[   10.139529] forcedeth 0000:00:0a.0: ifname eth0, PHY OUI 0x5043 @ 1, addr 00:13:d4:dc:41:12
[   10.140462] forcedeth 0000:00:0a.0: highdma csum gbit lnktim desc-v3
[   10.141462] driver: '0000:00:0a.0': driver_bound: bound to device 'forcedeth'
[   10.141475] work_for_cpu used greatest stack depth: 5232 bytes left
[   10.155462] bus: 'pci': really_probe: bound device 0000:00:0a.0 to driver forcedeth
[   10.163463] initcall init_nic+0x0/0x1b returned 0 after 540932 usecs
[   10.169459] calling  rtl8139_init_module+0x0/0x1b @ 1
[   10.174458] bus: 'pci': add driver 8139too
[   10.178472] bus: 'pci': driver_probe_device: matched device 0000:05:07.0 with driver 8139too
[   10.187455] bus: 'pci': really_probe: probing driver 8139too with device 0000:05:07.0
[   10.195360] 8139too: 8139too Fast Ethernet driver 0.9.28
[   10.195615] ACPI: PCI Interrupt Link [APC2] enabled at IRQ 17
[   10.196466] 8139too 0000:05:07.0: PCI INT A -> Link[APC2] -> GSI 17 (level, low) -> IRQ 17
[   10.197689] device: 'eth1': device_add
[   10.198527] PM: Adding info for No Bus:eth1
[   10.199494] 8139too 0000:05:07.0: eth1: RealTek RTL8139 at 0xffffc90010820000, 00:c0:df:03:68:5d, IRQ 17
[   10.200455] driver: '0000:05:07.0': driver_bound: bound to device '8139too'
[   10.207453] bus: 'pci': really_probe: bound device 0000:05:07.0 to driver 8139too
[   10.214477] initcall rtl8139_init_module+0x0/0x1b returned 0 after 39056 usecs
[   10.221450] calling  init_netconsole+0x0/0x1ef @ 1
[   10.226482] console [netcon0] enabled
[   10.230447] netconsole: network logging started
[   10.234448] initcall init_netconsole+0x0/0x1ef returned 0 after 7811 usecs
[   10.241447] calling  ehci_hcd_init+0x0/0x78 @ 1
[   10.246445] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[   10.252444] bus: 'pci': add driver ehci_hcd
[   10.257450] bus: 'pci': driver_probe_device: matched device 0000:00:02.1 with driver ehci_hcd
[   10.265442] bus: 'pci': really_probe: probing driver ehci_hcd with device 0000:00:02.1
[   10.274116] ACPI: PCI Interrupt Link [APCL] enabled at IRQ 22
[   10.274450] ehci_hcd 0000:00:02.1: PCI INT B -> Link[APCL] -> GSI 22 (level, low) -> IRQ 22
[   10.275449] ehci_hcd 0000:00:02.1: setting latency timer to 64
[   10.276441] ehci_hcd 0000:00:02.1: EHCI Host Controller
[   10.277488] ehci_hcd 0000:00:02.1: new USB bus registered, assigned bus number 1
[   10.283494] ehci_hcd 0000:00:02.1: debug port 1
[   10.284444] ehci_hcd 0000:00:02.1: cache line size of 32 is not supported
[   10.285466] ehci_hcd 0000:00:02.1: irq 22, io mem 0xfeb00000
[   10.292442] ehci_hcd 0000:00:02.1: USB 2.0 started, EHCI 1.00
[   10.293514] device: 'usb1': device_add
[   10.294605] bus: 'usb': add device usb1
[   10.295455] PM: Adding info for usb:usb1
[   10.296461] bus: 'usb': driver_probe_device: matched device usb1 with driver usb
[   10.297437] bus: 'usb': really_probe: probing driver usb with device usb1
[   10.298494] device: '1-0:1.0': device_add
[   10.299455] bus: 'usb': add device 1-0:1.0
[   10.300443] PM: Adding info for usb:1-0:1.0
[   10.301465] bus: 'usb': driver_probe_device: matched device 1-0:1.0 with driver hub
[   10.302436] bus: 'usb': really_probe: probing driver hub with device 1-0:1.0
[   10.303441] hub 1-0:1.0: USB hub found
[   10.304442] hub 1-0:1.0: 10 ports detected
[   10.305495] driver: '1-0:1.0': driver_bound: bound to device 'hub'
[   10.306436] bus: 'usb': really_probe: bound device 1-0:1.0 to driver hub
[   10.307440] device: 'ep_81': device_add
[   10.308449] PM: Adding info for No Bus:ep_81
[   10.309439] device: 'usbdev1.1': device_add
[   10.310462] PM: Adding info for No Bus:usbdev1.1
[   10.311464] driver: 'usb1': driver_bound: bound to device 'usb'
[   10.312435] bus: 'usb': really_probe: bound device usb1 to driver usb
[   10.313438] device: 'ep_00': device_add
[   10.314450] PM: Adding info for No Bus:ep_00
[   10.315484] driver: '0000:00:02.1': driver_bound: bound to device 'ehci_hcd'
[   10.315495] work_for_cpu used greatest stack depth: 5024 bytes left
[   10.328434] bus: 'pci': really_probe: bound device 0000:00:02.1 to driver ehci_hcd
[   10.336446] initcall ehci_hcd_init+0x0/0x78 returned 0 after 87877 usecs
[   10.342431] calling  ohci_hcd_mod_init+0x0/0x54 @ 1
[   10.347429] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[   10.353429] bus: 'pci': add driver ohci_hcd
[   10.358434] bus: 'pci': driver_probe_device: matched device 0000:00:02.0 with driver ohci_hcd
[   10.366427] bus: 'pci': really_probe: probing driver ohci_hcd with device 0000:00:02.0
[   10.375144] ACPI: PCI Interrupt Link [APCF] enabled at IRQ 21
[   10.375440] ohci_hcd 0000:00:02.0: PCI INT A -> Link[APCF] -> GSI 21 (level, low) -> IRQ 21
[   10.376440] ohci_hcd 0000:00:02.0: setting latency timer to 64
[   10.377426] ohci_hcd 0000:00:02.0: OHCI Host Controller
[   10.378435] ohci_hcd 0000:00:02.0: new USB bus registered, assigned bus number 2
[   10.382464] ohci_hcd 0000:00:02.0: irq 21, io mem 0xda102000
[   10.436464] device: 'usb2': device_add
[   10.437561] bus: 'usb': add device usb2
[   10.438432] PM: Adding info for usb:usb2
[   10.439436] bus: 'usb': driver_probe_device: matched device usb2 with driver usb
[   10.440415] bus: 'usb': really_probe: probing driver usb with device usb2
[   10.441430] device: '2-0:1.0': device_add
[   10.442430] bus: 'usb': add device 2-0:1.0
[   10.443420] PM: Adding info for usb:2-0:1.0
[   10.444427] bus: 'usb': driver_probe_device: matched device 2-0:1.0 with driver hub
[   10.445414] bus: 'usb': really_probe: probing driver hub with device 2-0:1.0
[   10.446419] hub 2-0:1.0: USB hub found
[   10.447420] hub 2-0:1.0: 10 ports detected
[   10.448447] driver: '2-0:1.0': driver_bound: bound to device 'hub'
[   10.449414] bus: 'usb': really_probe: bound device 2-0:1.0 to driver hub
[   10.450418] device: 'ep_81': device_add
[   10.451430] PM: Adding info for No Bus:ep_81
[   10.452417] device: 'usbdev2.1': device_add
[   10.453466] PM: Adding info for No Bus:usbdev2.1
[   10.454423] driver: 'usb2': driver_bound: bound to device 'usb'
[   10.455413] bus: 'usb': really_probe: bound device usb2 to driver usb
[   10.456416] device: 'ep_00': device_add
[   10.457426] PM: Adding info for No Bus:ep_00
[   10.458457] driver: '0000:00:02.0': driver_bound: bound to device 'ohci_hcd'
[   10.458468] work_for_cpu used greatest stack depth: 4768 bytes left
[   10.471412] bus: 'pci': really_probe: bound device 0000:00:02.0 to driver ohci_hcd
[   10.479434] initcall ohci_hcd_mod_init+0x0/0x54 returned 0 after 128886 usecs
[   10.486409] calling  uhci_hcd_init+0x0/0xbf @ 1
[   10.490407] uhci_hcd: USB Universal Host Controller Interface driver
[   10.497432] bus: 'pci': add driver uhci_hcd
[   10.501436] initcall uhci_hcd_init+0x0/0xbf returned 0 after 10740 usecs
[   10.508406] calling  usb_usual_init+0x0/0x3d @ 1
[   10.512421] bus: 'usb': add driver libusual
[   10.516439] usbcore: registered new interface driver libusual
[   10.522404] initcall usb_usual_init+0x0/0x3d returned 0 after 9764 usecs
[   10.529402] calling  i8042_init+0x0/0x31d @ 1
[   10.533402] bus: 'pnp': add driver i8042 kbd
[   10.538419] bus: 'pnp': driver_probe_device: matched device 00:0a with driver i8042 kbd
[   10.546400] bus: 'pnp': really_probe: probing driver i8042 kbd with device 00:0a
[   10.553406] driver: '00:0a': driver_bound: bound to device 'i8042 kbd'
[   10.560398] bus: 'pnp': really_probe: bound device 00:0a to driver i8042 kbd
[   10.567411] bus: 'pnp': add driver i8042 aux
[   10.571421] i8042: PNP: PS/2 Controller [PNP0303:PS2K] at 0x60,0x64 irq 1
[   10.578395] i8042: PNP: PS/2 appears to have AUX port disabled, if this is incorrect please boot with i8042.nopnp
[   10.588409] Registering platform device 'i8042'. Parent at platform
[   10.594392] device: 'i8042': device_add
[   10.598396] bus: 'platform': add device i8042
[   10.602398] PM: Adding info for platform:i8042
[   10.607400] bus: 'platform': add driver i8042
[   10.611394] bus: 'platform': driver_probe_device: matched device i8042 with driver i8042
[   10.619388] bus: 'platform': really_probe: probing driver i8042 with device i8042
[   10.628110] serio: i8042 KBD port at 0x60,0x64 irq 1
[   10.632406] driver: 'i8042': driver_bound: bound to device 'i8042'
[   10.639386] bus: 'platform': really_probe: bound device i8042 to driver i8042
[   10.646698] initcall i8042_init+0x0/0x31d returned 0 after 110334 usecs
[   10.646425] device: 'serio0': device_add
[   10.646437] bus: 'serio': add device serio0
[   10.646452] PM: Adding info for serio:serio0
[   10.647386] calling  mousedev_init+0x0/0x5e @ 1
[   10.648404] device: 'mice': device_add
[   10.649464] PM: Adding info for No Bus:mice
[   10.650410] mousedev: PS/2 mouse device common for all mice
[   10.651384] initcall mousedev_init+0x0/0x5e returned 0 after 2929 usecs
[   10.652383] calling  atkbd_init+0x0/0x1b @ 1
[   10.653383] bus: 'serio': add driver atkbd
[   10.654407] initcall atkbd_init+0x0/0x1b returned 0 after 976 usecs
[   10.655384] calling  init_ladder+0x0/0x12 @ 1
[   10.656388] bus: 'serio': driver_probe_device: matched device serio0 with driver atkbd
[   10.657383] bus: 'serio': really_probe: probing driver atkbd with device serio0
[   10.658474] cpuidle: using governor ladder
[   10.659384] initcall init_ladder+0x0/0x12 returned 0 after 2929 usecs
[   10.660383] calling  flow_cache_init_global+0x0/0x13a @ 1
[   10.661450] initcall flow_cache_init_global+0x0/0x13a returned 0 after 0 usecs
[   10.662383] calling  init_syncookies+0x0/0x19 @ 1
[   10.663411] initcall init_syncookies+0x0/0x19 returned 0 after 0 usecs
[   10.664382] calling  ipv4_netfilter_init+0x0/0x20 @ 1
[   10.665394] initcall ipv4_netfilter_init+0x0/0x20 returned 0 after 0 usecs
[   10.666381] calling  packet_init+0x0/0x44 @ 1
[   10.667382] NET: Registered protocol family 17
[   10.668404] initcall packet_init+0x0/0x44 returned 0 after 976 usecs
[   10.669381] calling  dsa_init_module+0x0/0x14 @ 1
[   10.670381] initcall dsa_init_module+0x0/0x14 returned 0 after 0 usecs
[   10.671380] calling  edsa_init_module+0x0/0x14 @ 1
[   10.672380] initcall edsa_init_module+0x0/0x14 returned 0 after 0 usecs
[   10.673379] calling  mv88e6123_61_65_init+0x0/0x14 @ 1
[   10.674400] initcall mv88e6123_61_65_init+0x0/0x14 returned 0 after 0 usecs
[   10.675381] calling  mv88e6131_init+0x0/0x14 @ 1
[   10.676380] initcall mv88e6131_init+0x0/0x14 returned 0 after 0 usecs
[   10.677379] calling  dsa_init_module+0x0/0x12 @ 1
[   10.678379] bus: 'platform': add driver dsa
[   10.679394] initcall dsa_init_module+0x0/0x12 returned 0 after 976 usecs
[   10.680379] calling  dcbnl_init+0x0/0x47 @ 1
[   10.681379] initcall dcbnl_init+0x0/0x47 returned 0 after 0 usecs
[   10.682379] calling  rio_init_mports+0x0/0x6a @ 1
[   10.683389] initcall rio_init_mports+0x0/0x6a returned 0 after 0 usecs
[   10.684380] calling  mcheck_debugfs_init+0x0/0x3b @ 1
[   10.685402] initcall mcheck_debugfs_init+0x0/0x3b returned 0 after 0 usecs
[   10.687379] calling  severities_debugfs_init+0x0/0x3b @ 1
[   10.688395] initcall severities_debugfs_init+0x0/0x3b returned 0 after 0 usecs
[   10.689378] calling  hpet_insert_resource+0x0/0x23 @ 1
[   10.690377] initcall hpet_insert_resource+0x0/0x23 returned 1 after 0 usecs
[   10.691377] initcall hpet_insert_resource+0x0/0x23 returned with error code 1 
[   10.692377] calling  update_mp_table+0x0/0x422 @ 1
[   10.693377] initcall update_mp_table+0x0/0x422 returned 0 after 0 usecs
[   10.694377] calling  lapic_insert_resource+0x0/0x3f @ 1
[   10.695378] initcall lapic_insert_resource+0x0/0x3f returned 0 after 0 usecs
[   10.696377] calling  io_apic_bug_finalize+0x0/0x1b @ 1
[   10.697377] initcall io_apic_bug_finalize+0x0/0x1b returned 0 after 0 usecs
[   10.698377] calling  check_early_ioremap_leak+0x0/0x50 @ 1
[   10.699377] initcall check_early_ioremap_leak+0x0/0x50 returned 0 after 0 usecs
[   10.700376] calling  sched_init_debug+0x0/0x24 @ 1
[   10.701397] device: 'input0': device_add
[   10.702406] initcall sched_init_debug+0x0/0x24 returned 0 after 976 usecs
[   10.703378] calling  init_oops_id+0x0/0x40 @ 1
[   10.704381] initcall init_oops_id+0x0/0x40 returned 0 after 0 usecs
[   10.705375] calling  printk_late_init+0x0/0x4d @ 1
[   10.706375] initcall printk_late_init+0x0/0x4d returned 0 after 0 usecs
[   10.707375] calling  pm_qos_power_init+0x0/0xdc @ 1
[   10.708377] device: 'cpu_dma_latency': device_add
[   10.709435] PM: Adding info for No Bus:cpu_dma_latency
[   10.711387] device: 'network_latency': device_add
[   10.712410] PM: Adding info for No Bus:network_latency
[   10.713384] device: 'network_throughput': device_add
[   10.714406] PM: Adding info for No Bus:network_throughput
[   10.715383] initcall pm_qos_power_init+0x0/0xdc returned 0 after 6834 usecs
[   10.716374] calling  software_resume+0x0/0x220 @ 1
[   10.717416] PM: Adding info for No Bus:input0
[   10.718401] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input0
[   10.719411] driver: 'serio0': driver_bound: bound to device 'atkbd'
[   10.720373] bus: 'serio': really_probe: bound device serio0 to driver atkbd
[   10.721390] PM: Hibernation image not present or could not be loaded.
[   10.722373] initcall software_resume+0x0/0x220 returned -2 after 4882 usecs
[   10.723373] initcall software_resume+0x0/0x220 returned with error code -2 
[   10.724372] calling  taskstats_init+0x0/0x95 @ 1
[   10.725379] registered taskstats version 1
[   10.726372] initcall taskstats_init+0x0/0x95 returned 0 after 976 usecs
[   10.727372] calling  clear_boot_tracer+0x0/0x2d @ 1
[   10.728372] initcall clear_boot_tracer+0x0/0x2d returned 0 after 0 usecs
[   10.729372] calling  kdb_ftrace_register+0x0/0x2f @ 1
[   10.730375] initcall kdb_ftrace_register+0x0/0x2f returned 0 after 0 usecs
[   10.731371] calling  max_swapfiles_check+0x0/0x8 @ 1
[   10.732371] initcall max_swapfiles_check+0x0/0x8 returned 0 after 0 usecs
[   10.733371] calling  random32_reseed+0x0/0xa2 @ 1
[   10.734381] initcall random32_reseed+0x0/0xa2 returned 0 after 0 usecs
[   10.735371] calling  pci_resource_alignment_sysfs_init+0x0/0x19 @ 1
[   10.736374] initcall pci_resource_alignment_sysfs_init+0x0/0x19 returned 0 after 0 usecs
[   10.737370] calling  pci_sysfs_init+0x0/0x51 @ 1
[   10.738686] initcall pci_sysfs_init+0x0/0x51 returned 0 after 0 usecs
[   10.739371] calling  seqgen_init+0x0/0xf @ 1
[   10.740381] initcall seqgen_init+0x0/0xf returned 0 after 0 usecs
[   10.741370] calling  scsi_complete_async_scans+0x0/0x150 @ 1
[   10.742369] initcall scsi_complete_async_scans+0x0/0x150 returned 0 after 0 usecs
[   10.743370] calling  pci_mmcfg_late_insert_resources+0x0/0x61 @ 1
[   10.744371] initcall pci_mmcfg_late_insert_resources+0x0/0x61 returned 0 after 0 usecs
[   10.745369] calling  tcp_congestion_default+0x0/0x12 @ 1
[   10.746371] initcall tcp_congestion_default+0x0/0x12 returned 0 after 0 usecs
[   10.747369] calling  initialize_hashrnd+0x0/0x19 @ 1
[   10.748372] initcall initialize_hashrnd+0x0/0x19 returned 0 after 0 usecs
[   10.749947] async_waiting @ 1
[   10.750371] async_continuing @ 1 after 0 usec
[   10.764335] EXT3-fs (sda6): recovery required on readonly filesystem
[   10.770365] EXT3-fs (sda6): write access will be enabled during recovery
[   10.780702] EXT3-fs: barriers not enabled
[   10.793144] kjournald starting.  Commit interval 5 seconds
[   10.793236] EXT3-fs (sda6): recovery complete
[   10.793966] EXT3-fs (sda6): mounted filesystem with ordered data mode
[   10.794009] VFS: Mounted root (ext3 filesystem) readonly on device 8:6.
[   10.794028] async_waiting @ 1
[   10.794030] async_continuing @ 1 after 0 usec
[   10.823492] Freeing unused kernel memory: 616k freed
[   11.087787] ------------[ cut here ]------------
[   11.088312] Kernel BUG at ffffffff8100a140 [verbose debug info unavailable]
[   11.088312] invalid opcode: 0000 [#1] SMP 
[   11.088312] last sysfs file: 
[   11.088312] CPU 1 
[   11.088312] Modules linked in:
[   11.088312] 
[   11.088312] Pid: 41, comm: modprobe Not tainted 2.6.39-rc2-tip+ #113394  
[   11.088312] RIP: 0010:[<ffffffff8100a140>]  [<ffffffff8100a140>] start_thread_common.constprop.1+0x100/0x110
[   11.088312] RSP: 0018:ffff88003d7c5c40  EFLAGS: 00010246
[   11.088312] RAX: ffff88003d7c5fd8 RBX: ffff88003d74bd40 RCX: 0000000000000033
[   11.088312] RDX: 00007ffffffff000 RSI: 000000310f600ac0 RDI: 0000000000000000
[   11.088312] RBP: ffff88003d7c5c60 R08: 0000000000000000 R09: 0000000000000004
[   11.088312] R10: 00007fff4ae4dd68 R11: 0000000000000000 R12: 00007fff4ae4dd60
[   11.088312] R13: 000000310f600ac0 R14: 0000000000000033 R15: ffff88003d74bd40
[   11.088312] FS:  00007f48d909f780(0000) GS:ffff88003fd00000(0000) knlGS:0000000000000000
[   11.088312] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[   11.088312] CR2: 00007fff4ae4def9 CR3: 000000003d7af000 CR4: 00000000000006e0
[   11.088312] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   11.088312] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[   11.088312] Process modprobe (pid: 41, threadinfo ffff88003d7c4000, task ffff88003d74bd40)
[   11.088312] Stack:
[   11.088312]  ffff88003d72c400 ffff88003d60a400 0000000000000000 ffff88003d7c5e80
[   11.088312]  ffff88003d7c5c70 ffffffff8100a546 ffff88003d7c5d90 ffffffff8117c7de
[   11.088312]  ffff88003d74bd40 0000000000000004 00007fff4ae4dda8 00007fff4ae4dd68
[   11.088312] Call Trace:
[   11.088312]  [<ffffffff8100a546>] start_thread+0x16/0x20
[   11.088312]  [<ffffffff8117c7de>] load_elf_binary+0x14fe/0x1980
[   11.088312]  [<ffffffff81138392>] search_binary_handler+0xc2/0x2a0
[   11.088312]  [<ffffffff8117b2e0>] ? load_elf_library+0x2b0/0x2b0
[   11.088312]  [<ffffffff8113a35c>] do_execve+0x24c/0x2d0
[   11.088312]  [<ffffffff81014b97>] sys_execve+0x47/0x80
[   11.088312]  [<ffffffff8145b698>] kernel_execve+0x68/0xd0
[   11.088312]  [<ffffffff8106ca83>] ? ____call_usermodehelper+0x93/0xa0
[   11.088312]  [<ffffffff8145b624>] kernel_thread_helper+0x4/0x10
[   11.088312]  [<ffffffff81459f54>] ? retint_restore_args+0x13/0x13
[   11.088312]  [<ffffffff8106c9f0>] ? call_usermodehelper_setup+0xe0/0xe0
[   11.088312]  [<ffffffff8145b620>] ? gs_change+0x13/0x13
[   11.088312] Code: f0 4c 8b 75 f8 c9 c3 0f 1f 40 00 48 8b 3d 19 01 64 00 48 85 ff 74 14 48 89 bb a0 04 00 00 48 c7 05 02 01 64 00 00 00 00 00 eb a1 <0f> 0b 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 55 48 89 e5 66 
[   11.088312] RIP  [<ffffffff8100a140>] start_thread_common.constprop.1+0x100/0x110
[   11.088312]  RSP <ffff88003d7c5c40>
[   11.340286] ---[ end trace f7578c669bd4d836 ]---
[   11.345277] Kernel panic - not syncing: Fatal exception

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [RFC v3 0/8] x86, xsave: rework of extended state handling, LWP support
  2011-04-07  7:23             ` Ingo Molnar
@ 2011-04-07 15:30               ` Hans Rosenfeld
  2011-04-07 16:08                 ` [RFC v4 6/8] x86, xsave: add support for non-lazy xstates Hans Rosenfeld
                                   ` (2 more replies)
  2011-05-16 19:10               ` [RFC v3 0/8] x86, xsave: rework of extended state handling, LWP support Hans Rosenfeld
  1 sibling, 3 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-04-07 15:30 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: hpa, brgerst, tglx, suresh.b.siddha, eranian, Richter, Robert,
	Herrmann3, Andreas, x86, linux-kernel

On Thu, Apr 07, 2011 at 03:23:05AM -0400, Ingo Molnar wrote:
> 
> FYI, the bits in tip:x86/xsave crash on boot on an AMD X2 testbox:
> 
> [   10.823492] Freeing unused kernel memory: 616k freed
> [   11.087787] ------------[ cut here ]------------
> [   11.088312] Kernel BUG at ffffffff8100a140 [verbose debug info unavailable]
> [   11.088312] invalid opcode: 0000 [#1] SMP 
> [   11.088312] last sysfs file: 
> [   11.088312] CPU 1 
> [   11.088312] Modules linked in:
> [   11.088312] 
> [   11.088312] Pid: 41, comm: modprobe Not tainted 2.6.39-rc2-tip+ #113394  
> [   11.088312] RIP: 0010:[<ffffffff8100a140>]  [<ffffffff8100a140>] start_thread_common.constprop.1+0x100/0x110
> [   11.088312] RSP: 0018:ffff88003d7c5c40  EFLAGS: 00010246
> [   11.088312] RAX: ffff88003d7c5fd8 RBX: ffff88003d74bd40 RCX: 0000000000000033
> [   11.088312] RDX: 00007ffffffff000 RSI: 000000310f600ac0 RDI: 0000000000000000
> [   11.088312] RBP: ffff88003d7c5c60 R08: 0000000000000000 R09: 0000000000000004
> [   11.088312] R10: 00007fff4ae4dd68 R11: 0000000000000000 R12: 00007fff4ae4dd60
> [   11.088312] R13: 000000310f600ac0 R14: 0000000000000033 R15: ffff88003d74bd40
> [   11.088312] FS:  00007f48d909f780(0000) GS:ffff88003fd00000(0000) knlGS:0000000000000000
> [   11.088312] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> [   11.088312] CR2: 00007fff4ae4def9 CR3: 000000003d7af000 CR4: 00000000000006e0
> [   11.088312] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [   11.088312] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> [   11.088312] Process modprobe (pid: 41, threadinfo ffff88003d7c4000, task ffff88003d74bd40)
> [   11.088312] Stack:
> [   11.088312]  ffff88003d72c400 ffff88003d60a400 0000000000000000 ffff88003d7c5e80
> [   11.088312]  ffff88003d7c5c70 ffffffff8100a546 ffff88003d7c5d90 ffffffff8117c7de
> [   11.088312]  ffff88003d74bd40 0000000000000004 00007fff4ae4dda8 00007fff4ae4dd68
> [   11.088312] Call Trace:
> [   11.088312]  [<ffffffff8100a546>] start_thread+0x16/0x20
> [   11.088312]  [<ffffffff8117c7de>] load_elf_binary+0x14fe/0x1980
> [   11.088312]  [<ffffffff81138392>] search_binary_handler+0xc2/0x2a0
> [   11.088312]  [<ffffffff8117b2e0>] ? load_elf_library+0x2b0/0x2b0
> [   11.088312]  [<ffffffff8113a35c>] do_execve+0x24c/0x2d0
> [   11.088312]  [<ffffffff81014b97>] sys_execve+0x47/0x80
> [   11.088312]  [<ffffffff8145b698>] kernel_execve+0x68/0xd0
> [   11.088312]  [<ffffffff8106ca83>] ? ____call_usermodehelper+0x93/0xa0
> [   11.088312]  [<ffffffff8145b624>] kernel_thread_helper+0x4/0x10
> [   11.088312]  [<ffffffff81459f54>] ? retint_restore_args+0x13/0x13
> [   11.088312]  [<ffffffff8106c9f0>] ? call_usermodehelper_setup+0xe0/0xe0
> [   11.088312]  [<ffffffff8145b620>] ? gs_change+0x13/0x13
> [   11.088312] Code: f0 4c 8b 75 f8 c9 c3 0f 1f 40 00 48 8b 3d 19 01 64 00 48 85 ff 74 14 48 89 bb a0 04 00 00 48 c7 05 02 01 64 00 00 00 00 00 eb a1 <0f> 0b 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 55 48 89 e5 66 
> [   11.088312] RIP  [<ffffffff8100a140>] start_thread_common.constprop.1+0x100/0x110
> [   11.088312]  RSP <ffff88003d7c5c40>

Sorry for that, it seems I made a wrong assumption about
kernel_execve() usage. Updated patches will follow shortly.


Hans


-- 
%SYSTEM-F-ANARCHISM, The operating system has been overthrown


^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC v4 6/8] x86, xsave: add support for non-lazy xstates
  2011-04-07 15:30               ` Hans Rosenfeld
@ 2011-04-07 16:08                 ` Hans Rosenfeld
  2011-04-07 16:08                 ` [RFC v4 8/8] x86, xsave: remove lazy allocation of xstate area Hans Rosenfeld
  2011-04-13 10:58                 ` [PATCH] x86, xsave: fix non-lazy allocation of the xsave area Hans Rosenfeld
  2 siblings, 0 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-04-07 16:08 UTC (permalink / raw)
  To: hpa, mingo
  Cc: brgerst, tglx, suresh.b.siddha, eranian, robert.richter,
	Andreas.Herrmann3, x86, linux-kernel, Hans Rosenfeld

Non-lazy xstates are, as the name suggests, extended states that cannot
be saved or restored lazily. The state for AMDs LWP feature is an
example of this.

This patch adds support for this kind of xstates. If any such states are
present and supported on the running system, they will always be enabled
in xstate_mask so that they are always restored in switch_to. Since lazy
allocation of the xstate area won't work when non-lazy xstates are used,
all user tasks will always have a xstate area preallocated.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/include/asm/i387.h  |   14 ++++++++++++++
 arch/x86/include/asm/xsave.h |    5 +++--
 arch/x86/kernel/process_32.c |    2 +-
 arch/x86/kernel/process_64.c |    2 +-
 arch/x86/kernel/xsave.c      |    6 +++++-
 5 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index b8f9617..67233a5 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -330,6 +330,20 @@ static inline void fpu_copy(struct fpu *dst, struct fpu *src)
 
 extern void fpu_finit(struct fpu *fpu);
 
+static inline void fpu_clear(struct fpu *fpu)
+{
+	if (pcntxt_mask & XCNTXT_NONLAZY) {
+		if (!fpu_allocated(fpu) && fpu_alloc(fpu))
+			do_group_exit(SIGKILL);
+
+		memset(fpu->state, 0, xstate_size);
+		fpu_finit(fpu);
+		set_used_math();
+	} else {
+		fpu_free(fpu);
+	}
+}
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* _ASM_X86_I387_H */
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
index b8861d4..4ccee3c 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
@@ -23,9 +23,10 @@
 /*
  * These are the features that the OS can handle currently.
  */
-#define XCNTXT_MASK	(XSTATE_FP | XSTATE_SSE | XSTATE_YMM)
+#define XCNTXT_LAZY	(XSTATE_FP | XSTATE_SSE | XSTATE_YMM)
+#define XCNTXT_NONLAZY	0
 
-#define XCNTXT_LAZY	XCNTXT_MASK
+#define XCNTXT_MASK	(XCNTXT_LAZY | XCNTXT_NONLAZY)
 
 #ifdef CONFIG_X86_64
 #define REX_PREFIX	"0x48, "
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 8df07c3..a878736 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -257,7 +257,7 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)
 	/*
 	 * Free the old FP and other extended state
 	 */
-	free_thread_xstate(current);
+	fpu_clear(&current->thread.fpu);
 }
 EXPORT_SYMBOL_GPL(start_thread);
 
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index cbf1a67..8ff35fc 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -344,7 +344,7 @@ start_thread_common(struct pt_regs *regs, unsigned long new_ip,
 	/*
 	 * Free the old FP and other extended state
 	 */
-	free_thread_xstate(current);
+	fpu_clear(&current->thread.fpu);
 }
 
 void
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index d42810f..56ab3d3 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -16,6 +16,7 @@
  * Supported feature mask by the CPU and the kernel.
  */
 u64 pcntxt_mask;
+EXPORT_SYMBOL(pcntxt_mask);
 
 /*
  * Represents init state for the supported extended state.
@@ -260,7 +261,7 @@ int restore_xstates_sigframe(void __user *buf, unsigned int size)
 	struct task_struct *tsk = current;
 	struct _fpstate_ia32 __user *fp = buf;
 	struct xsave_struct *xsave;
-	u64 xstate_mask = 0;
+	u64 xstate_mask = pcntxt_mask & XCNTXT_NONLAZY;
 	int err;
 
 	if (!buf) {
@@ -477,6 +478,9 @@ static void __init xstate_enable_boot_cpu(void)
 	printk(KERN_INFO "xsave/xrstor: enabled xstate_bv 0x%llx, "
 	       "cntxt size 0x%x\n",
 	       pcntxt_mask, xstate_size);
+
+	if (pcntxt_mask & XCNTXT_NONLAZY)
+		task_thread_info(&init_task)->xstate_mask |= XCNTXT_NONLAZY;
 }
 
 /*
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [RFC v4 8/8] x86, xsave: remove lazy allocation of xstate area
  2011-04-07 15:30               ` Hans Rosenfeld
  2011-04-07 16:08                 ` [RFC v4 6/8] x86, xsave: add support for non-lazy xstates Hans Rosenfeld
@ 2011-04-07 16:08                 ` Hans Rosenfeld
  2011-04-13 10:58                 ` [PATCH] x86, xsave: fix non-lazy allocation of the xsave area Hans Rosenfeld
  2 siblings, 0 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-04-07 16:08 UTC (permalink / raw)
  To: hpa, mingo
  Cc: brgerst, tglx, suresh.b.siddha, eranian, robert.richter,
	Andreas.Herrmann3, x86, linux-kernel, Hans Rosenfeld

This patch completely removes lazy allocation of the xstate area. All
user tasks will always have an xstate area preallocated, just like they
already do when non-lazy features are present. The size of the xsave
area ranges from 112 to 960 bytes, depending on the xstates present and
enabled. Since it is common to use SSE etc. for optimization, the actual
overhead is expected to negligible.

This removes some of the special-case handling of non-lazy xstates. It
also greatly simplifies init_fpu() by removing the allocation code, the
check for presence of the xstate area or init_fpu() return value.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/include/asm/i387.h   |   16 ++++++----------
 arch/x86/kernel/i387.c        |   41 +++++++++--------------------------------
 arch/x86/kernel/traps.c       |   16 ++--------------
 arch/x86/kernel/xsave.c       |    8 ++------
 arch/x86/kvm/x86.c            |    4 ++--
 arch/x86/math-emu/fpu_entry.c |    8 ++------
 6 files changed, 23 insertions(+), 70 deletions(-)

diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index 67233a5..833b6f1 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -40,7 +40,7 @@
 extern unsigned int sig_xstate_size;
 extern void fpu_init(void);
 extern void mxcsr_feature_mask_init(void);
-extern int init_fpu(struct task_struct *child);
+extern void init_fpu(struct task_struct *child);
 extern asmlinkage void math_state_restore(void);
 extern int dump_fpu(struct pt_regs *, struct user_i387_struct *);
 
@@ -332,16 +332,12 @@ extern void fpu_finit(struct fpu *fpu);
 
 static inline void fpu_clear(struct fpu *fpu)
 {
-	if (pcntxt_mask & XCNTXT_NONLAZY) {
-		if (!fpu_allocated(fpu) && fpu_alloc(fpu))
-			do_group_exit(SIGKILL);
+	if (!fpu_allocated(fpu) && fpu_alloc(fpu))
+		do_group_exit(SIGKILL);
 
-		memset(fpu->state, 0, xstate_size);
-		fpu_finit(fpu);
-		set_used_math();
-	} else {
-		fpu_free(fpu);
-	}
+	memset(fpu->state, 0, xstate_size);
+	fpu_finit(fpu);
+	set_used_math();
 }
 
 #endif /* __ASSEMBLY__ */
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
index dd9644a..df0b139 100644
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -127,9 +127,9 @@ EXPORT_SYMBOL_GPL(fpu_finit);
  * value at reset if we support XMM instructions and then
  * remember the current task has used the FPU.
  */
-int init_fpu(struct task_struct *tsk)
+void init_fpu(struct task_struct *tsk)
 {
-	int ret;
+	BUG_ON(tsk->flags & PF_KTHREAD);
 
 	if (tsk_used_math(tsk)) {
 		if (HAVE_HWFP && tsk == current) {
@@ -137,20 +137,12 @@ int init_fpu(struct task_struct *tsk)
 			save_xstates(tsk);
 			preempt_enable();
 		}
-		return 0;
+		return;
 	}
 
-	/*
-	 * Memory allocation at the first usage of the FPU and other state.
-	 */
-	ret = fpu_alloc(&tsk->thread.fpu);
-	if (ret)
-		return ret;
-
 	fpu_finit(&tsk->thread.fpu);
 
 	set_stopped_child_used_math(tsk);
-	return 0;
 }
 EXPORT_SYMBOL_GPL(init_fpu);
 
@@ -173,14 +165,10 @@ int xfpregs_get(struct task_struct *target, const struct user_regset *regset,
 		unsigned int pos, unsigned int count,
 		void *kbuf, void __user *ubuf)
 {
-	int ret;
-
 	if (!cpu_has_fxsr)
 		return -ENODEV;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	if (use_xsaveopt())
 		sanitize_i387_state(target);
@@ -198,9 +186,7 @@ int xfpregs_set(struct task_struct *target, const struct user_regset *regset,
 	if (!cpu_has_fxsr)
 		return -ENODEV;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	if (use_xsaveopt())
 		sanitize_i387_state(target);
@@ -232,9 +218,7 @@ int xstateregs_get(struct task_struct *target, const struct user_regset *regset,
 	if (!cpu_has_xsave)
 		return -ENODEV;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	/*
 	 * Copy the 48bytes defined by the software first into the xstate
@@ -262,9 +246,7 @@ int xstateregs_set(struct task_struct *target, const struct user_regset *regset,
 	if (!cpu_has_xsave)
 		return -ENODEV;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
 				 &target->thread.fpu.state->xsave, 0, -1);
@@ -427,11 +409,8 @@ int fpregs_get(struct task_struct *target, const struct user_regset *regset,
 	       void *kbuf, void __user *ubuf)
 {
 	struct user_i387_ia32_struct env;
-	int ret;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	if (!HAVE_HWFP)
 		return fpregs_soft_get(target, regset, pos, count, kbuf, ubuf);
@@ -462,9 +441,7 @@ int fpregs_set(struct task_struct *target, const struct user_regset *regset,
 	struct user_i387_ia32_struct env;
 	int ret;
 
-	ret = init_fpu(target);
-	if (ret)
-		return ret;
+	init_fpu(target);
 
 	if (use_xsaveopt())
 		sanitize_i387_state(target);
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 872fc78..c8fbd04 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -734,20 +734,8 @@ asmlinkage void math_state_restore(void)
 	struct thread_info *thread = current_thread_info();
 	struct task_struct *tsk = thread->task;
 
-	if (!tsk_used_math(tsk)) {
-		local_irq_enable();
-		/*
-		 * does a slab alloc which can sleep
-		 */
-		if (init_fpu(tsk)) {
-			/*
-			 * ran out of memory!
-			 */
-			do_group_exit(SIGKILL);
-			return;
-		}
-		local_irq_disable();
-	}
+	if (!tsk_used_math(tsk))
+		init_fpu(tsk);
 
 	restore_xstates(tsk, XCNTXT_LAZY);
 }
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index a188362..62f2df8 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -264,7 +264,6 @@ int restore_xstates_sigframe(void __user *buf, unsigned int size)
 	struct _fpstate_ia32 __user *fp = buf;
 	struct xsave_struct *xsave;
 	u64 xstate_mask = pcntxt_mask & XCNTXT_NONLAZY;
-	int err;
 
 	if (!buf) {
 		if (used_math()) {
@@ -277,11 +276,8 @@ int restore_xstates_sigframe(void __user *buf, unsigned int size)
 	if (!access_ok(VERIFY_READ, buf, size))
 		return -EACCES;
 
-	if (!used_math()) {
-		err = init_fpu(tsk);
-		if (err)
-			return err;
-	}
+	if (!used_math())
+		init_fpu(tsk);
 
 	if (!HAVE_HWFP) {
 		set_used_math();
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index bc04e15..17e52a9 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5386,8 +5386,8 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
 	int r;
 	sigset_t sigsaved;
 
-	if (!tsk_used_math(current) && init_fpu(current))
-		return -ENOMEM;
+	if (!tsk_used_math(current))
+		init_fpu(current);
 
 	if (vcpu->sigset_active)
 		sigprocmask(SIG_SETMASK, &vcpu->sigset, &sigsaved);
diff --git a/arch/x86/math-emu/fpu_entry.c b/arch/x86/math-emu/fpu_entry.c
index 7718541..472e2b9 100644
--- a/arch/x86/math-emu/fpu_entry.c
+++ b/arch/x86/math-emu/fpu_entry.c
@@ -147,12 +147,8 @@ void math_emulate(struct math_emu_info *info)
 	unsigned long code_limit = 0;	/* Initialized to stop compiler warnings */
 	struct desc_struct code_descriptor;
 
-	if (!used_math()) {
-		if (init_fpu(current)) {
-			do_group_exit(SIGKILL);
-			return;
-		}
-	}
+	if (!used_math())
+		init_fpu(current);
 
 #ifdef RE_ENTRANT_CHECKING
 	if (emulating) {
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* [PATCH] x86, xsave: fix non-lazy allocation of the xsave area
  2011-04-07 15:30               ` Hans Rosenfeld
  2011-04-07 16:08                 ` [RFC v4 6/8] x86, xsave: add support for non-lazy xstates Hans Rosenfeld
  2011-04-07 16:08                 ` [RFC v4 8/8] x86, xsave: remove lazy allocation of xstate area Hans Rosenfeld
@ 2011-04-13 10:58                 ` Hans Rosenfeld
  2011-04-13 23:21                   ` H. Peter Anvin
  2 siblings, 1 reply; 48+ messages in thread
From: Hans Rosenfeld @ 2011-04-13 10:58 UTC (permalink / raw)
  To: hpa, mingo
  Cc: brgerst, tglx, suresh.b.siddha, eranian, robert.richter,
	Andreas.Herrmann3, x86, linux-kernel, Hans Rosenfeld

A single static xsave area just for init is not enough, since there are
more user processes that are directly executed by kernel threads. Use
fpu_alloc(), and SIGKILL the process if that fails.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/include/asm/i387.h |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index 989c0ac..833b6f1 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -329,15 +329,12 @@ static inline void fpu_copy(struct fpu *dst, struct fpu *src)
 }
 
 extern void fpu_finit(struct fpu *fpu);
-static union thread_xstate __init_xstate, *init_xstate = &__init_xstate;
 
 static inline void fpu_clear(struct fpu *fpu)
 {
-	if (!fpu_allocated(fpu)) {
-		BUG_ON(init_xstate == NULL);
-		fpu->state = init_xstate;
-		init_xstate = NULL;
-	}
+	if (!fpu_allocated(fpu) && fpu_alloc(fpu))
+		do_group_exit(SIGKILL);
+
 	memset(fpu->state, 0, xstate_size);
 	fpu_finit(fpu);
 	set_used_math();
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH] x86, xsave: fix non-lazy allocation of the xsave area
  2011-04-13 10:58                 ` [PATCH] x86, xsave: fix non-lazy allocation of the xsave area Hans Rosenfeld
@ 2011-04-13 23:21                   ` H. Peter Anvin
  2011-04-15 16:47                     ` [PATCH 1/1] " Hans Rosenfeld
  0 siblings, 1 reply; 48+ messages in thread
From: H. Peter Anvin @ 2011-04-13 23:21 UTC (permalink / raw)
  To: Hans Rosenfeld
  Cc: mingo, brgerst, tglx, suresh.b.siddha, eranian, robert.richter,
	Andreas.Herrmann3, x86, linux-kernel

On 04/13/2011 03:58 AM, Hans Rosenfeld wrote:
> A single static xsave area just for init is not enough, since there are
> more user processes that are directly executed by kernel threads. Use
> fpu_alloc(), and SIGKILL the process if that fails.
> 
> Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
> ---
>  arch/x86/include/asm/i387.h |    9 +++------
>  1 files changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
> index 989c0ac..833b6f1 100644
> --- a/arch/x86/include/asm/i387.h
> +++ b/arch/x86/include/asm/i387.h
> @@ -329,15 +329,12 @@ static inline void fpu_copy(struct fpu *dst, struct fpu *src)
>  }
>  
>  extern void fpu_finit(struct fpu *fpu);
> -static union thread_xstate __init_xstate, *init_xstate = &__init_xstate;
>  
>  static inline void fpu_clear(struct fpu *fpu)
>  {
> -	if (!fpu_allocated(fpu)) {
> -		BUG_ON(init_xstate == NULL);
> -		fpu->state = init_xstate;
> -		init_xstate = NULL;
> -	}
> +	if (!fpu_allocated(fpu) && fpu_alloc(fpu))
> +		do_group_exit(SIGKILL);
> +
>  	memset(fpu->state, 0, xstate_size);
>  	fpu_finit(fpu);
>  	set_used_math();

Ideally this should be done earlier, while it is still possible to
ENOMEM the exec.  Specifically, it probably should be done from a new
arch hook at the top in flush_old_exec().  I'm not sure how much it
matters in practice, because if we are that memory-constrained we'll
probably die shortly anyway, and to a kernel thread it is probably not
that much of a difference if the exec'd process dies with SIGKILL or if
it gets ENOMEM from the exec() -- it will typically be visible only from
the parent thread anyway.

	-hpa


^ permalink raw reply	[flat|nested] 48+ messages in thread

* [PATCH 1/1] x86, xsave: fix non-lazy allocation of the xsave area
  2011-04-13 23:21                   ` H. Peter Anvin
@ 2011-04-15 16:47                     ` Hans Rosenfeld
  0 siblings, 0 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-04-15 16:47 UTC (permalink / raw)
  To: hpa
  Cc: brgerst, tglx, mingo, suresh.b.siddha, eranian, robert.richter,
	Andreas.Herrmann3, x86, linux-kernel, Hans Rosenfeld

A single static xsave area just for init is not enough, since there are
more user processes that are directly executed by kernel threads. Add a
call to a new arch-specific function to flush_old_exec(), which will in
turn call fpu_alloc() to allocate a xsave area if necessary.

Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
---
 arch/x86/include/asm/i387.h |    6 ------
 arch/x86/kernel/process.c   |    7 +++++++
 fs/exec.c                   |    9 +++++++++
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index 989c0ac..0448f45 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -329,15 +329,9 @@ static inline void fpu_copy(struct fpu *dst, struct fpu *src)
 }
 
 extern void fpu_finit(struct fpu *fpu);
-static union thread_xstate __init_xstate, *init_xstate = &__init_xstate;
 
 static inline void fpu_clear(struct fpu *fpu)
 {
-	if (!fpu_allocated(fpu)) {
-		BUG_ON(init_xstate == NULL);
-		fpu->state = init_xstate;
-		init_xstate = NULL;
-	}
 	memset(fpu->state, 0, xstate_size);
 	fpu_finit(fpu);
 	set_used_math();
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 0382f98..3edfbf2 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -26,6 +26,13 @@
 struct kmem_cache *task_xstate_cachep;
 EXPORT_SYMBOL_GPL(task_xstate_cachep);
 
+int arch_prealloc_fpu(struct task_struct *tsk)
+{
+	if (!fpu_allocated(&tsk->thread.fpu))
+		return fpu_alloc(&tsk->thread.fpu);
+	return 0;
+}
+
 int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
 {
 	int ret;
diff --git a/fs/exec.c b/fs/exec.c
index 5e62d26..c5b5c1e 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1022,10 +1022,19 @@ void set_task_comm(struct task_struct *tsk, char *buf)
 	perf_event_comm(tsk);
 }
 
+int __attribute__((weak)) arch_prealloc_fpu(struct task_struct *tsk)
+{
+	return 0;
+}
+
 int flush_old_exec(struct linux_binprm * bprm)
 {
 	int retval;
 
+	retval = arch_prealloc_fpu(current);
+	if (retval)
+		goto out;
+
 	/*
 	 * Make sure we have a private signal table and that
 	 * we are unassociated from the previous thread group.
-- 
1.5.6.5



^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [RFC v3 0/8] x86, xsave: rework of extended state handling, LWP support
  2011-04-07  7:23             ` Ingo Molnar
  2011-04-07 15:30               ` Hans Rosenfeld
@ 2011-05-16 19:10               ` Hans Rosenfeld
  2011-05-17 11:30                 ` Ingo Molnar
  1 sibling, 1 reply; 48+ messages in thread
From: Hans Rosenfeld @ 2011-05-16 19:10 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: hpa, x86, linux-kernel

Hi,

On Thu, Apr 07, 2011 at 03:23:05AM -0400, Ingo Molnar wrote:
> 
> FYI, the bits in tip:x86/xsave crash on boot on an AMD X2 testbox:

> Full crashlog and kernel config attached. I've excluded x86/save from 
> tip:master for now.

this issue has been fixed a few weeks ago.

Are there any plans to include x86/xsave into tip:master again?


Hans


-- 
%SYSTEM-F-ANARCHISM, The operating system has been overthrown


^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [RFC v3 0/8] x86, xsave: rework of extended state handling, LWP support
  2011-05-16 19:10               ` [RFC v3 0/8] x86, xsave: rework of extended state handling, LWP support Hans Rosenfeld
@ 2011-05-17 11:30                 ` Ingo Molnar
  2011-05-17 15:22                   ` Hans Rosenfeld
                                     ` (2 more replies)
  0 siblings, 3 replies; 48+ messages in thread
From: Ingo Molnar @ 2011-05-17 11:30 UTC (permalink / raw)
  To: Hans Rosenfeld
  Cc: hpa, x86, linux-kernel, Robert Richter, Thomas Gleixner,
	Peter Zijlstra, Arnaldo Carvalho de Melo,
	Frédéric Weisbecker, Steven Rostedt


* Hans Rosenfeld <hans.rosenfeld@amd.com> wrote:

> Hi,
> 
> On Thu, Apr 07, 2011 at 03:23:05AM -0400, Ingo Molnar wrote:
> > 
> > FYI, the bits in tip:x86/xsave crash on boot on an AMD X2 testbox:
> 
> > Full crashlog and kernel config attached. I've excluded x86/save from 
> > tip:master for now.
> 
> this issue has been fixed a few weeks ago.
> 
> Are there any plans to include x86/xsave into tip:master again?

Regarding the LWP bits, that branch was indeed excluded because of that crash, 
while re-checking the branch today i noticed at least one serious design error 
in it, which makes me reconsider the whole thing:

- Where is the hardware interrupt that signals the ring-buffer-full condition
  exposed to user-space and how can user-space wait for ring buffer events?
  AFAICS this needs to set the LWP_CFG MSR and needs an irq handler, which 
  needs kernel side support - but that is not included in these patches.

  The way we solved this with Intel's BTS (and PEBS) feature is that there's
  a per task hardware buffer that is coupled with the event ring buffer, so
  both setup and 'waiting' for the ring-buffer happens automatically and
  transparently because tools can already wait on the ring-buffer.

  Considerable effort went into that model on the Intel side before we merged
  it and i see no reason why an AMD hw-tracing feature should not have this 
  too...

  [ If that is implemented we can expose LWP to user-space as well (which can
    choose to utilize it directly and buffer into its own memory area without 
    irqs and using polling, but i'd generally discourage such crude event 
    collection methods). ]

- LWP is exposed indiscriminately, without giving user-space a chance to 
  disable it on a per task basis. Security-conscious apps would want to disable
  access to the LWP instructions - which are all ring 3 and unprivileged! We
  already allow this for the TSC for example. Right now sandboxed code like
  seccomp would get access to LWP as well - not good. Some intelligent
  (optional) control is needed, probably using cr0's lwp-enabled bit.

There are a couple of other items as well:

- The LWP_CFG has other features as well, such as the ability to aggregate 
  events amongst cores. This is not exposed either. This looks like a lower 
  prio, optional item which could be offered after the first patches went
  upstream.

- like we do it for PEBS with the perf_attr.precise attribute, it would be nice 
  to report not RIP+1 but the real RIP itself. On Intel we use LBR to discover 
  the previous instruction, this might not be possible on AMD CPUs.

  One solution would be to disassemble the sampled instruction and approximate 
  the previous one by assuming that it's the preceding instruction (for 
  branches and calls this might not be true). If we do this then the event::FUS 
  bit has to be taken into account - in case the CPU has fused the instruction
  and we have a two instructions delay in reporting.

  In any case, this is an optional item too and v1 support can be merged 
  without trying to implement precise RIP support.

- there are a few interesting looking event details that we'd want to expose
  in a generalized manner: branch taken/not taken bit, branch prediction 
  hit/miss bit, etc.

  This too is optional.

- The LWPVAL instruction allows the user-space generation of samples. There
  needs to be a matching generic event for it, which is then inserted into the 
  perf ring-buffer. Similarly, LWPINS needs to have a matching generic record 
  as well, so that user-space can decode it.

  This too looks optional to me.

- You'd eventually want to expose the randomization (bits 60-63 in the LWPCB)
  feature as well, via an attribute bit. Ditto for filtering such as cache
  latency filtering, which looks the most useful. The low/high IP filter could 
  be exposed as well. All optional. For remaining featurities if there's no sane
  way to expose them generally we can expose a raw event field as
  well and have a raw event configuration space to twiddle these details.

In general LWP is pretty neat and i agree that we want to offer it, it offers
access to five top categories of hw events (which we also have generalized):

 - instructions
 - branches
 - the most important types of cache misses
 - CPU cycles
 - constant (bus) cycles

 - user-space generated events/samples

So it will fit nicely into our existing scheme of how we handle PMU features
and generalizations.

Here are a couple of suggestions to LWP hardware designers:

 - the fact that LWP cannot count kernel events right now is unfortunate - 
   there's no reason not to allow privileged user-space to request ring 3
   events as well - hopefully this misfeature will be fixed in future 
   iterations of the hardware.

 - it would be nice to allow the per task masking/unmasking of LWP without
   having to modify the cr0 (which can be expensive). A third mode
   implemented in the LWP_CFG MSG would suffice: it would make the LWP
   instructions privileged, but would otherwise allow LWP event collection
   to occur even on sandboxed code.

 - it would be nice to also log the previous retired instruction in the
   trace entry, to ease decoding of the real instruction that generated
   an event. (Fused instructions can generate their RIP at the first
   instruction.)

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [RFC v3 0/8] x86, xsave: rework of extended state handling, LWP support
  2011-05-17 11:30                 ` Ingo Molnar
@ 2011-05-17 15:22                   ` Hans Rosenfeld
  2011-05-18 11:22                     ` Ingo Molnar
  2011-05-18 13:51                     ` Ingo Molnar
  2011-05-18  8:16                   ` Joerg Roedel
  2011-05-18 18:02                   ` Andreas Herrmann
  2 siblings, 2 replies; 48+ messages in thread
From: Hans Rosenfeld @ 2011-05-17 15:22 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: hpa, x86, linux-kernel, Richter, Robert, Thomas Gleixner,
	Peter Zijlstra, Arnaldo Carvalho de Melo,
	Frédéric Weisbecker, Steven Rostedt

On Tue, May 17, 2011 at 07:30:20AM -0400, Ingo Molnar wrote:
> Regarding the LWP bits, that branch was indeed excluded because of that crash, 
> while re-checking the branch today i noticed at least one serious design error 
> in it, which makes me reconsider the whole thing:

If you don't like the patch to enable LWP, you could leave that one out
for now. The other xsave rework patches are necessary for LWP, but they
also make sense in their own right.
 
> - Where is the hardware interrupt that signals the ring-buffer-full condition
>   exposed to user-space and how can user-space wait for ring buffer events?
>   AFAICS this needs to set the LWP_CFG MSR and needs an irq handler, which 
>   needs kernel side support - but that is not included in these
>   patches.

This is not strictly necessary. All that the LWP patch does is enable a
new instruction set that can be used without any support for interrupts.
A user process tracing itself with LWP can always poll the ring buffer.

>   The way we solved this with Intel's BTS (and PEBS) feature is that there's
>   a per task hardware buffer that is coupled with the event ring buffer, so
>   both setup and 'waiting' for the ring-buffer happens automatically and
>   transparently because tools can already wait on the ring-buffer.
> 
>   Considerable effort went into that model on the Intel side before we merged
>   it and i see no reason why an AMD hw-tracing feature should not have this 
>   too...

I don't see how that is related to LWP, which by design only works in
user space and directly logs to user space buffers.

>   [ If that is implemented we can expose LWP to user-space as well (which can
>     choose to utilize it directly and buffer into its own memory area without 
>     irqs and using polling, but i'd generally discourage such crude event 
>     collection methods). ]

Well, thats exactly how LWP is supposed to work. Its all user space. It
works only in user mode and it logs directly to a buffer in virtual
address space of the process being traced. The kernel doesn't have to
care at all about LWP for basic functionality, given that it enables the
instruction set and saving/restoring of the LWP state. Enabling the LWP
interrupt and relaying that as a signal or whatever is completely
optional and can be done later if necessary.

> - LWP is exposed indiscriminately, without giving user-space a chance to 
>   disable it on a per task basis. Security-conscious apps would want to disable
>   access to the LWP instructions - which are all ring 3 and unprivileged! We
>   already allow this for the TSC for example. Right now sandboxed code like
>   seccomp would get access to LWP as well - not good. Some intelligent
>   (optional) control is needed, probably using cr0's lwp-enabled bit.

What exactly is the point here? If a program doesn't want to use LWP for
whatever reason, it doesn't have to. No state is saved/restored by
XSAVE/XRSTOR for LWP if it is unused. A security-conscious app would
also not allow any LD_PRELOADs or anything like that which could use LWP
behind its back. What exactly is gained by disabling it, except for
breaking the specification?

Note that there is only one way to disable LWP, and that is clearing the
LWP bit in the XFEATURE_ENABLED_MASK in XCR0. Messing with that in a
running system will cause a lot of pain.

> There are a couple of other items as well:
> 
> - The LWP_CFG has other features as well, such as the ability to aggregate 
>   events amongst cores. This is not exposed either. This looks like a lower 
>   prio, optional item which could be offered after the first patches went
>   upstream.

I don't see that anywhere in the specification, where did you find that?

> - like we do it for PEBS with the perf_attr.precise attribute, it would be nice 
>   to report not RIP+1 but the real RIP itself. On Intel we use LBR to discover 
>   the previous instruction, this might not be possible on AMD CPUs.
> 
>   One solution would be to disassemble the sampled instruction and approximate 
>   the previous one by assuming that it's the preceding instruction (for 
>   branches and calls this might not be true). If we do this then the event::FUS 
>   bit has to be taken into account - in case the CPU has fused the instruction
>   and we have a two instructions delay in reporting.
> 
>   In any case, this is an optional item too and v1 support can be merged 
>   without trying to implement precise RIP support.
> 
> - there are a few interesting looking event details that we'd want to expose
>   in a generalized manner: branch taken/not taken bit, branch prediction 
>   hit/miss bit, etc.
> 
>   This too is optional.
> 
> - The LWPVAL instruction allows the user-space generation of samples. There
>   needs to be a matching generic event for it, which is then inserted into the 
>   perf ring-buffer. Similarly, LWPINS needs to have a matching generic record 
>   as well, so that user-space can decode it.
> 
>   This too looks optional to me.
> 
> - You'd eventually want to expose the randomization (bits 60-63 in the LWPCB)
>   feature as well, via an attribute bit. Ditto for filtering such as cache
>   latency filtering, which looks the most useful. The low/high IP filter could 
>   be exposed as well. All optional. For remaining featurities if there's no sane
>   way to expose them generally we can expose a raw event field as
>   well and have a raw event configuration space to twiddle these details.
> 
> In general LWP is pretty neat and i agree that we want to offer it, it offers
> access to five top categories of hw events (which we also have generalized):
> 
>  - instructions
>  - branches
>  - the most important types of cache misses
>  - CPU cycles
>  - constant (bus) cycles
> 
>  - user-space generated events/samples
> 
> So it will fit nicely into our existing scheme of how we handle PMU features
> and generalizations.

I don't quite understand what you are proposing here. The LWPCB is
controlled by the user space application that traces itself, so all of
it is already exposed by the hardware. The samples are directly logged to
the user space buffer by the hardware, so there is no work to do for the
kernel here. Any post-processing of the samples (for precise RIP or
such) needs to be done in the user space.

We had some discussions about how to make LWP more accessible to
users. Having LWP support in perf would certainly be nice, but the
implementation would be very much different from that for other PMUs.
LWP does almost everything in hardware that perf does in the kernel.

As I said before, with this patch I'm enabling a new instruction set and
associated extended state. How exactly user programs use it, and how it
might fit into existing PMU APIs and tools is not really that important
now.

> Here are a couple of suggestions to LWP hardware designers:
> 
>  - the fact that LWP cannot count kernel events right now is unfortunate - 
>    there's no reason not to allow privileged user-space to request ring 3
>    events as well - hopefully this misfeature will be fixed in future 
>    iterations of the hardware.
> 
>  - it would be nice to allow the per task masking/unmasking of LWP without
>    having to modify the cr0 (which can be expensive). A third mode
>    implemented in the LWP_CFG MSG would suffice: it would make the LWP
>    instructions privileged, but would otherwise allow LWP event collection
>    to occur even on sandboxed code.
> 
>  - it would be nice to also log the previous retired instruction in the
>    trace entry, to ease decoding of the real instruction that generated
>    an event. (Fused instructions can generate their RIP at the first
>    instruction.)

I will forward this to our hardware designers, but I have my doubts
about the first two of your suggestions. They seem to be orthogonal to
what LWP is supposed to be.


Hans


-- 
%SYSTEM-F-ANARCHISM, The operating system has been overthrown


^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [RFC v3 0/8] x86, xsave: rework of extended state handling, LWP support
  2011-05-17 11:30                 ` Ingo Molnar
  2011-05-17 15:22                   ` Hans Rosenfeld
@ 2011-05-18  8:16                   ` Joerg Roedel
  2011-05-18 10:59                     ` Ingo Molnar
  2011-05-18 18:02                   ` Andreas Herrmann
  2 siblings, 1 reply; 48+ messages in thread
From: Joerg Roedel @ 2011-05-18  8:16 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Hans Rosenfeld, hpa, x86, linux-kernel, Robert Richter,
	Thomas Gleixner, Peter Zijlstra, Arnaldo Carvalho de Melo,
	Frédéric Weisbecker, Steven Rostedt

Hi Ingo,

thanks for your thoughts on this. I have some comments below.

On Tue, May 17, 2011 at 01:30:20PM +0200, Ingo Molnar wrote:

> - Where is the hardware interrupt that signals the ring-buffer-full condition
>   exposed to user-space and how can user-space wait for ring buffer events?
>   AFAICS this needs to set the LWP_CFG MSR and needs an irq handler, which 
>   needs kernel side support - but that is not included in these patches.
> 
>   The way we solved this with Intel's BTS (and PEBS) feature is that there's
>   a per task hardware buffer that is coupled with the event ring buffer, so
>   both setup and 'waiting' for the ring-buffer happens automatically and
>   transparently because tools can already wait on the ring-buffer.
> 
>   Considerable effort went into that model on the Intel side before we merged
>   it and i see no reason why an AMD hw-tracing feature should not have this 
>   too...
> 
>   [ If that is implemented we can expose LWP to user-space as well (which can
>     choose to utilize it directly and buffer into its own memory area without 
>     irqs and using polling, but i'd generally discourage such crude event 
>     collection methods). ]

If I understand this correctly you suggest to propagate the lwp-events
through perf into user-space. This is certainly good because it provides
a unified interface, but it somewhat elimitates the 'lightweight' part
of LWP because the samples need to be read by the kernel from user-space
memory (the lwp-ring-buffer needs to be in user-space memory), convert
it to perf-samples, and copy it back to user-space. The benefit is the
unified interface but the 'lightweight' and low-impact part vanishes to
some degree.

Also, LWP is somewhat different from the old-style PMU. LWP is designed
for self-monitoring of applications that want to optimize themself at
runtime, like JIT compilers (Java, LVMM, ...) or databases. For those
applications it would be good to keep LWP as lightweight as possible.

The missing support for interupts is certainly a problem here which
significantly limits the usefulness of the feature for now. My idea was
to expose the interupt-event through perf to user-space so that the
application can wait on that event to read out the LWP ring-buffer.

But to come back to your idea, it probably could be done in a way to
enable profiling of other applications using LWP. The kernel needs to
allocate the lwp ring-buffer and setup lwp itself. The problem is that
the buffer needs to be user-accessible and where to map this buffer:

	a) On the kernel-part of the address space. Problematic because
	   every process can read the buffer of other tasks. So this is
	   a no-go from a security point-of-view.

	b) Change the address space layout in a comatible way to allow
	   the kernel to map it (e.g. make a small part of the
	   kernel-address space per-process). Somewhat intrusive to
	   current x86 code, also not sure this feature is worth it.

	c) Some way to let userspace setup such a buffer and give the
	   address to the kernel, or we mmap it directly into user
	   address space. But that may cause other problems with
	   applications that have strict requirements for their
	   address-space layout.

Bottom-line is, we need a good and secure way to setup a user-accessible
buffer per-process in the kernel. If we have that we can use LWP to
monitor other applications (unless the application decides to use LWP of
its own).

I like the idea, but we should also make sure that we don't prevent the
low-impact self-monitoring use-case for applications that want it.

> - LWP is exposed indiscriminately, without giving user-space a chance to 
>   disable it on a per task basis. Security-conscious apps would want to disable
>   access to the LWP instructions - which are all ring 3 and unprivileged! We
>   already allow this for the TSC for example. Right now sandboxed code like
>   seccomp would get access to LWP as well - not good. Some intelligent
>   (optional) control is needed, probably using cr0's lwp-enabled bit.

That could certainly be done, but requires an xcr0 write at
context-switch. JFI, how can the tsc be disabled for a task from
userspace?

Regards,

	Joerg


^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [RFC v3 0/8] x86, xsave: rework of extended state handling, LWP support
  2011-05-18  8:16                   ` Joerg Roedel
@ 2011-05-18 10:59                     ` Ingo Molnar
  0 siblings, 0 replies; 48+ messages in thread
From: Ingo Molnar @ 2011-05-18 10:59 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: Hans Rosenfeld, hpa, x86, linux-kernel, Robert Richter,
	Thomas Gleixner, Peter Zijlstra, Arnaldo Carvalho de Melo,
	Frédéric Weisbecker, Steven Rostedt


* Joerg Roedel <joro@8bytes.org> wrote:

> Hi Ingo,
> 
> thanks for your thoughts on this. I have some comments below.
> 
> On Tue, May 17, 2011 at 01:30:20PM +0200, Ingo Molnar wrote:
> 
> > - Where is the hardware interrupt that signals the ring-buffer-full condition
> >   exposed to user-space and how can user-space wait for ring buffer events?
> >   AFAICS this needs to set the LWP_CFG MSR and needs an irq handler, which 
> >   needs kernel side support - but that is not included in these patches.
> > 
> >   The way we solved this with Intel's BTS (and PEBS) feature is that there's
> >   a per task hardware buffer that is coupled with the event ring buffer, so
> >   both setup and 'waiting' for the ring-buffer happens automatically and
> >   transparently because tools can already wait on the ring-buffer.
> > 
> >   Considerable effort went into that model on the Intel side before we merged
> >   it and i see no reason why an AMD hw-tracing feature should not have this 
> >   too...
> > 
> >   [ If that is implemented we can expose LWP to user-space as well (which can
> >     choose to utilize it directly and buffer into its own memory area without 
> >     irqs and using polling, but i'd generally discourage such crude event 
> >     collection methods). ]
> 
> If I understand this correctly you suggest to propagate the lwp-events
> through perf into user-space. This is certainly good because it provides
> a unified interface, but it somewhat elimitates the 'lightweight' part
> of LWP because the samples need to be read by the kernel from user-space
> memory (the lwp-ring-buffer needs to be in user-space memory), convert
> it to perf-samples, and copy it back to user-space. The benefit is the
> unified interface but the 'lightweight' and low-impact part vanishes to
> some degree.

I have two arguments here.

1) it does not matter much in practice

Say we have a large amount of samples: a hundred thousand samples for a second 
worth of application execution. This 100 KHz sampling is already 100 times 
larger than the default we use in tools.

100k samples - the 'lightweight' comes from not having to incur the cost of 
100,000 PMU interrupts spread out with 1000+ overhead cycles each - but being 
able to batch it up in groups.

The copying of the 100k samples means the handling of 3.2 MB of data per 
second. The copying itself is *negligible* - this is from an ancient AMD box:

 phoenix:~> perf bench mem memcpy
 # Running mem/memcpy benchmark...
 # Copying 1MB Bytes ...

     727.802038 MB/Sec
       1.949227 GB/Sec (with prefault)

On modern CPUs it ought to be in the 0.1% overhead range. For usual sampling 
rates the copying would be in the 0.001% overhead range.

And for that we get a much better abstraction and much better tooling model. 
The decision is a no-brainer really.

Note that if user-space *really* wants to get rid of even this overhead it can 
use the instructions in a raw way. I expect that to have the fate of 
sendfile(): zero-copy was trumpeted to be a big performance thing but in 
practice it rarely mattered, usability was what kept people on read()/write().

[ and compared to raw LWP instructions the usability disadvantage of sendfile() 
  is almost non-existent. ]

2) there's no contradiction: lightweight access can be supported in the perf 
   abstraction as well

While the PEBS buffer is not exposed to user-space, we can expose the buffer in 
the LWP case and make 'raw collection' possible. As long as the standard 
facilities are used to *configure* profiling and as long as the standard 
facilities are used for the threshold irq functionality, etc. this is not 
something i object to.

And if zero copying matters a lot, then regular tools will use that facility as 
well.

> Also, LWP is somewhat different from the old-style PMU. LWP is designed
> for self-monitoring of applications that want to optimize themself at
> runtime, like JIT compilers (Java, LVMM, ...) or databases. For those
> applications it would be good to keep LWP as lightweight as possible.

That goal does not contradict the sane resource management and synchronization 
requirements i outlined.

> The missing support for interupts is certainly a problem here which 
> significantly limits the usefulness of the feature for now. [...]

Yes, that's the key observation.

> [...] My idea was to expose the interupt-event through perf to user-space so 
> that the application can wait on that event to read out the LWP ring-buffer.

The (much) better thing (which you seem to realize later in your mail) is to 
just integrate the buffer and teach the kernel to parse it.

Then *all* tools will be able to utilize this (useful looking) hardware feature 
straight away, with very little modifications needed - the advantage of 
standardized kernel interfaces.

If the CPU guys give us a 'measure kernel mode' bit it as well in the future 
then it will be even more useful all around.

So this is not just about the current first generation hardware, it's also 
about what LWP could very well turn out to look like in the future, using 
obvious extensions.

By making it a limited user-space hack just because LWP *can* be used as such a 
hack we would really risk condemning a very valuable piece of silicon to that 
stupid role forever. It does not have to be used as such a hack and it does not 
have to be condemned to that role.

> But to come back to your idea, it probably could be done in a way to
> enable profiling of other applications using LWP. The kernel needs to
> allocate the lwp ring-buffer and setup lwp itself. [...]

Yes.

> [...] The problem is that the buffer needs to be user-accessible and where to 
> map this buffer:
> 
> 	a) On the kernel-part of the address space. Problematic because
> 	   every process can read the buffer of other tasks. So this is
> 	   a no-go from a security point-of-view.

No, the hardware buffer can (and should) be in user memory. We also want to 
expose it (see raw decoding above), just like we expose raw events.

> 	b) Change the address space layout in a comatible way to allow
> 	   the kernel to map it (e.g. make a small part of the
> 	   kernel-address space per-process). Somewhat intrusive to
> 	   current x86 code, also not sure this feature is worth it.

There's nothing wrong with allocating user memory on behalf of the task, if it 
asks for it (or if the parent or some other controlling task wants to profile 
the task) - we do it in a couple of places in the kernel - the perf subsystem 
itself does it.

> 	c) Some way to let userspace setup such a buffer and give the
> 	   address to the kernel, or we mmap it directly into user
> 	   address space. But that may cause other problems with
> 	   applications that have strict requirements for their
> 	   address-space layout.

A buffer has to be allocated no matter who does it.

> Bottom-line is, we need a good and secure way to setup a user-accessible
> buffer per-process in the kernel. [...]

Correct. It can either be a do_mmap() call, or if we want to handle any aspect 
of it ourselves then it can be done like arch/x86/vdso/vma.c::init_vdso_vars() 
sets up the vdso vma.

We also obviously want to mlock this area (within the perf page-locking 
limits). While the LWP hardware is robust enough to not crash on a not present 
(paged out or not yet paged in) page, spuriously losing samples is not good.

> [...] If we have that we can use LWP to monitor other applications (unless 
> the application decides to use LWP of its own).

Yes!

That's not surprising: the hw feature itself looks pretty decently done, except 
the few things i noted in my first mail which limit its utility needlessly.
[ They could ask us next time around they add a feature like this. ]

> I like the idea, but we should also make sure that we don't prevent the
> low-impact self-monitoring use-case for applications that want it.

Yes, while i dont find that a too interesting usecase i see no problem with 
exposing this 'raw' area to apps that want to parse it directly (in fact the hw 
forces that, because the area has to be ring 3 writable) - as long as the whole 
resource infrastructure of creating and managing it is sane.

The kernel is a resource manager and this is a useful CPU resource.

> > - LWP is exposed indiscriminately, without giving user-space a chance to 
> >   disable it on a per task basis. Security-conscious apps would want to disable
> >   access to the LWP instructions - which are all ring 3 and unprivileged! We
> >   already allow this for the TSC for example. Right now sandboxed code like
> >   seccomp would get access to LWP as well - not good. Some intelligent
> >   (optional) control is needed, probably using cr0's lwp-enabled bit.
> 
> That could certainly be done, but requires an xcr0 write at
> context-switch. JFI, how can the tsc be disabled for a task from
> userspace?

See prctl_set_seccomp()'s disable_TSC call. The scheduler notices the TIF_NOTSC 
flag and twiddles CR4::TSD. TSC disablement is implicit in the seccomp 
execution model.

Here there should be a TIF_NOLWP, tied into seccomp by default and twiddling 
xcr0 at context-switch.

This will be zero overhead by default.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [RFC v3 0/8] x86, xsave: rework of extended state handling, LWP support
  2011-05-17 15:22                   ` Hans Rosenfeld
@ 2011-05-18 11:22                     ` Ingo Molnar
  2011-05-18 13:51                     ` Ingo Molnar
  1 sibling, 0 replies; 48+ messages in thread
From: Ingo Molnar @ 2011-05-18 11:22 UTC (permalink / raw)
  To: Hans Rosenfeld
  Cc: hpa, x86, linux-kernel, Richter, Robert, Thomas Gleixner,
	Peter Zijlstra, Arnaldo Carvalho de Melo,
	Frédéric Weisbecker, Steven Rostedt


* Hans Rosenfeld <hans.rosenfeld@amd.com> wrote:

> > Here are a couple of suggestions to LWP hardware designers:
> > 
> >  - the fact that LWP cannot count kernel events right now is unfortunate - 
> >    there's no reason not to allow privileged user-space to request ring 3
> >    events as well - hopefully this misfeature will be fixed in future 
> >    iterations of the hardware.
> > 
> >  - it would be nice to allow the per task masking/unmasking of LWP without
> >    having to modify the cr0 (which can be expensive). A third mode
> >    implemented in the LWP_CFG MSG would suffice: it would make the LWP
> >    instructions privileged, but would otherwise allow LWP event collection
> >    to occur even on sandboxed code.
> > 
> >  - it would be nice to also log the previous retired instruction in the
> >    trace entry, to ease decoding of the real instruction that generated
> >    an event. (Fused instructions can generate their RIP at the first
> >    instruction.)
> 
> I will forward this to our hardware designers, but I have my doubts about the 
> first two of your suggestions. They seem to be orthogonal to what LWP is 
> supposed to be.

Not sure why you think those two suggestions are 'orthogonal to LWP', they are 
not:

 - the second suggestion adds a third security model to the current 
   all-or-nothing nature of LWP instructions.

 - the first suggestion is a variation of its current security model as well:
   it allows LWP driven event collection in kernel mode, not just user mode.

There is nothing fundamentally ring-3-only about the concept of 'light weight 
profiling' - while ring-3-only event collection is understandably necessary for 
unprivileged user-space, it is not the only interesting mode of lightweight 
event collection.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [RFC v3 0/8] x86, xsave: rework of extended state handling, LWP support
  2011-05-17 15:22                   ` Hans Rosenfeld
  2011-05-18 11:22                     ` Ingo Molnar
@ 2011-05-18 13:51                     ` Ingo Molnar
  1 sibling, 0 replies; 48+ messages in thread
From: Ingo Molnar @ 2011-05-18 13:51 UTC (permalink / raw)
  To: Hans Rosenfeld
  Cc: hpa, x86, linux-kernel, Richter, Robert, Thomas Gleixner,
	Peter Zijlstra, Arnaldo Carvalho de Melo,
	Frédéric Weisbecker, Steven Rostedt


* Hans Rosenfeld <hans.rosenfeld@amd.com> wrote:

> On Tue, May 17, 2011 at 07:30:20AM -0400, Ingo Molnar wrote:
> > Regarding the LWP bits, that branch was indeed excluded because of that crash, 
> > while re-checking the branch today i noticed at least one serious design error 
> > in it, which makes me reconsider the whole thing:
> 
> If you don't like the patch to enable LWP, you could leave that one out
> for now. The other xsave rework patches are necessary for LWP, but they
> also make sense in their own right.
>  
> > - Where is the hardware interrupt that signals the ring-buffer-full condition
> >   exposed to user-space and how can user-space wait for ring buffer events?
> >   AFAICS this needs to set the LWP_CFG MSR and needs an irq handler, which 
> >   needs kernel side support - but that is not included in these
> >   patches.
> 
> This is not strictly necessary. All that the LWP patch does is enable a
> new instruction set that can be used without any support for interrupts.
> A user process tracing itself with LWP can always poll the ring buffer.

Only allowing the buffer to be polled is like 1980's technology, we can (and 
must) do better than that to expose useful hardware resources ...

LWP has a threshold interrupt and if you utilize it as i suggested it will 
solve this problem.

> >   The way we solved this with Intel's BTS (and PEBS) feature is that there's
> >   a per task hardware buffer that is coupled with the event ring buffer, so
> >   both setup and 'waiting' for the ring-buffer happens automatically and
> >   transparently because tools can already wait on the ring-buffer.
> > 
> >   Considerable effort went into that model on the Intel side before we merged
> >   it and i see no reason why an AMD hw-tracing feature should not have this 
> >   too...
> 
> I don't see how that is related to LWP, which by design only works in user 
> space and directly logs to user space buffers.

Both PEBS/BTS and LWP hw-logs to a buffer in virtual memory - full stop.

PEBS allows this buffer to be kernel privileged. That does not change the 
fundamental model though: the best way to expose such capabilities is via a 
standardized event interface.

> >   [ If that is implemented we can expose LWP to user-space as well (which can
> >     choose to utilize it directly and buffer into its own memory area without 
> >     irqs and using polling, but i'd generally discourage such crude event 
> >     collection methods). ]
> 
> Well, thats exactly how LWP is supposed to work. Its all user space. It works 
> only in user mode and it logs directly to a buffer in virtual address space 
> of the process being traced. The kernel doesn't have to care at all about LWP 
> for basic functionality, given that it enables the instruction set and 
> saving/restoring of the LWP state. Enabling the LWP interrupt and relaying 
> that as a signal or whatever is completely optional and can be done later if 
> necessary.

This is a very poor model of exposing a useful (and valuable) CPU hardware 
resource to user-space. Especially since we already have working example of how 
to do a proper model via the PEBS/BTS code.

To give an example of where we turn a low level hardware resource into a higher 
level concept: for example USB disks are primarily designed to be throw-away 
containers of user space controlled trash - thus is the right way to expose 
them would be to give the raw USB disk to user-space?

I don't think so, instead what we do is that we have kernel support for USB 
disks which enumerates and organizes them into storage devices and we put 
filesystems on them - so that apps can access an USB stick via standardized 
APIs - without actually tools being particularly USB-aware.

There's still raw USB devices available which you can use if you really want 
(or need) to, but 99% of the usage is via standardized, higher level 
interfaces.
 
I'm sure you'll agree that this kind of standardization and abstraction helps!

We are trying to do something rather similar with PEBS/BTS and want to fit LWP 
into that as well.

> > - LWP is exposed indiscriminately, without giving user-space a chance to 
> >   disable it on a per task basis. Security-conscious apps would want to disable
> >   access to the LWP instructions - which are all ring 3 and unprivileged! We
> >   already allow this for the TSC for example. Right now sandboxed code like
> >   seccomp would get access to LWP as well - not good. Some intelligent
> >   (optional) control is needed, probably using cr0's lwp-enabled bit.
> 
> What exactly is the point here? If a program doesn't want to use LWP for 
> whatever reason, it doesn't have to. [...]

The point is risk (surface of attack) reduction: in Linux there's support for 
heavily sandboxed code, for which today we even turn the RDTSC instruction off. 
(see my mail to Joerg for specific details about seccomp)

There's security models where they want to run untrusted assembly code but want 
to reduce the attack surface as much as possible. Such code wants to be able to 
exclude the LWP instructions from being used by sandboxed code.

> [...] No state is saved/restored by XSAVE/XRSTOR for LWP if it is unused. A 
> security-conscious app would also not allow any LD_PRELOADs or anything like 
> that which could use LWP behind its back. What exactly is gained by disabling 
> it, except for breaking the specification?

The gain is to optionally allow it for sandboxing host code to turn off CPU 
resources it does not want to expose. LWP is a whole new set of (rather 
complex) CPU logic.

> Note that there is only one way to disable LWP, and that is clearing the LWP 
> bit in the XFEATURE_ENABLED_MASK in XCR0. Messing with that in a running 
> system will cause a lot of pain.

We already modify cr0 in certain circumstances so it's possible and robust but 
indeed it's not particularly common at the moment - nor will it be the common 
case in the future.

> > There are a couple of other items as well:
> > 
> > - The LWP_CFG has other features as well, such as the ability to aggregate 
> >   events amongst cores. This is not exposed either. This looks like a lower 
> >   prio, optional item which could be offered after the first patches went
> >   upstream.
> 
> I don't see that anywhere in the specification, where did you find that?

There's a COREID field in the LWP_CFG MSR, which the spec says should be 
initialized by the OS to the local APIC ID. I did not see this done in the 
patches: it just enables LWP.

The core ID allows a buffering model where software can use a single target 
buffer with multiple threads logging into it. The CoreID field is then used to 
demultiplex which core the event originated from.

The LWP_CFG::COREID field has a reset value of 0, so with the current patches 
if the BIOS forgets to initalize the MSR (not unheard of) we are left with only 
partially working LWP: all-zeroes events and no ability to demux.

( Furthermore, the COREID has a hardware limit of 256 so any system bigger that 
  256 CPUs should gracefully bail out, should software attempt to set up a 
  shared buffer for say 512 cores. )

(I have looked at the revision 3.08 PDF.)

> > - like we do it for PEBS with the perf_attr.precise attribute, it would be nice 
> >   to report not RIP+1 but the real RIP itself. On Intel we use LBR to discover 
> >   the previous instruction, this might not be possible on AMD CPUs.
> > 
> >   One solution would be to disassemble the sampled instruction and approximate 
> >   the previous one by assuming that it's the preceding instruction (for 
> >   branches and calls this might not be true). If we do this then the event::FUS 
> >   bit has to be taken into account - in case the CPU has fused the instruction
> >   and we have a two instructions delay in reporting.
> > 
> >   In any case, this is an optional item too and v1 support can be merged 
> >   without trying to implement precise RIP support.
> > 
> > - there are a few interesting looking event details that we'd want to expose
> >   in a generalized manner: branch taken/not taken bit, branch prediction 
> >   hit/miss bit, etc.
> > 
> >   This too is optional.
> > 
> > - The LWPVAL instruction allows the user-space generation of samples. There
> >   needs to be a matching generic event for it, which is then inserted into the 
> >   perf ring-buffer. Similarly, LWPINS needs to have a matching generic record 
> >   as well, so that user-space can decode it.
> > 
> >   This too looks optional to me.
> > 
> > - You'd eventually want to expose the randomization (bits 60-63 in the LWPCB)
> >   feature as well, via an attribute bit. Ditto for filtering such as cache
> >   latency filtering, which looks the most useful. The low/high IP filter could 
> >   be exposed as well. All optional. For remaining featurities if there's no sane
> >   way to expose them generally we can expose a raw event field as
> >   well and have a raw event configuration space to twiddle these details.
> > 
> > In general LWP is pretty neat and i agree that we want to offer it, it offers
> > access to five top categories of hw events (which we also have generalized):
> > 
> >  - instructions
> >  - branches
> >  - the most important types of cache misses
> >  - CPU cycles
> >  - constant (bus) cycles
> > 
> >  - user-space generated events/samples
> > 
> > So it will fit nicely into our existing scheme of how we handle PMU features
> > and generalizations.
> 
> I don't quite understand what you are proposing here. [...]

See Joerg's mail and my mail to Joerg, it outlines the model. Check out how we 
support PEBS today, LWP support will look quite similar to it - the main 
difference being how the buffer is allocated (for LWP it's a userspace buffer 
in the target task's mm, shared with the monitoring task (which can be itself 
as well)) and of course the hw specific configuration and parsing of the 
events.

> [...] The LWPCB is controlled by the user space application that traces 
> itself, so all of it is already exposed by the hardware. The samples are 
> directly logged to the user space buffer by the hardware, so there is no work 
> to do for the kernel here. Any post-processing of the samples (for precise 
> RIP or such) needs to be done in the user space.

Yes, this is similar to the PEBS and BTS model: there too the hardware logs 
automatically, and the kernel gets a threshold interrupt (or drains the queue 
explicitly).

> We had some discussions about how to make LWP more accessible to users. 
> Having LWP support in perf would certainly be nice, but the implementation 
> would be very much different from that for other PMUs. LWP does almost 
> everything in hardware that perf does in the kernel.

Yes, it should be supported similarly to how we support PEBS and BTS today. 
This is a problem that has been solved already, the AMD LWP model is a newer 
incarnation of the concept.

> As I said before, with this patch I'm enabling a new instruction set and 
> associated extended state. How exactly user programs use it, and how it might 
> fit into existing PMU APIs and tools is not really that important now.

How support for a new x86 CPU resource is integrated into the kernel is highly 
important and relevant to me both as an x86 maintainer and as a perf/PMU 
maintainer.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [RFC v3 0/8] x86, xsave: rework of extended state handling, LWP support
  2011-05-17 11:30                 ` Ingo Molnar
  2011-05-17 15:22                   ` Hans Rosenfeld
  2011-05-18  8:16                   ` Joerg Roedel
@ 2011-05-18 18:02                   ` Andreas Herrmann
  2 siblings, 0 replies; 48+ messages in thread
From: Andreas Herrmann @ 2011-05-18 18:02 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Hans Rosenfeld, hpa, x86, linux-kernel, Robert Richter,
	Thomas Gleixner, Peter Zijlstra, Arnaldo Carvalho de Melo,
	Frédéric Weisbecker, Steven Rostedt

On Tue, May 17, 2011 at 01:30:20PM +0200, Ingo Molnar wrote:
> 
> * Hans Rosenfeld <hans.rosenfeld@amd.com> wrote:
> 
> > Hi,
> > 
> > On Thu, Apr 07, 2011 at 03:23:05AM -0400, Ingo Molnar wrote:
> > > 
> > > FYI, the bits in tip:x86/xsave crash on boot on an AMD X2 testbox:
> > 
> > > Full crashlog and kernel config attached. I've excluded x86/save from 
> > > tip:master for now.
> > 
> > this issue has been fixed a few weeks ago.
> > 
> > Are there any plans to include x86/xsave into tip:master again?
> 
> Regarding the LWP bits, that branch was indeed excluded because of that crash, 
> while re-checking the branch today i noticed at least one serious design error 
> in it, which makes me reconsider the whole thing:

Independend of all the concerns and useful comments regarding LWP ...
it seems to me that patches 1-7 are still of use (cleaning up the
save/restore code making it more maintainable).

Wouldn't it make sense to add patches 1-7 to a branch that is tested
with linux-next to find potential regressions?


Andreas

^ permalink raw reply	[flat|nested] 48+ messages in thread

end of thread, other threads:[~2011-05-18 18:02 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-09 19:14 [RFC 0/8] rework of extended state handling, LWP support Hans Rosenfeld
2011-03-09 19:14 ` [RFC 1/8] x86, xsave: cleanup fpu/xsave support Hans Rosenfeld
2011-03-09 19:14 ` [RFC 2/8] x86, xsave: rework " Hans Rosenfeld
2011-03-09 19:14 ` [RFC 3/8] x86, xsave: cleanup fpu/xsave signal frame setup Hans Rosenfeld
2011-03-09 19:14 ` [RFC 4/8] x86, xsave: remove unused code Hans Rosenfeld
2011-03-09 19:14 ` [RFC 5/8] x86, xsave: more cleanups Hans Rosenfeld
2011-03-09 19:15 ` [RFC 6/8] x86, xsave: add support for non-lazy xstates Hans Rosenfeld
2011-03-09 19:15 ` [RFC 7/8] x86, xsave: add kernel support for AMDs Lightweight Profiling (LWP) Hans Rosenfeld
2011-03-09 19:15 ` [RFC 8/8] x86, xsave: remove lazy allocation of xstate area Hans Rosenfeld
2011-03-23 15:27   ` [RFC v2 0/8] x86, xsave: rework of extended state handling, LWP support Hans Rosenfeld
2011-03-23 15:27   ` [RFC v2 1/8] x86, xsave: cleanup fpu/xsave support Hans Rosenfeld
2011-03-23 15:27   ` [RFC v2 2/8] x86, xsave: rework " Hans Rosenfeld
2011-03-23 15:27   ` [RFC v2 3/8] x86, xsave: cleanup fpu/xsave signal frame setup Hans Rosenfeld
2011-03-23 15:27   ` [RFC v2 4/8] x86, xsave: remove unused code Hans Rosenfeld
2011-03-23 15:27   ` [RFC v2 5/8] x86, xsave: more cleanups Hans Rosenfeld
2011-03-23 15:27   ` [RFC v2 6/8] x86, xsave: add support for non-lazy xstates Hans Rosenfeld
2011-03-23 15:27   ` [RFC v2 7/8] x86, xsave: add kernel support for AMDs Lightweight Profiling (LWP) Hans Rosenfeld
2011-03-23 15:27   ` [RFC v2 8/8] x86, xsave: remove lazy allocation of xstate area Hans Rosenfeld
2011-03-24 11:39     ` Brian Gerst
2011-03-29 14:17       ` Hans Rosenfeld
2011-03-29 15:27         ` H. Peter Anvin
2011-03-30 13:11           ` Hans Rosenfeld
2011-04-05 15:50           ` [RFC v3 0/8] x86, xsave: rework of extended state handling, LWP support Hans Rosenfeld
2011-04-07  7:23             ` Ingo Molnar
2011-04-07 15:30               ` Hans Rosenfeld
2011-04-07 16:08                 ` [RFC v4 6/8] x86, xsave: add support for non-lazy xstates Hans Rosenfeld
2011-04-07 16:08                 ` [RFC v4 8/8] x86, xsave: remove lazy allocation of xstate area Hans Rosenfeld
2011-04-13 10:58                 ` [PATCH] x86, xsave: fix non-lazy allocation of the xsave area Hans Rosenfeld
2011-04-13 23:21                   ` H. Peter Anvin
2011-04-15 16:47                     ` [PATCH 1/1] " Hans Rosenfeld
2011-05-16 19:10               ` [RFC v3 0/8] x86, xsave: rework of extended state handling, LWP support Hans Rosenfeld
2011-05-17 11:30                 ` Ingo Molnar
2011-05-17 15:22                   ` Hans Rosenfeld
2011-05-18 11:22                     ` Ingo Molnar
2011-05-18 13:51                     ` Ingo Molnar
2011-05-18  8:16                   ` Joerg Roedel
2011-05-18 10:59                     ` Ingo Molnar
2011-05-18 18:02                   ` Andreas Herrmann
2011-04-05 15:50           ` [RFC v3 1/8] x86, xsave: cleanup fpu/xsave support Hans Rosenfeld
2011-04-05 15:50           ` [RFC v3 2/8] x86, xsave: rework " Hans Rosenfeld
2011-04-05 15:50           ` [RFC v3 3/8] x86, xsave: cleanup fpu/xsave signal frame setup Hans Rosenfeld
2011-04-05 15:50           ` [RFC v3 4/8] x86, xsave: remove unused code Hans Rosenfeld
2011-04-05 15:50           ` [RFC v3 5/8] x86, xsave: more cleanups Hans Rosenfeld
2011-04-05 15:50           ` [RFC v3 6/8] x86, xsave: add support for non-lazy xstates Hans Rosenfeld
2011-04-05 15:50           ` [RFC v3 7/8] x86, xsave: add kernel support for AMDs Lightweight Profiling (LWP) Hans Rosenfeld
2011-04-06 22:06             ` [tip:x86/xsave] " tip-bot for Hans Rosenfeld
2011-04-05 15:50           ` [RFC v3 8/8] x86, xsave: remove lazy allocation of xstate area Hans Rosenfeld
2011-04-06 22:06             ` [tip:x86/xsave] " tip-bot for Hans Rosenfeld

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).