# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: package/*/linux/hotfix-ppc64-ps3-srr-clobber.patch # Copyright (C) 2024 The T2 SDE Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This patch file is dual-licensed. It is available under the license the # patched project is licensed under, as long as it is an OpenSource license # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms # of the GNU General Public License version 2 as used by the T2 SDE. # --- T2-COPYRIGHT-NOTE-END --- Booting Ps3 instantly yields: <4>SRR0 was: c0000000000971b4 should be: c0000000002d55c4 <4>SRR1 was: 8000000000008032 should be: 8000000000008032 Fix this by marking ssr regs clobbered for each lv1 call. Signed-off-by: René Rebe --- ./arch/powerpc/include/asm/lv1call.h.vanilla 2024-01-14 20:55:26.286402628 +0100 +++ ./arch/powerpc/include/asm/lv1call.h 2024-01-14 21:44:45.431525711 +0100 @@ -14,6 +14,7 @@ #include #include +#include /* lv1 call declaration macros */ @@ -210,7 +211,7 @@ #define LV1_CALL(name, in, out, num) \ extern s64 _lv1_##name(LV1_##in##_IN_##out##_OUT_ARG_DECL); \ static inline int lv1_##name(LV1_##in##_IN_##out##_OUT_ARG_DECL) \ - {return _lv1_##name(LV1_##in##_IN_##out##_OUT_ARGS);} + {srr_regs_clobbered(); return _lv1_##name(LV1_##in##_IN_##out##_OUT_ARGS);} #endif #endif /* !defined(__ASSEMBLY__) */ --- ./arch/powerpc/include/asm/interrupt.h.vanilla 2024-01-14 21:42:11.164519295 +0100 +++ ./arch/powerpc/include/asm/interrupt.h 2024-01-14 21:43:08.143521665 +0100 @@ -81,6 +81,7 @@ #ifdef CONFIG_PPC_BOOK3S_64 DECLARE_STATIC_KEY_FALSE(interrupt_exit_not_reentrant); +__attribute__((always_inline)) static inline void srr_regs_clobbered(void) { local_paca->srr_valid = 0;