On 1/7/20 6:09 PM, Stephen Warren wrote:
James,
I'm looking at commit 6d99b68933fbcf51f84fcbba49246ce1209ec193 ("arm64:
alternatives: use tpidr_el2 on VHE hosts"). When it was back-ported to
v4.9.x as eea59020a7f2993018ccde317387031c04c62036, the changes to
arch/arm64/mm/proc.S weren't included. I assume this was just an
accident, or was there some specific reason for this? Either way, I do
find that I need those changes for system suspend/resume to work in my
downstream vendor fork of v4.9 if I enable KVM support in .config. I'm
happy to send a patch for v4.9.x to add those changes back if that's the
way to go. v4.14.x and later don't have this issue.
Upon further investigation of git history, here's what happened:
When When 6d99b68933fb was back-ported to upstream v4.9.x as
eea59020a7f2, proc.S didn't save/restore tpidr_el1 at all, so that's why
the edits to proc.S were dropped as part of the backport.
Separately, in android-4.9, 0ec37136b90e ("UPSTREAM: arm64: move sp_el0
and tpidr_el1 into cpu_suspend_ctx") modified proc.S to save/restore
tpidir_el1. When those two commits were later merged together in
android-4.9, the modifications to proc.S to alternate between
tpidr_el1/2 should have been added back in, but weren't.
Since our downstream 4.9 fork is based on android-4.9 after that merge,
it picked up this issue and needs to be patched for it. Anyone else
using android-4.9 would need this fix too. However, upstream 4.9.x
stable doesn't have an issue.