Currently, the hyp code cannot make full use of a bss, as the kernel section is mapped read-only. While this mapping could simply be changed to read-write, it would intermingle even more the hyp and kernel state than they currently are. Instead, introduce a __hyp_bss section, that uses reserved pages, and create the appropriate RW hyp mappings during KVM init. Acked-by: Will Deacon <will@kernel.org> Signed-off-by: Quentin Perret <qperret@google.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20210319100146.1149909-8-qperret@google.com
30 lines
678 B
ArmAsm
30 lines
678 B
ArmAsm
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Copyright (C) 2020 Google LLC.
|
|
* Written by David Brazdil <dbrazdil@google.com>
|
|
*
|
|
* Linker script used for partial linking of nVHE EL2 object files.
|
|
*/
|
|
|
|
#include <asm/hyp_image.h>
|
|
#include <asm-generic/vmlinux.lds.h>
|
|
#include <asm/cache.h>
|
|
#include <asm/memory.h>
|
|
|
|
SECTIONS {
|
|
HYP_SECTION(.idmap.text)
|
|
HYP_SECTION(.text)
|
|
HYP_SECTION(.data..ro_after_init)
|
|
HYP_SECTION(.rodata)
|
|
|
|
/*
|
|
* .hyp..data..percpu needs to be page aligned to maintain the same
|
|
* alignment for when linking into vmlinux.
|
|
*/
|
|
. = ALIGN(PAGE_SIZE);
|
|
BEGIN_HYP_SECTION(.data..percpu)
|
|
PERCPU_INPUT(L1_CACHE_BYTES)
|
|
END_HYP_SECTION
|
|
HYP_SECTION(.bss)
|
|
}
|