10 Jul, 2007

1 commit


14 Jun, 2007

1 commit

  • Currently the powerpc kernel has a 64-bit only feature,
    COHERENT_ICACHE used for those CPUS which maintain icache/dcache
    coherency in hardware (POWER5, essentially). It also has a feature,
    SPLIT_ID_CACHE, which is used on CPUs which have separate i and
    d-caches, which is to say everything except 601 and Freescale E200.

    In nearly all the places we check the SPLIT_ID_CACHE, what we actually
    care about is whether the i and d-caches are coherent (which they will
    be, trivially, if they're the same cache).

    This tries to clarify the situation a little. The COHERENT_ICACHE
    feature becomes availble on 32-bit and is set for all CPUs where i and
    d-cache are effectively coherent, whether this is due to special logic
    (POWER5) or because they're unified. We check this, instead of
    SPLIT_ID_CACHE nearly everywhere.

    The SPLIT_ID_CACHE feature itself is replaced by a UNIFIED_ID_CACHE
    feature with reversed sense, set only on 601 and Freescale E200. In
    the two places (one Freescale BookE specific) where we really care
    whether it's a unified cache, not whether they're coherent, we check
    this feature. The CPUs with unified cache are so few, we could
    consider replacing this feature bit with explicit checks against the
    PVR.

    This will make unifying the 32-bit and 64-bit cache flush code a
    little more straightforward.

    Signed-off-by: David Gibson
    Signed-off-by: Paul Mackerras

    David Gibson
     

17 May, 2007

1 commit


24 Apr, 2007

2 commits


07 Feb, 2007

2 commits

  • Add cputable entries for which type of PMC implementation the processor
    has.

    I've only filled in the current 64-bit processors, the unfilled default
    value will have same behaviour as before so it can be done over time
    as needed.

    Also tidy up the dummy_perf implementation a bit, aggregating it into
    one function with ifdefs instead of several.

    Signed-off-by: Olof Johansson
    Signed-off-by: Paul Mackerras

    Olof Johansson
     
  • CPU_FTRS_POWER6X is unused, hence remove it.

    Signed-off-by Michael Neuling

    Signed-off-by: Paul Mackerras

    Michael Neuling
     

11 Dec, 2006

1 commit


09 Dec, 2006

1 commit

  • POWER6 adds a new SPR, the data stream control register (DSCR). It can
    be used to adjust how agressive the prefetch mechanisms are.

    Its possible we may want to context switch this, but for now just export
    it to userspace via sysfs so we can adjust it.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Paul Mackerras

    Anton Blanchard
     

08 Dec, 2006

1 commit

  • The e300c2 has no FPU. Its MSR[FP] is grounded to zero. If an attempt
    is made to execute a floating point instruction (including floating-point
    load, store, or move instructions), the e300c2 takes a floating-point
    unavailable interrupt.

    This patch adds support for FP emulation on the e300c2 by declaring a
    new CPU_FTR_FP_TAKES_FPUNAVAIL, where FP unavail interrupts are
    intercepted and redirected to the ProgramCheck exception path for
    correct emulation handling.

    (If we run out of CPU_FTR bits we could look to reclaim this bit by adding
    support to test the cpu_user_features for PPC_FEATURE_HAS_FPU instead)

    It adds a nop to the exception path for 32-bit processors with a FPU.

    Signed-off-by: Kim Phillips
    Signed-off-by: Kumar Gala

    Kim Phillips
     

04 Dec, 2006

4 commits

  • Remove CPU_FTR_16M_PAGE from the cupfeatures mask at runtime on iSeries.

    Signed-off-by: Stephen Rothwell
    Signed-off-by: Paul Mackerras

    Stephen Rothwell
     
  • It saves #ifdef'ing in callers if we at least define the 64-bit cpu
    features for 32-bit also.

    Signed-off-by: Michael Ellerman
    Signed-off-by: Arnd Bergmann

    Michael Ellerman
     
  • This adds code to look at the properties firmware puts in the device
    tree to determine what compatibility mode the partition is in on
    POWER6 machines, and set the ELF aux vector AT_HWCAP and AT_PLATFORM
    entries appropriately.

    Specifically, we look at the cpu-version property in the cpu node(s).
    If that contains a "logical" PVR value (of the form 0x0f00000x), we
    call identify_cpu again with this PVR value. A value of 0x0f000001
    indicates the partition is in POWER5+ compatibility mode, and a value
    of 0x0f000002 indicates "POWER6 architected" mode, with various
    extensions disabled. We also look for various other properties:
    ibm,dfp, ibm,purr and ibm,spurr.

    Signed-off-by: Paul Mackerras

    Paul Mackerras
     
  • Add PPU event-based and cycle-based profiling support to Oprofile for Cell.

    Oprofile is expected to collect data on all CPUs simultaneously.
    However, there is one set of performance counters per node. There are
    two hardware threads or virtual CPUs on each node. Hence, OProfile must
    multiplex in time the performance counter collection on the two virtual
    CPUs.

    The multiplexing of the performance counters is done by a virtual
    counter routine. Initially, the counters are configured to collect data
    on the even CPUs in the system, one CPU per node. In order to capture
    the PC for the virtual CPU when the performance counter interrupt occurs
    (the specified number of events between samples has occurred), the even
    processors are configured to handle the performance counter interrupts
    for their node. The virtual counter routine is called via a kernel
    timer after the virtual sample time. The routine stops the counters,
    saves the current counts, loads the last counts for the other virtual
    CPU on the node, sets interrupts to be handled by the other virtual CPU
    and restarts the counters, the virtual timer routine is scheduled to run
    again. The virtual sample time is kept relatively small to make sure
    sampling occurs on both CPUs on the node with a relatively small
    granularity. Whenever the counters overflow, the performance counter
    interrupt is called to collect the PC for the CPU where data is being
    collected.

    The oprofile driver relies on a firmware RTAS call to setup the debug bus
    to route the desired signals to the performance counter hardware to be
    counted. The RTAS call must set the routing registers appropriately in
    each of the islands to pass the signals down the debug bus as well as
    routing the signals from a particular island onto the bus. There is a
    second firmware RTAS call to reset the debug bus to the non pass thru
    state when the counters are not in use.

    Signed-off-by: Carl Love
    Signed-off-by: Maynard Johnson
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Paul Mackerras

    Maynard Johnson
     

25 Oct, 2006

4 commits

  • The Cell CPU timebase has an erratum. When reading the entire 64 bits
    of the timebase with one mftb instruction, there is a handful of cycles
    window during which one might read a value with the low order 32 bits
    already reset to 0x00000000 but the high order bits not yet incremeted
    by one. This fixes it by reading the timebase again until the low order
    32 bits is no longer 0. That might introduce occasional latencies if
    hitting mftb just at the wrong time, but no more than 70ns on a cell
    blade, and that was considered acceptable.

    Signed-off-by: Benjamin Herrenschmidt
    Acked-by: Olof Johansson
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     
  • This patch reworks the feature fixup mecanism so vdso's can be fixed up.
    The main issue was that the construct:

    .long label (or .llong on 64 bits)

    will not work in the case of a shared library like the vdso. It will
    generate an empty placeholder in the fixup table along with a reloc,
    which is not something we can deal with in the vdso.

    The idea here (thanks Alan Modra !) is to instead use something like:

    1:
    .long label - 1b

    That is, the feature fixup tables no longer contain addresses of bits of
    code to patch, but offsets of such code from the fixup table entry
    itself. That is properly resolved by ld when building the .so's. I've
    modified the fixup mecanism generically to use that method for the rest
    of the kernel as well.

    Another trick is that the 32 bits vDSO included in the 64 bits kernel
    need to have a table in the 64 bits format. However, gas does not
    support 32 bits code with a statement of the form:

    .llong label - 1b (Or even just .llong label)

    That is, it cannot emit the right fixup/relocation for the linker to use
    to assign a 32 bits address to an .llong field. Thus, in the specific
    case of the 32 bits vdso built as part of the 64 bits kernel, we are
    using a modified macro that generates:

    .long 0xffffffff
    .llong label - 1b

    Note that is assumes that the value is negative which is enforced by
    the .lds (those offsets are always negative as the .text is always
    before the fixup table and gas doesn't support emiting the reloc the
    other way around).

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     
  • This patch adds some macros that can be used with an explicit label in
    order to nest cpu features. This should be used very careful but is
    necessary for the upcoming cell TB fixup.

    Signed-off-by: Benjamin Herrenschmidt
    Acked-by: Olof Johansson
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     
  • There are currently two versions of the functions for applying the
    feature fixups, one for CPU features and one for firmware features. In
    addition, they are both in assembly and with separate implementations
    for 32 and 64 bits. identify_cpu() is also implemented in assembly and
    separately for 32 and 64 bits.

    This patch replaces them with a pair of C functions. The call sites are
    slightly moved on ppc64 as well to be called from C instead of from
    assembly, though it's a very small change, and thus shouldn't cause any
    problem.

    Signed-off-by: Benjamin Herrenschmidt
    Acked-by: Olof Johansson
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     

13 Sep, 2006

2 commits

  • Introduce PWRficient PA6T cputable entries and feature bits.

    Signed-off-by: Olof Johansson
    Signed-off-by: Paul Mackerras

    Olof Johansson
     
  • The performance monitor implementation (including CTRL register behaviour)
    is just included in PPC v2 as an example, it's not truly part of the base.

    It's actually a somewhat misleading feature, but I'll leave that be for
    now: The presence of the register is not what the feature bit is used
    for, but instead it's used to determine if it contains the runlatch
    bit for idle reporting of the performance monitor. For alternative
    implementations, the register might still exist but the bit might have
    different meaning (or no meaning at all).

    For now, split it off and don't include it in CPU_FTR_PPCAS_ARCH_V2_BASE.

    Signed-off-by: Olof Johansson
    Signed-off-by: Paul Mackerras

    Olof Johansson
     

25 Aug, 2006

1 commit

  • Cleanup CPU inits a bit more, Geoff Levand already did some earlier.

    * Move CPU state save to cpu_setup, since cpu_setup is only ever done
    on cpu 0 on 64-bit and save is never done more than once.
    * Rename __restore_cpu_setup to __restore_cpu_ppc970 and add
    function pointers to the cputable to use instead. Powermac always
    has 970 so no need to check there.
    * Rename __970_cpu_preinit to __cpu_preinit_ppc970 and check PVR before
    calling it instead of in it, it's too early to use cputable.
    * Rename pSeries_secondary_smp_init to generic_secondary_smp_init since
    everyone but powermac and iSeries use it.

    Signed-off-by: Olof Johansson
    Signed-off-by: Paul Mackerras

    Olof Johansson
     

28 Jun, 2006

1 commit


23 Jun, 2006

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (139 commits)
    [POWERPC] re-enable OProfile for iSeries, using timer interrupt
    [POWERPC] support ibm,extended-*-frequency properties
    [POWERPC] Extra sanity check in EEH code
    [POWERPC] Dont look for class-code in pci children
    [POWERPC] Fix mdelay badness on shared processor partitions
    [POWERPC] disable floating point exceptions for init
    [POWERPC] Unify ppc syscall tables
    [POWERPC] mpic: add support for serial mode interrupts
    [POWERPC] pseries: Print PCI slot location code on failure
    [POWERPC] spufs: one more fix for 64k pages
    [POWERPC] spufs: fail spu_create with invalid flags
    [POWERPC] spufs: clear class2 interrupt status before wakeup
    [POWERPC] spufs: fix Makefile for "make clean"
    [POWERPC] spufs: remove stop_code from struct spu
    [POWERPC] spufs: fix spu irq affinity setting
    [POWERPC] spufs: further abstract priv1 register access
    [POWERPC] spufs: split the Cell BE support into generic and platform dependant parts
    [POWERPC] spufs: dont try to access SPE channel 1 count
    [POWERPC] spufs: use kzalloc in create_spu
    [POWERPC] spufs: fix initial state of wbox file
    ...

    Manually resolved conflicts in:
    drivers/net/phy/Makefile
    include/asm-powerpc/spu.h

    Linus Torvalds
     

18 Jun, 2006

1 commit


15 Jun, 2006

1 commit


09 Jun, 2006

2 commits

  • This adds the PowerPC part of the code to allow processes to change
    their endian mode via prctl.

    This also extends the alignment exception handler to be able to fix up
    alignment exceptions that occur in little-endian mode, both for
    "PowerPC" little-endian and true little-endian.

    We always enter signal handlers in big-endian mode -- the support for
    little-endian mode does not amount to the creation of a little-endian
    user/kernel ABI. If the signal handler returns, the endian mode is
    restored to what it was when the signal was delivered.

    We have two new kernel CPU feature bits, one for PPC little-endian and
    one for true little-endian. Most of the classic 32-bit processors
    support PPC little-endian, and this is reflected in the CPU feature
    table. There are two corresponding feature bits reported to userland
    in the AT_HWCAP aux vector entry.

    This is based on an earlier patch by Anton Blanchard.

    Signed-off-by: Paul Mackerras

    Paul Mackerras
     
  • POWER6 moves some of the MMCRA bits and also requires some bits to be
    cleared each PMU interrupt.

    Signed-off-by: Michael Neuling
    Acked-by: Anton Blanchard
    Signed-off-by: Paul Mackerras

    Michael Neuling
     

29 Apr, 2006

1 commit


27 Mar, 2006

1 commit

  • Christoph noticed that sparse warned about all the enum tags in cuptable.h
    that had values that required them to be type log. (enum tags are ints
    according to the standard.)

    This patch attempts to fix them in the least intrusive way possible by
    turning them all into #defines except for the 32 bit CPU_FTRS_POSSIBLE and
    CPU_FTRS_ALWAYS which are hard to construct that way. This works because
    these last two contain no bits above 2^31.

    Signed-off-by: Stephen Rothwell
    Signed-off-by: Paul Mackerras

    Stephen Rothwell
     

22 Mar, 2006

1 commit


09 Mar, 2006

1 commit


03 Mar, 2006

1 commit


24 Feb, 2006

2 commits

  • This implements accurate task and cpu time accounting for 64-bit
    powerpc kernels. Instead of accounting a whole jiffy of time to a
    task on a timer interrupt because that task happened to be running at
    the time, we now account time in units of timebase ticks according to
    the actual time spent by the task in user mode and kernel mode. We
    also count the time spent processing hardware and software interrupts
    accurately. This is conditional on CONFIG_VIRT_CPU_ACCOUNTING. If
    that is not set, we do tick-based approximate accounting as before.

    To get this accurate information, we read either the PURR (processor
    utilization of resources register) on POWER5 machines, or the timebase
    on other machines on

    * each entry to the kernel from usermode
    * each exit to usermode
    * transitions between process context, hard irq context and soft irq
    context in kernel mode
    * context switches.

    On POWER5 systems with shared-processor logical partitioning we also
    read both the PURR and the timebase at each timer interrupt and
    context switch in order to determine how much time has been taken by
    the hypervisor to run other partitions ("steal" time). Unfortunately,
    since we need values of the PURR on both threads at the same time to
    accurately calculate the steal time, and since we can only calculate
    steal time on a per-core basis, the apportioning of the steal time
    between idle time (time which we ceded to the hypervisor in the idle
    loop) and actual stolen time is somewhat approximate at the moment.

    This is all based quite heavily on what s390 does, and it uses the
    generic interfaces that were added by the s390 developers,
    i.e. account_system_time(), account_user_time(), etc.

    This patch doesn't add any new interfaces between the kernel and
    userspace, and doesn't change the units in which time is reported to
    userspace by things such as /proc/stat, /proc//stat, getrusage(),
    times(), etc. Internally the various task and cpu times are stored in
    timebase units, but they are converted to USER_HZ units (1/100th of a
    second) when reported to userspace. Some precision is therefore lost
    but there should not be any accumulating error, since the internal
    accumulation is at full precision.

    Signed-off-by: Paul Mackerras

    Paul Mackerras
     
  • On the 83xx platform to ensure the PCI inbound memory is handled properly we
    have to turn on coherency for all pages in the MMU. Otherwise we see
    corruption if inbound "prefetching/streaming" is enabled on the PCI controller.

    Signed-off-by: Randy Vinson
    Signed-off-by: Kumar Gala
    Signed-off-by: Paul Mackerras

    Kumar Gala
     

14 Jan, 2006

2 commits

  • In 2.6.15-git6 a change was commited in the oprofile support in
    the powerpc architecture. It introduced the powerpc_oprofile_type
    which contains the define G4. This causes a name clash with the
    existing wacom usb tablet driver.

    CC [M] drivers/usb/input/wacom.o
    drivers/usb/input/wacom.c:98: error: conflicting types for `G4'
    include/asm/cputable.h:37: error: previous declaration of `G4'
    CC [M] drivers/usb/mon/mon_text.o
    make[3]: *** [drivers/usb/input/wacom.o] Error 1
    make[2]: *** [drivers/usb/input] Error 2

    The elements of an enum declared in global scope are effectivly
    global identifiers themselves. As such we need to ensure the names
    are unique. This patch updates the later oprofile support to use
    unique names.

    Signed-off-by: Andy Whitcroft
    Signed-off-by: Paul Mackerras

    Andy Whitcroft
     
  • The glibc folks want to use AT_PLATFORM to select between possible
    alternative versions of shared libraries. This commit makes the kernel
    supply an AT_PLATFORM string that indicates what class of processor
    we are running on. Processors with the same set of user-level
    instructions and roughly the same instruction scheduling characteristics
    are given the same AT_PLATFORM value; for example, 821, 823 and 860
    are all reported as "ppc823", and 7447, 7447A, 7448, 7450, 7451, 7455
    are all called "ppc7450".

    The intention is that the AT_PLATFORM values match the values that
    gcc accepts for the -mcpu= option. For values which are numeric
    (e.g. -mcpu=750), "ppc" has been prepended.

    This also adds a PPC_FEATURE_BOOKE bit to the AT_HWCAP value and sets
    it for the 440 family and the Freescale 85xx family.

    Signed-off-by: Paul Mackerras

    Paul Mackerras
     

09 Jan, 2006

4 commits

  • My recent changes to oprofile broke it when built as a module. Fix it by
    using an enum instead of a function pointer. This way we still retain
    the oprofile configuration in the cputable.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Paul Mackerras

    Anton Blanchard
     
  • This patch enables support for pause(0) power management state
    for the Cell Broadband Processor, which is import for power efficient
    operation. The pervasive infrastructure will in the future enable
    us to introduce more functionality specific to the Cell's
    pervasive unit.

    From: Maximino Aguilar
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Paul Mackerras

    Arnd Bergmann
     
  • include/asm-ppc/ had #ifdef __KERNEL__ in all header files that
    are not meant for use by user space, include/asm-powerpc does
    not have this yet.

    This patch gets us a lot closer there. There are a few cases
    where I was not sure, so I left them out. I have verified
    that no CONFIG_* symbols are used outside of __KERNEL__
    any more and that there are no obvious compile errors when
    including any of the headers in user space libraries.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Paul Mackerras

    Arnd Bergmann
     
  • Milton and I were looking at the cputable code and it looks like we can
    set spurious bits on 64bit.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Paul Mackerras

    Anton Blanchard