Revert "ANDROID: KVM: arm64: Add initial support for KVM_CAP_EXIT_HYPERCALL"

This reverts commit a1bd2a6b3c.

Bug: 233587962
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I1e80a4ad2243313d0e9ff899a2686a1a6afa00f6
This commit is contained in:
Will Deacon
2022-07-07 15:51:27 +01:00
parent 3201118a4b
commit a712ed58dc
3 changed files with 0 additions and 45 deletions

View File

@@ -204,8 +204,6 @@ struct kvm_arch {
bool mte_enabled;
struct kvm_protected_vm pkvm;
u64 hypercall_exit_enabled;
};
struct kvm_protected_vcpu {

View File

@@ -64,9 +64,6 @@ static bool vgic_present;
static DEFINE_PER_CPU(unsigned char, kvm_arm_hardware_enabled);
DEFINE_STATIC_KEY_FALSE(userspace_irqchip_in_use);
/* KVM "vendor" hypercalls which may be forwarded to userspace on request. */
#define KVM_EXIT_HYPERCALL_VALID_MASK (0)
int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu)
{
return kvm_vcpu_exiting_guest_mode(vcpu) == IN_GUEST_MODE;
@@ -105,19 +102,6 @@ int kvm_vm_ioctl_enable_cap(struct kvm *kvm,
}
mutex_unlock(&kvm->lock);
break;
case KVM_CAP_EXIT_HYPERCALL:
if (cap->flags)
return -EINVAL;
if (cap->args[0] & ~KVM_EXIT_HYPERCALL_VALID_MASK)
return -EINVAL;
if (cap->args[1] || cap->args[2] || cap->args[3])
return -EINVAL;
WRITE_ONCE(kvm->arch.hypercall_exit_enabled, cap->args[0]);
r = 0;
break;
default:
r = -EINVAL;
break;
@@ -320,9 +304,6 @@ static int kvm_check_extension(struct kvm *kvm, long ext)
case KVM_CAP_ARM_PTRAUTH_GENERIC:
r = system_has_full_ptr_auth();
break;
case KVM_CAP_EXIT_HYPERCALL:
r = KVM_EXIT_HYPERCALL_VALID_MASK;
break;
default:
r = 0;
}
@@ -939,12 +920,6 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
ret = kvm_handle_mmio_return(vcpu);
if (ret)
return ret;
} else if (run->exit_reason == KVM_EXIT_HYPERCALL) {
smccc_set_retval(vcpu,
vcpu->run->hypercall.ret,
vcpu->run->hypercall.args[0],
vcpu->run->hypercall.args[1],
vcpu->run->hypercall.args[2]);
}
vcpu_load(vcpu);

View File

@@ -58,24 +58,6 @@ static void kvm_ptp_get_time(struct kvm_vcpu *vcpu, u64 *val)
val[3] = lower_32_bits(cycles);
}
static int kvm_vcpu_exit_hcall(struct kvm_vcpu *vcpu, u32 nr, u32 nr_args)
{
u64 mask = vcpu->kvm->arch.hypercall_exit_enabled;
u32 i;
if (nr_args > 6 || !(mask & BIT(nr)))
return -EINVAL;
vcpu->run->exit_reason = KVM_EXIT_HYPERCALL;
vcpu->run->hypercall.nr = nr;
for (i = 0; i < nr_args; ++i)
vcpu->run->hypercall.args[i] = vcpu_get_reg(vcpu, i + 1);
vcpu->run->hypercall.longmode = !vcpu_mode_is_32bit(vcpu);
return 0;
}
int kvm_hvc_call_handler(struct kvm_vcpu *vcpu)
{
u32 func_id = smccc_get_function(vcpu);