13 Nov, 2013

1 commit

  • Only a couple of arches (sh/x86) use fpu_counter in task_struct so it can
    be moved out into ARCH specific thread_struct, reducing the size of
    task_struct for other arches.

    Compile tested sh defconfig + sh4-linux-gcc (4.6.3)

    Signed-off-by: Vineet Gupta
    Cc: Paul Mundt
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vineet Gupta
     

11 Jan, 2013

1 commit


23 Oct, 2012

1 commit


17 May, 2012

1 commit

  • Historical prepare_to_copy() is mostly a no-op, duplicated for majority of
    the architectures and the rest following the x86 model of flushing the extended
    register state like fpu there.

    Remove it and use the arch_dup_task_struct() instead.

    Suggested-by: Oleg Nesterov
    Suggested-by: Linus Torvalds
    Signed-off-by: Suresh Siddha
    Link: http://lkml.kernel.org/r/1336692811-30576-1-git-send-email-suresh.b.siddha@intel.com
    Acked-by: Benjamin Herrenschmidt
    Cc: David Howells
    Cc: Koichi Yasutake
    Cc: Paul Mackerras
    Cc: Paul Mundt
    Cc: Chris Zankel
    Cc: Richard Henderson
    Cc: Russell King
    Cc: Haavard Skinnemoen
    Cc: Mike Frysinger
    Cc: Mark Salter
    Cc: Aurelien Jacquiot
    Cc: Mikael Starvik
    Cc: Yoshinori Sato
    Cc: Richard Kuo
    Cc: Tony Luck
    Cc: Michal Simek
    Cc: Ralf Baechle
    Cc: Jonas Bonn
    Cc: James E.J. Bottomley
    Cc: Helge Deller
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: Chen Liqin
    Cc: Lennox Wu
    Cc: David S. Miller
    Cc: Chris Metcalf
    Cc: Jeff Dike
    Cc: Richard Weinberger
    Cc: Guan Xuetao
    Signed-off-by: H. Peter Anvin

    Suresh Siddha
     

11 Jan, 2011

1 commit


18 Nov, 2010

1 commit

  • GCC's __builtin_prefetch() was introduced a long time ago, all
    supported GCC versions have it. So this patch is to use it for
    implementing the prefetch on SH2A and SH4.

    The current prefetch implementation is almost equivalent with
    __builtin_prefetch.
    The third parameter in the __builtin_prefetch is the locality
    that it's not supported on SH architectures. It has been set
    to three and it should be verified if it's suitable for SH2A
    as well. I didn't test on this architecture.

    The builtin usage should be more efficient that an __asm__
    because less barriers, and because the compiler doesn't see the
    inst as a "black box" allowing better code generation.

    This has been already done on other architectures (see the commit:
    0453fb3c528c5eb3483441a466b24a4cb409eec5).

    Many thanks to Christian Bruel for his
    support on evaluate the impact of the gcc built-in on SH4 arch.

    No regressions found while testing with LMbench on STLinux targets.

    Signed-off-by: Giuseppe Cavallaro
    Signed-off-by: Stuart Menefy
    Signed-off-by: Paul Mundt

    Giuseppe CAVALLARO
     

14 Jun, 2010

1 commit

  • This follows the x86/ppc changes for kprobe-based event tracing on sh.
    While kprobes is only supported on 32-bit sh, we provide the API for
    HAVE_REGS_AND_STACK_ACCESS_API for both 32 and 64-bit.

    Signed-off-by: Paul Mundt

    Paul Mundt
     

21 Apr, 2010

1 commit


23 Feb, 2010

1 commit

  • This hooks up the SET/GET_UNALIGN_CTL knobs cribbing the bulk of it from
    the PPC and ia64 implementations. The thread flags happen to be the
    logical inverse of what the global fault mode is set to, so this works
    out pretty cleanly. By default the global fault mode is used, with tasks
    now being able to override their own settings via prctl().

    Signed-off-by: Paul Mundt

    Paul Mundt
     

19 Jan, 2010

1 commit


13 Jan, 2010

