|
@@ -318,6 +318,37 @@ void do_barrier_nospec_fixups(bool enable)
|
|
|
}
|
|
|
#endif /* CONFIG_PPC_BARRIER_NOSPEC */
|
|
|
|
|
|
+#ifdef CONFIG_PPC_FSL_BOOK3E
|
|
|
+void do_barrier_nospec_fixups_range(bool enable, void *fixup_start, void *fixup_end)
|
|
|
+{
|
|
|
+ unsigned int instr[2], *dest;
|
|
|
+ long *start, *end;
|
|
|
+ int i;
|
|
|
+
|
|
|
+ start = fixup_start;
|
|
|
+ end = fixup_end;
|
|
|
+
|
|
|
+ instr[0] = PPC_INST_NOP;
|
|
|
+ instr[1] = PPC_INST_NOP;
|
|
|
+
|
|
|
+ if (enable) {
|
|
|
+ pr_info("barrier-nospec: using isync; sync as speculation barrier\n");
|
|
|
+ instr[0] = PPC_INST_ISYNC;
|
|
|
+ instr[1] = PPC_INST_SYNC;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (i = 0; start < end; start++, i++) {
|
|
|
+ dest = (void *)start + *start;
|
|
|
+
|
|
|
+ pr_devel("patching dest %lx\n", (unsigned long)dest);
|
|
|
+ patch_instruction(dest, instr[0]);
|
|
|
+ patch_instruction(dest + 1, instr[1]);
|
|
|
+ }
|
|
|
+
|
|
|
+ printk(KERN_DEBUG "barrier-nospec: patched %d locations\n", i);
|
|
|
+}
|
|
|
+#endif /* CONFIG_PPC_FSL_BOOK3E */
|
|
|
+
|
|
|
void do_lwsync_fixups(unsigned long value, void *fixup_start, void *fixup_end)
|
|
|
{
|
|
|
long *start, *end;
|