Merge tag 'net-next-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev...
[linux-2.6-microblaze.git] / arch / arm64 / kvm / hypercalls.c
index 69e023d..9824025 100644 (file)
@@ -36,13 +36,24 @@ int kvm_hvc_call_handler(struct kvm_vcpu *vcpu)
                        }
                        break;
                case ARM_SMCCC_ARCH_WORKAROUND_2:
-                       switch (arm64_get_ssbd_state()) {
-                       case ARM64_SSBD_FORCE_DISABLE:
-                       case ARM64_SSBD_UNKNOWN:
+                       switch (arm64_get_spectre_v4_state()) {
+                       case SPECTRE_VULNERABLE:
                                break;
-                       case ARM64_SSBD_KERNEL:
-                       case ARM64_SSBD_FORCE_ENABLE:
-                       case ARM64_SSBD_MITIGATED:
+                       case SPECTRE_MITIGATED:
+                               /*
+                                * SSBS everywhere: Indicate no firmware
+                                * support, as the SSBS support will be
+                                * indicated to the guest and the default is
+                                * safe.
+                                *
+                                * Otherwise, expose a permanent mitigation
+                                * to the guest, and hide SSBS so that the
+                                * guest stays protected.
+                                */
+                               if (cpus_have_final_cap(ARM64_SSBS))
+                                       break;
+                               fallthrough;
+                       case SPECTRE_UNAFFECTED:
                                val = SMCCC_RET_NOT_REQUIRED;
                                break;
                        }