OpenCloudOS-Kernel/arch/arm64
Marc Zyngier 7d717558dd KVM: arm64: Reject VM creation when the default IPA size is unsupported
KVM/arm64 has forever used a 40bit default IPA space, partially
due to its 32bit heritage (where the only choice is 40bit).

However, there are implementations in the wild that have a *cough*
much smaller *cough* IPA space, which leads to a misprogramming of
VTCR_EL2, and a guest that is stuck on its first memory access
if userspace dares to ask for the default IPA setting (which most
VMMs do).

Instead, blundly reject the creation of such VM, as we can't
satisfy the requirements from userspace (with a one-off warning).
Also clarify the boot warning, and document that the VM creation
will fail when an unsupported IPA size is provided.

Although this is an ABI change, it doesn't really change much
for userspace:

- the guest couldn't run before this change, but no error was
  returned. At least userspace knows what is happening.

- a memory slot that was accepted because it did fit the default
  IPA space now doesn't even get a chance to be registered.

The other thing that is left doing is to convince userspace to
actually use the IPA space setting instead of relying on the
antiquated default.

Fixes: 233a7cb235 ("kvm: arm64: Allow tuning the physical address size for VM")
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: stable@vger.kernel.org
Reviewed-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Link: https://lore.kernel.org/r/20210311100016.3830038-2-maz@kernel.org
2021-03-12 15:42:57 +00:00
..
boot ARM: SoC fixes for v5.11 2021-01-08 14:13:54 -08:00
configs ARM: device tree updates for 5.11 2020-12-16 16:27:35 -08:00
crypto crypto: sha - split sha.h into sha1.h and sha2.h 2020-11-20 14:45:33 +11:00
include KVM: arm64: Ensure I-cache isolation between vcpus of a same VM 2021-03-09 17:58:56 +00:00
kernel KVM: arm64: Don't access PMSELR_EL0/PMUSERENR_EL0 when no PMU is available 2021-03-06 04:18:40 -05:00
kvm KVM: arm64: Reject VM creation when the default IPA size is unsupported 2021-03-12 15:42:57 +00:00
lib arm64: mte: add in-kernel MTE helpers 2020-12-22 12:55:07 -08:00
mm arm64: Remove arm64_dma32_phys_limit and its uses 2021-01-12 17:49:25 +00:00
net arm64: bpf: Fix branch offset in JIT 2020-09-17 12:05:36 +01:00
xen arm64: xen: Use modern annotations for assembly functions 2020-01-09 16:09:42 +00:00
Kbuild
Kconfig Revert "arm64: Enable perf events based hard lockup detector" 2021-01-13 15:08:41 +00:00
Kconfig.debug arm64: remove TEXT_OFFSET randomization 2020-06-15 13:10:59 +01:00
Kconfig.platforms ARM: device tree updates for 5.11 2020-12-16 16:27:35 -08:00
Makefile arm64: link with -z norelro for LLD or aarch64-elf 2021-01-05 11:51:41 +00:00