1. 05 3月, 2009 2 次提交
    • U
      [ARM] 5418/1: restore lr before leaving mcount · d4cc510c
      Uwe Kleine-König 提交于
      gcc seems to expect that lr isn't clobbered by mcount, because for a
      function starting with:
      
      	static int func(void)
      	{
      		void *ra = __builtin_return_address(0);
      
      		printk(KERN_EMERG "__builtin_return_address(0) = %pS\n", ra)
      
      		...
      
      the following assembler is generated by gcc 4.3.2:
      
      	   0:   e1a0c00d        mov     ip, sp
      	   4:   e92dd810        push    {r4, fp, ip, lr, pc}
      	   8:   e24cb004        sub     fp, ip, #4      ; 0x4
      	   c:   ebfffffe        bl      0 <mcount>
      	  10:   e59f0034        ldr     r0, [pc, #52]
      	  14:   e1a0100e        mov     r1, lr
      	  18:   ebfffffe        bl      0 <printk>
      
      Without this patch obviously __builtin_return_address(0) yields
      func+0x10 instead of the return address of the caller.
      
      Note this patch fixes a similar issue for the routines used with dynamic
      ftrace even though this isn't currently selectable for ARM.
      
      Cc: Abhishek Sagar <sagar.abhishek@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      d4cc510c
    • R
      843e22b0
  2. 04 3月, 2009 13 次提交
  3. 03 3月, 2009 24 次提交
  4. 02 3月, 2009 1 次提交
    • P
      x86 mmiotrace: fix race with release_kmmio_fault_page() · 340430c5
      Pekka Paalanen 提交于
      There was a theoretical possibility to a race between arming a page in
      post_kmmio_handler() and disarming the page in
      release_kmmio_fault_page():
      
      cpu0                             cpu1
      ------------------------------------------------------------------
      mmiotrace shutdown
      enter release_kmmio_fault_page
                                       fault on the page
                                       disarm the page
      disarm the page
                                       handle the MMIO access
                                       re-arm the page
      put the page on release list
      remove_kmmio_fault_pages()
                                       fault on the page
                                       page not known to mmiotrace
                                       fall back to do_page_fault()
                                       *KABOOM*
      
      (This scenario also shows the double disarm case which is allowed.)
      
      Fixed by acquiring kmmio_lock in post_kmmio_handler() and checking
      if the page is being released from mmiotrace.
      Signed-off-by: NPekka Paalanen <pq@iki.fi>
      Cc: Stuart Bennett <stuart@freedesktop.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      340430c5