static int handle_smc(struct kvm_vcpu *vcpu)
 {
+       int ret;
+
        /*
         * "If an SMC instruction executed at Non-secure EL1 is
         * trapped to EL2 because HCR_EL2.TSC is 1, the exception is a
         *
         * We need to advance the PC after the trap, as it would
         * otherwise return to the same address...
+        *
+        * Only handle SMCs from the virtual EL2 with an immediate of zero and
+        * skip it otherwise.
         */
-       vcpu_set_reg(vcpu, 0, ~0UL);
+       if (!vcpu_is_el2(vcpu) || kvm_vcpu_hvc_get_imm(vcpu)) {
+               vcpu_set_reg(vcpu, 0, ~0UL);
+               kvm_incr_pc(vcpu);
+               return 1;
+       }
+
+       /*
+        * If imm is zero then it is likely an SMCCC call.
+        *
+        * Note that on ARMv8.3, even if EL3 is not implemented, SMC executed
+        * 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);
+       if (ret < 0)
+               vcpu_set_reg(vcpu, 0, ~0UL);
+
        kvm_incr_pc(vcpu);
-       return 1;
+
+       return ret;
 }
 
 /*