summaryrefslogtreecommitdiffstats
path: root/virt/kvm/arm/hypercalls.c
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2020-05-13 12:40:34 +0200
committerMarc Zyngier <maz@kernel.org>2020-05-16 16:03:59 +0200
commit9ed24f4b712b855dcf7be3025b75b051cb73a2b7 (patch)
tree2979a0b689ba9ba130504f12b0e7b4562f2fac22 /virt/kvm/arm/hypercalls.c
parentLinux 5.7-rc5 (diff)
downloadlinux-9ed24f4b712b855dcf7be3025b75b051cb73a2b7.tar.xz
linux-9ed24f4b712b855dcf7be3025b75b051cb73a2b7.zip
KVM: arm64: Move virt/kvm/arm to arch/arm64
Now that the 32bit KVM/arm host is a distant memory, let's move the whole of the KVM/arm64 code into the arm64 tree. As they said in the song: Welcome Home (Sanitarium). Signed-off-by: Marc Zyngier <maz@kernel.org> Acked-by: Will Deacon <will@kernel.org> Link: https://lore.kernel.org/r/20200513104034.74741-1-maz@kernel.org
Diffstat (limited to 'virt/kvm/arm/hypercalls.c')
-rw-r--r--virt/kvm/arm/hypercalls.c71
1 files changed, 0 insertions, 71 deletions
diff --git a/virt/kvm/arm/hypercalls.c b/virt/kvm/arm/hypercalls.c
deleted file mode 100644
index 550dfa3e53cd..000000000000
--- a/virt/kvm/arm/hypercalls.c
+++ /dev/null
@@ -1,71 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-// Copyright (C) 2019 Arm Ltd.
-
-#include <linux/arm-smccc.h>
-#include <linux/kvm_host.h>
-
-#include <asm/kvm_emulate.h>
-
-#include <kvm/arm_hypercalls.h>
-#include <kvm/arm_psci.h>
-
-int kvm_hvc_call_handler(struct kvm_vcpu *vcpu)
-{
- u32 func_id = smccc_get_function(vcpu);
- long val = SMCCC_RET_NOT_SUPPORTED;
- u32 feature;
- gpa_t gpa;
-
- switch (func_id) {
- case ARM_SMCCC_VERSION_FUNC_ID:
- val = ARM_SMCCC_VERSION_1_1;
- break;
- case ARM_SMCCC_ARCH_FEATURES_FUNC_ID:
- feature = smccc_get_arg1(vcpu);
- switch (feature) {
- case ARM_SMCCC_ARCH_WORKAROUND_1:
- switch (kvm_arm_harden_branch_predictor()) {
- case KVM_BP_HARDEN_UNKNOWN:
- break;
- case KVM_BP_HARDEN_WA_NEEDED:
- val = SMCCC_RET_SUCCESS;
- break;
- case KVM_BP_HARDEN_NOT_REQUIRED:
- val = SMCCC_RET_NOT_REQUIRED;
- break;
- }
- break;
- case ARM_SMCCC_ARCH_WORKAROUND_2:
- switch (kvm_arm_have_ssbd()) {
- case KVM_SSBD_FORCE_DISABLE:
- case KVM_SSBD_UNKNOWN:
- break;
- case KVM_SSBD_KERNEL:
- val = SMCCC_RET_SUCCESS;
- break;
- case KVM_SSBD_FORCE_ENABLE:
- case KVM_SSBD_MITIGATED:
- val = SMCCC_RET_NOT_REQUIRED;
- break;
- }
- break;
- case ARM_SMCCC_HV_PV_TIME_FEATURES:
- val = SMCCC_RET_SUCCESS;
- break;
- }
- break;
- case ARM_SMCCC_HV_PV_TIME_FEATURES:
- val = kvm_hypercall_pv_features(vcpu);
- break;
- case ARM_SMCCC_HV_PV_TIME_ST:
- gpa = kvm_init_stolen_time(vcpu);
- if (gpa != GPA_INVALID)
- val = gpa;
- break;
- default:
- return kvm_psci_call(vcpu);
- }
-
- smccc_set_retval(vcpu, val, 0, 0, 0);
- return 1;
-}