1. 24 12月, 2009 2 次提交
  2. 22 12月, 2009 5 次提交
  3. 19 12月, 2009 1 次提交
  4. 18 12月, 2009 3 次提交
  5. 17 12月, 2009 29 次提交
    • B
      spi_s3c24xx: add FIQ pseudo-DMA support · bec0806c
      Ben Dooks 提交于
      Add pseudo-DMA by FIQ to the S3C24XX SPI driver.  This allows the driver
      to get DMA-like performance where there are either no free DMA channels or
      when doing transfers that required both TX and RX data paths.
      
      Since this patch requires the addition of an assembly file to hold the FIQ
      code, we rename the module (instead of adding a rename of the .c file to
      this patch).  We expect most users are loading this via udev and thus
      there should be no change to the userland configuration.
      Signed-off-by: NBen Dooks <ben@simtec.co.uk>
      Signed-off-by: NSimtec Linux Team <linux@simtec.co.uk>
      Cc: David Brownell <david-b@pacbell.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      bec0806c
    • L
      x86/ptrace: make genregs[32]_get/set more robust · 04a1e62c
      Linus Torvalds 提交于
      The loop condition is fragile: we compare an unsigned value to zero, and
      then decrement it by something larger than one in the loop.  All the
      callers should be passing in appropriately aligned buffer lengths, but
      it's better to just not rely on it, and have some appropriate defensive
      loop limits.
      Acked-by: NRoland McGrath <roland@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      04a1e62c
    • C
      ef8355c3
    • C
      score: fixed pfn_valid define. · 202b864a
      Chen Liqin 提交于
      Signed-off-by: NCui Bixiong <bixiong@sunnorth.com.cn>
      Signed-off-by: NChen Liqin <liqin.chen@sunplusct.com>
      
      	modified:   arch/score/include/asm/page.h
      	modified:   arch/score/kernel/setup.c
      	modified:   arch/score/mm/init.c
      202b864a
    • C
      score: add flush_dcahce_page and PG_dcache_dirty define · 11ab3f3d
      Chen Liqin 提交于
      Signed-off-by: NCui Bixiong <bixiong@sunnorth.com.cn>
      Signed-off-by: NChen Liqin <liqin.chen@sunplusct.com>
      
      	modified:   arch/score/include/asm/cacheflush.h
      	modified:   arch/score/mm/cache.c
      11ab3f3d
    • R
      MIPS: Lasat: Fix botched changes to sysctl code. · 606d62fa
      Ralf Baechle 提交于
      Commit 16393192 "sysctl mips/lasat: Remove
      dead binary sysctl support" obviously wasn't test built ...
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      606d62fa
    • R
      cf72e947
    • M
      MIPS: No longer hardwire CONFIG_EMBEDDED to y · a4609780
      Martin Michlmayr 提交于
      There's no reason for MIPS to select EMBEDDED.  In fact, EMBEDDED makes
      MIPS more awkward to deal with because it makes it different to the
      majority of architectures for no good reason.
      
      [Ralf: Historically disabling EMBEDDED had hid essential options for many
       MIPS platforms such as serial console and forced crap like VGA support
       or power managment enabled for platforms where those don't make any sense.
      
       The name of the option is also _very_ missleading so many users don't
       select it even where is was required for a functioning kernel.]
      Signed-off-by: NMartin Michlmayr <tbm@cyrius.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/663/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      a4609780
    • D
      MIPS: Fix and enhance built-in kernel command line · 6acc7d48
      Dmitri Vorobiev 提交于
      Currently, MIPS kernels silently overwrite kernel command-line parameters
      hardcoded in CONFIG_CMDLINE by the ones received from firmware.  Therefore,
      using firmware remains the only reliable method to transfer the
      command-line parameters, which is not always desirable or convenient, and
      the CONFIG_CMDLINE option is thereby effectively rendered useless.
      
      This patch fixes the problem described above and introduces a more flexible
      scheme of handling the kernel command line, in a manner identical to what is
      currently used for x86.  The default behavior, i.e. when CONFIG_CMDLINE_BOOL
      is not defined, retains the existing semantics, and firmware command-line
      arguments override the hardcoded ones.
      
      [Ralf: I fixed up all the defconfig files so the stay unaffected by this
      change.]
      Signed-off-by: NDmitri Vorobiev <dmitri.vorobiev@movial.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/689/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      6acc7d48
    • R
      MIPS: eXcite: Remove platform. · de4148f3
      Ralf Baechle 提交于
      The platform has never been fully merged 
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      Cc: Thomas Koeller <thomas.koeller@baslerweb.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Wim Van Sebroeck <wim@iguana.be>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mtd@lists.infradead.org
      Acked-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      Acked-by: NWim Van Sebroeck <wim@iguana.be>
      de4148f3
    • W
      MIPS: Loongson: Cleanups of serial port support · c3d8d850
      Wu Zhangjin 提交于
      This patchs uses a loongson_uart_base variable instead of the
      uart_base[] array and adds a new kernel option to avoid to compile
      uart_base.c all the time, which will save a little bit of memory for us.
      Signed-off-by: NWu Zhangjin <wuzhangjin@gmail.com>
      Cc: linux-mips@linux-mips.org
      http://patchwork.linux-mips.org/patch/727/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      c3d8d850
    • W
      MIPS: Lemote 2F: Suspend CS5536 MFGPT Timer · c47a48d8
      Wu Zhangjin 提交于
      Before putting the Loongson 2F into wait mode, suspend the MFGPT Timer and
      after wake-up resume it.  This may save some power.
      Signed-off-by: NWu Zhangjin <wuzhangjin@gmail.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/706/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      c47a48d8
    • U
      MIPS: Excite: move iodev_remove to .devexit.text · 59d4a914
      Uwe Kleine-König 提交于
      The function iodev_remove is used only wrapped by __devexit_p so define
      it using __devexit.
      Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Cc: Ming Lei <tom.leiming@gmail.com>
      Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/710/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      59d4a914
    • A
      MIPS: Lasat: Convert to proc_fops / seq_file · c0b4abdd
      Alexey Dobriyan 提交于
      Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Cc: akpm@linux-foundation.org
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/725/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      c0b4abdd
    • R
      MIPS: Cleanup signal code initialization · 137f6f3e
      Ralf Baechle 提交于
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/709/
      137f6f3e
    • R
      MIPS: Modularize COP2 handling · 69f3a7de
      Ralf Baechle 提交于
      Away with the daemons of ifdef; get ready for future COP2 users.
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      Patchwork: http://patchwork.linux-mips.org/patch/708/
      69f3a7de
    • R
      MIPS: Move EARLY_PRINTK to Kconfig.debug · 4dd92e15
      Ralf Baechle 提交于
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      4dd92e15
    • W
      70ab711d
    • W
      MIPS: Yeeloong 2F: Add LID open event as the wakeup event · cb1ed9e1
      Wu Zhangjin 提交于
      Yeeloong 2F netbook has an KB3310B embedded controller to manage the LID
      action.  When the LID is closed or opened a SCI interrupt is sent out and
      the corresponding event is saved to an EC register for later query.
      
      Allow the LID open interrupt to wake the processor from wait mode if it is
      in the suspend mode.
      Signed-off-by: NWu Zhangjin <wuzhangjin@gmail.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/685/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      cb1ed9e1
    • W
      MIPS: Yeeloong 2F: Add basic EC operations · ec614d80
      Wu Zhangjin 提交于
      YeeLoong2F has a KB3310b embedded controller. Add basic operations for
      future related drivers and board support.
      Signed-off-by: NWu Zhangjin <wuzhangjin@gmail.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/684/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      ec614d80
    • D
      MIPS: Move several variables from .bss to .init.data · 599a8945
      Dmitri Vorobiev 提交于
      Several static uninitialized variables are used in the scope of __init
      functions but are themselves not marked as __initdata.  This patch is to put
      those variables to where they belong and to reduce the memory footprint a
      little bit.
      
      Also, a couple of lines with spaces instead of tabs were fixed.
      Signed-off-by: NDmitri Vorobiev <dmitri.vorobiev@movial.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/698/Acked-by: NFlorian Fainelli <florian@openwrt.org>
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      599a8945
    • W
      MIPS: Tracing: Make function graph tracer work with -mmcount-ra-address · 7326c4e5
      Wu Zhangjin 提交于
      That thread "MIPS: Add option to pass return address location to
      _mcount" from "David Daney <ddaney@caviumnetworks.com>" have added a new
      option -mmcount-ra-address to gcc(4.5) for MIPS to transfer the location
      of the return address to _mcount.
      
      Benefit from this new feature, function graph tracer on MIPS will be
      easier and safer to hijack the return address of the kernel function,
      which will save some overhead and make the whole thing more reliable.
      
      In this patch, at first, try to enable the option -mmcount-ra-address in
      arch/mips/Makefile with cc-option, if gcc support it, it will be
      enabled, otherwise, no side effect.
      
      and then, we need to support this new option of gcc 4.5 and also support
      the old gcc versions.
      
      with _mcount in the old gcc versions, it's not easy to get the location
      of return address(tracing: add function graph tracer support for MIPS),
         so, we do it in a C function: ftrace_get_parent_addr(ftrace.c), but
         with -mmcount-ra-address, only several instructions need to get what
         we want, so, I put into asm(mcount.S). and also, as the $12(t0) is
         used by -mmcount-ra-address for transferring the localtion of return
         address to _mcount, we need to save it into the stack and restore it
         when enabled dynamic function tracer, 'Cause we have called
         "ftrace_call" before "ftrace_graph_caller", which may destroy
         $12(t0).
      
      (Thanks to David for providing that -mcount-ra-address and giving the
       idea of KBUILD_MCOUNT_RA_ADDRESS, both of them have made the whole
       thing more beautiful!)
      Signed-off-by: NWu Zhangjin <wuzhangjin@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Nicholas Mc Guire <der.herr@hofr.at>
      Cc: zhangfx@lemote.com
      Cc: Wu Zhangjin <wuzhangjin@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/681/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      7326c4e5
    • W
      MIPS: Tracing: Reserve $12(t0) for mcount-ra-address of gcc 4.5 · fc49a3be
      Wu Zhangjin 提交于
      A new option -mmcount-ra-address for gcc 4.5 have been sent by David
      Daney <ddaney@caviumnetworks.com> in the thread "MIPS: Add option to
      pass return address location to _mcount", which help to record the
      location of the return address(ra) for the function graph tracer of MIPS
      to hijack the return address easier and safer. that option used the
      $12(t0) register by default, so, we reserve it for it, and use t1,t2,t3
      instead of t0,t1,t2.
      Signed-off-by: NWu Zhangjin <wuzhangjin@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Nicholas Mc Guire <der.herr@hofr.at>
      Cc: zhangfx@lemote.com
      Cc: Wu Zhangjin <wuzhangjin@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/680/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      fc49a3be
    • W
      MIPS: Tracing: Make ftrace for MIPS work without -fno-omit-frame-pointer · 046199ca
      Wu Zhangjin 提交于
      When remove the -fno-omit-frame-pointer, gcc will not save the frame
      pointer for us, we need to save one ourselves.
      Signed-off-by: NWu Zhangjin <wuzhangjin@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Nicholas Mc Guire <der.herr@hofr.at>
      Cc: zhangfx@lemote.com
      Cc: Wu Zhangjin <wuzhangjin@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/679/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      046199ca
    • W
      MIPS: Tracing: Add dynamic function graph tracer for MIPS · e17ff5fe
      Wu Zhangjin 提交于
      This patch make function graph tracer work with dynamic function tracer.
      
      To share the source code of dynamic function tracer(MCOUNT_SAVE_REGS),
      and avoid restoring the whole saved registers, we need to restore the ra
      register from the stack.
      
      (NOTE: This not work with 32bit! need to ensure why!)
      Signed-off-by: NWu Zhangjin <wuzhangjin@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Nicholas Mc Guire <der.herr@hofr.at>
      Cc: zhangfx@lemote.com
      Cc: Wu Zhangjin <wuzhangjin@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/678/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      e17ff5fe
    • W
      MIPS: Tracing: Add function graph tracer support for MIPS · 29c5d346
      Wu Zhangjin 提交于
      The implementation of function graph tracer for MIPS is a little
      different from X86.
      
      in MIPS, gcc(with -pg) only transfer the caller's return address(at) and
      the _mcount's return address(ra) to us.
      
      For the kernel part without -mlong-calls:
      
      move at, ra
      jal _mcount
      
      For the module part with -mlong-calls:
      
      lui v1, hi16bit_of_mcount
      addiu v1, v1, low16bit_of_mcount
      move at, ra
      jal _mcount
      
      Without -mlong-calls,
      
      if the function is a leaf, it will not save the return address(ra):
      
      ffffffff80101298 <au1k_wait>:
      ffffffff80101298:       67bdfff0        daddiu  sp,sp,-16
      ffffffff8010129c:       ffbe0008        sd      s8,8(sp)
      ffffffff801012a0:       03a0f02d        move    s8,sp
      ffffffff801012a4:       03e0082d        move    at,ra
      ffffffff801012a8:       0c042930        jal     ffffffff8010a4c0 <_mcount>
      ffffffff801012ac:       00020021        nop
      
      so, we can hijack it directly in _mcount, but if the function is non-leaf, the
      return address is saved in the stack.
      
      ffffffff80133030 <copy_process>:
      ffffffff80133030:       67bdff50        daddiu  sp,sp,-176
      ffffffff80133034:       ffbe00a0        sd      s8,160(sp)
      ffffffff80133038:       03a0f02d        move    s8,sp
      ffffffff8013303c:       ffbf00a8        sd      ra,168(sp)
      ffffffff80133040:       ffb70098        sd      s7,152(sp)
      ffffffff80133044:       ffb60090        sd      s6,144(sp)
      ffffffff80133048:       ffb50088        sd      s5,136(sp)
      ffffffff8013304c:       ffb40080        sd      s4,128(sp)
      ffffffff80133050:       ffb30078        sd      s3,120(sp)
      ffffffff80133054:       ffb20070        sd      s2,112(sp)
      ffffffff80133058:       ffb10068        sd      s1,104(sp)
      ffffffff8013305c:       ffb00060        sd      s0,96(sp)
      ffffffff80133060:       03e0082d        move    at,ra
      ffffffff80133064:       0c042930        jal     ffffffff8010a4c0 <_mcount>
      ffffffff80133068:       00020021        nop
      
      but we can not get the exact stack address(which saved ra) directly in
      _mcount, we need to search the content of at register in the stack space
      or search the "s{d,w} ra, offset(sp)" instruction in the text. 'Cause we
      can not prove there is only a match in the stack space, so, we search
      the text instead.
      
      as we can see, if the first instruction above "move at, ra" is not a
      store instruction, there should be a leaf function, so we hijack the at
      register directly via putting &return_to_handler into it, otherwise, we
      search the "s{d,w} ra, offset(sp)" instruction to get the stack offset,
      and then the stack address. we use the above copy_process() as an
      example, we at last find "ffbf00a8", 0xa8 is the stack offset, we plus
      it with s8(fp), that is the stack address, we hijack the content via
      writing the &return_to_handler in.
      
      If with -mlong-calls, since there are two more instructions above "move
      at, ra", so, we can move the pointer to the position above "lui v1,
      hi16bit_of_mcount".
      Signed-off-by: NWu Zhangjin <wuzhangjin@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Nicholas Mc Guire <der.herr@hofr.at>
      Cc: zhangfx@lemote.com
      Cc: Wu Zhangjin <wuzhangjin@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/677/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      29c5d346
    • W
      MIPS: Tracing: Add IRQENTRY_EXIT section for MIPS · 8f99a162
      Wu Zhangjin 提交于
      This patch add a new section for MIPS to record the block of the hardirq
      handling for function graph tracer(print_graph_irq) via adding the
      __irq_entry annotation to the the entrypoints of the hardirqs(the block
      with irq_enter()...irq_exit()).
      
      Thanks goes to Steven & Frederic Weisbecker for their feedbacks.
      Signed-off-by: NWu Zhangjin <wuzhangjin@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Nicholas Mc Guire <der.herr@hofr.at>
      Cc: zhangfx@lemote.com
      Cc: Wu Zhangjin <wuzhangjin@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Reviewed-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Patchwork: http://patchwork.linux-mips.org/patch/676/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      8f99a162
    • W
      MIPS: Tracing: Add dynamic function tracer support · 538f1952
      Wu Zhangjin 提交于
      With dynamic function tracer, by default, _mcount is defined as an
      "empty" function, it returns directly without any more action . When
      enabling it in user-space, it will jump to a real tracing
      function(ftrace_caller), and do the real job for us.
      
      Differ from the static function tracer, dynamic function tracer provides
      two functions ftrace_make_call()/ftrace_make_nop() to enable/disable the
      tracing of some indicated kernel functions(set_ftrace_filter).
      
      In the -v4 version, the implementation of this support is basically the same as
      X86 version does: _mcount is implemented as an empty function and ftrace_caller
      is implemented as a real tracing function respectively.
      
      But in this version, to support module tracing with the help of
      -mlong-calls in arch/mips/Makefile:
      
      MODFLAGS += -mlong-calls.
      
      The stuff becomes a little more complex. We need to cope with two
      different type of calling to _mcount.
      
      For the kernel part, the calling to _mcount(result of "objdump -hdr
      vmlinux"). is like this:
      
      	108:   03e0082d        move    at,ra
      	10c:   0c000000        jal     0 <fpcsr_pending>
                              10c: R_MIPS_26  _mcount
                              10c: R_MIPS_NONE        *ABS*
                              10c: R_MIPS_NONE        *ABS*
      	110:   00020021        nop
      
      For the module with -mlong-calls, it looks like this:
      
      	c:	3c030000 	lui	v1,0x0
      			c: R_MIPS_HI16	_mcount
      			c: R_MIPS_NONE	*ABS*
      			c: R_MIPS_NONE	*ABS*
      	10:	64630000 	daddiu	v1,v1,0
      			10: R_MIPS_LO16	_mcount
      			10: R_MIPS_NONE	*ABS*
      			10: R_MIPS_NONE	*ABS*
      	14:	03e0082d 	move	at,ra
      	18:	0060f809 	jalr	v1
      
      In the kernel version, there is only one "_mcount" string for every
      kernel function, so, we just need to match this one in mcount_regex of
      scripts/recordmcount.pl, but in the module version, we need to choose
      one of the two to match. Herein, I choose the first one with
      "R_MIPS_HI16 _mcount".
      
      and In the kernel verion, without module tracing support, we just need
      to replace "jal _mcount" by "jal ftrace_caller" to do real tracing, and
      filter the tracing of some kernel functions via replacing it by a nop
      instruction.
      
      but as we have described before, the instruction "jal ftrace_caller" only left
      32bit length for the address of ftrace_caller, it will fail when calling from
      the module space. so, herein, we must replace something else.
      
      the basic idea is loading the address of ftrace_caller to v1 via changing these
      two instructions:
      
      	lui	v1,0x0
      	addiu	v1,v1,0
      
      If we want to enable the tracing, we need to replace the above instructions to:
      
      	lui	v1, HI_16BIT_ftrace_caller
      	addiu	v1, v1, LOW_16BIT_ftrace_caller
      
      If we want to stop the tracing of the indicated kernel functions, we
      just need to replace the "jalr v1" to a nop instruction. but we need to
      replace two instructions and encode the above two instructions
      oursevles.
      
      Is there a simpler solution? Yes! Here it is, in this version, we put _mcount
      and ftrace_caller together, which means the address of _mcount and
      ftrace_caller is the same:
      
      _mcount:
      ftrace_caller:
      	j	ftrace_stub
      	 nop
      
      	...(do real tracing here)...
      
      ftrace_stub:
      	jr	ra
      	 move	ra, at
      
      By default, the kernel functions call _mcount, and then jump to ftrace_stub and
      return. and when we want to do real tracing, we just need to remove that "j
      ftrace_stub", and it will run through the two "nop" instructions and then do
      the real tracing job.
      
      what about filtering job? we just need to do this:
      
      	 lui v1, hi_16bit_of_mcount        <--> b 1f (0x10000004)
      	 addiu v1, v1, low_16bit_of_mcount
      	 move at, ra
      	 jalr v1
      	 nop
      	 				     1f: (rec->ip + 12)
      
      In linux-mips64, there will be some local symbols, whose name are
      prefixed by $L, which need to be filtered. thanks goes to Steven for
      writing the mips64-specific function_regex.
      
      In a conclusion, with RISC, things becomes easier with such a "stupid"
      trick, RISC is something like K.I.S.S, and also, there are lots of
      "simple" tricks in the whole ftrace support, thanks goes to Steven and
      the other folks for providing such a wonderful tracing framework!
      Signed-off-by: NWu Zhangjin <wuzhangjin@gmail.com>
      Cc: Nicholas Mc Guire <der.herr@hofr.at>
      Cc: zhangfx@lemote.com
      Cc: Wu Zhangjin <wuzhangjin@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/675/Acked-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      538f1952
    • W
      MIPS: Tracing: Enable HAVE_FUNCTION_TRACE_MCOUNT_TEST for MIPS · 69a7d1b3
      Wu Zhangjin 提交于
      There is an exisiting common ftrace_test_stop_func() in
      kernel/trace/ftrace.c, which is used to check the global variable
      ftrace_trace_stop to determine whether stop the function tracing.
      
      This patch implepment the MIPS specific one to speedup the procedure.
      
      Thanks goes to Zhang Le for Cleaning it up.
      Signed-off-by: NWu Zhangjin <wuzhangjin@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Nicholas Mc Guire <der.herr@hofr.at>
      Cc: zhangfx@lemote.com
      Cc: Wu Zhangjin <wuzhangjin@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/673/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      69a7d1b3