From 36248a15a718ec1200ae6016c5c3e8813bb3f6bf Mon Sep 17 00:00:00 2001 From: Frank Wang Date: Wed, 6 Dec 2023 14:59:39 +0800 Subject: [PATCH 01/70] FROMGIT: usb: dwc3: set pm runtime active before resume common For device mode, if PM runtime autosuspend feature enabled, the runtime power status of dwc3 may be suspended when run dwc3_resume(), and dwc3 gadget would not be configured in dwc3_gadget_run_stop(). It would cause gadget connected failed if USB cable has been plugged before PM resume. So move forward pm_runtime_set_active() to fix it. Bug: 300024866 Change-Id: I53d07c7bfb86d4ae8d60e07096dff0fd68e30eff Signed-off-by: Frank Wang Link: https://lore.kernel.org/r/20231206065939.16958-1-frank.wang@rock-chips.com Signed-off-by: Greg Kroah-Hartman (cherry picked from commit 68c26fe58182f5af56bfa577d1cc0c949740baab https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next) --- drivers/usb/dwc3/core.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 2b01c3e05ebe..10ebfc8ed81e 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -2235,12 +2235,15 @@ static int dwc3_resume(struct device *dev) pinctrl_pm_select_default_state(dev); - ret = dwc3_resume_common(dwc, PMSG_RESUME); - if (ret) - return ret; - pm_runtime_disable(dev); pm_runtime_set_active(dev); + + ret = dwc3_resume_common(dwc, PMSG_RESUME); + if (ret) { + pm_runtime_set_suspended(dev); + return ret; + } + pm_runtime_enable(dev); return 0; From 97100e867e38c9c384274c03c8012ac023fb1ccc Mon Sep 17 00:00:00 2001 From: Uttkarsh Aggarwal Date: Fri, 22 Dec 2023 15:17:04 +0530 Subject: [PATCH 02/70] FROMGIT: usb: dwc: ep0: Update request status in dwc3_ep0_stall_restart Current implementation blocks the running operations when Plug-out and Plug-In is performed continuously, process gets stuck in dwc3_thread_interrupt(). Code Flow: CPU1 ->Gadget_start ->dwc3_interrupt ->dwc3_thread_interrupt ->dwc3_process_event_buf ->dwc3_process_event_entry ->dwc3_endpoint_interrupt ->dwc3_ep0_interrupt ->dwc3_ep0_inspect_setup ->dwc3_ep0_stall_and_restart By this time if pending_list is not empty, it will get the next request on the given list and calls dwc3_gadget_giveback which will unmap request and call its complete() callback to notify upper layers that it has completed. Currently dwc3_gadget_giveback status is set to -ECONNRESET, whereas it should be -ESHUTDOWN based on condition if not dwc->connected is true. Cc: Fixes: d742220b3577 ("usb: dwc3: ep0: giveback requests on stall_and_restart") Signed-off-by: Uttkarsh Aggarwal Link: https://lore.kernel.org/r/20231222094704.20276-1-quic_uaggarwa@quicinc.com Signed-off-by: Greg Kroah-Hartman Bug: 320413810 (cherry picked from commit e9d40b215e38480fd94c66b06d79045717a59e9c https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/ usb-next) Change-Id: I7f0afebbcfa88b6b4e622a708b9838dd461661fc Signed-off-by: Sriram Dash --- drivers/usb/dwc3/ep0.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index 61de693461da..ec3c33266547 100644 --- a/drivers/usb/dwc3/ep0.c +++ b/drivers/usb/dwc3/ep0.c @@ -236,7 +236,10 @@ void dwc3_ep0_stall_and_restart(struct dwc3 *dwc) struct dwc3_request *req; req = next_request(&dep->pending_list); - dwc3_gadget_giveback(dep, req, -ECONNRESET); + if (!dwc->connected) + dwc3_gadget_giveback(dep, req, -ESHUTDOWN); + else + dwc3_gadget_giveback(dep, req, -ECONNRESET); } dwc->eps[0]->trb_enqueue = 0; From 28dbe4d613083a5442a5dfdef7d842cfa5e11657 Mon Sep 17 00:00:00 2001 From: Lianjun Huang Date: Thu, 11 Jan 2024 15:06:34 +0800 Subject: [PATCH 03/70] ANDROID: GKI: add symbols to ABI After demand paging is captured during APP launch, we can do it in advance before next launch. Add the symbols for it here. INFO: 4 function symbol(s) added 'unsigned int filemap_get_folios(struct address_space*, unsigned long*, unsigned long, struct folio_batch*)' 'unsigned int find_get_pages_range_tag(struct address_space*, unsigned long*, unsigned long, xa_mark_t, unsigned int, struct page**)' 'void page_cache_async_ra(struct readahead_control*, struct folio*, unsigned long)' 'void page_cache_sync_ra(struct readahead_control*, unsigned long)' Bug: 315913896 Signed-off-by: Lianjun Huang Signed-off-by: Lianjun Huang Change-Id: I3f42c39c6432303e69f1fbae56fabf620381d8c5 --- android/abi_gki_aarch64.stg | 98 ++++++++++++++++++++++++++++++++++ android/abi_gki_aarch64_xiaomi | 5 ++ 2 files changed, 103 insertions(+) diff --git a/android/abi_gki_aarch64.stg b/android/abi_gki_aarch64.stg index a7a7e77c8c92..8942237f06f6 100644 --- a/android/abi_gki_aarch64.stg +++ b/android/abi_gki_aarch64.stg @@ -28803,6 +28803,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0xd0f3b5bf } +pointer_reference { + id: 0x3ead5537 + kind: POINTER + pointee_type_id: 0xd0f5b243 +} pointer_reference { id: 0x3eafc7e2 kind: POINTER @@ -38679,6 +38684,11 @@ array { number_of_elements: 8 element_type_id: 0x69318e08 } +array { + id: 0xfe82aef1 + number_of_elements: 15 + element_type_id: 0x2170d06d +} array { id: 0xfeb89bd6 number_of_elements: 65 @@ -91679,6 +91689,12 @@ member { name: "folio" type_id: 0x2170d06d } +member { + id: 0x53859aee + name: "folios" + type_id: 0xfe82aef1 + offset: 64 +} member { id: 0x53e7f764 name: "folios" @@ -230365,6 +230381,17 @@ struct_union { member_id: 0xb4a7dfee } } +struct_union { + id: 0xd0f5b243 + kind: STRUCT + name: "folio_batch" + definition { + bytesize: 128 + member_id: 0xd1ffb44c + member_id: 0x4db3a084 + member_id: 0x53859aee + } +} struct_union { id: 0x9524b580 kind: STRUCT @@ -294477,6 +294504,12 @@ function { return_type_id: 0x48b5725f parameter_id: 0x246dc7d4 } +function { + id: 0x19832808 + return_type_id: 0x48b5725f + parameter_id: 0x275ab027 + parameter_id: 0x33756485 +} function { id: 0x198668f4 return_type_id: 0x48b5725f @@ -294584,6 +294617,13 @@ function { return_type_id: 0x48b5725f parameter_id: 0x257d12af } +function { + id: 0x19c7e382 + return_type_id: 0x48b5725f + parameter_id: 0x275ab027 + parameter_id: 0x2170d06d + parameter_id: 0x33756485 +} function { id: 0x19c83efb return_type_id: 0x48b5725f @@ -328823,6 +328863,24 @@ function { parameter_id: 0x116785ed parameter_id: 0x4585663f } +function { + id: 0xcbaec654 + return_type_id: 0x4585663f + parameter_id: 0x1582ab06 + parameter_id: 0x064d6086 + parameter_id: 0x33756485 + parameter_id: 0x3ead5537 +} +function { + id: 0xcbafd069 + return_type_id: 0x4585663f + parameter_id: 0x1582ab06 + parameter_id: 0x064d6086 + parameter_id: 0x33756485 + parameter_id: 0x7f7172c7 + parameter_id: 0x4585663f + parameter_id: 0x0b30ee00 +} function { id: 0xcbc6cc7a return_type_id: 0x0a9a051a @@ -360410,6 +360468,15 @@ elf_symbol { type_id: 0x98e049ee full_name: "filemap_flush" } +elf_symbol { + id: 0xa6f98003 + name: "filemap_get_folios" + is_defined: true + symbol_type: FUNCTION + crc: 0x162e44f4 + type_id: 0xcbaec654 + full_name: "filemap_get_folios" +} elf_symbol { id: 0xc7c68a05 name: "filemap_write_and_wait_range" @@ -360446,6 +360513,15 @@ elf_symbol { type_id: 0x93eb75f8 full_name: "find_extend_vma" } +elf_symbol { + id: 0xddb3e7a5 + name: "find_get_pages_range_tag" + is_defined: true + symbol_type: FUNCTION + crc: 0x40bbf264 + type_id: 0xcbafd069 + full_name: "find_get_pages_range_tag" +} elf_symbol { id: 0x02b1ce77 name: "find_get_pid" @@ -374612,6 +374688,15 @@ elf_symbol { type_id: 0x6720d32f full_name: "overflowuid" } +elf_symbol { + id: 0x23a386a4 + name: "page_cache_async_ra" + is_defined: true + symbol_type: FUNCTION + crc: 0x7f37eef2 + type_id: 0x19c7e382 + full_name: "page_cache_async_ra" +} elf_symbol { id: 0xdea2b008 name: "page_cache_next_miss" @@ -374630,6 +374715,15 @@ elf_symbol { type_id: 0x340d6f59 full_name: "page_cache_prev_miss" } +elf_symbol { + id: 0x591c4b4f + name: "page_cache_sync_ra" + is_defined: true + symbol_type: FUNCTION + crc: 0xe337e689 + type_id: 0x19832808 + full_name: "page_cache_sync_ra" +} elf_symbol { id: 0x60d84cc3 name: "page_endio" @@ -402019,10 +402113,12 @@ interface { symbol_id: 0x3289d59f symbol_id: 0x82b19820 symbol_id: 0x7c937fc2 + symbol_id: 0xa6f98003 symbol_id: 0xc7c68a05 symbol_id: 0xb9dc79d0 symbol_id: 0x8bbdb127 symbol_id: 0xeaf15c9b + symbol_id: 0xddb3e7a5 symbol_id: 0x02b1ce77 symbol_id: 0x90d375c5 symbol_id: 0xdc16d76a @@ -403597,8 +403693,10 @@ interface { symbol_id: 0x57ecab02 symbol_id: 0x27d0c7b6 symbol_id: 0x28b33064 + symbol_id: 0x23a386a4 symbol_id: 0xdea2b008 symbol_id: 0xdf2c83f5 + symbol_id: 0x591c4b4f symbol_id: 0x60d84cc3 symbol_id: 0xb613af5e symbol_id: 0xff029108 diff --git a/android/abi_gki_aarch64_xiaomi b/android/abi_gki_aarch64_xiaomi index d502877c9b2c..dd305e697200 100644 --- a/android/abi_gki_aarch64_xiaomi +++ b/android/abi_gki_aarch64_xiaomi @@ -345,3 +345,8 @@ #required by mi_asap.ko __traceiter_android_vh_read_pages __tracepoint_android_vh_read_pages + page_cache_sync_ra + page_cache_async_ra + pagecache_get_page + filemap_get_folios + find_get_pages_range_tag From 66a20ed4b89ae79fdb14c5233f89cc3278dfd00f Mon Sep 17 00:00:00 2001 From: Norihiko Hama Date: Sat, 6 Jan 2024 14:20:56 +0900 Subject: [PATCH 04/70] ANDROID: GKI: Add initial symbol list for honda Initial add for oem specific symbol list 2 function symbol(s) added 'void* devres_find(struct device*, dr_release_t, dr_match_t, void*)' 'bool input_device_enabled(struct input_dev*)' Bug: 319451108 Change-Id: I09d922aa61b7c50ad6a6c8e22f8798f0bc786832 Signed-off-by: Norihiko Hama --- BUILD.bazel | 1 + android/abi_gki_aarch64.stg | 33 +++++++++++++++++++++++++++++++++ android/abi_gki_aarch64_honda | 7 +++++++ 3 files changed, 41 insertions(+) create mode 100644 android/abi_gki_aarch64_honda diff --git a/BUILD.bazel b/BUILD.bazel index 1c1dc8627744..6b3b030ecdb0 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -104,6 +104,7 @@ filegroup( "android/abi_gki_aarch64_exynos", "android/abi_gki_aarch64_exynosauto", "android/abi_gki_aarch64_galaxy", + "android/abi_gki_aarch64_honda", "android/abi_gki_aarch64_honor", "android/abi_gki_aarch64_imx", "android/abi_gki_aarch64_meizu", diff --git a/android/abi_gki_aarch64.stg b/android/abi_gki_aarch64.stg index 8942237f06f6..72322735c738 100644 --- a/android/abi_gki_aarch64.stg +++ b/android/abi_gki_aarch64.stg @@ -301925,6 +301925,14 @@ function { parameter_id: 0x18bd6530 parameter_id: 0x0379c823 } +function { + id: 0x5776682f + return_type_id: 0x18bd6530 + parameter_id: 0x0258f96e + parameter_id: 0x548dee2a + parameter_id: 0x92cb2337 + parameter_id: 0x18bd6530 +} function { id: 0x578fa618 return_type_id: 0x295c7202 @@ -331287,6 +331295,11 @@ function { return_type_id: 0x6d7f5ff6 parameter_id: 0x10193e4a } +function { + id: 0xfab4e970 + return_type_id: 0x6d7f5ff6 + parameter_id: 0x1042c9d1 +} function { id: 0xfabc5175 return_type_id: 0x6d7f5ff6 @@ -353833,6 +353846,15 @@ elf_symbol { type_id: 0x9c603af1 full_name: "devres_destroy" } +elf_symbol { + id: 0xfe668bbf + name: "devres_find" + is_defined: true + symbol_type: FUNCTION + crc: 0x6cb8013f + type_id: 0x5776682f + full_name: "devres_find" +} elf_symbol { id: 0xe41962a4 name: "devres_free" @@ -365907,6 +365929,15 @@ elf_symbol { type_id: 0x15912855 full_name: "input_copy_abs" } +elf_symbol { + id: 0x5a86c89e + name: "input_device_enabled" + is_defined: true + symbol_type: FUNCTION + crc: 0x4e243813 + type_id: 0xfab4e970 + full_name: "input_device_enabled" +} elf_symbol { id: 0x1cfb5d03 name: "input_event" @@ -401378,6 +401409,7 @@ interface { symbol_id: 0xd155689b symbol_id: 0xf4be3f1a symbol_id: 0x2f22f242 + symbol_id: 0xfe668bbf symbol_id: 0xe41962a4 symbol_id: 0xfb540e8c symbol_id: 0xabe60a33 @@ -402717,6 +402749,7 @@ interface { symbol_id: 0xbc652525 symbol_id: 0x2336c16f symbol_id: 0x5b69d05f + symbol_id: 0x5a86c89e symbol_id: 0x1cfb5d03 symbol_id: 0x60efc3a4 symbol_id: 0xc802de31 diff --git a/android/abi_gki_aarch64_honda b/android/abi_gki_aarch64_honda new file mode 100644 index 000000000000..ab2d130c5fe7 --- /dev/null +++ b/android/abi_gki_aarch64_honda @@ -0,0 +1,7 @@ +[abi_symbol_list] +# commonly used by custom vendor modules + __bitmap_subset + devres_find + input_device_enabled + pvclock_gtod_register_notifier + refcount_dec_if_one From dd0098bdb40c7776972fce03cc554bdb76859a9a Mon Sep 17 00:00:00 2001 From: Norihiko Hama Date: Sat, 6 Jan 2024 14:29:58 +0900 Subject: [PATCH 05/70] ANDROID: GKI: Update honda symbol list for led-trigger 2 function symbol(s) added 'void led_blink_set_oneshot(struct led_classdev*, unsigned long*, unsigned long*, int)' 'void led_stop_software_blink(struct led_classdev*)' Bug: 319451108 Change-Id: I25f44f730780d41dc68cfb8697844e12fb4ea189 Signed-off-by: Norihiko Hama --- android/abi_gki_aarch64.stg | 28 ++++++++++++++++++++++++++++ android/abi_gki_aarch64_honda | 8 ++++++++ 2 files changed, 36 insertions(+) diff --git a/android/abi_gki_aarch64.stg b/android/abi_gki_aarch64.stg index 72322735c738..b6120b4a30a3 100644 --- a/android/abi_gki_aarch64.stg +++ b/android/abi_gki_aarch64.stg @@ -295967,6 +295967,14 @@ function { parameter_id: 0x32a623d7 parameter_id: 0x00c72527 } +function { + id: 0x1c33c003 + return_type_id: 0x48b5725f + parameter_id: 0x32caaf24 + parameter_id: 0x064d6086 + parameter_id: 0x064d6086 + parameter_id: 0x6720d32f +} function { id: 0x1c362eb2 return_type_id: 0x48b5725f @@ -369521,6 +369529,15 @@ elf_symbol { type_id: 0x984fafbd full_name: "l2tp_xmit_skb" } +elf_symbol { + id: 0x17e9fb87 + name: "led_blink_set_oneshot" + is_defined: true + symbol_type: FUNCTION + crc: 0x4161bcf8 + type_id: 0x1c33c003 + full_name: "led_blink_set_oneshot" +} elf_symbol { id: 0x709f7fc8 name: "led_classdev_flash_register_ext" @@ -369620,6 +369637,15 @@ elf_symbol { type_id: 0x91a53d53 full_name: "led_set_flash_timeout" } +elf_symbol { + id: 0xe0c4a1c1 + name: "led_stop_software_blink" + is_defined: true + symbol_type: FUNCTION + crc: 0x2e5a3d0d + type_id: 0x1c2afa5a + full_name: "led_stop_software_blink" +} elf_symbol { id: 0x1874c9e3 name: "led_sysfs_disable" @@ -403148,6 +403174,7 @@ interface { symbol_id: 0x8066cf3a symbol_id: 0x8f6761e2 symbol_id: 0x20069858 + symbol_id: 0x17e9fb87 symbol_id: 0x709f7fc8 symbol_id: 0xa58e6f5d symbol_id: 0xfe24eb71 @@ -403159,6 +403186,7 @@ interface { symbol_id: 0x2e74d698 symbol_id: 0x7bbb8d5f symbol_id: 0xa18d331b + symbol_id: 0xe0c4a1c1 symbol_id: 0x1874c9e3 symbol_id: 0xef448c0c symbol_id: 0x678fcec9 diff --git a/android/abi_gki_aarch64_honda b/android/abi_gki_aarch64_honda index ab2d130c5fe7..526964f0142e 100644 --- a/android/abi_gki_aarch64_honda +++ b/android/abi_gki_aarch64_honda @@ -5,3 +5,11 @@ input_device_enabled pvclock_gtod_register_notifier refcount_dec_if_one + +# commonly required by ledtrig-heartbeat.ko modules + avenrun + +# commonly required by ledtrig-*.ko modules + led_blink_set_oneshot + led_set_brightness_nosleep + led_stop_software_blink From 39a0823340d197313428208bc02c2618ab03c82a Mon Sep 17 00:00:00 2001 From: Norihiko Hama Date: Sat, 6 Jan 2024 15:21:57 +0900 Subject: [PATCH 06/70] ANDROID: GKI: Update honda symbol list for net scheduler 31 function symbol(s) added 'int __skb_vlan_pop(struct sk_buff*, u16*)' 'struct flow_rule* flow_rule_alloc(unsigned int)' 'clock_t jiffies_to_clock_t(unsigned long)' 'int skb_eth_pop(struct sk_buff*)' 'int skb_eth_push(struct sk_buff*, const unsigned char*, const unsigned char*)' 'void skb_flow_dissect_ct(const struct sk_buff*, struct flow_dissector*, void*, u16*, size_t, bool, u16)' 'void skb_flow_dissect_hash(const struct sk_buff*, struct flow_dissector*, void*)' 'void skb_flow_dissect_meta(const struct sk_buff*, struct flow_dissector*, void*)' 'void skb_flow_dissect_tunnel_info(const struct sk_buff*, struct flow_dissector*, void*)' 'void skb_flow_dissector_init(struct flow_dissector*, const struct flow_dissector_key*, unsigned int)' 'int skb_vlan_pop(struct sk_buff*)' 'int skb_vlan_push(struct sk_buff*, __be16, u16)' 'int tc_setup_cb_add(struct tcf_block*, struct tcf_proto*, enum tc_setup_type, void*, bool, u32*, unsigned int*, bool)' 'int tc_setup_cb_call(struct tcf_block*, enum tc_setup_type, void*, bool, bool)' 'int tc_setup_cb_destroy(struct tcf_block*, struct tcf_proto*, enum tc_setup_type, void*, bool, u32*, unsigned int*, bool)' 'int tc_setup_cb_reoffload(struct tcf_block*, struct tcf_proto*, bool, flow_setup_cb_t*, enum tc_setup_type, void*, void*, u32*, unsigned int*)' 'int tcf_action_check_ctrlact(int, struct tcf_proto*, struct tcf_chain**, struct netlink_ext_ack*)' 'struct tcf_chain* tcf_action_set_ctrlact(struct tc_action*, int, struct tcf_chain*)' 'void tcf_action_update_stats(struct tc_action*, u64, u64, u64, bool)' 'void tcf_chain_put_by_act(struct tcf_chain*)' 'unsigned int tcf_exts_num_actions(struct tcf_exts*)' 'int tcf_exts_terse_dump(struct sk_buff*, struct tcf_exts*)' 'int tcf_generic_walker(struct tc_action_net*, struct sk_buff*, struct netlink_callback*, int, const struct tc_action_ops*, struct netlink_ext_ack*)' 'int tcf_idr_check_alloc(struct tc_action_net*, u32*, struct tc_action**, int)' 'void tcf_idr_cleanup(struct tc_action_net*, u32)' 'int tcf_idr_create_from_flags(struct tc_action_net*, u32, struct nlattr*, struct tc_action**, const struct tc_action_ops*, int, u32)' 'int tcf_idr_release(struct tc_action*, bool)' 'int tcf_idr_search(struct tc_action_net*, struct tc_action**, u32)' 'void tcf_idrinfo_destroy(const struct tc_action_ops*, struct tcf_idrinfo*)' 'int tcf_register_action(struct tc_action_ops*, struct pernet_operations*)' 'int tcf_unregister_action(struct tc_action_ops*, struct pernet_operations*)' Bug: 319451108 Change-Id: I8cd204b87577972e35d29c0a992c8b6c0adefd58 Signed-off-by: Norihiko Hama --- android/abi_gki_aarch64.stg | 704 ++++++++++++++++++++++++++++++++++ android/abi_gki_aarch64_honda | 37 ++ 2 files changed, 741 insertions(+) diff --git a/android/abi_gki_aarch64.stg b/android/abi_gki_aarch64.stg index b6120b4a30a3..b14c07379061 100644 --- a/android/abi_gki_aarch64.stg +++ b/android/abi_gki_aarch64.stg @@ -3403,6 +3403,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0x1a8afd70 } +pointer_reference { + id: 0x0c32f89e + kind: POINTER + pointee_type_id: 0x1a8b04e5 +} pointer_reference { id: 0x0c337849 kind: POINTER @@ -7928,6 +7933,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0x6b752d98 } +pointer_reference { + id: 0x10504678 + kind: POINTER + pointee_type_id: 0x6b01ff7f +} pointer_reference { id: 0x105b358b kind: POINTER @@ -8923,6 +8933,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0x7c95d721 } +pointer_reference { + id: 0x15c24728 + kind: POINTER + pointee_type_id: 0x7d49fa3c +} pointer_reference { id: 0x15c389f6 kind: POINTER @@ -12373,6 +12388,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0xbe42b117 } +pointer_reference { + id: 0x2511a6f5 + kind: POINTER + pointee_type_id: 0xbe067d4b +} pointer_reference { id: 0x2524545c kind: POINTER @@ -28113,6 +28133,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0xd99c0331 } +pointer_reference { + id: 0x3cf9dfcf + kind: POINTER + pointee_type_id: 0xd9a799a2 +} pointer_reference { id: 0x3cfc8982 kind: POINTER @@ -29878,6 +29903,11 @@ typedef { name: "cisco_proto" referred_type_id: 0x0a19ea99 } +typedef { + id: 0x70239517 + name: "clock_t" + referred_type_id: 0xe3186d0a +} typedef { id: 0x4478ba6b name: "clockid_t" @@ -33033,6 +33063,11 @@ qualified { qualifier: CONST qualified_type_id: 0x1637ba4d } +qualified { + id: 0xd9a799a2 + qualifier: CONST + qualified_type_id: 0x16d9d002 +} qualified { id: 0xda235d29 qualifier: CONST @@ -104472,6 +104507,11 @@ member { name: "idr_rt" type_id: 0x80c20070 } +member { + id: 0x639387b1 + name: "idrinfo" + type_id: 0x3442a45d +} member { id: 0x63938e73 name: "idrinfo" @@ -112666,6 +112706,11 @@ member { type_id: 0x674028f7 offset: 832 } +member { + id: 0x8ea8c4ec + name: "key_id" + type_id: 0x405d0abf +} member { id: 0x8ec1ce72 name: "key_id" @@ -139954,6 +139999,12 @@ member { type_id: 0xc9082b19 offset: 96 } +member { + id: 0x9be8ed4d + name: "offset" + type_id: 0xf435685e + offset: 64 +} member { id: 0x9beaae82 name: "offset" @@ -141127,6 +141178,12 @@ member { name: "ops" type_id: 0x3a40dd6c } +member { + id: 0xafb1449f + name: "ops" + type_id: 0x3a40dd6c + offset: 64 +} member { id: 0xafb144a9 name: "ops" @@ -230177,6 +230234,16 @@ struct_union { member_id: 0x9ba29f20 } } +struct_union { + id: 0x16d9d002 + kind: STRUCT + name: "flow_dissector_key" + definition { + bytesize: 16 + member_id: 0x8ea8c4ec + member_id: 0x9be8ed4d + } +} struct_union { id: 0x7b243421 kind: STRUCT @@ -258565,6 +258632,16 @@ struct_union { member_id: 0x59c72968 } } +struct_union { + id: 0x6b01ff7f + kind: STRUCT + name: "tc_action_net" + definition { + bytesize: 16 + member_id: 0x639387b1 + member_id: 0xafb1449f + } +} struct_union { id: 0x7d49fa3c kind: STRUCT @@ -277308,6 +277385,140 @@ enumeration { } } } +enumeration { + id: 0x405d0abf + name: "flow_dissector_key_id" + definition { + underlying_type_id: 0x4585663f + enumerator { + name: "FLOW_DISSECTOR_KEY_CONTROL" + } + enumerator { + name: "FLOW_DISSECTOR_KEY_BASIC" + value: 1 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_IPV4_ADDRS" + value: 2 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_IPV6_ADDRS" + value: 3 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_PORTS" + value: 4 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_PORTS_RANGE" + value: 5 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_ICMP" + value: 6 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_ETH_ADDRS" + value: 7 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_TIPC" + value: 8 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_ARP" + value: 9 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_VLAN" + value: 10 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_FLOW_LABEL" + value: 11 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_GRE_KEYID" + value: 12 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_MPLS_ENTROPY" + value: 13 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_ENC_KEYID" + value: 14 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS" + value: 15 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS" + value: 16 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_ENC_CONTROL" + value: 17 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_ENC_PORTS" + value: 18 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_MPLS" + value: 19 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_TCP" + value: 20 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_IP" + value: 21 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_CVLAN" + value: 22 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_ENC_IP" + value: 23 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_ENC_OPTS" + value: 24 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_META" + value: 25 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_CT" + value: 26 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_HASH" + value: 27 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_NUM_OF_VLANS" + value: 28 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_PPPOE" + value: 29 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_L2TPV3" + value: 30 + } + enumerator { + name: "FLOW_DISSECTOR_KEY_MAX" + value: 31 + } + } +} enumeration { id: 0x08fa9aab name: "freq_qos_req_type" @@ -292419,6 +292630,11 @@ function { parameter_id: 0x1cce8023 parameter_id: 0x6720d32f } +function { + id: 0x163a90aa + return_type_id: 0x48b5725f + parameter_id: 0x1a8b04e5 +} function { id: 0x163b1761 return_type_id: 0x48b5725f @@ -293540,6 +293756,12 @@ function { parameter_id: 0x1d1533af parameter_id: 0x1e820193 } +function { + id: 0x17a860a1 + return_type_id: 0x48b5725f + parameter_id: 0x10504678 + parameter_id: 0xc9082b19 +} function { id: 0x17a9b884 return_type_id: 0x48b5725f @@ -295183,6 +295405,13 @@ function { parameter_id: 0x760e8adc parameter_id: 0x00256a1d } +function { + id: 0x1af68d6f + return_type_id: 0x48b5725f + parameter_id: 0x2a316b68 + parameter_id: 0x3cf9dfcf + parameter_id: 0x4585663f +} function { id: 0x1afeafa7 return_type_id: 0x48b5725f @@ -296707,6 +296936,15 @@ function { return_type_id: 0x48b5725f parameter_id: 0x3609467c } +function { + id: 0x1d1ccc70 + return_type_id: 0x48b5725f + parameter_id: 0x3fab28c8 + parameter_id: 0x92233392 + parameter_id: 0x92233392 + parameter_id: 0x92233392 + parameter_id: 0x6d7f5ff6 +} function { id: 0x1d1cf212 return_type_id: 0x48b5725f @@ -298070,6 +298308,12 @@ function { parameter_id: 0x39487d35 parameter_id: 0x04a6a89c } +function { + id: 0x1ed96c59 + return_type_id: 0x48b5725f + parameter_id: 0x3a40dd6c + parameter_id: 0x3442a45d +} function { id: 0x1eda71a1 return_type_id: 0x48b5725f @@ -298825,6 +299069,24 @@ function { parameter_id: 0x4585663f parameter_id: 0x4585663f } +function { + id: 0x1fae5edf + return_type_id: 0x48b5725f + parameter_id: 0x3e6396e0 + parameter_id: 0x2a316b68 + parameter_id: 0x18bd6530 +} +function { + id: 0x1faed94e + return_type_id: 0x48b5725f + parameter_id: 0x3e6396e0 + parameter_id: 0x2a316b68 + parameter_id: 0x18bd6530 + parameter_id: 0x2ec35650 + parameter_id: 0xf435685e + parameter_id: 0x6d7f5ff6 + parameter_id: 0x914dbfdc +} function { id: 0x1fafd1a4 return_type_id: 0x48b5725f @@ -300707,6 +300969,11 @@ function { parameter_id: 0x18bd6530 parameter_id: 0x33756485 } +function { + id: 0x416f964c + return_type_id: 0x70239517 + parameter_id: 0x33756485 +} function { id: 0x41818af1 return_type_id: 0xc9082b19 @@ -301439,6 +301706,11 @@ function { return_type_id: 0x295c7202 parameter_id: 0x0ae4a2c7 } +function { + id: 0x5221a908 + return_type_id: 0x2511a6f5 + parameter_id: 0x4585663f +} function { id: 0x523165ec return_type_id: 0x18bd6530 @@ -304215,6 +304487,14 @@ function { parameter_id: 0x0a126667 parameter_id: 0x0a126667 } +function { + id: 0x846ed06b + return_type_id: 0x6720d32f + parameter_id: 0x6720d32f + parameter_id: 0x09451098 + parameter_id: 0x0c32f89e + parameter_id: 0x07dcdbe1 +} function { id: 0x84710953 return_type_id: 0x6720d32f @@ -309396,6 +309676,19 @@ function { return_type_id: 0x6720d32f parameter_id: 0x3aac87ab } +function { + id: 0x932e1cba + return_type_id: 0x6720d32f + parameter_id: 0x3a433e0e + parameter_id: 0x09451098 + parameter_id: 0x6d7f5ff6 + parameter_id: 0x1c934597 + parameter_id: 0x26a97673 + parameter_id: 0x18bd6530 + parameter_id: 0x18bd6530 + parameter_id: 0x38d23361 + parameter_id: 0x1bf16028 +} function { id: 0x93304bad return_type_id: 0x6720d32f @@ -309425,6 +309718,18 @@ function { return_type_id: 0x6720d32f parameter_id: 0x3ae3ff84 } +function { + id: 0x933cebfd + return_type_id: 0x6720d32f + parameter_id: 0x3a433e0e + parameter_id: 0x09451098 + parameter_id: 0x26a97673 + parameter_id: 0x18bd6530 + parameter_id: 0x6d7f5ff6 + parameter_id: 0x38d23361 + parameter_id: 0x1bf16028 + parameter_id: 0x6d7f5ff6 +} function { id: 0x933f3b0e return_type_id: 0x6720d32f @@ -309721,6 +310026,15 @@ function { parameter_id: 0x3b04bead parameter_id: 0x33756485 } +function { + id: 0x938d088e + return_type_id: 0x6720d32f + parameter_id: 0x3a433e0e + parameter_id: 0x26a97673 + parameter_id: 0x18bd6530 + parameter_id: 0x6d7f5ff6 + parameter_id: 0x6d7f5ff6 +} function { id: 0x938d8e84 return_type_id: 0x6720d32f @@ -310018,6 +310332,12 @@ function { return_type_id: 0x6720d32f parameter_id: 0x397d00ab } +function { + id: 0x93dfd462 + return_type_id: 0x6720d32f + parameter_id: 0x3fab28c8 + parameter_id: 0x6d7f5ff6 +} function { id: 0x93e044d4 return_type_id: 0x6720d32f @@ -313450,6 +313770,12 @@ function { parameter_id: 0x14b9453b parameter_id: 0x3f8f206d } +function { + id: 0x98511587 + return_type_id: 0x6720d32f + parameter_id: 0x15c24728 + parameter_id: 0x2859d899 +} function { id: 0x985410df return_type_id: 0x6720d32f @@ -314798,6 +315124,14 @@ function { parameter_id: 0xeb0f6de6 parameter_id: 0x4585663f } +function { + id: 0x99777843 + return_type_id: 0x6720d32f + parameter_id: 0x10504678 + parameter_id: 0x38d23361 + parameter_id: 0x057af395 + parameter_id: 0x6720d32f +} function { id: 0x99780c28 return_type_id: 0xf435685e @@ -314863,6 +315197,16 @@ function { parameter_id: 0x203f3220 parameter_id: 0x0b0dddba } +function { + id: 0x998b6de0 + return_type_id: 0x6720d32f + parameter_id: 0x10504678 + parameter_id: 0x054f691a + parameter_id: 0x2cc3e4c8 + parameter_id: 0x6720d32f + parameter_id: 0x3a40dd6c + parameter_id: 0x07dcdbe1 +} function { id: 0x998be740 return_type_id: 0x6720d32f @@ -315040,6 +315384,13 @@ function { parameter_id: 0x116785ed parameter_id: 0x1aeeade4 } +function { + id: 0x99b35b75 + return_type_id: 0x6720d32f + parameter_id: 0x10504678 + parameter_id: 0x057af395 + parameter_id: 0xc9082b19 +} function { id: 0x99b42fa2 return_type_id: 0x6720d32f @@ -316503,6 +316854,17 @@ function { parameter_id: 0x4585663f parameter_id: 0x22b36393 } +function { + id: 0x9ab82f4e + return_type_id: 0x6720d32f + parameter_id: 0x10504678 + parameter_id: 0xc9082b19 + parameter_id: 0x239e18b5 + parameter_id: 0x057af395 + parameter_id: 0x3a40dd6c + parameter_id: 0x6720d32f + parameter_id: 0xc9082b19 +} function { id: 0x9ab830ae return_type_id: 0x3e10b518 @@ -321156,6 +321518,13 @@ function { parameter_id: 0x3e10b518 parameter_id: 0x18bd6530 } +function { + id: 0x9c3c1b22 + return_type_id: 0x6720d32f + parameter_id: 0x054f691a + parameter_id: 0x384c5795 + parameter_id: 0x384c5795 +} function { id: 0x9c3e4be2 return_type_id: 0x6720d32f @@ -321302,6 +321671,12 @@ function { return_type_id: 0x6720d32f parameter_id: 0x079ff791 } +function { + id: 0x9c683430 + return_type_id: 0x6720d32f + parameter_id: 0x054f691a + parameter_id: 0x2ec35650 +} function { id: 0x9c6915bb return_type_id: 0x11c404ba @@ -322482,6 +322857,13 @@ function { return_type_id: 0x6720d32f parameter_id: 0x02862e14 } +function { + id: 0x9d217999 + return_type_id: 0x6720d32f + parameter_id: 0x054f691a + parameter_id: 0x7584e7da + parameter_id: 0x914dbfdc +} function { id: 0x9d220f74 return_type_id: 0x8fd1c081 @@ -328822,6 +329204,11 @@ function { parameter_id: 0x2a285513 parameter_id: 0x4faa9b63 } +function { + id: 0xca3fb0b0 + return_type_id: 0x4585663f + parameter_id: 0x1393392e +} function { id: 0xca4b711f return_type_id: 0x1b084782 @@ -329350,6 +329737,13 @@ function { parameter_id: 0x105c8027 parameter_id: 0x300fdc99 } +function { + id: 0xd6fcc6b4 + return_type_id: 0x1a8b04e5 + parameter_id: 0x3fab28c8 + parameter_id: 0x6720d32f + parameter_id: 0x1a8b04e5 +} function { id: 0xd742e545 return_type_id: 0x26ad5dc1 @@ -334911,6 +335305,15 @@ elf_symbol { type_id: 0x9d54e5f2 full_name: "__skb_pad" } +elf_symbol { + id: 0xbdb79dce + name: "__skb_vlan_pop" + is_defined: true + symbol_type: FUNCTION + crc: 0x40bb17d8 + type_id: 0x9c683430 + full_name: "__skb_vlan_pop" +} elf_symbol { id: 0x7809a362 name: "__sock_create" @@ -360669,6 +361072,15 @@ elf_symbol { type_id: 0x82854b3f full_name: "flow_keys_basic_dissector" } +elf_symbol { + id: 0xdf121e19 + name: "flow_rule_alloc" + is_defined: true + symbol_type: FUNCTION + crc: 0x0e39522d + type_id: 0x5221a908 + full_name: "flow_rule_alloc" +} elf_symbol { id: 0xdf189e23 name: "flow_rule_match_basic" @@ -367819,6 +368231,15 @@ elf_symbol { type_id: 0x73531faf full_name: "jiffies_64_to_clock_t" } +elf_symbol { + id: 0x01438401 + name: "jiffies_to_clock_t" + is_defined: true + symbol_type: FUNCTION + crc: 0x7d0db45c + type_id: 0x416f964c + full_name: "jiffies_to_clock_t" +} elf_symbol { id: 0x9175ce1c name: "jiffies_to_msecs" @@ -385162,6 +385583,69 @@ elf_symbol { type_id: 0x9dc52cf1 full_name: "skb_ensure_writable" } +elf_symbol { + id: 0x4a80bd34 + name: "skb_eth_pop" + is_defined: true + symbol_type: FUNCTION + crc: 0x50d031fd + type_id: 0x9cd33969 + full_name: "skb_eth_pop" +} +elf_symbol { + id: 0xacfbcb27 + name: "skb_eth_push" + is_defined: true + symbol_type: FUNCTION + crc: 0xf0efc4fc + type_id: 0x9c3c1b22 + full_name: "skb_eth_push" +} +elf_symbol { + id: 0x414be22e + name: "skb_flow_dissect_ct" + is_defined: true + symbol_type: FUNCTION + crc: 0x3f0543e5 + type_id: 0x1faed94e + full_name: "skb_flow_dissect_ct" +} +elf_symbol { + id: 0x020865bd + name: "skb_flow_dissect_hash" + is_defined: true + symbol_type: FUNCTION + crc: 0x7622e705 + type_id: 0x1fae5edf + full_name: "skb_flow_dissect_hash" +} +elf_symbol { + id: 0xb3f58cb2 + name: "skb_flow_dissect_meta" + is_defined: true + symbol_type: FUNCTION + crc: 0xf1dd55b5 + type_id: 0x1fae5edf + full_name: "skb_flow_dissect_meta" +} +elf_symbol { + id: 0x236e8eb5 + name: "skb_flow_dissect_tunnel_info" + is_defined: true + symbol_type: FUNCTION + crc: 0x5b143d5e + type_id: 0x1fae5edf + full_name: "skb_flow_dissect_tunnel_info" +} +elf_symbol { + id: 0xd1a5a209 + name: "skb_flow_dissector_init" + is_defined: true + symbol_type: FUNCTION + crc: 0xb11e6d8f + type_id: 0x1af68d6f + full_name: "skb_flow_dissector_init" +} elf_symbol { id: 0xca7402ca name: "skb_free_datagram" @@ -385360,6 +385844,24 @@ elf_symbol { type_id: 0x11b644af full_name: "skb_unlink" } +elf_symbol { + id: 0x4cb1cea9 + name: "skb_vlan_pop" + is_defined: true + symbol_type: FUNCTION + crc: 0xb3a96b22 + type_id: 0x9cd33969 + full_name: "skb_vlan_pop" +} +elf_symbol { + id: 0x2b9b7a92 + name: "skb_vlan_push" + is_defined: true + symbol_type: FUNCTION + crc: 0xa0805653 + type_id: 0x9d217999 + full_name: "skb_vlan_push" +} elf_symbol { id: 0x706a5214 name: "skcipher_alloc_instance_simple" @@ -389404,6 +389906,51 @@ elf_symbol { type_id: 0xf4933b90 full_name: "tasklist_lock" } +elf_symbol { + id: 0x1a591d57 + name: "tc_setup_cb_add" + is_defined: true + symbol_type: FUNCTION + crc: 0xcaeffa45 + type_id: 0x933cebfd + full_name: "tc_setup_cb_add" +} +elf_symbol { + id: 0xf099d343 + name: "tc_setup_cb_call" + is_defined: true + symbol_type: FUNCTION + crc: 0x76fe3f79 + type_id: 0x938d088e + full_name: "tc_setup_cb_call" +} +elf_symbol { + id: 0xadb59b05 + name: "tc_setup_cb_destroy" + is_defined: true + symbol_type: FUNCTION + crc: 0xc6603a57 + type_id: 0x933cebfd + full_name: "tc_setup_cb_destroy" +} +elf_symbol { + id: 0xbfd2d0d2 + name: "tc_setup_cb_reoffload" + is_defined: true + symbol_type: FUNCTION + crc: 0x0af2caa9 + type_id: 0x932e1cba + full_name: "tc_setup_cb_reoffload" +} +elf_symbol { + id: 0xd6059721 + name: "tcf_action_check_ctrlact" + is_defined: true + symbol_type: FUNCTION + crc: 0x46abbb86 + type_id: 0x846ed06b + full_name: "tcf_action_check_ctrlact" +} elf_symbol { id: 0x01cdd14d name: "tcf_action_exec" @@ -389413,6 +389960,33 @@ elf_symbol { type_id: 0x9cdfbc5a full_name: "tcf_action_exec" } +elf_symbol { + id: 0x2d797653 + name: "tcf_action_set_ctrlact" + is_defined: true + symbol_type: FUNCTION + crc: 0x40648ae8 + type_id: 0xd6fcc6b4 + full_name: "tcf_action_set_ctrlact" +} +elf_symbol { + id: 0x2fba8b59 + name: "tcf_action_update_stats" + is_defined: true + symbol_type: FUNCTION + crc: 0xc01351f4 + type_id: 0x1d1ccc70 + full_name: "tcf_action_update_stats" +} +elf_symbol { + id: 0xcda1c9b0 + name: "tcf_chain_put_by_act" + is_defined: true + symbol_type: FUNCTION + crc: 0x32e263c9 + type_id: 0x163a90aa + full_name: "tcf_chain_put_by_act" +} elf_symbol { id: 0xc924b9c3 name: "tcf_exts_destroy" @@ -389440,6 +390014,24 @@ elf_symbol { type_id: 0x9c9d758d full_name: "tcf_exts_dump_stats" } +elf_symbol { + id: 0xcc0525bc + name: "tcf_exts_num_actions" + is_defined: true + symbol_type: FUNCTION + crc: 0x622f18a2 + type_id: 0xca3fb0b0 + full_name: "tcf_exts_num_actions" +} +elf_symbol { + id: 0xb8aeb338 + name: "tcf_exts_terse_dump" + is_defined: true + symbol_type: FUNCTION + crc: 0x6ed8c02c + type_id: 0x9c9d758d + full_name: "tcf_exts_terse_dump" +} elf_symbol { id: 0xd6adc7e6 name: "tcf_exts_validate" @@ -389449,6 +390041,69 @@ elf_symbol { type_id: 0x9e8d7e1b full_name: "tcf_exts_validate" } +elf_symbol { + id: 0x15d83074 + name: "tcf_generic_walker" + is_defined: true + symbol_type: FUNCTION + crc: 0xed0b67db + type_id: 0x998b6de0 + full_name: "tcf_generic_walker" +} +elf_symbol { + id: 0x199994d8 + name: "tcf_idr_check_alloc" + is_defined: true + symbol_type: FUNCTION + crc: 0xc97e7304 + type_id: 0x99777843 + full_name: "tcf_idr_check_alloc" +} +elf_symbol { + id: 0xf8fc1781 + name: "tcf_idr_cleanup" + is_defined: true + symbol_type: FUNCTION + crc: 0x5d9b66f4 + type_id: 0x17a860a1 + full_name: "tcf_idr_cleanup" +} +elf_symbol { + id: 0x7d1274eb + name: "tcf_idr_create_from_flags" + is_defined: true + symbol_type: FUNCTION + crc: 0x9542eb81 + type_id: 0x9ab82f4e + full_name: "tcf_idr_create_from_flags" +} +elf_symbol { + id: 0xff33b55b + name: "tcf_idr_release" + is_defined: true + symbol_type: FUNCTION + crc: 0x37c812cd + type_id: 0x93dfd462 + full_name: "tcf_idr_release" +} +elf_symbol { + id: 0x6bb95f19 + name: "tcf_idr_search" + is_defined: true + symbol_type: FUNCTION + crc: 0xbe3be9ac + type_id: 0x99b35b75 + full_name: "tcf_idr_search" +} +elf_symbol { + id: 0x9945c609 + name: "tcf_idrinfo_destroy" + is_defined: true + symbol_type: FUNCTION + crc: 0x23943127 + type_id: 0x1ed96c59 + full_name: "tcf_idrinfo_destroy" +} elf_symbol { id: 0xcc386657 name: "tcf_queue_work" @@ -389458,6 +390113,24 @@ elf_symbol { type_id: 0xf39dedcb full_name: "tcf_queue_work" } +elf_symbol { + id: 0x529a9e72 + name: "tcf_register_action" + is_defined: true + symbol_type: FUNCTION + crc: 0x86a41cbc + type_id: 0x98511587 + full_name: "tcf_register_action" +} +elf_symbol { + id: 0x99d5bf98 + name: "tcf_unregister_action" + is_defined: true + symbol_type: FUNCTION + crc: 0xb6030976 + type_id: 0x98511587 + full_name: "tcf_unregister_action" +} elf_symbol { id: 0xeb0e3e9b name: "tcp_hashinfo" @@ -399329,6 +400002,7 @@ interface { symbol_id: 0xe614bbc1 symbol_id: 0x07c5a76f symbol_id: 0x55574d11 + symbol_id: 0xbdb79dce symbol_id: 0x7809a362 symbol_id: 0x91762fff symbol_id: 0x7a4705f8 @@ -402190,6 +402864,7 @@ interface { symbol_id: 0xbbba9aad symbol_id: 0xd211b195 symbol_id: 0xba7efe3b + symbol_id: 0xdf121e19 symbol_id: 0xdf189e23 symbol_id: 0xae6c6645 symbol_id: 0x6097dede @@ -402984,6 +403659,7 @@ interface { symbol_id: 0xd63a3f70 symbol_id: 0x075fdad1 symbol_id: 0x6bcfa61d + symbol_id: 0x01438401 symbol_id: 0x9175ce1c symbol_id: 0x81dadb36 symbol_id: 0x9bfc3a5e @@ -404911,6 +405587,13 @@ interface { symbol_id: 0xe40dd16b symbol_id: 0xe3dfe241 symbol_id: 0x33735fec + symbol_id: 0x4a80bd34 + symbol_id: 0xacfbcb27 + symbol_id: 0x414be22e + symbol_id: 0x020865bd + symbol_id: 0xb3f58cb2 + symbol_id: 0x236e8eb5 + symbol_id: 0xd1a5a209 symbol_id: 0xca7402ca symbol_id: 0x778992cc symbol_id: 0x0e0dc50e @@ -404933,6 +405616,8 @@ interface { symbol_id: 0x745d77d7 symbol_id: 0xee44d535 symbol_id: 0xeedc57e1 + symbol_id: 0x4cb1cea9 + symbol_id: 0x2b9b7a92 symbol_id: 0x706a5214 symbol_id: 0x56fe28ac symbol_id: 0xfb0d7eaf @@ -405383,12 +406068,31 @@ interface { symbol_id: 0x9c77d018 symbol_id: 0x9b3fb280 symbol_id: 0x6c3c9573 + symbol_id: 0x1a591d57 + symbol_id: 0xf099d343 + symbol_id: 0xadb59b05 + symbol_id: 0xbfd2d0d2 + symbol_id: 0xd6059721 symbol_id: 0x01cdd14d + symbol_id: 0x2d797653 + symbol_id: 0x2fba8b59 + symbol_id: 0xcda1c9b0 symbol_id: 0xc924b9c3 symbol_id: 0x2c53af12 symbol_id: 0xa4bb7174 + symbol_id: 0xcc0525bc + symbol_id: 0xb8aeb338 symbol_id: 0xd6adc7e6 + symbol_id: 0x15d83074 + symbol_id: 0x199994d8 + symbol_id: 0xf8fc1781 + symbol_id: 0x7d1274eb + symbol_id: 0xff33b55b + symbol_id: 0x6bb95f19 + symbol_id: 0x9945c609 symbol_id: 0xcc386657 + symbol_id: 0x529a9e72 + symbol_id: 0x99d5bf98 symbol_id: 0xeb0e3e9b symbol_id: 0x5f96413a symbol_id: 0x34a062e9 diff --git a/android/abi_gki_aarch64_honda b/android/abi_gki_aarch64_honda index 526964f0142e..54def470d105 100644 --- a/android/abi_gki_aarch64_honda +++ b/android/abi_gki_aarch64_honda @@ -13,3 +13,40 @@ led_blink_set_oneshot led_set_brightness_nosleep led_stop_software_blink + +# required by cls_flower.ko module + flow_rule_alloc + idr_get_next_ul + radix_tree_tagged + skb_flow_dissect_ct + skb_flow_dissect_hash + skb_flow_dissect_meta + skb_flow_dissect_tunnel_info + skb_flow_dissector_init + tc_setup_cb_call + tc_setup_cb_destroy + tc_setup_cb_reoffload + tc_setup_cb_add + tcf_exts_num_actions + tcf_exts_terse_dump + +# required by act_vlan.ko module + jiffies_to_clock_t + skb_eth_push + skb_eth_pop + __skb_vlan_pop + skb_vlan_push + skb_vlan_pop + tcf_action_check_ctrlact + tcf_action_set_ctrlact + tcf_action_update_stats + tcf_chain_put_by_act + tcf_generic_walker + tcf_idr_check_alloc + tcf_idr_cleanup + tcf_idr_create_from_flags + tcf_idr_release + tcf_idr_search + tcf_idrinfo_destroy + tcf_register_action + tcf_unregister_action From 4dc7f98815ead8c97ab037a5b2b99bcf645eb0a6 Mon Sep 17 00:00:00 2001 From: Norihiko Hama Date: Sat, 6 Jan 2024 16:12:46 +0900 Subject: [PATCH 07/70] ANDROID: GKI: Update honda symbol list for ebtables 18 function symbol(s) added 'void __audit_log_nfcfg(const char*, u8, unsigned int, enum audit_nfcfgop, gfp_t)' 'int nf_register_sockopt(struct nf_sockopt_ops*)' 'void nf_unregister_sockopt(struct nf_sockopt_ops*)' 'void* vmalloc_node(unsigned long, int)' 'int xt_check_match(struct xt_mtchk_param*, unsigned int, u16, bool)' 'int xt_check_target(struct xt_tgchk_param*, unsigned int, u16, bool)' 'int xt_compat_add_offset(u_int8_t, unsigned int, int)' 'int xt_compat_calc_jump(u_int8_t, unsigned int)' 'void xt_compat_flush_offsets(u_int8_t)' 'int xt_compat_init_offsets(u8, unsigned int)' 'void xt_compat_lock(u_int8_t)' 'int xt_compat_match_offset(const struct xt_match*)' 'int xt_compat_target_offset(const struct xt_target*)' 'void xt_compat_unlock(u_int8_t)' 'int xt_data_to_user(void*, const void*, int, int, int)' 'struct xt_match* xt_find_match(u8, const char*, u8)' 'struct xt_match* xt_request_find_match(uint8_t, const char*, uint8_t)' 'struct xt_target* xt_request_find_target(u8, const char*, u8)' 1 variable symbol(s) added 'u32 audit_enabled' Bug: 319451108 Change-Id: I5e8b449b63100da21939b7f74c8db1df0eae1947 Signed-off-by: Norihiko Hama --- android/abi_gki_aarch64.stg | 1043 +++++++++++++++++++++++++++++++++ android/abi_gki_aarch64_honda | 21 + 2 files changed, 1064 insertions(+) diff --git a/android/abi_gki_aarch64.stg b/android/abi_gki_aarch64.stg index b14c07379061..df71bc1b8567 100644 --- a/android/abi_gki_aarch64.stg +++ b/android/abi_gki_aarch64.stg @@ -2563,6 +2563,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0x0f8cb195 } +pointer_reference { + id: 0x09793771 + kind: POINTER + pointee_type_id: 0x0fa43b5b +} pointer_reference { id: 0x097a80cb kind: POINTER @@ -4418,6 +4423,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0x1e388fbe } +pointer_reference { + id: 0x0d1e2386 + kind: POINTER + pointee_type_id: 0x1e386887 +} pointer_reference { id: 0x0d1ea752 kind: POINTER @@ -5213,6 +5223,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0x1cf53808 } +pointer_reference { + id: 0x0dae372d + kind: POINTER + pointee_type_id: 0x1cf83a2a +} pointer_reference { id: 0x0daecbaf kind: POINTER @@ -6793,6 +6808,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0x165365f0 } +pointer_reference { + id: 0x0f04e485 + kind: POINTER + pointee_type_id: 0x16537488 +} pointer_reference { id: 0x0f04e7c1 kind: POINTER @@ -8113,6 +8133,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0x6f28a54f } +pointer_reference { + id: 0x115cc476 + kind: POINTER + pointee_type_id: 0x6f33f746 +} pointer_reference { id: 0x115dc206 kind: POINTER @@ -12893,6 +12918,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0xb4f4f790 } +pointer_reference { + id: 0x27b13952 + kind: POINTER + pointee_type_id: 0xb48403d5 +} pointer_reference { id: 0x27b5ed37 kind: POINTER @@ -14288,6 +14318,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0x9b4af141 } +pointer_reference { + id: 0x2c42c82a + kind: POINTER + pointee_type_id: 0x9b4bc634 +} pointer_reference { id: 0x2c42cb6e kind: POINTER @@ -14298,6 +14333,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0x9b4bd74c } +pointer_reference { + id: 0x2c42fa17 + kind: POINTER + pointee_type_id: 0x9b4b0ec1 +} pointer_reference { id: 0x2c436299 kind: POINTER @@ -14468,6 +14508,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0x9b74c720 } +pointer_reference { + id: 0x2c4d46ea + kind: POINTER + pointee_type_id: 0x9b75fd34 +} pointer_reference { id: 0x2c4d6bfe kind: POINTER @@ -19403,6 +19448,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0x9352af9c } +pointer_reference { + id: 0x2e4676b7 + kind: POINTER + pointee_type_id: 0x93593c41 +} pointer_reference { id: 0x2e477ad3 kind: POINTER @@ -20558,6 +20608,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0x91cfc9b1 } +pointer_reference { + id: 0x2ee404a5 + kind: POINTER + pointee_type_id: 0x91d0f40b +} pointer_reference { id: 0x2ee5b68c kind: POINTER @@ -22428,6 +22483,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0xeabee0bd } +pointer_reference { + id: 0x303f837b + kind: POINTER + pointee_type_id: 0xeabeeb71 +} pointer_reference { id: 0x30408c71 kind: POINTER @@ -22883,6 +22943,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0xeebb2bcf } +pointer_reference { + id: 0x31405c92 + kind: POINTER + pointee_type_id: 0xef4194d4 +} pointer_reference { id: 0x31433284 kind: POINTER @@ -22958,6 +23023,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0xefa4cae6 } +pointer_reference { + id: 0x3181aee5 + kind: POINTER + pointee_type_id: 0xec465d0b +} pointer_reference { id: 0x31829648 kind: POINTER @@ -25453,6 +25523,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0xf1214399 } +pointer_reference { + id: 0x36dc02f2 + kind: POINTER + pointee_type_id: 0xf130ed57 +} pointer_reference { id: 0x36dc9e6f kind: POINTER @@ -25528,6 +25603,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0xf1938ae0 } +pointer_reference { + id: 0x36f8a731 + kind: POINTER + pointee_type_id: 0xf1a27a59 +} pointer_reference { id: 0x36f98e5c kind: POINTER @@ -26628,6 +26708,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0xcebcf7b7 } +pointer_reference { + id: 0x3944cc8a + kind: POINTER + pointee_type_id: 0xcf53d4b6 +} pointer_reference { id: 0x39450091 kind: POINTER @@ -26858,6 +26943,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0xccbdcf13 } +pointer_reference { + id: 0x39c040d1 + kind: POINTER + pointee_type_id: 0xcd41e5db +} pointer_reference { id: 0x39c0701e kind: POINTER @@ -27138,6 +27228,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0xc3bedf1f } +pointer_reference { + id: 0x3a80e450 + kind: POINTER + pointee_type_id: 0xc04377de +} pointer_reference { id: 0x3a813c8c kind: POINTER @@ -27518,6 +27613,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0xc7dbc4f1 } +pointer_reference { + id: 0x3b677dbb + kind: POINTER + pointee_type_id: 0xc7dd1073 +} pointer_reference { id: 0x3b68ec61 kind: POINTER @@ -27828,6 +27928,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0xdaa2f673 } +pointer_reference { + id: 0x3c3f3f74 + kind: POINTER + pointee_type_id: 0xdabc1b4d +} pointer_reference { id: 0x3c3fe9a7 kind: POINTER @@ -28263,6 +28368,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0xdfde7856 } +pointer_reference { + id: 0x3d6e017a + kind: POINTER + pointee_type_id: 0xdff8e374 +} pointer_reference { id: 0x3d723536 kind: POINTER @@ -28628,6 +28738,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0xd20232fd } +pointer_reference { + id: 0x3e12c07b + kind: POINTER + pointee_type_id: 0xd20be770 +} pointer_reference { id: 0x3e146274 kind: POINTER @@ -31753,6 +31868,11 @@ qualified { qualifier: CONST qualified_type_id: 0x70919762 } +qualified { + id: 0xc04377de + qualifier: CONST + qualified_type_id: 0x714a69f1 +} qualified { id: 0xc04414ae qualifier: CONST @@ -32118,6 +32238,11 @@ qualified { qualifier: CONST qualified_type_id: 0x6f28a54f } +qualified { + id: 0xc7dd1073 + qualifier: CONST + qualified_type_id: 0x6f33f746 +} qualified { id: 0xc803d596 qualifier: CONST @@ -33448,6 +33573,11 @@ qualified { qualifier: CONST qualified_type_id: 0x0f3e57d3 } +qualified { + id: 0xdff8e374 + qualifier: CONST + qualified_type_id: 0x0fa43b5b +} qualified { id: 0xe03e1a37 qualifier: CONST @@ -34008,6 +34138,11 @@ qualified { qualifier: CONST qualified_type_id: 0xdabc347f } +qualified { + id: 0xeabeeb71 + qualifier: CONST + qualified_type_id: 0xdabc1b4d +} qualified { id: 0xeae74d43 qualifier: CONST @@ -34118,6 +34253,11 @@ qualified { qualifier: CONST qualified_type_id: 0xc06242e6 } +qualified { + id: 0xec465d0b + qualifier: CONST + qualified_type_id: 0xc15ec2a7 +} qualified { id: 0xec4abfbd qualifier: CONST @@ -34318,6 +34458,11 @@ qualified { qualifier: CONST qualified_type_id: 0xcc87604a } +qualified { + id: 0xef4194d4 + qualifier: CONST + qualified_type_id: 0xcd41e5db +} qualified { id: 0xef4c2c8d qualifier: CONST @@ -34383,6 +34528,11 @@ qualified { qualifier: CONST qualified_type_id: 0xb469cc14 } +qualified { + id: 0xf130ed57 + qualifier: CONST + qualified_type_id: 0xb48403d5 +} qualified { id: 0xf16d39f2 qualifier: CONST @@ -35567,6 +35717,11 @@ array { number_of_elements: 3 element_type_id: 0x35448f63 } +array { + id: 0x201349f7 + number_of_elements: 29 + element_type_id: 0xd20232fd +} array { id: 0x2087fff2 number_of_elements: 3 @@ -39439,6 +39594,11 @@ member { type_id: 0x458b21a2 offset: 96 } +member { + id: 0x32a98097 + type_id: 0x458861c9 + offset: 64 +} member { id: 0x32ae3ded type_id: 0x459687a6 @@ -39957,6 +40117,10 @@ member { type_id: 0x6f2909ad offset: 832 } +member { + id: 0x381ff41d + type_id: 0x6f51a064 +} member { id: 0x38620a39 type_id: 0x6ea6707c @@ -60586,6 +60750,18 @@ member { type_id: 0x139300cd offset: 256 } +member { + id: 0x67e96e72 + name: "checkentry" + type_id: 0x2e4676b7 + offset: 448 +} +member { + id: 0x67e9cc00 + name: "checkentry" + type_id: 0x2ee404a5 + offset: 448 +} member { id: 0x666c167f name: "checkreqprot" @@ -64032,6 +64208,12 @@ member { type_id: 0xd25c011d offset: 192 } +member { + id: 0xc3d16b32 + name: "compat_from_user" + type_id: 0x0f04e485 + offset: 576 +} member { id: 0x4a54423a name: "compat_ioctl" @@ -64115,6 +64297,12 @@ member { type_id: 0x6720d32f offset: 192 } +member { + id: 0x8fe7966d + name: "compat_to_user" + type_id: 0x2c42c82a + offset: 640 +} member { id: 0x7a39bd0a name: "compat_version" @@ -64155,6 +64343,12 @@ member { name: "compatible_version" type_id: 0xe8034002 } +member { + id: 0xca1a8759 + name: "compatsize" + type_id: 0x4585663f + offset: 896 +} member { id: 0x989c0466 name: "compl_reqs" @@ -73717,6 +73911,12 @@ member { type_id: 0x0d1ea752 offset: 832 } +member { + id: 0xa4fb3edf + name: "destroy" + type_id: 0x0d1e2386 + offset: 512 +} member { id: 0xa4fb57dd name: "destroy" @@ -73734,6 +73934,12 @@ member { type_id: 0x0dad77a5 offset: 512 } +member { + id: 0xa4fb8ecb + name: "destroy" + type_id: 0x0dae372d + offset: 512 +} member { id: 0xa4fb8fb9 name: "destroy" @@ -83173,6 +83379,12 @@ member { type_id: 0xf1159c31 offset: 64 } +member { + id: 0x3fc83009 + name: "entryinfo" + type_id: 0x391f15ea + offset: 128 +} member { id: 0x8ef9a4f4 name: "enum_dv_timings" @@ -86267,6 +86479,18 @@ member { name: "family" type_id: 0x6720d32f } +member { + id: 0x9e5f12db + name: "family" + type_id: 0x0abe9fd1 + offset: 352 +} +member { + id: 0x9e5f1e4b + name: "family" + type_id: 0x0abe9fd1 + offset: 192 +} member { id: 0x9e6bbc49 name: "family" @@ -86290,6 +86514,12 @@ member { type_id: 0x295c7202 offset: 8 } +member { + id: 0x9e9c9282 + name: "family" + type_id: 0xc93e017b + offset: 976 +} member { id: 0x9e9c961c name: "family" @@ -92409,6 +92639,12 @@ member { type_id: 0x054f691a offset: 1024 } +member { + id: 0x0840fe2b + name: "fragoff" + type_id: 0x914dbfdc + offset: 224 +} member { id: 0x5ed9c6c0 name: "frags_cache_name" @@ -95192,6 +95428,12 @@ member { type_id: 0x2c3be0fd offset: 640 } +member { + id: 0x31757c02 + name: "get" + type_id: 0x2c42fa17 + offset: 384 +} member { id: 0x31766522 name: "get" @@ -96094,6 +96336,18 @@ member { type_id: 0x39b05793 offset: 1664 } +member { + id: 0x617b3df2 + name: "get_optmax" + type_id: 0x6720d32f + offset: 352 +} +member { + id: 0xff9b15ab + name: "get_optmin" + type_id: 0x6720d32f + offset: 320 +} member { id: 0x4aebacca name: "get_orientation" @@ -100697,6 +100951,12 @@ member { name: "hook" type_id: 0x1d10c881 } +member { + id: 0x90452b86 + name: "hook_mask" + type_id: 0x4585663f + offset: 320 +} member { id: 0x4baf7b66 name: "hook_ops_type" @@ -100716,6 +100976,12 @@ member { type_id: 0xc3ac8280 offset: 64 } +member { + id: 0x64dd1fe7 + name: "hooks" + type_id: 0x4585663f + offset: 928 +} member { id: 0x28df8f7a name: "hooks_arp" @@ -101074,6 +101340,12 @@ member { type_id: 0x6720d32f offset: 1152 } +member { + id: 0xed2a5c83 + name: "hotdrop" + type_id: 0x6d7f5ff6 + offset: 240 +} member { id: 0x75d72ecb name: "hotplug" @@ -121997,6 +122269,12 @@ member { type_id: 0x2cdf41d9 offset: 512 } +member { + id: 0xe615f34c + name: "match" + type_id: 0x36f8a731 + offset: 384 +} member { id: 0xe61687a2 name: "match" @@ -122009,6 +122287,23 @@ member { type_id: 0x3493e68d offset: 256 } +member { + id: 0xe61e6099 + name: "match" + type_id: 0x3d6e017a + offset: 64 +} +member { + id: 0xe61e6478 + name: "match" + type_id: 0x3d6e017a +} +member { + id: 0xe61e6cb1 + name: "match" + type_id: 0x3d6e017a + offset: 192 +} member { id: 0xe62639eb name: "match" @@ -122107,6 +122402,29 @@ member { type_id: 0x33756485 offset: 960 } +member { + id: 0x4dc4136b + name: "matchinfo" + type_id: 0x18bd6530 + offset: 256 +} +member { + id: 0x4dc41a02 + name: "matchinfo" + type_id: 0x18bd6530 + offset: 128 +} +member { + id: 0x4de5b1b0 + name: "matchinfo" + type_id: 0x391f15ea +} +member { + id: 0xa1e58126 + name: "matchsize" + type_id: 0x4585663f + offset: 832 +} member { id: 0xcf872d8f name: "mattr" @@ -125091,6 +125409,12 @@ member { type_id: 0x0b27dc43 offset: 320 } +member { + id: 0x3e3e8f0f + name: "me" + type_id: 0x0b27dc43 + offset: 704 +} member { id: 0x8dae3d1f name: "mean" @@ -131101,6 +131425,12 @@ member { name: "name" type_id: 0x235dd3e0 } +member { + id: 0x0dfb76d6 + name: "name" + type_id: 0x201349f7 + offset: 128 +} member { id: 0x0dfb96fb name: "name" @@ -133804,6 +134134,12 @@ member { name: "nfs_fl" type_id: 0x35981da9 } +member { + id: 0x3d4d09b8 + name: "nft_compat" + type_id: 0x6d7f5ff6 + offset: 360 +} member { id: 0xe49ba3c7 name: "ngpio" @@ -142983,6 +143319,12 @@ member { type_id: 0x0b27dc43 offset: 1280 } +member { + id: 0x4a965527 + name: "owner" + type_id: 0x0b27dc43 + offset: 448 +} member { id: 0x4a96554f name: "owner" @@ -147265,6 +147607,12 @@ member { type_id: 0x914dbfdc offset: 64 } +member { + id: 0xca8bb222 + name: "pf" + type_id: 0x0abe9fd1 + offset: 128 +} member { id: 0xcaa851c4 name: "pf" @@ -154954,6 +155302,12 @@ member { type_id: 0x0db3daed offset: 1472 } +member { + id: 0x5daafa45 + name: "proto" + type_id: 0xc93e017b + offset: 960 +} member { id: 0x5dd026ed name: "proto" @@ -166341,6 +166695,12 @@ member { type_id: 0x3e10b518 offset: 128 } +member { + id: 0x94a26ac4 + name: "revision" + type_id: 0x0abe9fd1 + offset: 360 +} member { id: 0xbcd2bd0f name: "revmap" @@ -173907,6 +174267,12 @@ member { type_id: 0x2e37c006 offset: 320 } +member { + id: 0x3df20d1c + name: "set" + type_id: 0x2c4d46ea + offset: 256 +} member { id: 0x3df35b61 name: "set" @@ -174628,6 +174994,18 @@ member { type_id: 0x33756485 offset: 11648 } +member { + id: 0xbce3db87 + name: "set_optmax" + type_id: 0x6720d32f + offset: 192 +} +member { + id: 0x2ef1fff5 + name: "set_optmin" + type_id: 0x6720d32f + offset: 160 +} member { id: 0x01b2c6d9 name: "set_over_current_protection" @@ -182846,6 +183224,12 @@ member { type_id: 0x33756485 offset: 1728 } +member { + id: 0x72c1076d + name: "state" + type_id: 0x32f2aeac + offset: 128 +} member { id: 0x72c92280 name: "state" @@ -188027,6 +188411,18 @@ member { name: "table" type_id: 0x3f8f92cb } +member { + id: 0xb6d524c4 + name: "table" + type_id: 0x3e10b518 + offset: 64 +} +member { + id: 0xb6d5288b + name: "table" + type_id: 0x3e10b518 + offset: 768 +} member { id: 0xb6ea05f8 name: "table" @@ -188460,6 +188856,29 @@ member { type_id: 0x33756485 offset: 512 } +member { + id: 0xb392e6ad + name: "target" + type_id: 0x303f837b + offset: 192 +} +member { + id: 0xb392ea85 + name: "target" + type_id: 0x303f837b + offset: 64 +} +member { + id: 0xb392ee64 + name: "target" + type_id: 0x303f837b +} +member { + id: 0xb39b94b9 + name: "target" + type_id: 0x3944cc8a + offset: 384 +} member { id: 0xb3add302 name: "target" @@ -188717,6 +189136,29 @@ member { type_id: 0x6720d32f offset: 160 } +member { + id: 0xce07641d + name: "targetsize" + type_id: 0x4585663f + offset: 832 +} +member { + id: 0x2f419094 + name: "targinfo" + type_id: 0x391f15ea +} +member { + id: 0x2f60324f + name: "targinfo" + type_id: 0x18bd6530 + offset: 256 +} +member { + id: 0x2f603b26 + name: "targinfo" + type_id: 0x18bd6530 + offset: 128 +} member { id: 0x9c26475e name: "task" @@ -190060,6 +190502,12 @@ member { type_id: 0x6720d32f offset: 3904 } +member { + id: 0x5a55ca66 + name: "thoff" + type_id: 0x4585663f + offset: 192 +} member { id: 0x0b535931 name: "thrashing_count" @@ -200428,6 +200876,12 @@ member { type_id: 0x4585663f offset: 2784 } +member { + id: 0xbb6c96d0 + name: "usersize" + type_id: 0x4585663f + offset: 864 +} member { id: 0x557afbd5 name: "userspace_addr" @@ -212576,6 +213030,15 @@ struct_union { member_id: 0x2380a48f } } +struct_union { + id: 0x458861c9 + kind: UNION + definition { + bytesize: 8 + member_id: 0x4de5b1b0 + member_id: 0x2f419094 + } +} struct_union { id: 0x458b21a2 kind: UNION @@ -214716,6 +215179,15 @@ struct_union { member_id: 0x7cb52b3e } } +struct_union { + id: 0x6f51a064 + kind: UNION + definition { + bytesize: 8 + member_id: 0xe61e6478 + member_id: 0xb392ee64 + } +} struct_union { id: 0x701090f6 kind: UNION @@ -244140,6 +244612,24 @@ struct_union { member_id: 0xe6309576 } } +struct_union { + id: 0xd20be770 + kind: STRUCT + name: "nf_sockopt_ops" + definition { + bytesize: 72 + member_id: 0x7c00ef52 + member_id: 0xca8bb222 + member_id: 0x2ef1fff5 + member_id: 0xbce3db87 + member_id: 0x3df20d1c + member_id: 0xff9b15ab + member_id: 0x617b3df2 + member_id: 0x31757c02 + member_id: 0x4a965527 + member_id: 0x2d081e2a + } +} struct_union { id: 0x2d20b515 kind: STRUCT @@ -270331,6 +270821,124 @@ struct_union { member_id: 0x24d20612 } } +struct_union { + id: 0xb48403d5 + kind: STRUCT + name: "xt_action_param" + definition { + bytesize: 32 + member_id: 0x381ff41d + member_id: 0x32a98097 + member_id: 0x72c1076d + member_id: 0x5a55ca66 + member_id: 0x0840fe2b + member_id: 0xed2a5c83 + } +} +struct_union { + id: 0x0fa43b5b + kind: STRUCT + name: "xt_match" + definition { + bytesize: 128 + member_id: 0x7c00ef52 + member_id: 0x0dfb76d6 + member_id: 0x94a26ac4 + member_id: 0xe615f34c + member_id: 0x67e96e72 + member_id: 0xa4fb8ecb + member_id: 0xc3d16b32 + member_id: 0x8fe7966d + member_id: 0x3e3e8f0f + member_id: 0xb6d5288b + member_id: 0xa1e58126 + member_id: 0xbb6c96d0 + member_id: 0xca1a8759 + member_id: 0x64dd1fe7 + member_id: 0x5daafa45 + member_id: 0x9e9c9282 + } +} +struct_union { + id: 0x6f33f746 + kind: STRUCT + name: "xt_mtchk_param" + definition { + bytesize: 48 + member_id: 0x7203ed5f + member_id: 0xb6d524c4 + member_id: 0x3fc83009 + member_id: 0xe61e6cb1 + member_id: 0x4dc4136b + member_id: 0x90452b86 + member_id: 0x9e5f12db + member_id: 0x3d4d09b8 + } +} +struct_union { + id: 0xc15ec2a7 + kind: STRUCT + name: "xt_mtdtor_param" + definition { + bytesize: 32 + member_id: 0x7203ed5f + member_id: 0xe61e6099 + member_id: 0x4dc41a02 + member_id: 0x9e5f1e4b + } +} +struct_union { + id: 0xdabc1b4d + kind: STRUCT + name: "xt_target" + definition { + bytesize: 128 + member_id: 0x7c00ef52 + member_id: 0x0dfb76d6 + member_id: 0x94a26ac4 + member_id: 0xb39b94b9 + member_id: 0x67e9cc00 + member_id: 0xa4fb3edf + member_id: 0xc3d16b32 + member_id: 0x8fe7966d + member_id: 0x3e3e8f0f + member_id: 0xb6d5288b + member_id: 0xce07641d + member_id: 0xbb6c96d0 + member_id: 0xca1a8759 + member_id: 0x64dd1fe7 + member_id: 0x5daafa45 + member_id: 0x9e9c9282 + } +} +struct_union { + id: 0xcd41e5db + kind: STRUCT + name: "xt_tgchk_param" + definition { + bytesize: 48 + member_id: 0x7203ed5f + member_id: 0xb6d524c4 + member_id: 0x3fc83009 + member_id: 0xb392e6ad + member_id: 0x2f60324f + member_id: 0x90452b86 + member_id: 0x9e5f12db + member_id: 0x3d4d09b8 + } +} +struct_union { + id: 0x714a69f1 + kind: STRUCT + name: "xt_tgdtor_param" + definition { + bytesize: 32 + member_id: 0x7203ed5f + member_id: 0xb392ea85 + member_id: 0x2f603b26 + member_id: 0x9e5f1e4b + } +} struct_union { id: 0x01c06930 kind: STRUCT @@ -271514,6 +272122,92 @@ enumeration { } } } +enumeration { + id: 0x6797b524 + name: "audit_nfcfgop" + definition { + underlying_type_id: 0x4585663f + enumerator { + name: "AUDIT_XT_OP_REGISTER" + } + enumerator { + name: "AUDIT_XT_OP_REPLACE" + value: 1 + } + enumerator { + name: "AUDIT_XT_OP_UNREGISTER" + value: 2 + } + enumerator { + name: "AUDIT_NFT_OP_TABLE_REGISTER" + value: 3 + } + enumerator { + name: "AUDIT_NFT_OP_TABLE_UNREGISTER" + value: 4 + } + enumerator { + name: "AUDIT_NFT_OP_CHAIN_REGISTER" + value: 5 + } + enumerator { + name: "AUDIT_NFT_OP_CHAIN_UNREGISTER" + value: 6 + } + enumerator { + name: "AUDIT_NFT_OP_RULE_REGISTER" + value: 7 + } + enumerator { + name: "AUDIT_NFT_OP_RULE_UNREGISTER" + value: 8 + } + enumerator { + name: "AUDIT_NFT_OP_SET_REGISTER" + value: 9 + } + enumerator { + name: "AUDIT_NFT_OP_SET_UNREGISTER" + value: 10 + } + enumerator { + name: "AUDIT_NFT_OP_SETELEM_REGISTER" + value: 11 + } + enumerator { + name: "AUDIT_NFT_OP_SETELEM_UNREGISTER" + value: 12 + } + enumerator { + name: "AUDIT_NFT_OP_GEN_REGISTER" + value: 13 + } + enumerator { + name: "AUDIT_NFT_OP_OBJ_REGISTER" + value: 14 + } + enumerator { + name: "AUDIT_NFT_OP_OBJ_UNREGISTER" + value: 15 + } + enumerator { + name: "AUDIT_NFT_OP_OBJ_RESET" + value: 16 + } + enumerator { + name: "AUDIT_NFT_OP_FLOWTABLE_REGISTER" + value: 17 + } + enumerator { + name: "AUDIT_NFT_OP_FLOWTABLE_UNREGISTER" + value: 18 + } + enumerator { + name: "AUDIT_NFT_OP_INVALID" + value: 19 + } + } +} enumeration { id: 0x6bbe1f72 name: "audit_state" @@ -287420,6 +288114,13 @@ function { parameter_id: 0xb0c2eb21 parameter_id: 0x3e10b518 } +function { + id: 0x0118ea6e + return_type_id: 0x3c3f3f74 + parameter_id: 0x295c7202 + parameter_id: 0x3e10b518 + parameter_id: 0x295c7202 +} function { id: 0x012b29b0 return_type_id: 0x914dbfdc @@ -289985,6 +290686,11 @@ function { return_type_id: 0x48b5725f parameter_id: 0x0ab9fa4c } +function { + id: 0x1237f667 + return_type_id: 0x48b5725f + parameter_id: 0x0abe9fd1 +} function { id: 0x1239dff8 return_type_id: 0x48b5725f @@ -292698,6 +293404,12 @@ function { parameter_id: 0x1830dd64 parameter_id: 0x31c0ce8c } +function { + id: 0x16537488 + return_type_id: 0x48b5725f + parameter_id: 0x18bd6530 + parameter_id: 0x391f15ea +} function { id: 0x1653799a return_type_id: 0x48b5725f @@ -296835,6 +297547,11 @@ function { return_type_id: 0x48b5725f parameter_id: 0x31b5a66f } +function { + id: 0x1cf83a2a + return_type_id: 0x48b5725f + parameter_id: 0x3181aee5 +} function { id: 0x1cf8df35 return_type_id: 0x48b5725f @@ -297760,6 +298477,11 @@ function { parameter_id: 0x295c7202 parameter_id: 0x11c404ba } +function { + id: 0x1e386887 + return_type_id: 0x48b5725f + parameter_id: 0x3a80e450 +} function { id: 0x1e388fbe return_type_id: 0x48b5725f @@ -298553,6 +299275,11 @@ function { return_type_id: 0x48b5725f parameter_id: 0x3e10b518 } +function { + id: 0x1f1ce18d + return_type_id: 0x48b5725f + parameter_id: 0x3e12c07b +} function { id: 0x1f1f7d50 return_type_id: 0x48b5725f @@ -299056,6 +299783,15 @@ function { parameter_id: 0xf435685e parameter_id: 0x18bd6530 } +function { + id: 0x1fa9ce73 + return_type_id: 0x48b5725f + parameter_id: 0x3e10b518 + parameter_id: 0x295c7202 + parameter_id: 0x4585663f + parameter_id: 0x6797b524 + parameter_id: 0xf1a6dfed +} function { id: 0x1faab0ad return_type_id: 0x48b5725f @@ -302990,6 +303726,13 @@ function { parameter_id: 0x285cedbe parameter_id: 0x3e10b518 } +function { + id: 0x60249243 + return_type_id: 0x09793771 + parameter_id: 0x43e910ce + parameter_id: 0x3e10b518 + parameter_id: 0x43e910ce +} function { id: 0x60262630 return_type_id: 0x2488f94c @@ -304000,6 +304743,13 @@ function { parameter_id: 0x322c8c4b parameter_id: 0x3e10b518 } +function { + id: 0x7a9367a8 + return_type_id: 0x09793771 + parameter_id: 0x295c7202 + parameter_id: 0x3e10b518 + parameter_id: 0x295c7202 +} function { id: 0x7a9510d5 return_type_id: 0xa256f9e0 @@ -307030,6 +307780,11 @@ function { parameter_id: 0x3f37d9d5 parameter_id: 0xf017819f } +function { + id: 0x918f03f1 + return_type_id: 0x6720d32f + parameter_id: 0x303f837b +} function { id: 0x91906f9c return_type_id: 0x6720d32f @@ -307595,6 +308350,11 @@ function { parameter_id: 0x33f8b54b parameter_id: 0x2b8f13b3 } +function { + id: 0x91d0f40b + return_type_id: 0x6720d32f + parameter_id: 0x31405c92 +} function { id: 0x91d1290e return_type_id: 0x6720d32f @@ -308046,6 +308806,11 @@ function { parameter_id: 0x064d6086 parameter_id: 0x6720d32f } +function { + id: 0x92045331 + return_type_id: 0x6720d32f + parameter_id: 0x3e12c07b +} function { id: 0x92046299 return_type_id: 0x6720d32f @@ -309068,6 +309833,14 @@ function { parameter_id: 0x3e10b518 parameter_id: 0x3185812b } +function { + id: 0x92c30011 + return_type_id: 0x6720d32f + parameter_id: 0x39c040d1 + parameter_id: 0x4585663f + parameter_id: 0x914dbfdc + parameter_id: 0x6d7f5ff6 +} function { id: 0x92c4ddf1 return_type_id: 0x6720d32f @@ -309185,6 +309958,11 @@ function { parameter_id: 0x3df0a7d3 parameter_id: 0x099bbff0 } +function { + id: 0x92db6371 + return_type_id: 0x6720d32f + parameter_id: 0x3d6e017a +} function { id: 0x92dc6e62 return_type_id: 0x6720d32f @@ -309799,6 +310577,11 @@ function { parameter_id: 0x33756485 parameter_id: 0x0a134144 } +function { + id: 0x93593c41 + return_type_id: 0x6720d32f + parameter_id: 0x3b677dbb +} function { id: 0x935a996a return_type_id: 0x15a30023 @@ -312537,6 +313320,12 @@ function { return_type_id: 0x6720d32f parameter_id: 0x2d01fcba } +function { + id: 0x96c1ea37 + return_type_id: 0x6720d32f + parameter_id: 0x295c7202 + parameter_id: 0x4585663f +} function { id: 0x96c3b4e1 return_type_id: 0x6720d32f @@ -314486,6 +315275,14 @@ function { parameter_id: 0x4585663f parameter_id: 0x4585663f } +function { + id: 0x98e42138 + return_type_id: 0x6720d32f + parameter_id: 0x115cc476 + parameter_id: 0x4585663f + parameter_id: 0x914dbfdc + parameter_id: 0x6d7f5ff6 +} function { id: 0x98e450c7 return_type_id: 0x6720d32f @@ -318030,6 +318827,14 @@ function { parameter_id: 0x1bf16028 parameter_id: 0x0a0607fc } +function { + id: 0x9b4b0ec1 + return_type_id: 0x6720d32f + parameter_id: 0x1d44326e + parameter_id: 0x6720d32f + parameter_id: 0x18bd6530 + parameter_id: 0x13580d6c +} function { id: 0x9b4b35cf return_type_id: 0x6720d32f @@ -318049,6 +318854,12 @@ function { parameter_id: 0x18bd6530 parameter_id: 0x390ad61e } +function { + id: 0x9b4bc634 + return_type_id: 0x6720d32f + parameter_id: 0x18bd6530 + parameter_id: 0x391f15ea +} function { id: 0x9b4bcb26 return_type_id: 0x6720d32f @@ -318187,6 +318998,15 @@ function { parameter_id: 0x1a5d0549 parameter_id: 0x052fac00 } +function { + id: 0x9b538b4b + return_type_id: 0x6720d32f + parameter_id: 0x18bd6530 + parameter_id: 0x391f15ea + parameter_id: 0x6720d32f + parameter_id: 0x6720d32f + parameter_id: 0x6720d32f +} function { id: 0x9b538b4c return_type_id: 0x6720d32f @@ -318802,6 +319622,14 @@ function { parameter_id: 0x188b9e81 parameter_id: 0x35d37abd } +function { + id: 0x9b75fd34 + return_type_id: 0x6720d32f + parameter_id: 0x1d44326e + parameter_id: 0x6720d32f + parameter_id: 0xe61f67ea + parameter_id: 0x4585663f +} function { id: 0x9b76121f return_type_id: 0x6720d32f @@ -324873,6 +325701,13 @@ function { return_type_id: 0x6720d32f parameter_id: 0x0e7d50ff } +function { + id: 0x9e209977 + return_type_id: 0x6720d32f + parameter_id: 0x0abe9fd1 + parameter_id: 0x4585663f + parameter_id: 0x6720d32f +} function { id: 0x9e20c0b8 return_type_id: 0x6720d32f @@ -324989,6 +325824,12 @@ function { parameter_id: 0x0b036186 parameter_id: 0x13580d6c } +function { + id: 0x9e395143 + return_type_id: 0x6720d32f + parameter_id: 0x0abe9fd1 + parameter_id: 0x4585663f +} function { id: 0x9e3d18cf return_type_id: 0x6720d32f @@ -329542,6 +330383,12 @@ function { parameter_id: 0x4585663f parameter_id: 0x3e10b518 } +function { + id: 0xcf53d4b6 + return_type_id: 0x4585663f + parameter_id: 0x054f691a + parameter_id: 0x36dc02f2 +} function { id: 0xcf54e4d8 return_type_id: 0x65d74a06 @@ -330746,6 +331593,12 @@ function { return_type_id: 0x1344d43c parameter_id: 0x31829648 } +function { + id: 0xf1a27a59 + return_type_id: 0x6d7f5ff6 + parameter_id: 0x3e6396e0 + parameter_id: 0x27b13952 +} function { id: 0xf1ad8e6c return_type_id: 0x6d7f5ff6 @@ -332424,6 +333277,15 @@ elf_symbol { symbol_type: FUNCTION crc: 0x3d93c7c2 } +elf_symbol { + id: 0xa610716e + name: "__audit_log_nfcfg" + is_defined: true + symbol_type: FUNCTION + crc: 0x9968aacb + type_id: 0x1fa9ce73 + full_name: "__audit_log_nfcfg" +} elf_symbol { id: 0x1bc9d7cd name: "__auxiliary_driver_register" @@ -345086,6 +345948,15 @@ elf_symbol { type_id: 0x9faad4c6 full_name: "attribute_container_unregister" } +elf_symbol { + id: 0x32300687 + name: "audit_enabled" + is_defined: true + symbol_type: OBJECT + crc: 0xb44e18ea + type_id: 0xc9082b19 + full_name: "audit_enabled" +} elf_symbol { id: 0x82786c66 name: "autoremove_wake_function" @@ -373087,6 +373958,15 @@ elf_symbol { type_id: 0x9e768b87 full_name: "nf_register_net_hooks" } +elf_symbol { + id: 0xaf6b3cf1 + name: "nf_register_sockopt" + is_defined: true + symbol_type: FUNCTION + crc: 0x953af51d + type_id: 0x92045331 + full_name: "nf_register_sockopt" +} elf_symbol { id: 0x840dad92 name: "nf_unregister_net_hook" @@ -373105,6 +373985,15 @@ elf_symbol { type_id: 0x136e393b full_name: "nf_unregister_net_hooks" } +elf_symbol { + id: 0x21972142 + name: "nf_unregister_sockopt" + is_defined: true + symbol_type: FUNCTION + crc: 0x94800529 + type_id: 0x1f1ce18d + full_name: "nf_unregister_sockopt" +} elf_symbol { id: 0x36bc8d13 name: "nfc_add_se" @@ -398204,6 +399093,15 @@ elf_symbol { type_id: 0x5a4be8d0 full_name: "vmalloc" } +elf_symbol { + id: 0xe69feff9 + name: "vmalloc_node" + is_defined: true + symbol_type: FUNCTION + crc: 0x23fd3028 + type_id: 0x5bd76b9c + full_name: "vmalloc_node" +} elf_symbol { id: 0x3f9de086 name: "vmalloc_nr_pages" @@ -399464,6 +400362,132 @@ elf_symbol { type_id: 0xfe25e2a0 full_name: "xsk_uses_need_wakeup" } +elf_symbol { + id: 0xf5ab35e6 + name: "xt_check_match" + is_defined: true + symbol_type: FUNCTION + crc: 0x05cd1740 + type_id: 0x98e42138 + full_name: "xt_check_match" +} +elf_symbol { + id: 0x7403a15a + name: "xt_check_target" + is_defined: true + symbol_type: FUNCTION + crc: 0x1314973f + type_id: 0x92c30011 + full_name: "xt_check_target" +} +elf_symbol { + id: 0x2f309c50 + name: "xt_compat_add_offset" + is_defined: true + symbol_type: FUNCTION + crc: 0x823edea5 + type_id: 0x9e209977 + full_name: "xt_compat_add_offset" +} +elf_symbol { + id: 0x26744e0a + name: "xt_compat_calc_jump" + is_defined: true + symbol_type: FUNCTION + crc: 0xc7fae024 + type_id: 0x9e395143 + full_name: "xt_compat_calc_jump" +} +elf_symbol { + id: 0xe7886112 + name: "xt_compat_flush_offsets" + is_defined: true + symbol_type: FUNCTION + crc: 0x04e27719 + type_id: 0x1237f667 + full_name: "xt_compat_flush_offsets" +} +elf_symbol { + id: 0xcec5ff48 + name: "xt_compat_init_offsets" + is_defined: true + symbol_type: FUNCTION + crc: 0x50873741 + type_id: 0x96c1ea37 + full_name: "xt_compat_init_offsets" +} +elf_symbol { + id: 0x78c32641 + name: "xt_compat_lock" + is_defined: true + symbol_type: FUNCTION + crc: 0xa7c94f1d + type_id: 0x1237f667 + full_name: "xt_compat_lock" +} +elf_symbol { + id: 0x135c7495 + name: "xt_compat_match_offset" + is_defined: true + symbol_type: FUNCTION + crc: 0x14a0f8b0 + type_id: 0x92db6371 + full_name: "xt_compat_match_offset" +} +elf_symbol { + id: 0x85c54a29 + name: "xt_compat_target_offset" + is_defined: true + symbol_type: FUNCTION + crc: 0xfb916994 + type_id: 0x918f03f1 + full_name: "xt_compat_target_offset" +} +elf_symbol { + id: 0x5a8a6a49 + name: "xt_compat_unlock" + is_defined: true + symbol_type: FUNCTION + crc: 0xd1e246a2 + type_id: 0x1237f667 + full_name: "xt_compat_unlock" +} +elf_symbol { + id: 0x8eb67e0f + name: "xt_data_to_user" + is_defined: true + symbol_type: FUNCTION + crc: 0xc2666935 + type_id: 0x9b538b4b + full_name: "xt_data_to_user" +} +elf_symbol { + id: 0xf6d0be30 + name: "xt_find_match" + is_defined: true + symbol_type: FUNCTION + crc: 0x9ae59c00 + type_id: 0x7a9367a8 + full_name: "xt_find_match" +} +elf_symbol { + id: 0xffcb0fa2 + name: "xt_request_find_match" + is_defined: true + symbol_type: FUNCTION + crc: 0xbbf17510 + type_id: 0x60249243 + full_name: "xt_request_find_match" +} +elf_symbol { + id: 0xa2ee5f12 + name: "xt_request_find_target" + is_defined: true + symbol_type: FUNCTION + crc: 0x3f5ba116 + type_id: 0x0118ea6e + full_name: "xt_request_find_target" +} elf_symbol { id: 0x0fc8c78d name: "zap_vma_ptes" @@ -399682,6 +400706,7 @@ interface { symbol_id: 0xc77348b3 symbol_id: 0x21c9fe20 symbol_id: 0xeaf0b860 + symbol_id: 0xa610716e symbol_id: 0x1bc9d7cd symbol_id: 0xd97b055a symbol_id: 0xac51df48 @@ -401089,6 +402114,7 @@ interface { symbol_id: 0x24064426 symbol_id: 0x41765c03 symbol_id: 0xcd05507b + symbol_id: 0x32300687 symbol_id: 0x82786c66 symbol_id: 0xd772fde3 symbol_id: 0x1abdc14f @@ -404199,8 +405225,10 @@ interface { symbol_id: 0x82e37620 symbol_id: 0x8b1dfb41 symbol_id: 0x43078d96 + symbol_id: 0xaf6b3cf1 symbol_id: 0x840dad92 symbol_id: 0x619db28f + symbol_id: 0x21972142 symbol_id: 0x36bc8d13 symbol_id: 0x38637341 symbol_id: 0x985a4d66 @@ -406990,6 +408018,7 @@ interface { symbol_id: 0xca7f93d5 symbol_id: 0xac972f8d symbol_id: 0x3c915fdb + symbol_id: 0xe69feff9 symbol_id: 0x3f9de086 symbol_id: 0x6d8b459f symbol_id: 0xa1a341df @@ -407130,6 +408159,20 @@ interface { symbol_id: 0xe31eb78b symbol_id: 0xb73c4905 symbol_id: 0xbb650596 + symbol_id: 0xf5ab35e6 + symbol_id: 0x7403a15a + symbol_id: 0x2f309c50 + symbol_id: 0x26744e0a + symbol_id: 0xe7886112 + symbol_id: 0xcec5ff48 + symbol_id: 0x78c32641 + symbol_id: 0x135c7495 + symbol_id: 0x85c54a29 + symbol_id: 0x5a8a6a49 + symbol_id: 0x8eb67e0f + symbol_id: 0xf6d0be30 + symbol_id: 0xffcb0fa2 + symbol_id: 0xa2ee5f12 symbol_id: 0x0fc8c78d symbol_id: 0xe8e0ea6a symbol_id: 0xa5d58813 diff --git a/android/abi_gki_aarch64_honda b/android/abi_gki_aarch64_honda index 54def470d105..eeed2aa9a1eb 100644 --- a/android/abi_gki_aarch64_honda +++ b/android/abi_gki_aarch64_honda @@ -50,3 +50,24 @@ tcf_idrinfo_destroy tcf_register_action tcf_unregister_action + +# required by ebtables.ko module + __audit_log_nfcfg + audit_enabled + nf_register_sockopt + nf_unregister_sockopt + vmalloc_node + xt_check_match + xt_check_target + xt_compat_add_offset + xt_compat_calc_jump + xt_compat_flush_offsets + xt_compat_init_offsets + xt_compat_lock + xt_compat_match_offset + xt_compat_target_offset + xt_compat_unlock + xt_data_to_user + xt_find_match + xt_request_find_match + xt_request_find_target From 3160b69e20ddbb32a7e3bc54677c340371aaeec6 Mon Sep 17 00:00:00 2001 From: Norihiko Hama Date: Sat, 6 Jan 2024 16:32:50 +0900 Subject: [PATCH 08/70] ANDROID: GKI: Update honda symbol list for ebt filter 2 function symbol(s) added 'void arp_send(int, int, __be32, struct net_device*, __be32, const unsigned char*, const unsigned char*, const unsigned char*)' 'void nf_log_packet(struct net*, u_int8_t, unsigned int, const struct sk_buff*, const struct net_device*, const struct net_device*, const struct nf_loginfo*, const char*, ...)' 1 variable symbol(s) added 'int sysctl_nf_log_all_netns' Bug: 319451108 Change-Id: I5194eb32b01d66db1744c17e45ff1e1451a9f350 Signed-off-by: Norihiko Hama --- android/abi_gki_aarch64.stg | 55 +++++++++++++++++++++++++++++++++++ android/abi_gki_aarch64_honda | 7 +++++ 2 files changed, 62 insertions(+) diff --git a/android/abi_gki_aarch64.stg b/android/abi_gki_aarch64.stg index df71bc1b8567..adb69e3da2c6 100644 --- a/android/abi_gki_aarch64.stg +++ b/android/abi_gki_aarch64.stg @@ -288415,6 +288415,18 @@ function { parameter_id: 0x6720d32f parameter_id: 0x6720d32f } +function { + id: 0x08f48955 + return_type_id: 0x48b5725f + parameter_id: 0x6720d32f + parameter_id: 0x6720d32f + parameter_id: 0xe276adef + parameter_id: 0x32a623d7 + parameter_id: 0xe276adef + parameter_id: 0x384c5795 + parameter_id: 0x384c5795 + parameter_id: 0x384c5795 +} function { id: 0x091a93fa return_type_id: 0xa98dedee @@ -291660,6 +291672,19 @@ function { parameter_id: 0x336c4b19 parameter_id: 0x3e10b518 } +function { + id: 0x138ba240 + return_type_id: 0x48b5725f + parameter_id: 0x0ca27481 + parameter_id: 0x0abe9fd1 + parameter_id: 0x4585663f + parameter_id: 0x3e6396e0 + parameter_id: 0x3399c453 + parameter_id: 0x3399c453 + parameter_id: 0x336c4b19 + parameter_id: 0x3e10b518 + parameter_id: 0xa52a0930 +} function { id: 0x138bff3f return_type_id: 0x0c2e195c @@ -345858,6 +345883,15 @@ elf_symbol { type_id: 0x45f82b62 full_name: "arm_smccc_get_version" } +elf_symbol { + id: 0x4f8a812a + name: "arp_send" + is_defined: true + symbol_type: FUNCTION + crc: 0x9ae1c2c6 + type_id: 0x08f48955 + full_name: "arp_send" +} elf_symbol { id: 0x1eee53db name: "arp_tbl" @@ -373940,6 +373974,15 @@ elf_symbol { type_id: 0xfebe0504 full_name: "nf_ct_invert_tuple" } +elf_symbol { + id: 0x05283614 + name: "nf_log_packet" + is_defined: true + symbol_type: FUNCTION + crc: 0xdaa07447 + type_id: 0x138ba240 + full_name: "nf_log_packet" +} elf_symbol { id: 0x8b1dfb41 name: "nf_register_net_hook" @@ -390345,6 +390388,15 @@ elf_symbol { type_id: 0x8151bb19 full_name: "syscon_regmap_lookup_by_phandle_optional" } +elf_symbol { + id: 0xa32ba558 + name: "sysctl_nf_log_all_netns" + is_defined: true + symbol_type: OBJECT + crc: 0x9aaeefce + type_id: 0x6720d32f + full_name: "sysctl_nf_log_all_netns" +} elf_symbol { id: 0xbf1515af name: "sysctl_sched_features" @@ -402104,6 +402156,7 @@ interface { symbol_id: 0xd634ca29 symbol_id: 0xd672b08d symbol_id: 0xb61718ed + symbol_id: 0x4f8a812a symbol_id: 0x1eee53db symbol_id: 0xd9184490 symbol_id: 0xe6ba30b7 @@ -405223,6 +405276,7 @@ interface { symbol_id: 0xb4e99805 symbol_id: 0x471faa17 symbol_id: 0x82e37620 + symbol_id: 0x05283614 symbol_id: 0x8b1dfb41 symbol_id: 0x43078d96 symbol_id: 0xaf6b3cf1 @@ -407046,6 +407100,7 @@ interface { symbol_id: 0x9a5404bf symbol_id: 0x2f857527 symbol_id: 0x3e5f4f82 + symbol_id: 0xa32ba558 symbol_id: 0xbf1515af symbol_id: 0xe6ea21b1 symbol_id: 0x87812861 diff --git a/android/abi_gki_aarch64_honda b/android/abi_gki_aarch64_honda index eeed2aa9a1eb..d01b1309dc84 100644 --- a/android/abi_gki_aarch64_honda +++ b/android/abi_gki_aarch64_honda @@ -71,3 +71,10 @@ xt_find_match xt_request_find_match xt_request_find_target + +# required by ebt_arpreply.ko module + arp_send + +# required by ebt_log.ko module + nf_log_packet + sysctl_nf_log_all_netns From 55930b39caac80ba866f0a098c38835d1589c69e Mon Sep 17 00:00:00 2001 From: Norihiko Hama Date: Sat, 6 Jan 2024 16:51:38 +0900 Subject: [PATCH 09/70] ANDROID: GKI: Update honda symbol list for xt_LOG 9 function symbol(s) added 'int nf_log_buf_add(struct nf_log_buf*, const char*, ...)' 'void nf_log_buf_close(struct nf_log_buf*)' 'struct nf_log_buf* nf_log_buf_open()' 'int nf_log_register(u_int8_t, struct nf_logger*)' 'int nf_log_set(struct net*, u_int8_t, const struct nf_logger*)' 'void nf_log_unregister(struct nf_logger*)' 'void nf_log_unset(struct net*, const struct nf_logger*)' 'int nf_logger_find_get(int, enum nf_log_type)' 'void nf_logger_put(int, enum nf_log_type)' Bug: 319451108 Change-Id: I300644b6a9221874e29ff97bd2937361c353af03 Signed-off-by: Norihiko Hama --- android/abi_gki_aarch64.stg | 173 ++++++++++++++++++++++++++++++++++ android/abi_gki_aarch64_honda | 11 +++ 2 files changed, 184 insertions(+) diff --git a/android/abi_gki_aarch64.stg b/android/abi_gki_aarch64.stg index adb69e3da2c6..274a0554c239 100644 --- a/android/abi_gki_aarch64.stg +++ b/android/abi_gki_aarch64.stg @@ -183,6 +183,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0x28e34a3d } +pointer_reference { + id: 0x00b27c00 + kind: POINTER + pointee_type_id: 0x2889169c +} pointer_reference { id: 0x00b7947f kind: POINTER @@ -27018,6 +27023,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0xcd0cdcf7 } +pointer_reference { + id: 0x39d477a1 + kind: POINTER + pointee_type_id: 0xcd113819 +} pointer_reference { id: 0x39d60e4a kind: POINTER @@ -38009,6 +38019,11 @@ array { id: 0xc227cae4 element_type_id: 0x18791053 } +array { + id: 0xc2477f5b + number_of_elements: 1020 + element_type_id: 0x384f7d7c +} array { id: 0xc28f8f19 number_of_elements: 19 @@ -55876,6 +55891,12 @@ member { name: "buf" type_id: 0xc8c766a0 } +member { + id: 0x9ad98a9e + name: "buf" + type_id: 0xc2477f5b + offset: 32 +} member { id: 0x9aeff0bf name: "buf" @@ -244581,6 +244602,16 @@ struct_union { member_id: 0xf543a7c9 } } +struct_union { + id: 0xcd113819 + kind: STRUCT + name: "nf_log_buf" + definition { + bytesize: 1024 + member_id: 0x6560daa2 + member_id: 0x9ad98a9e + } +} struct_union { id: 0x2889169c kind: STRUCT @@ -288427,6 +288458,12 @@ function { parameter_id: 0x384c5795 parameter_id: 0x384c5795 } +function { + id: 0x09028dcc + return_type_id: 0x48b5725f + parameter_id: 0x6720d32f + parameter_id: 0x14ba251a +} function { id: 0x091a93fa return_type_id: 0xa98dedee @@ -289485,6 +289522,11 @@ function { return_type_id: 0x48b5725f parameter_id: 0x00a43052 } +function { + id: 0x10b4ce93 + return_type_id: 0x48b5725f + parameter_id: 0x00b27c00 +} function { id: 0x10b5b48c return_type_id: 0x48b5725f @@ -291434,6 +291476,12 @@ function { parameter_id: 0x293f2663 parameter_id: 0x3da0a8e3 } +function { + id: 0x134cbffd + return_type_id: 0x48b5725f + parameter_id: 0x0ca27481 + parameter_id: 0x3f1cd3a6 +} function { id: 0x135157d2 return_type_id: 0x48b5725f @@ -299145,6 +299193,11 @@ function { parameter_id: 0x295c7202 parameter_id: 0x295c7202 } +function { + id: 0x1eed4c7b + return_type_id: 0x48b5725f + parameter_id: 0x39d477a1 +} function { id: 0x1eedbe86 return_type_id: 0x48b5725f @@ -305193,6 +305246,12 @@ function { parameter_id: 0x3e10b518 parameter_id: 0x120540d1 } +function { + id: 0x841a3f70 + return_type_id: 0x6720d32f + parameter_id: 0x6720d32f + parameter_id: 0x14ba251a +} function { id: 0x84257977 return_type_id: 0x6720d32f @@ -310446,6 +310505,13 @@ function { parameter_id: 0x3806390a parameter_id: 0x295c7202 } +function { + id: 0x9324f691 + return_type_id: 0x6720d32f + parameter_id: 0x39d477a1 + parameter_id: 0x3e10b518 + parameter_id: 0xa52a0930 +} function { id: 0x9326478c return_type_id: 0x6720d32f @@ -326332,6 +326398,13 @@ function { return_type_id: 0x6720d32f parameter_id: 0x0c2e195c } +function { + id: 0x9e8d4344 + return_type_id: 0x6720d32f + parameter_id: 0x0ca27481 + parameter_id: 0x0abe9fd1 + parameter_id: 0x3f1cd3a6 +} function { id: 0x9e8d7e1b return_type_id: 0x6720d32f @@ -327046,6 +327119,12 @@ function { parameter_id: 0x0e8833d6 parameter_id: 0x6720d32f } +function { + id: 0x9f2d8d2b + return_type_id: 0x6720d32f + parameter_id: 0x0abe9fd1 + parameter_id: 0x00b27c00 +} function { id: 0x9f2dbdb4 return_type_id: 0x6720d32f @@ -328367,6 +328446,10 @@ function { parameter_id: 0xfc0e1dbd parameter_id: 0x0d9f5631 } +function { + id: 0xa5e2423c + return_type_id: 0x39d477a1 +} function { id: 0xa641688a return_type_id: 0xfc0e1dbd @@ -373974,6 +374057,33 @@ elf_symbol { type_id: 0xfebe0504 full_name: "nf_ct_invert_tuple" } +elf_symbol { + id: 0x38b1d9e3 + name: "nf_log_buf_add" + is_defined: true + symbol_type: FUNCTION + crc: 0xcd6f2dc9 + type_id: 0x9324f691 + full_name: "nf_log_buf_add" +} +elf_symbol { + id: 0xeacec26b + name: "nf_log_buf_close" + is_defined: true + symbol_type: FUNCTION + crc: 0x80c68137 + type_id: 0x1eed4c7b + full_name: "nf_log_buf_close" +} +elf_symbol { + id: 0xfde35a24 + name: "nf_log_buf_open" + is_defined: true + symbol_type: FUNCTION + crc: 0x0d4961de + type_id: 0xa5e2423c + full_name: "nf_log_buf_open" +} elf_symbol { id: 0x05283614 name: "nf_log_packet" @@ -373983,6 +374093,60 @@ elf_symbol { type_id: 0x138ba240 full_name: "nf_log_packet" } +elf_symbol { + id: 0x8ecf8aa9 + name: "nf_log_register" + is_defined: true + symbol_type: FUNCTION + crc: 0x76eb5be6 + type_id: 0x9f2d8d2b + full_name: "nf_log_register" +} +elf_symbol { + id: 0x55dea4c4 + name: "nf_log_set" + is_defined: true + symbol_type: FUNCTION + crc: 0x939a54bd + type_id: 0x9e8d4344 + full_name: "nf_log_set" +} +elf_symbol { + id: 0x8ca42486 + name: "nf_log_unregister" + is_defined: true + symbol_type: FUNCTION + crc: 0x616b7349 + type_id: 0x10b4ce93 + full_name: "nf_log_unregister" +} +elf_symbol { + id: 0xdd9bb11b + name: "nf_log_unset" + is_defined: true + symbol_type: FUNCTION + crc: 0x134619c3 + type_id: 0x134cbffd + full_name: "nf_log_unset" +} +elf_symbol { + id: 0x5eaca033 + name: "nf_logger_find_get" + is_defined: true + symbol_type: FUNCTION + crc: 0xd1f2eee2 + type_id: 0x841a3f70 + full_name: "nf_logger_find_get" +} +elf_symbol { + id: 0x7a73c649 + name: "nf_logger_put" + is_defined: true + symbol_type: FUNCTION + crc: 0xb8cd3a7f + type_id: 0x09028dcc + full_name: "nf_logger_put" +} elf_symbol { id: 0x8b1dfb41 name: "nf_register_net_hook" @@ -405276,7 +405440,16 @@ interface { symbol_id: 0xb4e99805 symbol_id: 0x471faa17 symbol_id: 0x82e37620 + symbol_id: 0x38b1d9e3 + symbol_id: 0xeacec26b + symbol_id: 0xfde35a24 symbol_id: 0x05283614 + symbol_id: 0x8ecf8aa9 + symbol_id: 0x55dea4c4 + symbol_id: 0x8ca42486 + symbol_id: 0xdd9bb11b + symbol_id: 0x5eaca033 + symbol_id: 0x7a73c649 symbol_id: 0x8b1dfb41 symbol_id: 0x43078d96 symbol_id: 0xaf6b3cf1 diff --git a/android/abi_gki_aarch64_honda b/android/abi_gki_aarch64_honda index d01b1309dc84..8ee57762f944 100644 --- a/android/abi_gki_aarch64_honda +++ b/android/abi_gki_aarch64_honda @@ -78,3 +78,14 @@ # required by ebt_log.ko module nf_log_packet sysctl_nf_log_all_netns + +# required by xt_LOG.ko module + nf_log_buf_add + nf_log_buf_close + nf_log_buf_open + nf_log_register + nf_log_set + nf_log_unregister + nf_log_unset + nf_logger_find_get + nf_logger_put From 24bb8fc82e6084e93e22edc2011ddb088f5a60b2 Mon Sep 17 00:00:00 2001 From: songfeng Date: Thu, 4 Jan 2024 18:17:32 +0800 Subject: [PATCH 10/70] ANDROID: vendor_hooks: add hooks in driver/android/binder.c Add hooks to support oem's binder feature of improving certain scenarios sched priority by moving these scenarios' work to a fixed binder thread. Add the following new vendor hooks to drivers/android/binder.c: 1 trace_android_vh_binder_spawn_new_thread in our os, some binder_transaction will be marked as vip flag, it can be named vip transaction, the binder_work within the vip transaction can be named vip work. here will force a thread (named vip thread) to be spawned and skip the normal conditions to spawn a thread. vip thread will just select vip transaction to process. 2 trace_android_vh_binder_ioctl_end in our os, in binder_proc, about binder threads,special thread (called vip thread) will work for special binder_transaction (called vip transaction). here will expand one ioctl cmd for binder driver, it will set the max count about special thread (called vip thread) in binder_proc, and if it has vip thread in the binder_proc. 3 trace_android_vh_binder_looper_exited while BC_REGISTER_LOOPER cmd, will set special thread as vip thread. the flag saved in binder_thread:looper here will unset the vip flag saved in binder_thread, while BC_EXIT_LOOPER cmd, if the thread is vip thread(reference above about vip thread) 4 trace_android_vh_binder_has_special_work_ilocked for special binder thread(called vip thread), it will deal with special binder_work (called vip work) within special transaction (call vip transaction), here, if the thread is vip thread, it will check the vip work if exist or not. 5 trace_android_vh_binder_select_special_worklist for special binder thread(called vip thread), it will select the worklist for special binder_work(called vip work) within special binder_transaction(called vip transaction) here, it will make sure the selected worklist, the head of it is vip work within vip transaction Bug: 318782978 Change-Id: I8e544d9be2644a6144a9cfbd477e087d46b0073f Signed-off-by: songfeng --- drivers/android/binder.c | 18 ++++++++++++++++-- drivers/android/vendor_hooks.c | 5 +++++ include/trace/hooks/binder.h | 22 ++++++++++++++++++++++ 3 files changed, 43 insertions(+), 2 deletions(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index b0188e8ee00b..dc9606733889 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -560,6 +560,7 @@ static bool binder_has_work(struct binder_thread *thread, bool do_proc_work) binder_inner_proc_lock(thread->proc); has_work = binder_has_work_ilocked(thread, do_proc_work); + trace_android_vh_binder_has_special_work_ilocked(thread, do_proc_work, &has_work); binder_inner_proc_unlock(thread->proc); return has_work; @@ -4280,6 +4281,7 @@ static int binder_thread_write(struct binder_proc *proc, thread->looper |= BINDER_LOOPER_STATE_ENTERED; break; case BC_EXIT_LOOPER: + trace_android_vh_binder_looper_exited(thread, proc); binder_debug(BINDER_DEBUG_THREADS, "%d:%d BC_EXIT_LOOPER\n", proc->pid, thread->pid); @@ -4607,6 +4609,8 @@ static int binder_thread_read(struct binder_proc *proc, void __user *end = buffer + size; int ret = 0; + bool nothing_to_do = false; + bool force_spawn = false; int wait_for_proc_work; if (*consumed == 0) { @@ -4662,14 +4666,20 @@ retry: binder_inner_proc_lock(proc); trace_android_vh_binder_select_worklist_ilocked(&list, thread, proc, wait_for_proc_work); + trace_android_vh_binder_select_special_worklist(&list, thread, + proc, wait_for_proc_work, ¬hing_to_do); if (list) goto skip; + else if (nothing_to_do) + goto no_work; + if (!binder_worklist_empty_ilocked(&thread->todo)) list = &thread->todo; else if (!binder_worklist_empty_ilocked(&proc->todo) && wait_for_proc_work) list = &proc->todo; else { +no_work: binder_inner_proc_unlock(proc); /* no data added */ @@ -4987,11 +4997,14 @@ done: *consumed = ptr - buffer; binder_inner_proc_lock(proc); - if (proc->requested_threads == 0 && + trace_android_vh_binder_spawn_new_thread(thread, proc, &force_spawn); + + if ((proc->requested_threads == 0 && list_empty(&thread->proc->waiting_threads) && proc->requested_threads_started < proc->max_threads && (thread->looper & (BINDER_LOOPER_STATE_REGISTERED | - BINDER_LOOPER_STATE_ENTERED)) /* the user-space code fails to */ + BINDER_LOOPER_STATE_ENTERED))) || + force_spawn /* the user-space code fails to */ /*spawn a new thread if we leave this out */) { proc->requested_threads++; binder_inner_proc_unlock(proc); @@ -5780,6 +5793,7 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) goto err; } ret = 0; + trace_android_vh_binder_ioctl_end(current, cmd, arg, thread, proc, &ret); err: if (thread) thread->looper_need_return = false; diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 14bb47fcf8b0..3b50cf94742b 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -164,6 +164,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_wait_for_work); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_proc_transaction_finish); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_proc_transaction_entry); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_select_worklist_ilocked); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_select_special_worklist); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sync_txn_recvd); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpufreq_transition); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_freq_qos_add_request); @@ -370,3 +371,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_kmalloc_large_alloced); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_netlink_poll); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ep_create_wakeup_source); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_timerfd_create); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_ioctl_end); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_looper_exited); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_spawn_new_thread); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_has_special_work_ilocked); diff --git a/include/trace/hooks/binder.h b/include/trace/hooks/binder.h index 216b5645db73..1a1d051fb079 100644 --- a/include/trace/hooks/binder.h +++ b/include/trace/hooks/binder.h @@ -74,6 +74,11 @@ DECLARE_HOOK(android_vh_binder_select_worklist_ilocked, TP_PROTO(struct list_head **list, struct binder_thread *thread, struct binder_proc *proc, int wait_for_proc_work), TP_ARGS(list, thread, proc, wait_for_proc_work)); +DECLARE_HOOK(android_vh_binder_select_special_worklist, + TP_PROTO(struct list_head **list, struct binder_thread *thread, struct binder_proc *proc, + int wait_for_proc_work, bool *nothing_to_do), + TP_ARGS(list, thread, proc, wait_for_proc_work, nothing_to_do)); + DECLARE_HOOK(android_vh_binder_alloc_new_buf_locked, TP_PROTO(size_t size, size_t *free_async_space, int is_async), TP_ARGS(size, free_async_space, is_async)); @@ -118,6 +123,23 @@ DECLARE_HOOK(android_vh_binder_free_buf, struct binder_buffer *buffer), TP_ARGS(proc, thread, buffer)); +DECLARE_HOOK(android_vh_binder_ioctl_end, + TP_PROTO(struct task_struct *caller_task, + unsigned int cmd, + unsigned long arg, + struct binder_thread *thread, + struct binder_proc *proc, + int *ret), + TP_ARGS(caller_task, cmd, arg, thread, proc, ret)); +DECLARE_HOOK(android_vh_binder_looper_exited, + TP_PROTO(struct binder_thread *thread, struct binder_proc *proc), + TP_ARGS(thread, proc)); +DECLARE_HOOK(android_vh_binder_spawn_new_thread, + TP_PROTO(struct binder_thread *thread, struct binder_proc *proc, bool *force_spawn), + TP_ARGS(thread, proc, force_spawn)); +DECLARE_HOOK(android_vh_binder_has_special_work_ilocked, + TP_PROTO(struct binder_thread *thread, bool do_proc_work, bool *has_work), + TP_ARGS(thread, do_proc_work, has_work)); #endif /* _TRACE_HOOK_BINDER_H */ /* This part must be outside protection */ #include From e6712ed4f007a5258d767a73a37ffc7b22538149 Mon Sep 17 00:00:00 2001 From: songfeng Date: Fri, 5 Jan 2024 20:23:25 +0800 Subject: [PATCH 11/70] ANDROID: ABI: Update oplus symbol list 5 function symbol(s) added 'int __traceiter_android_vh_binder_has_special_work_ilocked(void*, struct binder_thread*, bool, bool*)' 'int __traceiter_android_vh_binder_ioctl_end(void*, struct task_struct*, unsigned int, unsigned long, struct binder_thread*, struct binder_proc*, int*)' 'int __traceiter_android_vh_binder_looper_exited(void*, struct binder_thread*, struct binder_proc*)' 'int __traceiter_android_vh_binder_spawn_new_thread(void*, struct binder_thread*, struct binder_proc*, bool*)' 'int __traceiter_android_vh_binder_select_special_worklist(void*, struct list_head**, struct binder_thread*, struct binder_proc*, int, bool*)' 5 variable symbol(s) added 'struct tracepoint __tracepoint_android_vh_binder_has_special_work_ilocked' 'struct tracepoint __tracepoint_android_vh_binder_ioctl_end' 'struct tracepoint __tracepoint_android_vh_binder_looper_exited' 'struct tracepoint __tracepoint_android_vh_binder_spawn_new_thread' 'struct tracepoint __tracepoint_android_vh_binder_select_special_worklist' Bug: 318782978 Change-Id: I0598a329a4d4c455450c9d47973103f04f9e3790 Signed-off-by: songfeng --- android/abi_gki_aarch64.stg | 137 ++++++++++++++++++++++++++++++++++ android/abi_gki_aarch64_oplus | 10 +++ 2 files changed, 147 insertions(+) diff --git a/android/abi_gki_aarch64.stg b/android/abi_gki_aarch64.stg index 274a0554c239..7fdf2a028cf6 100644 --- a/android/abi_gki_aarch64.stg +++ b/android/abi_gki_aarch64.stg @@ -318438,6 +318438,14 @@ function { parameter_id: 0x6d7f5ff6 parameter_id: 0x13580d6c } +function { + id: 0x9b247e43 + return_type_id: 0x6720d32f + parameter_id: 0x18bd6530 + parameter_id: 0x24373219 + parameter_id: 0x6d7f5ff6 + parameter_id: 0x11cfee5a +} function { id: 0x9b248c83 return_type_id: 0x6720d32f @@ -318663,6 +318671,14 @@ function { parameter_id: 0x24373219 parameter_id: 0x1f8dbf97 } +function { + id: 0x9b38c2fb + return_type_id: 0x6720d32f + parameter_id: 0x18bd6530 + parameter_id: 0x24373219 + parameter_id: 0x1f8dbf97 + parameter_id: 0x11cfee5a +} function { id: 0x9b396630 return_type_id: 0x6720d32f @@ -320604,6 +320620,16 @@ function { parameter_id: 0x1f8dbf97 parameter_id: 0x6720d32f } +function { + id: 0x9bb2f2c9 + return_type_id: 0x6720d32f + parameter_id: 0x18bd6530 + parameter_id: 0x0508b7df + parameter_id: 0x24373219 + parameter_id: 0x1f8dbf97 + parameter_id: 0x6720d32f + parameter_id: 0x11cfee5a +} function { id: 0x9bb5868f return_type_id: 0x6720d32f @@ -321059,6 +321085,17 @@ function { parameter_id: 0x7be80061 parameter_id: 0x4585663f } +function { + id: 0x9bca793f + return_type_id: 0x6720d32f + parameter_id: 0x18bd6530 + parameter_id: 0x1d19a9d5 + parameter_id: 0x4585663f + parameter_id: 0x33756485 + parameter_id: 0x24373219 + parameter_id: 0x1f8dbf97 + parameter_id: 0x13580d6c +} function { id: 0x9bca85c1 return_type_id: 0x6720d32f @@ -337859,6 +337896,15 @@ elf_symbol { type_id: 0x9bd18c9d full_name: "__traceiter_android_vh_binder_free_proc" } +elf_symbol { + id: 0xe87f2d41 + name: "__traceiter_android_vh_binder_has_special_work_ilocked" + is_defined: true + symbol_type: FUNCTION + crc: 0x0ec74efc + type_id: 0x9b247e43 + full_name: "__traceiter_android_vh_binder_has_special_work_ilocked" +} elf_symbol { id: 0x6935b08b name: "__traceiter_android_vh_binder_has_work_ilocked" @@ -337868,6 +337914,24 @@ elf_symbol { type_id: 0x9b24741c full_name: "__traceiter_android_vh_binder_has_work_ilocked" } +elf_symbol { + id: 0xb0a95f1d + name: "__traceiter_android_vh_binder_ioctl_end" + is_defined: true + symbol_type: FUNCTION + crc: 0x8c109e21 + type_id: 0x9bca793f + full_name: "__traceiter_android_vh_binder_ioctl_end" +} +elf_symbol { + id: 0x49b3cee8 + name: "__traceiter_android_vh_binder_looper_exited" + is_defined: true + symbol_type: FUNCTION + crc: 0x31a70825 + type_id: 0x9b3885c4 + full_name: "__traceiter_android_vh_binder_looper_exited" +} elf_symbol { id: 0xd595bd2c name: "__traceiter_android_vh_binder_looper_state_registered" @@ -337958,6 +338022,15 @@ elf_symbol { type_id: 0x9ba25f4a full_name: "__traceiter_android_vh_binder_restore_priority" } +elf_symbol { + id: 0xbe951464 + name: "__traceiter_android_vh_binder_select_special_worklist" + is_defined: true + symbol_type: FUNCTION + crc: 0xa41a031a + type_id: 0x9bb2f2c9 + full_name: "__traceiter_android_vh_binder_select_special_worklist" +} elf_symbol { id: 0xd738b678 name: "__traceiter_android_vh_binder_select_worklist_ilocked" @@ -337976,6 +338049,15 @@ elf_symbol { type_id: 0x9ba25f4a full_name: "__traceiter_android_vh_binder_set_priority" } +elf_symbol { + id: 0xbce49c1c + name: "__traceiter_android_vh_binder_spawn_new_thread" + is_defined: true + symbol_type: FUNCTION + crc: 0x2ffcc983 + type_id: 0x9b38c2fb + full_name: "__traceiter_android_vh_binder_spawn_new_thread" +} elf_symbol { id: 0x6bce867e name: "__traceiter_android_vh_binder_special_task" @@ -341873,6 +341955,15 @@ elf_symbol { type_id: 0x18ccbd2c full_name: "__tracepoint_android_vh_binder_free_proc" } +elf_symbol { + id: 0x28cc114f + name: "__tracepoint_android_vh_binder_has_special_work_ilocked" + is_defined: true + symbol_type: OBJECT + crc: 0x522bc7e1 + type_id: 0x18ccbd2c + full_name: "__tracepoint_android_vh_binder_has_special_work_ilocked" +} elf_symbol { id: 0x332635cd name: "__tracepoint_android_vh_binder_has_work_ilocked" @@ -341882,6 +341973,24 @@ elf_symbol { type_id: 0x18ccbd2c full_name: "__tracepoint_android_vh_binder_has_work_ilocked" } +elf_symbol { + id: 0x8bf347a7 + name: "__tracepoint_android_vh_binder_ioctl_end" + is_defined: true + symbol_type: OBJECT + crc: 0xd0b11a87 + type_id: 0x18ccbd2c + full_name: "__tracepoint_android_vh_binder_ioctl_end" +} +elf_symbol { + id: 0x12269b16 + name: "__tracepoint_android_vh_binder_looper_exited" + is_defined: true + symbol_type: OBJECT + crc: 0x2a34d63d + type_id: 0x18ccbd2c + full_name: "__tracepoint_android_vh_binder_looper_exited" +} elf_symbol { id: 0xf06625d6 name: "__tracepoint_android_vh_binder_looper_state_registered" @@ -341972,6 +342081,15 @@ elf_symbol { type_id: 0x18ccbd2c full_name: "__tracepoint_android_vh_binder_restore_priority" } +elf_symbol { + id: 0x903775d2 + name: "__tracepoint_android_vh_binder_select_special_worklist" + is_defined: true + symbol_type: OBJECT + crc: 0x4b47e85e + type_id: 0x18ccbd2c + full_name: "__tracepoint_android_vh_binder_select_special_worklist" +} elf_symbol { id: 0x21d8d29a name: "__tracepoint_android_vh_binder_select_worklist_ilocked" @@ -341990,6 +342108,15 @@ elf_symbol { type_id: 0x18ccbd2c full_name: "__tracepoint_android_vh_binder_set_priority" } +elf_symbol { + id: 0x14e4067e + name: "__tracepoint_android_vh_binder_spawn_new_thread" + is_defined: true + symbol_type: OBJECT + crc: 0x5accdd27 + type_id: 0x18ccbd2c + full_name: "__tracepoint_android_vh_binder_spawn_new_thread" +} elf_symbol { id: 0xdda667b0 name: "__tracepoint_android_vh_binder_special_task" @@ -401419,7 +401546,10 @@ interface { symbol_id: 0x6e0b473c symbol_id: 0xcb807696 symbol_id: 0xbebf7d98 + symbol_id: 0xe87f2d41 symbol_id: 0x6935b08b + symbol_id: 0xb0a95f1d + symbol_id: 0x49b3cee8 symbol_id: 0xd595bd2c symbol_id: 0xfdb48c6a symbol_id: 0xbff39e0e @@ -401430,8 +401560,10 @@ interface { symbol_id: 0x5c1ee0c5 symbol_id: 0x2d244867 symbol_id: 0xc6c9353c + symbol_id: 0xbe951464 symbol_id: 0xd738b678 symbol_id: 0x2a9c6616 + symbol_id: 0xbce49c1c symbol_id: 0x6bce867e symbol_id: 0x4785a3dd symbol_id: 0x25f13dbe @@ -401865,7 +401997,10 @@ interface { symbol_id: 0x61b56472 symbol_id: 0x19dded7c symbol_id: 0xf32898c6 + symbol_id: 0x28cc114f symbol_id: 0x332635cd + symbol_id: 0x8bf347a7 + symbol_id: 0x12269b16 symbol_id: 0xf06625d6 symbol_id: 0x259ffe94 symbol_id: 0x95c75a1c @@ -401876,8 +402011,10 @@ interface { symbol_id: 0x54aac8cb symbol_id: 0x6de9ac69 symbol_id: 0x57a9a36a + symbol_id: 0x903775d2 symbol_id: 0x21d8d29a symbol_id: 0x2e04cb9c + symbol_id: 0x14e4067e symbol_id: 0xdda667b0 symbol_id: 0x306b5ff7 symbol_id: 0x2fce8f78 diff --git a/android/abi_gki_aarch64_oplus b/android/abi_gki_aarch64_oplus index 8c9846b3a27d..38ee6cb19e5f 100644 --- a/android/abi_gki_aarch64_oplus +++ b/android/abi_gki_aarch64_oplus @@ -123,7 +123,10 @@ __traceiter_android_vh_record_rwsem_lock_starttime __traceiter_android_vh_alter_mutex_list_add __traceiter_android_vh_binder_free_proc + __traceiter_android_vh_binder_has_special_work_ilocked __traceiter_android_vh_binder_has_work_ilocked + __traceiter_android_vh_binder_ioctl_end + __traceiter_android_vh_binder_looper_exited __traceiter_android_vh_binder_looper_state_registered __traceiter_android_vh_binder_new_ref __traceiter_android_vh_binder_del_ref @@ -134,6 +137,8 @@ __traceiter_android_vh_binder_proc_transaction_finish __traceiter_android_vh_binder_read_done __traceiter_android_vh_binder_select_worklist_ilocked + __traceiter_android_vh_binder_select_special_worklist + __traceiter_android_vh_binder_spawn_new_thread __traceiter_android_vh_binder_thread_read __traceiter_android_vh_binder_thread_release __traceiter_android_vh_binder_wait_for_work @@ -209,7 +214,10 @@ __tracepoint_android_vh_account_task_time __tracepoint_android_vh_alter_mutex_list_add __tracepoint_android_vh_binder_free_proc + __tracepoint_android_vh_binder_has_special_work_ilocked __tracepoint_android_vh_binder_has_work_ilocked + __tracepoint_android_vh_binder_ioctl_end + __tracepoint_android_vh_binder_looper_exited __tracepoint_android_vh_binder_looper_state_registered __tracepoint_android_vh_binder_new_ref __tracepoint_android_vh_binder_del_ref @@ -220,6 +228,8 @@ __tracepoint_android_vh_binder_proc_transaction_finish __tracepoint_android_vh_binder_read_done __tracepoint_android_vh_binder_select_worklist_ilocked + __tracepoint_android_vh_binder_select_special_worklist + __tracepoint_android_vh_binder_spawn_new_thread __tracepoint_android_vh_binder_thread_read __tracepoint_android_vh_binder_thread_release __tracepoint_android_vh_binder_wait_for_work From 899194d7e9095594e35bb0097dc0e3e2c7d8a0e6 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 4 Dec 2023 14:25:33 +0100 Subject: [PATCH 12/70] UPSTREAM: netfilter: nf_tables: bail out on mismatching dynset and set expressions [ Upstream commit 3701cd390fd731ee7ae8b8006246c8db82c72bea ] If dynset expressions provided by userspace is larger than the declared set expressions, then bail out. Bug: 316085841 Fixes: 48b0ae046ee9 ("netfilter: nftables: netlink support for several set element expressions") Reported-by: Xingyuan Mo Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin (cherry picked from commit cf5f113c41eb2c7dbe19d849a0883f7a429fa54b) Signed-off-by: Lee Jones Change-Id: I4bd3f7e9148d4bc12bbc67ecdd605c2957eb8010 --- net/netfilter/nft_dynset.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/net/netfilter/nft_dynset.c b/net/netfilter/nft_dynset.c index cf9a1ae87d9b..a470e5f61284 100644 --- a/net/netfilter/nft_dynset.c +++ b/net/netfilter/nft_dynset.c @@ -279,10 +279,15 @@ static int nft_dynset_init(const struct nft_ctx *ctx, priv->expr_array[i] = dynset_expr; priv->num_exprs++; - if (set->num_exprs && - dynset_expr->ops != set->exprs[i]->ops) { - err = -EOPNOTSUPP; - goto err_expr_free; + if (set->num_exprs) { + if (i >= set->num_exprs) { + err = -EINVAL; + goto err_expr_free; + } + if (dynset_expr->ops != set->exprs[i]->ops) { + err = -EOPNOTSUPP; + goto err_expr_free; + } } i++; } From cfe8cce4e8a1938ea6aff81c4c8e9cbee7be62f9 Mon Sep 17 00:00:00 2001 From: Yabin Cui Date: Fri, 27 Jan 2023 23:10:01 +0000 Subject: [PATCH 13/70] UPSTREAM: coresight: tmc: Don't enable TMC when it's not ready. If TMC ETR is enabled without being ready, in later use we may see AXI bus errors caused by accessing invalid addresses. Bug: 256184860 Change-Id: I9c0b8c7af63a2e2e7469a8537bc721ec6ae6679c Signed-off-by: Yabin Cui [ Tweak error message ] Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230127231001.1920947-1-yabinc@google.com (cherry picked from commit 669c4614236a7f78a2b693d0024cbdfa8536eb5a) --- .../hwtracing/coresight/coresight-tmc-core.c | 4 +- .../hwtracing/coresight/coresight-tmc-etf.c | 45 +++++++++++++++---- .../hwtracing/coresight/coresight-tmc-etr.c | 19 ++++++-- drivers/hwtracing/coresight/coresight-tmc.h | 2 +- 4 files changed, 56 insertions(+), 14 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-tmc-core.c b/drivers/hwtracing/coresight/coresight-tmc-core.c index 07abf28ad725..c106d142e632 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-core.c +++ b/drivers/hwtracing/coresight/coresight-tmc-core.c @@ -31,7 +31,7 @@ DEFINE_CORESIGHT_DEVLIST(etb_devs, "tmc_etb"); DEFINE_CORESIGHT_DEVLIST(etf_devs, "tmc_etf"); DEFINE_CORESIGHT_DEVLIST(etr_devs, "tmc_etr"); -void tmc_wait_for_tmcready(struct tmc_drvdata *drvdata) +int tmc_wait_for_tmcready(struct tmc_drvdata *drvdata) { struct coresight_device *csdev = drvdata->csdev; struct csdev_access *csa = &csdev->access; @@ -40,7 +40,9 @@ void tmc_wait_for_tmcready(struct tmc_drvdata *drvdata) if (coresight_timeout(csa, TMC_STS, TMC_STS_TMCREADY_BIT, 1)) { dev_err(&csdev->dev, "timeout while waiting for TMC to be Ready\n"); + return -EBUSY; } + return 0; } void tmc_flush_and_stop(struct tmc_drvdata *drvdata) diff --git a/drivers/hwtracing/coresight/coresight-tmc-etf.c b/drivers/hwtracing/coresight/coresight-tmc-etf.c index 3f207999377f..e374b02d98be 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etf.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etf.c @@ -16,12 +16,20 @@ static int tmc_set_etf_buffer(struct coresight_device *csdev, struct perf_output_handle *handle); -static void __tmc_etb_enable_hw(struct tmc_drvdata *drvdata) +static int __tmc_etb_enable_hw(struct tmc_drvdata *drvdata) { + int rc = 0; + CS_UNLOCK(drvdata->base); /* Wait for TMCSReady bit to be set */ - tmc_wait_for_tmcready(drvdata); + rc = tmc_wait_for_tmcready(drvdata); + if (rc) { + dev_err(&drvdata->csdev->dev, + "Failed to enable: TMC not ready\n"); + CS_LOCK(drvdata->base); + return rc; + } writel_relaxed(TMC_MODE_CIRCULAR_BUFFER, drvdata->base + TMC_MODE); writel_relaxed(TMC_FFCR_EN_FMT | TMC_FFCR_EN_TI | @@ -33,6 +41,7 @@ static void __tmc_etb_enable_hw(struct tmc_drvdata *drvdata) tmc_enable_hw(drvdata); CS_LOCK(drvdata->base); + return rc; } static int tmc_etb_enable_hw(struct tmc_drvdata *drvdata) @@ -42,8 +51,10 @@ static int tmc_etb_enable_hw(struct tmc_drvdata *drvdata) if (rc) return rc; - __tmc_etb_enable_hw(drvdata); - return 0; + rc = __tmc_etb_enable_hw(drvdata); + if (rc) + coresight_disclaim_device(drvdata->csdev); + return rc; } static void tmc_etb_dump_hw(struct tmc_drvdata *drvdata) @@ -91,12 +102,20 @@ static void tmc_etb_disable_hw(struct tmc_drvdata *drvdata) coresight_disclaim_device(drvdata->csdev); } -static void __tmc_etf_enable_hw(struct tmc_drvdata *drvdata) +static int __tmc_etf_enable_hw(struct tmc_drvdata *drvdata) { + int rc = 0; + CS_UNLOCK(drvdata->base); /* Wait for TMCSReady bit to be set */ - tmc_wait_for_tmcready(drvdata); + rc = tmc_wait_for_tmcready(drvdata); + if (rc) { + dev_err(&drvdata->csdev->dev, + "Failed to enable : TMC is not ready\n"); + CS_LOCK(drvdata->base); + return rc; + } writel_relaxed(TMC_MODE_HARDWARE_FIFO, drvdata->base + TMC_MODE); writel_relaxed(TMC_FFCR_EN_FMT | TMC_FFCR_EN_TI, @@ -105,6 +124,7 @@ static void __tmc_etf_enable_hw(struct tmc_drvdata *drvdata) tmc_enable_hw(drvdata); CS_LOCK(drvdata->base); + return rc; } static int tmc_etf_enable_hw(struct tmc_drvdata *drvdata) @@ -114,8 +134,10 @@ static int tmc_etf_enable_hw(struct tmc_drvdata *drvdata) if (rc) return rc; - __tmc_etf_enable_hw(drvdata); - return 0; + rc = __tmc_etf_enable_hw(drvdata); + if (rc) + coresight_disclaim_device(drvdata->csdev); + return rc; } static void tmc_etf_disable_hw(struct tmc_drvdata *drvdata) @@ -639,6 +661,7 @@ int tmc_read_unprepare_etb(struct tmc_drvdata *drvdata) char *buf = NULL; enum tmc_mode mode; unsigned long flags; + int rc = 0; /* config types are set a boot time and never change */ if (WARN_ON_ONCE(drvdata->config_type != TMC_CONFIG_TYPE_ETB && @@ -664,7 +687,11 @@ int tmc_read_unprepare_etb(struct tmc_drvdata *drvdata) * can't be NULL. */ memset(drvdata->buf, 0, drvdata->size); - __tmc_etb_enable_hw(drvdata); + rc = __tmc_etb_enable_hw(drvdata); + if (rc) { + spin_unlock_irqrestore(&drvdata->spinlock, flags); + return rc; + } } else { /* * The ETB/ETF is not tracing and the buffer was just read. diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c index 1be0e5e0e80b..8ef4a2a13427 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c @@ -984,15 +984,22 @@ static void tmc_sync_etr_buf(struct tmc_drvdata *drvdata) etr_buf->ops->sync(etr_buf, rrp, rwp); } -static void __tmc_etr_enable_hw(struct tmc_drvdata *drvdata) +static int __tmc_etr_enable_hw(struct tmc_drvdata *drvdata) { u32 axictl, sts; struct etr_buf *etr_buf = drvdata->etr_buf; + int rc = 0; CS_UNLOCK(drvdata->base); /* Wait for TMCSReady bit to be set */ - tmc_wait_for_tmcready(drvdata); + rc = tmc_wait_for_tmcready(drvdata); + if (rc) { + dev_err(&drvdata->csdev->dev, + "Failed to enable : TMC not ready\n"); + CS_LOCK(drvdata->base); + return rc; + } writel_relaxed(etr_buf->size / 4, drvdata->base + TMC_RSZ); writel_relaxed(TMC_MODE_CIRCULAR_BUFFER, drvdata->base + TMC_MODE); @@ -1033,6 +1040,7 @@ static void __tmc_etr_enable_hw(struct tmc_drvdata *drvdata) tmc_enable_hw(drvdata); CS_LOCK(drvdata->base); + return rc; } static int tmc_etr_enable_hw(struct tmc_drvdata *drvdata, @@ -1061,7 +1069,12 @@ static int tmc_etr_enable_hw(struct tmc_drvdata *drvdata, rc = coresight_claim_device(drvdata->csdev); if (!rc) { drvdata->etr_buf = etr_buf; - __tmc_etr_enable_hw(drvdata); + rc = __tmc_etr_enable_hw(drvdata); + if (rc) { + drvdata->etr_buf = NULL; + coresight_disclaim_device(drvdata->csdev); + tmc_etr_disable_catu(drvdata); + } } return rc; diff --git a/drivers/hwtracing/coresight/coresight-tmc.h b/drivers/hwtracing/coresight/coresight-tmc.h index 946aab12f980..26e6356261c1 100644 --- a/drivers/hwtracing/coresight/coresight-tmc.h +++ b/drivers/hwtracing/coresight/coresight-tmc.h @@ -255,7 +255,7 @@ struct tmc_sg_table { }; /* Generic functions */ -void tmc_wait_for_tmcready(struct tmc_drvdata *drvdata); +int tmc_wait_for_tmcready(struct tmc_drvdata *drvdata); void tmc_flush_and_stop(struct tmc_drvdata *drvdata); void tmc_enable_hw(struct tmc_drvdata *drvdata); void tmc_disable_hw(struct tmc_drvdata *drvdata); From 65db2f8ed322f649a46c9ad0351526fe22d7b232 Mon Sep 17 00:00:00 2001 From: "dae.seo" Date: Tue, 16 Jan 2024 14:09:30 +0900 Subject: [PATCH 14/70] ANDROID: GKI: add GKI symbol list for Exynosauto SoC This patch adds GKI symbol list for Exynosauto Soc. We need to add 1 function(flush_signals) symbol to send buffer to other domains. 1 function symbol(s) added 'void flush_signals(struct task_struct*)' Bug: 320368458 Signed-off-by: Daehyun Seo Change-Id: I66a9264b70dc24f30029b413077363996b3339cd --- android/abi_gki_aarch64.stg | 10 ++++ android/abi_gki_aarch64_exynosauto | 90 +++++++++++++++++------------- 2 files changed, 62 insertions(+), 38 deletions(-) diff --git a/android/abi_gki_aarch64.stg b/android/abi_gki_aarch64.stg index 7fdf2a028cf6..f6bfd1c2f644 100644 --- a/android/abi_gki_aarch64.stg +++ b/android/abi_gki_aarch64.stg @@ -362259,6 +362259,15 @@ elf_symbol { type_id: 0xf3110cae full_name: "flush_delayed_work" } +elf_symbol { + id: 0xa9d940b8 + name: "flush_signals" + is_defined: true + symbol_type: FUNCTION + crc: 0xe2b313b2 + type_id: 0x17de3be6 + full_name: "flush_signals" +} elf_symbol { id: 0x3c7c2553 name: "flush_work" @@ -404252,6 +404261,7 @@ interface { symbol_id: 0xc442704c symbol_id: 0xb290a148 symbol_id: 0x09d08108 + symbol_id: 0xa9d940b8 symbol_id: 0x3c7c2553 symbol_id: 0x06c58be7 symbol_id: 0x159a69a3 diff --git a/android/abi_gki_aarch64_exynosauto b/android/abi_gki_aarch64_exynosauto index 1e8246795df8..3e1138f25bc1 100644 --- a/android/abi_gki_aarch64_exynosauto +++ b/android/abi_gki_aarch64_exynosauto @@ -34,14 +34,8 @@ clk_disable clk_enable clk_get - __clk_get_hw clk_get_rate - clk_hw_get_parent clk_prepare - clk_register - clk_register_clkdev - clk_register_fixed_factor - clk_register_fixed_rate clk_set_rate clk_unprepare cma_alloc @@ -90,6 +84,7 @@ _dev_info devm_add_action devm_clk_get + devm_clk_get_optional devm_free_irq devm_gen_pool_create devm_gpiod_get @@ -177,8 +172,6 @@ drm_atomic_helper_connector_destroy_state drm_atomic_helper_connector_duplicate_state drm_atomic_helper_connector_reset - __drm_atomic_helper_private_obj_duplicate_state - drm_atomic_private_obj_init drm_bridge_add drm_bridge_remove drm_compat_ioctl @@ -242,7 +235,6 @@ drm_modeset_unlock drm_mode_vrefresh drm_object_attach_property - drm_object_property_set_value drm_open drm_poll drm_prime_gem_destroy @@ -252,14 +244,18 @@ drm_release drm_vblank_init dump_stack + dw_pcie_ep_init dw_pcie_host_init dw_pcie_own_conf_map_bus dw_pcie_read + dw_pcie_read_dbi dw_pcie_setup_rc dw_pcie_write + dw_pcie_write_dbi enable_irq fd_install _find_first_bit + _find_first_zero_bit _find_next_bit finish_wait flush_delayed_work @@ -315,7 +311,9 @@ __init_waitqueue_head iomem_resource iommu_get_domain_for_dev + iommu_map iommu_register_device_fault_handler + iommu_unmap iommu_unregister_device_fault_handler ioremap_prot iounmap @@ -403,6 +401,7 @@ mipi_dsi_device_unregister mipi_dsi_driver_register_full mipi_dsi_driver_unregister + misc_deregister misc_register mod_timer module_layout @@ -419,13 +418,12 @@ netdev_warn noop_llseek nr_cpu_ids + nsecs_to_jiffies ns_to_timespec64 __num_online_cpus of_address_to_resource of_alias_get_id - of_clk_add_provider of_clk_get - of_clk_src_onecell_get of_count_phandle_with_args of_device_get_match_data of_device_is_available @@ -467,10 +465,15 @@ oops_in_progress panic panic_notifier_list + param_ops_bool param_ops_int param_ops_string param_ops_uint pcie_get_mps + pci_epc_mem_alloc_addr + pci_epc_mem_free_addr + pci_epc_set_bar + pci_epc_unmap_addr pcie_set_mps pci_find_bus pci_generic_config_read @@ -547,6 +550,7 @@ __register_chrdev register_console register_pm_notifier + register_reboot_notifier register_syscore_ops regmap_read regmap_update_bits_base @@ -647,6 +651,7 @@ ttm_bo_mmap_obj __udelay __unregister_chrdev + unregister_pm_notifier up up_write __usecs_to_jiffies @@ -687,6 +692,7 @@ vsnprintf vunmap vzalloc + wait_for_completion wait_for_completion_interruptible_timeout wait_for_completion_timeout __wake_up @@ -712,9 +718,18 @@ regmap_bulk_write regmap_register_patch +# required by clk_exynosauto.ko + __clk_get_hw + clk_hw_get_parent + clk_register + clk_register_clkdev + clk_register_fixed_factor + clk_register_fixed_rate + of_clk_add_provider + of_clk_src_onecell_get + # required by cmupmucal.ko debugfs_create_x32 - of_find_node_by_type # required by dmatest.ko __dma_request_channel @@ -726,7 +741,6 @@ mempool_free_slab param_get_bool param_get_string - param_ops_bool param_set_bool param_set_copystring set_freezable @@ -741,7 +755,9 @@ drm_atomic_get_new_private_obj_state drm_atomic_get_old_private_obj_state drm_atomic_get_private_obj_state + __drm_atomic_helper_private_obj_duplicate_state drm_atomic_private_obj_fini + drm_atomic_private_obj_init drm_crtc_commit_wait drm_crtc_wait_one_vblank __drm_debug @@ -750,6 +766,7 @@ drm_edid_duplicate drm_edid_get_monitor_name drm_modeset_lock_single_interruptible + drm_object_property_set_value __drm_printfn_debug memchr_inv __sw_hweight8 @@ -848,7 +865,6 @@ typec_set_pwr_role typec_unregister_partner typec_unregister_port - unregister_pm_notifier usb_gadget_set_state usb_otg_state_string wakeup_source_register @@ -945,7 +961,6 @@ drm_atomic_helper_update_plane drm_atomic_helper_wait_for_vblanks drm_bridge_attach - drm_connector_set_path_property drm_crtc_arm_vblank_event drm_crtc_handle_vblank drm_crtc_init_with_planes @@ -963,7 +978,6 @@ drm_gem_vm_open drm_get_connector_status_name drm_get_format_info - drm_helper_probe_detect drm_mode_config_helper_resume drm_mode_config_helper_suspend drm_mode_config_reset @@ -982,7 +996,6 @@ drm_plane_create_zpos_immutable_property drm_plane_create_zpos_property __drm_printfn_info - drm_property_blob_put drm_property_create drm_property_create_blob drm_rotation_simplify @@ -991,6 +1004,7 @@ drm_writeback_connector_init drm_writeback_queue_job drm_writeback_signal_completion + flush_signals gpiod_to_irq mipi_dsi_host_register mipi_dsi_host_unregister @@ -998,7 +1012,6 @@ of_drm_find_panel of_find_i2c_device_by_node of_graph_get_endpoint_by_regs - of_graph_get_endpoint_count of_graph_get_next_endpoint of_graph_get_port_by_id of_graph_get_remote_port @@ -1010,15 +1023,16 @@ platform_find_device_by_driver seq_hex_dump seq_release + strnstr synchronize_irq vmalloc_to_page # required by exynos_mfc.ko clk_put + dma_buf_begin_cpu_access_partial + dma_buf_end_cpu_access_partial hex_dump_to_buffer - iommu_map iommu_map_sg - iommu_unmap __sw_hweight64 _totalram_pages @@ -1056,10 +1070,12 @@ strncasecmp thermal_cdev_update +# required by exyswd-rng.ko + devm_hwrng_register + # required by gpu-sched.ko mod_delayed_work_on sched_set_fifo_low - wait_for_completion __xa_alloc xa_destroy xa_erase @@ -1113,6 +1129,9 @@ # required by panic-fingerprint.ko stack_trace_save +# required by pcie-exynos-dw-ep.ko + pci_epc_map_addr + # required by pcs_xpcs.ko mdiobus_modify_changed phylink_mii_c22_pcs_decode_state @@ -1198,6 +1217,12 @@ __devm_irq_alloc_descs handle_nested_irq +# required by s3c2410_wdt.ko + watchdog_init_timeout + watchdog_register_device + watchdog_set_restart_priority + watchdog_unregister_device + # required by sam-is.ko down down_trylock @@ -1206,9 +1231,9 @@ kernel_neon_end kobject_del kthread_flush_worker + pfn_is_map_memory pm_relax pm_stay_awake - register_reboot_notifier regulator_get_optional regulator_get_voltage regulator_is_enabled @@ -1246,7 +1271,6 @@ dma_heap_get_name is_dma_buf_file iterate_fd - misc_deregister remap_pfn_range __sg_page_iter_next __sg_page_iter_start @@ -1393,7 +1417,6 @@ drm_syncobj_get_handle drm_syncobj_replace_fence __fdget - _find_first_zero_bit __folio_put __get_task_comm handle_simple_irq @@ -1415,7 +1438,6 @@ memremap memunmap mmu_notifier_synchronize - nsecs_to_jiffies page_pinner_inited __page_pinner_put_page param_ops_charp @@ -1579,7 +1601,6 @@ stream_open # required by stmmac-platform.ko - devm_clk_get_optional of_get_mac_address of_phy_is_fixed_link @@ -1754,9 +1775,9 @@ current_work default_wake_function dma_buf_fd - dw_pcie_ep_init - dw_pcie_read_dbi - dw_pcie_write_dbi + drm_connector_set_path_property + drm_helper_probe_detect + drm_property_blob_put irq_create_of_mapping irq_dispose_mapping irq_find_matching_fwspec @@ -1769,21 +1790,17 @@ kthread_complete_and_exit nonseekable_open of_clk_del_provider + of_find_node_by_type + of_graph_get_endpoint_count of_irq_find_parent pci_disable_device pci_disable_msi pci_enable_device - pci_epc_map_addr - pci_epc_mem_alloc_addr - pci_epc_mem_free_addr - pci_epc_set_bar - pci_epc_unmap_addr pci_ioremap_wc_bar pci_num_vf __pci_register_driver pci_request_regions pci_unregister_driver - pfn_is_map_memory __platform_driver_probe pm_power_off proc_create_data @@ -1792,12 +1809,9 @@ remove_proc_entry remove_wait_queue sigprocmask - strnstr sysfs_create_bin_file sysfs_remove_bin_file __task_pid_nr_ns thermal_of_zone_register thermal_of_zone_unregister vprintk - watchdog_register_device - watchdog_unregister_device From 0799ace265e414abe4e95e33b00ea502ce81cd0a Mon Sep 17 00:00:00 2001 From: Vamsidhar reddy Gaddam Date: Thu, 18 Jan 2024 11:17:42 +0000 Subject: [PATCH 15/70] ANDROID: Update the ABI symbol list Adding the following symbols: - dma_buf_map_attachment_unlocked - dma_buf_unmap_attachment_unlocked - register_kretprobe - unregister_kretprobe Bug: 315267052 Change-Id: I676d5634d8e7903a12bfa2c036ce938272382aef Signed-off-by: Vamsidhar reddy Gaddam --- android/abi_gki_aarch64_pixel | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/android/abi_gki_aarch64_pixel b/android/abi_gki_aarch64_pixel index fac865d11e03..97c5ef909162 100644 --- a/android/abi_gki_aarch64_pixel +++ b/android/abi_gki_aarch64_pixel @@ -543,6 +543,7 @@ dma_buf_fd dma_buf_get dma_buf_map_attachment + dma_buf_map_attachment_unlocked dma_buf_mmap dmabuf_page_pool_alloc dmabuf_page_pool_create @@ -552,6 +553,7 @@ dma_buf_put dma_buf_set_name dma_buf_unmap_attachment + dma_buf_unmap_attachment_unlocked dma_buf_vmap dma_buf_vunmap dma_direct_alloc @@ -1788,6 +1790,7 @@ register_inet6addr_notifier register_inetaddr_notifier register_kernel_break_hook + register_kretprobe register_netdev register_netdevice register_netdevice_notifier @@ -2541,6 +2544,7 @@ unregister_chrdev_region unregister_inet6addr_notifier unregister_inetaddr_notifier + unregister_kretprobe unregister_netdev unregister_netdevice_many unregister_netdevice_notifier From 64c59ad2c38459e89c659b915057f3f683c37831 Mon Sep 17 00:00:00 2001 From: "Joel Fernandes (Google)" Date: Sat, 17 Sep 2022 16:41:59 +0000 Subject: [PATCH 16/70] UPSTREAM: rcu: Fix late wakeup when flush of bypass cblist happens When the bypass cblist gets too big or its timeout has occurred, it is flushed into the main cblist. However, the bypass timer is still running and the behavior is that it would eventually expire and wake the GP thread. Since we are going to use the bypass cblist for lazy CBs, do the wakeup soon as the flush for "too big or too long" bypass list happens. Otherwise, long delays can happen for callbacks which get promoted from lazy to non-lazy. This is a good thing to do anyway (regardless of future lazy patches), since it makes the behavior consistent with behavior of other code paths where flushing into the ->cblist makes the GP kthread into a non-sleeping state quickly. [ Frederic Weisbecker: Changes to avoid unnecessary GP-thread wakeups plus comment changes. ] Reviewed-by: Frederic Weisbecker Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney (cherry picked from commit b50606f35f4b73c8e4c6b9c64fe7ba72ea919134) Bug: 258241771 Signed-off-by: Joel Fernandes Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4909028 Reviewed-by: Vineeth Pillai Reviewed-by: Sean Paul Signed-off-by: Qais Yousef Change-Id: If8da96d7ba6ed90a2a70f7d56f7bb03af44fd649 --- kernel/rcu/tree_nocb.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h index 0a5f0ef41484..04c87f250e01 100644 --- a/kernel/rcu/tree_nocb.h +++ b/kernel/rcu/tree_nocb.h @@ -433,8 +433,9 @@ static bool rcu_nocb_try_bypass(struct rcu_data *rdp, struct rcu_head *rhp, if ((ncbs && j != READ_ONCE(rdp->nocb_bypass_first)) || ncbs >= qhimark) { rcu_nocb_lock(rdp); + *was_alldone = !rcu_segcblist_pend_cbs(&rdp->cblist); + if (!rcu_nocb_flush_bypass(rdp, rhp, j)) { - *was_alldone = !rcu_segcblist_pend_cbs(&rdp->cblist); if (*was_alldone) trace_rcu_nocb_wake(rcu_state.name, rdp->cpu, TPS("FirstQ")); @@ -447,7 +448,12 @@ static bool rcu_nocb_try_bypass(struct rcu_data *rdp, struct rcu_head *rhp, rcu_advance_cbs_nowake(rdp->mynode, rdp); rdp->nocb_gp_adv_time = j; } - rcu_nocb_unlock_irqrestore(rdp, flags); + + // The flush succeeded and we moved CBs into the regular list. + // Don't wait for the wake up timer as it may be too far ahead. + // Wake up the GP thread now instead, if the cblist was empty. + __call_rcu_nocb_wake(rdp, *was_alldone, flags); + return true; // Callback already enqueued. } From 4fb09fb4f7265eaf1a283ca3d0b7233f97a36072 Mon Sep 17 00:00:00 2001 From: Frederic Weisbecker Date: Sun, 16 Oct 2022 16:22:53 +0000 Subject: [PATCH 17/70] UPSTREAM: rcu: Fix missing nocb gp wake on rcu_barrier() In preparation for RCU lazy changes, wake up the RCU nocb gp thread if needed after an entrain. This change prevents the RCU barrier callback from waiting in the queue for several seconds before the lazy callbacks in front of it are serviced. Reported-by: Joel Fernandes (Google) Signed-off-by: Frederic Weisbecker Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney (cherry picked from commit b8f7aca3f0e0e6223094ba2662bac90353674b04) Bug: 258241771 Signed-off-by: Joel Fernandes Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4909029 Reviewed-by: Sean Paul Reviewed-by: Vineeth Pillai Signed-off-by: Qais Yousef Change-Id: Ib55c5886764b74df22531eca35f076ef7acc08dd --- kernel/rcu/tree.c | 11 +++++++++++ kernel/rcu/tree.h | 1 + kernel/rcu/tree_nocb.h | 5 +++++ 3 files changed, 17 insertions(+) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 917a1e43f783..6ea59aa53db7 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -3908,6 +3908,8 @@ static void rcu_barrier_entrain(struct rcu_data *rdp) { unsigned long gseq = READ_ONCE(rcu_state.barrier_sequence); unsigned long lseq = READ_ONCE(rdp->barrier_seq_snap); + bool wake_nocb = false; + bool was_alldone = false; lockdep_assert_held(&rcu_state.barrier_lock); if (rcu_seq_state(lseq) || !rcu_seq_state(gseq) || rcu_seq_ctr(lseq) != rcu_seq_ctr(gseq)) @@ -3916,7 +3918,14 @@ static void rcu_barrier_entrain(struct rcu_data *rdp) rdp->barrier_head.func = rcu_barrier_callback; debug_rcu_head_queue(&rdp->barrier_head); rcu_nocb_lock(rdp); + /* + * Flush bypass and wakeup rcuog if we add callbacks to an empty regular + * queue. This way we don't wait for bypass timer that can reach seconds + * if it's fully lazy. + */ + was_alldone = rcu_rdp_is_offloaded(rdp) && !rcu_segcblist_pend_cbs(&rdp->cblist); WARN_ON_ONCE(!rcu_nocb_flush_bypass(rdp, NULL, jiffies)); + wake_nocb = was_alldone && rcu_segcblist_pend_cbs(&rdp->cblist); if (rcu_segcblist_entrain(&rdp->cblist, &rdp->barrier_head)) { atomic_inc(&rcu_state.barrier_cpu_count); } else { @@ -3924,6 +3933,8 @@ static void rcu_barrier_entrain(struct rcu_data *rdp) rcu_barrier_trace(TPS("IRQNQ"), -1, rcu_state.barrier_sequence); } rcu_nocb_unlock(rdp); + if (wake_nocb) + wake_nocb_gp(rdp, false); smp_store_release(&rdp->barrier_seq_snap, gseq); } diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h index d4a97e40ea9c..925dd98f8b23 100644 --- a/kernel/rcu/tree.h +++ b/kernel/rcu/tree.h @@ -439,6 +439,7 @@ static void zero_cpu_stall_ticks(struct rcu_data *rdp); static struct swait_queue_head *rcu_nocb_gp_get(struct rcu_node *rnp); static void rcu_nocb_gp_cleanup(struct swait_queue_head *sq); static void rcu_init_one_nocb(struct rcu_node *rnp); +static bool wake_nocb_gp(struct rcu_data *rdp, bool force); static bool rcu_nocb_flush_bypass(struct rcu_data *rdp, struct rcu_head *rhp, unsigned long j); static bool rcu_nocb_try_bypass(struct rcu_data *rdp, struct rcu_head *rhp, diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h index 04c87f250e01..74d4983d68f8 100644 --- a/kernel/rcu/tree_nocb.h +++ b/kernel/rcu/tree_nocb.h @@ -1570,6 +1570,11 @@ static void rcu_init_one_nocb(struct rcu_node *rnp) { } +static bool wake_nocb_gp(struct rcu_data *rdp, bool force) +{ + return false; +} + static bool rcu_nocb_flush_bypass(struct rcu_data *rdp, struct rcu_head *rhp, unsigned long j) { From 66a832fe387d338510292e499eb67a8745c5e490 Mon Sep 17 00:00:00 2001 From: "Joel Fernandes (Google)" Date: Sun, 16 Oct 2022 16:22:54 +0000 Subject: [PATCH 18/70] UPSTREAM: rcu: Make call_rcu() lazy to save power Implement timer-based RCU callback batching (also known as lazy callbacks). With this we save about 5-10% of power consumed due to RCU requests that happen when system is lightly loaded or idle. By default, all async callbacks (queued via call_rcu) are marked lazy. An alternate API call_rcu_hurry() is provided for the few users, for example synchronize_rcu(), that need the old behavior. The batch is flushed whenever a certain amount of time has passed, or the batch on a particular CPU grows too big. Also memory pressure will flush it in a future patch. To handle several corner cases automagically (such as rcu_barrier() and hotplug), we re-use bypass lists which were originally introduced to address lock contention, to handle lazy CBs as well. The bypass list length has the lazy CB length included in it. A separate lazy CB length counter is also introduced to keep track of the number of lazy CBs. [ paulmck: Fix formatting of inline call_rcu_lazy() definition. ] [ paulmck: Apply Zqiang feedback. ] [ paulmck: Apply s/call_rcu_flush/call_rcu_hurry/ feedback from Tejun Heo. ] Suggested-by: Paul McKenney Acked-by: Frederic Weisbecker Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney (cherry picked from commit 3cb278e73be58bfb780ecd55129296d2f74c1fb7) Bug: 258241771 Signed-off-by: Joel Fernandes Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4909030 Reviewed-by: Vineeth Pillai Signed-off-by: Qais Yousef Change-Id: I557d5af2a5d317bd66e9ec55ed40822bb5c54390 --- include/linux/rcupdate.h | 9 +++ kernel/rcu/Kconfig | 8 ++ kernel/rcu/rcu.h | 8 ++ kernel/rcu/tiny.c | 2 +- kernel/rcu/tree.c | 129 ++++++++++++++++++++----------- kernel/rcu/tree.h | 11 ++- kernel/rcu/tree_exp.h | 2 +- kernel/rcu/tree_nocb.h | 159 +++++++++++++++++++++++++++++++-------- 8 files changed, 246 insertions(+), 82 deletions(-) diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index e9e61cd27ef6..46f05dc8b31a 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -108,6 +108,15 @@ static inline int rcu_preempt_depth(void) #endif /* #else #ifdef CONFIG_PREEMPT_RCU */ +#ifdef CONFIG_RCU_LAZY +void call_rcu_hurry(struct rcu_head *head, rcu_callback_t func); +#else +static inline void call_rcu_hurry(struct rcu_head *head, rcu_callback_t func) +{ + call_rcu(head, func); +} +#endif + /* Internal to kernel */ void rcu_init(void); extern int rcu_scheduler_active; diff --git a/kernel/rcu/Kconfig b/kernel/rcu/Kconfig index d471d22a5e21..d78f6181c8aa 100644 --- a/kernel/rcu/Kconfig +++ b/kernel/rcu/Kconfig @@ -311,4 +311,12 @@ config TASKS_TRACE_RCU_READ_MB Say N here if you hate read-side memory barriers. Take the default if you are unsure. +config RCU_LAZY + bool "RCU callback lazy invocation functionality" + depends on RCU_NOCB_CPU + default n + help + To save power, batch RCU callbacks and flush after delay, memory + pressure, or callback list growing too big. + endmenu # "RCU Subsystem" diff --git a/kernel/rcu/rcu.h b/kernel/rcu/rcu.h index 48d8f754b730..6b86c5912bea 100644 --- a/kernel/rcu/rcu.h +++ b/kernel/rcu/rcu.h @@ -474,6 +474,14 @@ enum rcutorture_type { INVALID_RCU_FLAVOR }; +#if defined(CONFIG_RCU_LAZY) +unsigned long rcu_lazy_get_jiffies_till_flush(void); +void rcu_lazy_set_jiffies_till_flush(unsigned long j); +#else +static inline unsigned long rcu_lazy_get_jiffies_till_flush(void) { return 0; } +static inline void rcu_lazy_set_jiffies_till_flush(unsigned long j) { } +#endif + #if defined(CONFIG_TREE_RCU) void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags, unsigned long *gp_seq); diff --git a/kernel/rcu/tiny.c b/kernel/rcu/tiny.c index a33a8d4942c3..72913ce21258 100644 --- a/kernel/rcu/tiny.c +++ b/kernel/rcu/tiny.c @@ -44,7 +44,7 @@ static struct rcu_ctrlblk rcu_ctrlblk = { void rcu_barrier(void) { - wait_rcu_gp(call_rcu); + wait_rcu_gp(call_rcu_hurry); } EXPORT_SYMBOL(rcu_barrier); diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 6ea59aa53db7..855c035ec963 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -2731,47 +2731,8 @@ static void check_cb_ovld(struct rcu_data *rdp) raw_spin_unlock_rcu_node(rnp); } -/** - * call_rcu() - Queue an RCU callback for invocation after a grace period. - * @head: structure to be used for queueing the RCU updates. - * @func: actual callback function to be invoked after the grace period - * - * The callback function will be invoked some time after a full grace - * period elapses, in other words after all pre-existing RCU read-side - * critical sections have completed. However, the callback function - * might well execute concurrently with RCU read-side critical sections - * that started after call_rcu() was invoked. - * - * RCU read-side critical sections are delimited by rcu_read_lock() - * and rcu_read_unlock(), and may be nested. In addition, but only in - * v5.0 and later, regions of code across which interrupts, preemption, - * or softirqs have been disabled also serve as RCU read-side critical - * sections. This includes hardware interrupt handlers, softirq handlers, - * and NMI handlers. - * - * Note that all CPUs must agree that the grace period extended beyond - * all pre-existing RCU read-side critical section. On systems with more - * than one CPU, this means that when "func()" is invoked, each CPU is - * guaranteed to have executed a full memory barrier since the end of its - * last RCU read-side critical section whose beginning preceded the call - * to call_rcu(). It also means that each CPU executing an RCU read-side - * critical section that continues beyond the start of "func()" must have - * executed a memory barrier after the call_rcu() but before the beginning - * of that RCU read-side critical section. Note that these guarantees - * include CPUs that are offline, idle, or executing in user mode, as - * well as CPUs that are executing in the kernel. - * - * Furthermore, if CPU A invoked call_rcu() and CPU B invoked the - * resulting RCU callback function "func()", then both CPU A and CPU B are - * guaranteed to execute a full memory barrier during the time interval - * between the call to call_rcu() and the invocation of "func()" -- even - * if CPU A and CPU B are the same CPU (but again only if the system has - * more than one CPU). - * - * Implementation of these memory-ordering guarantees is described here: - * Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.rst. - */ -void call_rcu(struct rcu_head *head, rcu_callback_t func) +static void +__call_rcu_common(struct rcu_head *head, rcu_callback_t func, bool lazy) { static atomic_t doublefrees; unsigned long flags; @@ -2812,7 +2773,7 @@ void call_rcu(struct rcu_head *head, rcu_callback_t func) } check_cb_ovld(rdp); - if (rcu_nocb_try_bypass(rdp, head, &was_alldone, flags)) + if (rcu_nocb_try_bypass(rdp, head, &was_alldone, flags, lazy)) return; // Enqueued onto ->nocb_bypass, so just leave. // If no-CBs CPU gets here, rcu_nocb_try_bypass() acquired ->nocb_lock. rcu_segcblist_enqueue(&rdp->cblist, head); @@ -2834,8 +2795,84 @@ void call_rcu(struct rcu_head *head, rcu_callback_t func) local_irq_restore(flags); } } -EXPORT_SYMBOL_GPL(call_rcu); +#ifdef CONFIG_RCU_LAZY +/** + * call_rcu_hurry() - Queue RCU callback for invocation after grace period, and + * flush all lazy callbacks (including the new one) to the main ->cblist while + * doing so. + * + * @head: structure to be used for queueing the RCU updates. + * @func: actual callback function to be invoked after the grace period + * + * The callback function will be invoked some time after a full grace + * period elapses, in other words after all pre-existing RCU read-side + * critical sections have completed. + * + * Use this API instead of call_rcu() if you don't want the callback to be + * invoked after very long periods of time, which can happen on systems without + * memory pressure and on systems which are lightly loaded or mostly idle. + * This function will cause callbacks to be invoked sooner than later at the + * expense of extra power. Other than that, this function is identical to, and + * reuses call_rcu()'s logic. Refer to call_rcu() for more details about memory + * ordering and other functionality. + */ +void call_rcu_hurry(struct rcu_head *head, rcu_callback_t func) +{ + return __call_rcu_common(head, func, false); +} +EXPORT_SYMBOL_GPL(call_rcu_hurry); +#endif + +/** + * call_rcu() - Queue an RCU callback for invocation after a grace period. + * By default the callbacks are 'lazy' and are kept hidden from the main + * ->cblist to prevent starting of grace periods too soon. + * If you desire grace periods to start very soon, use call_rcu_hurry(). + * + * @head: structure to be used for queueing the RCU updates. + * @func: actual callback function to be invoked after the grace period + * + * The callback function will be invoked some time after a full grace + * period elapses, in other words after all pre-existing RCU read-side + * critical sections have completed. However, the callback function + * might well execute concurrently with RCU read-side critical sections + * that started after call_rcu() was invoked. + * + * RCU read-side critical sections are delimited by rcu_read_lock() + * and rcu_read_unlock(), and may be nested. In addition, but only in + * v5.0 and later, regions of code across which interrupts, preemption, + * or softirqs have been disabled also serve as RCU read-side critical + * sections. This includes hardware interrupt handlers, softirq handlers, + * and NMI handlers. + * + * Note that all CPUs must agree that the grace period extended beyond + * all pre-existing RCU read-side critical section. On systems with more + * than one CPU, this means that when "func()" is invoked, each CPU is + * guaranteed to have executed a full memory barrier since the end of its + * last RCU read-side critical section whose beginning preceded the call + * to call_rcu(). It also means that each CPU executing an RCU read-side + * critical section that continues beyond the start of "func()" must have + * executed a memory barrier after the call_rcu() but before the beginning + * of that RCU read-side critical section. Note that these guarantees + * include CPUs that are offline, idle, or executing in user mode, as + * well as CPUs that are executing in the kernel. + * + * Furthermore, if CPU A invoked call_rcu() and CPU B invoked the + * resulting RCU callback function "func()", then both CPU A and CPU B are + * guaranteed to execute a full memory barrier during the time interval + * between the call to call_rcu() and the invocation of "func()" -- even + * if CPU A and CPU B are the same CPU (but again only if the system has + * more than one CPU). + * + * Implementation of these memory-ordering guarantees is described here: + * Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.rst. + */ +void call_rcu(struct rcu_head *head, rcu_callback_t func) +{ + return __call_rcu_common(head, func, IS_ENABLED(CONFIG_RCU_LAZY)); +} +EXPORT_SYMBOL_GPL(call_rcu); /* Maximum number of jiffies to wait before draining a batch. */ #define KFREE_DRAIN_JIFFIES (5 * HZ) @@ -3521,7 +3558,7 @@ void synchronize_rcu(void) if (rcu_gp_is_expedited()) synchronize_rcu_expedited(); else - wait_rcu_gp(call_rcu); + wait_rcu_gp(call_rcu_hurry); return; } @@ -3924,7 +3961,7 @@ static void rcu_barrier_entrain(struct rcu_data *rdp) * if it's fully lazy. */ was_alldone = rcu_rdp_is_offloaded(rdp) && !rcu_segcblist_pend_cbs(&rdp->cblist); - WARN_ON_ONCE(!rcu_nocb_flush_bypass(rdp, NULL, jiffies)); + WARN_ON_ONCE(!rcu_nocb_flush_bypass(rdp, NULL, jiffies, false)); wake_nocb = was_alldone && rcu_segcblist_pend_cbs(&rdp->cblist); if (rcu_segcblist_entrain(&rdp->cblist, &rdp->barrier_head)) { atomic_inc(&rcu_state.barrier_cpu_count); @@ -4359,7 +4396,7 @@ void rcutree_migrate_callbacks(int cpu) my_rdp = this_cpu_ptr(&rcu_data); my_rnp = my_rdp->mynode; rcu_nocb_lock(my_rdp); /* irqs already disabled. */ - WARN_ON_ONCE(!rcu_nocb_flush_bypass(my_rdp, NULL, jiffies)); + WARN_ON_ONCE(!rcu_nocb_flush_bypass(my_rdp, NULL, jiffies, false)); raw_spin_lock_rcu_node(my_rnp); /* irqs already disabled. */ /* Leverage recent GPs and set GP for new callbacks. */ needwake = rcu_advance_cbs(my_rnp, rdp) || diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h index 925dd98f8b23..fcb5d696eb17 100644 --- a/kernel/rcu/tree.h +++ b/kernel/rcu/tree.h @@ -263,14 +263,16 @@ struct rcu_data { unsigned long last_fqs_resched; /* Time of last rcu_resched(). */ unsigned long last_sched_clock; /* Jiffies of last rcu_sched_clock_irq(). */ + long lazy_len; /* Length of buffered lazy callbacks. */ int cpu; }; /* Values for nocb_defer_wakeup field in struct rcu_data. */ #define RCU_NOCB_WAKE_NOT 0 #define RCU_NOCB_WAKE_BYPASS 1 -#define RCU_NOCB_WAKE 2 -#define RCU_NOCB_WAKE_FORCE 3 +#define RCU_NOCB_WAKE_LAZY 2 +#define RCU_NOCB_WAKE 3 +#define RCU_NOCB_WAKE_FORCE 4 #define RCU_JIFFIES_TILL_FORCE_QS (1 + (HZ > 250) + (HZ > 500)) /* For jiffies_till_first_fqs and */ @@ -441,9 +443,10 @@ static void rcu_nocb_gp_cleanup(struct swait_queue_head *sq); static void rcu_init_one_nocb(struct rcu_node *rnp); static bool wake_nocb_gp(struct rcu_data *rdp, bool force); static bool rcu_nocb_flush_bypass(struct rcu_data *rdp, struct rcu_head *rhp, - unsigned long j); + unsigned long j, bool lazy); static bool rcu_nocb_try_bypass(struct rcu_data *rdp, struct rcu_head *rhp, - bool *was_alldone, unsigned long flags); + bool *was_alldone, unsigned long flags, + bool lazy); static void __call_rcu_nocb_wake(struct rcu_data *rdp, bool was_empty, unsigned long flags); static int rcu_nocb_need_deferred_wakeup(struct rcu_data *rdp, int level); diff --git a/kernel/rcu/tree_exp.h b/kernel/rcu/tree_exp.h index aa3ec3c3b9f7..b9637df7cda7 100644 --- a/kernel/rcu/tree_exp.h +++ b/kernel/rcu/tree_exp.h @@ -941,7 +941,7 @@ void synchronize_rcu_expedited(void) /* If expedited grace periods are prohibited, fall back to normal. */ if (rcu_gp_is_normal()) { - wait_rcu_gp(call_rcu); + wait_rcu_gp(call_rcu_hurry); return; } diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h index 74d4983d68f8..c3ec5f389d27 100644 --- a/kernel/rcu/tree_nocb.h +++ b/kernel/rcu/tree_nocb.h @@ -256,6 +256,31 @@ static bool wake_nocb_gp(struct rcu_data *rdp, bool force) return __wake_nocb_gp(rdp_gp, rdp, force, flags); } +/* + * LAZY_FLUSH_JIFFIES decides the maximum amount of time that + * can elapse before lazy callbacks are flushed. Lazy callbacks + * could be flushed much earlier for a number of other reasons + * however, LAZY_FLUSH_JIFFIES will ensure no lazy callbacks are + * left unsubmitted to RCU after those many jiffies. + */ +#define LAZY_FLUSH_JIFFIES (10 * HZ) +static unsigned long jiffies_till_flush = LAZY_FLUSH_JIFFIES; + +#ifdef CONFIG_RCU_LAZY +// To be called only from test code. +void rcu_lazy_set_jiffies_till_flush(unsigned long jif) +{ + jiffies_till_flush = jif; +} +EXPORT_SYMBOL(rcu_lazy_set_jiffies_till_flush); + +unsigned long rcu_lazy_get_jiffies_till_flush(void) +{ + return jiffies_till_flush; +} +EXPORT_SYMBOL(rcu_lazy_get_jiffies_till_flush); +#endif + /* * Arrange to wake the GP kthread for this NOCB group at some future * time when it is safe to do so. @@ -269,10 +294,14 @@ static void wake_nocb_gp_defer(struct rcu_data *rdp, int waketype, raw_spin_lock_irqsave(&rdp_gp->nocb_gp_lock, flags); /* - * Bypass wakeup overrides previous deferments. In case - * of callback storm, no need to wake up too early. + * Bypass wakeup overrides previous deferments. In case of + * callback storms, no need to wake up too early. */ - if (waketype == RCU_NOCB_WAKE_BYPASS) { + if (waketype == RCU_NOCB_WAKE_LAZY && + rdp->nocb_defer_wakeup == RCU_NOCB_WAKE_NOT) { + mod_timer(&rdp_gp->nocb_timer, jiffies + jiffies_till_flush); + WRITE_ONCE(rdp_gp->nocb_defer_wakeup, waketype); + } else if (waketype == RCU_NOCB_WAKE_BYPASS) { mod_timer(&rdp_gp->nocb_timer, jiffies + 2); WRITE_ONCE(rdp_gp->nocb_defer_wakeup, waketype); } else { @@ -293,10 +322,13 @@ static void wake_nocb_gp_defer(struct rcu_data *rdp, int waketype, * proves to be initially empty, just return false because the no-CB GP * kthread may need to be awakened in this case. * + * Return true if there was something to be flushed and it succeeded, otherwise + * false. + * * Note that this function always returns true if rhp is NULL. */ static bool rcu_nocb_do_flush_bypass(struct rcu_data *rdp, struct rcu_head *rhp, - unsigned long j) + unsigned long j, bool lazy) { struct rcu_cblist rcl; @@ -310,7 +342,20 @@ static bool rcu_nocb_do_flush_bypass(struct rcu_data *rdp, struct rcu_head *rhp, /* Note: ->cblist.len already accounts for ->nocb_bypass contents. */ if (rhp) rcu_segcblist_inc_len(&rdp->cblist); /* Must precede enqueue. */ - rcu_cblist_flush_enqueue(&rcl, &rdp->nocb_bypass, rhp); + + /* + * If the new CB requested was a lazy one, queue it onto the main + * ->cblist so we can take advantage of a sooner grade period. + */ + if (lazy && rhp) { + rcu_cblist_flush_enqueue(&rcl, &rdp->nocb_bypass, NULL); + rcu_cblist_enqueue(&rcl, rhp); + WRITE_ONCE(rdp->lazy_len, 0); + } else { + rcu_cblist_flush_enqueue(&rcl, &rdp->nocb_bypass, rhp); + WRITE_ONCE(rdp->lazy_len, 0); + } + rcu_segcblist_insert_pend_cbs(&rdp->cblist, &rcl); WRITE_ONCE(rdp->nocb_bypass_first, j); rcu_nocb_bypass_unlock(rdp); @@ -326,13 +371,13 @@ static bool rcu_nocb_do_flush_bypass(struct rcu_data *rdp, struct rcu_head *rhp, * Note that this function always returns true if rhp is NULL. */ static bool rcu_nocb_flush_bypass(struct rcu_data *rdp, struct rcu_head *rhp, - unsigned long j) + unsigned long j, bool lazy) { if (!rcu_rdp_is_offloaded(rdp)) return true; rcu_lockdep_assert_cblist_protected(rdp); rcu_nocb_bypass_lock(rdp); - return rcu_nocb_do_flush_bypass(rdp, rhp, j); + return rcu_nocb_do_flush_bypass(rdp, rhp, j, lazy); } /* @@ -345,7 +390,7 @@ static void rcu_nocb_try_flush_bypass(struct rcu_data *rdp, unsigned long j) if (!rcu_rdp_is_offloaded(rdp) || !rcu_nocb_bypass_trylock(rdp)) return; - WARN_ON_ONCE(!rcu_nocb_do_flush_bypass(rdp, NULL, j)); + WARN_ON_ONCE(!rcu_nocb_do_flush_bypass(rdp, NULL, j, false)); } /* @@ -367,12 +412,14 @@ static void rcu_nocb_try_flush_bypass(struct rcu_data *rdp, unsigned long j) * there is only one CPU in operation. */ static bool rcu_nocb_try_bypass(struct rcu_data *rdp, struct rcu_head *rhp, - bool *was_alldone, unsigned long flags) + bool *was_alldone, unsigned long flags, + bool lazy) { unsigned long c; unsigned long cur_gp_seq; unsigned long j = jiffies; long ncbs = rcu_cblist_n_cbs(&rdp->nocb_bypass); + bool bypass_is_lazy = (ncbs == READ_ONCE(rdp->lazy_len)); lockdep_assert_irqs_disabled(); @@ -417,25 +464,29 @@ static bool rcu_nocb_try_bypass(struct rcu_data *rdp, struct rcu_head *rhp, // If there hasn't yet been all that many ->cblist enqueues // this jiffy, tell the caller to enqueue onto ->cblist. But flush // ->nocb_bypass first. - if (rdp->nocb_nobypass_count < nocb_nobypass_lim_per_jiffy) { + // Lazy CBs throttle this back and do immediate bypass queuing. + if (rdp->nocb_nobypass_count < nocb_nobypass_lim_per_jiffy && !lazy) { rcu_nocb_lock(rdp); *was_alldone = !rcu_segcblist_pend_cbs(&rdp->cblist); if (*was_alldone) trace_rcu_nocb_wake(rcu_state.name, rdp->cpu, TPS("FirstQ")); - WARN_ON_ONCE(!rcu_nocb_flush_bypass(rdp, NULL, j)); + + WARN_ON_ONCE(!rcu_nocb_flush_bypass(rdp, NULL, j, false)); WARN_ON_ONCE(rcu_cblist_n_cbs(&rdp->nocb_bypass)); return false; // Caller must enqueue the callback. } // If ->nocb_bypass has been used too long or is too full, // flush ->nocb_bypass to ->cblist. - if ((ncbs && j != READ_ONCE(rdp->nocb_bypass_first)) || + if ((ncbs && !bypass_is_lazy && j != READ_ONCE(rdp->nocb_bypass_first)) || + (ncbs && bypass_is_lazy && + (time_after(j, READ_ONCE(rdp->nocb_bypass_first) + jiffies_till_flush))) || ncbs >= qhimark) { rcu_nocb_lock(rdp); *was_alldone = !rcu_segcblist_pend_cbs(&rdp->cblist); - if (!rcu_nocb_flush_bypass(rdp, rhp, j)) { + if (!rcu_nocb_flush_bypass(rdp, rhp, j, lazy)) { if (*was_alldone) trace_rcu_nocb_wake(rcu_state.name, rdp->cpu, TPS("FirstQ")); @@ -463,13 +514,24 @@ static bool rcu_nocb_try_bypass(struct rcu_data *rdp, struct rcu_head *rhp, ncbs = rcu_cblist_n_cbs(&rdp->nocb_bypass); rcu_segcblist_inc_len(&rdp->cblist); /* Must precede enqueue. */ rcu_cblist_enqueue(&rdp->nocb_bypass, rhp); + + if (lazy) + WRITE_ONCE(rdp->lazy_len, rdp->lazy_len + 1); + if (!ncbs) { WRITE_ONCE(rdp->nocb_bypass_first, j); trace_rcu_nocb_wake(rcu_state.name, rdp->cpu, TPS("FirstBQ")); } rcu_nocb_bypass_unlock(rdp); smp_mb(); /* Order enqueue before wake. */ - if (ncbs) { + // A wake up of the grace period kthread or timer adjustment + // needs to be done only if: + // 1. Bypass list was fully empty before (this is the first + // bypass list entry), or: + // 2. Both of these conditions are met: + // a. The bypass list previously had only lazy CBs, and: + // b. The new CB is non-lazy. + if (ncbs && (!bypass_is_lazy || lazy)) { local_irq_restore(flags); } else { // No-CBs GP kthread might be indefinitely asleep, if so, wake. @@ -497,8 +559,10 @@ static void __call_rcu_nocb_wake(struct rcu_data *rdp, bool was_alldone, unsigned long flags) __releases(rdp->nocb_lock) { + long bypass_len; unsigned long cur_gp_seq; unsigned long j; + long lazy_len; long len; struct task_struct *t; @@ -512,9 +576,16 @@ static void __call_rcu_nocb_wake(struct rcu_data *rdp, bool was_alldone, } // Need to actually to a wakeup. len = rcu_segcblist_n_cbs(&rdp->cblist); + bypass_len = rcu_cblist_n_cbs(&rdp->nocb_bypass); + lazy_len = READ_ONCE(rdp->lazy_len); if (was_alldone) { rdp->qlen_last_fqs_check = len; - if (!irqs_disabled_flags(flags)) { + // Only lazy CBs in bypass list + if (lazy_len && bypass_len == lazy_len) { + rcu_nocb_unlock_irqrestore(rdp, flags); + wake_nocb_gp_defer(rdp, RCU_NOCB_WAKE_LAZY, + TPS("WakeLazy")); + } else if (!irqs_disabled_flags(flags)) { /* ... if queue was empty ... */ rcu_nocb_unlock_irqrestore(rdp, flags); wake_nocb_gp(rdp, false); @@ -605,12 +676,12 @@ static void nocb_gp_sleep(struct rcu_data *my_rdp, int cpu) static void nocb_gp_wait(struct rcu_data *my_rdp) { bool bypass = false; - long bypass_ncbs; int __maybe_unused cpu = my_rdp->cpu; unsigned long cur_gp_seq; unsigned long flags; bool gotcbs = false; unsigned long j = jiffies; + bool lazy = false; bool needwait_gp = false; // This prevents actual uninitialized use. bool needwake; bool needwake_gp; @@ -640,24 +711,43 @@ static void nocb_gp_wait(struct rcu_data *my_rdp) * won't be ignored for long. */ list_for_each_entry(rdp, &my_rdp->nocb_head_rdp, nocb_entry_rdp) { + long bypass_ncbs; + bool flush_bypass = false; + long lazy_ncbs; + trace_rcu_nocb_wake(rcu_state.name, rdp->cpu, TPS("Check")); rcu_nocb_lock_irqsave(rdp, flags); lockdep_assert_held(&rdp->nocb_lock); bypass_ncbs = rcu_cblist_n_cbs(&rdp->nocb_bypass); - if (bypass_ncbs && + lazy_ncbs = READ_ONCE(rdp->lazy_len); + + if (bypass_ncbs && (lazy_ncbs == bypass_ncbs) && + (time_after(j, READ_ONCE(rdp->nocb_bypass_first) + jiffies_till_flush) || + bypass_ncbs > 2 * qhimark)) { + flush_bypass = true; + } else if (bypass_ncbs && (lazy_ncbs != bypass_ncbs) && (time_after(j, READ_ONCE(rdp->nocb_bypass_first) + 1) || bypass_ncbs > 2 * qhimark)) { - // Bypass full or old, so flush it. - (void)rcu_nocb_try_flush_bypass(rdp, j); - bypass_ncbs = rcu_cblist_n_cbs(&rdp->nocb_bypass); + flush_bypass = true; } else if (!bypass_ncbs && rcu_segcblist_empty(&rdp->cblist)) { rcu_nocb_unlock_irqrestore(rdp, flags); continue; /* No callbacks here, try next. */ } + + if (flush_bypass) { + // Bypass full or old, so flush it. + (void)rcu_nocb_try_flush_bypass(rdp, j); + bypass_ncbs = rcu_cblist_n_cbs(&rdp->nocb_bypass); + lazy_ncbs = READ_ONCE(rdp->lazy_len); + } + if (bypass_ncbs) { trace_rcu_nocb_wake(rcu_state.name, rdp->cpu, - TPS("Bypass")); - bypass = true; + bypass_ncbs == lazy_ncbs ? TPS("Lazy") : TPS("Bypass")); + if (bypass_ncbs == lazy_ncbs) + lazy = true; + else + bypass = true; } rnp = rdp->mynode; @@ -705,12 +795,20 @@ static void nocb_gp_wait(struct rcu_data *my_rdp) my_rdp->nocb_gp_gp = needwait_gp; my_rdp->nocb_gp_seq = needwait_gp ? wait_gp_seq : 0; - if (bypass && !rcu_nocb_poll) { - // At least one child with non-empty ->nocb_bypass, so set - // timer in order to avoid stranding its callbacks. - wake_nocb_gp_defer(my_rdp, RCU_NOCB_WAKE_BYPASS, - TPS("WakeBypassIsDeferred")); + // At least one child with non-empty ->nocb_bypass, so set + // timer in order to avoid stranding its callbacks. + if (!rcu_nocb_poll) { + // If bypass list only has lazy CBs. Add a deferred lazy wake up. + if (lazy && !bypass) { + wake_nocb_gp_defer(my_rdp, RCU_NOCB_WAKE_LAZY, + TPS("WakeLazyIsDeferred")); + // Otherwise add a deferred bypass wake up. + } else if (bypass) { + wake_nocb_gp_defer(my_rdp, RCU_NOCB_WAKE_BYPASS, + TPS("WakeBypassIsDeferred")); + } } + if (rcu_nocb_poll) { /* Polling, so trace if first poll in the series. */ if (gotcbs) @@ -1036,7 +1134,7 @@ static long rcu_nocb_rdp_deoffload(void *arg) * return false, which means that future calls to rcu_nocb_try_bypass() * will refuse to put anything into the bypass. */ - WARN_ON_ONCE(!rcu_nocb_flush_bypass(rdp, NULL, jiffies)); + WARN_ON_ONCE(!rcu_nocb_flush_bypass(rdp, NULL, jiffies, false)); /* * Start with invoking rcu_core() early. This way if the current thread * happens to preempt an ongoing call to rcu_core() in the middle, @@ -1290,6 +1388,7 @@ static void __init rcu_boot_init_nocb_percpu_data(struct rcu_data *rdp) raw_spin_lock_init(&rdp->nocb_gp_lock); timer_setup(&rdp->nocb_timer, do_nocb_deferred_wakeup_timer, 0); rcu_cblist_init(&rdp->nocb_bypass); + WRITE_ONCE(rdp->lazy_len, 0); mutex_init(&rdp->nocb_gp_kthread_mutex); } @@ -1576,13 +1675,13 @@ static bool wake_nocb_gp(struct rcu_data *rdp, bool force) } static bool rcu_nocb_flush_bypass(struct rcu_data *rdp, struct rcu_head *rhp, - unsigned long j) + unsigned long j, bool lazy) { return true; } static bool rcu_nocb_try_bypass(struct rcu_data *rdp, struct rcu_head *rhp, - bool *was_alldone, unsigned long flags) + bool *was_alldone, unsigned long flags, bool lazy) { return false; } From 4957579439942d44c30adc9cf32084fd2e420278 Mon Sep 17 00:00:00 2001 From: "Joel Fernandes (Google)" Date: Sun, 16 Oct 2022 16:22:55 +0000 Subject: [PATCH 19/70] UPSTREAM: rcu: Refactor code a bit in rcu_nocb_do_flush_bypass() This consolidates the code a bit and makes it cleaner. Functionally it is the same. Reported-by: Paul E. McKenney Signed-off-by: Joel Fernandes (Google) Reviewed-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney (cherry picked from commit 3d222a0c0cfef85bad2c9cff5d541836cb81cfbd) Bug: 258241771 Signed-off-by: Joel Fernandes Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4909031 Reviewed-by: Sean Paul Reviewed-by: Vineeth Pillai Signed-off-by: Qais Yousef Change-Id: I8422c7138edd6a476fc46374beefdf46dd76b8b0 --- kernel/rcu/tree_nocb.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h index c3ec5f389d27..89ddaa0b06a1 100644 --- a/kernel/rcu/tree_nocb.h +++ b/kernel/rcu/tree_nocb.h @@ -327,10 +327,11 @@ static void wake_nocb_gp_defer(struct rcu_data *rdp, int waketype, * * Note that this function always returns true if rhp is NULL. */ -static bool rcu_nocb_do_flush_bypass(struct rcu_data *rdp, struct rcu_head *rhp, +static bool rcu_nocb_do_flush_bypass(struct rcu_data *rdp, struct rcu_head *rhp_in, unsigned long j, bool lazy) { struct rcu_cblist rcl; + struct rcu_head *rhp = rhp_in; WARN_ON_ONCE(!rcu_rdp_is_offloaded(rdp)); rcu_lockdep_assert_cblist_protected(rdp); @@ -345,16 +346,16 @@ static bool rcu_nocb_do_flush_bypass(struct rcu_data *rdp, struct rcu_head *rhp, /* * If the new CB requested was a lazy one, queue it onto the main - * ->cblist so we can take advantage of a sooner grade period. + * ->cblist so that we can take advantage of the grace-period that will + * happen regardless. But queue it onto the bypass list first so that + * the lazy CB is ordered with the existing CBs in the bypass list. */ if (lazy && rhp) { - rcu_cblist_flush_enqueue(&rcl, &rdp->nocb_bypass, NULL); - rcu_cblist_enqueue(&rcl, rhp); - WRITE_ONCE(rdp->lazy_len, 0); - } else { - rcu_cblist_flush_enqueue(&rcl, &rdp->nocb_bypass, rhp); - WRITE_ONCE(rdp->lazy_len, 0); + rcu_cblist_enqueue(&rdp->nocb_bypass, rhp); + rhp = NULL; } + rcu_cblist_flush_enqueue(&rcl, &rdp->nocb_bypass, rhp); + WRITE_ONCE(rdp->lazy_len, 0); rcu_segcblist_insert_pend_cbs(&rdp->cblist, &rcl); WRITE_ONCE(rdp->nocb_bypass_first, j); From c570c8fea354efe75f47403c8569825e573e82b1 Mon Sep 17 00:00:00 2001 From: Vineeth Pillai Date: Sun, 16 Oct 2022 16:22:56 +0000 Subject: [PATCH 20/70] BACKPORT: rcu: Shrinker for lazy rcu The shrinker is used to speed up the free'ing of memory potentially held by RCU lazy callbacks. RCU kernel module test cases show this to be effective. Test is introduced in a later patch. Signed-off-by: Vineeth Pillai Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney (cherry picked from commit c945b4da7a448a9a56becc5a8745d942b2b83d3c) Conflicts: kernel/rcu/tree_nocb.h Trivial conflict due to: "rcu/nocb: Add an option to offload all CPUs on boot" Bug: 258241771 Signed-off-by: Joel Fernandes Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4909032 Reviewed-by: Vineeth Pillai Signed-off-by: Qais Yousef Change-Id: I6a73a9dae79ff35feca37abe2663e55a0f46dda8 --- kernel/rcu/tree_nocb.h | 52 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h index 89ddaa0b06a1..31eec9cb0095 100644 --- a/kernel/rcu/tree_nocb.h +++ b/kernel/rcu/tree_nocb.h @@ -1312,6 +1312,55 @@ int rcu_nocb_cpu_offload(int cpu) } EXPORT_SYMBOL_GPL(rcu_nocb_cpu_offload); +static unsigned long +lazy_rcu_shrink_count(struct shrinker *shrink, struct shrink_control *sc) +{ + int cpu; + unsigned long count = 0; + + /* Snapshot count of all CPUs */ + for_each_possible_cpu(cpu) { + struct rcu_data *rdp = per_cpu_ptr(&rcu_data, cpu); + + count += READ_ONCE(rdp->lazy_len); + } + + return count ? count : SHRINK_EMPTY; +} + +static unsigned long +lazy_rcu_shrink_scan(struct shrinker *shrink, struct shrink_control *sc) +{ + int cpu; + unsigned long flags; + unsigned long count = 0; + + /* Snapshot count of all CPUs */ + for_each_possible_cpu(cpu) { + struct rcu_data *rdp = per_cpu_ptr(&rcu_data, cpu); + int _count = READ_ONCE(rdp->lazy_len); + + if (_count == 0) + continue; + rcu_nocb_lock_irqsave(rdp, flags); + WRITE_ONCE(rdp->lazy_len, 0); + rcu_nocb_unlock_irqrestore(rdp, flags); + wake_nocb_gp(rdp, false); + sc->nr_to_scan -= _count; + count += _count; + if (sc->nr_to_scan <= 0) + break; + } + return count ? count : SHRINK_STOP; +} + +static struct shrinker lazy_rcu_shrinker = { + .count_objects = lazy_rcu_shrink_count, + .scan_objects = lazy_rcu_shrink_scan, + .batch = 0, + .seeks = DEFAULT_SEEKS, +}; + void __init rcu_init_nohz(void) { int cpu; @@ -1354,6 +1403,9 @@ void __init rcu_init_nohz(void) if (offload_all) cpumask_setall(rcu_nocb_mask); + if (register_shrinker(&lazy_rcu_shrinker, "rcu-lazy")) + pr_err("Failed to register lazy_rcu shrinker!\n"); + if (!cpumask_subset(rcu_nocb_mask, cpu_possible_mask)) { pr_info("\tNote: kernel parameter 'rcu_nocbs=', 'nohz_full', or 'isolcpus=' contains nonexistent CPUs.\n"); cpumask_and(rcu_nocb_mask, cpu_possible_mask, From 9b625f4978158d2e6c48d9c9487be17c42f242ae Mon Sep 17 00:00:00 2001 From: "Joel Fernandes (Google)" Date: Sun, 16 Oct 2022 16:22:59 +0000 Subject: [PATCH 21/70] UPSTREAM: rcu/sync: Use call_rcu_hurry() instead of call_rcu call_rcu() changes to save power will slow down rcu sync. Use the call_rcu_hurry() API instead which reverts to the old behavior. [ paulmck: Apply s/call_rcu_flush/call_rcu_hurry/ feedback from Tejun Heo. ] Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney (cherry picked from commit 7651d6b25086656eacfdd8356bfe3a21c0c2d79d) Bug: 258241771 Signed-off-by: Joel Fernandes Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4909033 Reviewed-by: Vineeth Pillai Reviewed-by: Sean Paul Signed-off-by: Qais Yousef Change-Id: I5123ba52f47676305dbcfa1233bf3b41f140766c --- kernel/rcu/sync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rcu/sync.c b/kernel/rcu/sync.c index 5cefc702158f..e550f97779b8 100644 --- a/kernel/rcu/sync.c +++ b/kernel/rcu/sync.c @@ -44,7 +44,7 @@ static void rcu_sync_func(struct rcu_head *rhp); static void rcu_sync_call(struct rcu_sync *rsp) { - call_rcu(&rsp->cb_head, rcu_sync_func); + call_rcu_hurry(&rsp->cb_head, rcu_sync_func); } /** From 83f8ba569fab1acf078befcbac0b98043952ad70 Mon Sep 17 00:00:00 2001 From: "Joel Fernandes (Google)" Date: Sun, 16 Oct 2022 16:23:00 +0000 Subject: [PATCH 22/70] UPSTREAM: rcu/rcuscale: Use call_rcu_hurry() for async reader test rcuscale uses call_rcu() to queue async readers. With recent changes to save power, the test will have fewer async readers in flight. Use the call_rcu_hurry() API instead to revert to the old behavior. [ paulmck: Apply s/call_rcu_flush/call_rcu_hurry/ feedback from Tejun Heo. ] Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney (cherry picked from commit 723df859d8bba948ff2eb08eba32ab433acf7c9c) Bug: 258241771 Signed-off-by: Joel Fernandes Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4909034 Reviewed-by: Sean Paul Reviewed-by: Vineeth Pillai Signed-off-by: Qais Yousef Change-Id: I680dacb44e81e210e2e4455f28e50b9b516222a8 --- kernel/rcu/rcuscale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rcu/rcuscale.c b/kernel/rcu/rcuscale.c index 0b88d96511ad..e4a203313906 100644 --- a/kernel/rcu/rcuscale.c +++ b/kernel/rcu/rcuscale.c @@ -175,7 +175,7 @@ static struct rcu_scale_ops rcu_ops = { .get_gp_seq = rcu_get_gp_seq, .gp_diff = rcu_seq_diff, .exp_completed = rcu_exp_batches_completed, - .async = call_rcu, + .async = call_rcu_hurry, .gp_barrier = rcu_barrier, .sync = synchronize_rcu, .exp_sync = synchronize_rcu_expedited, From 52193e948972aa11035f3fcd1ac04ea0939093d0 Mon Sep 17 00:00:00 2001 From: "Joel Fernandes (Google)" Date: Sun, 16 Oct 2022 16:23:01 +0000 Subject: [PATCH 23/70] UPSTREAM: rcu/rcutorture: Use call_rcu_hurry() where needed call_rcu() changes to save power will change the behavior of rcutorture tests. Use the call_rcu_hurry() API instead which reverts to the old behavior. [ paulmck: Apply s/call_rcu_flush/call_rcu_hurry/ feedback from Tejun Heo. ] Reported-by: Paul E. McKenney Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney (cherry picked from commit 405d8e91f0a99777d61f6b0ddc3484d8ea7ca393) Bug: 258241771 Signed-off-by: Joel Fernandes Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4909035 Reviewed-by: Sean Paul Reviewed-by: Vineeth Pillai Signed-off-by: Qais Yousef Change-Id: I8008990dfe7e64f511aada006e736b15cdd0d61e --- kernel/rcu/rcutorture.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 503c2aa845a4..2226f86f54f7 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -510,7 +510,7 @@ static unsigned long rcu_no_completed(void) static void rcu_torture_deferred_free(struct rcu_torture *p) { - call_rcu(&p->rtort_rcu, rcu_torture_cb); + call_rcu_hurry(&p->rtort_rcu, rcu_torture_cb); } static void rcu_sync_torture_init(void) @@ -551,7 +551,7 @@ static struct rcu_torture_ops rcu_ops = { .start_gp_poll_exp_full = start_poll_synchronize_rcu_expedited_full, .poll_gp_state_exp = poll_state_synchronize_rcu, .cond_sync_exp = cond_synchronize_rcu_expedited, - .call = call_rcu, + .call = call_rcu_hurry, .cb_barrier = rcu_barrier, .fqs = rcu_force_quiescent_state, .stats = NULL, @@ -848,7 +848,7 @@ static void rcu_tasks_torture_deferred_free(struct rcu_torture *p) static void synchronize_rcu_mult_test(void) { - synchronize_rcu_mult(call_rcu_tasks, call_rcu); + synchronize_rcu_mult(call_rcu_tasks, call_rcu_hurry); } static struct rcu_torture_ops tasks_ops = { @@ -3388,13 +3388,13 @@ static void rcu_test_debug_objects(void) /* Try to queue the rh2 pair of callbacks for the same grace period. */ preempt_disable(); /* Prevent preemption from interrupting test. */ rcu_read_lock(); /* Make it impossible to finish a grace period. */ - call_rcu(&rh1, rcu_torture_leak_cb); /* Start grace period. */ + call_rcu_hurry(&rh1, rcu_torture_leak_cb); /* Start grace period. */ local_irq_disable(); /* Make it harder to start a new grace period. */ - call_rcu(&rh2, rcu_torture_leak_cb); - call_rcu(&rh2, rcu_torture_err_cb); /* Duplicate callback. */ + call_rcu_hurry(&rh2, rcu_torture_leak_cb); + call_rcu_hurry(&rh2, rcu_torture_err_cb); /* Duplicate callback. */ if (rhp) { - call_rcu(rhp, rcu_torture_leak_cb); - call_rcu(rhp, rcu_torture_err_cb); /* Another duplicate callback. */ + call_rcu_hurry(rhp, rcu_torture_leak_cb); + call_rcu_hurry(rhp, rcu_torture_err_cb); /* Another duplicate callback. */ } local_irq_enable(); rcu_read_unlock(); From 3751416eeb2867edaf4c72867e9695b8d830789c Mon Sep 17 00:00:00 2001 From: Uladzislau Rezki Date: Sun, 16 Oct 2022 16:23:02 +0000 Subject: [PATCH 24/70] UPSTREAM: scsi/scsi_error: Use call_rcu_hurry() instead of call_rcu() Earlier commits in this series allow battery-powered systems to build their kernels with the default-disabled CONFIG_RCU_LAZY=y Kconfig option. This Kconfig option causes call_rcu() to delay its callbacks in order to batch them. This means that a given RCU grace period covers more callbacks, thus reducing the number of grace periods, in turn reducing the amount of energy consumed, which increases battery lifetime which can be a very good thing. This is not a subtle effect: In some important use cases, the battery lifetime is increased by more than 10%. This CONFIG_RCU_LAZY=y option is available only for CPUs that offload callbacks, for example, CPUs mentioned in the rcu_nocbs kernel boot parameter passed to kernels built with CONFIG_RCU_NOCB_CPU=y. Delaying callbacks is normally not a problem because most callbacks do nothing but free memory. If the system is short on memory, a shrinker will kick all currently queued lazy callbacks out of their laziness, thus freeing their memory in short order. Similarly, the rcu_barrier() function, which blocks until all currently queued callbacks are invoked, will also kick lazy callbacks, thus enabling rcu_barrier() to complete in a timely manner. However, there are some cases where laziness is not a good option. For example, synchronize_rcu() invokes call_rcu(), and blocks until the newly queued callback is invoked. It would not be a good for synchronize_rcu() to block for ten seconds, even on an idle system. Therefore, synchronize_rcu() invokes call_rcu_hurry() instead of call_rcu(). The arrival of a non-lazy call_rcu_hurry() callback on a given CPU kicks any lazy callbacks that might be already queued on that CPU. After all, if there is going to be a grace period, all callbacks might as well get full benefit from it. Yes, this could be done the other way around by creating a call_rcu_lazy(), but earlier experience with this approach and feedback at the 2022 Linux Plumbers Conference shifted the approach to call_rcu() being lazy with call_rcu_hurry() for the few places where laziness is inappropriate. And another call_rcu() instance that cannot be lazy is the one in the scsi_eh_scmd_add() function. Leaving this instance lazy results in unacceptably slow boot times. Therefore, make scsi_eh_scmd_add() use call_rcu_hurry() in order to revert to the old behavior. [ paulmck: Apply s/call_rcu_flush/call_rcu_hurry/ feedback from Tejun Heo. ] Tested-by: Joel Fernandes (Google) Signed-off-by: Uladzislau Rezki Signed-off-by: Joel Fernandes (Google) Cc: "James E.J. Bottomley" Cc: Reviewed-by: Bart Van Assche Acked-by: Martin K. Petersen Signed-off-by: Paul E. McKenney (cherry picked from commit 54d87b0a0c19bc3f740e4cd4b87ba14ce2e4ea73) Bug: 258241771 Signed-off-by: Joel Fernandes Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4909036 Reviewed-by: Vineeth Pillai Reviewed-by: Sean Paul Signed-off-by: Qais Yousef Change-Id: I95bba865e582b0a12b1c09ba1f0bd4f897401c07 --- drivers/scsi/scsi_error.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 3f10074e9c94..2c53965f903f 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -317,7 +317,7 @@ void scsi_eh_scmd_add(struct scsi_cmnd *scmd) * Ensure that all tasks observe the host state change before the * host_failed change. */ - call_rcu(&scmd->rcu, scsi_eh_inc_host_failed); + call_rcu_hurry(&scmd->rcu, scsi_eh_inc_host_failed); } /** From 84c8157d0602f10388a99854c88d5d5b41829230 Mon Sep 17 00:00:00 2001 From: "Paul E. McKenney" Date: Tue, 16 May 2023 03:41:37 -0700 Subject: [PATCH 25/70] UPSTREAM: rcu: Update synchronize_rcu_mult() comment for call_rcu_hurry() Those who have worked with RCU for some time will naturally think in terms of the long-standing call_rcu() API rather than the much newer call_rcu_hurry() API. But it is call_rcu_hurry() that you should normally pass to synchronize_rcu_mult(). This commit therefore updates the header comment to point this out. Signed-off-by: Paul E. McKenney Reviewed-by: Joel Fernandes (Google) (cherry picked from commit 6716f4d39c17febf7aa4fa5f5923da67a8d10e85) Bug: 258241771 Signed-off-by: Joel Fernandes Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4909037 Reviewed-by: Ross Zwisler Reviewed-by: Sean Paul Reviewed-by: Vineeth Pillai Signed-off-by: Qais Yousef Change-Id: I0d701825ddd7e15cebd92190388fbf78c04d26fb --- include/linux/rcupdate_wait.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/rcupdate_wait.h b/include/linux/rcupdate_wait.h index 699b938358bf..5e0f74f2f8ca 100644 --- a/include/linux/rcupdate_wait.h +++ b/include/linux/rcupdate_wait.h @@ -42,6 +42,11 @@ do { \ * call_srcu() function, with this wrapper supplying the pointer to the * corresponding srcu_struct. * + * Note that call_rcu_hurry() should be used instead of call_rcu() + * because in kernels built with CONFIG_RCU_LAZY=y the delay between the + * invocation of call_rcu() and that of the corresponding RCU callback + * can be multiple seconds. + * * The first argument tells Tiny RCU's _wait_rcu_gp() not to * bother waiting for RCU. The reason for this is because anywhere * synchronize_rcu_mult() can be called is automatically already a full From ced65a053b90453a4e68b9bde7f4de00b68fef17 Mon Sep 17 00:00:00 2001 From: Dylan Yudaken Date: Thu, 15 Dec 2022 10:41:38 -0800 Subject: [PATCH 26/70] UPSTREAM: io_uring: use call_rcu_hurry if signaling an eventfd io_uring uses call_rcu in the case it needs to signal an eventfd as a result of an eventfd signal, since recursing eventfd signals are not allowed. This should be calling the new call_rcu_hurry API to not delay the signal. Signed-off-by: Dylan Yudaken Cc: Joel Fernandes (Google) Cc: Paul E. McKenney Acked-by: Paul E. McKenney Reviewed-by: Joel Fernandes (Google) Link: https://lore.kernel.org/r/20221215184138.795576-1-dylany@meta.com Signed-off-by: Jens Axboe (cherry picked from commit 44a84da45272b3f4beb90025a64cfbde18f1aef0) Bug: 258241771 Signed-off-by: Joel Fernandes Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4909038 Reviewed-by: Vineeth Pillai Reviewed-by: Ross Zwisler Reviewed-by: Sean Paul Signed-off-by: Qais Yousef Change-Id: Iec189c9ce0a95ccacda81f58bf7d49a575a6ab3f --- io_uring/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index f413ebed81ab..24fb153158e6 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -536,7 +536,7 @@ static void io_eventfd_signal(struct io_ring_ctx *ctx) } else { atomic_inc(&ev_fd->refs); if (!atomic_fetch_or(BIT(IO_EVENTFD_OP_SIGNAL_BIT), &ev_fd->ops)) - call_rcu(&ev_fd->rcu, io_eventfd_ops); + call_rcu_hurry(&ev_fd->rcu, io_eventfd_ops); else atomic_dec(&ev_fd->refs); } From 72fdf7f60615d2ce928d6942923756e01c48a15f Mon Sep 17 00:00:00 2001 From: "Joel Fernandes (Google)" Date: Sun, 16 Oct 2022 16:22:58 +0000 Subject: [PATCH 27/70] UPSTREAM: percpu-refcount: Use call_rcu_hurry() for atomic switch Earlier commits in this series allow battery-powered systems to build their kernels with the default-disabled CONFIG_RCU_LAZY=y Kconfig option. This Kconfig option causes call_rcu() to delay its callbacks in order to batch callbacks. This means that a given RCU grace period covers more callbacks, thus reducing the number of grace periods, in turn reducing the amount of energy consumed, which increases battery lifetime which can be a very good thing. This is not a subtle effect: In some important use cases, the battery lifetime is increased by more than 10%. This CONFIG_RCU_LAZY=y option is available only for CPUs that offload callbacks, for example, CPUs mentioned in the rcu_nocbs kernel boot parameter passed to kernels built with CONFIG_RCU_NOCB_CPU=y. Delaying callbacks is normally not a problem because most callbacks do nothing but free memory. If the system is short on memory, a shrinker will kick all currently queued lazy callbacks out of their laziness, thus freeing their memory in short order. Similarly, the rcu_barrier() function, which blocks until all currently queued callbacks are invoked, will also kick lazy callbacks, thus enabling rcu_barrier() to complete in a timely manner. However, there are some cases where laziness is not a good option. For example, synchronize_rcu() invokes call_rcu(), and blocks until the newly queued callback is invoked. It would not be a good for synchronize_rcu() to block for ten seconds, even on an idle system. Therefore, synchronize_rcu() invokes call_rcu_hurry() instead of call_rcu(). The arrival of a non-lazy call_rcu_hurry() callback on a given CPU kicks any lazy callbacks that might be already queued on that CPU. After all, if there is going to be a grace period, all callbacks might as well get full benefit from it. Yes, this could be done the other way around by creating a call_rcu_lazy(), but earlier experience with this approach and feedback at the 2022 Linux Plumbers Conference shifted the approach to call_rcu() being lazy with call_rcu_hurry() for the few places where laziness is inappropriate. And another call_rcu() instance that cannot be lazy is the one on the percpu refcounter's "per-CPU to atomic switch" code path, which uses RCU when switching to atomic mode. The enqueued callback wakes up waiters waiting in the percpu_ref_switch_waitq. Allowing this callback to be lazy would result in unacceptable slowdowns for users of per-CPU refcounts, such as blk_pre_runtime_suspend(). Therefore, make __percpu_ref_switch_to_atomic() use call_rcu_hurry() in order to revert to the old behavior. [ paulmck: Apply s/call_rcu_flush/call_rcu_hurry/ feedback from Tejun Heo. ] Signed-off-by: Joel Fernandes (Google) Acked-by: Tejun Heo Signed-off-by: Paul E. McKenney Cc: Dennis Zhou Cc: Christoph Lameter Cc: (cherry picked from commit 343a72e5e37d380b70534fae3acd7e5e39adb769) Bug: 258241771 Signed-off-by: Joel Fernandes Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4909039 Reviewed-by: Sean Paul Reviewed-by: Vineeth Pillai Reviewed-by: Ross Zwisler Signed-off-by: Qais Yousef Change-Id: Icc325f69d0df1a37b6f1de02a284e1fabf20e366 --- lib/percpu-refcount.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/percpu-refcount.c b/lib/percpu-refcount.c index e5c5315da274..668f6aa6a75d 100644 --- a/lib/percpu-refcount.c +++ b/lib/percpu-refcount.c @@ -230,7 +230,8 @@ static void __percpu_ref_switch_to_atomic(struct percpu_ref *ref, percpu_ref_noop_confirm_switch; percpu_ref_get(ref); /* put after confirmation */ - call_rcu(&ref->data->rcu, percpu_ref_switch_to_atomic_rcu); + call_rcu_hurry(&ref->data->rcu, + percpu_ref_switch_to_atomic_rcu); } static void __percpu_ref_switch_to_percpu(struct percpu_ref *ref) From b9427245f0db1a846f3a62b36d13e7ef717df16c Mon Sep 17 00:00:00 2001 From: Uladzislau Rezki Date: Sun, 16 Oct 2022 16:23:03 +0000 Subject: [PATCH 28/70] UPSTREAM: workqueue: Make queue_rcu_work() use call_rcu_hurry() Earlier commits in this series allow battery-powered systems to build their kernels with the default-disabled CONFIG_RCU_LAZY=y Kconfig option. This Kconfig option causes call_rcu() to delay its callbacks in order to batch them. This means that a given RCU grace period covers more callbacks, thus reducing the number of grace periods, in turn reducing the amount of energy consumed, which increases battery lifetime which can be a very good thing. This is not a subtle effect: In some important use cases, the battery lifetime is increased by more than 10%. This CONFIG_RCU_LAZY=y option is available only for CPUs that offload callbacks, for example, CPUs mentioned in the rcu_nocbs kernel boot parameter passed to kernels built with CONFIG_RCU_NOCB_CPU=y. Delaying callbacks is normally not a problem because most callbacks do nothing but free memory. If the system is short on memory, a shrinker will kick all currently queued lazy callbacks out of their laziness, thus freeing their memory in short order. Similarly, the rcu_barrier() function, which blocks until all currently queued callbacks are invoked, will also kick lazy callbacks, thus enabling rcu_barrier() to complete in a timely manner. However, there are some cases where laziness is not a good option. For example, synchronize_rcu() invokes call_rcu(), and blocks until the newly queued callback is invoked. It would not be a good for synchronize_rcu() to block for ten seconds, even on an idle system. Therefore, synchronize_rcu() invokes call_rcu_hurry() instead of call_rcu(). The arrival of a non-lazy call_rcu_hurry() callback on a given CPU kicks any lazy callbacks that might be already queued on that CPU. After all, if there is going to be a grace period, all callbacks might as well get full benefit from it. Yes, this could be done the other way around by creating a call_rcu_lazy(), but earlier experience with this approach and feedback at the 2022 Linux Plumbers Conference shifted the approach to call_rcu() being lazy with call_rcu_hurry() for the few places where laziness is inappropriate. And another call_rcu() instance that cannot be lazy is the one in queue_rcu_work(), given that callers to queue_rcu_work() are not necessarily OK with long delays. Therefore, make queue_rcu_work() use call_rcu_hurry() in order to revert to the old behavior. [ paulmck: Apply s/call_rcu_flush/call_rcu_hurry/ feedback from Tejun Heo. ] Signed-off-by: Uladzislau Rezki Signed-off-by: Joel Fernandes (Google) Acked-by: Tejun Heo Cc: Lai Jiangshan Signed-off-by: Paul E. McKenney (cherry picked from commit a7e30c0e9a5f95b7f74e6272d9c75fd65c897721) Bug: 258241771 Signed-off-by: Joel Fernandes Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4909040 Reviewed-by: Sean Paul Reviewed-by: Ross Zwisler Reviewed-by: Vineeth Pillai Signed-off-by: Qais Yousef Change-Id: I1dd4cedd1fb02626fa47f88a7fbaa7cacfa95d11 --- kernel/workqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index eef7c0f893c3..dfe0d7c5eac1 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1781,7 +1781,7 @@ bool queue_rcu_work(struct workqueue_struct *wq, struct rcu_work *rwork) if (!test_and_set_bit(WORK_STRUCT_PENDING_BIT, work_data_bits(work))) { rwork->wq = wq; - call_rcu(&rwork->rcu, rcu_work_rcufn); + call_rcu_hurry(&rwork->rcu, rcu_work_rcufn); return true; } From 4316bd568bbff5570738ba3164ecf1542bc1e415 Mon Sep 17 00:00:00 2001 From: "Joel Fernandes (Google)" Date: Fri, 18 Nov 2022 19:19:08 +0000 Subject: [PATCH 29/70] UPSTREAM: net: Use call_rcu_hurry() for dst_release() In a networking test on ChromeOS, kernels built with the new CONFIG_RCU_LAZY=y Kconfig option fail a networking test in the teardown phase. This failure may be reproduced as follows: ip netns del The CONFIG_RCU_LAZY=y Kconfig option was introduced by earlier commits in this series for the benefit of certain battery-powered systems. This Kconfig option causes call_rcu() to delay its callbacks in order to batch them. This means that a given RCU grace period covers more callbacks, thus reducing the number of grace periods, in turn reducing the amount of energy consumed, which increases battery lifetime which can be a very good thing. This is not a subtle effect: In some important use cases, the battery lifetime is increased by more than 10%. This CONFIG_RCU_LAZY=y option is available only for CPUs that offload callbacks, for example, CPUs mentioned in the rcu_nocbs kernel boot parameter passed to kernels built with CONFIG_RCU_NOCB_CPU=y. Delaying callbacks is normally not a problem because most callbacks do nothing but free memory. If the system is short on memory, a shrinker will kick all currently queued lazy callbacks out of their laziness, thus freeing their memory in short order. Similarly, the rcu_barrier() function, which blocks until all currently queued callbacks are invoked, will also kick lazy callbacks, thus enabling rcu_barrier() to complete in a timely manner. However, there are some cases where laziness is not a good option. For example, synchronize_rcu() invokes call_rcu(), and blocks until the newly queued callback is invoked. It would not be a good for synchronize_rcu() to block for ten seconds, even on an idle system. Therefore, synchronize_rcu() invokes call_rcu_hurry() instead of call_rcu(). The arrival of a non-lazy call_rcu_hurry() callback on a given CPU kicks any lazy callbacks that might be already queued on that CPU. After all, if there is going to be a grace period, all callbacks might as well get full benefit from it. Yes, this could be done the other way around by creating a call_rcu_lazy(), but earlier experience with this approach and feedback at the 2022 Linux Plumbers Conference shifted the approach to call_rcu() being lazy with call_rcu_hurry() for the few places where laziness is inappropriate. Returning to the test failure, use of ftrace showed that this failure cause caused by the aadded delays due to this new lazy behavior of call_rcu() in kernels built with CONFIG_RCU_LAZY=y. Therefore, make dst_release() use call_rcu_hurry() in order to revert to the old test-failure-free behavior. [ paulmck: Apply s/call_rcu_flush/call_rcu_hurry/ feedback from Tejun Heo. ] Signed-off-by: Joel Fernandes (Google) Cc: David Ahern Cc: "David S. Miller" Cc: Hideaki YOSHIFUJI Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Reviewed-by: Eric Dumazet Signed-off-by: Paul E. McKenney (cherry picked from commit 483c26ff63f42e8898ed43aca0b9953bc91f0cd4) Bug: 258241771 Signed-off-by: Joel Fernandes Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4909041 Reviewed-by: Sean Paul Reviewed-by: Ross Zwisler Reviewed-by: Vineeth Pillai Signed-off-by: Qais Yousef Change-Id: Ifd64083bd210a9dfe94c179152f27d310c179507 --- net/core/dst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/dst.c b/net/core/dst.c index bc9c9be4e080..a4e738d321ba 100644 --- a/net/core/dst.c +++ b/net/core/dst.c @@ -174,7 +174,7 @@ void dst_release(struct dst_entry *dst) net_warn_ratelimited("%s: dst:%p refcnt:%d\n", __func__, dst, newrefcnt); if (!newrefcnt) - call_rcu(&dst->rcu_head, dst_destroy_rcu); + call_rcu_hurry(&dst->rcu_head, dst_destroy_rcu); } } EXPORT_SYMBOL(dst_release); From d07488d26e3c05a6d85a36596b227f740e2dfe29 Mon Sep 17 00:00:00 2001 From: "Joel Fernandes (Google)" Date: Thu, 12 Jan 2023 00:52:22 +0000 Subject: [PATCH 30/70] UPSTREAM: rcu: Track laziness during boot and suspend Boot and suspend/resume should not be slowed down in kernels built with CONFIG_RCU_LAZY=y. In particular, suspend can sometimes fail in such kernels. This commit therefore adds rcu_async_hurry(), rcu_async_relax(), and rcu_async_should_hurry() functions that track whether or not either a boot or a suspend/resume operation is in progress. This will enable a later commit to refrain from laziness during those times. Export rcu_async_should_hurry(), rcu_async_hurry(), and rcu_async_relax() for later use by rcutorture. [ paulmck: Apply feedback from Steve Rostedt. ] Fixes: 3cb278e73be5 ("rcu: Make call_rcu() lazy to save power") Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney (cherry picked from commit 6efdda8bec2900ce5166ee4ff4b1844b47b529cd) Bug: 258241771 Signed-off-by: Joel Fernandes Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4909178 Reviewed-by: Ross Zwisler Reviewed-by: Sean Paul Reviewed-by: Vineeth Pillai Signed-off-by: Qais Yousef Change-Id: Ieb2f2d484a33cfbd71f71c8e3dbcfc05cd7efe8c --- kernel/rcu/rcu.h | 6 ++++++ kernel/rcu/tree.c | 2 ++ kernel/rcu/update.c | 40 +++++++++++++++++++++++++++++++++++++++- 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/kernel/rcu/rcu.h b/kernel/rcu/rcu.h index 6b86c5912bea..b6756ff69041 100644 --- a/kernel/rcu/rcu.h +++ b/kernel/rcu/rcu.h @@ -443,14 +443,20 @@ do { \ /* Tiny RCU doesn't expedite, as its purpose in life is instead to be tiny. */ static inline bool rcu_gp_is_normal(void) { return true; } static inline bool rcu_gp_is_expedited(void) { return false; } +static inline bool rcu_async_should_hurry(void) { return false; } static inline void rcu_expedite_gp(void) { } static inline void rcu_unexpedite_gp(void) { } +static inline void rcu_async_hurry(void) { } +static inline void rcu_async_relax(void) { } static inline void rcu_request_urgent_qs_task(struct task_struct *t) { } #else /* #ifdef CONFIG_TINY_RCU */ bool rcu_gp_is_normal(void); /* Internal RCU use. */ bool rcu_gp_is_expedited(void); /* Internal RCU use. */ +bool rcu_async_should_hurry(void); /* Internal RCU use. */ void rcu_expedite_gp(void); void rcu_unexpedite_gp(void); +void rcu_async_hurry(void); +void rcu_async_relax(void); void rcupdate_announce_bootup_oddness(void); #ifdef CONFIG_TASKS_RCU_GENERIC void show_rcu_tasks_gp_kthreads(void); diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 855c035ec963..6151d3681e33 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -4435,11 +4435,13 @@ static int rcu_pm_notify(struct notifier_block *self, switch (action) { case PM_HIBERNATION_PREPARE: case PM_SUSPEND_PREPARE: + rcu_async_hurry(); rcu_expedite_gp(); break; case PM_POST_HIBERNATION: case PM_POST_SUSPEND: rcu_unexpedite_gp(); + rcu_async_relax(); break; default: break; diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c index 738842c4886b..d691c7bd55eb 100644 --- a/kernel/rcu/update.c +++ b/kernel/rcu/update.c @@ -144,8 +144,45 @@ bool rcu_gp_is_normal(void) } EXPORT_SYMBOL_GPL(rcu_gp_is_normal); -static atomic_t rcu_expedited_nesting = ATOMIC_INIT(1); +static atomic_t rcu_async_hurry_nesting = ATOMIC_INIT(1); +/* + * Should call_rcu() callbacks be processed with urgency or are + * they OK being executed with arbitrary delays? + */ +bool rcu_async_should_hurry(void) +{ + return !IS_ENABLED(CONFIG_RCU_LAZY) || + atomic_read(&rcu_async_hurry_nesting); +} +EXPORT_SYMBOL_GPL(rcu_async_should_hurry); +/** + * rcu_async_hurry - Make future async RCU callbacks not lazy. + * + * After a call to this function, future calls to call_rcu() + * will be processed in a timely fashion. + */ +void rcu_async_hurry(void) +{ + if (IS_ENABLED(CONFIG_RCU_LAZY)) + atomic_inc(&rcu_async_hurry_nesting); +} +EXPORT_SYMBOL_GPL(rcu_async_hurry); + +/** + * rcu_async_relax - Make future async RCU callbacks lazy. + * + * After a call to this function, future calls to call_rcu() + * will be processed in a lazy fashion. + */ +void rcu_async_relax(void) +{ + if (IS_ENABLED(CONFIG_RCU_LAZY)) + atomic_dec(&rcu_async_hurry_nesting); +} +EXPORT_SYMBOL_GPL(rcu_async_relax); + +static atomic_t rcu_expedited_nesting = ATOMIC_INIT(1); /* * Should normal grace-period primitives be expedited? Intended for * use within RCU. Note that this function takes the rcu_expedited @@ -195,6 +232,7 @@ static bool rcu_boot_ended __read_mostly; void rcu_end_inkernel_boot(void) { rcu_unexpedite_gp(); + rcu_async_relax(); if (rcu_normal_after_boot) WRITE_ONCE(rcu_normal, 1); rcu_boot_ended = true; From ffe09c06a8c6ad5b15f786f757ca14fb4083c53d Mon Sep 17 00:00:00 2001 From: "Joel Fernandes (Google)" Date: Thu, 12 Jan 2023 00:52:23 +0000 Subject: [PATCH 31/70] UPSTREAM: rcu: Disable laziness if lazy-tracking says so During suspend, we see failures to suspend 1 in 300-500 suspends. Looking closer, it appears that asynchronous RCU callbacks are being queued as lazy even though synchronous callbacks are expedited. These delays appear to not be very welcome by the suspend/resume code as evidenced by these occasional suspend failures. This commit modifies call_rcu() to check if rcu_async_should_hurry(), which will return true if we are in suspend or in-kernel boot. [ paulmck: Alphabetize local variables. ] Ignoring the lazy hint makes the 3000 suspend/resume cycles pass reliably on a 12th gen 12-core Intel CPU, and there is some evidence that it also slightly speeds up boot performance. Fixes: 3cb278e73be5 ("rcu: Make call_rcu() lazy to save power") Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney (cherry picked from commit cf7066b97e27b2319af1ae2ef6889c4a1704312d) Bug: 258241771 Signed-off-by: Joel Fernandes Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4909179 Reviewed-by: Vineeth Pillai Reviewed-by: Ross Zwisler Reviewed-by: Sean Paul Signed-off-by: Qais Yousef Change-Id: I4cfe6f43de8bae9a6c034831c79d9773199d6d29 --- kernel/rcu/tree.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 6151d3681e33..e1d4bde8672e 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -2732,10 +2732,11 @@ static void check_cb_ovld(struct rcu_data *rdp) } static void -__call_rcu_common(struct rcu_head *head, rcu_callback_t func, bool lazy) +__call_rcu_common(struct rcu_head *head, rcu_callback_t func, bool lazy_in) { static atomic_t doublefrees; unsigned long flags; + bool lazy; struct rcu_data *rdp; bool was_alldone; @@ -2760,6 +2761,7 @@ __call_rcu_common(struct rcu_head *head, rcu_callback_t func, bool lazy) kasan_record_aux_stack_noalloc(head); local_irq_save(flags); rdp = this_cpu_ptr(&rcu_data); + lazy = lazy_in && !rcu_async_should_hurry(); /* Add the callback to our list. */ if (unlikely(!rcu_segcblist_is_enabled(&rdp->cblist))) { From a079cc587655066963223bda9661c71037fc8f88 Mon Sep 17 00:00:00 2001 From: "Joel Fernandes (Google)" Date: Fri, 3 Mar 2023 21:38:51 +0000 Subject: [PATCH 32/70] ANDROID: rcu: Add a minimum time for marking boot as completed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On many systems, a great deal of boot (in userspace) happens after the kernel thinks the boot has completed. It is difficult to determine if the system has really booted from the kernel side. Some features like lazy-RCU can risk slowing down boot time if, say, a callback has been added that the boot synchronously depends on. Further expedited callbacks can get unexpedited way earlier than it should be, thus slowing down boot (as shown in the data below). For these reasons, this commit adds a config option 'CONFIG_RCU_BOOT_END_DELAY' and a boot parameter rcupdate.boot_end_delay. Userspace can also make RCU's view of the system as booted, by writing the time in milliseconds to: /sys/module/rcupdate/parameters/rcu_boot_end_delay Or even just writing a value of 0 to this sysfs node. However, under no circumstance will the boot be allowed to end earlier than just before init is launched. The default value of CONFIG_RCU_BOOT_END_DELAY is chosen as 15s. This suites ChromeOS and also a PREEMPT_RT system below very well, which need no config or parameter changes, and just a simple application of this patch. A system designer can also choose a specific value here to keep RCU from marking boot completion. As noted earlier, RCU's perspective of the system as booted will not be marker until at least rcu_boot_end_delay milliseconds have passed or an update is made via writing a small value (or 0) in milliseconds to: /sys/module/rcupdate/parameters/rcu_boot_end_delay. One side-effect of this patch is, there is a risk that a real-time workload launched just after the kernel boots will suffer interruptions due to expedited RCU, which previous ended just before init was launched. However, to mitigate such an issue (however unlikely), the user should either tune CONFIG_RCU_BOOT_END_DELAY to a smaller value than 15 seconds or write a value of 0 to /sys/module/rcupdate/parameters/rcu_boot_end_delay, once userspace boots, and before launching the real-time workload. Qiuxu also noted impressive boot-time improvements with earlier version of patch. An excerpt from the data he shared: 1) Testing environment: OS : CentOS Stream 8 (non-RT OS) Kernel : v6.2 Machine : Intel Cascade Lake server (2 sockets, each with 44 logical threads) Qemu args : -cpu host -enable-kvm, -smp 88,threads=2,sockets=2, … 2) OS boot time definition: The time from the start of the kernel boot to the shell command line prompt is shown from the console. [ Different people may have different OS boot time definitions. ] 3) Measurement method (very rough method): A timer in the kernel periodically prints the boot time every 100ms. As soon as the shell command line prompt is shown from the console, we record the boot time printed by the timer, then the printed boot time is the OS boot time. 4) Measured OS boot time (in seconds) a) Measured 10 times w/o this patch: 8.7s, 8.4s, 8.6s, 8.2s, 9.0s, 8.7s, 8.8s, 9.3s, 8.8s, 8.3s The average OS boot time was: ~8.7s b) Measure 10 times w/ this patch: 8.5s, 8.2s, 7.6s, 8.2s, 8.7s, 8.2s, 7.8s, 8.2s, 9.3s, 8.4s The average OS boot time was: ~8.3s. (CHROMIUM tag rationale: Submitted upstream but got lots of pushback as it may harm a PREEMPT_RT system -- the concern is VERY theoretical and this improves things for ChromeOS. Plus we are not a PREEMPT_RT system. So I am strongly suggesting this mostly simple change for ChromeOS.) Bug: 258241771 Tested-by: Qiuxu Zhuo Signed-off-by: Joel Fernandes (Google) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4350228 Commit-Queue: Joel Fernandes Commit-Queue: Vineeth Pillai Tested-by: Vineeth Pillai Tested-by: Joel Fernandes Reviewed-by: Vineeth Pillai Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4909180 Signed-off-by: Qais Yousef Change-Id: Ibd262189d7f92dbcc57f1508efe90fcfba95a6cc --- .../admin-guide/kernel-parameters.txt | 15 ++++ kernel/rcu/Kconfig | 21 ++++++ kernel/rcu/update.c | 75 ++++++++++++++++++- 3 files changed, 109 insertions(+), 2 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 8ac0b91b4d85..cba404efdd39 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -5130,6 +5130,21 @@ rcutorture.verbose= [KNL] Enable additional printk() statements. + rcupdate.rcu_boot_end_delay= [KNL] + Minimum time in milliseconds from the start of boot + that must elapse before the boot sequence can be marked + complete from RCU's perspective, after which RCU's + behavior becomes more relaxed. The default value is also + configurable via CONFIG_RCU_BOOT_END_DELAY. + Userspace can also mark the boot as completed + sooner by writing the time in milliseconds, say once + userspace considers the system as booted, to: + /sys/module/rcupdate/parameters/rcu_boot_end_delay + Or even just writing a value of 0 to this sysfs node. + The sysfs node can also be used to extend the delay + to be larger than the default, assuming the marking + of boot complete has not yet occurred. + rcupdate.rcu_cpu_stall_ftrace_dump= [KNL] Dump ftrace buffer after reporting RCU CPU stall warning. diff --git a/kernel/rcu/Kconfig b/kernel/rcu/Kconfig index d78f6181c8aa..446e827b079e 100644 --- a/kernel/rcu/Kconfig +++ b/kernel/rcu/Kconfig @@ -319,4 +319,25 @@ config RCU_LAZY To save power, batch RCU callbacks and flush after delay, memory pressure, or callback list growing too big. +config RCU_BOOT_END_DELAY + int "Minimum time before RCU may consider in-kernel boot as completed" + range 0 120000 + default 20000 + help + Default value of the minimum time in milliseconds from the start of boot + that must elapse before the boot sequence can be marked complete from RCU's + perspective, after which RCU's behavior becomes more relaxed. + Userspace can also mark the boot as completed sooner than this default + by writing the time in milliseconds, say once userspace considers + the system as booted, to: /sys/module/rcupdate/parameters/rcu_boot_end_delay. + Or even just writing a value of 0 to this sysfs node. The sysfs node can + also be used to extend the delay to be larger than the default, assuming + the marking of boot completion has not yet occurred. + + The actual delay for RCU's view of the system to be marked as booted can be + higher than this value if the kernel takes a long time to initialize but it + will never be smaller than this value. + + Accept the default if unsure. + endmenu # "RCU Subsystem" diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c index d691c7bd55eb..0e2efb947d5d 100644 --- a/kernel/rcu/update.c +++ b/kernel/rcu/update.c @@ -43,6 +43,7 @@ #include #include #include +#include #define CREATE_TRACE_POINTS @@ -224,13 +225,50 @@ void rcu_unexpedite_gp(void) } EXPORT_SYMBOL_GPL(rcu_unexpedite_gp); +/* + * Minimum time in milliseconds from the start boot until RCU can consider + * in-kernel boot as completed. This can also be tuned at runtime to end the + * boot earlier, by userspace init code writing the time in milliseconds (even + * 0) to: /sys/module/rcupdate/parameters/rcu_boot_end_delay. The sysfs node + * can also be used to extend the delay to be larger than the default, assuming + * the marking of boot complete has not yet occurred. + */ +static int rcu_boot_end_delay = CONFIG_RCU_BOOT_END_DELAY; + static bool rcu_boot_ended __read_mostly; +static bool rcu_boot_end_called __read_mostly; +static DEFINE_MUTEX(rcu_boot_end_lock); /* - * Inform RCU of the end of the in-kernel boot sequence. + * Inform RCU of the end of the in-kernel boot sequence. The boot sequence will + * not be marked ended until at least rcu_boot_end_delay milliseconds have passed. */ -void rcu_end_inkernel_boot(void) +void rcu_end_inkernel_boot(void); +static void rcu_boot_end_work_fn(struct work_struct *work) { + rcu_end_inkernel_boot(); +} +static DECLARE_DELAYED_WORK(rcu_boot_end_work, rcu_boot_end_work_fn); + +/* Must be called with rcu_boot_end_lock held. */ +static void rcu_end_inkernel_boot_locked(void) +{ + rcu_boot_end_called = true; + + if (rcu_boot_ended) + return; + + if (rcu_boot_end_delay) { + u64 boot_ms = div_u64(ktime_get_boot_fast_ns(), 1000000UL); + + if (boot_ms < rcu_boot_end_delay) { + schedule_delayed_work(&rcu_boot_end_work, + msecs_to_jiffies(rcu_boot_end_delay - boot_ms)); + return; + } + } + + cancel_delayed_work(&rcu_boot_end_work); rcu_unexpedite_gp(); rcu_async_relax(); if (rcu_normal_after_boot) @@ -238,6 +276,39 @@ void rcu_end_inkernel_boot(void) rcu_boot_ended = true; } +void rcu_end_inkernel_boot(void) +{ + mutex_lock(&rcu_boot_end_lock); + rcu_end_inkernel_boot_locked(); + mutex_unlock(&rcu_boot_end_lock); +} + +static int param_set_rcu_boot_end(const char *val, const struct kernel_param *kp) +{ + uint end_ms; + int ret = kstrtouint(val, 0, &end_ms); + + if (ret) + return ret; + /* + * rcu_end_inkernel_boot() should be called at least once during init + * before we can allow param changes to end the boot. + */ + mutex_lock(&rcu_boot_end_lock); + rcu_boot_end_delay = end_ms; + if (!rcu_boot_ended && rcu_boot_end_called) { + rcu_end_inkernel_boot_locked(); + } + mutex_unlock(&rcu_boot_end_lock); + return ret; +} + +static const struct kernel_param_ops rcu_boot_end_ops = { + .set = param_set_rcu_boot_end, + .get = param_get_uint, +}; +module_param_cb(rcu_boot_end_delay, &rcu_boot_end_ops, &rcu_boot_end_delay, 0644); + /* * Let rcutorture know when it is OK to turn it up to eleven. */ From 90d68cedd1d698b5ec8858dfd100e742e9dd6617 Mon Sep 17 00:00:00 2001 From: Qais Yousef Date: Sun, 3 Dec 2023 01:12:52 +0000 Subject: [PATCH 33/70] FROMLIST: rcu: Provide a boot time parameter to control lazy RCU To allow more flexible arrangements while still provide a single kernel for distros, provide a boot time parameter to enable/disable lazy RCU. Specify: rcutree.enable_rcu_lazy=[y|1|n|0] Which also requires rcu_nocbs=all at boot time to enable/disable lazy RCU. To disable it by default at build time when CONFIG_RCU_LAZY=y, the new CONFIG_RCU_LAZY_DEFAULT_OFF can be used. Bug: 258241771 Signed-off-by: Qais Yousef (Google) Tested-by: Andrea Righi Signed-off-by: Paul E. McKenney Link: https://lore.kernel.org/lkml/20231203011252.233748-1-qyousef@layalina.io/ [Fix trivial conflicts rejecting newer code that doesn't exist on 6.1] Signed-off-by: Qais Yousef Change-Id: Ib5585ae717a2ba7749f2802101b785c4e5de8a90 --- Documentation/admin-guide/kernel-parameters.txt | 5 +++++ kernel/rcu/Kconfig | 12 ++++++++++++ kernel/rcu/tree.c | 7 ++++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index cba404efdd39..8c2dfe8b36e8 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -4882,6 +4882,11 @@ rcu_node tree with an eye towards determining why a new grace period has not yet started. + rcutree.enable_rcu_lazy= [KNL] + To save power, batch RCU callbacks and flush after + delay, memory pressure or callback list growing too + big. + rcuscale.gp_async= [KNL] Measure performance of asynchronous grace-period primitives such as call_rcu(). diff --git a/kernel/rcu/Kconfig b/kernel/rcu/Kconfig index 446e827b079e..5ce3a8c258f3 100644 --- a/kernel/rcu/Kconfig +++ b/kernel/rcu/Kconfig @@ -318,6 +318,18 @@ config RCU_LAZY help To save power, batch RCU callbacks and flush after delay, memory pressure, or callback list growing too big. + Requires rcu_nocbs=all to be set. + + Use rcutree.enable_rcu_lazy=0 to turn it off at boot time. + +config RCU_LAZY_DEFAULT_OFF + bool "Turn RCU lazy invocation off by default" + depends on RCU_LAZY + default n + help + Allows building the kernel with CONFIG_RCU_LAZY=y yet keep it default + off. Boot time param rcutree.enable_rcu_lazy=1 can be used to switch + it back on. config RCU_BOOT_END_DELAY int "Minimum time before RCU may consider in-kernel boot as completed" diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index e1d4bde8672e..949c85870a0b 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -2799,6 +2799,9 @@ __call_rcu_common(struct rcu_head *head, rcu_callback_t func, bool lazy_in) } #ifdef CONFIG_RCU_LAZY +static bool enable_rcu_lazy __read_mostly = !IS_ENABLED(CONFIG_RCU_LAZY_DEFAULT_OFF); +module_param(enable_rcu_lazy, bool, 0444); + /** * call_rcu_hurry() - Queue RCU callback for invocation after grace period, and * flush all lazy callbacks (including the new one) to the main ->cblist while @@ -2824,6 +2827,8 @@ void call_rcu_hurry(struct rcu_head *head, rcu_callback_t func) return __call_rcu_common(head, func, false); } EXPORT_SYMBOL_GPL(call_rcu_hurry); +#else +#define enable_rcu_lazy false #endif /** @@ -2872,7 +2877,7 @@ EXPORT_SYMBOL_GPL(call_rcu_hurry); */ void call_rcu(struct rcu_head *head, rcu_callback_t func) { - return __call_rcu_common(head, func, IS_ENABLED(CONFIG_RCU_LAZY)); + __call_rcu_common(head, func, enable_rcu_lazy); } EXPORT_SYMBOL_GPL(call_rcu); From d97ea6529606de8f0019203c67ed78a73a31b5d7 Mon Sep 17 00:00:00 2001 From: Qais Yousef Date: Tue, 23 May 2023 19:22:19 +0000 Subject: [PATCH 34/70] ANDROID: Enable CONFIG_LAZY_RCU in arm64 gki_defconfig It is still disabled by default. Must specify rcutree.android_enable_rcu_lazy and rcu_nocbs=all in boot time parameter to actually enable it. Bug: 258241771 Change-Id: I11c920aa5edde2fc42ab54245cd198eb8cb47616 Signed-off-by: Qais Yousef --- arch/arm64/configs/gki_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/configs/gki_defconfig b/arch/arm64/configs/gki_defconfig index 009675466150..a3cf4c25c400 100644 --- a/arch/arm64/configs/gki_defconfig +++ b/arch/arm64/configs/gki_defconfig @@ -15,6 +15,8 @@ CONFIG_PSI=y CONFIG_RCU_EXPERT=y CONFIG_RCU_BOOST=y CONFIG_RCU_NOCB_CPU=y +CONFIG_RCU_LAZY=y +CONFIG_RCU_LAZY_DEFAULT_OFF=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_IKHEADERS=m From 6b4c816d17ba2c59dec517ed20d3f954d1027a8b Mon Sep 17 00:00:00 2001 From: Carlos Galo Date: Thu, 11 Jan 2024 21:05:30 +0000 Subject: [PATCH 35/70] FROMGIT: BACKPORT: mm: update mark_victim tracepoints fields The current implementation of the mark_victim tracepoint provides only the process ID (pid) of the victim process. This limitation poses challenges for userspace tools that need additional information about the OOM victim. The association between pid and the additional data may be lost after the kill, making it difficult for userspace to correlate the OOM event with the specific process. In order to mitigate this limitation, add the following fields: - UID In Android each installed application has a unique UID. Including the `uid` assists in correlating OOM events with specific apps. - Process Name (comm) Enables identification of the affected process. - OOM Score Allows userspace to get additional insights of the relative kill priority of the OOM victim. Link: https://lkml.kernel.org/r/20240111210539.636607-1-carlosgalo@google.com Change-Id: Icc3ed013a9dfff9bb09f1d7588757e6028c17069 Signed-off-by: Carlos Galo Cc: Steven Rostedt Cc: Suren Baghdasaryan Signed-off-by: Andrew Morton (cherry picked from commit 649ffb4cbb90a7f60f17dd74e57d814e762ea01d mm-unstable) [ carlosgalo: Manually added struct cred change in mark_oom_victim function ] Bug: 315560026 Change-Id: I81fb6f3447f432100ad4cd25e22db23768003388 Signed-off-by: Carlos Galo --- include/trace/events/oom.h | 19 +++++++++++++++---- mm/oom_kill.c | 7 ++++++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/include/trace/events/oom.h b/include/trace/events/oom.h index 26a11e4a2c36..3c5941da8075 100644 --- a/include/trace/events/oom.h +++ b/include/trace/events/oom.h @@ -72,19 +72,30 @@ TRACE_EVENT(reclaim_retry_zone, ); TRACE_EVENT(mark_victim, - TP_PROTO(int pid), + TP_PROTO(struct task_struct *task, uid_t uid), - TP_ARGS(pid), + TP_ARGS(task, uid), TP_STRUCT__entry( __field(int, pid) + __field(uid_t, uid) + __string(comm, task->comm) + __field(short, oom_score_adj) ), TP_fast_assign( - __entry->pid = pid; + __entry->pid = task->pid; + __entry->uid = uid; + __assign_str(comm, task->comm); + __entry->oom_score_adj = task->signal->oom_score_adj; ), - TP_printk("pid=%d", __entry->pid) + TP_printk("pid=%d uid=%u comm=%s oom_score_adj=%hd", + __entry->pid, + __entry->uid, + __get_str(comm), + __entry->oom_score_adj + ) ); TRACE_EVENT(wake_reaper, diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 76a1954071e1..6bb096462170 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include "internal.h" @@ -771,6 +772,8 @@ static void __mark_oom_victim(struct task_struct *tsk) */ static void mark_oom_victim(struct task_struct *tsk) { + const struct cred *cred; + WARN_ON(oom_killer_disabled); /* OOM killer might race with memcg OOM */ if (test_and_set_tsk_thread_flag(tsk, TIF_MEMDIE)) @@ -787,7 +790,9 @@ static void mark_oom_victim(struct task_struct *tsk) */ __thaw_task(tsk); atomic_inc(&oom_victims); - trace_mark_victim(tsk->pid); + cred = get_task_cred(tsk); + trace_mark_victim(tsk, cred->uid.val); + put_cred(cred); } /** From e4b0e14f83940cdc6cd141df475d1147f064b575 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Wed, 27 Dec 2023 21:37:02 +0100 Subject: [PATCH 36/70] UPSTREAM: async: Split async_schedule_node_domain() In preparation for subsequent changes, split async_schedule_node_domain() in two pieces so as to allow the bottom part of it to be called from a somewhat different code path. No functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Stanislaw Gruszka Tested-by: Youngmin Nam Reviewed-by: Ulf Hansson Bug: 319759660 Change-Id: I6405b388d9a0286208b48f7a321b0042d85abb4b (cherry picked from commit 6aa09a5bccd8e224d917afdb4c278fc66aacde4d) Signed-off-by: Youngmin Nam --- kernel/async.c | 56 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/kernel/async.c b/kernel/async.c index b2c4ba5686ee..cffe6b4cff9f 100644 --- a/kernel/async.c +++ b/kernel/async.c @@ -145,6 +145,39 @@ static void async_run_entry_fn(struct work_struct *work) wake_up(&async_done); } +static async_cookie_t __async_schedule_node_domain(async_func_t func, + void *data, int node, + struct async_domain *domain, + struct async_entry *entry) +{ + async_cookie_t newcookie; + unsigned long flags; + + INIT_LIST_HEAD(&entry->domain_list); + INIT_LIST_HEAD(&entry->global_list); + INIT_WORK(&entry->work, async_run_entry_fn); + entry->func = func; + entry->data = data; + entry->domain = domain; + + spin_lock_irqsave(&async_lock, flags); + + /* allocate cookie and queue */ + newcookie = entry->cookie = next_cookie++; + + list_add_tail(&entry->domain_list, &domain->pending); + if (domain->registered) + list_add_tail(&entry->global_list, &async_global_pending); + + atomic_inc(&entry_count); + spin_unlock_irqrestore(&async_lock, flags); + + /* schedule for execution */ + queue_work_node(node, system_unbound_wq, &entry->work); + + return newcookie; +} + /** * async_schedule_node_domain - NUMA specific version of async_schedule_domain * @func: function to execute asynchronously @@ -186,29 +219,8 @@ async_cookie_t async_schedule_node_domain(async_func_t func, void *data, func(data, newcookie); return newcookie; } - INIT_LIST_HEAD(&entry->domain_list); - INIT_LIST_HEAD(&entry->global_list); - INIT_WORK(&entry->work, async_run_entry_fn); - entry->func = func; - entry->data = data; - entry->domain = domain; - spin_lock_irqsave(&async_lock, flags); - - /* allocate cookie and queue */ - newcookie = entry->cookie = next_cookie++; - - list_add_tail(&entry->domain_list, &domain->pending); - if (domain->registered) - list_add_tail(&entry->global_list, &async_global_pending); - - atomic_inc(&entry_count); - spin_unlock_irqrestore(&async_lock, flags); - - /* schedule for execution */ - queue_work_node(node, system_unbound_wq, &entry->work); - - return newcookie; + return __async_schedule_node_domain(func, data, node, domain, entry); } EXPORT_SYMBOL_GPL(async_schedule_node_domain); From e1a20dd9ff6329bfafcc8151cccb3c2d01e01abf Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Wed, 27 Dec 2023 21:38:23 +0100 Subject: [PATCH 37/70] UPSTREAM: async: Introduce async_schedule_dev_nocall() In preparation for subsequent changes, introduce a specialized variant of async_schedule_dev() that will not invoke the argument function synchronously when it cannot be scheduled for asynchronous execution. The new function, async_schedule_dev_nocall(), will be used for fixing possible deadlocks in the system-wide power management core code. Signed-off-by: Rafael J. Wysocki Reviewed-by: Stanislaw Gruszka for the series. Tested-by: Youngmin Nam Reviewed-by: Ulf Hansson Bug: 319759660 Change-Id: I497f1a9655d80c2d9710c3c814f6a99a31bcf019 (cherry picked from commit 7d4b5d7a37bdd63a5a3371b988744b060d5bb86f) Signed-off-by: Youngmin Nam --- include/linux/async.h | 2 ++ kernel/async.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/include/linux/async.h b/include/linux/async.h index cce4ad31e8fc..33c9ff4afb49 100644 --- a/include/linux/async.h +++ b/include/linux/async.h @@ -90,6 +90,8 @@ async_schedule_dev(async_func_t func, struct device *dev) return async_schedule_node(func, dev, dev_to_node(dev)); } +bool async_schedule_dev_nocall(async_func_t func, struct device *dev); + /** * async_schedule_dev_domain - A device specific version of async_schedule_domain * @func: function to execute asynchronously diff --git a/kernel/async.c b/kernel/async.c index cffe6b4cff9f..673bba6bdf3a 100644 --- a/kernel/async.c +++ b/kernel/async.c @@ -243,6 +243,35 @@ async_cookie_t async_schedule_node(async_func_t func, void *data, int node) } EXPORT_SYMBOL_GPL(async_schedule_node); +/** + * async_schedule_dev_nocall - A simplified variant of async_schedule_dev() + * @func: function to execute asynchronously + * @dev: device argument to be passed to function + * + * @dev is used as both the argument for the function and to provide NUMA + * context for where to run the function. + * + * If the asynchronous execution of @func is scheduled successfully, return + * true. Otherwise, do nothing and return false, unlike async_schedule_dev() + * that will run the function synchronously then. + */ +bool async_schedule_dev_nocall(async_func_t func, struct device *dev) +{ + struct async_entry *entry; + + entry = kzalloc(sizeof(struct async_entry), GFP_KERNEL); + + /* Give up if there is no memory or too much work. */ + if (!entry || atomic_read(&entry_count) > MAX_WORK) { + kfree(entry); + return false; + } + + __async_schedule_node_domain(func, dev, dev_to_node(dev), + &async_dfl_domain, entry); + return true; +} + /** * async_synchronize_full - synchronize all asynchronous function calls * From 7eedea7abfe900b1fe476324a10bd95ea60a8e8b Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Wed, 27 Dec 2023 21:41:06 +0100 Subject: [PATCH 38/70] BACKPORT: PM: sleep: Fix possible deadlocks in core system-wide PM code It is reported that in low-memory situations the system-wide resume core code deadlocks, because async_schedule_dev() executes its argument function synchronously if it cannot allocate memory (and not only in that case) and that function attempts to acquire a mutex that is already held. Executing the argument function synchronously from within dpm_async_fn() may also be problematic for ordering reasons (it may cause a consumer device's resume callback to be invoked before a requisite supplier device's one, for example). Address this by changing the code in question to use async_schedule_dev_nocall() for scheduling the asynchronous execution of device suspend and resume functions and to directly run them synchronously if async_schedule_dev_nocall() returns false. Link: https://lore.kernel.org/linux-pm/ZYvjiqX6EsL15moe@perf/ Reported-by: Youngmin Nam Signed-off-by: Rafael J. Wysocki Reviewed-by: Stanislaw Gruszka Tested-by: Youngmin Nam Reviewed-by: Ulf Hansson Cc: 5.7+ # 5.7+: 6aa09a5bccd8 async: Split async_schedule_node_domain() Cc: 5.7+ # 5.7+: 7d4b5d7a37bd async: Introduce async_schedule_dev_nocall() Cc: 5.7+ # 5.7+ Bug: 319759660 Change-Id: I1164a6a0b9899ab2f01d5efb413827b9d0983d98 (cherry picked from commit 7839d0078e0d5e6cc2fa0b0dfbee71de74f1e557) [Youngmin: Resolved minor conflict in drivers/base/power/main.c] Signed-off-by: Youngmin Nam --- drivers/base/power/main.c | 148 ++++++++++++++++++-------------------- 1 file changed, 68 insertions(+), 80 deletions(-) diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 69a485fff42e..819d9110a458 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -580,7 +580,7 @@ bool dev_pm_skip_resume(struct device *dev) } /** - * device_resume_noirq - Execute a "noirq resume" callback for given device. + * __device_resume_noirq - Execute a "noirq resume" callback for given device. * @dev: Device to handle. * @state: PM transition of the system being carried out. * @async: If true, the device is being resumed asynchronously. @@ -588,7 +588,7 @@ bool dev_pm_skip_resume(struct device *dev) * The driver of @dev will not receive interrupts while this function is being * executed. */ -static int device_resume_noirq(struct device *dev, pm_message_t state, bool async) +static void __device_resume_noirq(struct device *dev, pm_message_t state, bool async) { pm_callback_t callback = NULL; const char *info = NULL; @@ -656,7 +656,13 @@ Skip: Out: complete_all(&dev->power.completion); TRACE_RESUME(error); - return error; + + if (error) { + suspend_stats.failed_resume_noirq++; + dpm_save_failed_step(SUSPEND_RESUME_NOIRQ); + dpm_save_failed_dev(dev_name(dev)); + pm_dev_err(dev, state, async ? " async noirq" : " noirq", error); + } } static bool is_async(struct device *dev) @@ -669,11 +675,15 @@ static bool dpm_async_fn(struct device *dev, async_func_t func) { reinit_completion(&dev->power.completion); - if (is_async(dev)) { - get_device(dev); - async_schedule_dev(func, dev); + if (!is_async(dev)) + return false; + + get_device(dev); + + if (async_schedule_dev_nocall(func, dev)) return true; - } + + put_device(dev); return false; } @@ -681,15 +691,19 @@ static bool dpm_async_fn(struct device *dev, async_func_t func) static void async_resume_noirq(void *data, async_cookie_t cookie) { struct device *dev = (struct device *)data; - int error; - - error = device_resume_noirq(dev, pm_transition, true); - if (error) - pm_dev_err(dev, pm_transition, " async", error); + __device_resume_noirq(dev, pm_transition, true); put_device(dev); } +static void device_resume_noirq(struct device *dev) +{ + if (dpm_async_fn(dev, async_resume_noirq)) + return; + + __device_resume_noirq(dev, pm_transition, false); +} + static void dpm_noirq_resume_devices(pm_message_t state) { struct device *dev; @@ -699,14 +713,6 @@ static void dpm_noirq_resume_devices(pm_message_t state) mutex_lock(&dpm_list_mtx); pm_transition = state; - /* - * Advanced the async threads upfront, - * in case the starting of async threads is - * delayed by non-async resuming devices. - */ - list_for_each_entry(dev, &dpm_noirq_list, power.entry) - dpm_async_fn(dev, async_resume_noirq); - while (!list_empty(&dpm_noirq_list)) { dev = to_device(dpm_noirq_list.next); get_device(dev); @@ -714,17 +720,7 @@ static void dpm_noirq_resume_devices(pm_message_t state) mutex_unlock(&dpm_list_mtx); - if (!is_async(dev)) { - int error; - - error = device_resume_noirq(dev, state, false); - if (error) { - suspend_stats.failed_resume_noirq++; - dpm_save_failed_step(SUSPEND_RESUME_NOIRQ); - dpm_save_failed_dev(dev_name(dev)); - pm_dev_err(dev, state, " noirq", error); - } - } + device_resume_noirq(dev); put_device(dev); @@ -752,14 +748,14 @@ void dpm_resume_noirq(pm_message_t state) } /** - * device_resume_early - Execute an "early resume" callback for given device. + * __device_resume_early - Execute an "early resume" callback for given device. * @dev: Device to handle. * @state: PM transition of the system being carried out. * @async: If true, the device is being resumed asynchronously. * * Runtime PM is disabled for @dev while this function is being executed. */ -static int device_resume_early(struct device *dev, pm_message_t state, bool async) +static void __device_resume_early(struct device *dev, pm_message_t state, bool async) { pm_callback_t callback = NULL; const char *info = NULL; @@ -812,21 +808,31 @@ Out: pm_runtime_enable(dev); complete_all(&dev->power.completion); - return error; + + if (error) { + suspend_stats.failed_resume_early++; + dpm_save_failed_step(SUSPEND_RESUME_EARLY); + dpm_save_failed_dev(dev_name(dev)); + pm_dev_err(dev, state, async ? " async early" : " early", error); + } } static void async_resume_early(void *data, async_cookie_t cookie) { struct device *dev = (struct device *)data; - int error; - - error = device_resume_early(dev, pm_transition, true); - if (error) - pm_dev_err(dev, pm_transition, " async", error); + __device_resume_early(dev, pm_transition, true); put_device(dev); } +static void device_resume_early(struct device *dev) +{ + if (dpm_async_fn(dev, async_resume_early)) + return; + + __device_resume_early(dev, pm_transition, false); +} + /** * dpm_resume_early - Execute "early resume" callbacks for all devices. * @state: PM transition of the system being carried out. @@ -840,14 +846,6 @@ void dpm_resume_early(pm_message_t state) mutex_lock(&dpm_list_mtx); pm_transition = state; - /* - * Advanced the async threads upfront, - * in case the starting of async threads is - * delayed by non-async resuming devices. - */ - list_for_each_entry(dev, &dpm_late_early_list, power.entry) - dpm_async_fn(dev, async_resume_early); - while (!list_empty(&dpm_late_early_list)) { dev = to_device(dpm_late_early_list.next); get_device(dev); @@ -855,17 +853,7 @@ void dpm_resume_early(pm_message_t state) mutex_unlock(&dpm_list_mtx); - if (!is_async(dev)) { - int error; - - error = device_resume_early(dev, state, false); - if (error) { - suspend_stats.failed_resume_early++; - dpm_save_failed_step(SUSPEND_RESUME_EARLY); - dpm_save_failed_dev(dev_name(dev)); - pm_dev_err(dev, state, " early", error); - } - } + device_resume_early(dev); put_device(dev); @@ -889,12 +877,12 @@ void dpm_resume_start(pm_message_t state) EXPORT_SYMBOL_GPL(dpm_resume_start); /** - * device_resume - Execute "resume" callbacks for given device. + * __device_resume - Execute "resume" callbacks for given device. * @dev: Device to handle. * @state: PM transition of the system being carried out. * @async: If true, the device is being resumed asynchronously. */ -static int device_resume(struct device *dev, pm_message_t state, bool async) +static void __device_resume(struct device *dev, pm_message_t state, bool async) { pm_callback_t callback = NULL; const char *info = NULL; @@ -976,20 +964,30 @@ static int device_resume(struct device *dev, pm_message_t state, bool async) TRACE_RESUME(error); - return error; + if (error) { + suspend_stats.failed_resume++; + dpm_save_failed_step(SUSPEND_RESUME); + dpm_save_failed_dev(dev_name(dev)); + pm_dev_err(dev, state, async ? " async" : "", error); + } } static void async_resume(void *data, async_cookie_t cookie) { struct device *dev = (struct device *)data; - int error; - error = device_resume(dev, pm_transition, true); - if (error) - pm_dev_err(dev, pm_transition, " async", error); + __device_resume(dev, pm_transition, true); put_device(dev); } +static void device_resume(struct device *dev) +{ + if (dpm_async_fn(dev, async_resume)) + return; + + __device_resume(dev, pm_transition, false); +} + /** * dpm_resume - Execute "resume" callbacks for non-sysdev devices. * @state: PM transition of the system being carried out. @@ -1009,27 +1007,17 @@ void dpm_resume(pm_message_t state) pm_transition = state; async_error = 0; - list_for_each_entry(dev, &dpm_suspended_list, power.entry) - dpm_async_fn(dev, async_resume); - while (!list_empty(&dpm_suspended_list)) { dev = to_device(dpm_suspended_list.next); + get_device(dev); - if (!is_async(dev)) { - int error; - mutex_unlock(&dpm_list_mtx); + mutex_unlock(&dpm_list_mtx); - error = device_resume(dev, state, false); - if (error) { - suspend_stats.failed_resume++; - dpm_save_failed_step(SUSPEND_RESUME); - dpm_save_failed_dev(dev_name(dev)); - pm_dev_err(dev, state, "", error); - } + device_resume(dev); + + mutex_lock(&dpm_list_mtx); - mutex_lock(&dpm_list_mtx); - } if (!list_empty(&dev->power.entry)) list_move_tail(&dev->power.entry, &dpm_prepared_list); From 947708f1ff8ba354736d7d0358ae4357e504047e Mon Sep 17 00:00:00 2001 From: Zhipeng Wang Date: Wed, 17 Jan 2024 17:40:29 +0900 Subject: [PATCH 39/70] ANDROID: ABI: Update symbol list for imx INFO: 1 function symbol(s) added 'int v4l2_fwnode_device_parse(struct device*, struct v4l2_fwnode_device_properties*)' Bug: 320539650 Change-Id: Id75312751f4832f1459387bd11c0583749d4fa4d Signed-off-by: Zhipeng Wang --- android/abi_gki_aarch64.stg | 21 +++++++++++++++++++++ android/abi_gki_aarch64_imx | 11 +++++++++++ 2 files changed, 32 insertions(+) diff --git a/android/abi_gki_aarch64.stg b/android/abi_gki_aarch64.stg index f6bfd1c2f644..f9c65e8266b4 100644 --- a/android/abi_gki_aarch64.stg +++ b/android/abi_gki_aarch64.stg @@ -27773,6 +27773,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0xc50a1b96 } +pointer_reference { + id: 0x3bd3f876 + kind: POINTER + pointee_type_id: 0xc50f0744 +} pointer_reference { id: 0x3bd6fa3a kind: POINTER @@ -325595,6 +325600,12 @@ function { parameter_id: 0x0258f96e parameter_id: 0x38514bfb } +function { + id: 0x9df99295 + return_type_id: 0x6720d32f + parameter_id: 0x0258f96e + parameter_id: 0x3bd3f876 +} function { id: 0x9dfae298 return_type_id: 0x6720d32f @@ -397375,6 +397386,15 @@ elf_symbol { type_id: 0x209ae488 full_name: "v4l2_format_info" } +elf_symbol { + id: 0xfb876b5c + name: "v4l2_fwnode_device_parse" + is_defined: true + symbol_type: FUNCTION + crc: 0x03ecb420 + type_id: 0x9df99295 + full_name: "v4l2_fwnode_device_parse" +} elf_symbol { id: 0x7ba36329 name: "v4l2_fwnode_endpoint_alloc_parse" @@ -408163,6 +408183,7 @@ interface { symbol_id: 0xe66642fe symbol_id: 0x538ad5cc symbol_id: 0x2244c8f0 + symbol_id: 0xfb876b5c symbol_id: 0x7ba36329 symbol_id: 0x2643c2c9 symbol_id: 0xcb8b4f14 diff --git a/android/abi_gki_aarch64_imx b/android/abi_gki_aarch64_imx index 1b556c8705f6..c7978e9b721f 100644 --- a/android/abi_gki_aarch64_imx +++ b/android/abi_gki_aarch64_imx @@ -2253,6 +2253,14 @@ usb_udc_vbus_handler __usecs_to_jiffies usleep_range_state + __v4l2_async_nf_add_fwnode + v4l2_async_nf_cleanup + v4l2_async_nf_init + v4l2_async_nf_register + v4l2_async_nf_unregister + v4l2_async_register_subdev + v4l2_async_register_subdev_sensor + v4l2_async_unregister_subdev v4l2_ctrl_auto_cluster v4l2_ctrl_handler_free v4l2_ctrl_handler_init_class @@ -2289,6 +2297,9 @@ v4l2_fh_init v4l2_fh_open __v4l2_find_nearest_size + v4l2_fwnode_device_parse + v4l2_fwnode_endpoint_alloc_parse + v4l2_fwnode_endpoint_parse v4l2_get_link_freq v4l2_g_parm_cap v4l2_i2c_subdev_init From 204160394a5955dab928a6ef0353c177e2a569e6 Mon Sep 17 00:00:00 2001 From: Paul Lawrence Date: Tue, 9 Jan 2024 10:02:00 -0800 Subject: [PATCH 40/70] ANDROID: fuse-bpf: Fix the issue of abnormal lseek system calls fuse_lseek_backing was returning the offset as an int, which would then be treated as an ERR if in the range 4G-4096 and 4G. Although the call would appear to work correctly, the file position would be incorrect according to a subsequent fseek with SEEK_CUR. Based on a change by chenyuwen who found and fixed this issue. Bug: 319219307 Change-Id: I3aef5fb22751a72ce2bd7674ee081956a89fc752 Signed-off-by: chenyuwen Signed-off-by: Paul Lawrence --- fs/fuse/backing.c | 11 +- .../selftests/filesystems/fuse/fuse_test.c | 24 ++- .../selftests/filesystems/fuse/test_bpf.c | 193 +++++++++++++++++- 3 files changed, 220 insertions(+), 8 deletions(-) diff --git a/fs/fuse/backing.c b/fs/fuse/backing.c index 6ca74987f7da..0bc637db568f 100644 --- a/fs/fuse/backing.c +++ b/fs/fuse/backing.c @@ -401,23 +401,26 @@ int fuse_lseek_backing(struct fuse_bpf_args *fa, struct file *file, loff_t offse struct file *backing_file = fuse_file->backing_file; loff_t ret; - /* TODO: Handle changing of the file handle */ if (offset == 0) { if (whence == SEEK_CUR) { flo->offset = file->f_pos; - return flo->offset; + return 0; } if (whence == SEEK_SET) { flo->offset = vfs_setpos(file, 0, 0); - return flo->offset; + return 0; } } inode_lock(file->f_inode); backing_file->f_pos = file->f_pos; ret = vfs_llseek(backing_file, fli->offset, fli->whence); - flo->offset = ret; + + if (!IS_ERR(ERR_PTR(ret))) { + flo->offset = ret; + ret = 0; + } inode_unlock(file->f_inode); return ret; } diff --git a/tools/testing/selftests/filesystems/fuse/fuse_test.c b/tools/testing/selftests/filesystems/fuse/fuse_test.c index ad24ed48853e..c31f6fdcf61d 100644 --- a/tools/testing/selftests/filesystems/fuse/fuse_test.c +++ b/tools/testing/selftests/filesystems/fuse/fuse_test.c @@ -255,7 +255,7 @@ static int bpf_test_partial(const char *mount_dir) TEST(src_fd = open(ft_src, O_DIRECTORY | O_RDONLY | O_CLOEXEC), src_fd != -1); TESTEQUAL(create_file(src_fd, s(test_name), 1, 2), 0); - TESTEQUAL(install_elf_bpf("test_bpf.bpf", "test_trace", + TESTEQUAL(install_elf_bpf("test_bpf.bpf", "test_partial", &bpf_fd, NULL, NULL), 0); TESTEQUAL(mount_fuse(mount_dir, bpf_fd, src_fd, &fuse_dev), 0); @@ -363,7 +363,7 @@ static int bpf_test_readdir(const char *mount_dir) src_fd != -1); TESTEQUAL(create_file(src_fd, s(names[0]), 1, 2), 0); TESTEQUAL(create_file(src_fd, s(names[1]), 1, 2), 0); - TESTEQUAL(install_elf_bpf("test_bpf.bpf", "test_trace", + TESTEQUAL(install_elf_bpf("test_bpf.bpf", "test_partial", &bpf_fd, NULL, NULL), 0); TESTEQUAL(mount_fuse(mount_dir, bpf_fd, src_fd, &fuse_dev), 0); @@ -1490,6 +1490,8 @@ out: static int bpf_test_lseek(const char *mount_dir) { const char *file = "real"; + const char *sparse_file = "sparse"; + const off_t sparse_length = 0x100000000u; const char *test_data = "data"; int result = TEST_FAILURE; int src_fd = -1; @@ -1504,6 +1506,12 @@ static int bpf_test_lseek(const char *mount_dir) TESTEQUAL(write(fd, test_data, strlen(test_data)), strlen(test_data)); TESTSYSCALL(close(fd)); fd = -1; + TEST(fd = openat(src_fd, sparse_file, O_CREAT | O_RDWR | O_CLOEXEC, + 0777), + fd != -1); + TESTSYSCALL(ftruncate(fd, sparse_length)); + TESTSYSCALL(close(fd)); + fd = -1; TESTEQUAL(install_elf_bpf("test_bpf.bpf", "test_trace", &bpf_fd, NULL, NULL), 0); TESTEQUAL(mount_fuse(mount_dir, bpf_fd, src_fd, &fuse_dev), 0); @@ -1518,6 +1526,18 @@ static int bpf_test_lseek(const char *mount_dir) TESTEQUAL(bpf_test_trace("lseek"), 0); TESTEQUAL(lseek(fd, 1, SEEK_DATA), 1); TESTEQUAL(bpf_test_trace("lseek"), 0); + TESTSYSCALL(close(fd)); + fd = -1; + + TEST(fd = s_open(s_path(s(mount_dir), s(sparse_file)), + O_RDONLY | O_CLOEXEC), + fd != -1); + TESTEQUAL(lseek(fd, -256, SEEK_END), sparse_length - 256); + TESTEQUAL(lseek(fd, 0, SEEK_CUR), sparse_length - 256); + + TESTSYSCALL(close(fd)); + fd = -1; + result = TEST_SUCCESS; out: close(fd); diff --git a/tools/testing/selftests/filesystems/fuse/test_bpf.c b/tools/testing/selftests/filesystems/fuse/test_bpf.c index a014b915c059..be5f59ad8343 100644 --- a/tools/testing/selftests/filesystems/fuse/test_bpf.c +++ b/tools/testing/selftests/filesystems/fuse/test_bpf.c @@ -28,9 +28,9 @@ int readdir_test(struct fuse_bpf_args *fa) } } -SEC("test_trace") +SEC("test_partial") /* return FUSE_BPF_BACKING to use backing fs, 0 to pass to usermode */ -int trace_test(struct fuse_bpf_args *fa) +int partial_test(struct fuse_bpf_args *fa) { switch (fa->opcode) { case FUSE_LOOKUP | FUSE_PREFILTER: { @@ -329,6 +329,195 @@ int trace_test(struct fuse_bpf_args *fa) } } +SEC("test_trace") +/* return FUSE_BPF_BACKING to use backing fs, 0 to pass to usermode */ +int trace_test(struct fuse_bpf_args *fa) +{ + switch (fa->opcode) { + case FUSE_LOOKUP | FUSE_PREFILTER: { + /* real and partial use backing file */ + const char *name = fa->in_args[0].value; + + bpf_printk("lookup %s", name); + return FUSE_BPF_BACKING; + } + + case FUSE_ACCESS | FUSE_PREFILTER: { + bpf_printk("Access: %d", fa->nodeid); + return FUSE_BPF_BACKING; + } + + case FUSE_CREATE | FUSE_PREFILTER: + bpf_printk("Create: %d", fa->nodeid); + return FUSE_BPF_BACKING; + + case FUSE_MKNOD | FUSE_PREFILTER: { + const struct fuse_mknod_in *fmi = fa->in_args[0].value; + const char *name = fa->in_args[1].value; + + bpf_printk("mknod %s %x %x", name, fmi->rdev | fmi->mode, fmi->umask); + return FUSE_BPF_BACKING; + } + + case FUSE_MKDIR | FUSE_PREFILTER: { + const struct fuse_mkdir_in *fmi = fa->in_args[0].value; + const char *name = fa->in_args[1].value; + + bpf_printk("mkdir %s %x %x", name, fmi->mode, fmi->umask); + return FUSE_BPF_BACKING; + } + + case FUSE_RMDIR | FUSE_PREFILTER: { + const char *name = fa->in_args[0].value; + + bpf_printk("rmdir %s", name); + return FUSE_BPF_BACKING; + } + + case FUSE_RENAME | FUSE_PREFILTER: { + const char *oldname = fa->in_args[1].value; + const char *newname = fa->in_args[2].value; + + bpf_printk("rename from %s", oldname); + bpf_printk("rename to %s", newname); + return FUSE_BPF_BACKING; + } + + case FUSE_RENAME2 | FUSE_PREFILTER: { + const struct fuse_rename2_in *fri = fa->in_args[0].value; + uint32_t flags = fri->flags; + const char *oldname = fa->in_args[1].value; + const char *newname = fa->in_args[2].value; + + bpf_printk("rename(%x) from %s", flags, oldname); + bpf_printk("rename to %s", newname); + return FUSE_BPF_BACKING; + } + + case FUSE_UNLINK | FUSE_PREFILTER: { + const char *name = fa->in_args[0].value; + + bpf_printk("unlink %s", name); + return FUSE_BPF_BACKING; + } + + case FUSE_LINK | FUSE_PREFILTER: { + const struct fuse_link_in *fli = fa->in_args[0].value; + const char *link_name = fa->in_args[1].value; + + bpf_printk("link %d %s", fli->oldnodeid, link_name); + return FUSE_BPF_BACKING; + } + + case FUSE_SYMLINK | FUSE_PREFILTER: { + const char *link_name = fa->in_args[0].value; + const char *link_dest = fa->in_args[1].value; + + bpf_printk("symlink from %s", link_name); + bpf_printk("symlink to %s", link_dest); + return FUSE_BPF_BACKING; + } + + case FUSE_READLINK | FUSE_PREFILTER: { + const char *link_name = fa->in_args[0].value; + + bpf_printk("readlink from", link_name); + return FUSE_BPF_BACKING; + } + + case FUSE_OPEN | FUSE_PREFILTER: { + bpf_printk("open"); + return FUSE_BPF_BACKING; + } + + case FUSE_OPEN | FUSE_POSTFILTER: + bpf_printk("open postfilter"); + return FUSE_BPF_USER_FILTER; + + case FUSE_READ | FUSE_PREFILTER: { + const struct fuse_read_in *fri = fa->in_args[0].value; + + bpf_printk("read %llu", fri->offset); + return FUSE_BPF_BACKING; + } + + case FUSE_GETATTR | FUSE_PREFILTER: { + bpf_printk("getattr"); + return FUSE_BPF_BACKING; + } + + case FUSE_SETATTR | FUSE_PREFILTER: { + bpf_printk("setattr"); + return FUSE_BPF_BACKING; + } + + case FUSE_OPENDIR | FUSE_PREFILTER: { + bpf_printk("opendir"); + return FUSE_BPF_BACKING; + } + + case FUSE_READDIR | FUSE_PREFILTER: { + bpf_printk("readdir"); + return FUSE_BPF_BACKING; + } + + case FUSE_FLUSH | FUSE_PREFILTER: { + bpf_printk("Flush"); + return FUSE_BPF_BACKING; + } + + case FUSE_GETXATTR | FUSE_PREFILTER: { + const char *name = fa->in_args[1].value; + + bpf_printk("getxattr %s", name); + return FUSE_BPF_BACKING; + } + + case FUSE_LISTXATTR | FUSE_PREFILTER: { + const char *name = fa->in_args[1].value; + + bpf_printk("listxattr %s", name); + return FUSE_BPF_BACKING; + } + + case FUSE_SETXATTR | FUSE_PREFILTER: { + const char *name = fa->in_args[1].value; + unsigned int size = fa->in_args[2].size; + + bpf_printk("setxattr %s %u", name, size); + return FUSE_BPF_BACKING; + } + + case FUSE_REMOVEXATTR | FUSE_PREFILTER: { + const char *name = fa->in_args[0].value; + + bpf_printk("removexattr %s", name); + return FUSE_BPF_BACKING; + } + + case FUSE_CANONICAL_PATH | FUSE_PREFILTER: { + bpf_printk("canonical_path"); + return FUSE_BPF_BACKING; + } + + case FUSE_STATFS | FUSE_PREFILTER: { + bpf_printk("statfs"); + return FUSE_BPF_BACKING; + } + + case FUSE_LSEEK | FUSE_PREFILTER: { + const struct fuse_lseek_in *fli = fa->in_args[0].value; + + bpf_printk("lseek type:%d, offset:%lld", fli->whence, fli->offset); + return FUSE_BPF_BACKING; + } + + default: + bpf_printk("Unknown opcode %d", fa->opcode); + return FUSE_BPF_BACKING; + } +} + SEC("test_hidden") int trace_hidden(struct fuse_bpf_args *fa) { From aba5a3fe094e43a7aa8adc5c09a131ef8c9ccfde Mon Sep 17 00:00:00 2001 From: Qais Yousef Date: Fri, 19 Jan 2024 10:52:57 +0000 Subject: [PATCH 41/70] ANDROID: Enable CONFIG_LAZY_RCU in x86 gki_defconfig It is still disabled by default. Must specify rcutree.android_enable_rcu_lazy and rcu_nocbs=all in boot time parameter to actually enable it. Bug: 258241771 Change-Id: Ic9e15b846d58ffa3d5dd81842c568da79352ff2d Signed-off-by: Qais Yousef --- arch/x86/configs/gki_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/configs/gki_defconfig b/arch/x86/configs/gki_defconfig index 7e2df44033bc..44f243dc72b8 100644 --- a/arch/x86/configs/gki_defconfig +++ b/arch/x86/configs/gki_defconfig @@ -17,6 +17,8 @@ CONFIG_PSI=y CONFIG_RCU_EXPERT=y CONFIG_RCU_BOOST=y CONFIG_RCU_NOCB_CPU=y +CONFIG_RCU_LAZY=y +CONFIG_RCU_LAZY_DEFAULT_OFF=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_IKHEADERS=m From 21c71a7d0e9611af47f97e4323cf8cff5e75ae05 Mon Sep 17 00:00:00 2001 From: Dylan Chang Date: Mon, 22 Jan 2024 11:23:20 +0800 Subject: [PATCH 42/70] ANDROID: GKI: Add symbol list for Nothing Add symbol list for Nothing at the first time 2 function symbol(s) added 'struct file_system_type* get_fs_type(const char*)' 'void iterate_supers_type(struct file_system_type*, void(*)(struct super_block*, void*), void*)' Bug: 321604034 Change-Id: I3cdf16cf21bf04df2c0ab10358e7e7da4e99ccd3 Signed-off-by: Dylan Chang --- BUILD.bazel | 1 + android/abi_gki_aarch64.stg | 43 +++++++++++++++++++++++++++++++++ android/abi_gki_aarch64_nothing | 4 +++ 3 files changed, 48 insertions(+) create mode 100644 android/abi_gki_aarch64_nothing diff --git a/BUILD.bazel b/BUILD.bazel index 6b3b030ecdb0..f1a46b2e796c 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -109,6 +109,7 @@ filegroup( "android/abi_gki_aarch64_imx", "android/abi_gki_aarch64_meizu", "android/abi_gki_aarch64_mtk", + "android/abi_gki_aarch64_nothing", "android/abi_gki_aarch64_oplus", "android/abi_gki_aarch64_pixel", "android/abi_gki_aarch64_qcom", diff --git a/android/abi_gki_aarch64.stg b/android/abi_gki_aarch64.stg index f9c65e8266b4..0c0a458c329f 100644 --- a/android/abi_gki_aarch64.stg +++ b/android/abi_gki_aarch64.stg @@ -4043,6 +4043,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0x18bd6530 } +pointer_reference { + id: 0x0cc07624 + kind: POINTER + pointee_type_id: 0x19413e0d +} pointer_reference { id: 0x0cc2a6e7 kind: POINTER @@ -295330,6 +295335,12 @@ function { return_type_id: 0x48b5725f parameter_id: 0x26847863 } +function { + id: 0x19413e0d + return_type_id: 0x48b5725f + parameter_id: 0x26ee682a + parameter_id: 0x18bd6530 +} function { id: 0x1942d44d return_type_id: 0x48b5725f @@ -296898,6 +296909,13 @@ function { parameter_id: 0x310ec01d parameter_id: 0x33756485 } +function { + id: 0x1c167d2e + return_type_id: 0x48b5725f + parameter_id: 0x32ec08f2 + parameter_id: 0x0cc07624 + parameter_id: 0x18bd6530 +} function { id: 0x1c18b1c5 return_type_id: 0x48b5725f @@ -330865,6 +330883,11 @@ function { return_type_id: 0x3ee88c45 parameter_id: 0x0258f96e } +function { + id: 0xdd084b85 + return_type_id: 0x32ec08f2 + parameter_id: 0x3e10b518 +} function { id: 0xdd32bce5 return_type_id: 0x0ae4a2c7 @@ -363630,6 +363653,15 @@ elf_symbol { type_id: 0x3a16a200 full_name: "get_each_object_track" } +elf_symbol { + id: 0x4579b2cf + name: "get_fs_type" + is_defined: true + symbol_type: FUNCTION + crc: 0x403e24c8 + type_id: 0xdd084b85 + full_name: "get_fs_type" +} elf_symbol { id: 0xdb82735d name: "get_governor_parent_kobj" @@ -369249,6 +369281,15 @@ elf_symbol { type_id: 0x9659ea27 full_name: "iterate_fd" } +elf_symbol { + id: 0xfea15456 + name: "iterate_supers_type" + is_defined: true + symbol_type: FUNCTION + crc: 0x4a91ba47 + type_id: 0x1c167d2e + full_name: "iterate_supers_type" +} elf_symbol { id: 0xca27ab6b name: "iunique" @@ -404432,6 +404473,7 @@ interface { symbol_id: 0xaf0c4e38 symbol_id: 0x08e235b1 symbol_id: 0x00d00ad1 + symbol_id: 0x4579b2cf symbol_id: 0xdb82735d symbol_id: 0x7d6ec6da symbol_id: 0x56ec444f @@ -405056,6 +405098,7 @@ interface { symbol_id: 0xbb7edccb symbol_id: 0xd4b34ea6 symbol_id: 0x3c6496cb + symbol_id: 0xfea15456 symbol_id: 0xca27ab6b symbol_id: 0x124d42c2 symbol_id: 0xd106aba0 diff --git a/android/abi_gki_aarch64_nothing b/android/abi_gki_aarch64_nothing new file mode 100644 index 000000000000..5960f2b3c287 --- /dev/null +++ b/android/abi_gki_aarch64_nothing @@ -0,0 +1,4 @@ +[abi_symbol_list] +# required by mount_state.ko + iterate_supers_type + get_fs_type \ No newline at end of file From bd77c97c7665fe28d898a82fcd664ed906e6f681 Mon Sep 17 00:00:00 2001 From: Avichal Rakesh Date: Thu, 4 Jan 2024 13:50:08 -0800 Subject: [PATCH 43/70] UPSTREAM: usb: gadget: uvc: Fix use are free during STREAMOFF There is a path that may lead to freed memory being referenced, causing kernel panics. The kernel panic has the following stack trace: Workqueue: uvcgadget uvcg_video_pump.c51fb85fece46625450f86adbf92c56c.cfi_jt pstate: 60c00085 (nZCv daIf +PAN +UAO -TCO BTYPE=--) pc : __list_del_entry_valid+0xc0/0xd4 lr : __list_del_entry_valid+0xc0/0xd4 Call trace: __list_del_entry_valid+0xc0/0xd4 uvc_video_free_request+0x60/0x98 uvcg_video_pump+0x1cc/0x204 process_one_work+0x21c/0x4b8 worker_thread+0x29c/0x574 kthread+0x158/0x1b0 ret_from_fork+0x10/0x30 The root cause is that uvcg_video_usb_req_queue frees the uvc_request if is_enabled is false and returns an error status. video_pump also frees the associated request if uvcg_video_usb_req_queue returns an error status, leading to double free and accessing garbage memory. To fix the issue, this patch removes freeing logic from uvcg_video_usb_req_queue, and lets the callers to the function handle queueing errors as they see fit. Fixes: 6acba0345b68 ("usb:gadget:uvc Do not use worker thread to pump isoc usb requests") Tested-by: Avichal Rakesh Signed-off-by: Avichal Rakesh Link: https://lore.kernel.org/r/20240104215009.2252452-1-arakesh@google.com Signed-off-by: Greg Kroah-Hartman Bug: 314338409 (cherry picked from commit fe814b5b0f3042f1a583734497e726ee53783cc1) Change-Id: Id13dea3a37e37a79cff3719ced449f0d1902ebd6 Signed-off-by: Avichal Rakesh --- drivers/usb/gadget/function/uvc_video.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/function/uvc_video.c b/drivers/usb/gadget/function/uvc_video.c index 98ba524c27f5..7f18dc471be3 100644 --- a/drivers/usb/gadget/function/uvc_video.c +++ b/drivers/usb/gadget/function/uvc_video.c @@ -276,10 +276,9 @@ static int uvcg_video_usb_req_queue(struct uvc_video *video, bool is_bulk = video->max_payload_size; struct list_head *list = NULL; - if (!video->is_enabled) { - uvc_video_free_request(req->context, video->ep); + if (!video->is_enabled) return -ENODEV; - } + if (queue_to_ep) { struct uvc_request *ureq = req->context; /* @@ -464,8 +463,15 @@ uvc_video_complete(struct usb_ep *ep, struct usb_request *req) * and this thread for isoc endpoints. */ ret = uvcg_video_usb_req_queue(video, to_queue, !is_bulk); - if (ret < 0) + if (ret < 0) { + /* + * Endpoint error, but the stream is still enabled. + * Put request back in req_free for it to be cleaned + * up later. + */ uvcg_queue_cancel(queue, 0); + list_add_tail(&to_queue->list, &video->req_free); + } } else { uvc_video_free_request(ureq, ep); } From 2d3f0c9d4108fe34b1dce62839f19dd56050f0c8 Mon Sep 17 00:00:00 2001 From: "Hailong.Liu" Date: Fri, 19 Jan 2024 11:22:09 +0800 Subject: [PATCH 44/70] ANDROID: Roll back some code to fix system_server registers psi trigger failed. the commit 2c1e89916b2bbab7e4b9cf2488ef778a949efcb5 revert part of https://android-review.googlesource.com/c/kernel/common/+/2199758 causing system_server registers psi trigger failed due to lack of CAP_SYS_RESOURCE capability. Bug: 243781242 Bug: 244148051 Signed-off-by: Hailong.Liu Change-Id: Ie22ea6f7a7dc848fa8307e6f4e8223779367df31 --- kernel/sched/psi.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c index 0c9c1c545926..55be195660a9 100644 --- a/kernel/sched/psi.c +++ b/kernel/sched/psi.c @@ -1410,27 +1410,19 @@ static int psi_cpu_show(struct seq_file *m, void *v) return psi_show(m, &psi_system, PSI_CPU); } -static int psi_open(struct file *file, int (*psi_show)(struct seq_file *, void *)) -{ - if (file->f_mode & FMODE_WRITE && !capable(CAP_SYS_RESOURCE)) - return -EPERM; - - return single_open(file, psi_show, NULL); -} - static int psi_io_open(struct inode *inode, struct file *file) { - return psi_open(file, psi_io_show); + return single_open(file, psi_io_show, NULL); } static int psi_memory_open(struct inode *inode, struct file *file) { - return psi_open(file, psi_memory_show); + return single_open(file, psi_memory_show, NULL); } static int psi_cpu_open(struct inode *inode, struct file *file) { - return psi_open(file, psi_cpu_show); + return single_open(file, psi_cpu_show, NULL); } static ssize_t psi_write(struct file *file, const char __user *user_buf, @@ -1544,7 +1536,7 @@ static int psi_irq_show(struct seq_file *m, void *v) static int psi_irq_open(struct inode *inode, struct file *file) { - return psi_open(file, psi_irq_show); + return single_open(file, psi_irq_show, NULL); } static ssize_t psi_irq_write(struct file *file, const char __user *user_buf, From 9267e267be78e29e9539c63969738d139980981b Mon Sep 17 00:00:00 2001 From: John Stultz Date: Thu, 18 Jan 2024 10:49:48 -0800 Subject: [PATCH 45/70] ANDROID: uid_sys_stats: Fully initialize uid_entry_tmp value Amit Pundir at Linaro reported seeing crashes in uid_sys_stats driver when building with GCC. Looking into it, it seems the uid_entry_tmp value is used while only partially initialized, causing potential out of bound access on the uid_entry io arrays. This likely has gone unnoticed with clang as I believe we're using the zero initialization for stack variables security feature. So change the logic to fully initialize the uid_entry_tmp value. Fixes: f68d4f3c3b53 ("ANDROID: uid_sys_stat: instead update_io_stats_uid_locked to update_io_stats_uid") Reported-by: Amit Pundir Signed-off-by: John Stultz Change-Id: I78de245e80ef60aabec78a615c7ba582ab5a2242 --- drivers/misc/uid_sys_stats.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/misc/uid_sys_stats.c b/drivers/misc/uid_sys_stats.c index 095962102ac7..e5d8af9712a0 100644 --- a/drivers/misc/uid_sys_stats.c +++ b/drivers/misc/uid_sys_stats.c @@ -684,9 +684,8 @@ static ssize_t uid_procstat_write(struct file *file, * so that we can unlock_uid during update_io_stats_uid, in order * to avoid the unnecessary lock-time of uid_lock. */ - uid_entry_tmp.uid = uid_entry->uid; - memcpy(uid_entry_tmp.io, uid_entry->io, - sizeof(struct io_stats) * UID_STATE_SIZE); + uid_entry_tmp = *uid_entry; + unlock_uid(uid); update_io_stats_uid(&uid_entry_tmp); From 427210e44019c8fe7b1e4a77eb3d661273199a67 Mon Sep 17 00:00:00 2001 From: Avichal Rakesh Date: Thu, 4 Jan 2024 13:50:09 -0800 Subject: [PATCH 46/70] UPSTREAM: usb: gadget: uvc: Remove nested locking When handling error status from uvcg_video_usb_req_queue, uvc_video_complete currently calls uvcg_queue_cancel with video->req_lock held. uvcg_queue_cancel internally locks queue->irqlock, which nests queue->irqlock inside video->req_lock. This isn't a functional bug at the moment, but does open up possibilities for ABBA deadlocks in the future. This patch fixes the accidental nesting by dropping video->req_lock before calling uvcg_queue_cancel. Fixes: 6acba0345b68 ("usb:gadget:uvc Do not use worker thread to pump isoc usb requests") Signed-off-by: Avichal Rakesh Link: https://lore.kernel.org/r/20240104215009.2252452-2-arakesh@google.com Signed-off-by: Greg Kroah-Hartman Bug: 314338409 (cherry picked from commit 9866dc4314c6c858e451933f965d64532aec00a9) Change-Id: If25fba6661d55cd972d76068750f3b445c8360aa Signed-off-by: Avichal Rakesh --- drivers/usb/gadget/function/uvc_video.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/uvc_video.c b/drivers/usb/gadget/function/uvc_video.c index 7f18dc471be3..dd3241fc6939 100644 --- a/drivers/usb/gadget/function/uvc_video.c +++ b/drivers/usb/gadget/function/uvc_video.c @@ -469,13 +469,15 @@ uvc_video_complete(struct usb_ep *ep, struct usb_request *req) * Put request back in req_free for it to be cleaned * up later. */ - uvcg_queue_cancel(queue, 0); list_add_tail(&to_queue->list, &video->req_free); } } else { uvc_video_free_request(ureq, ep); + ret = 0; } spin_unlock_irqrestore(&video->req_lock, flags); + if (ret < 0) + uvcg_queue_cancel(queue, 0); } static int From 32805608439a7d479d4780e337de2f4a62314ec1 Mon Sep 17 00:00:00 2001 From: Qian-Hao Huang Date: Tue, 23 Jan 2024 00:44:25 +0800 Subject: [PATCH 47/70] ANDROID: Update the ABI symbol list Adding the following symbols: - regulator_get_voltage - send_sig_info Bug: 321669930 Change-Id: I3cf5e5a7b37b5d1837ab7cbf151b7aabbaced504 Signed-off-by: Qian-Hao Huang --- android/abi_gki_aarch64_pixel | 2 ++ 1 file changed, 2 insertions(+) diff --git a/android/abi_gki_aarch64_pixel b/android/abi_gki_aarch64_pixel index 97c5ef909162..172d1c0d0b99 100644 --- a/android/abi_gki_aarch64_pixel +++ b/android/abi_gki_aarch64_pixel @@ -1829,6 +1829,7 @@ regulator_enable_regmap regulator_get regulator_get_optional + regulator_get_voltage regulator_get_voltage_sel_regmap regulator_is_enabled regulator_is_enabled_regmap @@ -1934,6 +1935,7 @@ scsi_set_sense_information scsi_unblock_requests sdev_prefix_printk + send_sig_info seq_hex_dump seq_lseek seq_open From 90bd30bdefa268c473eba62280f6ce14a6216e63 Mon Sep 17 00:00:00 2001 From: Ryan Huang Date: Fri, 19 Jan 2024 13:56:56 -0800 Subject: [PATCH 48/70] ANDROID: Update the ABI symbol list Adding the following symbols: - __traceiter_android_rvh_iommu_alloc_insert_iova - __traceiter_android_rvh_iommu_iovad_init_alloc_algo - __traceiter_android_rvh_iommu_limit_align_shift - __tracepoint_android_rvh_iommu_alloc_insert_iova - __tracepoint_android_rvh_iommu_iovad_init_alloc_algo - __tracepoint_android_rvh_iommu_limit_align_shift Bug: 321292231 Change-Id: I06bc89027ffd05c43de2cfce67dc3ca0440bce05 Signed-off-by: Ryan Huang --- android/abi_gki_aarch64_pixel | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/android/abi_gki_aarch64_pixel b/android/abi_gki_aarch64_pixel index 172d1c0d0b99..dde42e5f36f9 100644 --- a/android/abi_gki_aarch64_pixel +++ b/android/abi_gki_aarch64_pixel @@ -2282,6 +2282,9 @@ __traceiter_android_rvh_enqueue_task __traceiter_android_rvh_enqueue_task_fair __traceiter_android_rvh_find_lowest_rq + __traceiter_android_rvh_iommu_alloc_insert_iova + __traceiter_android_rvh_iommu_iovad_init_alloc_algo + __traceiter_android_rvh_iommu_limit_align_shift __traceiter_android_rvh_irqs_disable __traceiter_android_rvh_irqs_enable __traceiter_android_rvh_post_init_entity_util_avg @@ -2391,6 +2394,9 @@ __tracepoint_android_rvh_enqueue_task __tracepoint_android_rvh_enqueue_task_fair __tracepoint_android_rvh_find_lowest_rq + __tracepoint_android_rvh_iommu_alloc_insert_iova + __tracepoint_android_rvh_iommu_iovad_init_alloc_algo + __tracepoint_android_rvh_iommu_limit_align_shift __tracepoint_android_rvh_irqs_disable __tracepoint_android_rvh_irqs_enable __tracepoint_android_rvh_post_init_entity_util_avg From c2fbc12180d399b4f283c6c228dc084f4c01ec1f Mon Sep 17 00:00:00 2001 From: John Stultz Date: Wed, 17 Jan 2024 16:10:58 -0800 Subject: [PATCH 49/70] ANDROID: uid_sys_stats: Drop CONFIG_UID_SYS_STATS_DEBUG logic It was pointed out that since commit b6115e140102 ("ANDROID: uid_sys_stat: split the global lock uid_lock to the fine-grained locks for each hlist in hash_table") taking a spin_lock in uid_lock() causes a scheduling while atomic error if CONFIG_UID_SYS_STATS_DEBUG is enabled, as get_full_task_comm() takes the mmap_write_lock() which is a semaphore, breaking the proper ordering. In the GKI CONFIG_UID_SYS_STATS_DEBUG is disabled, so this went unnoticed. The uid_sys_stats logic isn't ever going to go upstream (it depends on reverting upstream logic) and will hopefully be replaced eventually. So there's not much reason to drag around this debug logic that is unused. So drop it. Less code to schlep forward. Bug: 320184870 Change-Id: I2cfce79d5a25a3eba11a5509444c07b4642ef2de Signed-off-by: John Stultz --- drivers/misc/Kconfig | 7 -- drivers/misc/uid_sys_stats.c | 223 ----------------------------------- 2 files changed, 230 deletions(-) diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index c4b89fb8590c..b3f752fac201 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -469,13 +469,6 @@ config UID_SYS_STATS Per UID based io statistics exported to /proc/uid_io Per UID based procstat control in /proc/uid_procstat -config UID_SYS_STATS_DEBUG - bool "Per-TASK statistics" - depends on UID_SYS_STATS - default n - help - Per TASK based io statistics exported to /proc/uid_io - config HISI_HIKEY_USB tristate "USB GPIO Hub on HiSilicon Hikey 960/970 Platform" depends on (OF && GPIOLIB) || COMPILE_TEST diff --git a/drivers/misc/uid_sys_stats.c b/drivers/misc/uid_sys_stats.c index e5d8af9712a0..13acc61539ab 100644 --- a/drivers/misc/uid_sys_stats.c +++ b/drivers/misc/uid_sys_stats.c @@ -76,9 +76,6 @@ struct uid_entry { int state; struct io_stats io[UID_STATE_SIZE]; struct hlist_node hash; -#ifdef CONFIG_UID_SYS_STATS_DEBUG - DECLARE_HASHTABLE(task_entries, UID_HASH_BITS); -#endif }; static inline int trylock_uid(uid_t uid) @@ -148,182 +145,6 @@ static void compute_io_bucket_stats(struct io_stats *io_bucket, memset(io_dead, 0, sizeof(struct io_stats)); } -#ifdef CONFIG_UID_SYS_STATS_DEBUG -static void get_full_task_comm(struct task_entry *task_entry, - struct task_struct *task) -{ - int i = 0, offset = 0, len = 0; - /* save one byte for terminating null character */ - int unused_len = MAX_TASK_COMM_LEN - TASK_COMM_LEN - 1; - char buf[MAX_TASK_COMM_LEN - TASK_COMM_LEN - 1]; - struct mm_struct *mm = task->mm; - - /* fill the first TASK_COMM_LEN bytes with thread name */ - __get_task_comm(task_entry->comm, TASK_COMM_LEN, task); - i = strlen(task_entry->comm); - while (i < TASK_COMM_LEN) - task_entry->comm[i++] = ' '; - - /* next the executable file name */ - if (mm) { - mmap_write_lock(mm); - if (mm->exe_file) { - char *pathname = d_path(&mm->exe_file->f_path, buf, - unused_len); - - if (!IS_ERR(pathname)) { - len = strlcpy(task_entry->comm + i, pathname, - unused_len); - i += len; - task_entry->comm[i++] = ' '; - unused_len--; - } - } - mmap_write_unlock(mm); - } - unused_len -= len; - - /* fill the rest with command line argument - * replace each null or new line character - * between args in argv with whitespace */ - len = get_cmdline(task, buf, unused_len); - while (offset < len) { - if (buf[offset] != '\0' && buf[offset] != '\n') - task_entry->comm[i++] = buf[offset]; - else - task_entry->comm[i++] = ' '; - offset++; - } - - /* get rid of trailing whitespaces in case when arg is memset to - * zero before being reset in userspace - */ - while (task_entry->comm[i-1] == ' ') - i--; - task_entry->comm[i] = '\0'; -} - -static struct task_entry *find_task_entry(struct uid_entry *uid_entry, - struct task_struct *task) -{ - struct task_entry *task_entry; - - hash_for_each_possible(uid_entry->task_entries, task_entry, hash, - task->pid) { - if (task->pid == task_entry->pid) { - /* if thread name changed, update the entire command */ - int len = strnchr(task_entry->comm, ' ', TASK_COMM_LEN) - - task_entry->comm; - - if (strncmp(task_entry->comm, task->comm, len)) - get_full_task_comm(task_entry, task); - return task_entry; - } - } - return NULL; -} - -static struct task_entry *find_or_register_task(struct uid_entry *uid_entry, - struct task_struct *task) -{ - struct task_entry *task_entry; - pid_t pid = task->pid; - - task_entry = find_task_entry(uid_entry, task); - if (task_entry) - return task_entry; - - task_entry = kzalloc(sizeof(struct task_entry), GFP_ATOMIC); - if (!task_entry) - return NULL; - - get_full_task_comm(task_entry, task); - - task_entry->pid = pid; - hash_add(uid_entry->task_entries, &task_entry->hash, (unsigned int)pid); - - return task_entry; -} - -static void remove_uid_tasks(struct uid_entry *uid_entry) -{ - struct task_entry *task_entry; - unsigned long bkt_task; - struct hlist_node *tmp_task; - - hash_for_each_safe(uid_entry->task_entries, bkt_task, - tmp_task, task_entry, hash) { - hash_del(&task_entry->hash); - kfree(task_entry); - } -} - -static void set_io_uid_tasks_zero(struct uid_entry *uid_entry) -{ - struct task_entry *task_entry; - unsigned long bkt_task; - - hash_for_each(uid_entry->task_entries, bkt_task, task_entry, hash) { - memset(&task_entry->io[UID_STATE_TOTAL_CURR], 0, - sizeof(struct io_stats)); - } -} - -static void add_uid_tasks_io_stats(struct task_entry *task_entry, - struct task_io_accounting *ioac, int slot) -{ - struct io_stats *task_io_slot = &task_entry->io[slot]; - - task_io_slot->read_bytes += ioac->read_bytes; - task_io_slot->write_bytes += compute_write_bytes(ioac); - task_io_slot->rchar += ioac->rchar; - task_io_slot->wchar += ioac->wchar; - task_io_slot->fsync += ioac->syscfs; -} - -static void compute_io_uid_tasks(struct uid_entry *uid_entry) -{ - struct task_entry *task_entry; - unsigned long bkt_task; - - hash_for_each(uid_entry->task_entries, bkt_task, task_entry, hash) { - compute_io_bucket_stats(&task_entry->io[uid_entry->state], - &task_entry->io[UID_STATE_TOTAL_CURR], - &task_entry->io[UID_STATE_TOTAL_LAST], - &task_entry->io[UID_STATE_DEAD_TASKS]); - } -} - -static void show_io_uid_tasks(struct seq_file *m, struct uid_entry *uid_entry) -{ - struct task_entry *task_entry; - unsigned long bkt_task; - - hash_for_each(uid_entry->task_entries, bkt_task, task_entry, hash) { - /* Separated by comma because space exists in task comm */ - seq_printf(m, "task,%s,%lu,%llu,%llu,%llu,%llu,%llu,%llu,%llu,%llu,%llu,%llu\n", - task_entry->comm, - (unsigned long)task_entry->pid, - task_entry->io[UID_STATE_FOREGROUND].rchar, - task_entry->io[UID_STATE_FOREGROUND].wchar, - task_entry->io[UID_STATE_FOREGROUND].read_bytes, - task_entry->io[UID_STATE_FOREGROUND].write_bytes, - task_entry->io[UID_STATE_BACKGROUND].rchar, - task_entry->io[UID_STATE_BACKGROUND].wchar, - task_entry->io[UID_STATE_BACKGROUND].read_bytes, - task_entry->io[UID_STATE_BACKGROUND].write_bytes, - task_entry->io[UID_STATE_FOREGROUND].fsync, - task_entry->io[UID_STATE_BACKGROUND].fsync); - } -} -#else -static void remove_uid_tasks(struct uid_entry *uid_entry) {}; -static void set_io_uid_tasks_zero(struct uid_entry *uid_entry) {}; -static void compute_io_uid_tasks(struct uid_entry *uid_entry) {}; -static void show_io_uid_tasks(struct seq_file *m, - struct uid_entry *uid_entry) {} -#endif - static struct uid_entry *find_uid_entry(uid_t uid) { struct uid_entry *uid_entry; @@ -347,9 +168,6 @@ static struct uid_entry *find_or_register_uid(uid_t uid) return NULL; uid_entry->uid = uid; -#ifdef CONFIG_UID_SYS_STATS_DEBUG - hash_init(uid_entry->task_entries); -#endif hash_add(hash_table, &uid_entry->hash, uid); return uid_entry; @@ -465,7 +283,6 @@ static ssize_t uid_remove_write(struct file *file, hash_for_each_possible_safe(hash_table, uid_entry, tmp, hash, (uid_t)uid_start) { if (uid_start == uid_entry->uid) { - remove_uid_tasks(uid_entry); hash_del(&uid_entry->hash); kfree(uid_entry); } @@ -503,10 +320,6 @@ static void add_uid_io_stats(struct uid_entry *uid_entry, if (slot != UID_STATE_DEAD_TASKS && (task->flags & PF_EXITING)) return; -#ifdef CONFIG_UID_SYS_STATS_DEBUG - task_entry = find_or_register_task(uid_entry, task); - add_uid_tasks_io_stats(task_entry, &task->ioac, slot); -#endif __add_uid_io_stats(uid_entry, &task->ioac, slot); } @@ -524,7 +337,6 @@ static void update_io_stats_all(void) hlist_for_each_entry(uid_entry, &hash_table[bkt], hash) { memset(&uid_entry->io[UID_STATE_TOTAL_CURR], 0, sizeof(struct io_stats)); - set_io_uid_tasks_zero(uid_entry); } unlock_uid_by_bkt(bkt); } @@ -552,24 +364,18 @@ static void update_io_stats_all(void) &uid_entry->io[UID_STATE_TOTAL_CURR], &uid_entry->io[UID_STATE_TOTAL_LAST], &uid_entry->io[UID_STATE_DEAD_TASKS]); - compute_io_uid_tasks(uid_entry); } unlock_uid_by_bkt(bkt); } } -#ifndef CONFIG_UID_SYS_STATS_DEBUG static void update_io_stats_uid(struct uid_entry *uid_entry) -#else -static void update_io_stats_uid_locked(struct uid_entry *uid_entry) -#endif { struct task_struct *task, *temp; struct user_namespace *user_ns = current_user_ns(); memset(&uid_entry->io[UID_STATE_TOTAL_CURR], 0, sizeof(struct io_stats)); - set_io_uid_tasks_zero(uid_entry); rcu_read_lock(); do_each_thread(temp, task) { @@ -583,7 +389,6 @@ static void update_io_stats_uid_locked(struct uid_entry *uid_entry) &uid_entry->io[UID_STATE_TOTAL_CURR], &uid_entry->io[UID_STATE_TOTAL_LAST], &uid_entry->io[UID_STATE_DEAD_TASKS]); - compute_io_uid_tasks(uid_entry); } @@ -610,8 +415,6 @@ static int uid_io_show(struct seq_file *m, void *v) uid_entry->io[UID_STATE_BACKGROUND].write_bytes, uid_entry->io[UID_STATE_FOREGROUND].fsync, uid_entry->io[UID_STATE_BACKGROUND].fsync); - - show_io_uid_tasks(m, uid_entry); } unlock_uid_by_bkt(bkt); } @@ -643,9 +446,7 @@ static ssize_t uid_procstat_write(struct file *file, uid_t uid; int argc, state; char input[128]; -#ifndef CONFIG_UID_SYS_STATS_DEBUG struct uid_entry uid_entry_tmp; -#endif if (count >= sizeof(input)) return -EINVAL; @@ -674,7 +475,6 @@ static ssize_t uid_procstat_write(struct file *file, return count; } -#ifndef CONFIG_UID_SYS_STATS_DEBUG /* * Update_io_stats_uid_locked would take a long lock-time of uid_lock * due to call do_each_thread to compute uid_entry->io, which would @@ -699,13 +499,6 @@ static ssize_t uid_procstat_write(struct file *file, } } unlock_uid(uid); -#else - update_io_stats_uid_locked(uid_entry); - - uid_entry->state = state; - - unlock_uid(uid); -#endif return count; } @@ -718,9 +511,6 @@ static const struct proc_ops uid_procstat_fops = { struct update_stats_work { uid_t uid; -#ifdef CONFIG_UID_SYS_STATS_DEBUG - struct task_struct *task; -#endif struct task_io_accounting ioac; u64 utime; u64 stime; @@ -746,19 +536,9 @@ static void update_stats_workfn(struct work_struct *work) uid_entry->utime += usw->utime; uid_entry->stime += usw->stime; -#ifdef CONFIG_UID_SYS_STATS_DEBUG - task_entry = find_task_entry(uid_entry, usw->task); - if (!task_entry) - goto next; - add_uid_tasks_io_stats(task_entry, &usw->ioac, - UID_STATE_DEAD_TASKS); -#endif __add_uid_io_stats(uid_entry, &usw->ioac, UID_STATE_DEAD_TASKS); next: unlock_uid(usw->uid); -#ifdef CONFIG_UID_SYS_STATS_DEBUG - put_task_struct(usw->task); -#endif kfree(usw); } @@ -783,9 +563,6 @@ static int process_notifier(struct notifier_block *self, usw = kmalloc(sizeof(struct update_stats_work), GFP_KERNEL); if (usw) { usw->uid = uid; -#ifdef CONFIG_UID_SYS_STATS_DEBUG - usw->task = get_task_struct(task); -#endif /* * Copy task->ioac since task might be destroyed before * the work is later performed. From c96cea1a3cc2292a0dde0c7ebb3da91831ce94b9 Mon Sep 17 00:00:00 2001 From: Jacky Liu Date: Tue, 23 Jan 2024 14:34:16 +0800 Subject: [PATCH 50/70] ANDROID: Update the ABI symbol list Adding the following symbols: - gpiod_set_debounce Bug: 316820336 Change-Id: I5f89b5ac4f52a05d1e29e3ff90abf6506551ef23 Signed-off-by: Jacky Liu --- android/abi_gki_aarch64_pixel | 1 + 1 file changed, 1 insertion(+) diff --git a/android/abi_gki_aarch64_pixel b/android/abi_gki_aarch64_pixel index dde42e5f36f9..833c5c316eb5 100644 --- a/android/abi_gki_aarch64_pixel +++ b/android/abi_gki_aarch64_pixel @@ -997,6 +997,7 @@ 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 From fa9ac43f1600ffdbf6db0fdc4548ef9e0b19e607 Mon Sep 17 00:00:00 2001 From: Wesley Cheng Date: Thu, 19 Oct 2023 13:29:24 +0300 Subject: [PATCH 51/70] BACKPORT: usb: host: xhci: Avoid XHCI resume delay if SSUSB device is not present There is a 120ms delay implemented for allowing the XHCI host controller to detect a U3 wakeup pulse. The intention is to wait for the device to retry the wakeup event if the USB3 PORTSC doesn't reflect the RESUME link status by the time it is checked. As per the USB3 specification: tU3WakeupRetryDelay ("Table 7-12. LTSSM State Transition Timeouts") This would allow the XHCI resume sequence to determine if the root hub needs to be also resumed. However, in case there is no device connected, or if there is only a HSUSB device connected, this delay would still affect the overall resume timing. Since this delay is solely for detecting U3 wake events (USB3 specific) then ignore this delay for the disconnected case and the HSUSB connected only case. [skip helper function, rename usb3_connected variable -Mathias ] Signed-off-by: Wesley Cheng Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20231019102924.2797346-20-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman Bug: 200589374 (cherry picked from commit 6add6dd345cb754ce18ff992c7264cabf31e59f6 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next) [wcheng: removed the need to check for resume type] Change-Id: I242a426ab0de40fd77705aaef57d228b8721d701 Signed-off-by: Wesley Cheng --- drivers/usb/host/xhci.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index be041bd65b19..d81d4aee1292 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -1133,6 +1133,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) int retval = 0; bool comp_timer_running = false; bool pending_portevent = false; + bool suspended_usb3_devs = false; bool reinit_xhc = false; if (!hcd->state) @@ -1282,10 +1283,16 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) /* * Resume roothubs only if there are pending events. * USB 3 devices resend U3 LFPS wake after a 100ms delay if - * the first wake signalling failed, give it that chance. + * the first wake signalling failed, give it that chance if + * there are suspended USB 3 devices. */ + if (xhci->usb3_rhub.bus_state.suspended_ports || + xhci->usb3_rhub.bus_state.bus_suspended) + suspended_usb3_devs = true; + pending_portevent = xhci_pending_portevent(xhci); - if (!pending_portevent) { + + if (suspended_usb3_devs && !pending_portevent) { msleep(120); pending_portevent = xhci_pending_portevent(xhci); } From be92a6a1b418031359411ed934b04630653cf7d5 Mon Sep 17 00:00:00 2001 From: James Tai Date: Wed, 24 Jan 2024 23:23:40 +0800 Subject: [PATCH 52/70] ANDROID: GKI: Remove CONFIG_MEDIA_CEC_RC This config will cause the 'CtsHdmiCecHostTestCases' test case to fail. According to the discussion in bug 309377116, it is recommended to remove this config. Bug: 322143898 Change-Id: Ied37a6c55f4198dbb9dbb9b6c3156a8a7a0bd945 Signed-off-by: James Tai --- arch/arm64/configs/gki_defconfig | 1 - arch/x86/configs/gki_defconfig | 1 - 2 files changed, 2 deletions(-) diff --git a/arch/arm64/configs/gki_defconfig b/arch/arm64/configs/gki_defconfig index c3b7a933d571..946ae28ff460 100644 --- a/arch/arm64/configs/gki_defconfig +++ b/arch/arm64/configs/gki_defconfig @@ -447,7 +447,6 @@ CONFIG_LIRC=y # CONFIG_RC_MAP is not set CONFIG_RC_DECODERS=y CONFIG_RC_DEVICES=y -CONFIG_MEDIA_CEC_RC=y # CONFIG_MEDIA_ANALOG_TV_SUPPORT is not set # CONFIG_MEDIA_DIGITAL_TV_SUPPORT is not set # CONFIG_MEDIA_RADIO_SUPPORT is not set diff --git a/arch/x86/configs/gki_defconfig b/arch/x86/configs/gki_defconfig index 44f243dc72b8..01aab1b36c65 100644 --- a/arch/x86/configs/gki_defconfig +++ b/arch/x86/configs/gki_defconfig @@ -413,7 +413,6 @@ CONFIG_LIRC=y # CONFIG_RC_MAP is not set CONFIG_RC_DECODERS=y CONFIG_RC_DEVICES=y -CONFIG_MEDIA_CEC_RC=y # CONFIG_MEDIA_ANALOG_TV_SUPPORT is not set # CONFIG_MEDIA_DIGITAL_TV_SUPPORT is not set # CONFIG_MEDIA_RADIO_SUPPORT is not set From 990d341477107a6808beff1e15b828b92e4cff13 Mon Sep 17 00:00:00 2001 From: Qais Yousef Date: Thu, 25 Jan 2024 02:09:22 +0000 Subject: [PATCH 53/70] ANDROID: Update the ABI symbol list Adding the following symbols: - max_load_balance_interval - static_key_count Bug: 269111781 Change-Id: Iebb995e32afbdca06c1634ee75eccbfe579aa16e Signed-off-by: Qais Yousef --- android/abi_gki_aarch64.stg | 25 +++++++++++++++++++++++++ android/abi_gki_aarch64_pixel | 2 ++ 2 files changed, 27 insertions(+) diff --git a/android/abi_gki_aarch64.stg b/android/abi_gki_aarch64.stg index 0c0a458c329f..219dac5c2765 100644 --- a/android/abi_gki_aarch64.stg +++ b/android/abi_gki_aarch64.stg @@ -313044,6 +313044,11 @@ function { return_type_id: 0x6720d32f parameter_id: 0x2e8ad82b } +function { + id: 0x962258fc + return_type_id: 0x6720d32f + parameter_id: 0x2e8aef4d +} function { id: 0x9625cb57 return_type_id: 0x6720d32f @@ -371684,6 +371689,15 @@ elf_symbol { type_id: 0x9c585b1a full_name: "match_token" } +elf_symbol { + id: 0xfe698851 + name: "max_load_balance_interval" + is_defined: true + symbol_type: OBJECT + crc: 0xae14740f + type_id: 0x33756485 + full_name: "max_load_balance_interval" +} elf_symbol { id: 0x588e0fe2 name: "mbox_chan_received_data" @@ -390152,6 +390166,15 @@ elf_symbol { type_id: 0x394e2c9b full_name: "start_poll_synchronize_srcu" } +elf_symbol { + id: 0x03273441 + name: "static_key_count" + is_defined: true + symbol_type: FUNCTION + crc: 0x389b64a2 + type_id: 0x962258fc + full_name: "static_key_count" +} elf_symbol { id: 0xc24d49e4 name: "static_key_disable" @@ -405365,6 +405388,7 @@ interface { symbol_id: 0xcc9bd833 symbol_id: 0x97e555df symbol_id: 0x61c53930 + symbol_id: 0xfe698851 symbol_id: 0x588e0fe2 symbol_id: 0xdaf86712 symbol_id: 0xd8f7e87d @@ -407417,6 +407441,7 @@ interface { symbol_id: 0xbd07e567 symbol_id: 0xf304733e symbol_id: 0x153d2098 + symbol_id: 0x03273441 symbol_id: 0xc24d49e4 symbol_id: 0x8ac195eb symbol_id: 0xd09568e0 diff --git a/android/abi_gki_aarch64_pixel b/android/abi_gki_aarch64_pixel index 833c5c316eb5..36ea77b35ffa 100644 --- a/android/abi_gki_aarch64_pixel +++ b/android/abi_gki_aarch64_pixel @@ -1317,6 +1317,7 @@ loops_per_jiffy mac_pton mas_empty_area_rev + max_load_balance_interval mbox_chan_received_data mbox_controller_register mbox_controller_unregister @@ -2139,6 +2140,7 @@ srcu_notifier_chain_unregister sscanf __stack_chk_fail + static_key_count static_key_disable static_key_enable static_key_slow_dec From c249740414d6dde3dd01b72fa0409075d968efb7 Mon Sep 17 00:00:00 2001 From: Qais Yousef Date: Mon, 18 Dec 2023 16:58:05 +0000 Subject: [PATCH 54/70] ANDROID: idle_inject: Export function symbols To enable out of tree drivers that are based on top of this functionality. Bug: 316903397 Change-Id: I96bd84b805b984ebbc3fe0ac4badcd62bb00418b Signed-off-by: Qais Yousef --- drivers/powercap/idle_inject.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/powercap/idle_inject.c b/drivers/powercap/idle_inject.c index 999e218d7793..9bc8add42ebd 100644 --- a/drivers/powercap/idle_inject.c +++ b/drivers/powercap/idle_inject.c @@ -159,6 +159,7 @@ void idle_inject_set_duration(struct idle_inject_device *ii_dev, WRITE_ONCE(ii_dev->idle_duration_us, idle_duration_us); } } +EXPORT_SYMBOL_GPL(idle_inject_set_duration); /** * idle_inject_get_duration - idle and run duration retrieval helper @@ -172,6 +173,7 @@ void idle_inject_get_duration(struct idle_inject_device *ii_dev, *run_duration_us = READ_ONCE(ii_dev->run_duration_us); *idle_duration_us = READ_ONCE(ii_dev->idle_duration_us); } +EXPORT_SYMBOL_GPL(idle_inject_get_duration); /** * idle_inject_set_latency - set the maximum latency allowed @@ -182,6 +184,7 @@ void idle_inject_set_latency(struct idle_inject_device *ii_dev, { WRITE_ONCE(ii_dev->latency_us, latency_us); } +EXPORT_SYMBOL_GPL(idle_inject_set_latency); /** * idle_inject_start - start idle injections @@ -213,6 +216,7 @@ int idle_inject_start(struct idle_inject_device *ii_dev) return 0; } +EXPORT_SYMBOL_GPL(idle_inject_start); /** * idle_inject_stop - stops idle injections @@ -259,6 +263,7 @@ void idle_inject_stop(struct idle_inject_device *ii_dev) cpu_hotplug_enable(); } +EXPORT_SYMBOL_GPL(idle_inject_stop); /** * idle_inject_setup - prepare the current task for idle injection @@ -334,6 +339,7 @@ out_rollback: return NULL; } +EXPORT_SYMBOL_GPL(idle_inject_register); /** * idle_inject_unregister - unregister idle injection control device @@ -354,6 +360,7 @@ void idle_inject_unregister(struct idle_inject_device *ii_dev) kfree(ii_dev); } +EXPORT_SYMBOL_GPL(idle_inject_unregister); static struct smp_hotplug_thread idle_inject_threads = { .store = &idle_inject_thread.tsk, From 7088d250bf59f36a2c156465e1b3fcebefd70373 Mon Sep 17 00:00:00 2001 From: Qais Yousef Date: Thu, 25 Jan 2024 15:12:45 +0000 Subject: [PATCH 55/70] ANDROID: Update the ABI symbol list Adding the following symbols: - idle_inject_get_duration - idle_inject_register - idle_inject_set_duration - idle_inject_set_latency - idle_inject_start - idle_inject_stop Bug: 316903397 Change-Id: I528b90dd34fe0cd2b64b2b615029152d9a3bce60 Signed-off-by: Qais Yousef --- android/abi_gki_aarch64.stg | 137 ++++++++++++++++++++++++++++++++++ android/abi_gki_aarch64_pixel | 6 ++ 2 files changed, 143 insertions(+) diff --git a/android/abi_gki_aarch64.stg b/android/abi_gki_aarch64.stg index 219dac5c2765..62d10761c046 100644 --- a/android/abi_gki_aarch64.stg +++ b/android/abi_gki_aarch64.stg @@ -28198,6 +28198,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0xd88f2091 } +pointer_reference { + id: 0x3cbd250a + kind: POINTER + pointee_type_id: 0xd8b472b6 +} pointer_reference { id: 0x3cc5d159 kind: POINTER @@ -67369,6 +67374,12 @@ member { type_id: 0xc8e4d7d1 offset: 384 } +member { + id: 0x3dfda6f6 + name: "cpumask" + type_id: 0xc8e4d7d1 + offset: 704 +} member { id: 0x954a0e7b name: "cpupri" @@ -104644,6 +104655,12 @@ member { offset: 2561 bitsize: 1 } +member { + id: 0xaea1d4b8 + name: "idle_duration_us" + type_id: 0x4585663f + offset: 576 +} member { id: 0xafe870ea name: "idle_h_nr_running" @@ -115129,6 +115146,12 @@ member { type_id: 0x160238dd offset: 2688 } +member { + id: 0x1e84361d + name: "latency_us" + type_id: 0x4585663f + offset: 640 +} member { id: 0xac824246 name: "latest_granting" @@ -168719,6 +168742,12 @@ member { type_id: 0xd5df6730 offset: 64 } +member { + id: 0x424a09e3 + name: "run_duration_us" + type_id: 0x4585663f + offset: 608 +} member { id: 0x9f0f9059 name: "run_graceperiod" @@ -234623,6 +234652,19 @@ struct_union { member_id: 0x2de9701e } } +struct_union { + id: 0xd8b472b6 + kind: STRUCT + name: "idle_inject_device" + definition { + bytesize: 88 + member_id: 0x1dce6e8e + member_id: 0xaea1d4b8 + member_id: 0x424a09e3 + member_id: 0x1e84361d + member_id: 0x3dfda6f6 + } +} struct_union { id: 0x04b89667 kind: STRUCT @@ -298961,6 +299003,12 @@ function { parameter_id: 0x054f691a parameter_id: 0x27847a9a } +function { + id: 0x1ea10d49 + return_type_id: 0x48b5725f + parameter_id: 0x3cbd250a + parameter_id: 0x4585663f +} function { id: 0x1ea1f34b return_type_id: 0x48b5725f @@ -298989,6 +299037,13 @@ function { parameter_id: 0x3b461cc8 parameter_id: 0xc9082b19 } +function { + id: 0x1eb06c10 + return_type_id: 0x48b5725f + parameter_id: 0x3cbd250a + parameter_id: 0x4585663f + parameter_id: 0x4585663f +} function { id: 0x1eb41c27 return_type_id: 0x48b5725f @@ -299948,6 +300003,11 @@ function { parameter_id: 0x3e19e681 parameter_id: 0x2afee447 } +function { + id: 0x1fb718d1 + return_type_id: 0x48b5725f + parameter_id: 0x3cbd250a +} function { id: 0x1fb862d7 return_type_id: 0x48b5725f @@ -300065,6 +300125,13 @@ function { parameter_id: 0x3104f372 parameter_id: 0x6720d32f } +function { + id: 0x1fde2109 + return_type_id: 0x48b5725f + parameter_id: 0x3cbd250a + parameter_id: 0x1bf16028 + parameter_id: 0x1bf16028 +} function { id: 0x1fdf0b41 return_type_id: 0x48b5725f @@ -303977,6 +304044,11 @@ function { return_type_id: 0x0130219f parameter_id: 0x0130219f } +function { + id: 0x65981286 + return_type_id: 0x3cbd250a + parameter_id: 0x38fa32ef +} function { id: 0x65a73fe6 return_type_id: 0x3ccb45d9 @@ -309860,6 +309932,11 @@ function { parameter_id: 0x15a30023 parameter_id: 0x146a39bf } +function { + id: 0x92afaa6d + return_type_id: 0x6720d32f + parameter_id: 0x3cbd250a +} function { id: 0x92b5578e return_type_id: 0x6720d32f @@ -366441,6 +366518,60 @@ elf_symbol { type_id: 0x1d307b55 full_name: "ida_free" } +elf_symbol { + id: 0xed9fa8eb + name: "idle_inject_get_duration" + is_defined: true + symbol_type: FUNCTION + crc: 0xe9cbcfd0 + type_id: 0x1fde2109 + full_name: "idle_inject_get_duration" +} +elf_symbol { + id: 0xba016e8c + name: "idle_inject_register" + is_defined: true + symbol_type: FUNCTION + crc: 0xd9693e02 + type_id: 0x65981286 + full_name: "idle_inject_register" +} +elf_symbol { + id: 0xdcaf9152 + name: "idle_inject_set_duration" + is_defined: true + symbol_type: FUNCTION + crc: 0xc18575af + type_id: 0x1eb06c10 + full_name: "idle_inject_set_duration" +} +elf_symbol { + id: 0x6a3603c1 + name: "idle_inject_set_latency" + is_defined: true + symbol_type: FUNCTION + crc: 0x95e93783 + type_id: 0x1ea10d49 + full_name: "idle_inject_set_latency" +} +elf_symbol { + id: 0xef70cf07 + name: "idle_inject_start" + is_defined: true + symbol_type: FUNCTION + crc: 0x5b3a2cd6 + type_id: 0x92afaa6d + full_name: "idle_inject_start" +} +elf_symbol { + id: 0x1f7b646d + name: "idle_inject_stop" + is_defined: true + symbol_type: FUNCTION + crc: 0x85c2b7eb + type_id: 0x1fb718d1 + full_name: "idle_inject_stop" +} elf_symbol { id: 0x7f40c9c2 name: "idr_alloc" @@ -404805,6 +404936,12 @@ interface { symbol_id: 0x58de8ff6 symbol_id: 0xb9a0744d symbol_id: 0x9c458796 + symbol_id: 0xed9fa8eb + symbol_id: 0xba016e8c + symbol_id: 0xdcaf9152 + symbol_id: 0x6a3603c1 + symbol_id: 0xef70cf07 + symbol_id: 0x1f7b646d symbol_id: 0x7f40c9c2 symbol_id: 0x3b6f5da6 symbol_id: 0x4a59ab5d diff --git a/android/abi_gki_aarch64_pixel b/android/abi_gki_aarch64_pixel index 36ea77b35ffa..611343b9f9ab 100644 --- a/android/abi_gki_aarch64_pixel +++ b/android/abi_gki_aarch64_pixel @@ -1057,6 +1057,12 @@ ida_alloc_range ida_destroy ida_free + idle_inject_get_duration + idle_inject_register + idle_inject_set_duration + idle_inject_set_latency + idle_inject_start + idle_inject_stop idr_alloc idr_alloc_cyclic idr_destroy From 6c32acf537f9dad87d9dc82939c02fd34b6ae641 Mon Sep 17 00:00:00 2001 From: Vincent Guittot Date: Fri, 13 Jan 2023 14:36:13 +0100 Subject: [PATCH 56/70] UPSTREAM: sched/fair: Limit sched slice duration In presence of a lot of small weight tasks like sched_idle tasks, normal or high weight tasks can see their ideal runtime (sched_slice) to increase to hundreds ms whereas it normally stays below sysctl_sched_latency. 2 normal tasks running on a CPU will have a max sched_slice of 12ms (half of the sched_period). This means that they will make progress every sysctl_sched_latency period. If we now add 1000 idle tasks on the CPU, the sched_period becomes 3006 ms and the ideal runtime of the normal tasks becomes 609 ms. It will even become 1500ms if the idle tasks belongs to an idle cgroup. This means that the scheduler will look for picking another waiting task after 609ms running time (1500ms respectively). The idle tasks change significantly the way the 2 normal tasks interleave their running time slot whereas they should have a small impact. Such long sched_slice can delay significantly the release of resources as the tasks can wait hundreds of ms before the next running slot just because of idle tasks queued on the rq. Cap the ideal_runtime to sysctl_sched_latency to make sure that tasks will regularly make progress and will not be significantly impacted by idle/background tasks queued on the rq. Bug: 315185352 Bug: 269111781 Change-Id: I27f956ee275d17ef708d8d27dc082c66ed5a5275 Signed-off-by: Vincent Guittot Signed-off-by: Ingo Molnar Tested-by: Dietmar Eggemann Link: https://lore.kernel.org/r/20230113133613.257342-1-vincent.guittot@linaro.org (cherry picked from commit 79ba1e607d68178db7d3fe4f6a4aa38f06805e7b) Signed-off-by: Qais Yousef (cherry picked from commit e32aeb03b9c6b1b625ff0248b6d5670aa74e783b) Signed-off-by: Qais Yousef --- kernel/sched/fair.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index f0d68a636da1..e2ab638162b9 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4947,7 +4947,13 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr) s64 delta; bool skip_preempt = false; - ideal_runtime = sched_slice(cfs_rq, curr); + /* + * When many tasks blow up the sched_period; it is possible that + * sched_slice() reports unusually large results (when many tasks are + * very light for example). Therefore impose a maximum. + */ + ideal_runtime = min_t(u64, sched_slice(cfs_rq, curr), sysctl_sched_latency); + delta_exec = curr->sum_exec_runtime - curr->prev_sum_exec_runtime; trace_android_rvh_check_preempt_tick(current, &ideal_runtime, &skip_preempt, delta_exec, cfs_rq, curr, sysctl_sched_min_granularity); From 473a8713158e845c1d621b71c9c57c5affe72f8d Mon Sep 17 00:00:00 2001 From: Marc Zyngier Date: Mon, 29 May 2023 16:21:42 +0100 Subject: [PATCH 57/70] BACKPORT: irqchip/gic-v3: Improve affinity helper The GICv3 driver uses multiple formats for the affinity, all derived from a reading of MPDR_EL1 on one CPU or another. Simplify the handling of these affinity by moving the access to the CPU affinity via cpu_logical_map() inside the helper, and rename it accordingly. This will be helpful to support some more broken hardware. Signed-off-by: Marc Zyngier Bug: 282025214 Change-Id: I2e6b9861d20336bec689a2e704b7fc50035841e7 (cherry picked from commit 3c65cbb7c5ebb4247968936899580c7f508ed223) [meitao: Resolved minor conflict in drivers/irqchip/irq-gic-v3.c ] Signed-off-by: meitaogao (cherry picked from commit 035e150e1af7221255b952865aaf80a4c1c6d96d) --- drivers/irqchip/irq-gic-v3.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index b0c065108bb7..7756ef3919dc 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -648,8 +648,9 @@ static int gic_irq_set_vcpu_affinity(struct irq_data *d, void *vcpu) return 0; } -static u64 gic_mpidr_to_affinity(unsigned long mpidr) +static u64 gic_cpu_to_affinity(int cpu) { + u64 mpidr = cpu_logical_map(cpu); u64 aff; aff = ((u64)MPIDR_AFFINITY_LEVEL(mpidr, 3) << 32 | @@ -906,7 +907,7 @@ void gic_v3_dist_init(void) * Set all global interrupts to the boot CPU only. ARE must be * enabled. */ - affinity = gic_mpidr_to_affinity(cpu_logical_map(smp_processor_id())); + affinity = gic_cpu_to_affinity(smp_processor_id()); for (i = 32; i < GIC_LINE_NR; i++) { trace_android_vh_gic_v3_affinity_init(i, GICD_IROUTER, &affinity); gic_write_irouter(affinity, base + GICD_IROUTER + i * 8); @@ -960,7 +961,7 @@ static int gic_iterate_rdists(int (*fn)(struct redist_region *, void __iomem *)) static int __gic_populate_rdist(struct redist_region *region, void __iomem *ptr) { - unsigned long mpidr = cpu_logical_map(smp_processor_id()); + unsigned long mpidr; u64 typer; u32 aff; @@ -968,6 +969,8 @@ static int __gic_populate_rdist(struct redist_region *region, void __iomem *ptr) * Convert affinity to a 32bit value that can be matched to * GICR_TYPER bits [63:32]. */ + mpidr = gic_cpu_to_affinity(smp_processor_id()); + aff = (MPIDR_AFFINITY_LEVEL(mpidr, 3) << 24 | MPIDR_AFFINITY_LEVEL(mpidr, 2) << 16 | MPIDR_AFFINITY_LEVEL(mpidr, 1) << 8 | @@ -1081,7 +1084,7 @@ static inline bool gic_dist_security_disabled(void) static void gic_cpu_sys_reg_init(void) { int i, cpu = smp_processor_id(); - u64 mpidr = cpu_logical_map(cpu); + u64 mpidr = gic_cpu_to_affinity(cpu); u64 need_rss = MPIDR_RS(mpidr); bool group0; u32 pribits; @@ -1180,11 +1183,11 @@ static void gic_cpu_sys_reg_init(void) for_each_online_cpu(i) { bool have_rss = per_cpu(has_rss, i) && per_cpu(has_rss, cpu); - need_rss |= MPIDR_RS(cpu_logical_map(i)); + need_rss |= MPIDR_RS(gic_cpu_to_affinity(i)); if (need_rss && (!have_rss)) pr_crit("CPU%d (%lx) can't SGI CPU%d (%lx), no RSS\n", cpu, (unsigned long)mpidr, - i, (unsigned long)cpu_logical_map(i)); + i, (unsigned long)gic_cpu_to_affinity(i)); } /** @@ -1261,9 +1264,11 @@ static u16 gic_compute_target_list(int *base_cpu, const struct cpumask *mask, unsigned long cluster_id) { int next_cpu, cpu = *base_cpu; - unsigned long mpidr = cpu_logical_map(cpu); + unsigned long mpidr; u16 tlist = 0; + mpidr = gic_cpu_to_affinity(cpu); + while (cpu < nr_cpu_ids) { tlist |= 1 << (mpidr & 0xf); @@ -1272,7 +1277,7 @@ static u16 gic_compute_target_list(int *base_cpu, const struct cpumask *mask, goto out; cpu = next_cpu; - mpidr = cpu_logical_map(cpu); + mpidr = gic_cpu_to_affinity(cpu); if (cluster_id != MPIDR_TO_SGI_CLUSTER_ID(mpidr)) { cpu--; @@ -1317,7 +1322,7 @@ static void gic_ipi_send_mask(struct irq_data *d, const struct cpumask *mask) dsb(ishst); for_each_cpu(cpu, mask) { - u64 cluster_id = MPIDR_TO_SGI_CLUSTER_ID(cpu_logical_map(cpu)); + u64 cluster_id = MPIDR_TO_SGI_CLUSTER_ID(gic_cpu_to_affinity(cpu)); u16 tlist; tlist = gic_compute_target_list(&cpu, mask, cluster_id); @@ -1377,7 +1382,7 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val, offset = convert_offset_index(d, GICD_IROUTER, &index); reg = gic_dist_base(d) + offset + (index * 8); - val = gic_mpidr_to_affinity(cpu_logical_map(cpu)); + val = gic_cpu_to_affinity(cpu); trace_android_rvh_gic_v3_set_affinity(d, mask_val, &val, force, gic_dist_base(d), gic_data.redist_regions[0].redist_base, From 4f668f5682f87744f661cfc896454432c07a4aa4 Mon Sep 17 00:00:00 2001 From: zhengyan Date: Mon, 22 May 2023 19:06:43 +0800 Subject: [PATCH 58/70] BACKPORT: irqchip/gic-v3: Work around affinity issues on ASR8601 The ASR8601 SoC combines ARMv8.2 CPUs from ARM with a GIC-500, also from ARM. However, the two are incompatible as the former expose an affinity in the form of (cluster, core, thread), while the latter can only deal with (cluster, core). If nothing is done, the GIC simply cannot route interrupts to the CPUs. Implement a workaround that shifts the affinity down by a level, ensuring the delivery of interrupts despite the implementation mismatch. Signed-off-by: zhengyan [maz: rewrote commit message, reimplemented the workaround in a manageable way] Signed-off-by: Marc Zyngier Bug: 282025214 Change-Id: Id62a4f45ec52c1de543bbd712879dc34688d7904 (cherry picked from commit b4d81fab1ed0b302c71a869e5b93d81dfbfd3175) [meitao: Resolved minor conflict in drivers/irqchip/irq-gic-v3.c ] Signed-off-by: meitaogao (cherry picked from commit f17cd56e4e4273eef892e424adb030ec8e96b095) --- Documentation/arm64/silicon-errata.rst | 4 ++++ drivers/irqchip/irq-gic-v3.c | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/Documentation/arm64/silicon-errata.rst b/Documentation/arm64/silicon-errata.rst index e252004fb8b7..ebd457a4971b 100644 --- a/Documentation/arm64/silicon-errata.rst +++ b/Documentation/arm64/silicon-errata.rst @@ -217,3 +217,7 @@ stable kernels. +----------------+-----------------+-----------------+-----------------------------+ | Fujitsu | A64FX | E#010001 | FUJITSU_ERRATUM_010001 | +----------------+-----------------+-----------------+-----------------------------+ + ++----------------+-----------------+-----------------+-----------------------------+ +| ASR | ASR8601 | #8601001 | N/A | ++----------------+-----------------+-----------------+-----------------------------+ diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 7756ef3919dc..fdf889d77c90 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -39,6 +39,7 @@ #define FLAGS_WORKAROUND_GICR_WAKER_MSM8996 (1ULL << 0) #define FLAGS_WORKAROUND_CAVIUM_ERRATUM_38539 (1ULL << 1) #define FLAGS_WORKAROUND_MTK_GICR_SAVE (1ULL << 2) +#define FLAGS_WORKAROUND_ASR_ERRATUM_8601001 (1ULL << 3) #define GIC_IRQ_TYPE_PARTITION (GIC_IRQ_TYPE_LPI + 1) @@ -653,6 +654,11 @@ static u64 gic_cpu_to_affinity(int cpu) u64 mpidr = cpu_logical_map(cpu); u64 aff; + /* ASR8601 needs to have its affinities shifted down... */ + if (unlikely(gic_data.flags & FLAGS_WORKAROUND_ASR_ERRATUM_8601001)) + mpidr = (MPIDR_AFFINITY_LEVEL(mpidr, 1) | + (MPIDR_AFFINITY_LEVEL(mpidr, 2) << 8)); + aff = ((u64)MPIDR_AFFINITY_LEVEL(mpidr, 3) << 32 | MPIDR_AFFINITY_LEVEL(mpidr, 2) << 16 | MPIDR_AFFINITY_LEVEL(mpidr, 1) << 8 | @@ -1803,6 +1809,15 @@ static bool gic_enable_quirk_arm64_2941627(void *data) return true; } +static bool gic_enable_quirk_asr8601(void *data) +{ + struct gic_chip_data_v3 *d = data; + + d->flags |= FLAGS_WORKAROUND_ASR_ERRATUM_8601001; + + return true; +} + static const struct gic_quirk gic_quirks[] = { { .desc = "GICv3: Qualcomm MSM8996 broken firmware", @@ -1814,6 +1829,11 @@ static const struct gic_quirk gic_quirks[] = { .property = "mediatek,broken-save-restore-fw", .init = gic_enable_quirk_mtk_gicr, }, + { + .desc = "GICv3: ASR erratum 8601001", + .compatible = "asr,asr8601-gic-v3", + .init = gic_enable_quirk_asr8601, + }, { .desc = "GICv3: HIP06 erratum 161010803", .iidr = 0x0204043b, From 2730733d54b61c35b835ce5c21fab0e280e52577 Mon Sep 17 00:00:00 2001 From: Daniel Mentz Date: Wed, 10 Jan 2024 02:33:05 -0800 Subject: [PATCH 59/70] ANDROID: gki_defconfig: Enable CONFIG_NVME_MULTIPATH Enable NVMe multipath support to get access to /dev/nvmeXnY block devices. Bug: 318459546 Change-Id: Id452462b4dbb474f1e3a53f5010f09edf63642bc Signed-off-by: Daniel Mentz --- arch/arm64/configs/gki_defconfig | 1 + arch/x86/configs/gki_defconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/arm64/configs/gki_defconfig b/arch/arm64/configs/gki_defconfig index 946ae28ff460..dbf1e1ca23fd 100644 --- a/arch/arm64/configs/gki_defconfig +++ b/arch/arm64/configs/gki_defconfig @@ -316,6 +316,7 @@ CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=8192 CONFIG_BLK_DEV_UBLK=y CONFIG_BLK_DEV_NVME=y +CONFIG_NVME_MULTIPATH=y CONFIG_SRAM=y CONFIG_UID_SYS_STATS=y CONFIG_SCSI=y diff --git a/arch/x86/configs/gki_defconfig b/arch/x86/configs/gki_defconfig index 01aab1b36c65..8330afe50d28 100644 --- a/arch/x86/configs/gki_defconfig +++ b/arch/x86/configs/gki_defconfig @@ -302,6 +302,7 @@ CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=8192 CONFIG_BLK_DEV_UBLK=y CONFIG_BLK_DEV_NVME=y +CONFIG_NVME_MULTIPATH=y CONFIG_SRAM=y CONFIG_UID_SYS_STATS=y CONFIG_SCSI=y From 9265fa90c1dd50ae4d3885494a70856090de62d3 Mon Sep 17 00:00:00 2001 From: Udipto Goswami Date: Wed, 10 Jan 2024 15:28:14 +0530 Subject: [PATCH 60/70] FROMLIST: usb: core: Prevent null pointer dereference in update_port_device_state Currently, the function update_port_device_state gets the usb_hub from udev->parent by calling usb_hub_to_struct_hub. However, in case the actconfig or the maxchild is 0, the usb_hub would be NULL and upon further accessing to get port_dev would result in null pointer dereference. Fix this by introducing an if check after the usb_hub is populated. Fixes: 83cb2604f641 ("usb: core: add sysfs entry for usb device state") Cc: stable@vger.kernel.org Signed-off-by: Udipto Goswami Reviewed-by: Alan Stern Bug: 321600650 Link: https://lore.kernel.org/all/20240110095814.7626-1-quic_ugoswami@quicinc.com/ Change-Id: I3fef553dce36a7ec2d335008fe8d51d848d6abd2 Signed-off-by: Rajashekar kuruva --- drivers/usb/core/hub.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index f2c561ae4bfe..e32b1d3a11ae 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -2033,9 +2033,19 @@ static void update_port_device_state(struct usb_device *udev) if (udev->parent) { hub = usb_hub_to_struct_hub(udev->parent); - port_dev = hub->ports[udev->portnum - 1]; - WRITE_ONCE(port_dev->state, udev->state); - sysfs_notify_dirent(port_dev->state_kn); + + /* + * The Link Layer Validation System Driver (lvstest) + * has a test step to unbind the hub before running the + * rest of the procedure. This triggers hub_disconnect + * which will set the hub's maxchild to 0, further + * resulting in usb_hub_to_struct_hub returning NULL. + */ + if (hub) { + port_dev = hub->ports[udev->portnum - 1]; + WRITE_ONCE(port_dev->state, udev->state); + sysfs_notify_dirent(port_dev->state_kn); + } } } From 599710db0fe6f7d4e1fd0d85c5f89125b9d8f246 Mon Sep 17 00:00:00 2001 From: Uttkarsh Aggarwal Date: Fri, 19 Jan 2024 15:18:25 +0530 Subject: [PATCH 61/70] FROMGIT: usb: dwc3: gadget: Fix NULL pointer dereference in dwc3_gadget_suspend In current scenario if Plug-out and Plug-In performed continuously there could be a chance while checking for dwc->gadget_driver in dwc3_gadget_suspend, a NULL pointer dereference may occur. Call Stack: CPU1: CPU2: gadget_unbind_driver dwc3_suspend_common dwc3_gadget_stop dwc3_gadget_suspend dwc3_disconnect_gadget CPU1 basically clears the variable and CPU2 checks the variable. Consider CPU1 is running and right before gadget_driver is cleared and in parallel CPU2 executes dwc3_gadget_suspend where it finds dwc->gadget_driver which is not NULL and resumes execution and then CPU1 completes execution. CPU2 executes dwc3_disconnect_gadget where it checks dwc->gadget_driver is already NULL because of which the NULL pointer deference occur. Cc: Fixes: 9772b47a4c29 ("usb: dwc3: gadget: Fix suspend/resume during device mode") Acked-by: Thinh Nguyen Signed-off-by: Uttkarsh Aggarwal (cherry picked from commit 61a348857e869432e6a920ad8ea9132e8d44c316 ) Bug: 322899161 Link: https://lore.kernel.org/all/20240119094825.26530-1-quic_uaggarwa@quicinc.com/ Change-Id: I2f1663f19ebdd6c6b5b1874a66c81fd3f75b0e9a Signed-off-by: Rajashekar kuruva --- drivers/usb/dwc3/gadget.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 121092e35ec6..c9c6255a047b 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -4590,15 +4590,13 @@ int dwc3_gadget_suspend(struct dwc3 *dwc) unsigned long flags; int ret; - if (!dwc->gadget_driver) - return 0; - ret = dwc3_gadget_soft_disconnect(dwc); if (ret) goto err; spin_lock_irqsave(&dwc->lock, flags); - dwc3_disconnect_gadget(dwc); + if (dwc->gadget_driver) + dwc3_disconnect_gadget(dwc); spin_unlock_irqrestore(&dwc->lock, flags); return 0; From a0b3b39898f7a2900f6b5309657191edbb7522ca Mon Sep 17 00:00:00 2001 From: meitaogao Date: Mon, 29 Jan 2024 16:56:44 +0800 Subject: [PATCH 62/70] ANDROID: GKI: Add ASR KMI symbol list INFO: 4 function symbol(s) added 'void clk_rate_exclusive_put(struct clk*)' 'int clk_set_rate_exclusive(struct clk*, unsigned long)' 'void sdhci_enable_sdio_irq(struct mmc_host*, int)' 'void sdhci_send_tuning(struct sdhci_host*, u32)' Bug: 322838719 Change-Id: Icd2e4f245fd146c065e8192a6ceb9dc2171dadb0 Signed-off-by: meitaogao --- BUILD.bazel | 1 + android/abi_gki_aarch64.stg | 40 ++++++++++++++++++++++++++++++++++ android/abi_gki_aarch64_asr | 43 +++++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 android/abi_gki_aarch64_asr diff --git a/BUILD.bazel b/BUILD.bazel index f1a46b2e796c..80f3b1b34d14 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -99,6 +99,7 @@ filegroup( name = "aarch64_additional_kmi_symbol_lists", srcs = [ # keep sorted + "android/abi_gki_aarch64_asr", "android/abi_gki_aarch64_asus", "android/abi_gki_aarch64_db845c", "android/abi_gki_aarch64_exynos", diff --git a/android/abi_gki_aarch64.stg b/android/abi_gki_aarch64.stg index 62d10761c046..0bf67c8ad4f6 100644 --- a/android/abi_gki_aarch64.stg +++ b/android/abi_gki_aarch64.stg @@ -349751,6 +349751,15 @@ elf_symbol { type_id: 0x1febeb84 full_name: "clk_put" } +elf_symbol { + id: 0xfb0bf054 + name: "clk_rate_exclusive_put" + is_defined: true + symbol_type: FUNCTION + crc: 0xacb4d88c + type_id: 0x1febeb84 + full_name: "clk_rate_exclusive_put" +} elf_symbol { id: 0xbfeba170 name: "clk_register" @@ -349877,6 +349886,15 @@ elf_symbol { type_id: 0x923e8caa full_name: "clk_set_rate" } +elf_symbol { + id: 0x7c95444b + name: "clk_set_rate_exclusive" + is_defined: true + symbol_type: FUNCTION + crc: 0xc5604800 + type_id: 0x923e8caa + full_name: "clk_set_rate_exclusive" +} elf_symbol { id: 0x7fbd0d58 name: "clk_sync_state" @@ -385256,6 +385274,15 @@ elf_symbol { type_id: 0x1c822746 full_name: "sdhci_enable_clk" } +elf_symbol { + id: 0xe34ae949 + name: "sdhci_enable_sdio_irq" + is_defined: true + symbol_type: FUNCTION + crc: 0x09984b8d + type_id: 0x1c8280d3 + full_name: "sdhci_enable_sdio_irq" +} elf_symbol { id: 0x5ab300fb name: "sdhci_enable_v4_mode" @@ -385382,6 +385409,15 @@ elf_symbol { type_id: 0x93dfa305 full_name: "sdhci_runtime_suspend_host" } +elf_symbol { + id: 0x5fc5a856 + name: "sdhci_send_tuning" + is_defined: true + symbol_type: FUNCTION + crc: 0x8b902c3e + type_id: 0x1de33115 + full_name: "sdhci_send_tuning" +} elf_symbol { id: 0xd2399e18 name: "sdhci_set_bus_width" @@ -403075,6 +403111,7 @@ interface { symbol_id: 0x3452fd74 symbol_id: 0x62ee7f8a symbol_id: 0x7d1f0700 + symbol_id: 0xfb0bf054 symbol_id: 0xbfeba170 symbol_id: 0x76cb6cc8 symbol_id: 0x822d6c04 @@ -403089,6 +403126,7 @@ interface { symbol_id: 0x2b1e3d59 symbol_id: 0x98850f9d symbol_id: 0x495f0223 + symbol_id: 0x7c95444b symbol_id: 0x7fbd0d58 symbol_id: 0x06f2ea68 symbol_id: 0xc8e117f2 @@ -407018,6 +407056,7 @@ interface { symbol_id: 0xc4c7fcde symbol_id: 0x20d4dbb9 symbol_id: 0x6febaf59 + symbol_id: 0xe34ae949 symbol_id: 0x5ab300fb symbol_id: 0x33d40ef0 symbol_id: 0xeb6692c0 @@ -407032,6 +407071,7 @@ interface { symbol_id: 0xa6fc085f symbol_id: 0x4e595f64 symbol_id: 0xd94e8fae + symbol_id: 0x5fc5a856 symbol_id: 0xd2399e18 symbol_id: 0x92732196 symbol_id: 0xd29660d9 diff --git a/android/abi_gki_aarch64_asr b/android/abi_gki_aarch64_asr new file mode 100644 index 000000000000..c378a4b70c3f --- /dev/null +++ b/android/abi_gki_aarch64_asr @@ -0,0 +1,43 @@ +[abi_symbol_list] + +# required by asr5803.ko + sdhci_enable_sdio_irq + +# required by asr_serial.ko + uart_get_divisor + uart_handle_cts_change + uart_handle_dcd_change + uart_insert_char + +# required by ehci-asr-ci.ko + ehci_init_driver + ehci_setup + +# required by phy-asr-ci-usb2.ko + usb_add_phy_dev + usb_remove_phy + +# required by pvrsrvkm.ko + call_rcu + devm_devfreq_remove_device + dev_pm_opp_remove + dma_fence_array_ops + dma_fence_enable_sw_signaling + idr_replace + kthread_freezable_should_stop + rcu_barrier + +# required by sdhci_asr.ko + sdhci_resume_host + sdhci_send_tuning + sdhci_set_clock + sdhci_set_uhs_signaling + sdhci_suspend_host + +# required by vh_sched.ko + __traceiter_android_vh_map_util_freq + __tracepoint_android_vh_map_util_freq + +# required by asr_drm.ko + clk_set_rate_exclusive + clk_rate_exclusive_put From 10558542a1f4889711cde9e72d79bc607935adb1 Mon Sep 17 00:00:00 2001 From: Chungkai Mei Date: Mon, 22 Jan 2024 06:08:44 +0000 Subject: [PATCH 63/70] ANDROID: sched: export update_misfit_status symbol Current scheduler cannot update misfit status immediately when we set uclamp min for some latency-sensitive tasks, it may cause some latency for these tasks so we may need to update misfit status in vendor kernel. Bug: 318526590 Change-Id: I0f03d2e52588822d1a9ef9a5f24944dff4f4e4a0 Signed-off-by: Chungkai Mei --- kernel/sched/fair.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index e2ab638162b9..a1456fd7ced6 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4574,7 +4574,7 @@ static inline int task_fits_cpu(struct task_struct *p, int cpu) return (util_fits_cpu(util, uclamp_min, uclamp_max, cpu) > 0); } -static inline void update_misfit_status(struct task_struct *p, struct rq *rq) +inline void update_misfit_status(struct task_struct *p, struct rq *rq) { bool need_update = true; @@ -4598,6 +4598,7 @@ static inline void update_misfit_status(struct task_struct *p, struct rq *rq) */ rq->misfit_task_load = max_t(unsigned long, task_h_load(p), 1); } +EXPORT_SYMBOL_GPL(update_misfit_status); #else /* CONFIG_SMP */ From d0e2d333f9563198a436facda25556c84da596b8 Mon Sep 17 00:00:00 2001 From: Chungkai Mei Date: Tue, 30 Jan 2024 07:27:55 +0000 Subject: [PATCH 64/70] ANDROID: Update the ABI symbol list Adding the following symbols: - update_misfit_status Bug: 318526590 Change-Id: I6bd490130932021298b4c72ee68725998ff2fb69 Signed-off-by: Chungkai Mei --- android/abi_gki_aarch64.stg | 16 ++++++++++++++++ android/abi_gki_aarch64_pixel | 1 + 2 files changed, 17 insertions(+) diff --git a/android/abi_gki_aarch64.stg b/android/abi_gki_aarch64.stg index 0bf67c8ad4f6..5e6fc8618ca4 100644 --- a/android/abi_gki_aarch64.stg +++ b/android/abi_gki_aarch64.stg @@ -294439,6 +294439,12 @@ function { parameter_id: 0x1d7ca769 parameter_id: 0x295c7202 } +function { + id: 0x1766319b + return_type_id: 0x48b5725f + parameter_id: 0x1d19a9d5 + parameter_id: 0x2e029f76 +} function { id: 0x176c2cc0 return_type_id: 0x48b5725f @@ -395061,6 +395067,15 @@ elf_symbol { type_id: 0x945a66f1 full_name: "update_devfreq" } +elf_symbol { + id: 0xcac5efbb + name: "update_misfit_status" + is_defined: true + symbol_type: FUNCTION + crc: 0x7e7e60ad + type_id: 0x1766319b + full_name: "update_misfit_status" +} elf_symbol { id: 0xa32cb360 name: "update_rq_clock" @@ -408144,6 +408159,7 @@ interface { symbol_id: 0xe109b3fc symbol_id: 0xb9af2013 symbol_id: 0x2867d724 + symbol_id: 0xcac5efbb symbol_id: 0xa32cb360 symbol_id: 0x45dcd84f symbol_id: 0x54ba3937 diff --git a/android/abi_gki_aarch64_pixel b/android/abi_gki_aarch64_pixel index 611343b9f9ab..6542846a3ddb 100644 --- a/android/abi_gki_aarch64_pixel +++ b/android/abi_gki_aarch64_pixel @@ -2581,6 +2581,7 @@ update_devfreq ___update_load_avg ___update_load_sum + update_misfit_status update_rq_clock up_read up_write From b6be1a36f7b19dcea16bb53b6eb980207c65215f Mon Sep 17 00:00:00 2001 From: "T.J. Mercier" Date: Fri, 26 Jan 2024 21:19:25 +0000 Subject: [PATCH 65/70] FROMGIT: mm: memcg: don't periodically flush stats when memcg is disabled The root memcg is onlined even when memcg is disabled. When it's onlined a 2 second periodic stat flush is started, but no stat flushing is required when memcg is disabled because there can be no child memcgs. Most calls to flush memcg stats are avoided when memcg is disabled as a result of the mem_cgroup_disabled check added in 7d7ef0a4686a ("mm: memcg: restore subtree stats flushing"), but the periodic flushing started in mem_cgroup_css_online is not. Skip it. Link: https://lkml.kernel.org/r/20240126211927.1171338-1-tjmercier@google.com Fixes: aa48e47e3906 ("memcg: infrastructure to flush memcg stats") Change-Id: Iae6aeb3091d349898ea4987a784a971d9b3c97f7 Signed-off-by: T.J. Mercier Acked-by: Shakeel Butt Acked-by: Johannes Weiner Acked-by: Chris Li Reported-by: Minchan Kim Cc: Michal Hocko Cc: Muchun Song Cc: Roman Gushchin Signed-off-by: Andrew Morton (cherry picked from commit 7e9bccbe57812f888f51d46d7cdbc6327eee24f3 https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git/ mm-unstable) Signed-off-by: T.J. Mercier --- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 1127aba1752b..180f75846935 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -5401,7 +5401,7 @@ static int mem_cgroup_css_online(struct cgroup_subsys_state *css) refcount_set(&memcg->id.ref, 1); css_get(css); - if (unlikely(mem_cgroup_is_root(memcg))) + if (unlikely(mem_cgroup_is_root(memcg)) && !mem_cgroup_disabled()) queue_delayed_work(system_unbound_wq, &stats_flush_dwork, 2UL*HZ); lru_gen_online_memcg(memcg); From 067a03c44e1a06b075fd52f32ab1eaee345562b3 Mon Sep 17 00:00:00 2001 From: Subrahmanyam Guthena Date: Tue, 30 Jan 2024 20:29:37 +0000 Subject: [PATCH 66/70] ANDROID: GKI: Add Pasa symbol list Add iio_trigger_generic_data_rdy_poll & input_device_enabled symbols used by inv-mpu-iio.ko (IAM20680 Sensor Module) & atmel_mxt_ts.ko(Ateml Touch) driver. Functions changes summary: 0 Removed, 0 Changed, 2 Added functions Variables changes summary: 0 Removed, 0 Changed, 0 Added variable 2 Added functions: [A] 'function irqreturn_t iio_trigger_generic_data_rdy_poll(int irq, void *private)' [A] 'function bool input_device_enabled(struct input_dev *dev)' Bug: 286165300 Change-Id: Icb0b6f6e97c2ec92e1aa68b88a72d2f7b5bad319 Signed-off-by: Subrahmanyam Guthena --- BUILD.bazel | 1 + android/abi_gki_aarch64.stg | 10 ++++++++++ android/abi_gki_aarch64_pasa | 4 ++++ 3 files changed, 15 insertions(+) create mode 100644 android/abi_gki_aarch64_pasa diff --git a/BUILD.bazel b/BUILD.bazel index 80f3b1b34d14..c420fcb3b3e8 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -112,6 +112,7 @@ filegroup( "android/abi_gki_aarch64_mtk", "android/abi_gki_aarch64_nothing", "android/abi_gki_aarch64_oplus", + "android/abi_gki_aarch64_pasa", "android/abi_gki_aarch64_pixel", "android/abi_gki_aarch64_qcom", "android/abi_gki_aarch64_rockchip", diff --git a/android/abi_gki_aarch64.stg b/android/abi_gki_aarch64.stg index 5e6fc8618ca4..b8f92c7bf9f9 100644 --- a/android/abi_gki_aarch64.stg +++ b/android/abi_gki_aarch64.stg @@ -367154,6 +367154,15 @@ elf_symbol { type_id: 0x16dc304e full_name: "iio_trigger_free" } +elf_symbol { + id: 0xaaf2e930 + name: "iio_trigger_generic_data_rdy_poll" + is_defined: true + symbol_type: FUNCTION + crc: 0x2d6bcdcb + type_id: 0x3b6e45be + full_name: "iio_trigger_generic_data_rdy_poll" +} elf_symbol { id: 0x613f6d1f name: "iio_trigger_notify_done" @@ -405057,6 +405066,7 @@ interface { symbol_id: 0xfc17cb5d symbol_id: 0x7ae28990 symbol_id: 0xcc1f3656 + symbol_id: 0xaaf2e930 symbol_id: 0x613f6d1f symbol_id: 0x83c94241 symbol_id: 0x7551a60b diff --git a/android/abi_gki_aarch64_pasa b/android/abi_gki_aarch64_pasa new file mode 100644 index 000000000000..87bebdec1cbb --- /dev/null +++ b/android/abi_gki_aarch64_pasa @@ -0,0 +1,4 @@ + +[abi_symbol_list] + iio_trigger_generic_data_rdy_poll + input_device_enabled From 7cbad58851d194c06be75425718d44d5ad0234c0 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 31 Jan 2024 01:14:23 +0000 Subject: [PATCH 67/70] Reapply "perf: Disallow mis-matched inherited group reads" This reverts commit 63eafbb6b311cb2bb9432d685e4608d841b8c74b. Keeps the ABI stable by taking advantage of a hole in the structure! Bug: 307236803 Change-Id: Ic5f7ebeb3a9b13afdb3bfff7e54c4a93b863dab6 Signed-off-by: Greg Kroah-Hartman --- android/abi_gki_aarch64.stg | 7 +++++++ include/linux/perf_event.h | 3 +++ kernel/events/core.c | 39 +++++++++++++++++++++++++++++++------ 3 files changed, 43 insertions(+), 6 deletions(-) diff --git a/android/abi_gki_aarch64.stg b/android/abi_gki_aarch64.stg index b8f92c7bf9f9..c5b6b6cf0403 100644 --- a/android/abi_gki_aarch64.stg +++ b/android/abi_gki_aarch64.stg @@ -97923,6 +97923,12 @@ member { type_id: 0x6720d32f offset: 768 } +member { + id: 0x16cb0979 + name: "group_generation" + type_id: 0x4585663f + offset: 1120 +} member { id: 0x0f81c321 name: "group_index" @@ -246740,6 +246746,7 @@ struct_union { member_id: 0xb826ad15 member_id: 0xf0897d29 member_id: 0x26e58ea7 + member_id: 0x16cb0979 member_id: 0xc397b990 member_id: 0x933349d1 member_id: 0xbadfff7b diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 64eda2503892..19e7b77ef0cf 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -694,6 +694,9 @@ struct perf_event { /* The cumulative AND of all event_caps for events in this group. */ int group_caps; +#ifndef __GENKSYMS__ + unsigned int group_generation; +#endif struct perf_event *group_leader; struct pmu *pmu; void *pmu_private; diff --git a/kernel/events/core.c b/kernel/events/core.c index e8506aca1fc0..e82f21843b25 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -1977,6 +1977,7 @@ static void perf_group_attach(struct perf_event *event) list_add_tail(&event->sibling_list, &group_leader->sibling_list); group_leader->nr_siblings++; + group_leader->group_generation++; perf_event__header_size(group_leader); @@ -2171,6 +2172,7 @@ static void perf_group_detach(struct perf_event *event) if (leader != event) { list_del_init(&event->sibling_list); event->group_leader->nr_siblings--; + event->group_leader->group_generation++; goto out; } @@ -5295,7 +5297,7 @@ static int __perf_read_group_add(struct perf_event *leader, u64 read_format, u64 *values) { struct perf_event_context *ctx = leader->ctx; - struct perf_event *sub; + struct perf_event *sub, *parent; unsigned long flags; int n = 1; /* skip @nr */ int ret; @@ -5305,6 +5307,33 @@ static int __perf_read_group_add(struct perf_event *leader, return ret; raw_spin_lock_irqsave(&ctx->lock, flags); + /* + * Verify the grouping between the parent and child (inherited) + * events is still in tact. + * + * Specifically: + * - leader->ctx->lock pins leader->sibling_list + * - parent->child_mutex pins parent->child_list + * - parent->ctx->mutex pins parent->sibling_list + * + * Because parent->ctx != leader->ctx (and child_list nests inside + * ctx->mutex), group destruction is not atomic between children, also + * see perf_event_release_kernel(). Additionally, parent can grow the + * group. + * + * Therefore it is possible to have parent and child groups in a + * different configuration and summing over such a beast makes no sense + * what so ever. + * + * Reject this. + */ + parent = leader->parent; + if (parent && + (parent->group_generation != leader->group_generation || + parent->nr_siblings != leader->nr_siblings)) { + ret = -ECHILD; + goto unlock; + } /* * Since we co-schedule groups, {enabled,running} times of siblings @@ -5338,8 +5367,9 @@ static int __perf_read_group_add(struct perf_event *leader, values[n++] = atomic64_read(&sub->lost_samples); } +unlock: raw_spin_unlock_irqrestore(&ctx->lock, flags); - return 0; + return ret; } static int perf_read_group(struct perf_event *event, @@ -5358,10 +5388,6 @@ static int perf_read_group(struct perf_event *event, values[0] = 1 + leader->nr_siblings; - /* - * By locking the child_mutex of the leader we effectively - * lock the child list of all siblings.. XXX explain how. - */ mutex_lock(&leader->child_mutex); ret = __perf_read_group_add(leader, read_format, values); @@ -13268,6 +13294,7 @@ static int inherit_group(struct perf_event *parent_event, !perf_get_aux_event(child_ctr, leader)) return -EINVAL; } + leader->group_generation = parent_event->group_generation; return 0; } From 6ce5bb744e0dc6a66296eca017952f719354e5fd Mon Sep 17 00:00:00 2001 From: Seiya Wang Date: Wed, 31 Jan 2024 15:38:01 +0800 Subject: [PATCH 68/70] ANDROID: GKI: Update symbol list for mtk Add following symbols 12 function symbol(s) added 'void clkdev_add(struct clk_lookup*)' 'void clkdev_drop(struct clk_lookup*)' 'void devm_devfreq_unregister_opp_notifier(struct device*, struct devfreq*)' 'struct phy_device* fixed_phy_register(unsigned int, struct fixed_phy_status*, struct device_node*)' 'void fixed_phy_unregister(struct phy_device*)' 'int generic_handle_irq_safe(unsigned int)' 'struct irq_domain* irq_domain_create_simple(struct fwnode_handle*, unsigned int, unsigned int, const struct irq_domain_ops*, void*)' 'void phy_ethtool_ksettings_get(struct phy_device*, struct ethtool_link_ksettings*)' 'int phy_ethtool_ksettings_set(struct phy_device*, const struct ethtool_link_ksettings*)' 'int phy_register_fixup_for_uid(u32, u32, int(*)(struct phy_device*))' 'int phy_save_page(struct phy_device*)' 'int phy_unregister_fixup_for_uid(u32, u32)' Bug: 323111136 Signed-off-by: Seiya Wang Change-Id: I2b9659b4cd24363631913f3c1548198127fb293e --- android/abi_gki_aarch64.stg | 237 ++++++++++++++++++++++++++++++++++++ android/abi_gki_aarch64_mtk | 12 ++ 2 files changed, 249 insertions(+) diff --git a/android/abi_gki_aarch64.stg b/android/abi_gki_aarch64.stg index c5b6b6cf0403..69c568233542 100644 --- a/android/abi_gki_aarch64.stg +++ b/android/abi_gki_aarch64.stg @@ -24513,6 +24513,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0xf87f5460 } +pointer_reference { + id: 0x3490b2d2 + kind: POINTER + pointee_type_id: 0xf8022dd7 +} pointer_reference { id: 0x3491860b kind: POINTER @@ -28288,6 +28293,11 @@ pointer_reference { kind: POINTER pointee_type_id: 0xde680909 } +pointer_reference { + id: 0x3d132f3c + kind: POINTER + pointee_type_id: 0xde0c5a6e +} pointer_reference { id: 0x3d1364e9 kind: POINTER @@ -49559,6 +49569,12 @@ member { type_id: 0x6720d32f offset: 9536 } +member { + id: 0xaa60592a + name: "asym_pause" + type_id: 0x6720d32f + offset: 128 +} member { id: 0x2059f065 name: "asym_prefer_cpu" @@ -62165,6 +62181,12 @@ member { type_id: 0x13f8b706 offset: 2240 } +member { + id: 0x37a7cc74 + name: "clk_hw" + type_id: 0x0ae4a2c7 + offset: 320 +} member { id: 0x36da2546 name: "clk_list_head" @@ -80748,6 +80770,12 @@ member { type_id: 0x6720d32f offset: 9440 } +member { + id: 0x70edc889 + name: "duplex" + type_id: 0x6720d32f + offset: 64 +} member { id: 0x70edcbaf name: "duplex" @@ -116933,6 +116961,11 @@ member { type_id: 0x6720d32f offset: 128 } +member { + id: 0x55d9bf3e + name: "link" + type_id: 0x6720d32f +} member { id: 0x55ddaf31 name: "link" @@ -145935,6 +145968,12 @@ member { type_id: 0x04f0669a offset: 64 } +member { + id: 0x6d4fa7de + name: "pause" + type_id: 0x6720d32f + offset: 96 +} member { id: 0x6d4faa04 name: "pause" @@ -180823,6 +180862,12 @@ member { type_id: 0xe62ebf07 offset: 32 } +member { + id: 0xa08da031 + name: "speed" + type_id: 0x6720d32f + offset: 32 +} member { id: 0xa08da7ed name: "speed" @@ -221634,6 +221679,19 @@ struct_union { member_id: 0x2d5bf0a8 } } +struct_union { + id: 0xde0c5a6e + kind: STRUCT + name: "clk_lookup" + definition { + bytesize: 48 + member_id: 0x0fa6c6af + member_id: 0x8e5720f5 + member_id: 0xd70e055b + member_id: 0xc8e8283a + member_id: 0x37a7cc74 + } +} struct_union { id: 0x08a8a88b kind: STRUCT @@ -230699,6 +230757,19 @@ struct_union { member_id: 0x59119163 } } +struct_union { + id: 0xf8022dd7 + kind: STRUCT + name: "fixed_phy_status" + definition { + bytesize: 20 + member_id: 0x55d9bf3e + member_id: 0xa08da031 + member_id: 0x70edc889 + member_id: 0x6d4fa7de + member_id: 0xaa60592a + } +} struct_union { id: 0xc8adfcbd kind: STRUCT @@ -297385,6 +297456,12 @@ function { parameter_id: 0x914dbfdc parameter_id: 0x6720d32f } +function { + id: 0x1ca12c7e + return_type_id: 0x48b5725f + parameter_id: 0x3176a085 + parameter_id: 0x19357319 +} function { id: 0x1ca44d8a return_type_id: 0x48b5725f @@ -300125,6 +300202,11 @@ function { parameter_id: 0x6720d32f parameter_id: 0x6720d32f } +function { + id: 0x1fdc9a5c + return_type_id: 0x48b5725f + parameter_id: 0x3d132f3c +} function { id: 0x1fdd3c97 return_type_id: 0x48b5725f @@ -303838,6 +303920,15 @@ function { parameter_id: 0xf1a6dfed parameter_id: 0x6720d32f } +function { + id: 0x5f0ba086 + return_type_id: 0x18a2fb63 + parameter_id: 0x0490bb4a + parameter_id: 0x4585663f + parameter_id: 0x4585663f + parameter_id: 0x30351611 + parameter_id: 0x18bd6530 +} function { id: 0x5f133b10 return_type_id: 0x18a2fb63 @@ -307532,6 +307623,12 @@ function { parameter_id: 0x07fec5e7 parameter_id: 0x38d23361 } +function { + id: 0x9138bf4f + return_type_id: 0x6720d32f + parameter_id: 0x3176a085 + parameter_id: 0x397d1060 +} function { id: 0x913a79c8 return_type_id: 0x6720d32f @@ -328454,6 +328551,13 @@ function { parameter_id: 0x270c2906 parameter_id: 0x3b461cc8 } +function { + id: 0xa2605fd7 + return_type_id: 0x3176a085 + parameter_id: 0x4585663f + parameter_id: 0x3490b2d2 + parameter_id: 0x347303b4 +} function { id: 0xa2832510 return_type_id: 0xfc0e1dbd @@ -329142,6 +329246,19 @@ function { parameter_id: 0x0258f96e parameter_id: 0x4585663f } +function { + id: 0xace6c945 + return_type_id: 0x6720d32f + parameter_id: 0xc9082b19 + parameter_id: 0xc9082b19 +} +function { + id: 0xaced709f + return_type_id: 0x6720d32f + parameter_id: 0xc9082b19 + parameter_id: 0xc9082b19 + parameter_id: 0x2ee76b64 +} function { id: 0xad2e2b96 return_type_id: 0x0258f96e @@ -349935,6 +350052,24 @@ elf_symbol { type_id: 0x1febeb84 full_name: "clk_unregister" } +elf_symbol { + id: 0xdf9b5d08 + name: "clkdev_add" + is_defined: true + symbol_type: FUNCTION + crc: 0xb1d8a384 + type_id: 0x1fdc9a5c + full_name: "clkdev_add" +} +elf_symbol { + id: 0x56748a0b + name: "clkdev_drop" + is_defined: true + symbol_type: FUNCTION + crc: 0x75245022 + type_id: 0x1fdc9a5c + full_name: "clkdev_drop" +} elf_symbol { id: 0x430bfeda name: "clockevents_config_and_register" @@ -354313,6 +354448,15 @@ elf_symbol { type_id: 0x10943c29 full_name: "devm_devfreq_unregister_notifier" } +elf_symbol { + id: 0xb3d128c7 + name: "devm_devfreq_unregister_opp_notifier" + is_defined: true + symbol_type: FUNCTION + crc: 0xbc91c0d5 + type_id: 0x1093c795 + full_name: "devm_devfreq_unregister_opp_notifier" +} elf_symbol { id: 0x8ed64fa4 name: "devm_device_add_group" @@ -362307,6 +362451,24 @@ elf_symbol { type_id: 0x9cec28b8 full_name: "firmware_request_nowarn" } +elf_symbol { + id: 0x95cbf27f + name: "fixed_phy_register" + is_defined: true + symbol_type: FUNCTION + crc: 0xcc37eda7 + type_id: 0xa2605fd7 + full_name: "fixed_phy_register" +} +elf_symbol { + id: 0x53f6e0dd + name: "fixed_phy_unregister" + is_defined: true + symbol_type: FUNCTION + crc: 0xce8bb312 + type_id: 0x1cc5f9b2 + full_name: "fixed_phy_unregister" +} elf_symbol { id: 0xbbba9aad name: "fixed_size_llseek" @@ -363324,6 +363486,15 @@ elf_symbol { type_id: 0x8ce1baa0 full_name: "generic_handle_irq" } +elf_symbol { + id: 0xd5bc36ee + name: "generic_handle_irq_safe" + is_defined: true + symbol_type: FUNCTION + crc: 0x81e2bdf4 + type_id: 0x8ce1baa0 + full_name: "generic_handle_irq_safe" +} elf_symbol { id: 0x95a840b8 name: "generic_mii_ioctl" @@ -368970,6 +369141,15 @@ elf_symbol { type_id: 0x5807e85a full_name: "irq_domain_create_hierarchy" } +elf_symbol { + id: 0xe67fe9f7 + name: "irq_domain_create_simple" + is_defined: true + symbol_type: FUNCTION + crc: 0x63135fdc + type_id: 0x5f0ba086 + full_name: "irq_domain_create_simple" +} elf_symbol { id: 0xba41ecd4 name: "irq_domain_disconnect_hierarchy" @@ -378519,6 +378699,24 @@ elf_symbol { type_id: 0x1c416a95 full_name: "phy_ethtool_get_wol" } +elf_symbol { + id: 0x55d86251 + name: "phy_ethtool_ksettings_get" + is_defined: true + symbol_type: FUNCTION + crc: 0x4b00eccd + type_id: 0x1ca12c7e + full_name: "phy_ethtool_ksettings_get" +} +elf_symbol { + id: 0xbaefa94a + name: "phy_ethtool_ksettings_set" + is_defined: true + symbol_type: FUNCTION + crc: 0xd044fa31 + type_id: 0x9138bf4f + full_name: "phy_ethtool_ksettings_set" +} elf_symbol { id: 0x6a3f9c83 name: "phy_ethtool_nway_reset" @@ -378780,6 +378978,15 @@ elf_symbol { type_id: 0x90738a48 full_name: "phy_read_paged" } +elf_symbol { + id: 0x7944625a + name: "phy_register_fixup_for_uid" + is_defined: true + symbol_type: FUNCTION + crc: 0x6b6cddac + type_id: 0xaced709f + full_name: "phy_register_fixup_for_uid" +} elf_symbol { id: 0x6e21f792 name: "phy_remove_link_mode" @@ -378834,6 +379041,15 @@ elf_symbol { type_id: 0x90580076 full_name: "phy_restore_page" } +elf_symbol { + id: 0x16bb21a4 + name: "phy_save_page" + is_defined: true + symbol_type: FUNCTION + crc: 0x2acbda9f + type_id: 0x91dd4b0e + full_name: "phy_save_page" +} elf_symbol { id: 0x0ccd2ae9 name: "phy_select_page" @@ -378960,6 +379176,15 @@ elf_symbol { type_id: 0x1cc5f9b2 full_name: "phy_trigger_machine" } +elf_symbol { + id: 0xde204c0c + name: "phy_unregister_fixup_for_uid" + is_defined: true + symbol_type: FUNCTION + crc: 0xd738ca1b + type_id: 0xace6c945 + full_name: "phy_unregister_fixup_for_uid" +} elf_symbol { id: 0xe7bafb12 name: "phy_validate" @@ -403161,6 +403386,8 @@ interface { symbol_id: 0x7fbd0d58 symbol_id: 0x06f2ea68 symbol_id: 0xc8e117f2 + symbol_id: 0xdf9b5d08 + symbol_id: 0x56748a0b symbol_id: 0x430bfeda symbol_id: 0x0522e13b symbol_id: 0x961eb280 @@ -403648,6 +403875,7 @@ interface { symbol_id: 0x6415475c symbol_id: 0x2bf23b7c symbol_id: 0x97301de5 + symbol_id: 0xb3d128c7 symbol_id: 0x8ed64fa4 symbol_id: 0x0764373d symbol_id: 0x72706e55 @@ -404534,6 +404762,8 @@ interface { symbol_id: 0xf882020f symbol_id: 0x2e62a121 symbol_id: 0x24954a6b + symbol_id: 0x95cbf27f + symbol_id: 0x53f6e0dd symbol_id: 0xbbba9aad symbol_id: 0xd211b195 symbol_id: 0xba7efe3b @@ -404647,6 +404877,7 @@ interface { symbol_id: 0x3812bb22 symbol_id: 0x2f7205ee symbol_id: 0x7d577f86 + symbol_id: 0xd5bc36ee symbol_id: 0x95a840b8 symbol_id: 0x7f639ef1 symbol_id: 0x4c4073c3 @@ -405274,6 +405505,7 @@ interface { symbol_id: 0x9f4df92b symbol_id: 0x5e13f2f1 symbol_id: 0x135db1d2 + symbol_id: 0xe67fe9f7 symbol_id: 0xba41ecd4 symbol_id: 0x3fa49947 symbol_id: 0x327b1cbb @@ -406335,6 +406567,8 @@ interface { symbol_id: 0x02d49a4a symbol_id: 0xc8a98327 symbol_id: 0x1e7f3ab3 + symbol_id: 0x55d86251 + symbol_id: 0xbaefa94a symbol_id: 0x6a3f9c83 symbol_id: 0xd75689cb symbol_id: 0x992e8b3c @@ -406364,12 +406598,14 @@ interface { symbol_id: 0xc7d3f838 symbol_id: 0x1a84af17 symbol_id: 0x13b5133e + symbol_id: 0x7944625a symbol_id: 0x6e21f792 symbol_id: 0x4e868331 symbol_id: 0xd306839f symbol_id: 0x8fff831c symbol_id: 0x61290d1f symbol_id: 0x409cd326 + symbol_id: 0x16bb21a4 symbol_id: 0x0ccd2ae9 symbol_id: 0x14a69275 symbol_id: 0x6a86851c @@ -406384,6 +406620,7 @@ interface { symbol_id: 0xf1503ace symbol_id: 0x2c0117f0 symbol_id: 0xa3314c5c + symbol_id: 0xde204c0c symbol_id: 0xe7bafb12 symbol_id: 0x32988703 symbol_id: 0x39bc463d diff --git a/android/abi_gki_aarch64_mtk b/android/abi_gki_aarch64_mtk index d6dd01bc8c43..fdc0e3b84455 100644 --- a/android/abi_gki_aarch64_mtk +++ b/android/abi_gki_aarch64_mtk @@ -152,6 +152,8 @@ clk_bulk_put clk_bulk_put_all clk_bulk_unprepare + clkdev_add + clkdev_drop clk_disable clk_divider_ops clk_enable @@ -473,6 +475,7 @@ devm_devfreq_register_notifier devm_devfreq_remove_device devm_devfreq_unregister_notifier + devm_devfreq_unregister_opp_notifier devm_extcon_dev_allocate devm_extcon_dev_register devm_extcon_register_notifier @@ -928,6 +931,8 @@ find_vpid finish_wait firmware_request_nowarn + fixed_phy_register + fixed_phy_unregister flush_dcache_page flush_delayed_fput flush_delayed_work @@ -989,6 +994,7 @@ generic_file_llseek generic_handle_domain_irq generic_handle_irq + generic_handle_irq_safe genlmsg_multicast_allns genlmsg_put genl_register_family @@ -1257,6 +1263,7 @@ irq_create_of_mapping irq_dispose_mapping __irq_domain_add + irq_domain_create_simple irq_domain_free_irqs_common irq_domain_get_irq_data irq_domain_remove @@ -1861,6 +1868,8 @@ phy_ethtool_get_eee phy_ethtool_get_link_ksettings phy_ethtool_get_wol + phy_ethtool_ksettings_get + phy_ethtool_ksettings_set phy_ethtool_nway_reset phy_ethtool_set_eee phy_ethtool_set_link_ksettings @@ -1886,13 +1895,16 @@ phy_power_on phy_print_status phy_put + phy_register_fixup_for_uid phy_remove_link_mode + phy_save_page phy_set_mode_ext phy_start phy_start_aneg phy_stop phy_support_asym_pause phy_suspend + phy_unregister_fixup_for_uid pick_migrate_task pid_task pinconf_generic_parse_dt_config From 8fbed1ea00e4683b1fee4601aad32efbf4b62d0b Mon Sep 17 00:00:00 2001 From: "Matthew Wilcox (Oracle)" Date: Thu, 21 Dec 2023 16:53:57 +0000 Subject: [PATCH 69/70] UPSTREAM: ida: Fix crash in ida_free when the bitmap is empty [ Upstream commit af73483f4e8b6f5c68c9aa63257bdd929a9c194a ] The IDA usually detects double-frees, but that detection failed to consider the case when there are no nearby IDs allocated and so we have a NULL bitmap rather than simply having a clear bit. Add some tests to the test-suite to be sure we don't inadvertently reintroduce this problem. Unfortunately they're quite noisy so include a message to disregard the warnings. Bug: 321878978 Reported-by: Zhenghan Wang Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin (cherry picked from commit 5dbcdaf4dbfe074e9142991c5c28eef789c1f6c6) Signed-off-by: Lee Jones Change-Id: I4919e5c64af12f86fe1a91e1e9224a58eedbf345 --- lib/idr.c | 2 +- lib/test_ida.c | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/lib/idr.c b/lib/idr.c index 13f2758c2377..da36054c3ca0 100644 --- a/lib/idr.c +++ b/lib/idr.c @@ -508,7 +508,7 @@ void ida_free(struct ida *ida, unsigned int id) goto delete; xas_store(&xas, xa_mk_value(v)); } else { - if (!test_bit(bit, bitmap->bitmap)) + if (!bitmap || !test_bit(bit, bitmap->bitmap)) goto err; __clear_bit(bit, bitmap->bitmap); xas_set_mark(&xas, XA_FREE_MARK); diff --git a/lib/test_ida.c b/lib/test_ida.c index b06880625961..55105baa19da 100644 --- a/lib/test_ida.c +++ b/lib/test_ida.c @@ -150,6 +150,45 @@ static void ida_check_conv(struct ida *ida) IDA_BUG_ON(ida, !ida_is_empty(ida)); } +/* + * Check various situations where we attempt to free an ID we don't own. + */ +static void ida_check_bad_free(struct ida *ida) +{ + unsigned long i; + + printk("vvv Ignore \"not allocated\" warnings\n"); + /* IDA is empty; all of these will fail */ + ida_free(ida, 0); + for (i = 0; i < 31; i++) + ida_free(ida, 1 << i); + + /* IDA contains a single value entry */ + IDA_BUG_ON(ida, ida_alloc_min(ida, 3, GFP_KERNEL) != 3); + ida_free(ida, 0); + for (i = 0; i < 31; i++) + ida_free(ida, 1 << i); + + /* IDA contains a single bitmap */ + IDA_BUG_ON(ida, ida_alloc_min(ida, 1023, GFP_KERNEL) != 1023); + ida_free(ida, 0); + for (i = 0; i < 31; i++) + ida_free(ida, 1 << i); + + /* IDA contains a tree */ + IDA_BUG_ON(ida, ida_alloc_min(ida, (1 << 20) - 1, GFP_KERNEL) != (1 << 20) - 1); + ida_free(ida, 0); + for (i = 0; i < 31; i++) + ida_free(ida, 1 << i); + printk("^^^ \"not allocated\" warnings over\n"); + + ida_free(ida, 3); + ida_free(ida, 1023); + ida_free(ida, (1 << 20) - 1); + + IDA_BUG_ON(ida, !ida_is_empty(ida)); +} + static DEFINE_IDA(ida); static int ida_checks(void) @@ -162,6 +201,7 @@ static int ida_checks(void) ida_check_leaf(&ida, 1024 * 64); ida_check_max(&ida); ida_check_conv(&ida); + ida_check_bad_free(&ida); printk("IDA: %u of %u tests passed\n", tests_passed, tests_run); return (tests_run != tests_passed) ? 0 : -EINVAL; From 3578913b2ebbdf0d8143ade56a586a0cf27ba6fd Mon Sep 17 00:00:00 2001 From: Hyunwoo Kim Date: Sat, 9 Dec 2023 05:05:38 -0500 Subject: [PATCH 70/70] UPSTREAM: net/rose: Fix Use-After-Free in rose_ioctl [ Upstream commit 810c38a369a0a0ce625b5c12169abce1dd9ccd53 ] Because rose_ioctl() accesses sk->sk_receive_queue without holding a sk->sk_receive_queue.lock, it can cause a race with rose_accept(). A use-after-free for skb occurs with the following flow. ``` rose_ioctl() -> skb_peek() rose_accept() -> skb_dequeue() -> kfree_skb() ``` Add sk->sk_receive_queue.lock to rose_ioctl() to fix this issue. Bug: 321175740 Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Hyunwoo Kim Link: https://lore.kernel.org/r/20231209100538.GA407321@v4bel-B760M-AORUS-ELITE-AX Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin (cherry picked from commit 3f1f6a94d8858706863fe90da35663f6e24be274) Signed-off-by: Lee Jones Change-Id: I94d2aae6221fb95cb285e1a6d0c6fe39a70e35d2 --- net/rose/af_rose.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index ca2b17f32670..674937284b8d 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c @@ -1315,9 +1315,11 @@ static int rose_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) case TIOCINQ: { struct sk_buff *skb; long amount = 0L; - /* These two are safe on a single CPU system as only user tasks fiddle here */ + + spin_lock_irq(&sk->sk_receive_queue.lock); if ((skb = skb_peek(&sk->sk_receive_queue)) != NULL) amount = skb->len; + spin_unlock_irq(&sk->sk_receive_queue.lock); return put_user(amount, (unsigned int __user *) argp); }