Revert "ANDROID: KVM: arm64: pkvm: Track the SVE state in the shadow vcpu"

This reverts commit d35bf8afbf.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I7400ee64cb65b99f3616dc77c66960d65881e37a
This commit is contained in:
Will Deacon
2022-07-07 15:48:53 +01:00
parent b01c45bf4a
commit 0ec225eb5e

View File

@@ -354,19 +354,8 @@ static void unpin_host_vcpus(struct shadow_vcpu_state *shadow_vcpus, int nr_vcpu
for (i = 0; i < nr_vcpus; i++) {
struct kvm_vcpu *host_vcpu = shadow_vcpus[i].vcpu.arch.pkvm.host_vcpu;
struct kvm_vcpu *shadow_vcpu = &shadow_vcpus[i].vcpu;
size_t sve_state_size;
void *sve_state;
hyp_unpin_shared_mem(host_vcpu, host_vcpu + 1);
if (!test_bit(KVM_ARM_VCPU_SVE, shadow_vcpu->arch.features))
continue;
sve_state = shadow_vcpu->arch.sve_state;
sve_state = kern_hyp_va(sve_state);
sve_state_size = vcpu_sve_state_size(shadow_vcpu);
hyp_unpin_shared_mem(sve_state, sve_state + sve_state_size);
}
}
@@ -416,27 +405,6 @@ static int init_shadow_structs(struct kvm *kvm, struct kvm_shadow_vm *vm,
if (ret)
return ret;
if (test_bit(KVM_ARM_VCPU_SVE, shadow_vcpu->arch.features)) {
size_t sve_state_size;
void *sve_state;
shadow_vcpu->arch.sve_state = READ_ONCE(host_vcpu->arch.sve_state);
shadow_vcpu->arch.sve_max_vl = READ_ONCE(host_vcpu->arch.sve_max_vl);
sve_state = kern_hyp_va(shadow_vcpu->arch.sve_state);
sve_state_size = vcpu_sve_state_size(shadow_vcpu);
if (!shadow_vcpu->arch.sve_state || !sve_state_size ||
hyp_pin_shared_mem(sve_state,
sve_state + sve_state_size)) {
clear_bit(KVM_ARM_VCPU_SVE,
shadow_vcpu->arch.features);
shadow_vcpu->arch.sve_state = NULL;
shadow_vcpu->arch.sve_max_vl = 0;
return -EINVAL;
}
}
if (vm->arch.pkvm.enabled)
pkvm_vcpu_init_traps(shadow_vcpu);
kvm_reset_pvm_sys_regs(shadow_vcpu);