10 May, 2007

1 commit

  • This adds the necessary support to hpte_decode() to handle 1TB
    segments and 16GB pages, and removes an uninitialized value
    warning on avpn.

    We don't have any code to generate HPTEs for 1TB segments or 16GB
    pages yet, so this is mostly for completeness, and to fix the
    warning.

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

    Paul Mackerras
     

09 May, 2007

1 commit

  • The basic issue is to be able to do what hugetlbfs does but with
    different page sizes for some other special filesystems; more
    specifically, my need is:

    - Huge pages

    - SPE local store mappings using 64K pages on a 4K base page size
    kernel on Cell

    - Some special 4K segments in 64K-page kernels for mapping a dodgy
    type of powerpc-specific infiniband hardware that requires 4K MMU
    mappings for various reasons I won't explain here.

    The main issues are:

    - To maintain/keep track of the page size per "segment" (as we can
    only have one page size per segment on powerpc, which are 256MB
    divisions of the address space).

    - To make sure special mappings stay within their allotted
    "segments" (including MAP_FIXED crap)

    - To make sure everybody else doesn't mmap/brk/grow_stack into a
    "segment" that is used for a special mapping

    Some of the necessary mechanisms to handle that were present in the
    hugetlbfs code, but mostly in ways not suitable for anything else.

    The patch relies on some changes to the generic get_unmapped_area()
    that just got merged. It still hijacks hugetlb callbacks here or
    there as the generic code hasn't been entirely cleaned up yet but
    that shouldn't be a problem.

    So what is a slice ? Well, I re-used the mechanism used formerly by our
    hugetlbfs implementation which divides the address space in
    "meta-segments" which I called "slices". The division is done using
    256MB slices below 4G, and 1T slices above. Thus the address space is
    divided currently into 16 "low" slices and 16 "high" slices. (Special
    case: high slice 0 is the area between 4G and 1T).

    Doing so simplifies significantly the tracking of segments and avoids
    having to keep track of all the 256MB segments in the address space.

    While I used the "concepts" of hugetlbfs, I mostly re-implemented
    everything in a more generic way and "ported" hugetlbfs to it.

    Slices can have an associated page size, which is encoded in the mmu
    context and used by the SLB miss handler to set the segment sizes. The
    hash code currently doesn't care, it has a specific check for hugepages,
    though I might add a mechanism to provide per-slice hash mapping
    functions in the future.

    The slice code provide a pair of "generic" get_unmapped_area() (bottomup
    and topdown) functions that should work with any slice size. There is
    some trickiness here so I would appreciate people to have a look at the
    implementation of these and let me know if I got something wrong.

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

    Benjamin Herrenschmidt
     

27 Apr, 2007

1 commit

  • Currently asm-powerpc/mmu.h has definitions for the 64-bit hash based
    MMU. If CONFIG_PPC64 is not set, it instead includes asm-ppc/mmu.h
    which contains a particularly horrible mess of #ifdefs giving the
    definitions for all the various 32-bit MMUs.

    It would be nice to have the low level definitions for each MMU type
    neatly in their own separate files. It would also be good to wean
    arch/powerpc off dependence on the old asm-ppc/mmu.h.

    This patch makes a start on such a cleanup by moving the definitions
    for the 64-bit hash MMU to their own file, asm-powerpc/mmu_hash64.h.
    Definitions for the other MMUs still all come from asm-ppc/mmu.h,
    however each MMU type can now be one-by-one moved over to their own
    file, in the process cleaning them up stripping them of cruft no
    longer necessary in arch/powerpc.

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

    David Gibson