1. 12 2月, 2010 1 次提交
    • S
      x86, ptrace: regset extensions to support xstate · 5b3efd50
      Suresh Siddha 提交于
      Add the xstate regset support which helps extend the kernel ptrace and the
      core-dump interfaces to support AVX state etc.
      
      This regset interface is designed to support all the future state that gets
      supported using xsave/xrstor infrastructure.
      
      Looking at the memory layout saved by "xsave", one can't say which state
      is represented in the memory layout. This is because if a particular state is
      in init state, in the xsave hdr it can be represented by bit '0'. And hence
      we can't really say by the xsave header wether a state is in init state or
      the state is not saved in the memory layout.
      
      And hence the xsave memory layout available through this regset
      interface uses SW usable bytes [464..511] to convey what state is represented
      in the memory layout.
      
      First 8 bytes of the sw_usable_bytes[464..467] will be set to OS enabled xstate
      mask(which is same as the 64bit mask returned by the xgetbv's xCR0).
      
      The note NT_X86_XSTATE represents the extended state information in the
      core file, using the above mentioned memory layout.
      Signed-off-by: NSuresh Siddha <suresh.b.siddha@intel.com>
      LKML-Reference: <20100211195614.802495327@sbs-t61.sc.intel.com>
      Signed-off-by: NHongjiu Lu <hjl.tools@gmail.com>
      Cc: Roland McGrath <roland@redhat.com>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      5b3efd50
  2. 05 3月, 2009 1 次提交
    • D
      x86, math-emu: fix init_fpu for task != current · ab9e1858
      Daniel Glöckner 提交于
      Impact: fix math-emu related crash while using GDB/ptrace
      
      init_fpu() calls finit to initialize a task's xstate, while finit always
      works on the current task. If we use PTRACE_GETFPREGS on another
      process and both processes did not already use floating point, we get
      a null pointer exception in finit.
      
      This patch creates a new function finit_task that takes a task_struct
      parameter. finit becomes a wrapper that simply calls finit_task with
      current. On the plus side this avoids many calls to get_current which
      would each resolve to an inline assembler mov instruction.
      
      An empty finit_task has been added to i387.h to avoid linker errors in
      case the compiler still emits the call in init_fpu when
      CONFIG_MATH_EMULATION is not defined.
      
      The declaration of finit in i387.h has been removed as the remaining
      code using this function gets its prototype from fpu_proto.h.
      Signed-off-by: NDaniel Glöckner <dg@emlix.com>
      Cc: Suresh Siddha <suresh.b.siddha@intel.com>
      Cc: "Pallipadi Venkatesh" <venkatesh.pallipadi@intel.com>
      Cc: Arjan van de Ven <arjan@infradead.org>
      Cc: Bill Metzenthen <billm@melbpc.org.au>
      LKML-Reference: <E1Lew31-0004il-Fg@mailer.emlix.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ab9e1858
  3. 20 11月, 2008 1 次提交
    • R
      x86: fix __cpuinit/__init tangle in init_thread_xstate() · 9bc646f1
      Rakib Mullick 提交于
      Impact:	fix incorrect __init annotation
      
      This patch removes the following section mismatch warning. A patch set
      was send previously (http://lkml.org/lkml/2008/11/10/407). But
      introduce some other problem, reported by Rufus
      (http://lkml.org/lkml/2008/11/11/46). Then Ingo Molnar suggest that,
      it's best to remove __init from xsave_cntxt_init(void). Which is the
      second patch in this series. Now, this one removes the following
      warning.
      
      WARNING: arch/x86/kernel/built-in.o(.cpuinit.text+0x2237): Section
      mismatch in reference from the function cpu_init() to the function
      .init.text:init_thread_xstate()
      The function __cpuinit cpu_init() references
      a function __init init_thread_xstate().
      If init_thread_xstate is only used by cpu_init then
      annotate init_thread_xstate with a matching annotation.
      Signed-off-by: NRakib Mullick <rakib.mullick@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      9bc646f1
  4. 08 10月, 2008 1 次提交
    • S
      x86: xsave: set FP, SSE bits in the xsave header in the user sigcontext · 04944b79
      Suresh Siddha 提交于
      If a processor implementation discern that a processor state component is in
      its initialized state, it may modify the corresponding bit in the
      xsave header.xstate_bv as '0'. State in the memory layout setup by 'xsave'
      will be consistent with the bit values in the header.
      
      During signal handling, legacy applications may change the FP/SSE bits
      in the sigcontext memory layout without touching the FP/SSE header bits
      in the xsave header. So always set FP/SSE bits in the xsave header
      while saving the sigcontext state to the user space. During signal return,
      this will enable the kernel to capture any changes to the FP/SSE bits by the
      legacy applications which don't touch xsave headers.
      
      xsave aware apps can change the xstate_bv in the xsave header aswell
      as change any contents in the memory layout. xrestor as part of sigreturn
      will capture all the changes.
      Signed-off-by: NSuresh Siddha <suresh.b.siddha@intel.com>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      04944b79
  5. 31 7月, 2008 7 次提交
  6. 01 7月, 2008 1 次提交
  7. 30 6月, 2008 1 次提交
    • T
      ptrace GET/SET FPXREGS broken · 11dbc963
      TAKADA Yoshihito 提交于
      When I update kernel 2.6.25 from 2.6.24, gdb does not work.
      On 2.6.25, ptrace(PTRACE_GETFPXREGS, ...) returns ENODEV.
      
      But 2.6.24 kernel's ptrace() returns EIO.
      It is issue of compatibility.
      
      I attached test program as pt.c and patch for fix it.
      
      #include <stdio.h>
      #include <stdlib.h>
      #include <unistd.h>
      #include <signal.h>
      #include <errno.h>
      #include <sys/ptrace.h>
      #include <sys/types.h>
      
      struct user_fxsr_struct {
      	unsigned short	cwd;
      	unsigned short	swd;
      	unsigned short	twd;
      	unsigned short	fop;
      	long	fip;
      	long	fcs;
      	long	foo;
      	long	fos;
      	long	mxcsr;
      	long	reserved;
      	long	st_space[32];	/* 8*16 bytes for each FP-reg = 128 bytes */
      	long	xmm_space[32];	/* 8*16 bytes for each XMM-reg = 128 bytes */
      	long	padding[56];
      };
      
      int main(void)
      {
        pid_t pid;
      
        pid = fork();
      
        switch(pid){
        case -1:/*  error */
          break;
        case 0:/*  child */
          child();
          break;
        default:
          parent(pid);
          break;
        }
        return 0;
      }
      
      int child(void)
      {
        ptrace(PTRACE_TRACEME);
        kill(getpid(), SIGSTOP);
        sleep(10);
        return 0;
      }
      int parent(pid_t pid)
      {
        int ret;
        struct user_fxsr_struct fpxregs;
      
        ret = ptrace(PTRACE_GETFPXREGS, pid, 0, &fpxregs);
        if(ret < 0){
          printf("%d: %s.\n", errno, strerror(errno));
        }
        kill(pid, SIGCONT);
        wait(pid);
        return 0;
      }
      
      /* in the kerel, at kernel/i387.c get_fpxregs() */
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      11dbc963
  8. 04 6月, 2008 1 次提交
  9. 11 5月, 2008 1 次提交
  10. 20 4月, 2008 2 次提交
  11. 17 4月, 2008 1 次提交
    • I
      x86: clean up i387.c · f668964e
      Ingo Molnar 提交于
      minor coding style cleanups.
      
      Before:
         total: 0 errors, 3 warnings, 479 lines checked
      After:
         total: 0 errors, 1 warnings, 483 lines checked
      
      No code changed:
      
      arch/x86/kernel/i387.o:
      
         text	   data	    bss	    dec	    hex	filename
         2379	      4	      8	   2391	    957	i387.o.before
         2379	      4	      8	   2391	    957	i387.o.after
      
      md5:
         e1434553a3b4ff1f52ad97a68b1fad8a  i387.o.before.asm
         e1434553a3b4ff1f52ad97a68b1fad8a  i387.o.after.asm
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f668964e
  12. 07 3月, 2008 1 次提交
    • J
      x86: fix merge mistake in i387.c · 609b5297
      Jan Beulich 提交于
      convert_fxsr_to_user() in 2.6.24's i387_32.c did this, and
      convert_to_fxsr() also does the inverse, so I assume it's an oversight
      that it is no longer being done.
      
      [ mingo@elte.hu:
      
        we encode it this way because there's no space for the 'FPU Last
        Instruction Opcode' (->fop) field in the legacy user_i387_ia32_struct
        that PTRACE_GETFPREGS/PTRACE_SETFPREGS uses.
      
        it's probably pure legacy - i'd be surprised if any user-space relied on
        the FPU Last Opcode in any way. But indeed we used to do it previously
        so the most conservative thing is to preserve that piece of information.
      ]
      Signed-off-by: NJan Beulich <jbeulich@novell.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      609b5297
  13. 05 3月, 2008 1 次提交
  14. 19 2月, 2008 1 次提交
  15. 30 1月, 2008 4 次提交
  16. 14 10月, 2007 1 次提交
    • D
      Delete filenames in comments. · 835c34a1
      Dave Jones 提交于
      Since the x86 merge, lots of files that referenced their own filenames
      are no longer correct.  Rather than keep them up to date, just delete
      them, as they add no real value.
      
      Additionally:
      - fix up comment formatting in scx200_32.c
      - Remove a credit from myself in setup_64.c from a time when we had no SCM
      - remove longwinded history from tsc_32.c which can be figured out from
        git.
      Signed-off-by: NDave Jones <davej@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      835c34a1
  17. 11 10月, 2007 2 次提交
  18. 01 7月, 2006 1 次提交
  19. 23 6月, 2006 1 次提交
  20. 23 7月, 2005 1 次提交
    • L
      x86: make restore_fpu() use alternative assembler instructions · 8ed1383f
      Linus Torvalds 提交于
      It's really just a single instruction, conditional on whether the CPU
      supports FXSR or not, so implement it as such instead of making it a
      function that queries FXSR dynamically.
      
      This means that the instruction just gets automatically rewritten to the
      correct one at boot-time.
      8ed1383f
  21. 24 6月, 2005 1 次提交
  22. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4