OSDN Git Service

arm64: vmlinux.ld: Add mmuoff data sections and move mmuoff text into idmap
authorJames Morse <james.morse@arm.com>
Thu, 19 Jul 2018 05:19:13 +0000 (10:49 +0530)
committerGerrit - the friendly Code Review server <code-review@localhost>
Tue, 7 Aug 2018 22:54:46 +0000 (15:54 -0700)
commit8357b00fc7ddb84306a711547ea7f6cf91f8ef58
tree1ec133326496f6e9c2757235f55f918714127c41
parent12ba466b44d63f1c8ed75435ca725c2b2575761e
arm64: vmlinux.ld: Add mmuoff data sections and move mmuoff text into idmap

Resume from hibernate needs to clean any text executed by the kernel with
the MMU off to the PoC. Collect these functions together into the
.idmap.text section as all this code is tightly coupled and also needs
the same cleaning after resume.

Data is more complicated, secondary_holding_pen_release is written with
the MMU on, clean and invalidated, then read with the MMU off. In contrast
__boot_cpu_mode is written with the MMU off, the corresponding cache line
is invalidated, so when we read it with the MMU on we don't get stale data.
These cache maintenance operations conflict with each other if the values
are within a Cache Writeback Granule (CWG) of each other.
Collect the data into two sections .mmuoff.data.read and .mmuoff.data.write,
the linker script ensures mmuoff.data.write section is aligned to the
architectural maximum CWG of 2KB.

Change-Id: I3f5add863896e0acaa54dd11929fc1d553d402f4
Signed-off-by: James Morse <james.morse@arm.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Git-Commit: b61130381120398876b86282082ad9f24976dfcf
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Arun KS <arunks@codeaurora.org>
arch/arm64/include/asm/sections.h
arch/arm64/kernel/head.S
arch/arm64/kernel/sleep.S
arch/arm64/kernel/smp_spin_table.c
arch/arm64/kernel/vmlinux.lds.S
arch/arm64/mm/proc.S