09 Dec, 2009

19 commits

  • Writing a driver using SCLPC on the MPC5200B I detected, that the
    intspec arrays to map irqs to Linux virq cannot be const, because the
    mapping and xlate functions only take non const pointers. All those
    functions do not modify the intspec, so a const pointer could be used.

    Signed-off-by: Roman Fietze
    Signed-off-by: Benjamin Herrenschmidt

    Roman Fietze
     
  • Use symbolic constant for PRESENT and avoid branching.

    Signed-off-by: Joakim Tjernlund
    Signed-off-by: Benjamin Herrenschmidt

    Joakim Tjernlund
     
  • There is no need to do set the DIRTY bit directly in DTLB Error.
    Trap to do_page_fault() and let the generic MM code do the work.

    Signed-off-by: Joakim Tjernlund
    Signed-off-by: Benjamin Herrenschmidt

    Joakim Tjernlund
     
  • Now that 8xx can fixup dcbX instructions, start using them
    where possible like every other PowerPc arch do.

    Signed-off-by: Joakim Tjernlund
    Signed-off-by: Benjamin Herrenschmidt

    Joakim Tjernlund
     
  • 8xx has not had WRITETHRU due to lack of bits in the pte.
    After the recent rewrite of the 8xx TLB code, there are
    two bits left. Use one of them to WRITETHRU.

    Perhaps use the last SW bit to PAGE_SPECIAL or PAGE_FILE?

    Signed-off-by: Joakim Tjernlund
    Signed-off-by: Benjamin Herrenschmidt

    Joakim Tjernlund
     
  • only DTLB Miss did set this bit, DTLB Error needs too otherwise
    the setting is lost when the page becomes dirty.

    Signed-off-by: Joakim Tjernlund
    Signed-off-by: Benjamin Herrenschmidt

    Joakim Tjernlund
     
  • This is an assembler version to fixup DAR not being set
    by dcbX, icbi instructions. There are two versions, one
    uses selfmodifing code, the other uses a
    jump table but is much bigger(default).

    Signed-off-by: Joakim Tjernlund
    Signed-off-by: Benjamin Herrenschmidt

    Joakim Tjernlund
     
  • dcbz, dcbf, dcbi, dcbst and icbi do not set DAR when they
    cause a DTLB Error. Dectect this by tagging DAR with 0x00f0
    at every exception exit that modifies DAR.
    Test for DAR=0x00f0 in DataTLBError and bail
    to handle_page_fault().

    Signed-off-by: Joakim Tjernlund
    Signed-off-by: Benjamin Herrenschmidt

    Joakim Tjernlund
     
  • Update the TLB asm to make proper use of _PAGE_DIRY and _PAGE_ACCESSED.
    Get rid of _PAGE_HWWRITE too.
    Pros:
    - I/D TLB Miss never needs to write to the linux pte.
    - _PAGE_ACCESSED is only set on TLB Error fixing accounting
    - _PAGE_DIRTY is mapped to 0x100, the changed bit, and is set directly
    when a page has been made dirty.
    - Proper RO/RW mapping of user space.
    - Free up 2 SW TLB bits in the linux pte(add back _PAGE_WRITETHRU ?)
    - kernel RO/user NA support.
    Cons:
    - A few more instructions in the TLB Miss routines.

    Signed-off-by: Joakim Tjernlund
    Signed-off-by: Benjamin Herrenschmidt

    Joakim Tjernlund
     
  • 8xx sometimes need to load a invalid/non-present TLBs in
    it DTLB asm handler.

    These must be invalidated separaly as linux mm don't.

    Signed-off-by: Joakim Tjernlund
    Signed-off-by: Benjamin Herrenschmidt

    Joakim Tjernlund
     
  • Benjamin Herrenschmidt
     
  • Benjamin Herrenschmidt
     
  • Currently the cpu-allocation/deallocation process comprises of two steps:
    - Set the indicators and to update the device tree with DLPAR node
    information.

    - Online/offline the allocated/deallocated CPU.

    This is achieved by writing to the sysfs tunables "probe" during allocation
    and "release" during deallocation.

    At the sametime, the userspace can independently online/offline the CPUs of
    the system using the sysfs tunable "online".

    It is quite possible that when a userspace tool offlines a CPU
    for the purpose of deallocation and is in the process of updating the device
    tree, some other userspace tool could bring the CPU back online by writing to
    the "online" sysfs tunable thereby causing the deallocate process to fail.

    The solution to this is to serialize writes to the "probe/release" sysfs
    tunable with the writes to the "online" sysfs tunable.

    This patch employs a mutex to provide this serialization, which is a no-op on
    all architectures except PPC_PSERIES

    Signed-off-by: Gautham R Shenoy
    Acked-by: Vaidyanathan Srinivasan
    Signed-off-by: Benjamin Herrenschmidt

    Gautham R Shenoy
     
  • Currently the cpu-allocation/deallocation on pSeries is a
    two step process from the Userspace.

    - Set the indicators and update the device tree by writing to the sysfs
    tunable "probe" during allocation and "release" during deallocation.
    - Online / Offline the CPUs of the allocated/would_be_deallocated node by
    writing to the sysfs tunable "online".

    This patch adds kernel code to online/offline the CPUs soon_after/just_before
    they have been allocated/would_be_deallocated. This way, the userspace tool
    that performs DLPAR operations would only have to deal with one set of sysfs
    tunables namely "probe" and release".

    Signed-off-by: Gautham R Shenoy
    Signed-off-by: Nathan Fontenot
    Acked-by: Vaidyanathan Srinivasan
    Signed-off-by: Benjamin Herrenschmidt

    Gautham R Shenoy
     
  • Remove the CPU from the online map to prevent smp_call_function
    from sending messages to a stopped CPU.

    Signed-off-by: Valentine Barshak
    Signed-off-by: Benjamin Herrenschmidt

    Valentine Barshak
     
  • This patch adds the specific routines to probe and release (add and remove)
    cpu resource for the powerpc pseries platform and registers these handlers
    with the ppc_md callout structure.

    Signed-off-by: Nathan Fontenot
    Acked-by: Paul Mackerras
    Signed-off-by: Benjamin Herrenschmidt

    Nathan Fontenot
     
  • Version 3 of this patch is updated with documentation added to
    Documentation/ABI. There are no changes to any of the C code from v2
    of the patch.

    In order to support kernel DLPAR of CPU resources we need to provide an
    interface to add (probe) and remove (release) the resource from the system.
    This patch Creates new generic probe and release sysfs files to facilitate
    cpu probe/release. The probe/release interface provides for allowing each
    arch to supply their own routines for implementing the backend of adding
    and removing cpus to/from the system.

    This also creates the powerpc specific stubs to handle the arch callouts
    from writes to the sysfs files.

    The creation and use of these files is regulated by the
    CONFIG_ARCH_CPU_PROBE_RELEASE option so that only architectures that need the
    capability will have the files created.

    Signed-off-by: Nathan Fontenot
    Signed-off-by: Benjamin Herrenschmidt

    Nathan Fontenot
     
  • The Dynamic Logical Partitioning capabilities of the powerpc pseries platform
    allows for the addition and removal of resources (i.e. CPU's, memory, and PCI
    devices) from a partition. The removal of a resource involves
    removing the resource's node from the device tree and then returning the
    resource to firmware via the rtas set-indicator call. To add a resource, it
    is first obtained from firmware via the rtas set-indicator call and then a
    new device tree node is created using the ibm,configure-coinnector rtas call
    and added to the device tree.

    This patch provides the kernel DLPAR infrastructure in a new filed named
    dlpar.c. The functionality provided is for acquiring and releasing a resource
    from firmware and the parsing of information returned from the
    ibm,configure-connector rtas call. Additionally this exports the pSeries
    reconfiguration notifier chain so that it can be invoked when device tree
    updates are made.

    Signed-off-by: Nathan Fontenot
    Acked-by: Paul Mackerras
    Signed-off-by: Benjamin Herrenschmidt

    Nathan Fontenot
     
  • The hotplug mediabay has tendrils deep into drivers/ide code
    which makes a libata port reather difficult. In addition it's
    ugly and could be done better.

    This reworks the interface between the mediabay and the rest
    of the world so that:

    - Any macio_driver can now have a mediabay_event callback
    which will be called when that driver sits on a mediabay and
    it's been either plugged or unplugged. The device type is
    passed as an argument. We can now move all the IDE cruft
    into the IDE driver itself

    - A check_media_bay() function can be used to take a peek
    at the type of device currently in the bay if any, a cleaner
    variant of the previous function with the same name.

    - A pair of lock/unlock functions are exposed to allow the
    IDE driver to block the hotplug callbacks during the initial
    setup and probing of the bay in order to avoid nasty race
    conditions.

    - The mediabay code no longer needs to spin on the status
    register of the IDE interface when it detects an IDE device,
    this is done just fine by the IDE code itself

    Overall, less code, simpler, and allows for another driver
    than our old drivers/ide based one.

    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     

