android_kernel_xiaomi_sdm845/arch/powerpc/mm
Paul Mackerras 549e8152de powerpc: Make the 64-bit kernel as a position-independent executable
This implements CONFIG_RELOCATABLE for 64-bit by making the kernel as
a position-independent executable (PIE) when it is set.  This involves
processing the dynamic relocations in the image in the early stages of
booting, even if the kernel is being run at the address it is linked at,
since the linker does not necessarily fill in words in the image for
which there are dynamic relocations.  (In fact the linker does fill in
such words for 64-bit executables, though not for 32-bit executables,
so in principle we could avoid calling relocate() entirely when we're
running a 64-bit kernel at the linked address.)

The dynamic relocations are processed by a new function relocate(addr),
where the addr parameter is the virtual address where the image will be
run.  In fact we call it twice; once before calling prom_init, and again
when starting the main kernel.  This means that reloc_offset() returns
0 in prom_init (since it has been relocated to the address it is running
at), which necessitated a few adjustments.

This also changes __va and __pa to use an equivalent definition that is
simpler.  With the relocatable kernel, PAGE_OFFSET and MEMORY_START are
constants (for 64-bit) whereas PHYSICAL_START is a variable (and
KERNELBASE ideally should be too, but isn't yet).

With this, relocatable kernels still copy themselves down to physical
address 0 and run there.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-09-15 11:08:38 -07:00
..
40x_mmu.c [POWERPC] Remove and replace uses of PPC_MEMSTART with memstart_addr 2008-04-17 07:46:12 +10:00
44x_mmu.c powerpc: rework 4xx PTE access and TLB miss 2008-07-09 13:36:17 -04:00
fault.c powerpc: BookE hardware watchpoint support 2008-07-25 15:44:39 +10:00
fsl_booke_mmu.c [POWERPC] 85xx: Add support for relocatable kernel (and booting at non-zero) 2008-04-24 20:58:01 +10:00
gup.c powerpc/mm: Lockless get_user_pages_fast() for 64-bit (v3) 2008-07-30 15:26:54 +10:00
hash_low_32.S [POWERPC] powerpc/mm/hash_low_32.S: Remove CVS keyword 2008-05-20 09:34:18 +10:00
hash_low_64.S powerpc: Free a PTE bit on ppc64 with 64K pages 2008-06-30 22:30:53 +10:00
hash_native_64.c [POWERPC] Use 1TB segments 2007-10-12 14:05:17 +10:00
hash_utils_64.c powerpc: Make the 64-bit kernel as a position-independent executable 2008-09-15 11:08:38 -07:00
hugetlbpage.c powerpc: Disable 64K hugetlb support when doing 64K SPU mappings 2008-07-28 16:30:53 +10:00
init_32.c powerpc: Fix problems with 32bit PPC's running with >= 4GB of RAM 2008-07-09 14:13:01 -04:00
init_64.c powerpc/mm: Fix attribute confusion with htab_bolt_mapping() 2008-08-11 10:09:56 +10:00
Makefile powerpc/mm: Lockless get_user_pages_fast() for 64-bit (v3) 2008-07-30 15:26:54 +10:00
mem.c powerpc: Fix compiler warning in arch/powerpc/mm/mem.c 2008-08-04 13:18:17 +10:00
mmap.c Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
mmu_context_32.c [POWERPC] Remove the dregs of APUS support from arch/powerpc 2007-06-14 22:30:15 +10:00
mmu_context_64.c [POWERPC] Tidy up CONFIG_PPC_MM_SLICES code 2007-08-17 11:01:59 +10:00
mmu_decl.h powerpc: Fix problems with 32bit PPC's running with >= 4GB of RAM 2008-07-09 14:13:01 -04:00
numa.c powerpc: Add support for dynamic reconfiguration memory in kexec/kdump kernels 2008-09-15 11:07:58 -07:00
pgtable_32.c powerpc ioremap_prot 2008-07-24 10:47:15 -07:00
pgtable_64.c powerpc ioremap_prot 2008-07-24 10:47:15 -07:00
ppc_mmu_32.c powerpc: Force printing of 'total_memory' to unsigned long long 2008-08-04 13:18:17 +10:00
slb_low.S [POWERPC] vmemmap fixes to use smaller pages 2008-05-15 20:49:25 +10:00
slb.c [POWERPC] vmemmap fixes to use smaller pages 2008-05-15 20:49:25 +10:00
slice.c Merge commit 'origin/master' 2008-07-16 11:07:59 +10:00
stab.c [POWERPC] Fix sparse warnings in arch/powerpc/mm 2008-05-14 22:31:46 +10:00
subpage-prot.c [POWERPC] Provide a way to protect 4k subpages when using 64k pages 2008-01-24 10:06:01 +11:00
tlb_32.c powerpc: tlb_32.c build fix 2007-07-21 17:49:16 -07:00
tlb_64.c powerpc: Move include files to arch/powerpc/include/asm 2008-08-04 12:02:00 +10:00