Revert "ANDROID: KVM: arm64: Fix for do not allow memslot changes after first VM run under pKVM"

This reverts commit e2e042c0c4.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I9a2364b3afd0cf12c7dba466f2d032424ba901e4
This commit is contained in:
Will Deacon
2022-07-07 15:48:48 +01:00
parent 5de803f3b8
commit a5d986619f

View File

@@ -1796,6 +1796,10 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,
hva_t reg_end = hva + mem->memory_size;
int ret = 0;
if (change != KVM_MR_CREATE && change != KVM_MR_MOVE &&
change != KVM_MR_FLAGS_ONLY)
return 0;
/* In protected mode, cannot modify memslots once a VM has run. */
if (is_protected_kvm_enabled() &&
(change == KVM_MR_DELETE || change == KVM_MR_MOVE) &&
@@ -1803,10 +1807,6 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,
return -EPERM;
}
if (change != KVM_MR_CREATE && change != KVM_MR_MOVE &&
change != KVM_MR_FLAGS_ONLY)
return 0;
/*
* Prevent userspace from creating a memory region outside of the IPA
* space addressable by the KVM guest IPA space.