1. 14 6月, 2007 22 次提交
    • B
      [POWERPC] Make syscall restart code more common · 22e38f29
      Benjamin Herrenschmidt 提交于
      This patch moves the code in signal_32.c and signal_64.c for handling
      syscall restart into a common signal.c file and converge around a single
      implementation that is based on the 32 bits one, using trap, ccr
      and r3 rather than the special "result" field for deciding what to do.
      
      The "result" field is now pretty much deprecated. We still set it for
      the sake of whatever might rely on it in userland but we no longer use
      it's content.
      
      This, along with a previous patch that enables ptracers to write to
      "trap" and "orig_r3" should allow gdb to properly handle syscall
      restarting.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      22e38f29
    • B
      [POWERPC] Always apply DABR changes on context switches · 791cc501
      Benjamin Herrenschmidt 提交于
      This patch removes the #ifdef CONFIG_PPC64 around setting the DABR.
      
      The actual setting of the SPR inside of the set_dabr() function is dependent
      on CONFIG_PPC64 || CONFIG_6xx but you can always provide a ppc_md hook to
      override that.  We should improve support for different HW breakpoints
      facilities but this is a first step.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      791cc501
    • B
      [POWERPC] powerpc: ptrace can set DABR on both 32 and 64 bits · 6d110da8
      Benjamin Herrenschmidt 提交于
      Allow ptrace to set dabr in the thread structure for both 32 and 64 bits,
      though only 64 bits actually uses that field, it's actually defined in both.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      6d110da8
    • B
      [POWERPC] ptrace shouldn't touch FP exec mode · abd06505
      Benjamin Herrenschmidt 提交于
      One of the gratuitous difference between 32 and 64-bit ptrace is
      whether you can whack the MSR:FE0 and FE1 bits from ptrace.  This
      patch forbids it unconditionally.  In addition, the 64-bit kernels
      used to return the exception mode in the MSR on reads, but 32-bit
      kernels didn't.  This patch makes it return those bits on both.
      
      Finally, since ptrace-ppc32.h and ptrace-ppc64.h are mostly empty now, and
      since the previous patch made ptrace32.c no longer need the MSR_DEBUGCHANGE
      definition, we just remove those 2 files and move back the remaining bits
      to ptrace.c (they were short lived heh ?).
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      abd06505
    • B
      [POWERPC] Allow ptrace write to pt_regs trap and orig_r3 · 912000e7
      Benjamin Herrenschmidt 提交于
      This patch allows a ptracer to write to the "trap" and "orig_r3" words
      of the pt_regs.
      
      This, along with a subsequent patch to the signal restart code, should
      enable gdb to properly handle syscall restarting after executing a separate
      function (at least when there's no restart block).
      
      This patch also removes ptrace32.c code toying directly with the registers
      and makes it use the ptrace_get/put_reg() accessors for everything so that
      the logic for checking what is permitted is in only one place.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      912000e7
    • B
      [POWERPC] Remove some useless ifdef's in ptrace · 1b6610d6
      Benjamin Herrenschmidt 提交于
      CHECK_FULL_REGS() exist on both 32 and 64 bits, so there's no need
      to make it conditional on CONFIG_PPC32.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      1b6610d6
    • B
      [POWERPC] Uninline common ptrace bits · 865418d8
      Benjamin Herrenschmidt 提交于
      This folds back the ptrace-common.h bits back into ptrace.c and removes
      that file. The FSL SPE bits from ptrace-ppc32.h are folded back in as
      well.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      865418d8
    • B
      [POWERPC] ptrace updates & new, better requests · e17666ba
      Benjamin Herrenschmidt 提交于
      The powerpc ptrace interface is dodgy at best. We have defined our
      "own" versions of GETREGS/SETREGS/GETFPREGS/SETFPREGS that strangely
      take arguments in reverse order from other archs (in addition to having
      different request numbers) and have subtle issue, like not accessing
      all of the registers in their respective categories.
      
      This patch moves the implementation of those to a separate function
      in order to facilitate their deprecation in the future, and provides
      new ptrace requests that mirror the x86 and sparc ones and use the
      same numbers:
      
         PTRACE_GETREGS    : returns an entire pt_regs (the whole thing,
                             not only the 32 GPRs, though that doesn't
                             include the FPRs etc... There's a compat version
                             for 32 bits that returns a 32 bits compatible
                             pt_regs (44 uints)
      
         PTRACE_SETREGS    : sets an entire pt_regs (the whole thing,
                             not only the 32 GPRs, though that doesn't
                             include the FPRs etc... Some registers cannot be
                             written to and will just be dropped, this is the
                             same as with POKEUSR, that is anything above MQ
                             on 32 bits and CCR on 64 bits. There is a compat
                             version as well.
      
         PTRACE_GETFPREGS  : returns all the FP registers -including- the FPSCR
                             that is 33 doubles (regardless of 32/64 bits)
      
         PTRACE_SETFPREGS  : sets all the FP registers -including- the FPSCR
                             that is 33 doubles (regardless of 32/64 bits)
      
      And two that only exist on 64 bits kernels:
      
         PTRACE_GETREGS64  : Same as PTRACE_GETREGS, except there is no compat
                             function, a 32 bits process will obtain the full 64
                             bits registers
      
         PTRACE_SETREGS64  : Same as PTRACE_SETREGS, except there is no compat
                             function, a 32 bits process will set the full 64
                             bits registers
      
      The two later ones makes things easier to have a 32 bits debugger on a
      64 bits program (or on a 32 bits program that uses the full 64 bits of
      the GPRs, which is possible though has issues that will be fixed in a
      later patch).
      
      Finally, while at it, the patch removes a whole bunch of code duplication
      between ptrace32.c and ptrace.c, in large part by having the former call
      into the later for all requests that don't need any special "compat"
      treatment.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      e17666ba
    • B
      [POWERPC] ptrace cleanups · acd89828
      Benjamin Herrenschmidt 提交于
      The powerpc ptrace code has some weirdness, like a ptrace-common.h file that
      is actually ppc64 only and some of the 32 bits code ifdef'ed inside ptrace.c.
      
      There are also separate implementations for things like get/set_vrregs for
      32 and 64 bits which is totally unnecessary.
      
      This patch cleans that up a bit by having a ptrace-common.h which contains
      really common code (and makes a lot more code common), and ptrace-ppc32.h and
      ptrace-ppc64.h files that contain the few remaining different bits.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      acd89828
    • B
      [POWERPC] Disable broken PPC_PTRACE_GETFPREGS on 32 bits · 0b3d5c48
      Benjamin Herrenschmidt 提交于
      The handling of PPC_PTRACE_GETFPREGS is broken on 32 bits kernel,
      it will only return half of the registers. Since that call didn't
      initially exist for 32 bits kernel (added recently), rather than
      fixing it, let's just remove it.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      0b3d5c48
    • B
      [POWERPC] spufs: Add a "capabilities" file to spu contexts · cbe709c1
      Benjamin Herrenschmidt 提交于
      This adds a "capabilities" file to spu contexts consisting of a
      list of linefeed separated capability names. The current exposed
      capabilities are "sched" (the context is scheduleable) and
      "step" (the context supports single stepping).
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: NJeremy Kerr <jk@ozlabs.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      cbe709c1
    • B
      [POWERPC] spufs: Add support for SPU single stepping · 05169237
      Benjamin Herrenschmidt 提交于
      This patch adds support for SPU single stepping. The single
      step bit is set in the SPU when the current process is
      being single-stepped via ptrace. The spu then stops and
      returns with a specific flag set and the syscall exit code
      will generate the SIGTRAP.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: NJeremy Kerr <jk@ozlabs.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      05169237
    • B
      [POWERPC] Rewrite IO allocation & mapping on powerpc64 · 3d5134ee
      Benjamin Herrenschmidt 提交于
      This rewrites pretty much from scratch the handling of MMIO and PIO
      space allocations on powerpc64.  The main goals are:
      
       - Get rid of imalloc and use more common code where possible
       - Simplify the current mess so that PIO space is allocated and
         mapped in a single place for PCI bridges
       - Handle allocation constraints of PIO for all bridges including
         hot plugged ones within the 2GB space reserved for IO ports,
         so that devices on hotplugged busses will now work with drivers
         that assume IO ports fit in an int.
       - Cleanup and separate tracking of the ISA space in the reserved
         low 64K of IO space. No ISA -> Nothing mapped there.
      
      I booted a cell blade with IDE on PIO and MMIO and a dual G5 so
      far, that's it :-)
      
      With this patch, all allocations are done using the code in
      mm/vmalloc.c, though we use the low level __get_vm_area with
      explicit start/stop constraints in order to manage separate
      areas for vmalloc/vmap, ioremap, and PCI IOs.
      
      This greatly simplifies a lot of things, as you can see in the
      diffstat of that patch :-)
      
      A new pair of functions pcibios_map/unmap_io_space() now replace
      all of the previous code that used to manipulate PCI IOs space.
      The allocation is done at mapping time, which is now called from
      scan_phb's, just before the devices are probed (instead of after,
      which is by itself a bug fix). The only other caller is the PCI
      hotplug code for hot adding PCI-PCI bridges (slots).
      
      imalloc is gone, as is the "sub-allocation" thing, but I do beleive
      that hotplug should still work in the sense that the space allocation
      is always done by the PHB, but if you unmap a child bus of this PHB
      (which seems to be possible), then the code should properly tear
      down all the HPTE mappings for that area of the PHB allocated IO space.
      
      I now always reserve the first 64K of IO space for the bridge with
      the ISA bus on it. I have moved the code for tracking ISA in a separate
      file which should also make it smarter if we ever are capable of
      hot unplugging or re-plugging an ISA bridge.
      
      This should have a side effect on platforms like powermac where VGA IOs
      will no longer work. This is done on purpose though as they would have
      worked semi-randomly before. The idea at this point is to isolate drivers
      that might need to access those and fix them by providing a proper
      function to obtain an offset to the legacy IOs of a given bus.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      3d5134ee
    • B
      [POWERPC] unmap_vm_area becomes unmap_kernel_range for the public · c19c03fc
      Benjamin Herrenschmidt 提交于
      This makes unmap_vm_area static and a wrapper around a new
      exported unmap_kernel_range that takes an explicit range instead
      of a vm_area struct.
      
      This makes it more versatile for code that wants to play with kernel
      page tables outside of the standard vmalloc area.
      
      (One example is some rework of the PowerPC PCI IO space mapping
      code that depends on that patch and removes some code duplication
      and horrible abuse of forged struct vm_struct).
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      c19c03fc
    • L
      [POWERPC] Tweak EEH copyright info · 3c8c90ab
      Linas Vepstas 提交于
      Twiddle the copyright notices. Per current guidelines, the use
      of the (C) or (c) in source code is deprecated.
      Signed-off-by: NLinas Vepstas <linas@austin.ibm.com>
      
      ----
       arch/powerpc/platforms/pseries/eeh.c        |    6 +++++-
       arch/powerpc/platforms/pseries/eeh_cache.c  |    3 ++-
       arch/powerpc/platforms/pseries/eeh_driver.c |    6 +++---
       3 files changed, 10 insertions(+), 5 deletions(-)
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      3c8c90ab
    • L
      [POWERPC] Remove dead EEH code · 42253a68
      Linas Vepstas 提交于
      Remove some dead code.
      Signed-off-by: NLinas Vepstas <linas@austin.ibm.com>
      
      ----
       arch/powerpc/platforms/pseries/eeh.c |    4 +---
       1 file changed, 1 insertion(+), 3 deletions(-)
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      42253a68
    • L
      [POWERPC] Show EEH per-device false positives · 858955bd
      Linas Vepstas 提交于
      Track and report the number of times we read an all-1s value (0xff,
      0xffff or 0xffffffff) from each device which is valid data, not
      indicating EEH isolation.
      Signed-off-by: NLinas Vepstas <linas@austin.ibm.com>
      
      ----
       arch/powerpc/platforms/pseries/eeh.c       |    5 +++++
       arch/powerpc/platforms/pseries/eeh_sysfs.c |    3 +++
       include/asm-powerpc/pci-bridge.h           |    1 +
       3 files changed, 9 insertions(+)
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      858955bd
    • L
      [POWERPC] Add EEH sysfs blinkenlights · e1d04c97
      Linas Vepstas 提交于
      Add sysfs blinkenlights for EEH statistics.  Shuffle the
      eeh_add_device_tree() call so that it appears in the correct
      sequence.
      Signed-off-by: NLinas Vepstas <linas@austin.ibm.com>
      
      ----
       arch/powerpc/platforms/pseries/Makefile    |    2
       arch/powerpc/platforms/pseries/eeh.c       |    4 +
       arch/powerpc/platforms/pseries/eeh_cache.c |    2
       arch/powerpc/platforms/pseries/eeh_sysfs.c |   84 +++++++++++++++++++++++++++++
       arch/powerpc/platforms/pseries/pci_dlpar.c |    7 +-
       include/asm-powerpc/ppc-pci.h              |    3 +
       6 files changed, 98 insertions(+), 4 deletions(-)
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      e1d04c97
    • J
      [POWERPC] Move common code out of if/else · 3f1df7a2
      Jon Tollefson 提交于
      Move common code out of if/else.
      Signed-off-by: NJon Tollefson <kniht@linux.vnet.ibm.com>
      ----
      
      hash_native_64.c |    3 +--
       1 files changed, 1 insertion(+), 2 deletions(-)
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      3f1df7a2
    • S
      [POWERPC] Fix VDSO compile warning · 31fe5bf6
      Segher Boessenkool 提交于
      Maybe the type should have been char[] instead of __u8[]
      in the first place, but this will do.
      Signed-off-by: NSegher Boessenkool <segher@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      31fe5bf6
    • M
      [POWERPC] Fix console output getting dropped on platforms without udbg_putc · 220ddc08
      Milton Miller 提交于
      Previously, registering this early console would just result
      in dropping early buffered printk output until a udbg_putc
      was registered.
      
      However, commit 69331af7
      clears the CON_PRINTBUFFER flag on the main console when a
      CON_BOOT (early) console has been registered, resulting in
      the buffered messages never being displayed to the user.
      
      This fixes the problem by making sure we don't register udbg_console
      on platforms that don't implement udbg_putc.
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Acked-by: NMark A. Greer <mgreer@mvista.com>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      220ddc08
    • P
      [POWERPC] Fix per-cpu allocation on oldworld SMP powermacs · c63c4faa
      Paul Mackerras 提交于
      The per-cpu area(a) for the secondary CPU(s) isn't getting allocated
      on old SMP powermacs that don't have the secondary CPU(s) listed in
      the device tree, as per-cpu areas are now only allocated for CPUs in
      the cpu_possible_map, and we aren't setting the bits for the secondary
      CPU(s) until smp_prepare_cpus(), which is after per-cpu allocation.
      Therefore this sets the bits for CPUs 1..3 in cpu_possible_map in
      pmac_setup_arch, so they get per-cpu data allocated.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      c63c4faa
  2. 12 6月, 2007 10 次提交
  3. 09 6月, 2007 6 次提交
  4. 08 6月, 2007 2 次提交