From 8d3d29f0729af71df257e2a90f6b612bb57f6078 Mon Sep 17 00:00:00 2001 From: Todd Kjos Date: Fri, 9 Oct 2020 16:24:55 -0700 Subject: [PATCH 01/33] UPSTREAM: binder: fix UAF when releasing todo list When releasing a thread todo list when tearing down a binder_proc, the following race was possible which could result in a use-after-free: 1. Thread 1: enter binder_release_work from binder_thread_release 2. Thread 2: binder_update_ref_for_handle() -> binder_dec_node_ilocked() 3. Thread 2: dec nodeA --> 0 (will free node) 4. Thread 1: ACQ inner_proc_lock 5. Thread 2: block on inner_proc_lock 6. Thread 1: dequeue work (BINDER_WORK_NODE, part of nodeA) 7. Thread 1: REL inner_proc_lock 8. Thread 2: ACQ inner_proc_lock 9. Thread 2: todo list cleanup, but work was already dequeued 10. Thread 2: free node 11. Thread 2: REL inner_proc_lock 12. Thread 1: deref w->type (UAF) The problem was that for a BINDER_WORK_NODE, the binder_work element must not be accessed after releasing the inner_proc_lock while processing the todo list elements since another thread might be handling a deref on the node containing the binder_work element leading to the node being freed. Signed-off-by: Todd Kjos Link: https://lore.kernel.org/r/20201009232455.4054810-1-tkjos@google.com Cc: # 4.14, 4.19, 5.4, 5.8 Signed-off-by: Greg Kroah-Hartman (cherry picked from commit f3277cbfba763cd2826396521b9296de67cf1bbc) Signed-off-by: Greg Kroah-Hartman Change-Id: I7c1bf0b74824f272664e76206c5dc3b66b9eeaff --- drivers/android/binder.c | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index 02df51ede095..85a6a7cb3cd1 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -230,7 +230,7 @@ static struct binder_transaction_log_entry *binder_transaction_log_add( struct binder_work { struct list_head entry; - enum { + enum binder_work_type { BINDER_WORK_TRANSACTION = 1, BINDER_WORK_TRANSACTION_COMPLETE, BINDER_WORK_RETURN_ERROR, @@ -917,27 +917,6 @@ static struct binder_work *binder_dequeue_work_head_ilocked( return w; } -/** - * binder_dequeue_work_head() - Dequeues the item at head of list - * @proc: binder_proc associated with list - * @list: list to dequeue head - * - * Removes the head of the list if there are items on the list - * - * Return: pointer dequeued binder_work, NULL if list was empty - */ -static struct binder_work *binder_dequeue_work_head( - struct binder_proc *proc, - struct list_head *list) -{ - struct binder_work *w; - - binder_inner_proc_lock(proc); - w = binder_dequeue_work_head_ilocked(list); - binder_inner_proc_unlock(proc); - return w; -} - static void binder_defer_work(struct binder_proc *proc, enum binder_deferred_state defer); static void binder_free_thread(struct binder_thread *thread); @@ -4753,13 +4732,17 @@ static void binder_release_work(struct binder_proc *proc, struct list_head *list) { struct binder_work *w; + enum binder_work_type wtype; while (1) { - w = binder_dequeue_work_head(proc, list); + binder_inner_proc_lock(proc); + w = binder_dequeue_work_head_ilocked(list); + wtype = w ? w->type : 0; + binder_inner_proc_unlock(proc); if (!w) return; - switch (w->type) { + switch (wtype) { case BINDER_WORK_TRANSACTION: { struct binder_transaction *t; @@ -4793,9 +4776,11 @@ static void binder_release_work(struct binder_proc *proc, kfree(death); binder_stats_deleted(BINDER_STAT_DEATH); } break; + case BINDER_WORK_NODE: + break; default: pr_err("unexpected work type, %d, not freed\n", - w->type); + wtype); break; } } From 205650744e175d581a549181b0345d8b0f0b2cfa Mon Sep 17 00:00:00 2001 From: Ravikanth Tuniki Date: Fri, 16 Oct 2020 15:48:51 +0530 Subject: [PATCH 02/33] ANDROID: ABI: update allowed list for QCOM Update the android/abi_gki_aarch64_qcom with recent symbol additions. Simple change and no need to update the .xml file, as no new symbol addition. Bug: 171100523 Change-Id: I5083548f18633b66b76d525209c52b4c44eded75 Signed-off-by: Ravikanth Tuniki --- android/abi_gki_aarch64_qcom | 3 +++ 1 file changed, 3 insertions(+) diff --git a/android/abi_gki_aarch64_qcom b/android/abi_gki_aarch64_qcom index 6c2539bdd013..ec52822cc991 100644 --- a/android/abi_gki_aarch64_qcom +++ b/android/abi_gki_aarch64_qcom @@ -870,6 +870,7 @@ find_next_zero_bit find_snd_usb_substream find_vma + find_vpid finish_wait firmware_request_nowarn flow_keys_basic_dissector @@ -1665,6 +1666,7 @@ phy_start phy_stop physvirt_offset + pid_task pinconf_generic_dt_node_to_map pinctrl_dev_get_drvdata pinctrl_force_default @@ -1975,6 +1977,7 @@ sched_clock sched_setattr sched_setscheduler + sched_setscheduler_nocheck schedule schedule_timeout schedule_timeout_interruptible From cbd55f8de66b64054669601d75184ae011a1523c Mon Sep 17 00:00:00 2001 From: Jaehyoung Choi Date: Mon, 19 Oct 2020 11:38:38 +0900 Subject: [PATCH 03/33] ANDROID: GKI: Update abi_gki_aarch64_exynos Leaf changes summary: 19 artifacts changed Changed leaf types summary: 0 leaf type changed Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 19 Added functions Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable 19 Added functions: [A] 'function void __sock_recv_timestamp(msghdr*, sock*, sk_buff*)' [A] 'function void __sock_recv_wifi_status(msghdr*, sock*, sk_buff*)' [A] 'function void __wake_up_locked_key(wait_queue_head*, unsigned int, void*)' [A] 'function void __wake_up_sync(wait_queue_head*, unsigned int, int)' [A] 'function void add_wait_queue_exclusive(wait_queue_head*, wait_queue_entry*)' [A] 'function bool cfg80211_chandef_valid(const cfg80211_chan_def*)' [A] 'function void cfg80211_conn_failed(net_device*, const u8*, nl80211_connect_failed_reason, gfp_t)' [A] 'function void cfg80211_ref_bss(wiphy*, cfg80211_bss*)' [A] 'function int dev_vprintk_emit(int, const device*, const char*, va_list)' [A] 'function nlattr** genl_family_attrbuf(const genl_family*)' [A] 'function int genlmsg_multicast_allns(const genl_family*, sk_buff*, u32, unsigned int, gfp_t)' [A] 'function i2c_client* i2c_new_device(i2c_adapter*, const i2c_board_info*)' [A] 'function int iio_convert_raw_to_processed(iio_channel*, int, int*, unsigned int)' [A] 'function int iio_get_channel_type(iio_channel*, iio_chan_type*)' [A] 'function bool rfkill_blocked(rfkill*)' [A] 'function int rtc_add_group(rtc_device*, const attribute_group*)' [A] 'function int rtc_set_time(rtc_device*, rtc_time*)' [A] 'function int snd_soc_dai_set_tristate(snd_soc_dai*, int)' [A] 'function int vprintk_emit(int, int, const char*, size_t, const char*, va_list)' Bug: 171029675 Signed-off-by: Jaehyoung Choi Change-Id: Ib4cc16e6ba55e4ba135ace7784aaaaf0eac4c00f --- android/abi_gki_aarch64.xml | 489 ++++++++++++++++++++++----------- android/abi_gki_aarch64_exynos | 87 ++++++ 2 files changed, 410 insertions(+), 166 deletions(-) diff --git a/android/abi_gki_aarch64.xml b/android/abi_gki_aarch64.xml index 88042d5b20bc..18c8c69aeec7 100644 --- a/android/abi_gki_aarch64.xml +++ b/android/abi_gki_aarch64.xml @@ -215,7 +215,9 @@ + + @@ -250,6 +252,8 @@ + + @@ -299,6 +303,7 @@ + @@ -522,7 +527,9 @@ + + @@ -544,6 +551,7 @@ + @@ -857,6 +865,7 @@ + @@ -1569,9 +1578,11 @@ + + @@ -1717,6 +1728,7 @@ + @@ -1821,11 +1833,13 @@ + + @@ -3025,6 +3039,7 @@ + @@ -3065,10 +3080,12 @@ + + @@ -3427,6 +3444,7 @@ + @@ -4206,6 +4224,7 @@ + @@ -15298,7 +15317,6 @@ - @@ -15318,6 +15336,20 @@ + + + + + + + + + + + + + + @@ -16102,6 +16134,8 @@ + + @@ -16915,7 +16949,7 @@ - + @@ -17032,7 +17066,7 @@ - + @@ -17092,8 +17126,8 @@ - - + + @@ -22722,6 +22756,13 @@ + + + + + + + @@ -31299,7 +31340,6 @@ - @@ -32094,7 +32134,6 @@ - @@ -39744,6 +39783,8 @@ + + @@ -39760,6 +39801,11 @@ + + + + + @@ -40797,6 +40843,7 @@ + @@ -40827,11 +40874,23 @@ + + + + + + + + + + + + @@ -53967,6 +54026,14 @@ + + + + + + + + @@ -55229,14 +55296,6 @@ - - - - - - - - @@ -55987,6 +56046,17 @@ + + + + + + + + + + + @@ -59320,7 +59390,7 @@ - + @@ -59645,17 +59715,6 @@ - - - - - - - - - - - @@ -64203,6 +64262,17 @@ + + + + + + + + + + + @@ -64365,7 +64435,7 @@ - + @@ -64411,8 +64481,6 @@ - - @@ -70760,6 +70828,20 @@ + + + + + + + + + + + + + + @@ -70902,6 +70984,7 @@ + @@ -71066,6 +71149,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -88232,14 +88339,6 @@ - - - - - - - - @@ -88251,6 +88350,20 @@ + + + + + + + + + + + + + + @@ -92758,6 +92871,8 @@ + + @@ -92803,6 +92918,15 @@ + + + + + + + + + @@ -93072,7 +93196,7 @@ - + @@ -93298,6 +93422,7 @@ + @@ -99520,13 +99645,13 @@ - + - + - + @@ -99568,7 +99693,7 @@ - + @@ -103731,7 +103856,7 @@ - + @@ -103747,7 +103872,7 @@ - + @@ -103755,7 +103880,7 @@ - + @@ -103769,7 +103894,7 @@ - + @@ -103800,6 +103925,11 @@ + + + + + @@ -103813,6 +103943,18 @@ + + + + + + + + + + + + @@ -107618,6 +107760,10 @@ + + + + @@ -108670,29 +108816,7 @@ - - - - - - - - - - - - - - - - - - - - - - - + @@ -108985,7 +109109,7 @@ - + @@ -109029,18 +109153,18 @@ - + - + - + @@ -109167,32 +109291,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -111460,6 +111558,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -111484,6 +111607,7 @@ + @@ -114128,7 +114252,7 @@ - + @@ -116334,6 +116458,25 @@ + + + + + + + + + + + + + + + + + + + @@ -116383,11 +116526,11 @@ - + - + @@ -116399,29 +116542,41 @@ - + - + - - + + - + + + + + + + + + + + + + @@ -116510,17 +116665,6 @@ - - - - - - - - - - - @@ -116932,6 +117076,25 @@ + + + + + + + + + + + + + + + + + + + @@ -116947,6 +117110,18 @@ + + + + + + + + + + + + @@ -121642,14 +121817,6 @@ - - - - - - - - @@ -122094,6 +122261,11 @@ + + + + + @@ -122180,6 +122352,13 @@ + + + + + + + @@ -122367,6 +122546,8 @@ + + @@ -122390,6 +122571,10 @@ + + + + @@ -122922,6 +123107,11 @@ + + + + + @@ -123089,44 +123279,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -128225,6 +128377,11 @@ + + + + + @@ -129380,6 +129537,6 @@ diff --git a/android/abi_gki_aarch64_exynos b/android/abi_gki_aarch64_exynos index 0b41a3f16cad..3e86b71f22cd 100644 --- a/android/abi_gki_aarch64_exynos +++ b/android/abi_gki_aarch64_exynos @@ -3,6 +3,7 @@ add_timer_on add_uevent_var add_wait_queue + add_wait_queue_exclusive adjust_managed_page_count alarm_cancel alarm_init @@ -34,6 +35,7 @@ _bcd2bin bcmp _bin2bcd + bin2hex bio_crypt_should_process __bitmap_clear __bitmap_parse @@ -56,6 +58,7 @@ bpf_trace_run6 bpf_trace_run7 bpf_trace_run9 + __break_lease build_skb bus_find_device bus_for_each_dev @@ -78,9 +81,11 @@ __cfg80211_alloc_event_skb __cfg80211_alloc_reply_skb cfg80211_chandef_create + cfg80211_chandef_valid cfg80211_ch_switch_notify cfg80211_classify8021d cfg80211_connect_done + cfg80211_conn_failed cfg80211_del_sta_sinfo cfg80211_disconnected cfg80211_external_auth_request @@ -93,6 +98,7 @@ cfg80211_new_sta cfg80211_put_bss cfg80211_ready_on_channel + cfg80211_ref_bss cfg80211_remain_on_channel_expired cfg80211_roamed cfg80211_rx_mgmt @@ -106,9 +112,13 @@ __class_create class_create_file_ns class_destroy + class_dev_iter_exit + class_dev_iter_init + class_dev_iter_next class_find_device __class_register class_unregister + clear_inode clear_page clk_bulk_disable clk_bulk_enable @@ -206,14 +216,18 @@ csum_partial csum_tcpudp_nofold _ctype + d_add dapm_pinctrl_event dapm_regulator_event datagram_poll + d_drop + deactivate_locked_super default_llseek default_wake_function delayed_work_timer_fn del_timer del_timer_sync + dentry_open destroy_workqueue dev_alloc_name _dev_crit @@ -311,6 +325,7 @@ devm_request_threaded_irq devm_reset_control_array_get __devm_reset_control_get + devm_rtc_allocate_device devm_rtc_device_register devm_snd_dmaengine_pcm_register devm_snd_soc_register_card @@ -341,7 +356,10 @@ devres_release dev_set_mac_address dev_set_name + dev_vprintk_emit _dev_warn + dget_parent + d_instantiate disable_irq disable_irq_nosync disable_percpu_irq @@ -394,6 +412,7 @@ dma_free_attrs dma_get_slave_caps dma_get_slave_channel + d_make_root dmam_alloc_attrs dma_mmap_attrs dma_pool_alloc @@ -414,6 +433,7 @@ down_trylock down_write d_path + dput driver_find driver_find_device driver_register @@ -465,10 +485,19 @@ freq_qos_add_request freq_qos_remove_request freq_qos_update_request + fs_kobj + fsstack_copy_attr_all fwnode_property_present fwnode_property_read_u16_array generic_file_llseek + generic_file_mmap + generic_file_read_iter + generic_file_splice_read generic_handle_irq + generic_read_dir + generic_shutdown_super + genl_family_attrbuf + genlmsg_multicast_allns genlmsg_put genl_register_family genl_unregister_family @@ -542,6 +571,7 @@ i2c_del_driver i2c_for_each_dev i2c_get_adapter + i2c_new_device i2c_new_dummy i2c_put_adapter i2c_register_driver @@ -564,13 +594,17 @@ ieee80211_channel_to_freq_khz ieee80211_freq_khz_to_channel ieee80211_get_channel_khz + iget5_locked ignore_console_lock_warning + ihold iio_channel_get iio_channel_release + iio_convert_raw_to_processed iio_device_alloc iio_device_free __iio_device_register iio_device_unregister + iio_get_channel_type iio_read_channel_processed iio_read_channel_raw in4_pton @@ -582,6 +616,8 @@ init_timer_key init_wait_entry __init_waitqueue_head + inode_init_once + inode_init_owner input_allocate_device input_event input_free_device @@ -639,6 +675,7 @@ iounmap __iowrite32_copy ip_send_check + iput __irq_alloc_descs irq_create_mapping __irq_domain_add @@ -664,6 +701,7 @@ irq_to_desc irq_work_queue is_console_locked + iterate_dir jiffies jiffies_64 jiffies_64_to_clock_t @@ -673,7 +711,9 @@ kasprintf kernel_kobj kernel_read + kernel_restart kernel_write + kern_path keyslot_manager_create_passthrough keyslot_manager_private __kfifo_alloc @@ -752,10 +792,16 @@ llist_add_batch __local_bh_enable_ip __lock_buffer + lockref_get + lock_rename lock_sock_nested + lookup_one_len loops_per_jiffy + LZ4_decompress_safe map_vm_area + match_int match_string + match_token media_create_intf_link media_create_pad_link media_device_register_entity @@ -841,6 +887,7 @@ no_llseek nonseekable_open noop_llseek + notify_change nr_cpu_ids nr_irqs nsecs_to_jiffies @@ -916,6 +963,7 @@ of_usb_get_phy_mode of_usb_host_tpl_support oops_in_progress + pagecache_get_page panic panic_notifier_list param_array_ops @@ -929,6 +977,8 @@ param_ops_ullong param_ops_ulong param_set_uint + path_get + path_put pci_alloc_irq_vectors_affinity pci_bus_type pci_d3cold_disable @@ -1121,6 +1171,7 @@ register_chrdev_region register_console register_die_notifier + register_filesystem register_inet6addr_notifier register_inetaddr_notifier register_netdev @@ -1177,13 +1228,17 @@ reset_control_reset return_address rfkill_alloc + rfkill_blocked rfkill_destroy rfkill_register rfkill_unregister rps_needed + rtc_add_group rtc_class_close rtc_class_open rtc_read_time + __rtc_register_device + rtc_set_time rtc_time64_to_tm rtc_tm_to_time64 rtc_update_irq @@ -1211,6 +1266,7 @@ seq_printf seq_puts seq_read + set_anon_super set_cpus_allowed_ptr set_normalized_timespec64 set_page_dirty_lock @@ -1218,6 +1274,7 @@ sg_alloc_table sg_alloc_table_from_pages sg_copy_to_buffer + sget sg_free_table sg_init_one sg_init_table @@ -1230,8 +1287,11 @@ __sg_page_iter_start sg_pcopy_from_buffer sg_pcopy_to_buffer + simple_getattr simple_open simple_read_from_buffer + simple_setattr + simple_statfs simple_strtol simple_strtoul simple_write_to_buffer @@ -1301,6 +1361,7 @@ snd_soc_dai_set_fmt snd_soc_dai_set_sysclk snd_soc_dai_set_tdm_slot + snd_soc_dai_set_tristate snd_soc_dapm_add_routes snd_soc_dapm_disable_pin snd_soc_dapm_enable_pin @@ -1369,6 +1430,8 @@ sock_no_shutdown sock_no_socketpair sock_queue_rcv_skb + __sock_recv_timestamp + __sock_recv_wifi_status sock_register sock_unregister softnet_data @@ -1412,11 +1475,13 @@ strncat strncmp strncpy + strndup_user strnlen strnstr strpbrk strrchr strsep + strspn strstr submit_bh subsys_system_register @@ -1425,6 +1490,7 @@ __sync_dirty_buffer sync_file_create sync_file_get_fence + sync_filesystem synchronize_irq synchronize_rcu syscon_regmap_lookup_by_phandle @@ -1490,6 +1556,7 @@ __trace_puts trace_raw_output_prep trace_seq_printf + truncate_inode_pages try_module_get __tty_alloc_driver tty_flip_buffer_push @@ -1534,9 +1601,13 @@ ufshcd_system_resume ufshcd_system_suspend ufshcd_wb_ctrl + unlock_new_inode + unlock_page + unlock_rename unmap_mapping_range __unregister_chrdev unregister_chrdev_region + unregister_filesystem unregister_inet6addr_notifier unregister_inetaddr_notifier unregister_netdev @@ -1642,6 +1713,7 @@ usb_unregister_notify usb_wakeup_notification __usecs_to_jiffies + user_path_at_empty usleep_range v4l2_ctrl_handler_free v4l2_ctrl_handler_init_class @@ -1692,9 +1764,20 @@ vb2_streamon vb2_wait_for_all_buffers vfree + vfs_create + vfs_fallocate vfs_fsync + vfs_getattr + vfs_getxattr + vfs_link + vfs_listxattr vfs_llseek + vfs_mkdir + vfs_rename + vfs_rmdir + vfs_setxattr vfs_statx + vfs_unlink video_devdata video_device_alloc video_device_release @@ -1703,6 +1786,7 @@ video_unregister_device vmalloc vmalloc_to_page + vmalloc_to_pfn vmalloc_user vmap vmemmap @@ -1712,6 +1796,7 @@ vm_map_pages vm_map_ram vm_unmap_ram + vprintk_emit vscnprintf vsnprintf vsprintf @@ -1724,12 +1809,14 @@ wait_for_completion_timeout __wait_on_buffer __wake_up + __wake_up_locked_key wake_up_process wakeup_source_add wakeup_source_create wakeup_source_destroy wakeup_source_register wakeup_source_unregister + __wake_up_sync __warn_printk watchdog_init_timeout watchdog_register_device From ec46411eb4efb3366f1614663566a67bf2231c5b Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 30 Jul 2020 08:10:20 +0200 Subject: [PATCH 04/33] UPSTREAM: modules: mark ref_module static ref_module isn't used anywhere outside of module.c. Bug: 157965270 Bug: 171277690 Signed-off-by: Christoph Hellwig Signed-off-by: Jessica Yu (cherry picked from commit 7ef5264de773279b9f23b6cc8afb5addb30e970b) Signed-off-by: Greg Kroah-Hartman Change-Id: I68f39675f53b745664c833ac150d838563c78aae Signed-off-by: Greg Kroah-Hartman --- include/linux/module.h | 1 - kernel/module.c | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/include/linux/module.h b/include/linux/module.h index 996e81a51fbf..7b3500539cae 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -648,7 +648,6 @@ static inline void __module_get(struct module *module) #define symbol_put_addr(p) do { } while (0) #endif /* CONFIG_MODULE_UNLOAD */ -int ref_module(struct module *a, struct module *b); /* This is a #define so the string doesn't get put in every .o file */ #define module_name(mod) \ diff --git a/kernel/module.c b/kernel/module.c index 63c0a2d1db66..9a319c9447f7 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -866,7 +866,7 @@ static int add_module_usage(struct module *a, struct module *b) } /* Module a uses b: caller needs module_mutex() */ -int ref_module(struct module *a, struct module *b) +static int ref_module(struct module *a, struct module *b) { int err; @@ -885,7 +885,6 @@ int ref_module(struct module *a, struct module *b) } return 0; } -EXPORT_SYMBOL_GPL(ref_module); /* Clear the unload stuff of the module. */ static void module_unload_free(struct module *mod) @@ -1165,11 +1164,10 @@ static inline void module_unload_free(struct module *mod) { } -int ref_module(struct module *a, struct module *b) +static int ref_module(struct module *a, struct module *b) { return strong_try_module_get(b); } -EXPORT_SYMBOL_GPL(ref_module); static inline int module_unload_init(struct module *mod) { From 2951ba186e1705e8455a2c98df69e2d2ce2a90c7 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 30 Jul 2020 08:10:21 +0200 Subject: [PATCH 05/33] UPSTREAM: modules: mark find_symbol static find_symbol is only used in module.c. Bug: 157965270 Bug: 171277690 Signed-off-by: Christoph Hellwig Signed-off-by: Jessica Yu (cherry picked from commit 773110470e2fa3839523384ae014f8a723c4d178) Signed-off-by: Greg Kroah-Hartman Change-Id: Ifd34f7a477be9ed1b7715ce966473f2898c5a975 Signed-off-by: Greg Kroah-Hartman --- include/linux/module.h | 11 ----------- kernel/module.c | 3 +-- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/include/linux/module.h b/include/linux/module.h index 7b3500539cae..05215b486c1c 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -581,17 +581,6 @@ struct symsearch { bool unused; }; -/* - * Search for an exported symbol by name. - * - * Must be called with module_mutex held or preemption disabled. - */ -const struct kernel_symbol *find_symbol(const char *name, - struct module **owner, - const s32 **crc, - bool gplok, - bool warn); - /* * Walk the exported symbol table * diff --git a/kernel/module.c b/kernel/module.c index 9a319c9447f7..436ec9f6478e 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -582,7 +582,7 @@ static bool find_exported_symbol_in_section(const struct symsearch *syms, /* Find an exported symbol and return it, along with, (optional) crc and * (optional) module which owns it. Needs preempt disabled or module_mutex. */ -const struct kernel_symbol *find_symbol(const char *name, +static const struct kernel_symbol *find_symbol(const char *name, struct module **owner, const s32 **crc, bool gplok, @@ -605,7 +605,6 @@ const struct kernel_symbol *find_symbol(const char *name, pr_debug("Failed to find symbol %s\n", name); return NULL; } -EXPORT_SYMBOL_GPL(find_symbol); /* * Search for module by name: must hold module_mutex (or preempt disabled From 6cd6da665d3fcb4d456b44f669ca1daf7539cbaf Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 30 Jul 2020 08:10:22 +0200 Subject: [PATCH 06/33] UPSTREAM: modules: mark each_symbol_section static each_symbol_section is only used inside of module.c. Bug: 157965270 Bug: 171277690 Signed-off-by: Christoph Hellwig Signed-off-by: Jessica Yu (cherry picked from commit a54e04914c211b5678602a46b3ede5d82ec1327d) Signed-off-by: Greg Kroah-Hartman Change-Id: I5debe30f150847281874d9b2c47952f9036d37d2 --- include/linux/module.h | 9 --------- kernel/module.c | 3 +-- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/include/linux/module.h b/include/linux/module.h index 05215b486c1c..70750f8856e1 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -581,15 +581,6 @@ struct symsearch { bool unused; }; -/* - * Walk the exported symbol table - * - * Must be called with module_mutex held or preemption disabled. - */ -bool each_symbol_section(bool (*fn)(const struct symsearch *arr, - struct module *owner, - void *data), void *data); - /* Returns 0 and fills in value, defined and namebuf, or -ERANGE if symnum out of range. */ int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type, diff --git a/kernel/module.c b/kernel/module.c index 436ec9f6478e..b3f4a62f2ae8 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -419,7 +419,7 @@ static bool each_symbol_in_section(const struct symsearch *arr, } /* Returns true as soon as fn returns true, otherwise false. */ -bool each_symbol_section(bool (*fn)(const struct symsearch *arr, +static bool each_symbol_section(bool (*fn)(const struct symsearch *arr, struct module *owner, void *data), void *data) @@ -481,7 +481,6 @@ bool each_symbol_section(bool (*fn)(const struct symsearch *arr, } return false; } -EXPORT_SYMBOL_GPL(each_symbol_section); struct find_symbol_arg { /* Input */ From 68d5cd1dcb65d2fc15b87975278122827ed9cdf5 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 30 Jul 2020 08:10:23 +0200 Subject: [PATCH 07/33] UPSTREAM: modules: unexport __module_text_address __module_text_address is only used by built-in code. Bug: 157965270 Bug: 171277690 Signed-off-by: Christoph Hellwig Signed-off-by: Jessica Yu (cherry picked from commit 3fe1e56d0e68b623dd62d8d38265d2a052e7e185) Signed-off-by: Greg Kroah-Hartman Change-Id: I1a9081c6fa3d2a6e27ede24a4fa2b6a220cd521d Signed-off-by: Greg Kroah-Hartman --- kernel/module.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/module.c b/kernel/module.c index b3f4a62f2ae8..8b40f32d8c3f 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -4561,7 +4561,6 @@ struct module *__module_text_address(unsigned long addr) } return mod; } -EXPORT_SYMBOL_GPL(__module_text_address); /* Don't grab lock, we're oopsing. */ void print_modules(void) From 684d5eaf063f5b0a8231acfb58990025348af894 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 30 Jul 2020 08:10:24 +0200 Subject: [PATCH 08/33] UPSTREAM: modules: unexport __module_address __module_address is only used by built-in code. Bug: 157965270 Bug: 171277690 Signed-off-by: Christoph Hellwig Signed-off-by: Jessica Yu (cherry picked from commit 34e64705ad415ed7a816e60ef62b42fe6d1729d9) Signed-off-by: Greg Kroah-Hartman Change-Id: I9fb9339e17a7bac54afee8d301f33298a702fcb9 Signed-off-by: Greg Kroah-Hartman --- kernel/module.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/module.c b/kernel/module.c index 8b40f32d8c3f..9ca9fe6c4307 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -4522,7 +4522,6 @@ struct module *__module_address(unsigned long addr) } return mod; } -EXPORT_SYMBOL_GPL(__module_address); /* * is_module_text_address - is this address inside module code? From 35601d50151b2cd29a357ab85f9ff0222af9877e Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 30 Jul 2020 08:10:25 +0200 Subject: [PATCH 09/33] UPSTREAM: modules: rename the licence field in struct symsearch to license Use the same spelling variant as the rest of the file. Bug: 157965270 Bug: 171277690 Signed-off-by: Christoph Hellwig Signed-off-by: Jessica Yu (cherry picked from commit cd8732cdcc37d7077c4fa2c966b748c0662b607e) Signed-off-by: Greg Kroah-Hartman Change-Id: I0ad6d1dcbe39053566bb922b9a71359f753df85c --- include/linux/module.h | 2 +- kernel/module.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/module.h b/include/linux/module.h index 70750f8856e1..3926d5ae1ff1 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -577,7 +577,7 @@ struct symsearch { NOT_GPL_ONLY, GPL_ONLY, WILL_BE_GPL_ONLY, - } licence; + } license; bool unused; }; diff --git a/kernel/module.c b/kernel/module.c index 9ca9fe6c4307..077aec753bb7 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -501,9 +501,9 @@ static bool check_exported_symbol(const struct symsearch *syms, struct find_symbol_arg *fsa = data; if (!fsa->gplok) { - if (syms->licence == GPL_ONLY) + if (syms->license == GPL_ONLY) return false; - if (syms->licence == WILL_BE_GPL_ONLY && fsa->warn) { + if (syms->license == WILL_BE_GPL_ONLY && fsa->warn) { pr_warn("Symbol %s is being used by a non-GPL module, " "which will not be allowed in the future\n", fsa->name); From f39710f356204024cd0428c9b9e0ad336f875efa Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 30 Jul 2020 08:10:26 +0200 Subject: [PATCH 10/33] UPSTREAM: modules: return licensing information from find_symbol Report the GPLONLY status through a new argument. Bug: 157965270 Bug: 171277690 Signed-off-by: Christoph Hellwig Signed-off-by: Jessica Yu (cherry picked from commit ef1dac6021cc8ec5de02ce31722bf26ac4ed5523) Signed-off-by: Greg Kroah-Hartman Change-Id: I93285e06e380509b11356256da4d3d5a8738e252 --- include/linux/module.h | 2 +- kernel/module.c | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/include/linux/module.h b/include/linux/module.h index 3926d5ae1ff1..0f5b9c3ce047 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -573,7 +573,7 @@ struct module *find_module(const char *name); struct symsearch { const struct kernel_symbol *start, *stop; const s32 *crcs; - enum { + enum mod_license { NOT_GPL_ONLY, GPL_ONLY, WILL_BE_GPL_ONLY, diff --git a/kernel/module.c b/kernel/module.c index 077aec753bb7..a1a9997833ef 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -492,6 +492,7 @@ struct find_symbol_arg { struct module *owner; const s32 *crc; const struct kernel_symbol *sym; + enum mod_license license; }; static bool check_exported_symbol(const struct symsearch *syms, @@ -525,6 +526,7 @@ static bool check_exported_symbol(const struct symsearch *syms, fsa->owner = owner; fsa->crc = symversion(syms->crcs, symnum); fsa->sym = &syms->start[symnum]; + fsa->license = syms->license; return true; } @@ -584,6 +586,7 @@ static bool find_exported_symbol_in_section(const struct symsearch *syms, static const struct kernel_symbol *find_symbol(const char *name, struct module **owner, const s32 **crc, + enum mod_license *license, bool gplok, bool warn) { @@ -598,6 +601,8 @@ static const struct kernel_symbol *find_symbol(const char *name, *owner = fsa.owner; if (crc) *crc = fsa.crc; + if (license) + *license = fsa.license; return fsa.sym; } @@ -1071,7 +1076,7 @@ void __symbol_put(const char *symbol) struct module *owner; preempt_disable(); - if (!find_symbol(symbol, &owner, NULL, true, false)) + if (!find_symbol(symbol, &owner, NULL, NULL, true, false)) BUG(); module_put(owner); preempt_enable(); @@ -1348,7 +1353,7 @@ static inline int check_modstruct_version(const struct load_info *info, * locking is necessary -- use preempt_disable() to placate lockdep. */ preempt_disable(); - if (!find_symbol("module_layout", NULL, &crc, true, false)) { + if (!find_symbol("module_layout", NULL, &crc, NULL, true, false)) { preempt_enable(); BUG(); } @@ -1432,6 +1437,7 @@ static const struct kernel_symbol *resolve_symbol(struct module *mod, struct module *owner; const struct kernel_symbol *sym; const s32 *crc; + enum mod_license license; int err; /* @@ -1441,7 +1447,7 @@ static const struct kernel_symbol *resolve_symbol(struct module *mod, */ sched_annotate_sleep(); mutex_lock(&module_mutex); - sym = find_symbol(name, &owner, &crc, + sym = find_symbol(name, &owner, &crc, &license, !(mod->taints & (1 << TAINT_PROPRIETARY_MODULE)), true); if (!sym) goto unlock; @@ -2263,7 +2269,7 @@ void *__symbol_get(const char *symbol) const struct kernel_symbol *sym; preempt_disable(); - sym = find_symbol(symbol, &owner, NULL, true, true); + sym = find_symbol(symbol, &owner, NULL, NULL, true, true); if (sym && strong_try_module_get(owner)) sym = NULL; preempt_enable(); @@ -2298,7 +2304,7 @@ static int verify_exported_symbols(struct module *mod) for (i = 0; i < ARRAY_SIZE(arr); i++) { for (s = arr[i].sym; s < arr[i].sym + arr[i].num; s++) { if (find_symbol(kernel_symbol_name(s), &owner, NULL, - true, false)) { + NULL, true, false)) { pr_err("%s: exports duplicate symbol %s" " (owned by %s)\n", mod->name, kernel_symbol_name(s), From 35b560985bf9890e62a5f58c3ec79a9966da2fba Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 28 Jul 2020 23:33:33 +0200 Subject: [PATCH 11/33] UPSTREAM: modules: inherit TAINT_PROPRIETARY_MODULE If a TAINT_PROPRIETARY_MODULE exports symbol, inherit the taint flag for all modules importing these symbols, and don't allow loading symbols from TAINT_PROPRIETARY_MODULE modules if the module previously imported gplonly symbols. Add a anti-circumvention devices so people don't accidentally get themselves into trouble this way. Comment from Greg: "Ah, the proven-to-be-illegal "GPL Condom" defense :)" Bug: 171277690 [jeyu: pr_info -> pr_err and pr_warn as per discussion] Link: http://lore.kernel.org/r/20200730162957.GA22469@lst.de Acked-by: Daniel Vetter Reviewed-by: Greg Kroah-Hartman Signed-off-by: Christoph Hellwig Signed-off-by: Jessica Yu (cherry picked from commit 262e6ae7081df304fc625cf368d5c2cbba2bb991) Signed-off-by: Greg Kroah-Hartman Change-Id: Id7c1af6bb8523bc39bda1efc661929d9ea0ccb20 --- include/linux/module.h | 1 + kernel/module.c | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/include/linux/module.h b/include/linux/module.h index 0f5b9c3ce047..4f71785d6bbd 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -382,6 +382,7 @@ struct module { unsigned int num_gpl_syms; const struct kernel_symbol *gpl_syms; const s32 *gpl_crcs; + bool using_gplonly_symbols; #ifdef CONFIG_UNUSED_SYMBOLS /* unused exported symbols. */ diff --git a/kernel/module.c b/kernel/module.c index a1a9997833ef..aca3a6355165 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -1427,6 +1427,24 @@ static int verify_namespace_is_imported(const struct load_info *info, return 0; } +static bool inherit_taint(struct module *mod, struct module *owner) +{ + if (!owner || !test_bit(TAINT_PROPRIETARY_MODULE, &owner->taints)) + return true; + + if (mod->using_gplonly_symbols) { + pr_err("%s: module using GPL-only symbols uses symbols from proprietary module %s.\n", + mod->name, owner->name); + return false; + } + + if (!test_bit(TAINT_PROPRIETARY_MODULE, &mod->taints)) { + pr_warn("%s: module uses symbols from proprietary module %s, inheriting taint.\n", + mod->name, owner->name); + set_bit(TAINT_PROPRIETARY_MODULE, &mod->taints); + } + return true; +} /* Resolve a symbol for this module. I.e. if we find one, record usage. */ static const struct kernel_symbol *resolve_symbol(struct module *mod, @@ -1452,6 +1470,14 @@ static const struct kernel_symbol *resolve_symbol(struct module *mod, if (!sym) goto unlock; + if (license == GPL_ONLY) + mod->using_gplonly_symbols = true; + + if (!inherit_taint(mod, owner)) { + sym = NULL; + goto getname; + } + if (!check_version(info, name, mod, crc)) { sym = ERR_PTR(-EINVAL); goto getname; From db96212bdede8915d9769eddcd378f70a8e4d279 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 20 Oct 2020 16:49:28 +0200 Subject: [PATCH 12/33] ANDROID: GKI: fix ABI breakage in module.h commit 262e6ae7081d ("modules: inherit TAINT_PROPRIETARY_MODULE") changes the size of 'struct module' a bit by adding a single boolean value to the middle. Move things around a bit and take up a space to preserve the abi so that nothing changes with the abi before that commit was merged. This might be able to be dropped at the next Android KABI "Break", if one happens. Bug: 171277690 Fixes: 262e6ae7081d ("modules: inherit TAINT_PROPRIETARY_MODULE") Signed-off-by: Greg Kroah-Hartman Change-Id: Ie31a6fcea384ad665248c87f7abfde4d214da70a --- include/linux/module.h | 8 ++++++-- kernel/module.c | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/linux/module.h b/include/linux/module.h index 4f71785d6bbd..5246cbce5881 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -346,6 +346,11 @@ struct klp_modinfo { }; #endif +struct module_kabi_preserve_1 { + u64 using_gplonly_symbols:1; + u64 free:63; +}; + struct module { enum module_state state; @@ -382,7 +387,6 @@ struct module { unsigned int num_gpl_syms; const struct kernel_symbol *gpl_syms; const s32 *gpl_crcs; - bool using_gplonly_symbols; #ifdef CONFIG_UNUSED_SYMBOLS /* unused exported symbols. */ @@ -516,7 +520,7 @@ struct module { struct error_injection_entry *ei_funcs; unsigned int num_ei_funcs; #endif - ANDROID_KABI_RESERVE(1); + ANDROID_KABI_USE(1, struct module_kabi_preserve_1 m1); ANDROID_KABI_RESERVE(2); ANDROID_KABI_RESERVE(3); ANDROID_KABI_RESERVE(4); diff --git a/kernel/module.c b/kernel/module.c index aca3a6355165..60f6a995265c 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -1432,7 +1432,7 @@ static bool inherit_taint(struct module *mod, struct module *owner) if (!owner || !test_bit(TAINT_PROPRIETARY_MODULE, &owner->taints)) return true; - if (mod->using_gplonly_symbols) { + if (mod->m1.using_gplonly_symbols) { pr_err("%s: module using GPL-only symbols uses symbols from proprietary module %s.\n", mod->name, owner->name); return false; @@ -1471,7 +1471,7 @@ static const struct kernel_symbol *resolve_symbol(struct module *mod, goto unlock; if (license == GPL_ONLY) - mod->using_gplonly_symbols = true; + mod->m1.using_gplonly_symbols = true; if (!inherit_taint(mod, owner)) { sym = NULL; From f1ff4a467862cf04052e30f56c0ae1c1a575f410 Mon Sep 17 00:00:00 2001 From: wangzun1 Date: Tue, 20 Oct 2020 19:51:43 +0800 Subject: [PATCH 13/33] ANDROID: GKI: update xiaomi symbol list Leaf changes summary: 0 artifact changed Changed leaf types summary: 0 leaf type changed Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 0 Added function Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable Bug: 171162194 Signed-off-by: Zun Wang Change-Id: I169bcdd14878392ef57aec9c303a421800278610 Signed-off-by: Greg Kroah-Hartman --- android/abi_gki_aarch64_xiaomi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/android/abi_gki_aarch64_xiaomi b/android/abi_gki_aarch64_xiaomi index 7b58413581e8..95acdab2fb70 100644 --- a/android/abi_gki_aarch64_xiaomi +++ b/android/abi_gki_aarch64_xiaomi @@ -16,6 +16,10 @@ regcache_drop_region snd_soc_dapm_del_routes +# required by tfa98xx_dlkm.ko + device_remove_bin_file + snd_pcm_hw_constraint_mask64 + # required by q6_dlkm.ko down_interruptible __kfifo_alloc From e17d9fc5315f6e4cfa93a99ccacdeb61d343e770 Mon Sep 17 00:00:00 2001 From: Abdulla Kamar Date: Tue, 20 Oct 2020 21:36:20 +1100 Subject: [PATCH 14/33] ANDROID: GKI: Enable CONFIG_X86_X2APIC Enable support for CONFIG_X86_X2APIC, if available. This speeds up operation in a hypervisor, as APIC is handled via MSRs. Bug: 171287650 Change-Id: Ie3cf57d07b8dde08ec609dfb031cfb0029218501 Signed-off-by: Abdulla Kamar --- arch/x86/configs/gki_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/configs/gki_defconfig b/arch/x86/configs/gki_defconfig index 5f6b1e4dd7f3..066dac7dfa88 100644 --- a/arch/x86/configs/gki_defconfig +++ b/arch/x86/configs/gki_defconfig @@ -48,6 +48,7 @@ CONFIG_SLAB_FREELIST_HARDENED=y CONFIG_SHUFFLE_PAGE_ALLOCATOR=y CONFIG_PROFILING=y CONFIG_SMP=y +CONFIG_X86_X2APIC=y CONFIG_HYPERVISOR_GUEST=y CONFIG_PARAVIRT=y CONFIG_NR_CPUS=32 From ba2f977129f8d5c343d5cbc8ac05dba39b1e7ea0 Mon Sep 17 00:00:00 2001 From: Neal Liu Date: Thu, 22 Oct 2020 17:11:31 +0800 Subject: [PATCH 15/33] ANDROID: modules: fix suspicious rcu usage Use rcu_read_lock_sched() & rcu_read_unlock_sched() to mark the beginning & end of a RCU-sched critical section instead. Bug: 171362096 Signed-off-by: Neal Liu Change-Id: Idb40e2c2356621398e06944f7cb9b8bc5ef1d92a --- kernel/module.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/module.c b/kernel/module.c index 60f6a995265c..36e15ead5a80 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -4348,10 +4348,10 @@ int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *, static void cfi_init(struct module *mod) { #ifdef CONFIG_CFI_CLANG - rcu_read_lock(); + rcu_read_lock_sched(); mod->cfi_check = (cfi_check_fn)find_kallsyms_symbol_value(mod, CFI_CHECK_FN_NAME); - rcu_read_unlock(); + rcu_read_unlock_sched(); cfi_module_add(mod, module_addr_min, module_addr_max); #endif } From 95bd9e26f2fdd575bda7aa3b25f802f525d06fce Mon Sep 17 00:00:00 2001 From: Raghavendra Rao Ananta Date: Wed, 21 Oct 2020 15:13:16 -0700 Subject: [PATCH 16/33] ANDROID: ABI: Update allowed list for QCOM Add the following symbols to QCOM allowed-list: -- amba_driver_register -- amba_driver_unregister Bug: 171409550 Change-Id: Iab997df4f8ebb2c39b993b60ee4eb0fa3100fbcd Signed-off-by: Raghavendra Rao Ananta --- android/abi_gki_aarch64_qcom | 2 ++ 1 file changed, 2 insertions(+) diff --git a/android/abi_gki_aarch64_qcom b/android/abi_gki_aarch64_qcom index ec52822cc991..7185732b36b2 100644 --- a/android/abi_gki_aarch64_qcom +++ b/android/abi_gki_aarch64_qcom @@ -21,6 +21,8 @@ alloc_skb_with_frags alloc_workqueue amba_bustype + amba_driver_register + amba_driver_unregister anon_inode_getfile arch_bpf_jit_check_func __arch_clear_user From ba7883760ae7aff60dcf6810b3813cacbffc05c1 Mon Sep 17 00:00:00 2001 From: Chao Hao Date: Tue, 8 Sep 2020 17:03:17 +0800 Subject: [PATCH 17/33] BACKPORT: FROMLIST: iommu/io-pgtable-arm-v7s: Use ias to check the valid iova in unmap Use the ias for the valid iova checking in _unmap. It is a preparing patch for supporting iova 34bit for MediaTek. BTW, change the ias/oas checking format in v7s_map. Bug: 167939345 Link: https://lore.kernel.org/patchwork/patch/1301119/ Change-Id: I78a5399fb5f6555ba9aca916393ed62262853e34 Signed-off-by: Yong Wu Signed-off-by: Chao Hao Signed-off-by: Chun-Hung Wu --- drivers/iommu/io-pgtable-arm-v7s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iommu/io-pgtable-arm-v7s.c index 4cb394937700..04a12ceff72a 100644 --- a/drivers/iommu/io-pgtable-arm-v7s.c +++ b/drivers/iommu/io-pgtable-arm-v7s.c @@ -719,7 +719,7 @@ static size_t arm_v7s_unmap(struct io_pgtable_ops *ops, unsigned long iova, { struct arm_v7s_io_pgtable *data = io_pgtable_ops_to_data(ops); - if (WARN_ON(upper_32_bits(iova))) + if (WARN_ON(iova >= (1ULL << data->iop.cfg.ias))) return 0; return __arm_v7s_unmap(data, gather, iova, size, 1, data->pgd); From 8b6f18592d6cea4db95f5651843ff88f6759aa5a Mon Sep 17 00:00:00 2001 From: Chao Hao Date: Tue, 8 Sep 2020 17:12:46 +0800 Subject: [PATCH 18/33] BACKPORT: FROMLIST: iommu/io-pgtable-arm-v7s: Extend PA34 for MediaTek MediaTek extend the bit5 in lvl1 and lvl2 descriptor as PA34. Bug: 167939345 Link: https://lore.kernel.org/patchwork/patch/1301120/ Change-Id: I6bd677285b73271f977f8bdeb4ef6b658b2ea81d Signed-off-by: Yong Wu Signed-off-by: Chao Hao Signed-off-by: Chun-Hung Wu --- drivers/iommu/io-pgtable-arm-v7s.c | 9 +++++++-- include/linux/io-pgtable.h | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iommu/io-pgtable-arm-v7s.c index 04a12ceff72a..b3b0d287f4d1 100644 --- a/drivers/iommu/io-pgtable-arm-v7s.c +++ b/drivers/iommu/io-pgtable-arm-v7s.c @@ -112,9 +112,10 @@ #define ARM_V7S_TEX_MASK 0x7 #define ARM_V7S_ATTR_TEX(val) (((val) & ARM_V7S_TEX_MASK) << ARM_V7S_TEX_SHIFT) -/* MediaTek extend the two bits for PA 32bit/33bit */ +/* MediaTek extend the bits below for PA 32bit/33bit/34bit */ #define ARM_V7S_ATTR_MTK_PA_BIT32 BIT(9) #define ARM_V7S_ATTR_MTK_PA_BIT33 BIT(4) +#define ARM_V7S_ATTR_MTK_PA_BIT34 BIT(5) /* *well, except for TEX on level 2 large pages, of course :( */ #define ARM_V7S_CONT_PAGE_TEX_SHIFT 6 @@ -196,6 +197,8 @@ static arm_v7s_iopte paddr_to_iopte(phys_addr_t paddr, int lvl, pte |= ARM_V7S_ATTR_MTK_PA_BIT32; if (paddr & BIT_ULL(33)) pte |= ARM_V7S_ATTR_MTK_PA_BIT33; + if (paddr & BIT_ULL(34)) + pte |= ARM_V7S_ATTR_MTK_PA_BIT34; return pte; } @@ -220,6 +223,8 @@ static phys_addr_t iopte_to_paddr(arm_v7s_iopte pte, int lvl, paddr |= BIT_ULL(32); if (pte & ARM_V7S_ATTR_MTK_PA_BIT33) paddr |= BIT_ULL(33); + if (pte & ARM_V7S_ATTR_MTK_PA_BIT34) + paddr |= BIT_ULL(34); return paddr; } @@ -756,7 +761,7 @@ static struct io_pgtable *arm_v7s_alloc_pgtable(struct io_pgtable_cfg *cfg, if (cfg->ias > ARM_V7S_ADDR_BITS) return NULL; - if (cfg->oas > (arm_v7s_is_mtk_enabled(cfg) ? 34 : ARM_V7S_ADDR_BITS)) + if (cfg->oas > (arm_v7s_is_mtk_enabled(cfg) ? 35 : ARM_V7S_ADDR_BITS)) return NULL; if (cfg->quirks & ~(IO_PGTABLE_QUIRK_ARM_NS | diff --git a/include/linux/io-pgtable.h b/include/linux/io-pgtable.h index cd6b768d3735..89f660f502f8 100644 --- a/include/linux/io-pgtable.h +++ b/include/linux/io-pgtable.h @@ -92,8 +92,8 @@ struct io_pgtable_cfg { * TLB maintenance when mapping as well as when unmapping. * * IO_PGTABLE_QUIRK_ARM_MTK_EXT: (ARM v7s format) MediaTek IOMMUs extend - * to support up to 34 bits PA where the bit32 and bit33 are - * encoded in the bit9 and bit4 of the PTE respectively. + * to support up to 35 bits PA where the bit32, bit33 and bit34 are + * encoded in the bit9, bit4 and bit5 of the PTE respectively. * * IO_PGTABLE_QUIRK_NON_STRICT: Skip issuing synchronous leaf TLBIs * on unmap, for DMA domains using the flush queue mechanism for From fbf0ae523db55bb47673f5c7b8f0a362fc99b7be Mon Sep 17 00:00:00 2001 From: Chao Hao Date: Tue, 8 Sep 2020 17:15:48 +0800 Subject: [PATCH 19/33] BACKPORT: FROMLIST: iommu/io-pgtable-arm-v7s: Add cfg as a param in some macros Add "cfg" as a parameter for some macros. This is a preparing patch for mediatek extend the lvl1 pgtable. No functional change. Bug: 167939345 Link: https://lore.kernel.org/patchwork/patch/1301121/ Change-Id: I1bb072406cd2122446f1db2183a838a56837d7af Signed-off-by: Yong Wu Signed-off-by: Chao Hao Signed-off-by: Chun-Hung Wu --- drivers/iommu/io-pgtable-arm-v7s.c | 34 +++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iommu/io-pgtable-arm-v7s.c index b3b0d287f4d1..511bc552e9ae 100644 --- a/drivers/iommu/io-pgtable-arm-v7s.c +++ b/drivers/iommu/io-pgtable-arm-v7s.c @@ -53,17 +53,17 @@ #define ARM_V7S_LVL_SHIFT(lvl) (ARM_V7S_ADDR_BITS - (4 + 8 * (lvl))) #define ARM_V7S_TABLE_SHIFT 10 -#define ARM_V7S_PTES_PER_LVL(lvl) (1 << _ARM_V7S_LVL_BITS(lvl)) -#define ARM_V7S_TABLE_SIZE(lvl) \ - (ARM_V7S_PTES_PER_LVL(lvl) * sizeof(arm_v7s_iopte)) +#define ARM_V7S_PTES_PER_LVL(lvl, cfg) (1 << _ARM_V7S_LVL_BITS(lvl)) +#define ARM_V7S_TABLE_SIZE(lvl, cfg) \ + (ARM_V7S_PTES_PER_LVL(lvl, cfg) * sizeof(arm_v7s_iopte)) #define ARM_V7S_BLOCK_SIZE(lvl) (1UL << ARM_V7S_LVL_SHIFT(lvl)) #define ARM_V7S_LVL_MASK(lvl) ((u32)(~0U << ARM_V7S_LVL_SHIFT(lvl))) #define ARM_V7S_TABLE_MASK ((u32)(~0U << ARM_V7S_TABLE_SHIFT)) -#define _ARM_V7S_IDX_MASK(lvl) (ARM_V7S_PTES_PER_LVL(lvl) - 1) -#define ARM_V7S_LVL_IDX(addr, lvl) ({ \ +#define _ARM_V7S_IDX_MASK(lvl, cfg) (ARM_V7S_PTES_PER_LVL(lvl, cfg) - 1) +#define ARM_V7S_LVL_IDX(addr, lvl, cfg) ({ \ int _l = lvl; \ - ((u32)(addr) >> ARM_V7S_LVL_SHIFT(_l)) & _ARM_V7S_IDX_MASK(_l); \ + ((u32)(addr) >> ARM_V7S_LVL_SHIFT(_l)) & _ARM_V7S_IDX_MASK(_l, cfg); \ }) /* @@ -241,7 +241,7 @@ static void *__arm_v7s_alloc_table(int lvl, gfp_t gfp, struct device *dev = cfg->iommu_dev; phys_addr_t phys; dma_addr_t dma; - size_t size = ARM_V7S_TABLE_SIZE(lvl); + size_t size = ARM_V7S_TABLE_SIZE(lvl, cfg); void *table = NULL; if (lvl == 1) @@ -287,7 +287,7 @@ static void __arm_v7s_free_table(void *table, int lvl, { struct io_pgtable_cfg *cfg = &data->iop.cfg; struct device *dev = cfg->iommu_dev; - size_t size = ARM_V7S_TABLE_SIZE(lvl); + size_t size = ARM_V7S_TABLE_SIZE(lvl, cfg); if (!cfg->coherent_walk) dma_unmap_single(dev, __arm_v7s_dma_addr(table), size, @@ -431,7 +431,7 @@ static int arm_v7s_init_pte(struct arm_v7s_io_pgtable *data, arm_v7s_iopte *tblp; size_t sz = ARM_V7S_BLOCK_SIZE(lvl); - tblp = ptep - ARM_V7S_LVL_IDX(iova, lvl); + tblp = ptep - ARM_V7S_LVL_IDX(iova, lvl, cfg); if (WARN_ON(__arm_v7s_unmap(data, NULL, iova + i * sz, sz, lvl, tblp) != sz)) return -EINVAL; @@ -484,7 +484,7 @@ static int __arm_v7s_map(struct arm_v7s_io_pgtable *data, unsigned long iova, int num_entries = size >> ARM_V7S_LVL_SHIFT(lvl); /* Find our entry at the current level */ - ptep += ARM_V7S_LVL_IDX(iova, lvl); + ptep += ARM_V7S_LVL_IDX(iova, lvl, cfg); /* If we can install a leaf entry at this level, then do so */ if (num_entries) @@ -557,7 +557,7 @@ static void arm_v7s_free_pgtable(struct io_pgtable *iop) struct arm_v7s_io_pgtable *data = io_pgtable_to_data(iop); int i; - for (i = 0; i < ARM_V7S_PTES_PER_LVL(1); i++) { + for (i = 0; i < ARM_V7S_PTES_PER_LVL(1, &data->iop.cfg); i++) { arm_v7s_iopte pte = data->pgd[i]; if (ARM_V7S_PTE_IS_TABLE(pte, 1)) @@ -609,9 +609,9 @@ static size_t arm_v7s_split_blk_unmap(struct arm_v7s_io_pgtable *data, if (!tablep) return 0; /* Bytes unmapped */ - num_ptes = ARM_V7S_PTES_PER_LVL(2); + num_ptes = ARM_V7S_PTES_PER_LVL(2, cfg); num_entries = size >> ARM_V7S_LVL_SHIFT(2); - unmap_idx = ARM_V7S_LVL_IDX(iova, 2); + unmap_idx = ARM_V7S_LVL_IDX(iova, 2, cfg); pte = arm_v7s_prot_to_pte(arm_v7s_pte_to_prot(blk_pte, 1), 2, cfg); if (num_entries > 1) @@ -653,7 +653,7 @@ static size_t __arm_v7s_unmap(struct arm_v7s_io_pgtable *data, if (WARN_ON(lvl > 2)) return 0; - idx = ARM_V7S_LVL_IDX(iova, lvl); + idx = ARM_V7S_LVL_IDX(iova, lvl, &iop->cfg); ptep += idx; do { pte[i] = READ_ONCE(ptep[i]); @@ -739,7 +739,7 @@ static phys_addr_t arm_v7s_iova_to_phys(struct io_pgtable_ops *ops, u32 mask; do { - ptep += ARM_V7S_LVL_IDX(iova, ++lvl); + ptep += ARM_V7S_LVL_IDX(iova, ++lvl, &data->iop.cfg); pte = READ_ONCE(*ptep); ptep = iopte_deref(pte, lvl, data); } while (ARM_V7S_PTE_IS_TABLE(pte, lvl)); @@ -782,8 +782,8 @@ static struct io_pgtable *arm_v7s_alloc_pgtable(struct io_pgtable_cfg *cfg, spin_lock_init(&data->split_lock); data->l2_tables = kmem_cache_create("io-pgtable_armv7s_l2", - ARM_V7S_TABLE_SIZE(2), - ARM_V7S_TABLE_SIZE(2), + ARM_V7S_TABLE_SIZE(2, cfg), + ARM_V7S_TABLE_SIZE(2, cfg), ARM_V7S_TABLE_SLAB_FLAGS, NULL); if (!data->l2_tables) goto out_free_data; From 0245f11b470a072d60e574e66f2ee02d83f0bc3d Mon Sep 17 00:00:00 2001 From: Chao Hao Date: Tue, 8 Sep 2020 17:18:00 +0800 Subject: [PATCH 20/33] BACKPORT: FROMLIST: iommu/io-pgtable-arm-v7s: Quad lvl1 pgtable for MediaTek The standard input iova bits is 32. MediaTek quad the lvl1 pagetable (4 * lvl1). No change for lvl2 pagetable. Then the iova bits can reach 34bit. Bug: 167939345 Link: https://lore.kernel.org/patchwork/patch/1301122/ Change-Id: I29095a7f521c73da3fa017e81471ba41db8377ff Signed-off-by: Yong Wu Signed-off-by: Chao Hao Signed-off-by: Chun-Hung Wu --- drivers/iommu/io-pgtable-arm-v7s.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iommu/io-pgtable-arm-v7s.c index 511bc552e9ae..6c08e991c9b0 100644 --- a/drivers/iommu/io-pgtable-arm-v7s.c +++ b/drivers/iommu/io-pgtable-arm-v7s.c @@ -50,10 +50,16 @@ */ #define ARM_V7S_ADDR_BITS 32 #define _ARM_V7S_LVL_BITS(lvl) (16 - (lvl) * 4) +/* MediaTek: totally 34bits, 14bits at lvl1 and 8bits at lvl2. */ +#define _ARM_V7S_LVL_BITS_MTK(lvl) (20 - (lvl) * 6) #define ARM_V7S_LVL_SHIFT(lvl) (ARM_V7S_ADDR_BITS - (4 + 8 * (lvl))) #define ARM_V7S_TABLE_SHIFT 10 -#define ARM_V7S_PTES_PER_LVL(lvl, cfg) (1 << _ARM_V7S_LVL_BITS(lvl)) +#define ARM_V7S_PTES_PER_LVL(lvl, cfg) ({ \ + !arm_v7s_is_mtk_enabled(cfg) ? \ + (1 << _ARM_V7S_LVL_BITS(lvl)) : (1 << _ARM_V7S_LVL_BITS_MTK(lvl));\ +}) + #define ARM_V7S_TABLE_SIZE(lvl, cfg) \ (ARM_V7S_PTES_PER_LVL(lvl, cfg) * sizeof(arm_v7s_iopte)) @@ -63,7 +69,7 @@ #define _ARM_V7S_IDX_MASK(lvl, cfg) (ARM_V7S_PTES_PER_LVL(lvl, cfg) - 1) #define ARM_V7S_LVL_IDX(addr, lvl, cfg) ({ \ int _l = lvl; \ - ((u32)(addr) >> ARM_V7S_LVL_SHIFT(_l)) & _ARM_V7S_IDX_MASK(_l, cfg); \ + ((addr) >> ARM_V7S_LVL_SHIFT(_l)) & _ARM_V7S_IDX_MASK(_l, cfg); \ }) /* @@ -758,7 +764,7 @@ static struct io_pgtable *arm_v7s_alloc_pgtable(struct io_pgtable_cfg *cfg, { struct arm_v7s_io_pgtable *data; - if (cfg->ias > ARM_V7S_ADDR_BITS) + if (cfg->ias > (arm_v7s_is_mtk_enabled(cfg) ? 34 : ARM_V7S_ADDR_BITS)) return NULL; if (cfg->oas > (arm_v7s_is_mtk_enabled(cfg) ? 35 : ARM_V7S_ADDR_BITS)) From 3f0fb2fde05a56b0789edbfb4459452e1b0356e7 Mon Sep 17 00:00:00 2001 From: Chun-Hung Wu Date: Wed, 16 Sep 2020 09:54:05 +0800 Subject: [PATCH 21/33] ANDROID: iommu: Enable CONFIG_IOMMU_IO_PGTABLE_ARMV7S Enable CONFIG_IOMMU_IO_PGTABLE_ARMV7S in gki_defconfig for MTK iommu/io-pgtable-arm-v7s. Bug: 167939345 Link: https://lore.kernel.org/patchwork/patch/1301119/ Signed-off-by: Yong Wu Signed-off-by: Chao Hao Signed-off-by: Chun-Hung Wu Change-Id: Ic1f3a9cdf20f49f615f56bd9d9b0899a8f7255f6 --- arch/arm64/configs/gki_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/gki_defconfig b/arch/arm64/configs/gki_defconfig index 3c3ad78c51db..658d4cd899e1 100644 --- a/arch/arm64/configs/gki_defconfig +++ b/arch/arm64/configs/gki_defconfig @@ -443,6 +443,7 @@ CONFIG_HWSPINLOCK=y CONFIG_MTK_TIMER=y CONFIG_MAILBOX=y CONFIG_IOMMU_LIMIT_IOVA_ALIGNMENT=y +CONFIG_IOMMU_IO_PGTABLE_ARMV7S=y CONFIG_REMOTEPROC=y CONFIG_RPMSG_CHAR=y CONFIG_DEVFREQ_GOV_PERFORMANCE=y From 2f397d4f6822d8854842837c5c4decc42b7ab12f Mon Sep 17 00:00:00 2001 From: Danesh Petigara Date: Sat, 17 Oct 2020 12:54:28 -0700 Subject: [PATCH 22/33] ANDROID: recordmcount: avoid STT_FILE as base for mcount offset relocation This problem was observed with a kernel built using clang and LTO. When the section header index of a section that contains mcount calls coincides with SHN_ABS, recordmcount ends up selecting a STT_FILE symbol as the base for mcount offset relocation. Since the STT_FILE symbol value is 0, it's not a suitable candidate as the base for relocation and results in the __mcount_loc table containing an invalid entry causing kernel oops in ftrace_init(): [ 0.000000] ftrace: allocating 45789 entries in 179 pages [ 0.000000] ------------[ cut here ]------------ [ 0.000000] WARNING: CPU: 0 PID: 0 at arch/arm64/kernel/ftrace.c:172 ftrace_make_nop+0x11c/0x150 [ 0.000000] Modules linked in: [ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 5.4.69-0-1pre+ #1 [ 0.000000] Hardware name: BCM972180HB_V20 (DT) [ 0.000000] pstate: 20400085 (nzCv daIf +PAN -UAO) [ 0.000000] pc : ftrace_make_nop+0x11c/0x150 [ 0.000000] lr : ftrace_make_nop+0x5c/0x150 [ 0.000000] sp : ffffffc011a43ef0 [ 0.000000] x29: ffffffc011a43f00 x28: 0000000000000001 [ 0.000000] x27: ffffff8027801380 x26: 0000000000000000 [ 0.000000] x25: ffffff8027880008 x24: 0000000000000000 [ 0.000000] x23: 0000000000000000 x22: 0000000000000008 [ 0.000000] x21: ffffffc010f5acdc x20: 0000000000000000 [ 0.000000] x19: 0000000000000020 x18: ffffffc011a79020 [ 0.000000] x17: 000000000000003c x16: 0000000000000022 [ 0.000000] x15: dead000000000100 x14: 0000000000000001 [ 0.000000] x13: 0000000000000000 x12: 0000000000000000 [ 0.000000] x11: 0000000000000000 x10: 0000000008000000 [ 0.000000] x9 : 0000000000000002 x8 : 0000000000000001 [ 0.000000] x7 : 0000000000000000 x6 : 000000000000003f [ 0.000000] x5 : 00000000000235b8 x4 : 0000000000000001 [ 0.000000] x3 : 0000000000000001 x2 : ffffffc010f5acdc [ 0.000000] x1 : ffffff8027880000 x0 : 0000000000000001 [ 0.000000] Call trace: [ 0.000000] ftrace_make_nop+0x11c/0x150 [ 0.000000] ftrace_process_locs+0x338/0x3e0 [ 0.000000] ftrace_init+0xac/0xdc [ 0.000000] start_kernel+0x194/0x43c [ 0.000000] random: get_random_bytes called from __warn+0xe0/0x138 with crng_init=0 [ 0.000000] ---[ end trace a8999690c4edae16 ]--- [ 0.000000] ------------[ cut here ]------------ [ 0.000000] WARNING: CPU: 0 PID: 0 at kernel/trace/ftrace.c:2008 ftrace_bug+0x94/0x268 [ 0.000000] Modules linked in: [ 0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G W 5.4.69-0-1pre+ #1 [ 0.000000] Hardware name: BCM972180HB_V20 (DT) [ 0.000000] pstate: 60400085 (nZCv daIf +PAN -UAO) [ 0.000000] pc : ftrace_bug+0x94/0x268 [ 0.000000] lr : ftrace_process_locs+0x364/0x3e0 [ 0.000000] sp : ffffffc011a43ef0 [ 0.000000] x29: ffffffc011a43ef0 x28: 0000000000000001 [ 0.000000] x27: ffffff8027801380 x26: 0000000000000000 [ 0.000000] x25: ffffff8027880008 x24: 0000000000000000 [ 0.000000] x23: 0000000000000000 x22: 0000000000000008 [ 0.000000] x21: ffffffc010f5acdc x20: 0000000000000020 [ 0.000000] x19: ffffff8027880000 x18: ffffffc011a79020 [ 0.000000] x17: 000000000000003c x16: 0000000000000022 [ 0.000000] x15: dead000000000100 x14: 0000000000000001 [ 0.000000] x13: 0000000000000000 x12: ffffffc010f5ed94 [ 0.000000] x11: ffffffc011a4f000 x10: ffffffc011a4f000 [ 0.000000] x9 : 0000000000000001 x8 : ffffffc011a4f000 [ 0.000000] x7 : 0000000000000000 x6 : 000000000000003f [ 0.000000] x5 : 00000000000235b8 x4 : 0000000000000001 [ 0.000000] x3 : 0000000000000001 x2 : ffffffc010f5acdc [ 0.000000] x1 : ffffff8027880000 x0 : ffffffc01151ade2 [ 0.000000] Call trace: [ 0.000000] ftrace_bug+0x94/0x268 [ 0.000000] ftrace_process_locs+0x364/0x3e0 [ 0.000000] ftrace_init+0xac/0xdc [ 0.000000] start_kernel+0x194/0x43c [ 0.000000] ---[ end trace a8999690c4edae17 ]--- [ 0.000000] ftrace failed to modify [ 0.000000] [<0000000000000020>] 0x20 [ 0.000000] actual: [ 0.000000] Unable to handle kernel read from unreadable memory at virtual address 0000000000000020 [ 0.000000] Mem abort info: [ 0.000000] ESR = 0x96000005 [ 0.000000] EC = 0x25: DABT (current EL), IL = 32 bits [ 0.000000] SET = 0, FnV = 0 [ 0.000000] EA = 0, S1PTW = 0 [ 0.000000] Data abort info: [ 0.000000] ISV = 0, ISS = 0x00000005 [ 0.000000] CM = 0, WnR = 0 [ 0.000000] [0000000000000020] user address but active_mm is swapper [ 0.000000] Internal error: Oops: 96000005 [#1] PREEMPT SMP [ 0.000000] Modules linked in: [ 0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G W 5.4.69-0-1pre+ #1 [ 0.000000] Hardware name: BCM972180HB_V20 (DT) [ 0.000000] pstate: 60400085 (nZCv daIf +PAN -UAO) [ 0.000000] pc : print_ip_ins+0x48/0x80 [ 0.000000] lr : print_ip_ins+0x2c/0x80 [ 0.000000] sp : ffffffc011a43eb0 [ 0.000000] x29: ffffffc011a43eb0 x28: 0000000000000001 [ 0.000000] x27: ffffff8027801380 x26: 0000000000000000 [ 0.000000] x25: ffffff8027880008 x24: 0000000000000000 [ 0.000000] x23: ffffffc0115f1abc x22: ffffffc01160e929 [ 0.000000] x21: 0000000000000000 x20: ffffffc011577a9c [ 0.000000] x19: 0000000000000020 x18: ffffffc011a79028 [ 0.000000] x17: 000000000000002c x16: ffffffc010f33fec [ 0.000000] x15: 0000000000000004 x14: ffff0000ffffff00 [ 0.000000] x13: 0000000000000000 x12: 0000000000000000 [ 0.000000] x11: 0000000000000000 x10: 00000000ffffffff [ 0.000000] x9 : 0000000000000000 x8 : 0000000000000000 [ 0.000000] x7 : 3030303030303030 x6 : ffffffc011c031a3 [ 0.000000] x5 : 000000000000000b x4 : ffffffc011c00866 [ 0.000000] x3 : 0000000000000020 x2 : 000000000000000b [ 0.000000] x1 : ffffffc011c00871 x0 : 000000000000000b [ 0.000000] Call trace: [ 0.000000] print_ip_ins+0x48/0x80 [ 0.000000] ftrace_bug+0xcc/0x268 [ 0.000000] ftrace_process_locs+0x364/0x3e0 [ 0.000000] ftrace_init+0xac/0xdc [ 0.000000] start_kernel+0x194/0x43c [ 0.000000] Code: aa1f03f5 9124a6d6 912af2f7 912a7294 (38756a62) [ 0.000000] ---[ end trace a8999690c4edae18 ]--- [ 0.000000] Kernel panic - not syncing: Attempted to kill the idle task! This can be fixed by avoiding STT_FILE symbols as the base for mcount offset relocation. Bug: 168835511 Signed-off-by: Danesh Petigara Signed-off-by: Pierre Couillaud Change-Id: I9e73706d5104bfa81bccd091e956660364f294de --- scripts/recordmcount.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/recordmcount.h b/scripts/recordmcount.h index f9b19524da11..42ad2f95e2f2 100644 --- a/scripts/recordmcount.h +++ b/scripts/recordmcount.h @@ -529,6 +529,9 @@ static int find_secsym_ndx(unsigned const txtndx, if (txtndx == get_symindex(symp, symtab, symtab_shndx) /* avoid STB_WEAK */ && (STB_LOCAL == st_bind || STB_GLOBAL == st_bind)) { + /* avoid file symbols */ + if (ELF_ST_TYPE(symp->st_info) == STT_FILE) + continue; /* function symbols on ARM have quirks, avoid them */ if (w2(ehdr->e_machine) == EM_ARM && ELF_ST_TYPE(symp->st_info) == STT_FUNC) From cea56b5c1065aef8655fb4d58fee3a15a4de7590 Mon Sep 17 00:00:00 2001 From: Chanho Park Date: Tue, 3 Mar 2020 23:40:52 +0530 Subject: [PATCH 23/33] ANDROID: PCI: dwc: export symbols for ep driver Export symbols for building Designware PCIe EP driver as kernel module. Partially cherry-picked for EXPORT_SYMBOL_GPL part from below patch. c57247f940e8 ("PCI: tegra: Add support for PCIe endpoint mode in Tegra194") Bug: 167931570 (partial backport of commit c57247f940e8ea13a0ec33378304dc3cdc5da4a8. Didn't backport entier patch because it requires below two precedence patchset to avoid patch conflict. "Add support to defer core initialization" by Vidya "Improvements to PCIe Endpoint Core" by Kishon) Signed-off-by: Chanho Park Change-Id: I4df622d67d4202c650abff6c424d1e3cb30408e2 --- drivers/pci/controller/dwc/pcie-designware-ep.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c index 3dd2e2697294..d6d9667c947a 100644 --- a/drivers/pci/controller/dwc/pcie-designware-ep.c +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c @@ -18,6 +18,7 @@ void dw_pcie_ep_linkup(struct dw_pcie_ep *ep) pci_epc_linkup(epc); } +EXPORT_SYMBOL_GPL(dw_pcie_ep_linkup); static void __dw_pcie_ep_reset_bar(struct dw_pcie *pci, enum pci_barno bar, int flags) @@ -607,3 +608,4 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep) return 0; } +EXPORT_SYMBOL_GPL(dw_pcie_ep_init); From 39133635c59157c271cc94a87244099cb3ae6da2 Mon Sep 17 00:00:00 2001 From: Chanho Park Date: Tue, 13 Oct 2020 18:52:37 +0900 Subject: [PATCH 24/33] ANDROID: GKI: add built-in PCIE_DW_PLAT_EP To build an EP driver which is based on PCIe designware as module, we need to get some symbols from pcie-designware_ep.c. To select the source from GKI kernel, we should enable PCIE_DW_PLAT_EP driver as prebuilt. Bug: 167931570 Signed-off-by: Chanho Park Change-Id: I12f796cb35794e29d1fa425d26e2c9ee2c855da2 --- arch/arm64/configs/gki_defconfig | 2 ++ arch/x86/configs/gki_defconfig | 2 ++ 2 files changed, 4 insertions(+) diff --git a/arch/arm64/configs/gki_defconfig b/arch/arm64/configs/gki_defconfig index 658d4cd899e1..b30790cd7704 100644 --- a/arch/arm64/configs/gki_defconfig +++ b/arch/arm64/configs/gki_defconfig @@ -230,8 +230,10 @@ CONFIG_PCI=y CONFIG_PCIEPORTBUS=y # CONFIG_PCIEAER is not set CONFIG_PCI_HOST_GENERIC=y +CONFIG_PCIE_DW_PLAT_EP=y CONFIG_PCIE_QCOM=y CONFIG_PCIE_KIRIN=y +CONFIG_PCI_ENDPOINT=y CONFIG_FW_LOADER_USER_HELPER=y CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y # CONFIG_FW_CACHE is not set diff --git a/arch/x86/configs/gki_defconfig b/arch/x86/configs/gki_defconfig index 066dac7dfa88..7da7f03361ca 100644 --- a/arch/x86/configs/gki_defconfig +++ b/arch/x86/configs/gki_defconfig @@ -205,6 +205,8 @@ CONFIG_PCI=y CONFIG_PCIEPORTBUS=y # CONFIG_PCIEAER is not set CONFIG_PCI_MSI=y +CONFIG_PCIE_DW_PLAT_EP=y +CONFIG_PCI_ENDPOINT=y CONFIG_FW_LOADER_USER_HELPER=y CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y # CONFIG_FW_CACHE is not set From e675b8a59a1bab2b0ddc0027607f1fbc0a6dc7d9 Mon Sep 17 00:00:00 2001 From: Sami Tolvanen Date: Mon, 12 Oct 2020 14:17:56 -0700 Subject: [PATCH 25/33] ANDROID: kbuild: disable GCOV with CFI With GCOV enabled, LLVM generates calls to compiler-generated __llvm_gcov_* functions, but doesn't add them to the CFI jump table, which trips indirect call checking. Work around the issue by disabling CFI when GCOV_KERNEL is enabled. Bug: 169124292 Change-Id: Ifd60cd9eda2bcdd86838ac5ce41bb0dbc00d602f Signed-off-by: Sami Tolvanen (cherry picked from commit 93a4197bc23a4a6967ff0592d07f3cf4cd69b1d6) --- arch/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/Kconfig b/arch/Kconfig index e2465e92ca21..d53afd0c8323 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -605,6 +605,7 @@ endchoice config CFI_CLANG bool "Use Clang's Control Flow Integrity (CFI)" depends on LTO_CLANG && KALLSYMS + depends on !GCOV_KERNEL help This option enables Clang's Control Flow Integrity (CFI), which adds runtime checking for indirect function calls. From 58e01352ee695bb234e9dfdc0654f1af661f503f Mon Sep 17 00:00:00 2001 From: "hajun.sung" Date: Fri, 23 Oct 2020 14:48:15 +0900 Subject: [PATCH 26/33] ANDROID: GKI: Update abi_gki_aarch64_exynos Leaf changes summary: 1 artifact changed (1 filtered out) Changed leaf types summary: 0 (1 filtered out) leaf type changed Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 0 Added function Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 1 Added variable 1 Added variable: [A] 'tracepoint __tracepoint_gpu_mem_total' Bug: 171536491 Change-Id: I2334f11828c2637c1a85cb7391ef7f4fb2fec902 Signed-off-by: hajun.sung --- android/abi_gki_aarch64.xml | 2116 ++++++++++++++++++++------------ android/abi_gki_aarch64_exynos | 4 + 2 files changed, 1317 insertions(+), 803 deletions(-) diff --git a/android/abi_gki_aarch64.xml b/android/abi_gki_aarch64.xml index 18c8c69aeec7..86c4dcbfb904 100644 --- a/android/abi_gki_aarch64.xml +++ b/android/abi_gki_aarch64.xml @@ -4338,6 +4338,7 @@ + @@ -4468,34 +4469,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -4587,6 +4560,7 @@ + @@ -4861,7 +4835,7 @@ - + @@ -5010,7 +4984,7 @@ - + @@ -5431,198 +5405,198 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -12177,6 +12151,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -12357,7 +12355,7 @@ - + @@ -12365,7 +12363,7 @@ - + @@ -12373,7 +12371,7 @@ - + @@ -14184,7 +14182,7 @@ - + @@ -14198,7 +14196,7 @@ - + @@ -14472,6 +14470,7 @@ + @@ -16134,8 +16133,6 @@ - - @@ -16949,7 +16946,7 @@ - + @@ -17066,7 +17063,7 @@ - + @@ -17126,8 +17123,8 @@ - - + + @@ -17341,6 +17338,17 @@ + + + + + + + + + + + @@ -17417,6 +17425,7 @@ + @@ -17451,6 +17460,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -17488,6 +17536,7 @@ + @@ -17635,6 +17684,17 @@ + + + + + + + + + + + @@ -18372,7 +18432,7 @@ - + @@ -18388,12 +18448,12 @@ - + - + @@ -18475,7 +18535,7 @@ - + @@ -18866,7 +18926,7 @@ - + @@ -19103,7 +19163,7 @@ - + @@ -19244,7 +19304,7 @@ - + @@ -20059,6 +20119,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -20076,7 +20174,7 @@ - + @@ -20207,44 +20305,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -20875,7 +20935,7 @@ - + @@ -20897,7 +20957,7 @@ - + @@ -21582,7 +21642,7 @@ - + @@ -21590,7 +21650,7 @@ - + @@ -21604,6 +21664,7 @@ + @@ -28926,6 +28987,17 @@ + + + + + + + + + + + @@ -28965,6 +29037,7 @@ + @@ -29017,6 +29090,17 @@ + + + + + + + + + + + @@ -29090,6 +29174,7 @@ + @@ -37572,14 +37657,6 @@ - - - - - - - - @@ -38515,13 +38592,13 @@ - + - + @@ -38604,7 +38681,7 @@ - + @@ -39002,7 +39079,7 @@ - + @@ -39195,6 +39272,9 @@ + + + @@ -39763,6 +39843,17 @@ + + + + + + + + + + + @@ -39884,6 +39975,7 @@ + @@ -42281,6 +42373,17 @@ + + + + + + + + + + + @@ -42344,6 +42447,7 @@ + @@ -42819,6 +42923,17 @@ + + + + + + + + + + + @@ -43019,6 +43134,7 @@ + @@ -46096,7 +46212,7 @@ - + @@ -46195,7 +46311,7 @@ - + @@ -48104,7 +48220,7 @@ - + @@ -48617,7 +48733,7 @@ - + @@ -48741,7 +48857,7 @@ - + @@ -49250,7 +49366,7 @@ - + @@ -49314,7 +49430,7 @@ - + @@ -49371,7 +49487,7 @@ - + @@ -49510,7 +49626,7 @@ - + @@ -49541,7 +49657,7 @@ - + @@ -49552,7 +49668,7 @@ - + @@ -49811,7 +49927,7 @@ - + @@ -49830,7 +49946,7 @@ - + @@ -49867,7 +49983,7 @@ - + @@ -49991,7 +50107,7 @@ - + @@ -50012,7 +50128,7 @@ - + @@ -50049,7 +50165,7 @@ - + @@ -50143,7 +50259,7 @@ - + @@ -50202,7 +50318,7 @@ - + @@ -51214,6 +51330,7 @@ + @@ -51273,7 +51390,6 @@ - @@ -52197,7 +52313,7 @@ - + @@ -52205,7 +52321,7 @@ - + @@ -52647,7 +52763,7 @@ - + @@ -52698,7 +52814,7 @@ - + @@ -52924,7 +53040,7 @@ - + @@ -53569,6 +53685,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -54015,25 +54166,6 @@ - - - - - - - - - - - - - - - - - - - @@ -55126,7 +55258,7 @@ - + @@ -55150,7 +55282,18 @@ - + + + + + + + + + + + + @@ -55296,6 +55439,14 @@ + + + + + + + + @@ -55576,6 +55727,7 @@ + @@ -56046,17 +56198,6 @@ - - - - - - - - - - - @@ -59390,7 +59531,7 @@ - + @@ -59619,6 +59760,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -59715,6 +60017,17 @@ + + + + + + + + + + + @@ -60772,7 +61085,7 @@ - + @@ -60978,8 +61291,8 @@ - - + + @@ -61103,7 +61416,7 @@ - + @@ -61117,7 +61430,7 @@ - + @@ -61159,7 +61472,7 @@ - + @@ -62362,7 +62675,7 @@ - + @@ -62922,7 +63235,7 @@ - + @@ -64127,7 +64440,7 @@ - + @@ -64138,7 +64451,7 @@ - + @@ -64146,7 +64459,7 @@ - + @@ -64162,7 +64475,7 @@ - + @@ -64178,7 +64491,7 @@ - + @@ -64186,7 +64499,7 @@ - + @@ -64200,7 +64513,7 @@ - + @@ -64211,7 +64524,7 @@ - + @@ -64219,7 +64532,7 @@ - + @@ -64227,7 +64540,7 @@ - + @@ -64235,7 +64548,7 @@ - + @@ -64243,7 +64556,7 @@ - + @@ -64262,18 +64575,7 @@ - - - - - - - - - - - - + @@ -64435,7 +64737,18 @@ - + + + + + + + + + + + + @@ -64465,7 +64778,7 @@ - + @@ -64481,6 +64794,8 @@ + + @@ -64543,6 +64858,7 @@ + @@ -64595,6 +64911,17 @@ + + + + + + + + + + + @@ -64652,6 +64979,7 @@ + @@ -64800,14 +65128,6 @@ - - - - - - - - @@ -65158,6 +65478,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -65919,12 +66262,6 @@ - - - - - - @@ -70984,7 +71321,6 @@ - @@ -71149,30 +71485,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -74247,6 +74559,17 @@ + + + + + + + + + + + @@ -74345,7 +74668,7 @@ - + @@ -74526,6 +74849,7 @@ + @@ -77074,6 +77398,17 @@ + + + + + + + + + + + @@ -77085,6 +77420,7 @@ + @@ -77228,11 +77564,6 @@ - - - - - @@ -79179,6 +79510,17 @@ + + + + + + + + + + + @@ -79247,8 +79589,20 @@ + + + + + + + + + + + + @@ -79261,6 +79615,7 @@ + @@ -80873,6 +81228,17 @@ + + + + + + + + + + + @@ -81327,17 +81693,6 @@ - - - - - - - - - - - @@ -86181,7 +86536,7 @@ - + @@ -86741,6 +87096,17 @@ + + + + + + + + + + + @@ -86779,6 +87145,7 @@ + @@ -87189,6 +87556,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -87301,7 +87694,7 @@ - + @@ -87332,32 +87725,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -87427,7 +87794,7 @@ - + @@ -87647,6 +88014,14 @@ + + + + + + + + @@ -88036,7 +88411,7 @@ - + @@ -88059,7 +88434,7 @@ - + @@ -88339,18 +88714,7 @@ - - - - - - - - - - - - + @@ -88389,14 +88753,6 @@ - - - - - - - - @@ -88739,6 +89095,17 @@ + + + + + + + + + + + @@ -88793,7 +89160,7 @@ - + @@ -88801,7 +89168,7 @@ - + @@ -88823,7 +89190,7 @@ - + @@ -89056,6 +89423,7 @@ + @@ -89084,12 +89452,8 @@ - - - - @@ -90536,11 +90900,23 @@ + + + + + + + + + + + + @@ -90705,7 +91081,11 @@ + + + + @@ -91453,7 +91833,7 @@ - + @@ -91878,6 +92258,17 @@ + + + + + + + + + + + @@ -91968,6 +92359,7 @@ + @@ -92218,10 +92610,22 @@ + + + + + + + + + + + + @@ -92467,34 +92871,34 @@ - + - + - + - + - + - + - + - + - + - + - + @@ -92508,16 +92912,16 @@ - - + + - - - - - - + + + + + + @@ -93422,7 +93826,6 @@ - @@ -93431,7 +93834,6 @@ - @@ -95451,7 +95853,7 @@ - + @@ -95573,7 +95975,7 @@ - + @@ -95612,7 +96014,7 @@ - + @@ -99152,7 +99554,7 @@ - + @@ -101764,6 +102166,17 @@ + + + + + + + + + + + @@ -102201,7 +102614,7 @@ - + @@ -102824,6 +103237,7 @@ + @@ -103902,7 +104316,7 @@ - + @@ -103910,7 +104324,8 @@ - + + @@ -104305,6 +104720,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -104356,6 +104797,8 @@ + + @@ -104414,6 +104857,7 @@ + @@ -104685,6 +105129,17 @@ + + + + + + + + + + + @@ -104765,6 +105220,7 @@ + @@ -106882,6 +107338,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -106989,26 +107465,6 @@ - - - - - - - - - - - - - - - - - - - - @@ -107231,23 +107687,6 @@ - - - - - - - - - - - - - - - - - @@ -107795,238 +108234,23 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -108181,18 +108405,7 @@ - - - - - - - - - - - @@ -108375,13 +108588,6 @@ - - - - - - - @@ -108389,10 +108595,6 @@ - - - - @@ -108667,6 +108869,17 @@ + + + + + + + + + + + @@ -108697,6 +108910,7 @@ + @@ -108816,14 +109030,14 @@ - - - + + + + + + - - - - + @@ -109007,6 +109221,14 @@ + + + + + + + + @@ -109153,18 +109375,18 @@ - + - + - + @@ -109263,7 +109485,7 @@ - + @@ -109291,6 +109513,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -109774,6 +110022,14 @@ + + + + + + + + @@ -110005,7 +110261,7 @@ - + @@ -110468,7 +110724,7 @@ - + @@ -110548,14 +110804,6 @@ - - - - - - - - @@ -111095,6 +111343,14 @@ + + + + + + + + @@ -111382,6 +111638,14 @@ + + + + + + + + @@ -111531,7 +111795,7 @@ - + @@ -111546,68 +111810,29 @@ - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + + + + - - - - - - - - - - - - - - - - - @@ -111619,6 +111844,7 @@ + @@ -112337,7 +112563,19 @@ - + + + + + + + + + + + + + @@ -112345,7 +112583,7 @@ - + @@ -112353,6 +112591,22 @@ + + + + + + + + + + + + + + + + @@ -113204,7 +113458,7 @@ - + @@ -113368,7 +113622,7 @@ - + @@ -114252,14 +114506,6 @@ - - - - - - - - @@ -115240,7 +115486,7 @@ - + @@ -115667,7 +115913,6 @@ - @@ -116458,25 +116703,6 @@ - - - - - - - - - - - - - - - - - - - @@ -116530,7 +116756,7 @@ - + @@ -116542,7 +116768,7 @@ - + @@ -116555,7 +116781,7 @@ - + @@ -116665,6 +116891,17 @@ + + + + + + + + + + + @@ -117076,26 +117313,260 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + + + + + + + + + + + + @@ -117179,6 +117650,17 @@ + + + + + + + + + + + @@ -118312,6 +118794,17 @@ + + + + + + + + + + + @@ -120293,7 +120786,7 @@ - + @@ -121739,6 +122232,7 @@ + @@ -121799,7 +122293,7 @@ - + @@ -123124,7 +123618,7 @@ - + @@ -123145,7 +123639,7 @@ - + @@ -123279,6 +123773,22 @@ + + + + + + + + + + + + + + + + @@ -123530,7 +124040,7 @@ - + diff --git a/android/abi_gki_aarch64_exynos b/android/abi_gki_aarch64_exynos index 3e86b71f22cd..4222e5233d9d 100644 --- a/android/abi_gki_aarch64_exynos +++ b/android/abi_gki_aarch64_exynos @@ -19,6 +19,7 @@ amba_driver_register amba_driver_unregister anon_inode_getfd + __arch_clear_user __arch_copy_from_user __arch_copy_in_user __arch_copy_to_user @@ -165,6 +166,7 @@ config_ep_by_speed config_group_init_type_name console_lock + console_stop console_trylock console_unlock __const_udelay @@ -1547,6 +1549,7 @@ __tracepoint_android_vh_is_fpsimd_save __tracepoint_device_pm_callback_end __tracepoint_device_pm_callback_start + __tracepoint_gpu_mem_total __tracepoint_pelt_cfs_tp tracepoint_probe_register __tracepoint_suspend_resume @@ -1596,6 +1599,7 @@ ufshcd_dme_get_attr ufshcd_dme_set_attr ufshcd_pltfrm_init + ufshcd_query_descriptor_retry ufshcd_remove ufshcd_shutdown ufshcd_system_resume From d82457153cb0ab4c0922da3fd2191ddd067497d6 Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Wed, 23 Oct 2019 21:56:30 +0100 Subject: [PATCH 27/33] UPSTREAM: sched/fair/util_est: Implement faster ramp-up EWMA on utilization increases The estimated utilization for a task: util_est = max(util_avg, est.enqueue, est.ewma) is defined based on: - util_avg: the PELT defined utilization - est.enqueued: the util_avg at the end of the last activation - est.ewma: a exponential moving average on the est.enqueued samples According to this definition, when a task suddenly changes its bandwidth requirements from small to big, the EWMA will need to collect multiple samples before converging up to track the new big utilization. This slow convergence towards bigger utilization values is not aligned to the default scheduler behavior, which is to optimize for performance. Moreover, the est.ewma component fails to compensate for temporarely utilization drops which spans just few est.enqueued samples. To let util_est do a better job in the scenario depicted above, change its definition by making util_est directly follow upward motion and only decay the est.ewma on downward. Bug: 120440300 Signed-off-by: Patrick Bellasi Signed-off-by: Peter Zijlstra (Intel) Acked-by: Vincent Guittot Cc: Dietmar Eggemann Cc: Douglas Raillard Cc: Juri Lelli Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Quentin Perret Cc: Rafael J . Wysocki Cc: Thomas Gleixner Link: https://lkml.kernel.org/r/20191023205630.14469-1-patrick.bellasi@matbug.net Signed-off-by: Ingo Molnar (cherry picked from commit b8c96361402aa3e74ad48ceef18aed99153d8da8) Signed-off-by: Qais Yousef Change-Id: Iaa75dec917748375d9043c3ebf21bf272299c8dd --- kernel/sched/fair.c | 14 +++++++++++++- kernel/sched/features.h | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index f78a92c2b54b..63f48ba96d88 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3780,11 +3780,22 @@ util_est_dequeue(struct cfs_rq *cfs_rq, struct task_struct *p, bool task_sleep) if (ue.enqueued & UTIL_AVG_UNCHANGED) return; + /* + * Reset EWMA on utilization increases, the moving average is used only + * to smooth utilization decreases. + */ + ue.enqueued = (task_util(p) | UTIL_AVG_UNCHANGED); + if (sched_feat(UTIL_EST_FASTUP)) { + if (ue.ewma < ue.enqueued) { + ue.ewma = ue.enqueued; + goto done; + } + } + /* * Skip update of task's estimated utilization when its EWMA is * already ~1% close to its last activation value. */ - ue.enqueued = (task_util(p) | UTIL_AVG_UNCHANGED); last_ewma_diff = ue.enqueued - ue.ewma; if (within_margin(last_ewma_diff, (SCHED_CAPACITY_SCALE / 100))) return; @@ -3817,6 +3828,7 @@ util_est_dequeue(struct cfs_rq *cfs_rq, struct task_struct *p, bool task_sleep) ue.ewma <<= UTIL_EST_WEIGHT_SHIFT; ue.ewma += last_ewma_diff; ue.ewma >>= UTIL_EST_WEIGHT_SHIFT; +done: WRITE_ONCE(p->se.avg.util_est, ue); } diff --git a/kernel/sched/features.h b/kernel/sched/features.h index 2410db5e9a35..7481cd96f391 100644 --- a/kernel/sched/features.h +++ b/kernel/sched/features.h @@ -89,3 +89,4 @@ SCHED_FEAT(WA_BIAS, true) * UtilEstimation. Use estimated CPU utilization. */ SCHED_FEAT(UTIL_EST, true) +SCHED_FEAT(UTIL_EST_FASTUP, true) From b494bbca7a770c777b4e869dc6dcf0e07acc5529 Mon Sep 17 00:00:00 2001 From: Archana Sriram Date: Mon, 26 Oct 2020 22:40:11 +0530 Subject: [PATCH 28/33] ANDROID: ABI: update allowed list for QCOM Update the android/abi_gki_aarch64_qcom with recent symbol additions. Simple change and no need to update the .xml file, as no new symbol addition. Bug: 171693478 Signed-off-by: Archana Sriram Change-Id: Ic105f1f4d3c3409c461e49035cad5806f5fce22c --- android/abi_gki_aarch64_qcom | 2 ++ 1 file changed, 2 insertions(+) diff --git a/android/abi_gki_aarch64_qcom b/android/abi_gki_aarch64_qcom index 7185732b36b2..17635e3a115a 100644 --- a/android/abi_gki_aarch64_qcom +++ b/android/abi_gki_aarch64_qcom @@ -957,6 +957,7 @@ get_random_bytes get_random_u32 __get_task_comm + get_task_pid get_tree_single get_unmapped_area get_unused_fd_flags @@ -1776,6 +1777,7 @@ put_device put_disk __put_page + put_pid __put_task_struct put_unused_fd put_vaddr_frames From 1eb128820e3cd5f6d15529f2a730c3ec46d3b00b Mon Sep 17 00:00:00 2001 From: Sami Tolvanen Date: Wed, 14 Oct 2020 13:24:28 -0700 Subject: [PATCH 29/33] ANDROID: scs: use vmapped shadow stacks by default Enable CONFIG_SHADOW_CALL_STACK_VMAP by default, and as we allocate a full page for the stack, allow the kernel use all of it. Bug: 169781940 Change-Id: Ie8eaa7f24e9bf10ff28a302ac98ad843b71c9c2a Signed-off-by: Sami Tolvanen --- arch/Kconfig | 1 + include/linux/scs.h | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/arch/Kconfig b/arch/Kconfig index d53afd0c8323..88401dab0689 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -549,6 +549,7 @@ config SHADOW_CALL_STACK config SHADOW_CALL_STACK_VMAP bool "Use virtually mapped shadow call stacks" depends on SHADOW_CALL_STACK + default y help Use virtually mapped shadow call stacks. Selecting this option provides better stack exhaustion protection, but increases per-thread diff --git a/include/linux/scs.h b/include/linux/scs.h index c5572fd770b0..f8c8beff7850 100644 --- a/include/linux/scs.h +++ b/include/linux/scs.h @@ -14,12 +14,17 @@ #ifdef CONFIG_SHADOW_CALL_STACK +#ifdef CONFIG_SHADOW_CALL_STACK_VMAP +#define SCS_SIZE PAGE_SIZE +#else /* * In testing, 1 KiB shadow stack size (i.e. 128 stack frames on a 64-bit * architecture) provided ~40% safety margin on stack usage while keeping * memory allocation overhead reasonable. */ #define SCS_SIZE 1024UL +#endif + #define GFP_SCS (GFP_KERNEL | __GFP_ZERO) /* From 42a391fef2e2f90aca29b7cde23a5e8bb75ffee2 Mon Sep 17 00:00:00 2001 From: Peter Wuw Date: Fri, 16 Oct 2020 18:49:34 +0800 Subject: [PATCH 30/33] ANDROID: GKI: Update abi_gki_aarch64_oneplus Add some symbols to symbol list included by oem modules. Bug: 165594476 Change-Id: I2ce478cf2fff9d570122910cc4007523afc8fa9f Signed-off-by: Peter Wuw --- android/abi_gki_aarch64_oneplus | 1478 +++++++++++++++++++++++++++++-- 1 file changed, 1401 insertions(+), 77 deletions(-) diff --git a/android/abi_gki_aarch64_oneplus b/android/abi_gki_aarch64_oneplus index 9d8fa8a826ad..57fde0b742f2 100644 --- a/android/abi_gki_aarch64_oneplus +++ b/android/abi_gki_aarch64_oneplus @@ -35,11 +35,13 @@ cdev_alloc cdev_del cdev_init + __cfi_slowpath __check_object_size __class_create class_destroy __class_register class_unregister + cleanup_srcu_struct clk_bulk_disable clk_bulk_enable clk_bulk_prepare @@ -79,7 +81,6 @@ __const_udelay consume_skb contig_page_data - _copy_from_iter_full cpu_hwcap_keys cpu_hwcaps cpumask_next @@ -88,6 +89,9 @@ __cpu_possible_mask __cpu_present_mask crc32_le + crypto_alloc_shash + crypto_destroy_tfm + crypto_shash_digest _ctype delayed_work_timer_fn del_timer @@ -103,15 +107,12 @@ device_create device_create_bin_file device_create_file - device_del device_destroy + device_find_child device_for_each_child - device_get_next_child_node device_initialize device_init_wakeup - device_match_fwnode device_property_present - device_property_read_string device_property_read_u32_array device_register device_remove_file @@ -128,7 +129,10 @@ devm_extcon_dev_register devm_free_irq devm_gpiod_get_optional + devm_gpio_free + devm_gpio_request devm_gpio_request_one + devm_iio_channel_get devm_input_allocate_device devm_ioremap devm_ioremap_nocache @@ -165,7 +169,6 @@ devm_reset_controller_register devm_thermal_zone_of_sensor_register devm_usb_get_phy_by_phandle - _dev_notice dev_pm_opp_add dev_pm_opp_find_freq_ceil dev_pm_opp_get_opp_count @@ -191,8 +194,6 @@ dma_buf_fd dma_buf_get dma_buf_get_flags - dma_buf_kmap - dma_buf_kunmap dma_buf_map_attachment dma_buf_put dma_buf_unmap_attachment @@ -208,6 +209,7 @@ dma_direct_unmap_page dma_direct_unmap_sg dma_fence_add_callback + dma_fence_array_create dma_fence_array_ops dma_fence_context_alloc dma_fence_default_wait @@ -232,6 +234,7 @@ driver_unregister drm_panel_notifier_register drm_panel_notifier_unregister + dump_stack enable_irq event_triggers_call extcon_get_edev_by_phandle @@ -239,12 +242,12 @@ extcon_register_notifier extcon_set_state_sync fd_install + fget find_last_bit find_next_bit find_next_zero_bit find_vma finish_wait - firmware_request_nowarn flush_delayed_work flush_work flush_workqueue @@ -252,8 +255,8 @@ free_irq free_netdev __free_pages - freezing_slow_path - fwnode_property_present + free_pages + generic_file_llseek generic_handle_irq genl_register_family genl_unregister_family @@ -264,8 +267,10 @@ gen_pool_free_owner get_cpu_device get_device + __get_free_pages get_random_bytes get_unused_fd_flags + get_zeroed_page gpiochip_add_data_with_key gpiochip_add_pin_range gpiochip_generic_free @@ -278,8 +283,6 @@ gpiod_get_raw_value gpiod_get_raw_value_cansleep gpiod_get_value - gpiod_get_value_cansleep - gpiod_set_debounce gpiod_set_raw_value gpiod_set_raw_value_cansleep gpiod_set_value @@ -293,12 +296,15 @@ handle_nested_irq handle_simple_irq hex_dump_to_buffer + hrtimer_active hrtimer_cancel hrtimer_init hrtimer_start_range_ns - hrtimer_try_to_cancel i2c_del_driver i2c_register_driver + i2c_smbus_read_byte_data + i2c_smbus_read_i2c_block_data + i2c_smbus_write_byte_data i2c_transfer i2c_transfer_buffer_flags icc_get @@ -321,6 +327,7 @@ idr_get_next idr_preload idr_remove + iio_read_channel_processed init_net __init_rwsem init_timer_key @@ -341,7 +348,6 @@ input_unregister_device input_unregister_handle input_unregister_handler - invalidate_mapping_pages iomem_resource iommu_attach_device iommu_detach_device @@ -351,6 +357,8 @@ iommu_domain_get_attr iommu_domain_set_attr iommu_get_domain_for_dev + iommu_group_get_for_dev + iommu_group_put iommu_map iommu_map_sg iommu_present @@ -382,10 +390,10 @@ irq_modify_status irq_of_parse_and_map irq_set_affinity_hint + irq_set_affinity_notifier irq_set_chained_handler_and_data irq_set_chip_and_handler_name irq_set_chip_data - irq_set_irq_type irq_set_irq_wake irq_to_desc jiffies @@ -398,6 +406,7 @@ kernel_recvmsg kernel_sendmsg __kfifo_in + __kfifo_out kfree kfree_skb kimage_vaddr @@ -415,6 +424,7 @@ kobject_del kobject_init_and_add kobject_put + kobject_uevent kobject_uevent_env krealloc kstrdup @@ -439,7 +449,6 @@ kvfree kvmalloc_node kzfree - led_classdev_unregister __list_add_valid __list_del_entry_valid list_sort @@ -449,18 +458,13 @@ mbox_free_channel mbox_request_channel mbox_send_message - media_device_cleanup - media_device_init - __media_device_register - media_device_unregister - media_entity_pads_init memchr memcmp memcpy __memcpy_fromio __memcpy_toio memdup_user - memmove + memremap memset __memset_io misc_deregister @@ -472,18 +476,18 @@ module_put __msecs_to_jiffies msleep - msleep_interruptible __mutex_init mutex_is_locked mutex_lock mutex_lock_interruptible mutex_trylock mutex_unlock - __netdev_alloc_skb netif_receive_skb netif_rx_ni netif_tx_wake_queue no_llseek + nonseekable_open + noop_llseek nr_cpu_ids ns_to_timespec nvmem_cell_get @@ -509,6 +513,7 @@ of_find_node_with_property of_find_property of_fwnode_ops + of_genpd_add_provider_onecell of_genpd_del_provider of_get_address of_get_child_by_name @@ -554,6 +559,7 @@ param_ops_int param_ops_string param_ops_uint + param_set_bool pci_alloc_irq_vectors_affinity pci_bus_type pci_clear_master @@ -565,6 +571,7 @@ pci_irq_vector pci_load_and_free_saved_state pci_read_config_dword + pci_read_config_word __pci_register_driver pci_release_region pci_request_region @@ -574,6 +581,7 @@ pci_set_power_state pci_store_saved_state pci_unregister_driver + PDE_DATA perf_trace_buf_alloc perf_trace_run_bpf_submit pfn_valid @@ -615,6 +623,7 @@ pm_clk_suspend pm_generic_resume pm_generic_suspend + pm_genpd_add_subdomain pm_genpd_init pm_power_off pm_qos_add_request @@ -649,8 +658,11 @@ print_hex_dump printk proc_create + proc_create_data + proc_mkdir __pskb_pull_tail put_device + __put_page __put_task_struct put_unused_fd pwm_apply_state @@ -690,19 +702,22 @@ __rcu_read_lock __rcu_read_unlock rdev_get_drvdata + reboot_mode refcount_dec_and_test_checked refcount_dec_checked refcount_inc_checked refcount_inc_not_zero_checked - __refrigerator regcache_mark_dirty regcache_sync regcache_sync_region __register_chrdev + register_chrdev_region register_netdev register_pm_notifier + register_reboot_notifier register_restart_handler __register_rpmsg_driver + register_syscore_ops regmap_bulk_read regmap_bulk_write __regmap_init @@ -727,34 +742,35 @@ request_threaded_irq reset_control_assert reset_control_deassert - rpmsg_poll rpmsg_send rpmsg_trysend + rtc_time64_to_tm sched_clock sched_setscheduler schedule schedule_timeout - schedule_timeout_uninterruptible scnprintf - scsi_normalize_sense seq_printf seq_puts + seq_read set_normalized_timespec64 - set_page_dirty_lock sg_alloc_table sg_free_table sg_init_table sg_next __sg_page_iter_next __sg_page_iter_start + simple_open simple_read_from_buffer + simple_strtoul + single_open + single_release skb_clone skb_copy_expand skb_dequeue skb_pull skb_push skb_put - skb_queue_purge skb_queue_tail skb_trim sk_free @@ -762,6 +778,9 @@ snd_info_create_module_entry snd_info_free_entry snd_info_register + snd_pcm_hw_constraint_integer + snd_pcm_lib_ioctl + snd_pcm_period_elapsed snd_soc_add_component_controls snd_soc_component_init_regmap snd_soc_component_read32 @@ -792,6 +811,7 @@ sock_create_kern sock_release sort + spi_sync spmi_controller_add spmi_controller_alloc spmi_controller_remove @@ -804,6 +824,7 @@ __stack_chk_fail __stack_chk_guard strcasecmp + strcat strchr strcmp strcpy @@ -811,13 +832,14 @@ strlcpy strlen strncasecmp + strncat strnchr strncmp + strncpy strnlen strnstr strpbrk strrchr - strscpy strsep strstr __sw_hweight32 @@ -827,19 +849,22 @@ sync_file_get_fence synchronize_irq syscon_node_to_regmap + sysfs_create_bin_file sysfs_create_file_ns sysfs_create_files sysfs_create_group sysfs_create_link sysfs_notify + sysfs_remove_bin_file sysfs_remove_file_ns sysfs_remove_files sysfs_remove_group sysfs_remove_link sysfs_streq system_freezable_wq - system_freezing_cnt + system_highpri_wq system_long_wq + system_power_efficient_wq system_unbound_wq system_wq __tasklet_hi_schedule @@ -871,7 +896,9 @@ unregister_chrdev_region unregister_netdev unregister_pm_notifier + unregister_reboot_notifier unregister_rpmsg_driver + unregister_syscore_ops up_read up_write usb_add_hcd @@ -879,10 +906,6 @@ usb_alloc_coherent usb_alloc_urb usb_assign_descriptors - usb_autopm_get_interface - usb_autopm_put_interface - usb_clear_halt - usb_composite_setup_continue usb_control_msg usb_deregister usb_disabled @@ -894,7 +917,6 @@ usb_ep_free_request usb_ep_queue usb_ep_set_halt - usb_find_common_endpoints usb_free_all_descriptors usb_free_coherent usb_free_urb @@ -902,71 +924,34 @@ usb_function_unregister usb_gadget_wakeup usb_get_dr_mode - usb_gstrings_attach usb_hcd_is_primary_hcd - usb_ifnum_to_if usb_interface_id usb_kill_urb - usb_poison_urb - usb_put_dev usb_put_function_instance usb_put_hcd usb_register_driver usb_remove_hcd usb_remove_phy - usb_set_interface + usb_role_switch_register + usb_role_switch_unregister usb_string_id usb_submit_urb __usecs_to_jiffies usleep_range - v4l2_ctrl_handler_free - __v4l2_ctrl_s_ctrl v4l2_device_register - v4l2_device_register_subdev v4l2_device_unregister v4l2_event_pending - v4l2_event_queue_fh v4l2_event_subscribe v4l2_event_unsubscribe - v4l2_fh_add - v4l2_fh_del - v4l2_fh_exit - v4l2_fh_init - v4l2_fh_open - v4l2_subdev_init vabits_actual - vb2_buffer_done - vb2_dqbuf - vb2_fop_mmap - vb2_fop_poll - vb2_fop_release - vb2_ioctl_create_bufs - vb2_ioctl_dqbuf - vb2_ioctl_qbuf - vb2_ioctl_querybuf - vb2_ioctl_reqbufs - vb2_ioctl_streamoff - vb2_ioctl_streamon - vb2_ops_wait_finish - vb2_ops_wait_prepare - vb2_plane_vaddr - vb2_qbuf - vb2_queue_init - vb2_queue_release - vb2_reqbufs - vb2_streamoff - vb2_streamon vfree video_devdata - video_device_release_empty video_ioctl2 __video_register_device video_unregister_device vmalloc vmap vmemmap - vm_map_ram - vm_unmap_ram vsnprintf vunmap vzalloc @@ -976,7 +961,1346 @@ wait_for_completion_timeout __wake_up wake_up_process + wakeup_source_add wakeup_source_register wakeup_source_unregister __warn_printk work_busy + xa_erase + xa_load + +# required by core_hang_detect.ko + cpu_subsys + +# required by qcom-pdc.ko + irq_chip_get_parent_state + irq_chip_retrigger_hierarchy + irq_domain_alloc_irqs_parent + irq_domain_create_hierarchy + irq_domain_set_hwirq_and_chip + irq_domain_update_bus_token + +# required by phy-generic.ko + regulator_set_current_limit + +# required by ns.ko + kernel_bind + kernel_setsockopt + xa_find + xa_find_after + xa_store + +# required by smcinvoke.ko + anon_inode_getfile + +# required by wsa883x_dlkm.ko + snd_soc_component_exit_regmap + +# required by i2c-msm-geni.ko + i2c_add_adapter + i2c_del_adapter + i2c_get_dma_safe_msg_buf + i2c_put_dma_safe_msg_buf + +# required by msm-vidc.ko + v4l2_ctrl_find + v4l2_ctrl_get_name + v4l2_ctrl_handler_free + v4l2_ctrl_handler_init_class + __v4l2_ctrl_modify_range + v4l2_ctrl_new_custom + v4l2_ctrl_new_std + v4l2_ctrl_new_std_menu + __v4l2_ctrl_s_ctrl + v4l2_event_dequeue + v4l2_event_queue_fh + v4l2_fh_add + v4l2_fh_del + v4l2_fh_exit + v4l2_fh_init + v4l2_s_ctrl + vb2_buffer_done + vb2_dqbuf + vb2_qbuf + vb2_queue_init + vb2_queue_release + vb2_reqbufs + vb2_streamoff + vb2_streamon + +# required by cnss_prealloc.ko + save_stack_trace + stack_trace_print + +# required by qti_amoled_ecm.ko + kstrtou16 + +# required by mbhc_dlkm.ko + snd_jack_set_key + snd_soc_card_jack_new + snd_soc_jack_report + +# required by usbtouchscreen.ko + usb_autopm_get_interface + usb_autopm_put_interface + usb_bulk_msg + +# required by qcom-spmi-temp-alarm.ko + of_thermal_get_ntrips + of_thermal_get_trip_points + of_thermal_is_trip_valid + thermal_zone_device_update + +# required by smp2p.ko + irq_set_parent + +# required by typec_ucsi.ko + device_get_next_child_node + fwnode_usb_role_switch_get + typec_altmode_get_partner + typec_altmode_update_active + typec_get_drvdata + typec_partner_register_altmode + typec_port_register_altmode + typec_register_partner + typec_register_port + typec_set_data_role + typec_set_pwr_opmode + typec_set_pwr_role + typec_unregister_altmode + typec_unregister_partner + typec_unregister_port + usb_role_switch_set_role + +# required by msm_rng.ko + crypto_register_rngs + crypto_unregister_rngs + hwrng_register + hwrng_unregister + +# required by touchscreen.ko + wait_for_completion_killable_timeout + +# required by ssusb-redriver-nb7vpq904m.ko + of_find_i2c_device_by_node + +# required by frpc-adsprpc.ko + memmove + try_wait_for_completion + +# required by dwc3-qcom.ko + devm_extcon_register_notifier + of_clk_get + of_clk_get_parent_count + +# required by ufshcd-crypto-qti.ko + keyslot_manager_create + keyslot_manager_private + ufshcd_crypto_cap_find + ufshcd_crypto_disable_spec + ufshcd_crypto_enable_spec + ufshcd_hold + ufshcd_release + +# required by tx_macro_dlkm.ko + snd_soc_get_enum_double + snd_soc_put_enum_double + +# required by qcom-arm-smmu-mod.ko + alloc_io_pgtable_ops + amba_bustype + bus_set_iommu + device_link_add + device_link_del + device_match_fwnode + _dev_notice + driver_find_device + free_io_pgtable_ops + generic_device_group + iommu_alloc_resv_region + iommu_device_register + iommu_device_unregister + iommu_dma_get_resv_regions + iommu_fwspec_add_ids + iommu_fwspec_free + iommu_get_dma_cookie + iommu_group_get + iommu_group_get_iommudata + iommu_group_ref_get + iommu_group_remove_device + iommu_group_set_iommudata + iommu_put_dma_cookie + of_dma_is_coherent + of_n_addr_cells + of_n_size_cells + pci_device_group + regulator_bulk_disable + regulator_disable_deferred + report_iommu_fault + +# required by gf_spi_driver.ko + __netlink_kernel_create + netlink_kernel_release + netlink_unicast + __nlmsg_put + wakeup_source_remove + +# required by wcd_core_dlkm.ko + devm_regmap_add_irq_chip + devm_regmap_del_irq_chip + irq_create_mapping + regmap_irq_get_virq + snd_soc_dapm_disable_pin + snd_soc_dapm_force_enable_pin + +# required by dwc3-haps.ko + pcim_enable_device + +# required by msm_qmp.ko + mbox_chan_received_data + mbox_chan_txdone + +# required by msm-poweroff.ko + param_set_int + +# required by qrtr.ko + alloc_skb_with_frags + capable + _copy_from_iter_full + datagram_poll + in_egroup_p + lock_sock_nested + proto_register + proto_unregister + radix_tree_iter_delete + radix_tree_next_chunk + refcount_dec_not_one + release_sock + sk_alloc + skb_copy_bits + skb_copy_datagram_iter + skb_free_datagram + __skb_pad + skb_queue_purge + skb_recv_datagram + skb_set_owner_w + skb_store_bits + sock_alloc_send_skb + sock_gettstamp + sock_init_data + sock_no_accept + sock_no_getsockopt + sock_no_listen + sock_no_mmap + sock_no_sendpage + sock_no_setsockopt + sock_no_shutdown + sock_no_socketpair + sock_queue_rcv_skb + sock_register + sock_unregister + +# required by atmel_mxt_ts.ko + desc_to_gpio + input_alloc_absinfo + input_mt_report_pointer_emulation + kmemdup_nul + +# required by qti-fixed-regulator.ko + gpiod_get_optional + +# required by dwc3.ko + device_property_read_string + device_property_read_u8_array + devm_usb_get_phy + extcon_find_edev_by_node + extcon_get_extcon_dev + extcon_unregister_notifier + of_usb_get_phy_mode + phy_pm_runtime_get_sync + phy_pm_runtime_put_sync + platform_get_irq_byname_optional + usb_add_gadget_udc + usb_decode_ctrl + usb_del_gadget_udc + usb_ep_set_maxpacket_limit + usb_gadget_giveback_request + usb_gadget_map_request_by_dev + usb_gadget_set_state + usb_gadget_udc_reset + usb_gadget_unmap_request_by_dev + usb_gadget_vbus_draw + usb_get_maximum_speed + +# required by extcon-usb-gpio.ko + device_set_wakeup_capable + gpiod_get_value_cansleep + gpiod_set_debounce + +# required by msm_glink_ssr.ko + of_phandle_iterator_init + of_phandle_iterator_next + +# required by qcom-spmi-adc5.ko + devm_iio_device_alloc + __devm_iio_device_register + +# required by bootloader_log.ko + seq_lseek + +# required by oplus_chg.ko + add_uevent_var + devm_power_supply_register + devres_destroy + i2c_smbus_read_word_data + i2c_smbus_write_i2c_block_data + i2c_smbus_write_word_data + iio_channel_get + power_supply_changed + power_supply_get_drvdata + round_jiffies_relative + schedule_timeout_interruptible + +# required by qseecom-mod.ko + __arch_copy_in_user + firmware_request_nowarn + sigprocmask + +# required by snd-usb-audio-qmi.ko + find_snd_usb_substream + snd_usb_enable_audio_stream + usb_ifnum_to_if + +# required by rndisipam.ko + alloc_etherdev_mqs + eth_mac_addr + eth_type_trans + netif_carrier_off + netif_carrier_on + +# required by pinctrl-spmi-gpio.ko + device_get_match_data + irq_chip_ack_parent + +# required by msm_ion_heaps.ko + cma_alloc + cma_release + gen_pool_avail + gen_pool_size + ion_buffer_zero + __ion_device_add_heap + ion_free + ion_heap_map_kernel + ion_heap_map_user + ion_heap_unmap_kernel + of_platform_device_create + of_translate_address + split_page + vm_map_ram + vm_unmap_ram + +# required by qcom_wdt_core.ko + cpu_pm_register_notifier + cpu_pm_unregister_notifier + panic_timeout + smp_call_function_single + +# required by hh_ctrl.ko + hypervisor_kobj + +# required by hvc_haven.ko + hvc_alloc + hvc_kick + hvc_poll + hvc_remove + +# required by qcom_glink_native.ko + kthread_cancel_work_sync + rpmsg_register_device + rpmsg_unregister_device + set_cpus_allowed_ptr + +# required by peripheral-loader.ko + __iowrite32_copy + request_firmware_into_buf + +# required by qcom_rpmh.ko + irq_get_irqchip_state + +# required by secure_buffer.ko + trace_print_array_seq + +# required by eud.ko + uart_insert_char + +# required by usb_f_diag.ko + refcount_dec_and_lock + +# required by governor_msm_adreno_tz.ko + update_devfreq + +# required by leds-qti-flash.ko + led_classdev_flash_register_ext + led_classdev_flash_unregister + led_classdev_unregister + +# required by rpmhpd.ko + dev_pm_opp_get_level + +# required by hh_msgq.ko + of_property_read_u64_index + +# required by cdsprm.ko + thermal_cdev_update + +# required by regmap-spmi.ko + spmi_ext_register_read + spmi_ext_register_readl + spmi_ext_register_write + spmi_ext_register_writel + spmi_register_read + spmi_register_write + spmi_register_zero_write + +# required by qti_battery_debug.ko + memory_read_from_buffer + +# required by usb_f_uac2.ko + usb_gstrings_attach + +# required by camera.ko + arch_timer_read_counter + devm_gpiod_put + down + gpio_free_array + gpio_request_one + iommu_dma_reserve_iova + __kfifo_alloc + __kfifo_in_r + __kfifo_len_r + __kfifo_out_r + __kfifo_to_user + led_trigger_event + led_trigger_register_simple + led_trigger_unregister_simple + media_device_cleanup + media_device_init + __media_device_register + media_device_unregister + media_entity_pads_init + ns_to_timespec64 + of_clk_get_from_provider + __release_region + request_firmware_direct + __request_region + __spi_register_driver + spi_setup + strchrnul + sysfs_create_groups + sysfs_remove_groups + up + v4l2_device_register_subdev + v4l2_device_register_subdev_nodes + v4l2_device_unregister_subdev + v4l2_event_queue + v4l2_fh_open + v4l2_fh_release + v4l2_subdev_call_wrappers + v4l2_subdev_init + video_device_alloc + video_device_release + video_device_release_empty + +# required by msm_sharedmem.ko + __uio_register_device + uio_unregister_device + +# required by msm_geni_serial.ko + console_stop + console_suspend_enabled + _raw_spin_trylock + __tty_insert_flip_char + tty_insert_flip_string_fixed_flag + uart_get_baud_rate + uart_resume_port + uart_suspend_port + uart_update_timeout + uart_write_wakeup + +# required by pci-msm-drv.ko + crc8 + crc8_populate_msb + devm_of_pci_get_host_bridge_resources + devm_pci_alloc_host_bridge + devm_request_pci_bus_resources + irq_domain_free_irqs_parent + of_irq_parse_and_map_pci + of_irq_parse_one + pci_assign_unassigned_bus_resources + pci_bus_add_devices + pci_common_swizzle + pci_find_ext_capability + pci_get_device + pci_msi_create_irq_domain + pci_msi_mask_irq + pci_msi_unmask_irq + pci_scan_root_bus_bridge + pci_walk_bus + pci_write_config_dword + +# required by bolero_cdc_dlkm.ko + regcache_cache_only + +# required by ufs-qcom.ko + blk_mq_rq_cpu + phy_calibrate + ufshcd_dme_get_attr + ufshcd_dme_set_attr + ufshcd_dump_regs + ufshcd_get_local_unipro_ver + ufshcd_pltfrm_init + ufshcd_pltfrm_resume + ufshcd_pltfrm_runtime_idle + ufshcd_pltfrm_runtime_resume + ufshcd_pltfrm_runtime_suspend + ufshcd_pltfrm_shutdown + ufshcd_pltfrm_suspend + ufshcd_query_attr + ufshcd_query_descriptor_retry + ufshcd_query_flag + ufshcd_remove + ufshcd_uic_hibern8_enter + ufshcd_uic_hibern8_exit + +# required by qcom-hv-haptics.ko + input_ff_create + input_ff_destroy + +# required by spi-msm-geni.ko + __spi_alloc_controller + spi_register_controller + spi_unregister_controller + +# required by incrementalfs.ko + bin2hex + __break_lease + clear_inode + __close_fd + d_add + d_drop + deactivate_locked_super + dentry_open + dget_parent + d_instantiate + d_make_root + dput + flush_dcache_page + fs_kobj + fsstack_copy_attr_all + generic_file_mmap + generic_file_read_iter + generic_file_splice_read + generic_read_dir + generic_shutdown_super + iget5_locked + ihold + inode_init_once + inode_init_owner + iput + iterate_dir + kernel_read + kernel_write + kern_path + lockref_get + lock_rename + lookup_one_len + LZ4_decompress_safe + match_int + match_token + notify_change + pagecache_get_page + path_get + path_put + __put_cred + register_filesystem + set_anon_super + sget + simple_getattr + simple_setattr + simple_statfs + strndup_user + sync_filesystem + truncate_inode_pages + unlock_new_inode + unlock_page + unlock_rename + unregister_filesystem + user_path_at_empty + vfs_create + vfs_fallocate + vfs_getattr + vfs_getxattr + vfs_link + vfs_listxattr + vfs_mkdir + vfs_rename + vfs_rmdir + vfs_setxattr + vfs_unlink + +# required by cnss2.ko + cma_get_name + devm_device_add_group + devm_device_remove_group + genlmsg_put + netlink_broadcast + nla_put + pci_assign_resource + pci_iomap + pci_load_saved_state + wait_for_completion_killable + +# required by glink_pkt.ko + rpmsg_get_signals + rpmsg_poll + rpmsg_set_signals + +# required by gpi.ko + dma_async_device_register + dma_async_device_unregister + dma_async_tx_descriptor_init + dma_get_slave_channel + of_dma_controller_free + of_dma_controller_register + vchan_dma_desc_free_list + vchan_init + vchan_tx_desc_free + vchan_tx_submit + +# required by cqhci.ko + dmam_alloc_attrs + dmam_free_coherent + mmc_cqe_request_done + +# required by qcom_pm8008-regulator.ko + devm_regulator_register_notifier + regulator_get_drvdata + regulator_list_voltage_linear + regulator_notifier_call_chain + +# required by op_cmdline.ko + simple_strtol + +# required by hh_rm_drv.ko + irq_create_fwspec_mapping + +# required by lvstest.ko + usb_alloc_dev + usb_find_common_endpoints + usb_poison_urb + usb_put_dev + usb_set_device_state + +# required by ipam.ko + add_wait_queue + alloc_netdev_mqs + ether_setup + hrtimer_try_to_cancel + init_dummy_netdev + napi_complete_done + napi_disable + __napi_schedule + napi_schedule_prep + __netdev_alloc_skb + netif_device_attach + netif_device_detach + netif_napi_add + netif_napi_del + netif_rx + ns_capable + remove_wait_queue + skb_add_rx_frag + skb_copy + skb_queue_head + vm_iomap_memory + wait_woken + woken_wake_function + +# required by slimbus-ngd.ko + gcd + +# required by clk-dummy.ko + of_clk_del_provider + of_clk_src_simple_get + +# required by sim_holder_detect.ko + remove_proc_entry + +# required by msm_drm.ko + adjust_managed_page_count + autoremove_wake_function + backlight_device_get_by_type + backlight_device_register + backlight_device_set_brightness + backlight_device_unregister + bpf_trace_run11 + bpf_trace_run12 + bpf_trace_run8 + clk_get_parent + clk_register + device_create_with_groups + devm_clk_bulk_get + devm_pwm_put + dma_resv_fini + dma_resv_init + dma_resv_wait_timeout_rcu + do_wait_intr + drm_add_edid_modes + drm_add_modes_noedid + drm_atomic_commit + drm_atomic_get_connector_state + drm_atomic_get_crtc_state + drm_atomic_get_plane_state + drm_atomic_get_private_obj_state + drm_atomic_helper_check + drm_atomic_helper_cleanup_planes + drm_atomic_helper_commit_duplicated_state + drm_atomic_helper_commit_hw_done + drm_atomic_helper_commit_modeset_disables + drm_atomic_helper_commit_modeset_enables + drm_atomic_helper_commit_planes + __drm_atomic_helper_connector_destroy_state + __drm_atomic_helper_connector_duplicate_state + __drm_atomic_helper_connector_reset + __drm_atomic_helper_crtc_destroy_state + __drm_atomic_helper_crtc_duplicate_state + drm_atomic_helper_dirtyfb + drm_atomic_helper_disable_plane + drm_atomic_helper_duplicate_state + drm_atomic_helper_page_flip + __drm_atomic_helper_plane_duplicate_state + drm_atomic_helper_prepare_planes + __drm_atomic_helper_private_obj_duplicate_state + drm_atomic_helper_set_config + drm_atomic_helper_shutdown + drm_atomic_helper_swap_state + drm_atomic_helper_update_legacy_modeset_state + drm_atomic_helper_update_plane + drm_atomic_helper_wait_for_fences + drm_atomic_helper_wait_for_vblanks + drm_atomic_private_obj_init + drm_atomic_set_crtc_for_connector + drm_atomic_set_fence_for_plane + drm_atomic_set_mode_for_crtc + drm_atomic_state_alloc + drm_atomic_state_clear + drm_atomic_state_default_clear + drm_atomic_state_default_release + __drm_atomic_state_free + drm_atomic_state_init + drm_bridge_attach + drm_bridge_disable + drm_bridge_enable + drm_bridge_mode_set + drm_bridge_post_disable + drm_bridge_pre_enable + drm_client_init + drm_client_modeset_commit_force + drm_client_register + drm_compat_ioctl + drm_connector_attach_encoder + drm_connector_cleanup + drm_connector_init + drm_connector_list_iter_begin + drm_connector_list_iter_end + drm_connector_list_iter_next + drm_connector_register + drm_connector_unregister + drm_connector_update_edid_property + drm_crtc_cleanup + drm_crtc_handle_vblank + drm_crtc_init_with_planes + drm_crtc_send_vblank_event + drm_crtc_vblank_off + drm_crtc_vblank_on + drm_crtc_vblank_reset + drm_crtc_wait_one_vblank + drm_dbg + drm_debug + drm_detect_hdmi_monitor + drm_detect_monitor_audio + drm_dev_alloc + drm_dev_dbg + drm_dev_printk + drm_dev_put + drm_dev_register + drm_dev_unregister + drm_dp_atomic_find_vcpi_slots + drm_dp_atomic_release_vcpi_slots + drm_dp_aux_register + drm_dp_aux_unregister + drm_dp_bw_code_to_link_rate + drm_dp_calc_pbn_mode + drm_dp_channel_eq_ok + drm_dp_check_act_status + drm_dp_clock_recovery_ok + drm_dp_dpcd_read + drm_dp_dpcd_read_link_status + drm_dp_dpcd_write + drm_dp_find_vcpi_slots + drm_dp_get_adjust_request_pre_emphasis + drm_dp_get_adjust_request_voltage + drm_dp_link_configure + drm_dp_link_power_down + drm_dp_link_power_up + drm_dp_link_rate_to_bw_code + drm_dp_link_train_channel_eq_delay + drm_dp_link_train_clock_recovery_delay + drm_dp_mst_allocate_vcpi + drm_dp_mst_deallocate_vcpi + drm_dp_mst_detect_port + drm_dp_mst_get_edid + drm_dp_mst_get_port_malloc + drm_dp_mst_hpd_irq + drm_dp_mst_put_port_malloc + drm_dp_mst_reset_vcpi_slots + drm_dp_mst_topology_mgr_destroy + drm_dp_mst_topology_mgr_init + drm_dp_mst_topology_mgr_set_mst + drm_dp_send_power_updown_phy + drm_dp_update_payload_part1 + drm_dp_update_payload_part2 + drm_edid_duplicate + drm_encoder_cleanup + drm_encoder_init + drm_err + drm_event_reserve_init_locked + drm_format_info + drm_framebuffer_init + drm_framebuffer_lookup + drm_framebuffer_remove + drm_framebuffer_unregister_private + drm_gem_create_mmap_offset + drm_gem_fb_create_handle + drm_gem_fb_destroy + drm_gem_fb_get_obj + drm_gem_free_mmap_offset + drm_gem_get_pages + drm_gem_handle_create + drm_gem_mmap + drm_gem_mmap_obj + drm_gem_object_init + drm_gem_object_lookup + drm_gem_object_put + drm_gem_object_put_unlocked + drm_gem_object_release + drm_gem_prime_export + drm_gem_prime_fd_to_handle + drm_gem_prime_handle_to_fd + drm_gem_private_object_init + drm_gem_put_pages + drm_gem_vm_close + drm_gem_vm_open + drm_get_connector_status_name + drm_get_edid + drm_get_format_info + drm_helper_hpd_irq_event + drm_helper_mode_fill_fb_struct + drm_helper_probe_single_connector_modes + drm_ioctl + drm_irq_install + drm_irq_uninstall + drm_kms_helper_poll_disable + drm_kms_helper_poll_enable + drm_kms_helper_poll_fini + drm_kms_helper_poll_init + drm_match_cea_mode + drm_mm_init + drm_mm_insert_node_in_range + drm_mm_remove_node + drm_mm_takedown + drm_mode_config_cleanup + drm_mode_config_init + drm_mode_config_reset + drm_mode_convert_umode + drm_mode_copy + drm_mode_create + drm_mode_create_dp_colorspace_property + drm_mode_debug_printmodeline + drm_mode_duplicate + drm_mode_equal + drm_mode_object_find + drm_mode_object_get + drm_mode_object_put + drm_mode_probed_add + drm_modeset_acquire_fini + drm_modeset_acquire_init + drm_modeset_backoff + drm_mode_set_crtcinfo + drm_modeset_drop_locks + drm_modeset_lock + drm_modeset_lock_all + drm_modeset_lock_all_ctx + drm_mode_set_name + drm_modeset_unlock_all + drm_mode_vrefresh + drm_object_attach_property + drm_object_property_set_value + drm_of_component_match_add + drm_open + drm_panel_add + drm_panel_init + drm_panel_notifier_call_chain + drm_panel_remove + drm_plane_cleanup + drm_plane_create_rotation_property + drm_poll + drm_prime_gem_destroy + drm_prime_pages_to_sg + drm_property_blob_get + drm_property_blob_put + drm_property_create + drm_property_create_bitmask + drm_property_create_blob + drm_property_create_enum + drm_property_create_range + drm_property_lookup_blob + drm_read + drm_release + drm_rotation_simplify + drm_send_event_locked + drm_set_preferred_mode + drm_universal_plane_init + drm_vblank_init + drm_wait_one_vblank + i2c_recover_bus + invalidate_mapping_pages + irq_domain_xlate_onecell + kernfs_find_and_get_ns + kernfs_notify + kernfs_put + kthread_cancel_delayed_work_sync + kthread_delayed_work_timer_fn + kthread_flush_work + kthread_mod_delayed_work + kthread_park + kthread_parkme + kthread_queue_delayed_work + kthread_should_park + kthread_unpark + memblock_free + memparse + memunmap + mipi_dsi_create_packet + mipi_dsi_dcs_set_display_brightness + mipi_dsi_dcs_set_tear_off + mipi_dsi_host_register + mipi_dsi_host_unregister + of_drm_find_bridge + of_genpd_add_provider_simple + of_graph_get_next_endpoint + of_graph_get_remote_port_parent + of_graph_parse_endpoint + of_node_name_eq + pm_genpd_remove + regulator_get_mode + shmem_truncate_range + strim + strreplace + timespec64_to_jiffies + unmap_mapping_range + vmf_insert_mixed + vm_get_page_prot + __wake_up_locked + +# required by ucsi_glink.ko + raw_notifier_call_chain + raw_notifier_chain_register + raw_notifier_chain_unregister + +# required by tri_key.ko + devm_extcon_dev_unregister + +# required by qcom-spmi-pmic.ko + __spmi_driver_register + +# required by phy-qcom-ufs.ko + __devm_of_phy_provider_register + devm_phy_create + of_phy_simple_xlate + +# required by xhci-pci.ko + pci_d3cold_disable + pci_read_config_byte + pci_set_mwi + usb_amd_quirk_pll_check + usb_create_shared_hcd + usb_enable_intel_xhci_ports + usb_hcd_pci_pm_ops + usb_hcd_pci_probe + usb_hcd_pci_remove + usb_hcd_pci_shutdown + +# required by sg.ko + __alloc_disk_node + blk_execute_rq_nowait + blk_get_request + blk_put_request + blk_rq_map_user + blk_rq_map_user_iov + blk_rq_unmap_user + blk_verify_command + class_interface_unregister + fasync_helper + import_iovec + kill_fasync + __module_get + put_disk + scsi_autopm_get_device + scsi_autopm_put_device + scsi_block_when_processing_errors + scsi_command_size_tbl + scsi_device_get + scsi_device_put + scsi_ioctl + scsi_ioctl_block_when_processing_errors + scsi_normalize_sense + __scsi_print_sense + scsi_register_interface + sdev_prefix_printk + sg_scsi_ioctl + __task_pid_nr_ns + +# required by mhi_bus.ko + device_del + prandom_u32 + _raw_read_lock_irq + _raw_read_unlock_irq + +# required by rtc-pm8xxx.ko + devm_rtc_device_register + rtc_tm_to_time64 + rtc_update_irq + rtc_valid_tm + +# required by smem.ko + devm_ioremap_wc + hwspin_lock_free + hwspin_lock_request_specific + __hwspin_lock_timeout + __hwspin_unlock + of_hwspin_lock_get_id + +# required by socinfo.ko + add_device_randomness + soc_device_register + soc_device_unregister + +# required by qcom_hwspinlock.ko + devm_regmap_field_alloc + hwspin_lock_register + hwspin_lock_unregister + regmap_field_read + regmap_field_update_bits_base + +# required by xhci-plat-hcd.ko + device_wakeup_enable + devm_clk_get_optional + of_usb_host_tpl_support + __usb_create_hcd + usb_hcd_platform_shutdown + +# required by dwc3-of-simple.ko + clk_bulk_get_all + of_reset_control_array_get + reset_control_put + reset_control_reset + +# required by platform_dlkm.ko + freezing_slow_path + hrtimer_forward + of_property_read_variable_u16_array + __refrigerator + snd_ctl_add + snd_ctl_boolean_mono_info + snd_ctl_enum_info + snd_ctl_new1 + snd_ctl_notify + snd_ctl_remove + snd_pcm_add_chmap_ctls + snd_pcm_hw_constraint_list + snd_pcm_hw_constraint_minmax + snd_pcm_hw_constraint_step + snd_pcm_std_chmaps + snd_pcm_stop + snd_soc_bytes_tlv_callback + snd_soc_card_get_kcontrol + snd_soc_new_compress + snd_timer_interrupt + system_freezing_cnt + +# required by machine_dlkm.ko + devm_snd_soc_register_card + snd_soc_dai_get_channel_map + snd_soc_dai_set_channel_map + snd_soc_dai_set_fmt + snd_soc_dai_set_sysclk + snd_soc_dai_set_tdm_slot + snd_soc_get_pcm_runtime + snd_soc_of_parse_audio_routing + snd_soc_of_parse_card_name + snd_soc_pm_ops + snd_soc_unregister_card + +# required by qpnp-power-on.ko + _dev_emerg + +# required by qmi_helpers.ko + synchronize_rcu + +# required by synx-driver.ko + dma_fence_enable_sw_signaling + dma_fence_get_status + time64_to_tm + +# required by usb_f_gsi.ko + dev_get_by_name + rndis_deregister + rndis_free_response + rndis_get_next_response + rndis_msg_parser + rndis_register + rndis_set_host_mac + rndis_set_param_dev + rndis_set_param_medium + rndis_set_param_vendor + rndis_signal_connect + rndis_uninit + usb_composite_setup_continue + +# required by aw8697.ko + __hrtimer_get_remaining + i2c_smbus_write_byte + +# required by xhci-hcd.ko + dma_pool_alloc + dma_pool_create + dma_pool_destroy + dma_pool_free + __num_online_cpus + param_ops_ullong + radix_tree_delete + radix_tree_maybe_preload + schedule_timeout_uninterruptible + sg_pcopy_from_buffer + sg_pcopy_to_buffer + usb_amd_dev_put + usb_amd_pt_check_port + usb_amd_quirk_pll_disable + usb_amd_quirk_pll_enable + usb_asmedia_modifyflowcontrol + usb_disable_xhci_ports + usb_get_urb + usb_hcd_check_unlink_urb + usb_hcd_end_port_resume + usb_hcd_giveback_urb + usb_hc_died + usb_hcd_irq + usb_hcd_link_urb_to_ep + usb_hcd_map_urb_for_dma + usb_hcd_poll_rh_status + usb_hcd_resume_root_hub + usb_hcd_start_port_resume + usb_hcd_unlink_urb_from_ep + usb_hub_clear_tt_buffer + usb_hub_find_child + usb_root_hub_lost_power + usb_wakeup_notification + +# required by _qcom_scm.ko + __arm_smccc_smc + gen_pool_best_fit + gen_pool_set_algo + gen_pool_virt_to_phys + +# required by clk-qcom.ko + __clk_determine_rate + clk_fixed_rate_ops + __clk_get_name + clk_hw_get_flags + clk_hw_get_parent + clk_hw_get_parent_by_index + clk_hw_is_enabled + clk_hw_round_rate + clk_sync_state + divider_get_val + divider_recalc_rate + divider_ro_round_rate_parent + divider_round_rate_parent + pm_genpd_remove_subdomain + rational_best_approximation + regmap_mmio_detach_clk + syscon_regmap_lookup_by_phandle + +# required by tfa9894_dlkm.ko + default_llseek + device_remove_bin_file + msleep_interruptible + proc_remove + simple_attr_open + simple_attr_read + simple_attr_release + simple_attr_write + +# required by rx_macro_dlkm.ko + snd_pcm_format_width + +# required by project_info.ko + sprint_symbol + +# required by msm_kgsl.ko + bpf_trace_run10 + check_zeroed_user + clear_page + _dev_crit + devfreq_add_device + devfreq_cooling_unregister + devfreq_remove_device + devfreq_resume_device + devfreq_suspend_device + device_show_int + device_store_int + __devm_request_region + dev_pm_opp_find_freq_exact + dev_pm_opp_find_freq_floor + dev_pm_opp_put + dev_pm_opp_register_notifier + dev_pm_opp_unregister_notifier + dma_fence_free + getboottime64 + get_random_u32 + __get_task_comm + get_unmapped_area + get_user_pages + idr_for_each + idr_replace + init_uts_ns + irq_work_queue + iterate_fd + ktime_get_real_seconds + llist_add_batch + llist_reverse_order + nvmem_cell_read_u32 + of_devfreq_cooling_register + of_find_matching_node_and_match + _raw_spin_trylock_bh + _raw_write_lock + _raw_write_unlock + rb_last + rb_prev + register_shrinker + set_page_dirty_lock + set_user_nice + sg_alloc_table_from_pages + thermal_zone_get_temp + thermal_zone_get_zone_by_name + trace_print_flags_seq + unregister_shrinker + vmf_insert_pfn + vm_insert_page + __xa_alloc + +# required by u_audio.ko + snd_card_free + snd_card_new + snd_card_register + snd_pcm_lib_free_pages + snd_pcm_lib_malloc_pages + snd_pcm_lib_preallocate_pages_for_all + snd_pcm_new + snd_pcm_set_ops + _snd_pcm_stream_lock_irqsave + snd_pcm_stream_unlock_irqrestore + +# required by q6_dlkm.ko + kset_create_and_add + kset_unregister + +# required by subsystem_restart.ko + init_srcu_struct + param_ops_long + __srcu_read_lock + __srcu_read_unlock + synchronize_srcu + system_state + +# required by spss_utils.ko + kernel_restart + +# required by qcom-cpufreq-hw.ko + arch_set_freq_scale + cpufreq_cpu_get_raw + cpufreq_freq_attr_scaling_available_freqs + cpufreq_freq_attr_scaling_boost_freqs + cpufreq_generic_frequency_table_verify + cpufreq_register_driver + cpufreq_unregister_driver + dev_pm_opp_of_register_em + dev_pm_opp_remove_all_dynamic + dev_pm_opp_set_sharing_cpus + of_cpufreq_cooling_register + +# required by sdhci-msm.ko + mmc_of_parse + mmc_send_tuning + regulator_is_supported_voltage + __sdhci_add_host + sdhci_add_host + sdhci_cleanup_host + sdhci_cqe_disable + sdhci_cqe_enable + sdhci_cqe_irq + sdhci_dumpregs + sdhci_enable_clk + sdhci_get_property + sdhci_pltfm_free + sdhci_pltfm_init + sdhci_remove_host + sdhci_reset + sdhci_set_bus_width + sdhci_setup_host + +# required by btpower.ko + regulator_get_voltage + rfkill_alloc + rfkill_destroy + rfkill_init_sw_state + rfkill_register + rfkill_unregister + +# required by dwc3-msm.ko + device_wakeup_disable + extcon_get_edev_name + extcon_get_property + irq_set_irqchip_state + irq_set_irq_type + pm_runtime_barrier + regulator_register_notifier + regulator_unregister_notifier + usb_gadget_vbus_connect + usb_gadget_vbus_disconnect + usb_register_notify + usb_speed_string + usb_unregister_notify + +# required by pwm-qti-lpg.ko + pwmchip_add + pwmchip_remove + +# required by pinctrl-msm.ko + device_property_read_u16_array + gpiochip_line_is_valid + handle_bad_irq + pinctrl_force_default + pinctrl_force_sleep + unregister_restart_handler From 54cf84a5959d6f761ad99b0e5d570480f816137f Mon Sep 17 00:00:00 2001 From: YT Chang Date: Thu, 3 Sep 2020 16:04:01 +0800 Subject: [PATCH 31/33] ANDROID: sched: add restrict vendor hook to modify load balance behavior For modifying load balance policy, we add the hook on find_busiest_group(). It allows us to modify load balance paths. Bug: 168248326 Signed-off-by: YT Chang Change-Id: I77ec043576139806551b978eb1bdf9f637442dfb (cherry picked from commit a2ca8408de6183364b4c17f341f06e875bc7a1c1) (cherry picked from commit 489646b879ede582b6b00803edd3f777aede4d85) --- drivers/android/vendor_hooks.c | 1 + include/trace/hooks/sched.h | 6 ++++++ kernel/sched/fair.c | 6 +++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index a52cc9b90920..a1839ddcf05b 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -62,3 +62,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_printk_store); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_show_regs); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_wq_lockup_pool); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sysrq_crash); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_find_busiest_group); \ No newline at end of file diff --git a/include/trace/hooks/sched.h b/include/trace/hooks/sched.h index 6ac7dd6f97b7..4e2be4d70658 100644 --- a/include/trace/hooks/sched.h +++ b/include/trace/hooks/sched.h @@ -65,6 +65,11 @@ DECLARE_RESTRICTED_HOOK(android_rvh_set_user_nice, DECLARE_RESTRICTED_HOOK(android_rvh_setscheduler, TP_PROTO(struct task_struct *p), TP_ARGS(p), 1); + +struct sched_group; +DECLARE_RESTRICTED_HOOK(android_rvh_find_busiest_group, + TP_PROTO(struct sched_group *busiest, struct rq *dst_rq, int *out_balance), + TP_ARGS(busiest, dst_rq, out_balance), 1); #else #define trace_android_rvh_select_task_rq_fair(p, prev_cpu, sd_flag, wake_flags, new_cpu) #define trace_android_rvh_select_task_rq_rt(p, prev_cpu, sd_flag, wake_flags, new_cpu) @@ -79,6 +84,7 @@ DECLARE_RESTRICTED_HOOK(android_rvh_setscheduler, #define trace_android_rvh_rtmutex_prepare_setprio(p, pi_task) #define trace_android_rvh_set_user_nice(p, nice) #define trace_android_rvh_setscheduler(p) +#define trace_android_rvh_find_busiest_group(busiest, dst_rq, out_balance) #endif #endif /* _TRACE_HOOK_SCHED_H */ /* This part must be outside protection */ diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 63f48ba96d88..7bd7edf1b14d 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8736,8 +8736,12 @@ static struct sched_group *find_busiest_group(struct lb_env *env) if (sched_energy_enabled()) { struct root_domain *rd = env->dst_rq->rd; + int out_balance = 1; - if (rcu_dereference(rd->pd) && !READ_ONCE(rd->overutilized)) + trace_android_rvh_find_busiest_group(sds.busiest, env->dst_rq, + &out_balance); + if (rcu_dereference(rd->pd) && !READ_ONCE(rd->overutilized) + && out_balance) goto out_balanced; } From b90aa177cb5897f0ef727e1c68b2f940f20922be Mon Sep 17 00:00:00 2001 From: Kishore Sri venkata Ganesh Bolisetty Date: Tue, 27 Oct 2020 11:37:39 -0700 Subject: [PATCH 32/33] ANDROID: ABI: Update allowed list for QCOM Add the following symbols to QCOM allowed-list: -- cpufreq_get_policy Bug: 171781675 Change-Id: I11699b631dc61b6ddcb245ae3f01ae41ee1314c7 Signed-off-by: Kishore Sri venkata Ganesh Bolisetty Signed-off-by: Raghavendra Rao Ananta --- android/abi_gki_aarch64_qcom | 1 + 1 file changed, 1 insertion(+) diff --git a/android/abi_gki_aarch64_qcom b/android/abi_gki_aarch64_qcom index 17635e3a115a..ee1f919ac00b 100644 --- a/android/abi_gki_aarch64_qcom +++ b/android/abi_gki_aarch64_qcom @@ -254,6 +254,7 @@ cpufreq_freq_attr_scaling_boost_freqs cpufreq_generic_attr cpufreq_generic_frequency_table_verify + cpufreq_get_policy cpufreq_quick_get_max cpufreq_register_driver cpufreq_register_notifier From 874de1d962e8cd1c234b918f5cae7f87796bde69 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Tue, 6 Oct 2020 23:58:37 -0700 Subject: [PATCH 33/33] ANDROID: GKI: enable CONFIG_CPU_FREQ_STAT and more thermal configs Bug: 170274669 Bug: 169727445 Bug: 171854825 Signed-off-by: Wei Wang Signed-off-by: Greg Kroah-Hartman Change-Id: I20d2848b97d2c3d1d80ad8c6d61d6de2cf306153 --- arch/arm64/configs/gki_defconfig | 4 ++++ arch/x86/configs/gki_defconfig | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/arch/arm64/configs/gki_defconfig b/arch/arm64/configs/gki_defconfig index b30790cd7704..d4d9627b93f6 100644 --- a/arch/arm64/configs/gki_defconfig +++ b/arch/arm64/configs/gki_defconfig @@ -69,6 +69,7 @@ CONFIG_CPU_IDLE=y CONFIG_ARM_CPUIDLE=y CONFIG_ARM_PSCI_CPUIDLE=y CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_STAT=y CONFIG_CPU_FREQ_TIMES=y CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y CONFIG_CPU_FREQ_GOV_POWERSAVE=y @@ -344,10 +345,13 @@ CONFIG_POWER_AVS=y CONFIG_POWER_RESET_HISI=y # CONFIG_HWMON is not set CONFIG_THERMAL=y +CONFIG_THERMAL_STATISTICS=y +CONFIG_THERMAL_WRITABLE_TRIPS=y CONFIG_THERMAL_GOV_USER_SPACE=y CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y CONFIG_CPU_THERMAL=y CONFIG_DEVFREQ_THERMAL=y +CONFIG_THERMAL_EMULATION=y CONFIG_WATCHDOG=y CONFIG_WATCHDOG_CORE=y CONFIG_MFD_ACT8945A=y diff --git a/arch/x86/configs/gki_defconfig b/arch/x86/configs/gki_defconfig index 7da7f03361ca..ff6bed6ddf4e 100644 --- a/arch/x86/configs/gki_defconfig +++ b/arch/x86/configs/gki_defconfig @@ -56,6 +56,7 @@ CONFIG_EFI=y CONFIG_PM_WAKELOCKS=y CONFIG_PM_WAKELOCKS_LIMIT=0 # CONFIG_PM_WAKELOCKS_GC is not set +CONFIG_CPU_FREQ_STAT=y CONFIG_CPU_FREQ_TIMES=y CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y CONFIG_CPU_FREQ_GOV_POWERSAVE=y @@ -295,8 +296,13 @@ CONFIG_HPET=y CONFIG_SPI=y CONFIG_GPIOLIB=y # CONFIG_HWMON is not set +CONFIG_THERMAL_STATISTICS=y +CONFIG_THERMAL_WRITABLE_TRIPS=y +CONFIG_THERMAL_GOV_USER_SPACE=y CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y +CONFIG_CPU_THERMAL=y CONFIG_DEVFREQ_THERMAL=y +CONFIG_THERMAL_EMULATION=y # CONFIG_X86_PKG_TEMP_THERMAL is not set CONFIG_WATCHDOG=y CONFIG_WATCHDOG_CORE=y