android_kernel_xiaomi_sm8350/arch/powerpc/platforms/cell
Benjamin Herrenschmidt d0f13e3c20 [POWERPC] Introduce address space "slices"
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 <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-05-09 16:35:00 +10:00
..
spufs header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
cbe_cpufreq.c [POWERPC] cell: cbe_cpufreq cleanup and crash fix 2007-04-30 11:02:05 +10:00
cbe_regs.c [POWERPC] cell: add support for proper device-tree 2007-04-23 21:44:40 +02:00
cbe_regs.h [POWERPC] cell: add cbe_node_to_cpu function 2007-04-23 21:44:38 +02:00
cbe_thermal.c [POWERPC] cbe_thermal: add throttling attributes to cpu and spu nodes 2007-04-23 21:44:39 +02:00
interrupt.c [POWERPC] Rename device_is_compatible to of_device_is_compatible 2007-05-07 20:31:14 +10:00
interrupt.h [POWERPC] cell: Add routines for managing PMU interrupts 2006-12-04 20:40:12 +11:00
io-workarounds.c [POWERPC] Rename get_property to of_get_property: arch/powerpc 2007-04-13 03:55:19 +10:00
iommu.c [POWERPC] Rename get_property to of_get_property: arch/powerpc 2007-04-13 03:55:19 +10:00
Kconfig [POWERPC] CBE thermal support on PS3 2007-04-13 03:55:15 +10:00
Makefile [POWERPC] Celleb: consolidate spu management ops 2007-02-07 14:03:21 +11:00
pervasive.c [POWERPC] cell: hard disable interrupts in power_save() 2006-12-04 20:40:21 +11:00
pervasive.h
pmu.c [POWERPC] cell: PPU Oprofile cleanup patch 2007-02-13 22:03:06 +01:00
ras.c [POWERPC] get_property cleanups 2007-04-30 11:02:05 +10:00
ras.h
setup.c [POWERPC] Rename device_is_compatible to of_device_is_compatible 2007-05-07 20:31:14 +10:00
smp.c
spider-pic.c [POWERPC] Rename device_is_compatible to of_device_is_compatible 2007-05-07 20:31:14 +10:00
spu_base.c [POWERPC] Introduce address space "slices" 2007-05-09 16:35:00 +10:00
spu_callbacks.c
spu_coredump.c [POWERPC] spufs: enable SPU coredump for kernel-builtin spufs 2007-04-23 21:18:59 +02:00
spu_manage.c [POWERPC] Rename get_property to of_get_property: arch/powerpc 2007-04-13 03:55:19 +10:00
spu_priv1_mmio.c [POWERPC] Celleb: consolidate spu management ops 2007-02-07 14:03:21 +11:00
spu_priv1_mmio.h [POWERPC] cell: abstract spu management routines 2006-12-04 20:40:39 +11:00
spu_syscalls.c