]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Mark host bss and rodata section as shared
authorQuentin Perret <qperret@google.com>
Mon, 9 Aug 2021 15:24:44 +0000 (16:24 +0100)
committerMarc Zyngier <maz@kernel.org>
Wed, 11 Aug 2021 10:39:51 +0000 (11:39 +0100)
commitf70e152e68aa905978760ee85089d30837f46152
tree51ce1752d2957fb662686973f5ce0b8c8f8b5e39
parent1f5c4fb59928d019fd7bdfd32b868774fb10344a
KVM: arm64: Mark host bss and rodata section as shared

As the hypervisor maps the host's .bss and .rodata sections in its
stage-1, make sure to tag them as shared in hyp and host page-tables.

But since the hypervisor relies on the presence of these mappings, we
cannot let the host in complete control of the memory regions -- it
must not unshare or donate them to another entity for example. To
prevent this, let's transfer the ownership of those ranges to the
hypervisor itself, and share the pages back with the host.

Signed-off-by: Quentin Perret <qperret@google.com>
Reviewed-by: Fuad Tabba <tabba@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210809152448.1810400-18-qperret@google.com
arch/arm64/kvm/hyp/nvhe/setup.c