]> 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)
commit8628bc9ce57b479e17f2b598f8de20f2bf0edfd4
tree51ce1752d2957fb662686973f5ce0b8c8f8b5e39
parent1973d00846eb2220b6ed348f7cbbc5b632866963
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