|
@@ -289,6 +289,20 @@ void __init arm64_update_smccc_conduit(struct alt_instr *alt,
|
|
|
*updptr = cpu_to_le32(insn);
|
|
|
}
|
|
|
|
|
|
+void __init arm64_enable_wa2_handling(struct alt_instr *alt,
|
|
|
+ __le32 *origptr, __le32 *updptr,
|
|
|
+ int nr_inst)
|
|
|
+{
|
|
|
+ BUG_ON(nr_inst != 1);
|
|
|
+ /*
|
|
|
+ * Only allow mitigation on EL1 entry/exit and guest
|
|
|
+ * ARCH_WORKAROUND_2 handling if the SSBD state allows it to
|
|
|
+ * be flipped.
|
|
|
+ */
|
|
|
+ if (arm64_get_ssbd_state() == ARM64_SSBD_KERNEL)
|
|
|
+ *updptr = cpu_to_le32(aarch64_insn_gen_nop());
|
|
|
+}
|
|
|
+
|
|
|
static void arm64_set_ssbd_mitigation(bool state)
|
|
|
{
|
|
|
switch (psci_ops.conduit) {
|