ANDROID: sched: add restricted tracehooks for 32bit execve

Pre and post tracepoints in force_compatible_cpus_allowed_ptr() need
to be restricted hooks so that they can sleep.

The old non-restricted versions need to stay in place temporarily for
KMI stability. They will be removed by aosp/1742588.

Bug: 187917024
Change-Id: If630554b1c8fa2e8ccb79c89945c55e17756e6a8
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
This commit is contained in:
Shaleen Agrawal 2021-06-23 11:10:57 -07:00
parent f502bc761a
commit c7c351ab3f
3 changed files with 11 additions and 0 deletions

View File

@ -331,3 +331,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sha256);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_aes_expandkey);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_aes_encrypt);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_aes_decrypt);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_force_compatible_pre);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_force_compatible_post);

View File

@ -378,6 +378,13 @@ DECLARE_HOOK(android_vh_force_compatible_post,
TP_PROTO(void *unused),
TP_ARGS(unused));
DECLARE_RESTRICTED_HOOK(android_rvh_force_compatible_pre,
TP_PROTO(void *unused),
TP_ARGS(unused), 1);
DECLARE_RESTRICTED_HOOK(android_rvh_force_compatible_post,
TP_PROTO(void *unused),
TP_ARGS(unused), 1);
/* macro versions of hooks are no longer required */
#endif /* _TRACE_HOOK_SCHED_H */

View File

@ -2106,6 +2106,7 @@ void force_compatible_cpus_allowed_ptr(struct task_struct *p)
* lock to ensure that the migration succeeds.
*/
trace_android_vh_force_compatible_pre(NULL);
trace_android_rvh_force_compatible_pre(NULL);
cpus_read_lock();
if (!cpumask_available(new_mask))
goto out_set_mask;
@ -2131,6 +2132,7 @@ void force_compatible_cpus_allowed_ptr(struct task_struct *p)
out_free_mask:
cpus_read_unlock();
trace_android_vh_force_compatible_post(NULL);
trace_android_rvh_force_compatible_post(NULL);
free_cpumask_var(new_mask);
}