08 Dec, 2009

4 commits

  • This adds dma_parms to macio devices and initializes them with
    default values. This will allow pata_macio to setup the appropriate
    max segment size for the block layer.

    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     
  • This adds some basic devres support. When enabled via macio_enable_devres()
    resources requested by drivers will be automatically released.

    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     
  • Currently userspace has no chance to find out which virtual address space we're
    in and resolve addresses. While that is a big problem for migration, it's also
    unpleasent when debugging, as gdb and the monitor don't work on virtual
    addresses.

    This patch exports enough of the MMU segment state to userspace to make
    debugging work and thus also includes the groundwork for migration.

    Signed-off-by: Alexander Graf
    Signed-off-by: Benjamin Herrenschmidt

    Alexander Graf
     
  • Commit a0668cdc154e54bf0c85182e0535eea237d53146 cleans up the handling
    of kmem_caches for allocating various levels of pagetables.
    Unfortunately, it conflicts badly with CONFIG_PPC_SUBPAGE_PROT, due to
    the latter's cleverly hidden technique of adding some extra allocation
    space to the top level page directory to store the extra information
    it needs.

    Since that extra allocation really doesn't fit into the cleaned up
    page directory allocating scheme, this patch alters
    CONFIG_PPC_SUBPAGE_PROT to instead allocate its struct
    subpage_prot_table as part of the mm_context_t.

    Signed-off-by: David Gibson
    Signed-off-by: Benjamin Herrenschmidt

    David Gibson
     

