Skip to content

Commit

Permalink
arm64: Move .hyp.rodata outside of the _sdata.._edata range
Browse files Browse the repository at this point in the history
commit eb48d15 upstream.

The HYP rodata section is currently lumped together with the BSS,
which isn't exactly what is expected (it gets registered with
kmemleak, for example).

Move it away so that it is actually marked RO. As an added
benefit, it isn't registered with kmemleak anymore.

Fixes: 380e18a ("KVM: arm64: Introduce a BSS section for use at Hyp")
Suggested-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: stable@vger.kernel.org #5.13
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20210802123830.2195174-2-maz@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Marc Zyngier authored and gregkh committed Sep 18, 2021
1 parent f1d3bf0 commit 60b28d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/arm64/kernel/vmlinux.lds.S
Expand Up @@ -181,6 +181,8 @@ SECTIONS
/* everything from this point to __init_begin will be marked RO NX */
RO_DATA(PAGE_SIZE)

HYPERVISOR_DATA_SECTIONS

idmap_pg_dir = .;
. += IDMAP_DIR_SIZE;
idmap_pg_end = .;
Expand Down Expand Up @@ -260,8 +262,6 @@ SECTIONS
_sdata = .;
RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_ALIGN)

HYPERVISOR_DATA_SECTIONS

/*
* Data written with the MMU off but read with the MMU on requires
* cache lines to be invalidated, discarding up to a Cache Writeback
Expand Down

0 comments on commit 60b28d5

Please sign in to comment.