Merge tag 'trace-v5.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
[linux-2.6-microblaze.git] / arch / powerpc / kernel / rtas.c
index 6bada74..99f2cce 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/reboot.h>
 #include <linux/syscalls.h>
 
+#include <asm/interrupt.h>
 #include <asm/prom.h>
 #include <asm/rtas.h>
 #include <asm/hvcall.h>
 /* This is here deliberately so it's only used in this file */
 void enter_rtas(unsigned long);
 
+static inline void do_enter_rtas(unsigned long args)
+{
+       enter_rtas(args);
+
+       srr_regs_clobbered(); /* rtas uses SRRs, invalidate */
+}
+
 struct rtas_t rtas = {
        .lock = __ARCH_SPIN_LOCK_UNLOCKED
 };
@@ -384,7 +392,7 @@ static char *__fetch_rtas_last_error(char *altbuf)
        save_args = rtas.args;
        rtas.args = err_args;
 
-       enter_rtas(__pa(&rtas.args));
+       do_enter_rtas(__pa(&rtas.args));
 
        err_args = rtas.args;
        rtas.args = save_args;
@@ -430,7 +438,7 @@ va_rtas_call_unlocked(struct rtas_args *args, int token, int nargs, int nret,
        for (i = 0; i < nret; ++i)
                args->rets[i] = 0;
 
-       enter_rtas(__pa(args));
+       do_enter_rtas(__pa(args));
 }
 
 void rtas_call_unlocked(struct rtas_args *args, int token, int nargs, int nret, ...)
@@ -1138,7 +1146,7 @@ SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs)
        flags = lock_rtas();
 
        rtas.args = args;
-       enter_rtas(__pa(&rtas.args));
+       do_enter_rtas(__pa(&rtas.args));
        args = rtas.args;
 
        /* A -1 return code indicates that the last command couldn't