1. 14 Jun, 2007 22 commits
    • Benjamin Herrenschmidt's avatar
      [POWERPC] powerpc: ptrace can set DABR on both 32 and 64 bits · 6d110da8
      Benjamin Herrenschmidt authored
      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: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      6d110da8
    • Benjamin Herrenschmidt's avatar
      [POWERPC] ptrace shouldn't touch FP exec mode · abd06505
      Benjamin Herrenschmidt authored
      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: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      abd06505
    • Benjamin Herrenschmidt's avatar
      [POWERPC] Allow ptrace write to pt_regs trap and orig_r3 · 912000e7
      Benjamin Herrenschmidt authored
      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: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      912000e7
    • Benjamin Herrenschmidt's avatar
      [POWERPC] Remove some useless ifdef's in ptrace · 1b6610d6
      Benjamin Herrenschmidt authored
      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: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      1b6610d6
    • Benjamin Herrenschmidt's avatar
      [POWERPC] Uninline common ptrace bits · 865418d8
      Benjamin Herrenschmidt authored
      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: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      865418d8
    • Benjamin Herrenschmidt's avatar
      [POWERPC] ptrace updates & new, better requests · e17666ba
      Benjamin Herrenschmidt authored
      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: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      e17666ba
    • Benjamin Herrenschmidt's avatar
      [POWERPC] ptrace cleanups · acd89828
      Benjamin Herrenschmidt authored
      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: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      acd89828
    • Benjamin Herrenschmidt's avatar
      [POWERPC] Disable broken PPC_PTRACE_GETFPREGS on 32 bits · 0b3d5c48
      Benjamin Herrenschmidt authored
      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: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      0b3d5c48
    • Benjamin Herrenschmidt's avatar
      [POWERPC] spufs: Add a "capabilities" file to spu contexts · cbe709c1
      Benjamin Herrenschmidt authored
      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: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: default avatarJeremy Kerr <jk@ozlabs.org>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      cbe709c1
    • Benjamin Herrenschmidt's avatar
      [POWERPC] spufs: Add support for SPU single stepping · 05169237
      Benjamin Herrenschmidt authored
      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: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: default avatarJeremy Kerr <jk@ozlabs.org>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      05169237
    • Benjamin Herrenschmidt's avatar
      [POWERPC] Rewrite IO allocation & mapping on powerpc64 · 3d5134ee
      Benjamin Herrenschmidt authored
      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: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      3d5134ee
    • Benjamin Herrenschmidt's avatar
      [POWERPC] unmap_vm_area becomes unmap_kernel_range for the public · c19c03fc
      Benjamin Herrenschmidt authored
      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: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      c19c03fc
    • Linas Vepstas's avatar
      [POWERPC] Tweak EEH copyright info · 3c8c90ab
      Linas Vepstas authored
      Twiddle the copyright notices. Per current guidelines, the use
      of the (C) or (c) in source code is deprecated.
      Signed-off-by: default avatarLinas 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: default avatarPaul Mackerras <paulus@samba.org>
      3c8c90ab
    • Linas Vepstas's avatar
      [POWERPC] Remove dead EEH code · 42253a68
      Linas Vepstas authored
      Remove some dead code.
      Signed-off-by: default avatarLinas Vepstas <linas@austin.ibm.com>
      
      ----
       arch/powerpc/platforms/pseries/eeh.c |    4 +---
       1 file changed, 1 insertion(+), 3 deletions(-)
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      42253a68
    • Linas Vepstas's avatar
      [POWERPC] Show EEH per-device false positives · 858955bd
      Linas Vepstas authored
      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: default avatarLinas 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: default avatarPaul Mackerras <paulus@samba.org>
      858955bd
    • Linas Vepstas's avatar
      [POWERPC] Add EEH sysfs blinkenlights · e1d04c97
      Linas Vepstas authored
      Add sysfs blinkenlights for EEH statistics.  Shuffle the
      eeh_add_device_tree() call so that it appears in the correct
      sequence.
      Signed-off-by: default avatarLinas 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: default avatarPaul Mackerras <paulus@samba.org>
      e1d04c97
    • Linas Vepstas's avatar
      [POWERPC] pseries: asm/pci-bridge.h CONFIG_ minor cleanup · c2e221e8
      Linas Vepstas authored
      Use the correct CONFIG_ option to mark off the EEH bits.
      Move the EEH bits to the bottom of the struct.
      The config_space array is used by EEH only; it does not
      need to be part of the struct for non-pseries machines.
      Signed-off-by: default avatarLinas Vepstas <linas@austin.ibm.com>
      
      ----
      Revised patch, per commments from Michael Ellerman.
      
       include/asm-powerpc/pci-bridge.h |   16 +++++++++-------
       1 file changed, 9 insertions(+), 7 deletions(-)
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      c2e221e8
    • Jon Tollefson's avatar
      [POWERPC] Move common code out of if/else · 3f1df7a2
      Jon Tollefson authored
      Move common code out of if/else.
      Signed-off-by: default avatarJon Tollefson <kniht@linux.vnet.ibm.com>
      ----
      
      hash_native_64.c |    3 +--
       1 files changed, 1 insertion(+), 2 deletions(-)
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      3f1df7a2
    • Segher Boessenkool's avatar
      [POWERPC] Fix VDSO compile warning · 31fe5bf6
      Segher Boessenkool authored
      Maybe the type should have been char[] instead of __u8[]
      in the first place, but this will do.
      Signed-off-by: default avatarSegher Boessenkool <segher@kernel.crashing.org>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      31fe5bf6
    • Anton Blanchard's avatar
      [POWERPC] Reserve threadinfo flags for perfmon2 · f341973d
      Anton Blanchard authored
      Reserve two TIF flags for perfmon2 and shift them into the low 16 bits
      so we can use single assembly instructions to create constants based off
      them.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      f341973d
    • Milton Miller's avatar
      [POWERPC] Fix console output getting dropped on platforms without udbg_putc · 220ddc08
      Milton Miller authored
      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: default avatarMilton Miller <miltonm@bga.com>
      Acked-by: default avatarMark A. Greer <mgreer@mvista.com>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      220ddc08
    • Paul Mackerras's avatar
      [POWERPC] Fix per-cpu allocation on oldworld SMP powermacs · c63c4faa
      Paul Mackerras authored
      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: default avatarPaul Mackerras <paulus@samba.org>
      c63c4faa
  2. 13 Jun, 2007 8 commits
  3. 12 Jun, 2007 10 commits