FAILED: patch "[PATCH] powerpc/powernv: Fix save/restore of SPRG3 on entry/exit from" failed to apply to 4.14-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
Quoted 1 line
From
b03897cf318dfc47de33a7ecbc7655584266f034Mon Sep 17 00:00:00 2001
From: "Gautham R. Shenoy" <[email protected]>
Date: Wed, 18 Jul 2018 14:03:16 +0530
Subject: [PATCH] powerpc/powernv: Fix save/restore of SPRG3 on entry/exit from
stop (idle)
On 64-bit servers, SPRN_SPRG3 and its userspace read-only mirror SPRN_USPRG3 are used as userspace VDSO write and read registers respectively.
SPRN_SPRG3 is lost when we enter stop4 and above, and is currently not restored. As a result, any read from SPRN_USPRG3 returns zero on an exit from stop4 (Power9 only) and above.
Thus in this situation, on POWER9, any call from sched_getcpu() always returns zero, as on powerpc, we call __kernel_getcpu() which relies upon SPRN_USPRG3 to report the CPU and NUMA node information.
Fix this by restoring SPRN_SPRG3 on wake up from a deep stop state with the sprg_vdso value that is cached in PACA.
arch/powerpc/kernel/idle_book3s.S +2 -0
@@ -144,7 +144,9 @@ power9_restore_additional_sprs: mtspr SPRN_MMCR1, r4 ld r3, STOP_MMCR2(r13) + ld r4, PACA_SPRG_VDSO(r13) mtspr SPRN_MMCR2, r3 + mtspr SPRN_SPRG3, r4 blr /*
PATCH 1/1 powerpc/powernv : Save/Restore SPRG3 on entry/exit from stop.
From: "Gautham R. Shenoy" <[email protected]>
[ Upstream commit b03897cf318dfc47de33a7ecbc7655584266f034 ]
On 64-bit servers, SPRN_SPRG3 and its userspace read-only mirror SPRN_USPRG3 are used as userspace VDSO write and read registers respectively.
SPRN_SPRG3 is lost when we enter stop4 and above, and is currently not restored. As a result, any read from SPRN_USPRG3 returns zero on an exit from stop4 and above.
Thus in this situation, on POWER9, any call from sched_getcpu() always returns zero, as on powerpc, we call __kernel_getcpu() which relies upon SPRN_USPRG3 to report the CPU and NUMA node information.
Fix this by restoring SPRN_SPRG3 on wake up from a deep stop state with the sprg_vdso value that is cached in PACA.
for stop4 cpuidle")
--- arch/powerpc/kernel/idle_book3s.S | 2 ++ 1 file changed, 2 insertions(+)
arch/powerpc/kernel/idle_book3s.S +2 -0
@@ -140,6 +140,8 @@ power9_restore_additional_sprs: ld r4, STOP_MMCR2(r13) mtspr SPRN_MMCR1, r3 mtspr SPRN_MMCR2, r4 + ld r4, PACA_SPRG_VDSO(r13) + mtspr SPRN_SPRG3, r4 blr /*
Signature · 1 line
1.9.4
Greg KH
maintainerRe: [PATCH] powerpc/powernv : Save/Restore SPRG3 on entry/exit from stop.
Quoted 22 lines · Gautham R. Shenoy
From: "Gautham R. Shenoy" <[email protected]>
[ Upstream commit
b03897cf318dfc47de33a7ecbc7655584266f034]On 64-bit servers,
SPRN_SPRG3and its userspace read-only mirrorSPRN_USPRG3are used as userspace VDSO write and read registers respectively.
SPRN_SPRG3is lost when we enter stop4 and above, and is currently not restored. As a result, any read fromSPRN_USPRG3returns zero on an exit from stop4 and above.Thus in this situation, on POWER9, any call from
sched_getcpu()always returns zero, as on powerpc, we call__kernel_getcpu()which relies uponSPRN_USPRG3to report the CPU and NUMA node information.Fix this by restoring
SPRN_SPRG3on wake up from a deep stop state with thesprg_vdsovalue that is cached in PACA.Fixes e1c1cfed5432 ("powerpc/powernv: Save/Restore additional SPRsfor stop4 cpuidle")
Quoted 8 lines
Reported-by Florian Weimer <[email protected]>Cc <[email protected]> # 4.14Signed-off-by Gautham R. Shenoy <[email protected]>Reviewed-by Michael Ellerman <[email protected]>Signed-off-by Michael Ellerman <[email protected]>--- arch/powerpc/kernel/idle_book3s.S | 2 ++ 1 file changed, 2 insertions(+)
What stable tree(s) do you want this applied to?
thanks,
greg k-h
Greg KH
maintainerRe: [PATCH] powerpc/powernv : Save/Restore SPRG3 on entry/exit from stop.
Quoted 32 lines · Greg KH
Quoted 22 lines · Gautham R. Shenoy
From: "Gautham R. Shenoy" <[email protected]>
[ Upstream commit
b03897cf318dfc47de33a7ecbc7655584266f034]On 64-bit servers,
SPRN_SPRG3and its userspace read-only mirrorSPRN_USPRG3are used as userspace VDSO write and read registers respectively.
SPRN_SPRG3is lost when we enter stop4 and above, and is currently not restored. As a result, any read fromSPRN_USPRG3returns zero on an exit from stop4 and above.Thus in this situation, on POWER9, any call from
sched_getcpu()always returns zero, as on powerpc, we call__kernel_getcpu()which relies uponSPRN_USPRG3to report the CPU and NUMA node information.Fix this by restoring
SPRN_SPRG3on wake up from a deep stop state with thesprg_vdsovalue that is cached in PACA.Fixes e1c1cfed5432 ("powerpc/powernv: Save/Restore additional SPRsfor stop4 cpuidle")
Quoted 8 lines
Reported-by Florian Weimer <[email protected]>Cc <[email protected]> # 4.14Signed-off-by Gautham R. Shenoy <[email protected]>Reviewed-by Michael Ellerman <[email protected]>Signed-off-by Michael Ellerman <[email protected]>--- arch/powerpc/kernel/idle_book3s.S | 2 ++ 1 file changed, 2 insertions(+)
Quoted 1 line
What stable tree(s) do you want this applied to?
I've now guessed that it is 4.14.y. If that's not the case, please let me know.
greg k-h
Re: [PATCH] powerpc/powernv : Save/Restore SPRG3 on entry/exit from stop.
Hello Greg,
Quoted 33 lines · Greg KH
Quoted 32 lines · Greg KH
Quoted 30 lines · Gautham R. Shenoy
From: "Gautham R. Shenoy" <[email protected]>
[ Upstream commit
b03897cf318dfc47de33a7ecbc7655584266f034]On 64-bit servers,
SPRN_SPRG3and its userspace read-only mirrorSPRN_USPRG3are used as userspace VDSO write and read registers respectively.
SPRN_SPRG3is lost when we enter stop4 and above, and is currently not restored. As a result, any read fromSPRN_USPRG3returns zero on an exit from stop4 and above.Thus in this situation, on POWER9, any call from
sched_getcpu()always returns zero, as on powerpc, we call__kernel_getcpu()which relies uponSPRN_USPRG3to report the CPU and NUMA node information.Fix this by restoring
SPRN_SPRG3on wake up from a deep stop state with thesprg_vdsovalue that is cached in PACA.Fixes e1c1cfed5432 ("powerpc/powernv: Save/Restore additional SPRsfor stop4 cpuidle")
Reported-by Florian Weimer <[email protected]>Cc <[email protected]> # 4.14Signed-off-by Gautham R. Shenoy <[email protected]>Reviewed-by Michael Ellerman <[email protected]>Signed-off-by Michael Ellerman <[email protected]>--- arch/powerpc/kernel/idle_book3s.S | 2 ++ 1 file changed, 2 insertions(+)
Quoted 4 lines
Quoted 1 line
What stable tree(s) do you want this applied to?
I've now guessed that it is 4.14.y. If that's not the case, please let me know.
Yes, this backport is for 4.14.y. The upstream commit cleanly applies on 4.15.18 and 4.16.18.
Quoted 3 lines
greg k-h
--
Thanks and Regards
gautham.