1. 08 12月, 2006 4 次提交
  2. 15 11月, 2006 1 次提交
  3. 29 10月, 2006 1 次提交
  4. 22 10月, 2006 1 次提交
  5. 05 10月, 2006 1 次提交
    • D
      IRQ: Maintain regs pointer globally rather than passing to IRQ handlers · 7d12e780
      David Howells 提交于
      Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
      of passing regs around manually through all ~1800 interrupt handlers in the
      Linux kernel.
      
      The regs pointer is used in few places, but it potentially costs both stack
      space and code to pass it around.  On the FRV arch, removing the regs parameter
      from all the genirq function results in a 20% speed up of the IRQ exit path
      (ie: from leaving timer_interrupt() to leaving do_IRQ()).
      
      Where appropriate, an arch may override the generic storage facility and do
      something different with the variable.  On FRV, for instance, the address is
      maintained in GR28 at all times inside the kernel as part of general exception
      handling.
      
      Having looked over the code, it appears that the parameter may be handed down
      through up to twenty or so layers of functions.  Consider a USB character
      device attached to a USB hub, attached to a USB controller that posts its
      interrupts through a cascaded auxiliary interrupt controller.  A character
      device driver may want to pass regs to the sysrq handler through the input
      layer which adds another few layers of parameter passing.
      
      I've build this code with allyesconfig for x86_64 and i386.  I've runtested the
      main part of the code on FRV and i386, though I can't test most of the drivers.
      I've also done partial conversion for powerpc and MIPS - these at least compile
      with minimal configurations.
      
      This will affect all archs.  Mostly the changes should be relatively easy.
      Take do_IRQ(), store the regs pointer at the beginning, saving the old one:
      
      	struct pt_regs *old_regs = set_irq_regs(regs);
      
      And put the old one back at the end:
      
      	set_irq_regs(old_regs);
      
      Don't pass regs through to generic_handle_irq() or __do_IRQ().
      
      In timer_interrupt(), this sort of change will be necessary:
      
      	-	update_process_times(user_mode(regs));
      	-	profile_tick(CPU_PROFILING, regs);
      	+	update_process_times(user_mode(get_irq_regs()));
      	+	profile_tick(CPU_PROFILING);
      
      I'd like to move update_process_times()'s use of get_irq_regs() into itself,
      except that i386, alone of the archs, uses something other than user_mode().
      
      Some notes on the interrupt handling in the drivers:
      
       (*) input_dev() is now gone entirely.  The regs pointer is no longer stored in
           the input_dev struct.
      
       (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking.  It does
           something different depending on whether it's been supplied with a regs
           pointer or not.
      
       (*) Various IRQ handler function pointers have been moved to type
           irq_handler_t.
      Signed-Off-By: NDavid Howells <dhowells@redhat.com>
      (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
      7d12e780
  6. 04 10月, 2006 1 次提交
  7. 01 10月, 2006 4 次提交
  8. 13 9月, 2006 1 次提交
  9. 25 7月, 2006 1 次提交
  10. 03 7月, 2006 1 次提交
  11. 27 6月, 2006 1 次提交
  12. 26 6月, 2006 9 次提交
  13. 22 6月, 2006 1 次提交
  14. 18 4月, 2006 1 次提交
  15. 27 3月, 2006 2 次提交
  16. 25 3月, 2006 1 次提交
  17. 24 3月, 2006 1 次提交
  18. 23 3月, 2006 1 次提交
    • P
      [PATCH] cciss: fix use-after-free in cciss_init_one · 61808c2b
      Patrick McHardy 提交于
      free_hba() sets hba[i] to NULL, the dereference afterwards results in this
      crash.  Setting busy_initializing to 0 actually looks unnecessary, but I'm
      not entirely sure, which is why I left it in.
      
      cciss: controller appears to be disabled
      Unable to handle kernel NULL pointer dereference at virtual address 00000370
       printing eip:
      c1114d53
      *pde = 00000000
      Oops: 0002 [#1]
      Modules linked in:
      CPU:    0
      EIP:    0060:[<c1114d53>]    Not tainted VLI
      EFLAGS: 00010286   (2.6.16 #1)
      EIP is at cciss_init_one+0x4e9/0x4fe
      eax: 00000000   ebx: c132cd60   ecx: c13154e4   edx: c27d3c00
      esi: 00000000   edi: c2748800   ebp: c2536ee4   esp: c2536eb8
      ds: 007b   es: 007b   ss: 0068
      Process swapper (pid: 1, threadinfo=c2536000 task=c2535a30)
      Stack: <0>00000000 00000000 00000000 c13fdba0 c2536ee8 c13159c0 c2536f38
      f7c74740
             c132cd60 c132cd60 ffffffed c2536ef0 c10c1d51 c2748800 c2536f04
      c10c1d85
             c132cd60 c2748800 c132cd8c c2536f14 c10c1db8 c2748848 00000000
      c2536f28
      Call Trace:
       [<c10031d5>] show_stack_log_lvl+0xa8/0xb0
       [<c1003305>] show_registers+0x102/0x16a
       [<c10034a2>] die+0xc1/0x13c
       [<c1288160>] do_page_fault+0x38a/0x525
       [<c1002e9b>] error_code+0x4f/0x54
       [<c10c1d51>] pci_call_probe+0xd/0x10
       [<c10c1d85>] __pci_device_probe+0x31/0x43
       [<c10c1db8>] pci_device_probe+0x21/0x34
       [<c110a654>] driver_probe_device+0x44/0x99
       [<c110a73f>] __driver_attach+0x39/0x5d
       [<c1109e1c>] bus_for_each_dev+0x35/0x5a
       [<c110a777>] driver_attach+0x14/0x16
       [<c110a220>] bus_add_driver+0x5c/0x8f
       [<c110ab22>] driver_register+0x73/0x78
       [<c10c1f6d>] __pci_register_driver+0x5f/0x71
       [<c13bf935>] cciss_init+0x1a/0x1c
       [<c13aa718>] do_initcalls+0x4c/0x96
       [<c13aa77e>] do_basic_setup+0x1c/0x1e
       [<c10002b1>] init+0x35/0x118
       [<c1000cf5>] kernel_thread_helper+0x5/0xb
      Code: 04 b5 e0 de 40 c1 8d 50 04 8b 40 34 e8 3f b7 f9 ff 8b 04 b5 e0 de
      40 c1 e8 aa f3 ff ff 89 f0 e8 e8 fa ff ff 8b 04 b5 e0 de 40 c1 <c7> 80
      70 03 00 00 00 00 00 00 83 c8 ff 8d 65 f4 5b 5e 5f 5d c3
       <0>Kernel panic - not syncing: Attempted to kill init!
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Cc: <mike.miller@hp.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      61808c2b
  19. 22 3月, 2006 1 次提交
  20. 28 2月, 2006 1 次提交
  21. 08 2月, 2006 1 次提交
  22. 10 1月, 2006 1 次提交
  23. 09 1月, 2006 3 次提交