04 Dec, 2009

2 commits


02 Dec, 2009

1 commit


27 Nov, 2009

2 commits

  • Commit a4fe3ce7699bfe1bd88f816b55d42d8fe1dac655 introduced a new
    get_user_pages() path for hugepages on powerpc. Unfortunately, there
    is a bug in it's loop logic, which can cause it to overrun the end of
    the intended region. This came about by copying the logic from the
    normal page path, which assumes the address and end parameters have
    been pagesize aligned at the top-level. Since they're not *hugepage*
    size aligned, the simplistic logic could step over the end of the gup
    region without triggering the loop end condition.

    This patch fixes the bug by using the technique that the normal page
    path uses in levels above the lowest to truncate the ending address to
    something we know we'll match with.

    Signed-off-by: David Gibson
    Signed-off-by: Benjamin Herrenschmidt

    David Gibson
     
  • Commit a0668cdc154e54bf0c85182e0535eea237d53146 cleans up the handling
    of kmem_caches for allocating various levels of pagetables.
    Unfortunately, it conflicts badly with CONFIG_PPC_SUBPAGE_PROT, due to
    the latter's cleverly hidden technique of adding some extra allocation
    space to the top level page directory to store the extra information
    it needs.

    Since that extra allocation really doesn't fit into the cleaned up
    page directory allocating scheme, this patch alters
    CONFIG_PPC_SUBPAGE_PROT to instead allocate its struct
    subpage_prot_table as part of the mm_context_t.

    Signed-off-by: David Gibson
    Signed-off-by: Benjamin Herrenschmidt

    David Gibson
     

24 Nov, 2009

