OSDN Git Service

kvm: arm64: Partially link nVHE hyp code, simplify HYPCOPY
authorDavid Brazdil <dbrazdil@google.com>
Tue, 22 Sep 2020 20:49:01 +0000 (21:49 +0100)
committerMarc Zyngier <maz@kernel.org>
Wed, 30 Sep 2020 07:33:52 +0000 (08:33 +0100)
commitab25464bdabd45f283cc1194e332040f89071106
tree8ba29ffb6644c5046dca35c69f7de883bdd1f8d9
parentf4d51dffc6c01a9e94650d95ce0104964f8ae822
kvm: arm64: Partially link nVHE hyp code, simplify HYPCOPY

Relying on objcopy to prefix the ELF section names of the nVHE hyp code
is brittle and prevents us from using wildcards to match specific
section names.

Improve the build rules by partially linking all '.nvhe.o' files and
prefixing their ELF section names using a linker script. Continue using
objcopy for prefixing ELF symbol names.

One immediate advantage of this approach is that all subsections
matching a pattern can be merged into a single prefixed section, eg.
.text and .text.* can be linked into a single '.hyp.text'. This removes
the need for -fno-reorder-functions on GCC and will be useful in the
future too: LTO builds use .text subsections, compilers routinely
generate .rodata subsections, etc.

Partially linking all hyp code into a single object file also makes it
easier to analyze.

Signed-off-by: David Brazdil <dbrazdil@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Acked-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20200922204910.7265-2-dbrazdil@google.com
arch/arm64/include/asm/hyp_image.h [new file with mode: 0644]
arch/arm64/kvm/hyp/nvhe/.gitignore [new file with mode: 0644]
arch/arm64/kvm/hyp/nvhe/Makefile
arch/arm64/kvm/hyp/nvhe/hyp.lds.S [new file with mode: 0644]