linux-stable/arch/arm64
Quentin Perret f320bc742b KVM: arm64: Prepare the creation of s1 mappings at EL2
When memory protection is enabled, the EL2 code needs the ability to
create and manage its own page-table. To do so, introduce a new set of
hypercalls to bootstrap a memory management system at EL2.

This leads to the following boot flow in nVHE Protected mode:

 1. the host allocates memory for the hypervisor very early on, using
    the memblock API;

 2. the host creates a set of stage 1 page-table for EL2, installs the
    EL2 vectors, and issues the __pkvm_init hypercall;

 3. during __pkvm_init, the hypervisor re-creates its stage 1 page-table
    and stores it in the memory pool provided by the host;

 4. the hypervisor then extends its stage 1 mappings to include a
    vmemmap in the EL2 VA space, hence allowing to use the buddy
    allocator introduced in a previous patch;

 5. the hypervisor jumps back in the idmap page, switches from the
    host-provided page-table to the new one, and wraps up its
    initialization by enabling the new allocator, before returning to
    the host.

 6. the host can free the now unused page-table created for EL2, and
    will now need to issue hypercalls to make changes to the EL2 stage 1
    mappings instead of modifying them directly.

Note that for the sake of simplifying the review, this patch focuses on
the hypervisor side of things. In other words, this only implements the
new hypercalls, but does not make use of them from the host yet. The
host-side changes will follow in a subsequent patch.

Credits to Will for __pkvm_init_switch_pgd.

Acked-by: Will Deacon <will@kernel.org>
Co-authored-by: Will Deacon <will@kernel.org>
Signed-off-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-18-qperret@google.com
2021-03-19 12:01:21 +00:00
..
boot regulator: Updates for v5.12 2021-02-22 09:16:38 -08:00
configs Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid 2021-02-23 14:52:22 -08:00
crypto crypto: arm64/crc-t10dif - move NEON yield to C code 2021-02-10 17:55:58 +11:00
include KVM: arm64: Prepare the creation of s1 mappings at EL2 2021-03-19 12:01:21 +00:00
kernel KVM: arm64: Prepare the creation of s1 mappings at EL2 2021-03-19 12:01:21 +00:00
kvm KVM: arm64: Prepare the creation of s1 mappings at EL2 2021-03-19 12:01:21 +00:00
lib arm64: lib: Annotate {clear, copy}_page() as position-independent 2021-03-19 12:01:19 +00:00
mm KVM: arm64: Prepare the creation of s1 mappings at EL2 2021-03-19 12:01:21 +00:00
net bpf: Rename BPF_XADD and prepare to encode other atomics in .imm 2021-01-14 18:34:29 -08:00
xen
Kbuild
Kconfig Linux 5.12-rc3 2021-03-19 12:01:04 +00:00
Kconfig.debug
Kconfig.platforms Updates for the irq subsystem: 2021-02-21 11:53:06 -08:00
Makefile arm64: do not descend to vdso directories twice 2021-01-20 12:18:46 +00:00