12 commits

  • Benjamin Herrenschmidt
     
  • Commit 87ec0e98cfdd8b68da6a7f9e70142ffc0e404fbb in kumar's next branch
    broke one of my test configs since it looks like Anton forgot about
    that mpc832x_rdb platform which still uses the old style probing for
    the SPI stuff.

    I'll let them do a cleaner fix that probably involves changing the
    probing method and getting rid of the platform device but for now
    this will do to fix it.

    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     
  • This patch was submitted, discussed, and eventually Acked by everyone, yet
    still isn't in the tree. See:

    http://patchwork.ozlabs.org/patch/1240/

    Signed-off-by: Josh Boyer
    Cc: Arnd Bergmann
    Cc: Paul Mackerras
    Signed-off-by: Benjamin Herrenschmidt

    arnd@arndb.de
     
  • Code was added to mm/higmem.c that depends on several
    kmap types that powerpc does not support. We add dummy
    invalid definitions for KM_NMI, KM_NM_PTE, and KM_IRQ_PTE.

    According to list discussion, this fix should not be needed
    anymore starting with 2.6.33. The code is commented to this
    effect so hopefully we will remember to remove this.

    Signed-off-by: Becky Bruce
    Signed-off-by: Benjamin Herrenschmidt

    Becky Bruce
     
  • We can kill unused swiotlb variable.

    Signed-off-by: FUJITA Tomonori
    Signed-off-by: Benjamin Herrenschmidt

    FUJITA Tomonori
     
  • Since they are static inline functions.

    Signed-off-by: Stephen Rothwell
    Signed-off-by: Benjamin Herrenschmidt

    Stephen Rothwell
     
  • The code under "if (is_global_init())" is bogus, and is_global_init()
    itself is not right in mt case.

    Contrary to what the comment says, nowadays force_sig_info() does kill
    init even if the handler is SIG_DFL. Note that force_sig_info() clears
    SIGNAL_UNKILLABLE exactly for this case.

    Signed-off-by: Oleg Nesterov
    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     
  • When a CPU is offlined on POWER currently, we call rtas_stop_self() and hand
    the CPU back to the resource pool. This path is used for DLPAR which will
    cause a change in the LPAR configuration which will be visible outside.

    This patch changes the default state a CPU is put into when it is offlined.
    On platforms which support ceding the processor to the hypervisor with
    latency hint specifier value, during a cpu offline operation,
    instead of calling rtas_stop_self(), we cede the vCPU to the hypervisor
    while passing a latency hint specifier value. The Hypervisor can use this hint
    to provide better energy savings. Also, during the offline
    operation, the control of the vCPU remains with the LPAR as oppposed to
    returning it to the resource pool.

    The patch achieves this by creating an infrastructure to set the
    preferred_offline_state() which can be either
    - CPU_STATE_OFFLINE: which is the current behaviour of calling
    rtas_stop_self()

    - CPU_STATE_INACTIVE: which cedes the vCPU to the hypervisor with the latency
    hint specifier.

    The codepath which wants to perform a DLPAR operation can set the
    preferred_offline_state() of a CPU to CPU_STATE_OFFLINE before invoking
    cpu_down().

    The patch also provides a boot-time command line argument to disable/enable
    CPU_STATE_INACTIVE.

    Signed-off-by: Gautham R Shenoy
    Signed-off-by: Nathan Fontenot
    Signed-off-by: Benjamin Herrenschmidt

    Gautham R Shenoy
     
  • This patch provides an extended_cede_processor() helper function
    which takes the cede latency hint as an argument. This hint is to be passed
    on to the hypervisor to cede to the corresponding state on platforms
    which support it.

    Signed-off-by: Gautham R Shenoy
    Signed-off-by: Arun R Bharadwaj
    Signed-off-by: Benjamin Herrenschmidt

    Gautham R Shenoy
     
  • Move ehea hcall definitions into hvcall.h.

    Signed-off-by: Anton Blanchard
    Acked-by: Thomas Klein
    Signed-off-by: Benjamin Herrenschmidt

    Anton Blanchard
     
  • The typename member of struct irq_chip was kept for migration purposes
    and is obsolete since more than 2 years. Fix up the leftovers.

    Signed-off-by: Thomas Gleixner
    Cc: Benjamin Herrenschmidt
    Cc: linuxppc-dev@ozlabs.org
    Acked-by: Geoff Levand
    Signed-off-by: Benjamin Herrenschmidt

    Thomas Gleixner
     
  • SPIN_LOCK_UNLOCKED is deprecated. Init the lock array at runtime
    instead.

    Signed-off-by: Thomas Gleixner
    Cc: Benjamin Herrenschmidt
    Cc: linuxppc-dev@ozlabs.org
    Tested-by: Stephen Rothwell
    Acked-by: Benjamin Herrenschmidt
    Signed-off-by: Benjamin Herrenschmidt

    Thomas Gleixner