2 commits

  • Paul Mundt
     
  • This follows the x86 xstate changes and implements a task_xstate slab
    cache that is dynamically sized to match one of hard FP/soft FP/FPU-less.

    This also tidies up and consolidates some of the SH-2A/SH-4 FPU
    fragmentation. Now fpu state restorers are commonly defined, with the
    init_fpu()/fpu_init() mess reworked to follow the x86 convention.
    The fpu_init() register initialization has been replaced by xstate setup
    followed by writing out to hardware via the standard restore path.

    As init_fpu() now performs a slab allocation a secondary lighterweight
    restorer is also introduced for the context switch.

    In the future the DSP state will be rolled in here, too.

    More work remains for math emulation and the SH-5 FPU, which presently
    uses its own special (UP-only) interfaces.

    Signed-off-by: Paul Mundt

    Paul Mundt
     

12 Jan, 2010

1 commit


05 Jan, 2010

1 commit

  • This is the next big chunk of hw_breakpoint support. This decouples
    the SH-4A support from the core and moves it out in to its own stub,
    following many of the conventions established with the perf events
    layering.

    In addition to extending SH-4A support to encapsulate the remainder
    of the UBC channels, clock framework support for handling the UBC
    interface clock is added as well, allowing for dynamic clock gating.

    This also fixes up a regression introduced by the SIGTRAP handling that
    broke the ksym_tracer, to the extent that the current support works well
    with all of the ksym_tracer/ptrace/kgdb. The kprobes singlestep code will
    follow in turn.

    With this in place, the remaining UBC variants (SH-2A and SH-4) can now
    be trivially plugged in.

    Signed-off-by: Paul Mundt

    Paul Mundt
     

08 Dec, 2009

2 commits

  • Conflict between FPU thread flag migration and debug
    thread flag addition.

    Conflicts:
    arch/sh/include/asm/thread_info.h
    arch/sh/include/asm/ubc.h
    arch/sh/kernel/process_32.c

    Paul Mundt
     
  • This adds preliminary support for the SH-4A UBC to the hw-breakpoints API.
    Presently only a single channel is implemented, and the ptrace interface
    still needs to be converted. This is the first step to cleaning up the
    long-standing UBC mess, making the UBC more generally accessible, and
    finally making it SMP safe.

    An additional abstraction will be layered on top of this as with the perf
    events code to permit the various CPU families to wire up support for
    their own specific UBCs, as many variations exist.

    Signed-off-by: Paul Mundt

    Paul Mundt
     

24 Nov, 2009

1 commit

  • A number of small optimisations to FPU handling, in particular:

    - move the task USEDFPU flag from the thread_info flags field (which
    is accessed asynchronously to the thread) to a new status field,
    which is only accessed by the thread itself. This allows locking to
    be removed in most cases, or can be reduced to a preempt_lock().
    This mimics the i386 behaviour.

    - move the modification of regs->sr and thread_info->status flags out
    of save_fpu() to __unlazy_fpu(). This gives the compiler a better
    chance to optimise things, as well as making save_fpu() symmetrical
    with restore_fpu() and init_fpu().

    - implement prepare_to_copy(), so that when creating a thread, we can
    unlazy the FPU prior to copying the thread data structures.

    Also make sure that the FPU is disabled while in the kernel, in
    particular while booting, and for newly created kernel threads,

    In a very artificial benchmark, the execution time for 2500000
    context switches was reduced from 50 to 45 seconds.

    Signed-off-by: Stuart Menefy
    Signed-off-by: Paul Mundt

    Stuart Menefy
     

04 Apr, 2009

1 commit

  • There were a number of issues with the DSP context save/restore code,
    mostly left-over relics from when it was introduced on SH3-DSP with
    little follow-up testing, resulting in things like task_pt_dspregs()
    referencing incorrect state on the stack.

    This follows the MIPS convention of tracking the DSP state in the
    thread_struct and handling the state save/restore in switch_to() and
    finish_arch_switch() respectively. The regset interface is also updated,
    which allows us to finally be rid of task_pt_dspregs() and the special
    cased task_pt_regs().

    Signed-off-by: Michael Trimarchi
    Signed-off-by: Paul Mundt

    Michael Trimarchi
     

27 Feb, 2009

1 commit


29 Jan, 2009

1 commit


22 Dec, 2008

3 commits


17 Sep, 2008

1 commit


12 Sep, 2008

1 commit


08 Sep, 2008

1 commit


29 Jul, 2008

1 commit

  • This follows the sparc changes a439fe51a1f8eb087c22dd24d69cebae4a3addac.

    Most of the moving about was done with Sam's directions at:

    http://marc.info/?l=linux-sh&m=121724823706062&w=2

    with subsequent hacking and fixups entirely my fault.

    Signed-off-by: Sam Ravnborg
    Signed-off-by: Paul Mundt

    Paul Mundt