From be1053a135623c735a4a2b55fe25ba1437881390 Mon Sep 17 00:00:00 2001 From: Elliot Berman Date: Tue, 16 Aug 2022 08:55:20 -0700 Subject: [PATCH 1/9] ANDROID: Guard rq_clock_task_mult with CONFIG_SMP rq->cpu only exists on CONFIG_SMP builds. PELT only needs to support SMP-enabled builds, so guard rq_clock_task_mult with CONFIG_SMP to support compilation of kernel without CONFIG_SMP enabled. Change-Id: I7779f5b10b44757dfd4cbc159b6ae3f3f1ddf3e7 Fixes: 93772777248d ("ANDROID: sched: Introducing PELT multiplier") Signed-off-by: Elliot Berman --- kernel/sched/sched.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 175d5f3ef58e..1069575c5a91 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1193,6 +1193,7 @@ static inline u64 rq_clock_task(struct rq *rq) return rq->clock_task; } +#ifdef CONFIG_SMP DECLARE_PER_CPU(u64, clock_task_mult); static inline u64 rq_clock_task_mult(struct rq *rq) @@ -1202,6 +1203,7 @@ static inline u64 rq_clock_task_mult(struct rq *rq) return per_cpu(clock_task_mult, rq->cpu); } +#endif /** * By default the decay is the default pelt decay period. From f6c94cfe8364e22e1c53e5fb99163f07dd1d5735 Mon Sep 17 00:00:00 2001 From: Carlos Llamas Date: Mon, 1 Aug 2022 18:25:11 +0000 Subject: [PATCH 2/9] FROMLIST: binder: fix UAF of ref->proc caused by race condition A transaction of type BINDER_TYPE_WEAK_HANDLE can fail to increment the reference for a node. In this case, the target proc normally releases the failed reference upon close as expected. However, if the target is dying in parallel the call will race with binder_deferred_release(), so the target could have released all of its references by now leaving the cleanup of the new failed reference unhandled. The transaction then ends and the target proc gets released making the ref->proc now a dangling pointer. Later on, ref->node is closed and we attempt to take spin_lock(&ref->proc->inner_lock), which leads to the use-after-free bug reported below. Let's fix this by cleaning up the failed reference on the spot instead of relying on the target to do so. ================================================================== BUG: KASAN: use-after-free in _raw_spin_lock+0xa8/0x150 Write of size 4 at addr ffff5ca207094238 by task kworker/1:0/590 CPU: 1 PID: 590 Comm: kworker/1:0 Not tainted 5.19.0-rc8 #10 Hardware name: linux,dummy-virt (DT) Workqueue: events binder_deferred_func Call trace: dump_backtrace.part.0+0x1d0/0x1e0 show_stack+0x18/0x70 dump_stack_lvl+0x68/0x84 print_report+0x2e4/0x61c kasan_report+0xa4/0x110 kasan_check_range+0xfc/0x1a4 __kasan_check_write+0x3c/0x50 _raw_spin_lock+0xa8/0x150 binder_deferred_func+0x5e0/0x9b0 process_one_work+0x38c/0x5f0 worker_thread+0x9c/0x694 kthread+0x188/0x190 ret_from_fork+0x10/0x20 Signed-off-by: Carlos Llamas Acked-by: Christian Brauner (Microsoft) Bug: 239630375 Link: https://lore.kernel.org/all/20220801182511.3371447-1-cmllamas@google.com/ Signed-off-by: Carlos Llamas Change-Id: I5085dd0dc805a780a64c057e5819f82dd8f02868 (cherry picked from commit ae3fa5d16a02ba7c7b170e0e1ab56d6f0ba33964) --- drivers/android/binder.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index 75cd8b927ad4..ba7d6a96514f 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -1504,6 +1504,18 @@ static int binder_inc_ref_for_node(struct binder_proc *proc, } ret = binder_inc_ref_olocked(ref, strong, target_list); *rdata = ref->data; + if (ret && ref == new_ref) { + /* + * Cleanup the failed reference here as the target + * could now be dead and have already released its + * references by now. Calling on the new reference + * with strong=0 and a tmp_refs will not decrement + * the node. The new_ref gets kfree'd below. + */ + binder_cleanup_ref_olocked(new_ref); + ref = NULL; + } + binder_proc_unlock(proc); if (new_ref && ref != new_ref) /* From 673c21e890430e27f61c179040db7c2021ea43c5 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Tue, 19 Jul 2022 12:52:51 +0100 Subject: [PATCH 3/9] FROMGIT: io_uring: Use original task for req identity in io_identity_cow() This issue is conceptually identical to the one fixed in 29f077d07051 ("io_uring: always use original task when preparing req identity"), so rather than reinvent the wheel, I'm shamelessly quoting the commit message from that patch - thanks Jens: "If the ring is setup with IORING_SETUP_IOPOLL and we have more than one task doing submissions on a ring, we can up in a situation where we assign the context from the current task rather than the request originator. Always use req->task rather than assume it's the same as current. No upstream patch exists for this issue, as only older kernels with the non-native workers have this problem." Bug: 238177383 Cc: Jens Axboe Cc: Pavel Begunkov Cc: Alexander Viro Cc: io-uring@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org Fixes: 5c3462cfd123b ("io_uring: store io_identity in io_uring_task") Signed-off-by: Lee Jones Signed-off-by: Greg Kroah-Hartman (cherry picked from commit 2ee0cab11f6626071f8a64c7792406dabdd94c8d git: //git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.10.y) Signed-off-by: Lee Jones Change-Id: I98adc653dbe03f8e9d214d9430fe50d351a45910 --- fs/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index b9e9046777db..25283f464d7e 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -1318,7 +1318,7 @@ static void io_req_clean_work(struct io_kiocb *req) */ static bool io_identity_cow(struct io_kiocb *req) { - struct io_uring_task *tctx = current->io_uring; + struct io_uring_task *tctx = req->task->io_uring; const struct cred *creds = NULL; struct io_identity *id; From b38f4656029ad93f6538361e3ae38e106798953a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?haibinzhang=20=28=E5=BC=A0=E6=B5=B7=E6=96=8C=29?= Date: Sat, 2 Jul 2022 05:43:19 +0000 Subject: [PATCH 4/9] FROMGIT: arm64: fix oops in concurrently setting insn_emulation sysctls emulation_proc_handler() changes table->data for proc_dointvec_minmax and can generate the following Oops if called concurrently with itself: | Unable to handle kernel NULL pointer dereference at virtual address 0000000000000010 | Internal error: Oops: 96000006 [#1] SMP | Call trace: | update_insn_emulation_mode+0xc0/0x148 | emulation_proc_handler+0x64/0xb8 | proc_sys_call_handler+0x9c/0xf8 | proc_sys_write+0x18/0x20 | __vfs_write+0x20/0x48 | vfs_write+0xe4/0x1d0 | ksys_write+0x70/0xf8 | __arm64_sys_write+0x20/0x28 | el0_svc_common.constprop.0+0x7c/0x1c0 | el0_svc_handler+0x2c/0xa0 | el0_svc+0x8/0x200 To fix this issue, keep the table->data as &insn->current_mode and use container_of() to retrieve the insn pointer. Another mutex is used to protect against the current_mode update but not for retrieving insn_emulation as table->data is no longer changing. Bug: 237540956 Co-developed-by: hewenliang Signed-off-by: hewenliang Signed-off-by: Haibin Zhang Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20220128090324.2727688-1-hewenliang4@huawei.com Link: https://lore.kernel.org/r/9A004C03-250B-46C5-BF39-782D7551B00E@tencent.com Signed-off-by: Will Deacon [Lee: Added Fixes: tag] (cherry picked from commit af483947d472eccb79e42059276c4deed76f99a6 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core) Fixes: 587064b610c7 ("arm64: Add framework for legacy instruction emulation") Signed-off-by: Lee Jones Change-Id: If9b96bb79c79903f9d8292e719b06fdef57ef1c5 --- arch/arm64/kernel/armv8_deprecated.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/arm64/kernel/armv8_deprecated.c b/arch/arm64/kernel/armv8_deprecated.c index 0e86e8b9cedd..c5da9d1e954a 100644 --- a/arch/arm64/kernel/armv8_deprecated.c +++ b/arch/arm64/kernel/armv8_deprecated.c @@ -59,6 +59,7 @@ struct insn_emulation { static LIST_HEAD(insn_emulation); static int nr_insn_emulated __initdata; static DEFINE_RAW_SPINLOCK(insn_emulation_lock); +static DEFINE_MUTEX(insn_emulation_mutex); static void register_emulation_hooks(struct insn_emulation_ops *ops) { @@ -207,10 +208,10 @@ static int emulation_proc_handler(struct ctl_table *table, int write, loff_t *ppos) { int ret = 0; - struct insn_emulation *insn = (struct insn_emulation *) table->data; + struct insn_emulation *insn = container_of(table->data, struct insn_emulation, current_mode); enum insn_emulation_mode prev_mode = insn->current_mode; - table->data = &insn->current_mode; + mutex_lock(&insn_emulation_mutex); ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos); if (ret || !write || prev_mode == insn->current_mode) @@ -223,7 +224,7 @@ static int emulation_proc_handler(struct ctl_table *table, int write, update_insn_emulation_mode(insn, INSN_UNDEF); } ret: - table->data = insn; + mutex_unlock(&insn_emulation_mutex); return ret; } @@ -247,7 +248,7 @@ static void __init register_insn_emulation_sysctl(void) sysctl->maxlen = sizeof(int); sysctl->procname = insn->ops->name; - sysctl->data = insn; + sysctl->data = &insn->current_mode; sysctl->extra1 = &insn->min; sysctl->extra2 = &insn->max; sysctl->proc_handler = emulation_proc_handler; From 9b37d6f4e9d44f0c5f2ffe4c4a8ac5cd2be38d2e Mon Sep 17 00:00:00 2001 From: Bing Han Date: Thu, 18 Aug 2022 15:35:24 +0800 Subject: [PATCH 5/9] ANDROID: vendor_hook: Add hook in si_swapinfo() This reverts commit 86be1a3d9f5a43437b9d1815a6014b4be96e1349 The hook android_vh_si_swapinfo is deleted, due to the symbol is not added to the abi list. The symbol is added to the abi list in patch:2183484. This patch is to add the hook android_vh_si_swapinfo again. Bug: 234214858 Bug: 203756332 Cc: Greg Kroah-Hartman Signed-off-by: Bing Han Change-Id: Ifd1e05f44ac04b67816618139badd5c2ee786b50 --- drivers/android/vendor_hooks.c | 3 --- include/trace/hooks/mm.h | 9 --------- 2 files changed, 12 deletions(-) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index c43d1cd06928..973389f942a9 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -426,8 +426,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_inactive_is_low); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_snapshot_refaults); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_account_swap_pages); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_unuse_swap_page); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_init_swap_info_struct); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_si_swapinfo); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_si); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_pages); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_shmem_page_flag); diff --git a/include/trace/hooks/mm.h b/include/trace/hooks/mm.h index 3f2784c6a0e5..3f847176676e 100644 --- a/include/trace/hooks/mm.h +++ b/include/trace/hooks/mm.h @@ -203,18 +203,9 @@ DECLARE_HOOK(android_vh_account_swap_pages, DECLARE_HOOK(android_vh_unuse_swap_page, TP_PROTO(struct swap_info_struct *si, struct page *page), TP_ARGS(si, page)); -DECLARE_HOOK(android_vh_init_swap_info_struct, - TP_PROTO(struct swap_info_struct *p, struct plist_head *swap_avail_heads), - TP_ARGS(p, swap_avail_heads)); DECLARE_HOOK(android_vh_si_swapinfo, TP_PROTO(struct swap_info_struct *si, bool *skip), TP_ARGS(si, skip)); -DECLARE_HOOK(android_vh_alloc_si, - TP_PROTO(struct swap_info_struct **p, bool *skip), - TP_ARGS(p, skip)); -DECLARE_HOOK(android_vh_free_pages, - TP_PROTO(struct page *page, unsigned int order), - TP_ARGS(page, order)); DECLARE_HOOK(android_vh_set_shmem_page_flag, TP_PROTO(struct page *page), TP_ARGS(page)); From 992dbdb58c67cf24c0c39c8d1f744b9656578bd9 Mon Sep 17 00:00:00 2001 From: Bing Han Date: Thu, 18 Aug 2022 15:37:32 +0800 Subject: [PATCH 6/9] ANDROID: vendor_hooks: Add hooks to extend the struct swap_info_struct This reverts commit: d0590b99c9946526ee434a33c47d69056d137e06 The hooks android_vh_init_swap_info_struct and android_vh_alloc_si are deleted, due to the symbols are not added to the abi list. The symbols are added to the abi list in patch:2183484. This patch is to add the hooks android_vh_init_swap_info_struct and android_vh_alloc_si again. Bug: 234214858 Bug: 203756332 Cc: Greg Kroah-Hartman Signed-off-by: Bing Han Change-Id: Id5524a726d213c5eab55570fd28d28da978974e7 --- drivers/android/vendor_hooks.c | 2 ++ include/trace/hooks/mm.h | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 973389f942a9..4061fdc915f4 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -426,5 +426,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_inactive_is_low); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_snapshot_refaults); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_account_swap_pages); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_unuse_swap_page); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_init_swap_info_struct); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_si_swapinfo); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_si); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_shmem_page_flag); diff --git a/include/trace/hooks/mm.h b/include/trace/hooks/mm.h index 3f847176676e..80d201364eae 100644 --- a/include/trace/hooks/mm.h +++ b/include/trace/hooks/mm.h @@ -203,9 +203,15 @@ DECLARE_HOOK(android_vh_account_swap_pages, DECLARE_HOOK(android_vh_unuse_swap_page, TP_PROTO(struct swap_info_struct *si, struct page *page), TP_ARGS(si, page)); +DECLARE_HOOK(android_vh_init_swap_info_struct, + TP_PROTO(struct swap_info_struct *p, struct plist_head *swap_avail_heads), + TP_ARGS(p, swap_avail_heads)); DECLARE_HOOK(android_vh_si_swapinfo, TP_PROTO(struct swap_info_struct *si, bool *skip), TP_ARGS(si, skip)); +DECLARE_HOOK(android_vh_alloc_si, + TP_PROTO(struct swap_info_struct **p, bool *skip), + TP_ARGS(p, skip)); DECLARE_HOOK(android_vh_set_shmem_page_flag, TP_PROTO(struct page *page), TP_ARGS(page)); From ed2998e8dd3182bc2ef30d9a17e8ec136ce4890a Mon Sep 17 00:00:00 2001 From: Bing Han Date: Thu, 18 Aug 2022 15:38:58 +0800 Subject: [PATCH 7/9] ANDROID: vendor_hook: Add hook in __free_pages() This reverts commit eb99e6d80ee21eb061c55cdf14c0b05e0c61af4d The hook android_vh_free_pages is deleted, due to the symbol is not added to the abi list. The symbol is added to the abi list in patch:2183484. This patch is to add the hook android_vh_free_pages again. Bug: 234214858 Bug: 203756332 Cc: Greg Kroah-Hartman Signed-off-by: Bing Han Change-Id: I2c97ea4d310e2004b94d891678127c17f7b07c93 --- drivers/android/vendor_hooks.c | 1 + include/trace/hooks/mm.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 4061fdc915f4..c43d1cd06928 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -429,4 +429,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_unuse_swap_page); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_init_swap_info_struct); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_si_swapinfo); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_si); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_pages); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_shmem_page_flag); diff --git a/include/trace/hooks/mm.h b/include/trace/hooks/mm.h index 80d201364eae..3f2784c6a0e5 100644 --- a/include/trace/hooks/mm.h +++ b/include/trace/hooks/mm.h @@ -212,6 +212,9 @@ DECLARE_HOOK(android_vh_si_swapinfo, DECLARE_HOOK(android_vh_alloc_si, TP_PROTO(struct swap_info_struct **p, bool *skip), TP_ARGS(p, skip)); +DECLARE_HOOK(android_vh_free_pages, + TP_PROTO(struct page *page, unsigned int order), + TP_ARGS(page, order)); DECLARE_HOOK(android_vh_set_shmem_page_flag, TP_PROTO(struct page *page), TP_ARGS(page)); From 2c814f559132d8b623207b2145d25a264f6c4ae1 Mon Sep 17 00:00:00 2001 From: Bing Han Date: Thu, 18 Aug 2022 12:20:58 +0800 Subject: [PATCH 8/9] ANDROID: GKI: Update symbol list for transsion Leaf changes summary: 52 artifacts changed Changed leaf types summary: 0 leaf type changed Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 26 Added functions Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 26 Added variables 26 Added functions: [A] 'function int __traceiter_android_vh_account_swap_pages(void*, swap_info_struct*, bool*)' [A] 'function int __traceiter_android_vh_alloc_si(void*, swap_info_struct**, bool*)' [A] 'function int __traceiter_android_vh_alloc_swap_slot_cache(void*, swap_slots_cache*, int*, bool*)' [A] 'function int __traceiter_android_vh_count_pswpin(void*, swap_info_struct*)' [A] 'function int __traceiter_android_vh_count_pswpout(void*, swap_info_struct*)' [A] 'function int __traceiter_android_vh_count_swpout_vm_event(void*, swap_info_struct*, page*, bool*)' [A] 'function int __traceiter_android_vh_cow_user_page(void*, vm_fault*, page*)' [A] 'function int __traceiter_android_vh_drain_slots_cache_cpu(void*, swap_slots_cache*, unsigned int, bool, bool*)' [A] 'function int __traceiter_android_vh_free_pages(void*, page*, unsigned int)' [A] 'function int __traceiter_android_vh_free_swap_slot(void*, swp_entry_t, swap_slots_cache*, bool*)' [A] 'function int __traceiter_android_vh_get_swap_page(void*, page*, swp_entry_t*, swap_slots_cache*, bool*)' [A] 'function int __traceiter_android_vh_handle_pte_fault_end(void*, vm_fault*, unsigned long int)' [A] 'function int __traceiter_android_vh_inactive_is_low(void*, unsigned long int, unsigned long int*, lru_list, bool*)' [A] 'function int __traceiter_android_vh_init_swap_info_struct(void*, swap_info_struct*, plist_head*)' [A] 'function int __traceiter_android_vh_migrate_page_states(void*, page*, page*)' [A] 'function int __traceiter_android_vh_page_isolated_for_reclaim(void*, mm_struct*, page*)' [A] 'function int __traceiter_android_vh_page_referenced_one_end(void*, vm_area_struct*, page*, int)' [A] 'function int __traceiter_android_vh_set_shmem_page_flag(void*, page*)' [A] 'function int __traceiter_android_vh_si_swapinfo(void*, swap_info_struct*, bool*)' [A] 'function int __traceiter_android_vh_snapshot_refaults(void*, lruvec*)' [A] 'function int __traceiter_android_vh_swap_slot_cache_active(void*, bool)' [A] 'function int __traceiter_android_vh_swapin_add_anon_rmap(void*, vm_fault*, page*)' [A] 'function int __traceiter_android_vh_unuse_swap_page(void*, swap_info_struct*, page*)' [A] 'function int __traceiter_android_vh_waiting_for_page_migration(void*, page*)' [A] 'function void plist_del(plist_node*, plist_head*)' [A] 'function void plist_requeue(plist_node*, plist_head*)' 26 Added variables: [A] 'tracepoint __tracepoint_android_vh_account_swap_pages' [A] 'tracepoint __tracepoint_android_vh_alloc_si' [A] 'tracepoint __tracepoint_android_vh_alloc_swap_slot_cache' [A] 'tracepoint __tracepoint_android_vh_count_pswpin' [A] 'tracepoint __tracepoint_android_vh_count_pswpout' [A] 'tracepoint __tracepoint_android_vh_count_swpout_vm_event' [A] 'tracepoint __tracepoint_android_vh_cow_user_page' [A] 'tracepoint __tracepoint_android_vh_drain_slots_cache_cpu' [A] 'tracepoint __tracepoint_android_vh_free_pages' [A] 'tracepoint __tracepoint_android_vh_free_swap_slot' [A] 'tracepoint __tracepoint_android_vh_get_swap_page' [A] 'tracepoint __tracepoint_android_vh_handle_pte_fault_end' [A] 'tracepoint __tracepoint_android_vh_inactive_is_low' [A] 'tracepoint __tracepoint_android_vh_init_swap_info_struct' [A] 'tracepoint __tracepoint_android_vh_migrate_page_states' [A] 'tracepoint __tracepoint_android_vh_page_isolated_for_reclaim' [A] 'tracepoint __tracepoint_android_vh_page_referenced_one_end' [A] 'tracepoint __tracepoint_android_vh_set_shmem_page_flag' [A] 'tracepoint __tracepoint_android_vh_si_swapinfo' [A] 'tracepoint __tracepoint_android_vh_snapshot_refaults' [A] 'tracepoint __tracepoint_android_vh_swap_slot_cache_active' [A] 'tracepoint __tracepoint_android_vh_swapin_add_anon_rmap' [A] 'tracepoint __tracepoint_android_vh_unuse_swap_page' [A] 'tracepoint __tracepoint_android_vh_waiting_for_page_migration' [A] 'atomic_long_t nr_swap_pages' [A] 'unsigned long int zero_pfn' Bug: 234214858 Signed-off-by: Bing Han Change-Id: I7e1764ee1bbd2e44bb67933024d89520ba48da22 --- android/abi_gki_aarch64.xml | 1476 +++++++++++++++++------------ android/abi_gki_aarch64_transsion | 52 + 2 files changed, 935 insertions(+), 593 deletions(-) diff --git a/android/abi_gki_aarch64.xml b/android/abi_gki_aarch64.xml index fbbcdb424bf5..913dd9b4484f 100644 --- a/android/abi_gki_aarch64.xml +++ b/android/abi_gki_aarch64.xml @@ -389,10 +389,13 @@ + + + @@ -435,6 +438,10 @@ + + + + @@ -447,6 +454,7 @@ + @@ -458,6 +466,8 @@ + + @@ -470,9 +480,13 @@ + + + + @@ -495,6 +509,7 @@ + @@ -506,7 +521,9 @@ + + @@ -540,6 +557,7 @@ + @@ -550,9 +568,13 @@ + + + + @@ -577,12 +599,14 @@ + + @@ -4081,6 +4105,8 @@ + + @@ -6176,10 +6202,13 @@ + + + @@ -6222,6 +6251,10 @@ + + + + @@ -6234,6 +6267,7 @@ + @@ -6246,6 +6280,8 @@ + + @@ -6258,10 +6294,14 @@ + + + + @@ -6285,6 +6325,7 @@ + @@ -6297,7 +6338,9 @@ + + @@ -6340,6 +6383,7 @@ + @@ -6351,10 +6395,14 @@ + + + + @@ -6381,6 +6429,7 @@ + @@ -6388,6 +6437,7 @@ + @@ -6559,6 +6609,7 @@ + @@ -6641,6 +6692,7 @@ + @@ -6934,7 +6986,7 @@ - + @@ -7814,6 +7866,15 @@ + + + + + + + + + @@ -8280,7 +8341,7 @@ - + @@ -9694,21 +9755,21 @@ - + - + - + - + - + - + @@ -14864,15 +14925,15 @@ - + - + - + - + @@ -15002,24 +15063,24 @@ - + - + - + - + - + - + - + @@ -17641,102 +17702,102 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -30552,18 +30613,18 @@ - + - + - + - + - + @@ -47037,36 +47098,36 @@ - + - + - + - + - + - + - + - + - + - + - + @@ -48380,12 +48441,12 @@ - + - + - + @@ -50408,18 +50469,18 @@ - + - + - + - + - + @@ -50807,6 +50868,7 @@ + @@ -50822,12 +50884,12 @@ - + - + - + @@ -51182,6 +51244,7 @@ + @@ -52649,81 +52712,81 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -52968,12 +53031,12 @@ - + - + - + @@ -56574,18 +56637,18 @@ - + - + - + - + - + @@ -59829,9 +59892,9 @@ - + - + @@ -60539,12 +60602,12 @@ - + - + - + @@ -60719,7 +60782,7 @@ - + @@ -62359,24 +62422,24 @@ - + - + - + - + - + - + - + @@ -65484,33 +65547,33 @@ - + - + - + - + - + - + - + - + - + - + @@ -73495,6 +73558,7 @@ + @@ -73538,54 +73602,54 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -74354,21 +74418,21 @@ - + - + - + - + - + - + @@ -76231,120 +76295,120 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -76905,18 +76969,18 @@ - + - + - + - + - + @@ -82406,54 +82470,54 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -82738,12 +82802,12 @@ - + - + - + @@ -85042,12 +85106,12 @@ - + - + - + @@ -88273,6 +88337,7 @@ + @@ -92024,7 +92089,20 @@ - + + + + + + + + + + + + + + @@ -93269,9 +93347,9 @@ - + - + @@ -99981,12 +100059,12 @@ - + - + - + @@ -100014,12 +100092,12 @@ - + - + - + @@ -103584,21 +103662,21 @@ - + - + - + - + - + - + @@ -105607,92 +105685,92 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -106515,66 +106593,66 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -106757,7 +106835,35 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -112345,99 +112451,99 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -116556,12 +116662,12 @@ - - - - - - + + + + + + @@ -117062,19 +117168,19 @@ - - - - - + + + + + - - - - - - + + + + + + @@ -117154,6 +117260,12 @@ + + + + + + @@ -117185,6 +117297,19 @@ + + + + + + + + + + + + + @@ -117222,148 +117347,148 @@ - - - - - + + + + + - - - - + + + + - - - + + + - - - - - + + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - - - - + + + + + + - - - - + + + + - - - - - - - - - - - + + - - - - - + + + + + + + + - - - - - - + + + + - - - - + + + + + + - - - - + + + + - - - - - + + + + - - - - + + + + + - - - - - - + + + + - - - + + + + + + - - - - - + + + - - - - - + + + + + + + + + + + + @@ -117469,6 +117594,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -117549,6 +117697,14 @@ + + + + + + + + @@ -117621,6 +117777,19 @@ + + + + + + + + + + + + + @@ -117692,6 +117861,14 @@ + + + + + + + + @@ -117703,6 +117880,20 @@ + + + + + + + + + + + + + + @@ -117710,6 +117901,12 @@ + + + + + + @@ -117847,6 +118044,12 @@ + + + + + + @@ -117863,29 +118066,29 @@ - - - - - + + + + + - - - + + + - - - - - + + + + + - - - - + + + + @@ -117915,6 +118118,12 @@ + + + + + + @@ -117923,6 +118132,13 @@ + + + + + + + @@ -118042,15 +118258,15 @@ - - - + + + - - - - + + + + @@ -118116,6 +118332,11 @@ + + + + + @@ -118181,6 +118402,17 @@ + + + + + + + + + + + @@ -118199,10 +118431,21 @@ - - - - + + + + + + + + + + + + + + + @@ -118253,41 +118496,41 @@ - - - - - + + + + + - - - - - + + + + + - - - - - - - - + + + + + + + + - - - - - + + + + + - - - - + + + + @@ -118356,6 +118599,12 @@ + + + + + + @@ -118398,6 +118647,11 @@ + + + + + @@ -118801,7 +119055,7 @@ - + @@ -118887,8 +119141,8 @@ - - + + @@ -118902,36 +119156,39 @@ + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + @@ -118948,6 +119205,10 @@ + + + + @@ -118960,6 +119221,7 @@ + @@ -118972,6 +119234,8 @@ + + @@ -118984,10 +119248,14 @@ + + + + @@ -119011,19 +119279,22 @@ + - - - - + + + + + + @@ -119053,8 +119324,8 @@ - - + + @@ -119066,6 +119337,7 @@ + @@ -119077,11 +119349,15 @@ + + - + + + @@ -119092,11 +119368,11 @@ - - - - - + + + + + @@ -119107,6 +119383,7 @@ + @@ -119114,6 +119391,7 @@ + @@ -121357,26 +121635,26 @@ - - - + + + - - - - - + + + + + - - - + + + - - - + + + @@ -122765,14 +123043,14 @@ - - - + + + - - - + + + @@ -128182,10 +128460,10 @@ - - - - + + + + @@ -131501,19 +131779,19 @@ - - + + - - - + + + - - - - + + + + @@ -131546,17 +131824,17 @@ - - + + - - - + + + @@ -131624,8 +131902,8 @@ - - + + @@ -134602,6 +134880,7 @@ + @@ -137117,6 +137396,16 @@ + + + + + + + + + + @@ -137977,8 +138266,8 @@ - - + + @@ -140357,27 +140646,27 @@ - - - - + + + + - - - + + + - - - - + + + + - - - - + + + + @@ -143299,11 +143588,11 @@ - - - - - + + + + + @@ -147223,6 +147512,7 @@ + diff --git a/android/abi_gki_aarch64_transsion b/android/abi_gki_aarch64_transsion index 7538d32cf51b..648b5a445e8b 100644 --- a/android/abi_gki_aarch64_transsion +++ b/android/abi_gki_aarch64_transsion @@ -6,3 +6,55 @@ scan_swap_map_slots swap_alloc_cluster check_cache_active + zero_pfn + nr_swap_pages + plist_requeue + plist_del + __traceiter_android_vh_handle_pte_fault_end + __traceiter_android_vh_cow_user_page + __traceiter_android_vh_swapin_add_anon_rmap + __traceiter_android_vh_waiting_for_page_migration + __traceiter_android_vh_migrate_page_states + __traceiter_android_vh_page_referenced_one_end + __traceiter_android_vh_count_pswpin + __traceiter_android_vh_count_pswpout + __traceiter_android_vh_count_swpout_vm_event + __traceiter_android_vh_swap_slot_cache_active + __traceiter_android_vh_drain_slots_cache_cpu + __traceiter_android_vh_alloc_swap_slot_cache + __traceiter_android_vh_free_swap_slot + __traceiter_android_vh_get_swap_page + __traceiter_android_vh_page_isolated_for_reclaim + __traceiter_android_vh_inactive_is_low + __traceiter_android_vh_snapshot_refaults + __traceiter_android_vh_account_swap_pages + __traceiter_android_vh_unuse_swap_page + __traceiter_android_vh_init_swap_info_struct + __traceiter_android_vh_si_swapinfo + __traceiter_android_vh_alloc_si + __traceiter_android_vh_free_pages + __traceiter_android_vh_set_shmem_page_flag + __tracepoint_android_vh_handle_pte_fault_end + __tracepoint_android_vh_cow_user_page + __tracepoint_android_vh_swapin_add_anon_rmap + __tracepoint_android_vh_waiting_for_page_migration + __tracepoint_android_vh_migrate_page_states + __tracepoint_android_vh_page_referenced_one_end + __tracepoint_android_vh_count_pswpin + __tracepoint_android_vh_count_pswpout + __tracepoint_android_vh_count_swpout_vm_event + __tracepoint_android_vh_swap_slot_cache_active + __tracepoint_android_vh_drain_slots_cache_cpu + __tracepoint_android_vh_alloc_swap_slot_cache + __tracepoint_android_vh_free_swap_slot + __tracepoint_android_vh_get_swap_page + __tracepoint_android_vh_page_isolated_for_reclaim + __tracepoint_android_vh_inactive_is_low + __tracepoint_android_vh_snapshot_refaults + __tracepoint_android_vh_account_swap_pages + __tracepoint_android_vh_unuse_swap_page + __tracepoint_android_vh_init_swap_info_struct + __tracepoint_android_vh_si_swapinfo + __tracepoint_android_vh_alloc_si + __tracepoint_android_vh_free_pages + __tracepoint_android_vh_set_shmem_page_flag \ No newline at end of file From 6759e5ca02c57d87bbc424a2da537907c0eb17ad Mon Sep 17 00:00:00 2001 From: Elliot Berman Date: Wed, 17 Aug 2022 10:30:58 -0700 Subject: [PATCH 9/9] ANDROID: Use rq_clock_task without CONFIG_SMP Fix build error caused by guarding rq_clock_task_mult with CONFIG_SMP. Issue was not seen in original commit as test case was UM Linux, which does not enable CONFIG_CFS_BANDWIDTH. >> kernel/sched/fair.c:4791:40: error: implicit declaration of function 'rq_clock_task_mult' [-Werror,-Wimplicit-function-declaration] cfs_rq->throttled_clock_task_time += rq_clock_task_mult(rq) - Change-Id: Id3392c37ba1b2bfe78c89bc4b1ca01b920164a35 Reported-by: kernel test robot Fixes: 567d65e53644 ("ANDROID: Guard rq_clock_task_mult with CONFIG_SMP") Signed-off-by: Elliot Berman (cherry picked from commit 04c766fa7690fc18178eb78293a733630789c138) --- kernel/sched/sched.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 1069575c5a91..d9606c4bf219 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1203,6 +1203,11 @@ static inline u64 rq_clock_task_mult(struct rq *rq) return per_cpu(clock_task_mult, rq->cpu); } +#else +static inline u64 rq_clock_task_mult(struct rq *rq) +{ + return rq_clock_task(rq); +} #endif /**