KVM: arm64: Rename SMC/HVC call handler to reflect reality
authorOliver Upton <oliver.upton@linux.dev>
Tue, 4 Apr 2023 15:40:41 +0000 (15:40 +0000)
committerMarc Zyngier <maz@kernel.org>
Wed, 5 Apr 2023 11:07:41 +0000 (12:07 +0100)
KVM handles SMCCC calls from virtual EL2 that use the SMC instruction
since commit bd36b1a9eb5a ("KVM: arm64: nv: Handle SMCs taken from
virtual EL2"). Thus, the function name of the handler no longer reflects
reality.

Normalize the name on SMCCC, since that's the only hypercall interface
KVM supports in the first place. No fuctional change intended.

Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230404154050.2270077-5-oliver.upton@linux.dev
arch/arm64/kvm/handle_exit.c
arch/arm64/kvm/hypercalls.c
include/kvm/arm_hypercalls.h

index a798c0b4d7177020ee9ed28ecc2ee345e565ee2e..5e4f9737cbd5827e7f794b745f5598ca3da46872 100644 (file)
@@ -52,7 +52,7 @@ static int handle_hvc(struct kvm_vcpu *vcpu)
                return 1;
        }
 
-       ret = kvm_hvc_call_handler(vcpu);
+       ret = kvm_smccc_call_handler(vcpu);
        if (ret < 0) {
                vcpu_set_reg(vcpu, 0, ~0UL);
                return 1;
@@ -89,7 +89,7 @@ static int handle_smc(struct kvm_vcpu *vcpu)
         * at Non-secure EL1 is trapped to EL2 if HCR_EL2.TSC==1, rather than
         * being treated as UNDEFINED.
         */
-       ret = kvm_hvc_call_handler(vcpu);
+       ret = kvm_smccc_call_handler(vcpu);
        if (ret < 0)
                vcpu_set_reg(vcpu, 0, ~0UL);
 
index a09a526a7d7c3ec3add2019d73de96c6b29ed4c2..5ead6c6afff0f1f31fe16187eec04a8a8f98e212 100644 (file)
@@ -121,7 +121,7 @@ static bool kvm_hvc_call_allowed(struct kvm_vcpu *vcpu, u32 func_id)
        }
 }
 
-int kvm_hvc_call_handler(struct kvm_vcpu *vcpu)
+int kvm_smccc_call_handler(struct kvm_vcpu *vcpu)
 {
        struct kvm_smccc_features *smccc_feat = &vcpu->kvm->arch.smccc_feat;
        u32 func_id = smccc_get_function(vcpu);
index 1188f116cf4e9dafbde939eac6d17cc5235d9650..8f4e33bc43e8c567f5a26cefdd496209372248d7 100644 (file)
@@ -6,7 +6,7 @@
 
 #include <asm/kvm_emulate.h>
 
-int kvm_hvc_call_handler(struct kvm_vcpu *vcpu);
+int kvm_smccc_call_handler(struct kvm_vcpu *vcpu);
 
 static inline u32 smccc_get_function(struct kvm_vcpu *vcpu)
 {