1. 02 3月, 2010 2 次提交
  2. 26 2月, 2010 1 次提交
  3. 22 2月, 2010 4 次提交
  4. 18 2月, 2010 1 次提交
    • P
      sh: Merge legacy and dynamic PMB modes. · d01447b3
      Paul Mundt 提交于
      This implements a bit of rework for the PMB code, which permits us to
      kill off the legacy PMB mode completely. Rather than trusting the boot
      loader to do the right thing, we do a quick verification of the PMB
      contents to determine whether to have the kernel setup the initial
      mappings or whether it needs to mangle them later on instead.
      
      If we're booting from legacy mappings, the kernel will now take control
      of them and make them match the kernel's initial mapping configuration.
      This is accomplished by breaking the initialization phase out in to
      multiple steps: synchronization, merging, and resizing. With the recent
      rework, the synchronization code establishes page links for compound
      mappings already, so we build on top of this for promoting mappings and
      reclaiming unused slots.
      
      At the same time, the changes introduced for the uncached helpers also
      permit us to dynamically resize the uncached mapping without any
      particular headaches. The smallest page size is more than sufficient for
      mapping all of kernel text, and as we're careful not to jump to any far
      off locations in the setup code the mapping can safely be resized
      regardless of whether we are executing from it or not.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      d01447b3
  5. 17 2月, 2010 7 次提交
  6. 16 2月, 2010 2 次提交
  7. 15 2月, 2010 2 次提交
    • P
      sh: Fix up legacy PMB mode offset calculation. · 04c86973
      Paul Mundt 提交于
      The change for fixing up sh64 inadvertently inverted the logic for legacy
      PMB, fix that back up.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      04c86973
    • P
      sh64: fix tracing of signals. · 4b505db9
      Paul Mundt 提交于
      This follows the parisc change to ensure that tracehook_signal_handler()
      is aware of when we are single-stepping in order to ptrace_notify()
      appropriately. While this was implemented for 32-bit SH, sh64 neglected
      to make use of TIF_SINGLESTEP when it was folded in with the 32-bit code,
      resulting in ptrace_notify() never being called.
      
      As sh64 uses all of the other abstractions already, this simply plugs in
      the thread flag in the appropriate enable/disable paths and fixes up the
      tracehook notification accordingly. With this in place, sh64 is brought
      in line with what 32-bit is already doing.
      Reported-by: NMike Frysinger <vapier@gentoo.org>
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      4b505db9
  8. 12 2月, 2010 1 次提交
  9. 09 2月, 2010 4 次提交
  10. 08 2月, 2010 5 次提交
    • M
      sh: Optimise FDE/CIE lookup by using red-black trees · 858918b7
      Matt Fleming 提交于
      Now that the DWARF unwinder is being used to provide perf callstacks
      unwinding speed is an issue. It is no longer being used in exceptional
      circumstances where we don't care about runtime performance, e.g. when
      panicing, so it makes sense improve performance is possible.
      
      With this patch I saw a 42% improvement in unwind time when calling
      return_address(1). Greater improvements will be seen as the number of
      levels unwound increases as each unwind is now cheaper.
      
      Note that insertion time has doubled but that's just the price we pay
      for keeping the trees balanced. However, this is a one-time cost for
      kernel boot/module load and so the improvements in lookup time dominate
      the extra time we spend keeping the trees balanced.
      Signed-off-by: NMatt Fleming <matt@console-pimps.org>
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      858918b7
    • M
      sh: Remove superfluous setup_frame_reg call · 1af0b2fc
      Matt Fleming 提交于
      There's no need to setup the frame pointer again in
      call_handle_tlbmiss. The frame pointer will already have been setup in
      handle_interrupt.
      Signed-off-by: NMatt Fleming <matt@console-pimps.org>
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      1af0b2fc
    • M
      sh: Don't continue unwinding across interrupts · 944a3438
      Matt Fleming 提交于
      Unfortunately, due to poor DWARF info in current toolchains, unwinding
      through interrutps cannot be done reliably. The problem is that the
      DWARF info for function epilogues is wrong.
      
      Take this standard epilogue sequence,
      
      80003cc4:       e3 6f           mov     r14,r15
      80003cc6:       26 4f           lds.l   @r15+,pr
      80003cc8:       f6 6e           mov.l   @r15+,r14
      						<---- interrupt here
      80003cca:       f6 6b           mov.l   @r15+,r11
      80003ccc:       f6 6a           mov.l   @r15+,r10
      80003cce:       f6 69           mov.l   @r15+,r9
      80003cd0:       0b 00           rts
      
      If we take an interrupt at the highlighted point, the DWARF info will
      bogusly claim that the return address can be found at some offset from
      the frame pointer, even though the frame pointer was just restored. The
      worst part is if the unwinder finds a text address at the bogus stack
      address - unwinding will continue, for a bit, until it finally comes
      across an unexpected address on the stack and blows up.
      
      The only solution is to stop unwinding once we've calculated the
      function that was executing when the interrupt occurred. This PC can be
      easily calculated from pt_regs->pc.
      Signed-off-by: NMatt Fleming <matt@console-pimps.org>
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      944a3438
    • M
      sh: Setup frame pointer in handle_exception path · 1dca56f1
      Matt Fleming 提交于
      In order to allow the DWARF unwinder to unwind through exceptions we
      need to setup the frame pointer register (r14).
      Signed-off-by: NMatt Fleming <matt@console-pimps.org>
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      1dca56f1
    • M
      sh: Correct the offset of the return address in ret_from_exception · 14269828
      Matt Fleming 提交于
      The address that ret_from_exception and ret_from_irq will return to is
      found in the stack slot for SPC, not PR. This error was causing the
      DWARF unwinder to pick up the wrong return address on the stack and then
      unwind using the unwind tables for the wrong function.
      
      While I'm here I might as well add CFI annotations for the other
      registers since they could be useful when unwinding.
      Signed-off-by: NMatt Fleming <matt@console-pimps.org>
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      14269828
  11. 02 2月, 2010 3 次提交
  12. 30 1月, 2010 1 次提交
    • L
      Split 'flush_old_exec' into two functions · 221af7f8
      Linus Torvalds 提交于
      'flush_old_exec()' is the point of no return when doing an execve(), and
      it is pretty badly misnamed.  It doesn't just flush the old executable
      environment, it also starts up the new one.
      
      Which is very inconvenient for things like setting up the new
      personality, because we want the new personality to affect the starting
      of the new environment, but at the same time we do _not_ want the new
      personality to take effect if flushing the old one fails.
      
      As a result, the x86-64 '32-bit' personality is actually done using this
      insane "I'm going to change the ABI, but I haven't done it yet" bit
      (TIF_ABI_PENDING), with SET_PERSONALITY() not actually setting the
      personality, but just the "pending" bit, so that "flush_thread()" can do
      the actual personality magic.
      
      This patch in no way changes any of that insanity, but it does split the
      'flush_old_exec()' function up into a preparatory part that can fail
      (still called flush_old_exec()), and a new part that will actually set
      up the new exec environment (setup_new_exec()).  All callers are changed
      to trivially comply with the new world order.
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      Cc: stable@kernel.org
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      221af7f8
  13. 28 1月, 2010 1 次提交
    • A
      perf: Fix inconsistency between IP and callchain sampling · 339ce1a4
      Anton Blanchard 提交于
      When running perf across all cpus with backtracing (-a -g), sometimes we
      get samples without associated backtraces:
      
          23.44%         init  [kernel]                     [k] restore
          11.46%         init                       eeba0c  [k] 0x00000000eeba0c
           6.77%      swapper  [kernel]                     [k] .perf_ctx_adjust_freq
           5.73%         init  [kernel]                     [k] .__trace_hcall_entry
           4.69%         perf  libc-2.9.so                  [.] 0x0000000006bb8c
                             |
                             |--11.11%-- 0xfffa941bbbc
      
      It turns out the backtrace code has a check for the idle task and the IP
      sampling does not. This creates problems when profiling an interrupt
      heavy workload (in my case 10Gbit ethernet) since we get no backtraces
      for interrupts received while idle (ie most of the workload).
      
      Right now x86 and sh check that current is not NULL, which should never
      happen so remove that too.
      
      Idle task's exclusion must be performed from the core code, on top
      of perf_event_attr:exclude_idle.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mundt <lethal@linux-sh.org>
      LKML-Reference: <20100118054707.GT12666@kryten>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      339ce1a4
  14. 27 1月, 2010 2 次提交
  15. 26 1月, 2010 1 次提交
    • P
      sh: Mass ctrl_in/outX to __raw_read/writeX conversion. · 9d56dd3b
      Paul Mundt 提交于
      The old ctrl in/out routines are non-portable and unsuitable for
      cross-platform use. While drivers/sh has already been sanitized, there
      is still quite a lot of code that is not. This converts the arch/sh/ bits
      over, which permits us to flag the routines as deprecated whilst still
      building with -Werror for the architecture code, and to ensure that
      future users are not added.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      9d56dd3b
  16. 21 1月, 2010 3 次提交
    • P
      sh: Kill off the special uncached section and fixmap. · 2dc2f8e0
      Paul Mundt 提交于
      Now that cached_to_uncached works as advertized in 32-bit mode and we're
      never going to be able to map < 16MB anyways, there's no need for the
      special uncached section. Kill it off.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      2dc2f8e0
    • P
      sh: Track the uncached mapping size. · 3125ee72
      Paul Mundt 提交于
      This provides a variable for tracking the uncached mapping size, and uses
      it for pretty printing the uncached lowmem range. Beyond this, we'll also
      be building on top of this for figuring out from where the remainder of
      P2 becomes usable when constructing unrelated mappings.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      3125ee72
    • P
      sh: Rework P2 to only include kernel text. · 2023b843
      Paul Mundt 提交于
      This effectively neutralizes P2 by getting rid of P1 identity mapping
      for all available memory and instead only establishes a single unbuffered
      PMB entry (16MB -- the smallest available) that covers the kernel.
      
      As using segmentation for abusing caching attributes in drivers is no
      longer supported (and there are no drivers that can be enabled in 32-bit
      mode that do this), this provides us with all of the uncached access
      needs by the kernel itself.
      
      Drivers and their ilk need to specify their caching attributes when
      remapping through page tables, as usual.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      2023b843