ANDROID: KVM: arm64: pkvm: Update the shadow view of pkvm.enabled at creation time

As we can't really rely on the host side for the protection status,
snapshot the expected status at VM creation time.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Bug: 209580772
Change-Id: I0943eadba25e6c9fe718f29e749b9fcc8fbb79ba
Signed-off-by: Will Deacon <willdeacon@google.com>
This commit is contained in:
Marc Zyngier
2022-01-05 18:43:16 +00:00
committed by Will Deacon
parent f780e698c7
commit 7c52b4e55a

View File

@@ -358,6 +358,7 @@ static int init_shadow_structs(struct kvm *kvm, struct kvm_shadow_vm *vm,
vm->host_kvm = kvm;
vm->created_vcpus = 0;
vm->arch.pkvm.pvmfw_load_addr = kvm->arch.pkvm.pvmfw_load_addr;
vm->arch.pkvm.enabled = READ_ONCE(kvm->arch.pkvm.enabled);
for (i = 0; i < nr_vcpus; i++) {
struct kvm_vcpu *host_vcpu = kern_hyp_va(vcpu_array[i]);