qcom: scm: Be careful with side-effects from is_scm_armv8
Currently, when deciding which version of scm call to make in scm_call2,
we check the scm_version variable. However, the scm_version variable is
only initialized as a side-effect of calling is_scm_armv8, which isn't
called anywhere in scm_call2. So if someone makes an scm_call2 before
is_scm_armv8 has been called then they could get the wrong scm version.
Fix this by calling is_scm_armv8 at the top of the scm_call2
function (and bailing out if it's not v8 since scm_call2 only supports
v8 forward). Similarly for scm_call2_atomic.
Since is_scm_armv8 caches its result the performance overhead of calling
on every invocation of scm_call2 should be negligible.
Change-Id: I46d2423ae2e4b5204fc5eefa1c6660c3c95a95b0
Signed-off-by:
Mitchel Humpherys <mitchelh@codeaurora.org>
Loading
Please register or sign in to comment