ANDROID: KVM: arm64: Don't filter out KVM_FUNC_MMIO_GUARD_MAP hypercalls

If a KVM_FUNC_MMIO_GUARD_MAP hypercall from a protected guest fails at
EL2 due to running out of page-table memory, the call is forwarded to
the host so that additional memory can be donated using the vCPU's
memcache.

Unfortunately, the host filters out these calls the hypervisor will
replay the guest's HVC instruction forever, making no progress because
it will fail each time.

Avoid filtering out KVM_FUNC_MMIO_GUARD_MAP, in the same way as we
handle the SHARE and UNSHARE hypercalls.

Bug: 262700476
Cc: Keir Fraser <keirf@google.com>
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: Idd14c6bc08a4232939676e3566b79cbc7c927a3a
This commit is contained in:
Will Deacon
2022-12-15 12:45:24 +00:00
parent 1af7ed3212
commit e38c4149ed

View File

@@ -85,6 +85,7 @@ static bool kvm_hvc_call_default_allowed(u32 func_id)
case ARM_SMCCC_ARCH_FEATURES_FUNC_ID:
case ARM_SMCCC_VENDOR_HYP_KVM_MEM_SHARE_FUNC_ID:
case ARM_SMCCC_VENDOR_HYP_KVM_MEM_UNSHARE_FUNC_ID:
case ARM_SMCCC_VENDOR_HYP_KVM_MMIO_GUARD_MAP_FUNC_ID:
return true;
default:
/* PSCI 0.2 and up is in the 0:0x1f range */