From 21e59d0563a95b01b18c4db6a504d48762ff21e5 Mon Sep 17 00:00:00 2001 From: Marc Zyngier Date: Mon, 2 Aug 2021 13:38:29 +0100 Subject: [PATCH 01/12] FROMGIT: arm64: Move .hyp.rodata outside of the _sdata.._edata range The HYP rodata section is currently lumped together with the BSS, which isn't exactly what is expected (it gets registered with kmemleak, for example). Move it away so that it is actually marked RO. As an added benefit, it isn't registered with kmemleak anymore. Fixes: 380e18ade4a5 ("KVM: arm64: Introduce a BSS section for use at Hyp") Suggested-by: Catalin Marinas Signed-off-by: Marc Zyngier Cc: stable@vger.kernel.org #5.13 Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20210802123830.2195174-2-maz@kernel.org (cherry picked from commit eb48d154cd0dade56a0e244f0cfa198ea2925ed3 git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git next) Signed-off-by: Marc Zyngier Bug: 194868924 Change-Id: I83eb8a573640a37d7272f004d5f1626080395d93 --- arch/arm64/kernel/vmlinux.lds.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S index f86d781e7180..51cbe394075d 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S @@ -181,6 +181,8 @@ SECTIONS /* everything from this point to __init_begin will be marked RO NX */ RO_DATA(PAGE_SIZE) + HYPERVISOR_DATA_SECTIONS + idmap_pg_dir = .; . += IDMAP_DIR_SIZE; idmap_pg_end = .; @@ -262,8 +264,6 @@ SECTIONS _sdata = .; RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_ALIGN) - HYPERVISOR_DATA_SECTIONS - /* * Data written with the MMU off but read with the MMU on requires * cache lines to be invalidated, discarding up to a Cache Writeback From 045204b0801f06ac45b9931cffed155624b1ae55 Mon Sep 17 00:00:00 2001 From: Marc Zyngier Date: Mon, 2 Aug 2021 13:38:30 +0100 Subject: [PATCH 02/12] FROMGIT: KVM: arm64: Unregister HYP sections from kmemleak in protected mode Booting a KVM host in protected mode with kmemleak quickly results in a pretty bad crash, as kmemleak doesn't know that the HYP sections have been taken away. This is specially true for the BSS section, which is part of the kernel BSS section and registered at boot time by kmemleak itself. Unregister the HYP part of the BSS before making that section HYP-private. The rest of the HYP-specific data is obtained via the page allocator or lives in other sections, none of which is subjected to kmemleak. Fixes: 90134ac9cabb ("KVM: arm64: Protect the .hyp sections from the host") Reviewed-by: Quentin Perret Reviewed-by: Catalin Marinas Signed-off-by: Marc Zyngier Cc: stable@vger.kernel.org # 5.13 Link: https://lore.kernel.org/r/20210802123830.2195174-3-maz@kernel.org (cherry picked from commit 47e6223c841e029bfc23c3ce594dac5525cebaf8 git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git next) Signed-off-by: Marc Zyngier Bug: 194868924 Change-Id: I2881fc146d8a8dd8c9ad9bd9da3a8356968be794 --- arch/arm64/kvm/arm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index 4024be1e59c9..4705db5c81d3 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -1945,6 +1946,12 @@ static int finalize_hyp_mode(void) if (ret) return ret; + /* + * Exclude HYP BSS from kmemleak so that it doesn't get peeked + * at, which would end badly once the section is inaccessible. + * None of other sections should ever be introspected. + */ + kmemleak_free_part(__hyp_bss_start, __hyp_bss_end - __hyp_bss_start); ret = pkvm_mark_hyp_section(__hyp_bss); if (ret) return ret; From bce9e7942ad39b8ecbbe592e6cae351c34b6991f Mon Sep 17 00:00:00 2001 From: Sajid Dalvi Date: Tue, 27 Jul 2021 17:31:07 -0500 Subject: [PATCH 03/12] ANDROID: PCI/PM: Use usleep_range for d3hot_delay This patch implements a vendor hook that changes d3hot_delay to use usleep_range() instead of msleep() to reduce the resume time from 20ms to 10ms. The call sequence is as follows: pci_pm_resume_noirq() pci_pm_default_resume_early() pci_power_up() pci_raw_set_power_state() --> msleep(10) The default d3hot_delay is 10ms. Using msleep for delays less than 20ms could result in delays up to 20ms. Reference: Documentation/timers/timers-howto.rst Using usleep_range() results in the delay being closer to 10ms and this reduces the resume time. Bug: 194231641 Change-Id: If3e4dcfb99edad302371273933fa6784854cf892 Signed-off-by: Sajid Dalvi --- drivers/android/vendor_hooks.c | 2 ++ drivers/pci/pci.c | 11 +++++++++-- include/trace/hooks/pci.h | 22 ++++++++++++++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 include/trace/hooks/pci.h diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 0ae5d2f5e055..1302b9b0f5f2 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -73,6 +73,7 @@ #include #include #include +#include /* * Export tracepoints that act as a bare tracehook (ie: have no trace event @@ -378,3 +379,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_tcp_recvmsg); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_udp_sendmsg); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_udp_recvmsg); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_tcp_recvmsg_stat); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_pci_d3_sleep); diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index d5d9ea864fe6..e5c3fb43a791 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -31,6 +31,9 @@ #include #include #include +#ifndef __GENKSYMS__ +#include +#endif #include "pci.h" DEFINE_MUTEX(pci_slot_mutex); @@ -64,12 +67,16 @@ struct pci_pme_device { static void pci_dev_d3_sleep(struct pci_dev *dev) { unsigned int delay = dev->d3hot_delay; + int err = -EOPNOTSUPP; if (delay < pci_pm_d3hot_delay) delay = pci_pm_d3hot_delay; - if (delay) - msleep(delay); + if (delay) { + trace_android_rvh_pci_d3_sleep(dev, delay, &err); + if (err == -EOPNOTSUPP) + msleep(delay); + } } #ifdef CONFIG_PCI_DOMAINS diff --git a/include/trace/hooks/pci.h b/include/trace/hooks/pci.h new file mode 100644 index 000000000000..d9c5e4aec7d1 --- /dev/null +++ b/include/trace/hooks/pci.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM pci +#define TRACE_INCLUDE_PATH trace/hooks + +#if !defined(_TRACE_HOOK_PCI_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_HOOK_PCI_H +#include +#include +/* + * Following tracepoints are not exported in tracefs and provide a + * mechanism for vendor modules to hook and extend functionality + */ + +DECLARE_RESTRICTED_HOOK(android_rvh_pci_d3_sleep, + TP_PROTO(struct pci_dev *dev, unsigned int delay, int *err), + TP_ARGS(dev, delay, err), 1); + +#endif /* _TRACE_HOOK_PCI_H */ + +/* This part must be outside protection */ +#include From e9ab28e1c5dfc4bc49996b194a853b0f98ad72bc Mon Sep 17 00:00:00 2001 From: Sajid Dalvi Date: Mon, 2 Aug 2021 23:37:32 -0500 Subject: [PATCH 04/12] ANDROID: ABI: update generic symbol list Added function: android_rvh_pci_d3_sleep Bug: 194231641 Signed-off-by: Sajid Dalvi Change-Id: If05731d35120e1e466f510d519466e8f4f9de2dd --- android/abi_gki_aarch64_generic | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/android/abi_gki_aarch64_generic b/android/abi_gki_aarch64_generic index e7929d5407e9..46db0cd8e0b5 100644 --- a/android/abi_gki_aarch64_generic +++ b/android/abi_gki_aarch64_generic @@ -643,6 +643,7 @@ drm_mode_equal drm_mode_equal_no_clocks drm_mode_object_find + drm_mode_object_get drm_mode_object_put drm_mode_probed_add drm_modeset_acquire_fini @@ -1342,6 +1343,7 @@ phy_init phy_power_off phy_power_on + pid_task pinconf_generic_dt_free_map pinconf_generic_dt_node_to_map pinctrl_add_gpio_range @@ -1433,6 +1435,7 @@ put_disk __put_net __put_page + put_pid put_sg_io_hdr __put_task_struct put_unused_fd @@ -1491,6 +1494,7 @@ register_netdev register_netdevice register_netdevice_notifier + register_oom_notifier register_pernet_device register_pernet_subsys register_pm_notifier @@ -1893,6 +1897,7 @@ time64_to_tm topology_set_thermal_pressure _totalram_pages + __trace_bputs trace_event_buffer_commit trace_event_buffer_reserve trace_event_ignore_this_pid @@ -1907,6 +1912,7 @@ __traceiter_android_rvh_find_energy_efficient_cpu __traceiter_android_rvh_irqs_disable __traceiter_android_rvh_irqs_enable + __traceiter_android_rvh_pci_d3_sleep __traceiter_android_rvh_post_init_entity_util_avg __traceiter_android_rvh_preempt_disable __traceiter_android_rvh_preempt_enable @@ -1981,6 +1987,7 @@ __tracepoint_android_rvh_find_energy_efficient_cpu __tracepoint_android_rvh_irqs_disable __tracepoint_android_rvh_irqs_enable + __tracepoint_android_rvh_pci_d3_sleep __tracepoint_android_rvh_post_init_entity_util_avg __tracepoint_android_rvh_preempt_disable __tracepoint_android_rvh_preempt_enable @@ -2104,6 +2111,7 @@ unregister_netdevice_many unregister_netdevice_notifier unregister_netdevice_queue + unregister_oom_notifier unregister_pernet_device unregister_pernet_subsys unregister_pm_notifier From 20c3903ad71d6c2f0e405635ec8a57e12690be15 Mon Sep 17 00:00:00 2001 From: Sajid Dalvi Date: Wed, 4 Aug 2021 20:25:31 -0500 Subject: [PATCH 05/12] ANDROID: ABI: update ABI XML android_rvh_pci_d3_sleep is now used Leaf changes summary: 2 artifacts changed (1 filtered out) Changed leaf types summary: 0 (1 filtered out) leaf type changed Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 1 Added variable 1 Added function: [A] 'function int __traceiter_android_rvh_pci_d3_sleep(void*, pci_dev*, unsigned int, int*)' 1 Added variable: [A] 'tracepoint __tracepoint_android_rvh_pci_d3_sleep' Bug: 194231641 Signed-off-by: Sajid Dalvi Change-Id: Icc36450b47f2d48f1aecfa74c6bfff0340d3504d --- android/abi_gki_aarch64.xml | 10018 +++++++++++++++++----------------- 1 file changed, 5013 insertions(+), 5005 deletions(-) diff --git a/android/abi_gki_aarch64.xml b/android/abi_gki_aarch64.xml index de64133c85e6..99419ee33dc4 100755 --- a/android/abi_gki_aarch64.xml +++ b/android/abi_gki_aarch64.xml @@ -274,6 +274,7 @@ + @@ -5025,6 +5026,7 @@ + @@ -7703,9 +7705,9 @@ - - - + + + @@ -7718,7 +7720,6 @@ - @@ -7800,7 +7801,6 @@ - @@ -8206,7 +8206,14 @@ - + + + + + + + + @@ -8214,13 +8221,6 @@ - - - - - - - @@ -10532,6 +10532,7 @@ + @@ -10865,8 +10866,8 @@ - - + + @@ -13612,12 +13613,6 @@ - - - - - - @@ -14086,6 +14081,9 @@ + + + @@ -14280,7 +14278,29 @@ - + + + + + + + + + + + + + + + + + + + + + + + @@ -17098,7 +17118,6 @@ - @@ -17470,11 +17489,7 @@ - - - - - + @@ -18421,7 +18436,6 @@ - @@ -18488,7 +18502,6 @@ - @@ -18925,14 +18938,6 @@ - - - - - - - - @@ -19915,6 +19920,7 @@ + @@ -20655,6 +20661,11 @@ + + + + + @@ -22628,7 +22639,7 @@ - + @@ -22832,6 +22843,7 @@ + @@ -23779,7 +23791,7 @@ - + @@ -23873,6 +23885,11 @@ + + + + + @@ -24122,7 +24139,6 @@ - @@ -24200,7 +24216,7 @@ - + @@ -24257,6 +24273,7 @@ + @@ -24607,6 +24624,7 @@ + @@ -26162,7 +26180,6 @@ - @@ -29823,9 +29840,9 @@ - - - + + + @@ -30709,7 +30726,6 @@ - @@ -30960,7 +30976,68 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -31461,7 +31538,6 @@ - @@ -31820,6 +31896,7 @@ + @@ -35184,7 +35261,6 @@ - @@ -35378,7 +35454,6 @@ - @@ -35435,7 +35510,7 @@ - + @@ -36167,8 +36242,8 @@ - - + + @@ -37090,17 +37165,6 @@ - - - - - - - - - - - @@ -37376,9 +37440,9 @@ - - - + + + @@ -37883,6 +37947,7 @@ + @@ -38839,7 +38904,6 @@ - @@ -41271,11 +41335,6 @@ - - - - - @@ -41819,7 +41878,6 @@ - @@ -42560,21 +42618,21 @@ - + - + - + - + - + - + @@ -44918,7 +44976,35 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -45479,7 +45565,14 @@ - + + + + + + + + @@ -46125,11 +46218,6 @@ - - - - - @@ -46521,7 +46609,7 @@ - + @@ -46952,7 +47040,7 @@ - + @@ -47436,6 +47524,7 @@ + @@ -48355,7 +48444,7 @@ - + @@ -49197,7 +49286,6 @@ - @@ -49644,6 +49732,7 @@ + @@ -50229,7 +50318,23 @@ - + + + + + + + + + + + + + + + + + @@ -50508,7 +50613,6 @@ - @@ -51425,9 +51529,9 @@ - - - + + + @@ -52147,6 +52251,7 @@ + @@ -52730,7 +52835,7 @@ - + @@ -52950,8 +53055,10 @@ - - + + + + @@ -53160,7 +53267,7 @@ - + @@ -55818,11 +55925,6 @@ - - - - - @@ -57016,44 +57118,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -57728,7 +57793,7 @@ - + @@ -58211,65 +58276,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -59974,7 +59981,17 @@ - + + + + + + + + + + + @@ -61016,7 +61033,7 @@ - + @@ -61500,10 +61517,10 @@ - - - - + + + + @@ -61553,6 +61570,12 @@ + + + + + + @@ -61812,6 +61835,7 @@ + @@ -62703,11 +62727,6 @@ - - - - - @@ -63722,11 +63741,6 @@ - - - - - @@ -64160,7 +64174,7 @@ - + @@ -65725,7 +65739,7 @@ - + @@ -66196,6 +66210,7 @@ + @@ -67352,7 +67367,7 @@ - + @@ -67686,14 +67701,7 @@ - - - - - - - - + @@ -68497,8 +68505,8 @@ - - + + @@ -68617,7 +68625,6 @@ - @@ -69242,8 +69249,8 @@ - - + + @@ -69315,6 +69322,7 @@ + @@ -69417,6 +69425,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -69467,38 +69495,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -69609,7 +69606,7 @@ - + @@ -72192,7 +72189,6 @@ - @@ -73587,11 +73583,11 @@ - + - + @@ -74631,12 +74627,12 @@ - - - - - - + + + + + + @@ -75920,6 +75916,7 @@ + @@ -76157,7 +76154,6 @@ - @@ -76366,7 +76362,14 @@ - + + + + + + + + @@ -76866,6 +76869,7 @@ + @@ -77677,6 +77681,7 @@ + @@ -77749,6 +77754,9 @@ + + + @@ -77765,11 +77773,6 @@ - - - - - @@ -77792,7 +77795,6 @@ - @@ -78246,7 +78248,7 @@ - + @@ -78322,14 +78324,6 @@ - - - - - - - - @@ -80667,12 +80661,12 @@ - + - + - + @@ -81233,6 +81227,7 @@ + @@ -81851,7 +81846,7 @@ - + @@ -82356,6 +82351,7 @@ + @@ -82499,9 +82495,9 @@ - - - + + + @@ -82969,26 +82965,7 @@ - - - - - - - - - - - - - - - - - - - - + @@ -83013,7 +82990,7 @@ - + @@ -83038,6 +83015,7 @@ + @@ -83076,6 +83054,7 @@ + @@ -84388,7 +84367,7 @@ - + @@ -85018,8 +84997,8 @@ - - + + @@ -86238,6 +86217,14 @@ + + + + + + + + @@ -86672,7 +86659,20 @@ - + + + + + + + + + + + + + + @@ -87229,7 +87229,7 @@ - + @@ -87604,6 +87604,7 @@ + @@ -87740,7 +87741,7 @@ - + @@ -89198,7 +89199,6 @@ - @@ -90451,7 +90451,7 @@ - + @@ -90995,7 +90995,7 @@ - + @@ -91433,7 +91433,7 @@ - + @@ -92130,9 +92130,6 @@ - - - @@ -93347,6 +93344,7 @@ + @@ -93621,8 +93619,8 @@ - - + + @@ -93818,8 +93816,8 @@ - - + + @@ -94938,6 +94936,7 @@ + @@ -95881,7 +95880,14 @@ - + + + + + + + + @@ -96934,9 +96940,6 @@ - - - @@ -96961,7 +96964,7 @@ - + @@ -97102,8 +97105,8 @@ - - + + @@ -97703,7 +97706,6 @@ - @@ -97972,6 +97974,7 @@ + @@ -98450,7 +98453,20 @@ - + + + + + + + + + + + + + + @@ -101727,6 +101743,7 @@ + @@ -101785,20 +101802,7 @@ - - - - - - - - - - - - - - + @@ -102133,6 +102137,7 @@ + @@ -105422,7 +105427,7 @@ - + @@ -105962,11 +105967,6 @@ - - - - - @@ -106287,6 +106287,7 @@ + @@ -107996,7 +107997,6 @@ - @@ -108074,7 +108074,6 @@ - @@ -108193,8 +108192,8 @@ - - + + @@ -108695,6 +108694,7 @@ + @@ -109785,6 +109785,13 @@ + + + + + + + @@ -111104,6 +111111,7 @@ + @@ -111467,38 +111475,38 @@ - - - + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - + + + - - - + + + @@ -111508,32 +111516,32 @@ - - - + + + - - - + + + - - - + + + - - - + + + - - + + @@ -111552,8 +111560,8 @@ - - + + @@ -111569,57 +111577,57 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - - + + + - - + + - - + + @@ -111630,16 +111638,16 @@ - - + + - - + + @@ -111658,12 +111666,12 @@ - - - - - - + + + + + + @@ -111680,9 +111688,9 @@ - - - + + + @@ -111698,33 +111706,33 @@ - - + + - - - + + + - - + + - - - + + + - - - + + + - - - + + + @@ -111737,22 +111745,22 @@ - - - - + + + + - - - - + + + + - - - - + + + + @@ -111826,13 +111834,13 @@ - - - - - - - + + + + + + + @@ -111841,29 +111849,29 @@ - - - + + + - - - - - - + + + + + + - - - - + + + + - - + + @@ -111905,11 +111913,11 @@ - - - - - + + + + + @@ -111926,14 +111934,14 @@ - - + + - - - - + + + + @@ -111956,27 +111964,27 @@ - - - - + + + + - - - + + + - - - + + + - - - - - + + + + + @@ -112026,21 +112034,21 @@ - - - - - + + + + + - - - - - - + + + + + + - - + + @@ -112081,18 +112089,18 @@ - - + + - - - + + + - - - + + + @@ -112125,17 +112133,17 @@ - - - - + + + + - - - - - + + + + + @@ -112146,53 +112154,53 @@ - - - - + + + + - - + + - - - + + + - - - + + + - - + + - - - - + + + + - - + + - - + + - - + + - - - - - + + + + + @@ -112201,49 +112209,49 @@ - - - - + + + + - - - - - - - + + + + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - - - + + + + + @@ -112253,10 +112261,10 @@ - - - - + + + + @@ -112300,17 +112308,17 @@ - - + + - - + + - - - + + + @@ -112341,10 +112349,10 @@ - - - - + + + + @@ -112376,13 +112384,13 @@ - - - + + + - - + + @@ -112413,8 +112421,8 @@ - - + + @@ -112423,8 +112431,8 @@ - - + + @@ -112446,8 +112454,8 @@ - - + + @@ -112494,8 +112502,8 @@ - - + + @@ -112517,10 +112525,10 @@ - - - - + + + + @@ -112556,9 +112564,9 @@ - - - + + + @@ -112692,16 +112700,16 @@ - - + + - - + + @@ -112724,53 +112732,53 @@ - - - - + + + + - - - - + + + + - - - + + + - - - + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - - + + + + @@ -112788,9 +112796,9 @@ - - - + + + @@ -112838,67 +112846,67 @@ - - - - + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - - + + + + + + + + + + @@ -112914,16 +112922,16 @@ - - + + - - - - - - + + + + + + @@ -112944,28 +112952,28 @@ - - + + - - - + + + - - - - - + + + + + - - - - - + + + + + @@ -112975,8 +112983,8 @@ - - + + @@ -112989,8 +112997,8 @@ - - + + @@ -113060,9 +113068,9 @@ - - - + + + @@ -113077,19 +113085,19 @@ - - - + + + - - - + + + - - - + + + @@ -113165,14 +113173,14 @@ - - - + + + - - - + + + @@ -113181,75 +113189,75 @@ - - - + + + - - - - + + + + - - + + - - - - - + + + + + - - - - - + + + + + - - + + - - - - + + + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + @@ -113257,34 +113265,34 @@ - - - + + + - - + + - - + + - - - + + + - - + + @@ -113376,8 +113384,8 @@ - - + + @@ -113460,28 +113468,28 @@ - - - + + + - - + + - - - - - + + + + + @@ -113496,11 +113504,11 @@ - - - - - + + + + + @@ -113512,11 +113520,11 @@ - - - - - + + + + + @@ -113535,8 +113543,8 @@ - - + + @@ -113573,10 +113581,10 @@ - - - - + + + + @@ -113614,22 +113622,22 @@ - - + + - - - - + + + + - - + + - - + + @@ -113656,22 +113664,22 @@ - - + + - - - - + + + + - - - + + + @@ -113732,8 +113740,8 @@ - - + + @@ -113744,18 +113752,18 @@ - - + + - - - + + + - - - + + + @@ -113767,8 +113775,8 @@ - - + + @@ -113784,9 +113792,9 @@ - - - + + + @@ -113819,12 +113827,12 @@ - - + + - - + + @@ -113835,23 +113843,23 @@ - - + + - - - + + + - - - - + + + + @@ -113866,9 +113874,9 @@ - - - + + + @@ -113879,8 +113887,8 @@ - - + + @@ -113900,47 +113908,47 @@ - - - + + + - - - + + + - - - - + + + + - - - - - + + + + + - - - - - + + + + + - + - + - - - - - + + + + + @@ -113979,12 +113987,12 @@ - - + + - - + + @@ -114013,10 +114021,10 @@ - - - - + + + + @@ -114071,42 +114079,42 @@ - - - - - - + + + + + + - - - - - - + + + + + + - - + + - - - + + + - - - + + + - + @@ -114141,10 +114149,10 @@ - - - - + + + + @@ -114152,9 +114160,9 @@ - - - + + + @@ -114164,7 +114172,7 @@ - + @@ -114175,8 +114183,8 @@ - - + + @@ -114193,22 +114201,22 @@ - - + + - - - + + + - - - + + + @@ -114258,11 +114266,11 @@ - - - - - + + + + + @@ -114270,44 +114278,44 @@ - - - - - + + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - + + - - + + - - - - + + + + @@ -114322,8 +114330,8 @@ - - + + @@ -114344,18 +114352,18 @@ - - - + + + - - - + + + @@ -114380,11 +114388,11 @@ - - - - - + + + + + @@ -114394,8 +114402,8 @@ - - + + @@ -114411,18 +114419,18 @@ - - + + - - + + - - - - + + + + @@ -114453,8 +114461,8 @@ - - + + @@ -114463,7 +114471,7 @@ - + @@ -114494,11 +114502,11 @@ - - - - - + + + + + @@ -114508,25 +114516,25 @@ - - - + + + - - - - - - + + + + + + - - - - - - + + + + + + @@ -114563,11 +114571,11 @@ - - - - - + + + + + @@ -114577,11 +114585,11 @@ - - - - - + + + + + @@ -114613,9 +114621,9 @@ - - - + + + @@ -114626,8 +114634,8 @@ - - + + @@ -114637,9 +114645,9 @@ - - - + + + @@ -114648,11 +114656,11 @@ - - - - - + + + + + @@ -114665,16 +114673,16 @@ - - + + - - + + - - + + @@ -114685,8 +114693,8 @@ - - + + @@ -114722,49 +114730,49 @@ - - + + - - - - + + + + - - - + + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + @@ -114786,9 +114794,9 @@ - - - + + + @@ -114801,9 +114809,9 @@ - - - + + + @@ -114825,10 +114833,10 @@ - - - - + + + + @@ -114859,15 +114867,15 @@ - - - - + + + + - - - + + + @@ -114887,8 +114895,8 @@ - - + + @@ -114904,8 +114912,8 @@ - - + + @@ -114913,13 +114921,13 @@ - - + + - - - + + + @@ -114930,9 +114938,9 @@ - - - + + + @@ -114949,16 +114957,16 @@ - - + + - - + + @@ -114970,9 +114978,9 @@ - - - + + + @@ -115057,9 +115065,9 @@ - - - + + + @@ -115067,17 +115075,17 @@ - - - - + + + + - - - - + + + + @@ -115090,9 +115098,9 @@ - - - + + + @@ -115113,11 +115121,11 @@ - - - - - + + + + + @@ -115165,20 +115173,20 @@ - - + + - - + + - - + + @@ -115191,8 +115199,8 @@ - - + + @@ -115214,12 +115222,12 @@ - - - - - - + + + + + + @@ -115228,40 +115236,40 @@ - - - + + + - - - - - - - + + + + + + + - - + + - - - + + + - - - - + + + + - - - - + + + + @@ -115296,28 +115304,28 @@ - - - + + + - - + + - - - - + + + + - - - + + + @@ -115335,10 +115343,10 @@ - - - - + + + + @@ -115360,11 +115368,11 @@ - - - - - + + + + + @@ -115387,15 +115395,15 @@ - - - + + + - - - - + + + + @@ -115412,14 +115420,14 @@ - - - + + + - - - + + + @@ -115448,22 +115456,22 @@ - - + + - - + + - - - - + + + + @@ -115486,10 +115494,10 @@ - - - - + + + + @@ -115497,15 +115505,15 @@ - - - - + + + + - - - + + + @@ -115597,11 +115605,11 @@ - - - - - + + + + + @@ -115760,29 +115768,29 @@ - - - - + + + + - - - + + + - - - - + + + + - - - - - + + + + + @@ -115792,10 +115800,10 @@ - - - - + + + + @@ -115834,14 +115842,14 @@ - - - - - - - - + + + + + + + + @@ -115854,9 +115862,9 @@ - - - + + + @@ -115883,8 +115891,8 @@ - - + + @@ -115941,14 +115949,14 @@ - - - + + + - - - + + + @@ -115956,10 +115964,10 @@ - - - - + + + + @@ -116004,15 +116012,15 @@ - - - - + + + + - - - + + + @@ -116105,16 +116113,16 @@ - - - + + + - - - - - + + + + + @@ -116164,46 +116172,46 @@ - - - + + + - - - - - + + + + + - - - - - + + + + + - - + + - - - - - + + + + + - - + + - - + + @@ -116298,9 +116306,9 @@ - - - + + + @@ -116322,17 +116330,17 @@ - - + + - - - + + + - - + + @@ -116340,15 +116348,15 @@ - - - + + + - - - - + + + + @@ -116359,34 +116367,34 @@ - - + + - - - - + + + + - - + + - - - + + + - - - - + + + + @@ -116398,9 +116406,9 @@ - - - + + + @@ -116408,8 +116416,8 @@ - - + + @@ -116420,15 +116428,15 @@ - + - - - - - - + + + + + + @@ -116440,13 +116448,13 @@ - - - - + + + + - - + + @@ -116466,10 +116474,10 @@ - - - - + + + + @@ -116619,46 +116627,46 @@ - - - + + + - - - + + + - - + + - - - - - + + + + + - - + + - - - + + + - - - - + + + + - - - - - + + + + + @@ -116787,8 +116795,8 @@ - - + + @@ -116817,16 +116825,16 @@ - - + + - - + + - - + + @@ -116838,16 +116846,16 @@ - - + + - - + + @@ -116863,9 +116871,9 @@ - - - + + + @@ -116875,62 +116883,62 @@ - - + + - - - + + + - - + + - - - + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - - - + + + - - - + + + @@ -116943,14 +116951,14 @@ - - - + + + - - - + + + @@ -116976,13 +116984,13 @@ - - - - - - - + + + + + + + @@ -117202,62 +117210,62 @@ - - + + - - - + + + - - + + - - - - - + + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - - + + @@ -117273,15 +117281,15 @@ - - + + - - - - - + + + + + @@ -117292,10 +117300,10 @@ - - - - + + + + @@ -117311,13 +117319,13 @@ - - + + - - - + + + @@ -117349,13 +117357,13 @@ - - - + + + - - + + @@ -117363,19 +117371,19 @@ - - - - - + + + + + - - - - - - + + + + + + @@ -117383,16 +117391,16 @@ - - + + - - + + - - + + @@ -117400,17 +117408,17 @@ - - + + - - + + - - - + + + @@ -117457,19 +117465,19 @@ - - - - - - - + + + + + + + - - - + + + @@ -117477,17 +117485,17 @@ - - - + + + - - + + @@ -117505,20 +117513,20 @@ - - + + - - + + - - + + @@ -117531,44 +117539,44 @@ - - - - - + + + + + - - - + + + - - - - + + + + - - - - + + + + - - + + - - + + @@ -117837,17 +117845,17 @@ - - + + - - - + + + @@ -117863,12 +117871,12 @@ - - - - - - + + + + + + @@ -117920,20 +117928,20 @@ - - + + - - - - + + + + - - - - + + + + @@ -118046,10 +118054,10 @@ - - - - + + + + @@ -118094,9 +118102,9 @@ - - - + + + @@ -118221,19 +118229,19 @@ - - - + + + - - - + + + - - - + + + @@ -118305,8 +118313,8 @@ - - + + @@ -118328,9 +118336,9 @@ - - - + + + @@ -118358,8 +118366,8 @@ - - + + @@ -118374,24 +118382,24 @@ - - + + - - - + + + - - - - + + + + - - - + + + @@ -118406,9 +118414,9 @@ - - - + + + @@ -118416,18 +118424,18 @@ - - + + - - - + + + - - - + + + @@ -118440,9 +118448,9 @@ - - - + + + @@ -118463,89 +118471,89 @@ - - + + - - + + - - - + + + - - - + + + - - + + - - - + + + - - + + - - + + - - - + + + - - + + - - - + + + - - + + - - + + - - + + - - - - + + + + - - - - + + + + @@ -118574,17 +118582,17 @@ - - + + - - + + - - - + + + @@ -118594,20 +118602,20 @@ - - + + - - + + - - + + @@ -118664,9 +118672,9 @@ - - - + + + @@ -118674,52 +118682,52 @@ - - + + - - - - - + + + + + - - - - - - - + + + + + + + - - - - + + + + - - - - + + + + - - - - - - + + + + + + - - - - - - + + + + + + @@ -118735,10 +118743,10 @@ - - - - + + + + @@ -118752,30 +118760,30 @@ - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + @@ -118787,8 +118795,8 @@ - - + + @@ -118864,20 +118872,20 @@ - - + + - - - - - - - - - - + + + + + + + + + + @@ -118886,19 +118894,19 @@ - - - + + + - - - - + + + + - - - + + + @@ -118925,24 +118933,24 @@ - - - - + + + + - - + + - - - - + + + + @@ -119115,8 +119123,8 @@ - - + + @@ -119130,13 +119138,13 @@ - - + + - - - + + + @@ -119175,14 +119183,14 @@ - - - + + + - - - + + + @@ -119190,22 +119198,22 @@ - - - - + + + + - - + + - - - + + + @@ -119219,50 +119227,50 @@ - - - - + + + + - - + + - - + + - - + + - - - - + + + + - - - - + + + + - - + + - - - + + + - - + + @@ -119272,15 +119280,15 @@ - - - + + + - - - - + + + + @@ -119302,27 +119310,27 @@ - - - - + + + + - - - - - + + + + + - - - + + + - - + + @@ -119331,9 +119339,9 @@ - - - + + + @@ -119342,30 +119350,30 @@ - - - + + + - - + + - - - + + + - - - - + + + + - - - - + + + + @@ -119381,22 +119389,22 @@ - - + + - - - + + + - - + + - - - + + + @@ -119413,8 +119421,8 @@ - - + + @@ -119429,8 +119437,8 @@ - - + + @@ -119478,18 +119486,18 @@ - - - + + + - - + + - - - + + + @@ -119497,18 +119505,18 @@ - - + + - - - + + + - - - + + + @@ -119566,8 +119574,8 @@ - - + + @@ -119586,8 +119594,8 @@ - - + + @@ -119630,12 +119638,12 @@ - - + + - - + + @@ -119672,35 +119680,35 @@ - - + + - - - + + + - - - - - - - + + + + + + + - - - - - - + + + + + + - - - + + + @@ -119712,13 +119720,13 @@ - - - + + + - - + + @@ -119755,33 +119763,33 @@ - - - - - + + + + + - - - - - + + + + + - - - - + + + + - - - + + + - - - - + + + + @@ -119797,8 +119805,8 @@ - - + + @@ -119825,12 +119833,12 @@ - - + + - - + + @@ -119841,28 +119849,28 @@ - - - - - - - + + + + + + + - - + + - - - - - + + + + + @@ -119874,8 +119882,8 @@ - - + + @@ -119901,8 +119909,8 @@ - - + + @@ -119912,20 +119920,20 @@ - - + + - + - - - + + + @@ -119939,38 +119947,38 @@ - - - - + + + + - - - + + + - - - + + + - - - + + + - - + + - - - + + + @@ -119980,13 +119988,13 @@ - - + + - - - + + + @@ -120000,41 +120008,41 @@ - - - - - - + + + + + + - - + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - - - + + + + + + + + @@ -120044,8 +120052,8 @@ - - + + @@ -120057,18 +120065,18 @@ - - + + - - - - + + + + @@ -120092,19 +120100,19 @@ - - - + + + - - - + + + - - - + + + @@ -120117,34 +120125,34 @@ - - - + + + - - - - + + + + - - + + - - - - - + + + + + - - - - - - + + + + + + @@ -120172,9 +120180,9 @@ - - - + + + @@ -120183,13 +120191,13 @@ - - + + - - - + + + @@ -120285,13 +120293,13 @@ - - - + + + - - + + @@ -120336,27 +120344,27 @@ - - + + - + - - - + + + - - + + - - + + @@ -120385,38 +120393,38 @@ - - - - + + + + - - - - - - - - + + + + + + + + - - + + - - + + - + - - + + @@ -120427,38 +120435,38 @@ - - - - + + + + - - + + - - - + + + - - + + - - - - - + + + + + - - - - + + + + @@ -120472,28 +120480,28 @@ - - - - - + + + + + - - + + - - - - - + + + + + - - - - + + + + @@ -120515,18 +120523,18 @@ - - + + - - + + - - + + @@ -120545,12 +120553,12 @@ - - + + - - + + @@ -120587,9 +120595,9 @@ - - - + + + @@ -120624,81 +120632,81 @@ - - - + + + - - - + + + - - - - + + + + - - - - - - + + + + + + - - - - + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -120823,12 +120831,12 @@ - - + + - - + + @@ -120871,14 +120879,14 @@ - - + + - - - - + + + + @@ -120899,36 +120907,36 @@ - - - - - + + + + + - - + + - - - + + + - - - - - - + + + + + + - - - - - - + + + + + + @@ -120939,39 +120947,39 @@ - - + + - - - + + + - - - - + + + + - - - + + + - - + + - - - + + + - - - - + + + + @@ -120997,14 +121005,14 @@ - - + + - - - - + + + + @@ -121021,8 +121029,8 @@ - - + + @@ -121095,14 +121103,14 @@ - - - - - - - - + + + + + + + + @@ -121133,9 +121141,9 @@ - - - + + + @@ -121155,18 +121163,18 @@ - - - - + + + + - - - + + + @@ -121174,18 +121182,18 @@ - - - - - - + + + + + + - - - + + + @@ -121195,8 +121203,8 @@ - - + + @@ -121211,8 +121219,8 @@ - - + + @@ -121227,8 +121235,8 @@ - - + + @@ -121261,20 +121269,20 @@ - - + + - - + + - - + + @@ -121301,12 +121309,12 @@ - - + + - - + + @@ -121314,34 +121322,34 @@ - - + + - - - + + + - - - - + + + + - - - - + + + + - - - + + + - - + + @@ -121423,9 +121431,9 @@ - - - + + + @@ -121586,21 +121594,21 @@ - - - + + + - - + + - - - - - - + + + + + + @@ -121608,40 +121616,40 @@ - - - - + + + + - - + + - - + + - - - - - - + + + + + + - - - - - + + + + + @@ -121671,8 +121679,8 @@ - - + + @@ -121758,13 +121766,13 @@ - - - + + + - - + + @@ -121775,15 +121783,15 @@ - - - - - - - - - + + + + + + + + + @@ -121819,9 +121827,9 @@ - - - + + + @@ -121833,21 +121841,21 @@ - - - - + + + + - - - - + + + + - - - + + + @@ -121860,10 +121868,10 @@ - - - - + + + + @@ -121871,11 +121879,11 @@ - - - - - + + + + + @@ -121898,10 +121906,10 @@ - - - - + + + + @@ -121914,20 +121922,20 @@ - - - + + + - - - - + + + + - + - - + + @@ -121937,9 +121945,9 @@ - - - + + + @@ -121974,14 +121982,14 @@ - - - + + + - - + + @@ -122057,8 +122065,8 @@ - - + + @@ -122068,66 +122076,66 @@ - - + + - - - - - - - - - + + + + + + + + + - - + + - - - - - - - - - + + + + + + + + + - - + + - - + + - - + + - - + + - + - - - - + + + + @@ -122147,21 +122155,21 @@ - - - - + + + + - - - + + + - - - - + + + + @@ -122172,23 +122180,23 @@ - - - - - - - - + + + + + + + + - - + + - - - + + + @@ -122197,10 +122205,10 @@ - - - - + + + + @@ -122232,46 +122240,46 @@ - - - - + + + + - - - + + + - - + + - - + + - - - + + + - - - - - + + + + + - - + + - - - + + + @@ -122280,31 +122288,31 @@ - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + - - + + @@ -122313,23 +122321,23 @@ - - - + + + - - - + + + - - - + + + @@ -122337,34 +122345,34 @@ - - - - + + + + - - - + + + - - - - + + + + - - - - + + + + - - - - - + + + + + @@ -122374,10 +122382,10 @@ - - - - + + + + @@ -122393,10 +122401,10 @@ - - - - + + + + @@ -122406,10 +122414,10 @@ - - - - + + + + @@ -122419,37 +122427,37 @@ - - - - + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + - - - - - + + + + + @@ -122460,9 +122468,9 @@ - - - + + + @@ -122473,11 +122481,11 @@ - - - - - + + + + + @@ -122509,11 +122517,11 @@ - - + + - + @@ -122530,15 +122538,15 @@ - - + + - - + + - - + + @@ -122558,8 +122566,8 @@ - - + + @@ -122569,8 +122577,8 @@ - - + + @@ -122582,8 +122590,8 @@ - - + + @@ -122597,18 +122605,18 @@ - - - + + + - - - - + + + + - - + + @@ -122616,10 +122624,10 @@ - - - - + + + + @@ -122632,14 +122640,14 @@ - - - - + + + + - - + + @@ -122670,22 +122678,22 @@ - - - + + + - - - + + + - - + + @@ -122696,29 +122704,29 @@ - - - - + + + + - - - - - + + + + + - - + + - - - + + + - - + + @@ -122737,11 +122745,11 @@ - - - - - + + + + + @@ -122749,8 +122757,8 @@ - - + + @@ -122768,11 +122776,11 @@ - - - - - + + + + + @@ -122800,21 +122808,21 @@ - - - + + + - - - - + + + + - - - - + + + + @@ -122827,9 +122835,9 @@ - - - + + + @@ -122840,31 +122848,31 @@ - - + + - - - + + + - - - + + + - - + + - - + + - - - + + + @@ -122873,8 +122881,8 @@ - - + + @@ -122972,12 +122980,12 @@ - - + + - - - + + + @@ -122986,17 +122994,17 @@ - - - + + + - - - + + + - + @@ -123007,9 +123015,9 @@ - - - + + + @@ -123074,10 +123082,10 @@ - - - - + + + + @@ -123105,13 +123113,13 @@ - - - - - - - + + + + + + + @@ -123258,12 +123266,12 @@ - - + + - - + + @@ -123275,11 +123283,11 @@ - - - - - + + + + + @@ -123320,8 +123328,8 @@ - - + + @@ -123374,8 +123382,8 @@ - - + + @@ -123387,9 +123395,9 @@ - - - + + + @@ -123400,23 +123408,23 @@ - - - - - - + + + + + + - - + + - - - - - + + + + + @@ -123473,8 +123481,8 @@ - - + + @@ -123489,9 +123497,9 @@ - - - + + + @@ -123533,8 +123541,8 @@ - - + + @@ -123587,51 +123595,51 @@ - - + + - - + + - - - + + + - - + + - - + + - - + + - - + + - - + + - - - - - + + + + + @@ -123639,18 +123647,18 @@ - - - - + + + + - - + + @@ -123658,14 +123666,14 @@ - - - - + + + + - - - + + + @@ -123696,17 +123704,17 @@ - - + + - - - + + + @@ -123716,9 +123724,9 @@ - - - + + + @@ -123760,12 +123768,12 @@ - - + + - - + + @@ -123779,67 +123787,67 @@ - - - + + + - - + + - - + + - - + + - - + + - - - - - + + + + + - - + + - - + + - - + + - - + + - - + + - - - + + + - - - + + + @@ -123847,12 +123855,12 @@ - - + + - - + + @@ -123863,53 +123871,53 @@ - - - - + + + + - - - + + + - - + + - - - - - + + + + + - - + + - - + + - - - - + + + + - - - - + + + + @@ -123930,11 +123938,11 @@ - - - - - + + + + + @@ -123951,24 +123959,24 @@ - - - - + + + + - - - - - + + + + + - - - - - + + + + + @@ -124003,12 +124011,12 @@ - - + + - - + + @@ -124033,18 +124041,18 @@ - - - + + + - - + + - - - + + + @@ -124068,18 +124076,18 @@ - - - - - + + + + + - - - - - + + + + + @@ -124090,19 +124098,19 @@ - - - - + + + + - - + + - - - + + + @@ -124121,14 +124129,14 @@ - - - + + + - - - + + + @@ -124154,9 +124162,9 @@ - - - + + + @@ -124169,14 +124177,14 @@ - - - - + + + + - - + + @@ -124194,39 +124202,39 @@ - - + + - - - + + + - - - - - + + + + + - - - + + + - - - - - + + + + + @@ -124239,9 +124247,9 @@ - - - + + + @@ -124260,14 +124268,14 @@ - - - - + + + + - - + + @@ -124278,44 +124286,44 @@ - - - - + + + + - - - + + + - - + + - - - + + + - - - + + + - - - + + + - - - - + + + + @@ -124338,16 +124346,16 @@ - - - - - - + + + + + + - - - + + + @@ -124355,9 +124363,9 @@ - - - + + + @@ -124384,28 +124392,28 @@ - - - + + + - - - + + + - - + + - - + + - - - - + + + + @@ -124430,9 +124438,9 @@ - - - + + + @@ -124448,32 +124456,32 @@ - - - - + + + + - - + + - - + + - - - + + + - - - + + + - - - + + + @@ -124482,9 +124490,9 @@ - - - + + + @@ -124492,112 +124500,112 @@ - - - + + + - - + + - - - + + + - - - + + + - - - - + + + + - - - - + + + + - - + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - + + - - + + - - - - + + + + - - - - + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - + + @@ -124617,8 +124625,8 @@ - - + + @@ -124632,61 +124640,61 @@ - - - - - + + + + + - - - + + + - - - - - + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - + + + + @@ -124704,12 +124712,12 @@ - - - - - - + + + + + + @@ -124720,12 +124728,12 @@ - - - - - - + + + + + + @@ -124733,9 +124741,9 @@ - - - + + + @@ -124748,15 +124756,15 @@ - - + + - - - - - + + + + + @@ -124773,10 +124781,10 @@ - - - - + + + + @@ -124786,10 +124794,10 @@ - - - - + + + + @@ -124808,8 +124816,8 @@ - - + + @@ -124820,8 +124828,8 @@ - - + + @@ -124928,25 +124936,25 @@ - - + + - - - - - - + + + + + + - - - + + + - - + + @@ -124955,57 +124963,57 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - + + + - - + + - - + + @@ -125021,10 +125029,10 @@ - - - - + + + + @@ -125066,25 +125074,25 @@ - - - + + + - - - + + + - - - + + + - - - - + + + + @@ -125093,8 +125101,8 @@ - - + + @@ -125125,18 +125133,18 @@ - - - + + + - - - + + + @@ -125152,34 +125160,34 @@ - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + @@ -125187,10 +125195,10 @@ - - - - + + + + @@ -125201,12 +125209,12 @@ - - + + - - + + @@ -125227,13 +125235,13 @@ - - - + + + - - + + @@ -125241,9 +125249,9 @@ - - - + + + @@ -125256,21 +125264,21 @@ - - - - + + + + - - - + + + - - - - + + + + @@ -125283,43 +125291,43 @@ - - + + - - + + - - + + - - - + + + - - + + - - + + - - - + + + - - + + - - - + + + @@ -125330,15 +125338,15 @@ - - - + + + - - - - + + + + @@ -125359,21 +125367,21 @@ - - - - + + + + - - - - - + + + + + @@ -125395,21 +125403,21 @@ - - + + - - + + - - - + + + - - + + @@ -125419,40 +125427,40 @@ - - + + - - + + - - - - - + + + + + - - - + + + - - - + + + - - + + - - + + - - + + @@ -125474,20 +125482,20 @@ - - - - - - + + + + + + - - + + - - + + @@ -125495,21 +125503,21 @@ - - - - - + + + + + - - - - - + + + + + - - + + @@ -125520,7 +125528,7 @@ - + @@ -125539,21 +125547,21 @@ - - - - + + + + - - - - - - - - - + + + + + + + + + @@ -125580,8 +125588,8 @@ - - + + @@ -125590,9 +125598,9 @@ - - - + + + @@ -125600,23 +125608,23 @@ - - - + + + - - - + + + - - - + + + @@ -125633,27 +125641,27 @@ - - + + - - - + + + - - - - + + + + @@ -125695,20 +125703,20 @@ - - + + - - + + - - + + @@ -125746,14 +125754,14 @@ - - - - + + + + - - - + + + @@ -125914,8 +125922,8 @@ - - + + @@ -125935,29 +125943,29 @@ - - - + + + - - + + - - + + - - + + - - + + - - + + @@ -125969,14 +125977,14 @@ - - - + + + - - - + + + @@ -125989,16 +125997,16 @@ - - - - + + + + - - - - + + + + @@ -126035,12 +126043,12 @@ - - + + - - + + @@ -126081,24 +126089,24 @@ - - + + - - + + - - + + - - + + @@ -126118,13 +126126,13 @@ - - + + - - - + + + @@ -126138,18 +126146,19 @@ - - - - + + + + - - - - + + + + + @@ -126163,12 +126172,12 @@ - - + + - - + + @@ -126191,8 +126200,8 @@ - - + + @@ -126205,64 +126214,64 @@ - - - - + + + + - - + + - - - + + + - - + + - + - + - - - - + + + + - - - - + + + + - - - - - - - - - + + + + + + + + + - - + + - - + + @@ -126271,36 +126280,36 @@ - - - - - + + + + + - - - - - - + + + + + + - - - - - - - + + + + + + + - - - - - - + + + + + + @@ -126311,12 +126320,12 @@ - - - - - - + + + + + + @@ -126335,9 +126344,9 @@ - - - + + + @@ -126347,8 +126356,8 @@ - - + + @@ -126362,19 +126371,19 @@ - - - - + + + + - - - + + + - - + + @@ -126427,27 +126436,27 @@ - - - - - + + + + + - - + + - - + + - - + + @@ -126455,20 +126464,20 @@ - - + + - - + + - - + + @@ -126515,8 +126524,8 @@ - - + + @@ -126526,21 +126535,21 @@ - - - - - + + + + + - - - - + + + + @@ -126554,24 +126563,24 @@ - - - + + + - - + + - - - - + + + + - - - + + + @@ -126599,38 +126608,38 @@ - - - + + + - - + + - - + + - - - + + + - - + + - - + + - - + + - - + + @@ -126639,7 +126648,7 @@ - + @@ -126679,17 +126688,17 @@ - + - + - - + + @@ -126708,8 +126717,8 @@ - - + + @@ -126736,31 +126745,31 @@ - - + + - - - - + + + + - - - + + + - - - + + + @@ -126820,8 +126829,8 @@ - - + + @@ -126862,16 +126871,16 @@ - - + + - - + + - - + + @@ -126882,8 +126891,8 @@ - - + + @@ -126902,12 +126911,12 @@ - - + + - - + + @@ -126923,8 +126932,8 @@ - - + + @@ -127037,10 +127046,10 @@ - - - - + + + + @@ -127049,20 +127058,20 @@ - - - - - - - - + + + + + + + + - - - - + + + + @@ -127070,14 +127079,14 @@ - - - + + + - - - + + + @@ -127090,8 +127099,8 @@ - - + + @@ -127103,8 +127112,8 @@ - - + + @@ -127141,8 +127150,8 @@ - - + + @@ -127193,22 +127202,22 @@ - - - - + + + + - - - - + + + + - - - - + + + + @@ -127294,8 +127303,8 @@ - - + + @@ -127303,22 +127312,22 @@ - - + + - - - - - - + + + + + + - - - - + + + + @@ -127331,9 +127340,9 @@ - - - + + + @@ -127341,9 +127350,9 @@ - - - + + + @@ -127391,13 +127400,13 @@ - - - - - - - + + + + + + + @@ -127405,24 +127414,24 @@ - - + + - - + + - - + + - - + + @@ -127438,20 +127447,20 @@ - - - - - - + + + + + + - - - + + + - - + + @@ -127467,8 +127476,8 @@ - - + + @@ -127485,8 +127494,8 @@ - - + + @@ -127499,15 +127508,15 @@ - - - + + + - - - - + + + + @@ -127515,39 +127524,39 @@ - - - + + + - - - - + + + + - - + + - - - + + + - - - - + + + + - - - + + + - - - + + + @@ -127555,30 +127564,30 @@ - - - - + + + + - - - - + + + + - - - - + + + + - - + + - - + + @@ -127686,8 +127695,8 @@ - - + + @@ -127756,12 +127765,12 @@ - - + + - - + + @@ -127773,14 +127782,14 @@ - - - + + + - - - + + + @@ -127788,9 +127797,9 @@ - - - + + + @@ -127815,12 +127824,12 @@ - - + + - - + + @@ -127838,10 +127847,10 @@ - - - - + + + + @@ -127858,62 +127867,62 @@ - - - - + + + + - - - + + + - - + + - - - - - - + + + + + + - - - - + + + + - - - - - - - + + + + + + + - - - + + + - - - + + + - - - + + + - - - - + + + + @@ -127924,7 +127933,7 @@ - + @@ -127958,10 +127967,10 @@ - - - - + + + + @@ -128003,7 +128012,7 @@ - + @@ -128011,34 +128020,34 @@ - - + + - - + + - - + + - - - - - - + + + + + + - - - - + + + + - - + + @@ -128049,10 +128058,10 @@ - - - - + + + + @@ -128062,8 +128071,8 @@ - - + + @@ -128074,8 +128083,8 @@ - - + + @@ -128104,8 +128113,8 @@ - - + + @@ -128138,11 +128147,11 @@ - - - - - + + + + + @@ -128175,11 +128184,11 @@ - - - - - + + + + + @@ -128251,21 +128260,21 @@ - - + + - - - + + + - - + + - - + + @@ -128299,11 +128308,11 @@ - - - - - + + + + + @@ -128318,21 +128327,21 @@ - - + + - - + + - - + + - - - + + + @@ -128348,11 +128357,11 @@ - - - - - + + + + + @@ -128386,21 +128395,21 @@ - - - - + + + + - - - - + + + + - - - + + + @@ -128421,26 +128430,26 @@ - - - - + + + + - - - + + + - - - - - + + + + + - - - + + + @@ -128449,20 +128458,20 @@ - - - + + + - - - + + + - - - + + + @@ -128472,26 +128481,26 @@ - - - + + + - - - + + + - - - - + + + + - - - - + + + + @@ -128605,9 +128614,9 @@ - - - + + + @@ -128616,9 +128625,9 @@ - - - + + + @@ -128626,21 +128635,21 @@ - - + + - - - - + + + + - - + + - - + + @@ -128648,15 +128657,15 @@ - - - + + + - - - - + + + + @@ -128668,57 +128677,57 @@ - - - - - - + + + + + + - - - - - - + + + + + + - - - - + + + + - - - + + + - - - + + + - - - - - + + + + + - - + + - - - + + + - - + + @@ -128729,13 +128738,13 @@ - - - - - - - + + + + + + + @@ -128767,10 +128776,10 @@ - - - - + + + + @@ -128778,10 +128787,10 @@ - - - - + + + + @@ -128789,10 +128798,10 @@ - - - - + + + + @@ -128815,10 +128824,10 @@ - - - - + + + + @@ -128834,29 +128843,29 @@ - + - - + + - - + + - - - - + + + + - - - - - - + + + + + + @@ -128885,13 +128894,13 @@ - - - - - - - + + + + + + + @@ -128910,10 +128919,10 @@ - - - - + + + + @@ -128930,10 +128939,10 @@ - - - - + + + + @@ -128943,30 +128952,30 @@ - - - + + + - - - - - - + + + + + + - - + + - - - - - - - + + + + + + + @@ -128983,13 +128992,13 @@ - - + + - - - + + + @@ -129008,39 +129017,39 @@ - - - + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - + + + - - + + @@ -129057,55 +129066,55 @@ - - - - - + + + + + - - - - - + + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - - - + + + - - - + + + @@ -129115,9 +129124,9 @@ - - - + + + @@ -129127,16 +129136,16 @@ - - - - - + + + + + - - - + + + @@ -129171,15 +129180,15 @@ - - - + + + - - - - + + + + @@ -129192,11 +129201,11 @@ - - - - - + + + + + @@ -129206,11 +129215,11 @@ - - - - - + + + + + @@ -129220,8 +129229,8 @@ - - + + @@ -129233,25 +129242,25 @@ - - + + - - + + - - - - - - - + + + + + + + - - + + @@ -129262,9 +129271,9 @@ - - - + + + @@ -129352,22 +129361,22 @@ - - - - - + + + + + - - - - - + + + + + - - + + @@ -129399,13 +129408,13 @@ - - + + - - - + + + @@ -129449,8 +129458,8 @@ - - + + @@ -129462,9 +129471,9 @@ - - - + + + @@ -129474,11 +129483,11 @@ - - - - - + + + + + @@ -129495,17 +129504,17 @@ - - + + - - - - - - - + + + + + + + @@ -129514,23 +129523,23 @@ - - + + - - - - + + + + - - - + + + - - + + @@ -129541,12 +129550,12 @@ - - - - - - + + + + + + @@ -129558,8 +129567,8 @@ - - + + @@ -129571,18 +129580,18 @@ - - - - - - + + + + + + - - - - + + + + @@ -129590,12 +129599,12 @@ - - + + - - + + @@ -129633,9 +129642,9 @@ - - - + + + @@ -129647,8 +129656,8 @@ - - + + @@ -129680,45 +129689,45 @@ - - - + + + - - - - + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - + + + + + @@ -129759,9 +129768,9 @@ - - - + + + @@ -129792,10 +129801,10 @@ - - - - + + + + @@ -129887,14 +129896,14 @@ - - - - + + + + - - + + @@ -129912,8 +129921,8 @@ - - + + @@ -130138,9 +130147,9 @@ - - - + + + @@ -130225,9 +130234,9 @@ - - - + + + @@ -130248,13 +130257,13 @@ - - - - - - - + + + + + + + @@ -130266,29 +130275,29 @@ - - - + + + - - + + - - + + - - - - - - + + + + + + - - + + @@ -130346,9 +130355,9 @@ - - - + + + @@ -130360,9 +130369,9 @@ - - - + + + @@ -130486,9 +130495,9 @@ - - - + + + @@ -130514,30 +130523,30 @@ - - + + - - + + - - + + - - - - + + + + - - - - - - + + + + + + @@ -130554,9 +130563,9 @@ - - - + + + @@ -130574,8 +130583,8 @@ - - + + @@ -130610,10 +130619,10 @@ - - - - + + + + @@ -130622,21 +130631,21 @@ - - - - + + + + - - - + + + - - - - + + + + @@ -130644,21 +130653,21 @@ - - - - + + + + - - - - - + + + + + - - - + + + @@ -130677,12 +130686,12 @@ - - - + + + - - + + @@ -130697,26 +130706,26 @@ - - + + - - + + - - + + - + - + @@ -130728,12 +130737,12 @@ - - + + - - + + @@ -130748,23 +130757,23 @@ - - + + - - + + - - - + + + - + - + @@ -130783,15 +130792,15 @@ - - - + + + - - - - + + + + @@ -130804,20 +130813,20 @@ - - - + + + - - - - + + + + - - - + + + @@ -130839,9 +130848,9 @@ - - - + + + @@ -130850,10 +130859,10 @@ - - - - + + + + @@ -130861,9 +130870,9 @@ - - - + + + @@ -130871,9 +130880,9 @@ - - - + + + @@ -130882,17 +130891,17 @@ - - - - + + + + - + @@ -130904,8 +130913,8 @@ - - + + @@ -130993,8 +131002,8 @@ - - + + @@ -131003,8 +131012,8 @@ - - + + @@ -131027,19 +131036,19 @@ - - - - - - - - - + + + + + + + + + - - + + @@ -131051,9 +131060,9 @@ - - - + + + @@ -131072,14 +131081,14 @@ - - - - + + + + - - + + @@ -131113,7 +131122,6 @@ - @@ -131135,19 +131143,19 @@ - - + + - - - - + + + + - - - + + + @@ -131165,8 +131173,8 @@ - - + + @@ -131176,24 +131184,24 @@ - - - - - + + + + + - - - - + + + + - - - - - + + + + + @@ -131203,26 +131211,26 @@ - - - - + + + + - - - + + + - - - + + + - - - + + + @@ -131245,12 +131253,12 @@ - + - - - + + + @@ -131348,10 +131356,10 @@ - - - - + + + + @@ -131359,10 +131367,10 @@ - - - - + + + + @@ -131441,19 +131449,19 @@ - - - + + + - - - + + + - - - + + + @@ -131483,8 +131491,8 @@ - - + + @@ -131502,8 +131510,8 @@ - - + + @@ -131517,14 +131525,14 @@ - - - + + + - - - + + + @@ -131558,9 +131566,9 @@ - - - + + + @@ -131651,11 +131659,11 @@ - - - - - + + + + + @@ -131869,9 +131877,9 @@ - - - + + + @@ -131983,15 +131991,15 @@ - - + + - - - - - + + + + + @@ -132025,8 +132033,8 @@ - - + + @@ -132057,17 +132065,17 @@ - - + + - - + + - - - + + + @@ -132078,8 +132086,8 @@ - - + + @@ -132106,12 +132114,12 @@ - - + + - - + + @@ -132134,8 +132142,8 @@ - - + + @@ -132157,8 +132165,8 @@ - - + + @@ -132189,9 +132197,9 @@ - - - + + + @@ -132214,9 +132222,9 @@ - - - + + + @@ -132231,12 +132239,12 @@ - - + + - - + + @@ -132255,8 +132263,8 @@ - - + + @@ -132271,16 +132279,16 @@ - - - - - - - - - - + + + + + + + + + + @@ -132314,8 +132322,8 @@ - - + + @@ -132333,9 +132341,9 @@ - - - + + + @@ -132347,9 +132355,9 @@ - - - + + + @@ -132368,24 +132376,24 @@ - - - + + + - - - - + + + + - - - + + + @@ -132407,8 +132415,8 @@ - - + + @@ -132427,9 +132435,9 @@ - - - + + + @@ -132438,28 +132446,28 @@ - - - - + + + + - - + + - - + + - - - + + + - - - + + + @@ -132468,14 +132476,14 @@ - - - - + + + + - - + + @@ -132486,9 +132494,9 @@ - - - + + + @@ -132514,8 +132522,8 @@ - - + + @@ -132612,15 +132620,15 @@ - - - + + + - - - - + + + + @@ -132632,8 +132640,8 @@ - - + + @@ -132661,14 +132669,14 @@ - - + + - - - - + + + + @@ -132692,30 +132700,30 @@ - - + + - - + + - - - + + + - - - + + + - - + + @@ -132735,13 +132743,13 @@ - - - + + + - - + + @@ -132767,9 +132775,9 @@ - - - + + + @@ -132790,10 +132798,10 @@ - - - - + + + + @@ -132843,9 +132851,9 @@ - - - + + + @@ -132905,21 +132913,21 @@ - - - + + + - - - - - - + + + + + + - - + + @@ -133100,10 +133108,10 @@ - - - - + + + + @@ -133384,10 +133392,10 @@ - - - - + + + + @@ -133431,9 +133439,9 @@ - - - + + + @@ -133447,10 +133455,10 @@ - - - - + + + + @@ -133528,9 +133536,9 @@ - - - + + + @@ -133557,21 +133565,21 @@ - - - - + + + + - - - - + + + + - - - + + + @@ -133582,9 +133590,9 @@ - - - + + + @@ -133599,14 +133607,14 @@ - - - + + + - - - + + + @@ -133648,15 +133656,15 @@ - - + + - - - - - + + + + + @@ -133733,8 +133741,8 @@ - - + + @@ -133770,8 +133778,8 @@ - - + + @@ -133838,9 +133846,9 @@ - - - + + + @@ -133911,26 +133919,26 @@ - - - - - - - + + + + + + + - - + + - - - + + + @@ -133975,13 +133983,13 @@ - - - + + + - - - + + + @@ -134041,15 +134049,15 @@ - - + + - - + + @@ -134060,16 +134068,16 @@ - - - - - + + + + + - - - + + + @@ -134078,11 +134086,11 @@ - - - - - + + + + + @@ -134091,9 +134099,9 @@ - - - + + + @@ -134143,11 +134151,11 @@ - - - - - + + + + + @@ -134157,17 +134165,17 @@ - - - + + + - - + + - - + + @@ -134176,12 +134184,12 @@ - - + + - - + + @@ -134189,8 +134197,8 @@ - - + + @@ -134207,8 +134215,8 @@ - - + + @@ -134216,12 +134224,12 @@ - - - + + + - + @@ -134250,17 +134258,17 @@ - - - + + + - - + + @@ -134327,28 +134335,28 @@ - - - + + + - - - - - + + + + + - - - - - + + + + + - - - + + + @@ -134358,17 +134366,17 @@ - - + + - - - - + + + + @@ -134379,26 +134387,26 @@ - - - - + + + + - - - - + + + + - - + + - - - - + + + + @@ -134409,9 +134417,9 @@ - - - + + + @@ -134443,10 +134451,10 @@ - - - - + + + + @@ -134479,9 +134487,9 @@ - - - + + + @@ -134498,15 +134506,15 @@ - - - - + + + + - - - + + + @@ -134530,12 +134538,12 @@ - - - - - - + + + + + + @@ -134557,13 +134565,13 @@ - - + + - - - + + + @@ -134580,10 +134588,10 @@ - - - - + + + + @@ -134594,47 +134602,47 @@ - - - + + + - - + + - - - - - - - + + + + + + + - - + + - - - + + + - - - - - - - + + + + + + + - - - - - - + + + + + + From 58f1839adc9a6011266049cb2ff98b1e26325fa0 Mon Sep 17 00:00:00 2001 From: Yee Lee Date: Wed, 28 Jul 2021 21:31:57 +0800 Subject: [PATCH 06/12] FROMGIT: arm64/cpufeature: Optionally disable MTE via command-line MTE support needs to be optionally disabled in runtime for HW issue workaround, FW development and some evaluation works on system resource and performance. This patch makes two changes: (1) moves init of tag-allocation bits(ATA/ATA0) to cpu_enable_mte() as not cached in TLB. (2) allows ID_AA64PFR1_EL1.MTE to be overridden on its shadow value by giving "arm64.nomte" on cmdline. When the feature value is off, ATA and TCF will not set and the related functionalities are accordingly suppressed. Change-Id: Ic9cf6d3a12a33b312643d96101c72a657cb714af Link: https://lore.kernel.org/lkml/20210803070824.7586-2-yee.lee@mediatek.com/ (cherry picked from commit 7a062ce31807eb402c38edbec50c1b848b4298f3 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git next) Bug: 195507092 Suggested-by: Catalin Marinas Suggested-by: Marc Zyngier Suggested-by: Suzuki K Poulose Signed-off-by: Yee Lee --- Documentation/admin-guide/kernel-parameters.txt | 3 +++ arch/arm64/include/asm/sysreg.h | 3 +-- arch/arm64/kernel/cpufeature.c | 3 +++ arch/arm64/kernel/idreg-override.c | 2 ++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 29c5f46bee20..093524d70372 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -393,6 +393,9 @@ arm64.nopauth [ARM64] Unconditionally disable Pointer Authentication support + arm64.nomte [ARM64] Unconditionally disable Memory Tagging Extension + support + ataflop= [HW,M68k] atarimouse= [HW,MOUSE] Atari Mouse diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h index 6201de6fdaac..2f09c856b6bc 100644 --- a/arch/arm64/include/asm/sysreg.h +++ b/arch/arm64/include/asm/sysreg.h @@ -684,8 +684,7 @@ (SCTLR_ELx_M | SCTLR_ELx_C | SCTLR_ELx_SA | SCTLR_EL1_SA0 | \ SCTLR_EL1_SED | SCTLR_ELx_I | SCTLR_EL1_DZE | SCTLR_EL1_UCT | \ SCTLR_EL1_NTWE | SCTLR_ELx_IESB | SCTLR_EL1_SPAN | SCTLR_ELx_ITFSB | \ - SCTLR_ELx_ATA | SCTLR_EL1_ATA0 | ENDIAN_SET_EL1 | SCTLR_EL1_UCI | \ - SCTLR_EL1_RES1) + ENDIAN_SET_EL1 | SCTLR_EL1_UCI | SCTLR_EL1_RES1) /* MAIR_ELx memory attributes (used by Linux) */ #define MAIR_ATTR_DEVICE_nGnRnE UL(0x00) diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index c9711b504e8f..d9e5c16f2037 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -1835,6 +1835,9 @@ static void bti_enable(const struct arm64_cpu_capabilities *__unused) #ifdef CONFIG_ARM64_MTE static void cpu_enable_mte(struct arm64_cpu_capabilities const *cap) { + sysreg_clear_set(sctlr_el1, 0, SCTLR_ELx_ATA | SCTLR_EL1_ATA0); + isb(); + /* * Clear the tags in the zero page. This needs to be done via the * linear map which has the Tagged attribute. diff --git a/arch/arm64/kernel/idreg-override.c b/arch/arm64/kernel/idreg-override.c index cc071712c6f9..81b7ecb69cd1 100644 --- a/arch/arm64/kernel/idreg-override.c +++ b/arch/arm64/kernel/idreg-override.c @@ -42,6 +42,7 @@ static const struct ftr_set_desc pfr1 __initconst = { .override = &id_aa64pfr1_override, .fields = { { "bt", ID_AA64PFR1_BT_SHIFT }, + { "mte", ID_AA64PFR1_MTE_SHIFT}, {} }, }; @@ -88,6 +89,7 @@ static const struct { { "arm64.nopauth", "id_aa64isar1.gpi=0 id_aa64isar1.gpa=0 " "id_aa64isar1.api=0 id_aa64isar1.apa=0" }, + { "arm64.nomte", "id_aa64pfr1.mte=0" }, { "nokaslr", "kaslr.disabled=1" }, }; From 41b79ac98d5dc5469e47488a5f095116cf2dbe7c Mon Sep 17 00:00:00 2001 From: Wesley Cheng Date: Thu, 29 Jul 2021 00:33:14 -0700 Subject: [PATCH 07/12] FROMGIT: usb: dwc3: gadget: Use list_replace_init() before traversing lists The list_for_each_entry_safe() macro saves the current item (n) and the item after (n+1), so that n can be safely removed without corrupting the list. However, when traversing the list and removing items using gadget giveback, the DWC3 lock is briefly released, allowing other routines to execute. There is a situation where, while items are being removed from the cancelled_list using dwc3_gadget_ep_cleanup_cancelled_requests(), the pullup disable routine is running in parallel (due to UDC unbind). As the cleanup routine removes n, and the pullup disable removes n+1, once the cleanup retakes the DWC3 lock, it references a request who was already removed/handled. With list debug enabled, this leads to a panic. Ensure all instances of the macro are replaced where gadget giveback is used. Example call stack: Thread#1: __dwc3_gadget_ep_set_halt() - CLEAR HALT -> dwc3_gadget_ep_cleanup_cancelled_requests() ->list_for_each_entry_safe() ->dwc3_gadget_giveback(n) ->dwc3_gadget_del_and_unmap_request()- n deleted[cancelled_list] ->spin_unlock ->Thread#2 executes ... ->dwc3_gadget_giveback(n+1) ->Already removed! Thread#2: dwc3_gadget_pullup() ->waiting for dwc3 spin_lock ... ->Thread#1 released lock ->dwc3_stop_active_transfers() ->dwc3_remove_requests() ->fetches n+1 item from cancelled_list (n removed by Thread#1) ->dwc3_gadget_giveback() ->dwc3_gadget_del_and_unmap_request()- n+1 deleted[cancelled_list] ->spin_unlock Fix this condition by utilizing list_replace_init(), and traversing through a local copy of the current elements in the endpoint lists. This will also set the parent list as empty, so if another thread is also looping through the list, it will be empty on the next iteration. Fixes: d4f1afe5e896 ("usb: dwc3: gadget: move requests to cancelled_list") Cc: stable Acked-by: Felipe Balbi Signed-off-by: Wesley Cheng Link: https://lore.kernel.org/r/1627543994-20327-1-git-send-email-wcheng@codeaurora.org Signed-off-by: Greg Kroah-Hartman (cherry picked from commit d25d85061bd856d6be221626605319154f9b5043 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-linus) Bug: 195570448 Signed-off-by: Greg Kroah-Hartman Change-Id: I0eebb6938d7fac97f6126deda2984387dec1e794 --- drivers/usb/dwc3/gadget.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 6162570846d0..685ec18503c5 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1924,9 +1924,13 @@ static void dwc3_gadget_ep_cleanup_cancelled_requests(struct dwc3_ep *dep) { struct dwc3_request *req; struct dwc3_request *tmp; + struct list_head local; struct dwc3 *dwc = dep->dwc; - list_for_each_entry_safe(req, tmp, &dep->cancelled_list, list) { +restart: + list_replace_init(&dep->cancelled_list, &local); + + list_for_each_entry_safe(req, tmp, &local, list) { dwc3_gadget_ep_skip_trbs(dep, req); switch (req->status) { case DWC3_REQUEST_STATUS_DISCONNECTED: @@ -1944,6 +1948,9 @@ static void dwc3_gadget_ep_cleanup_cancelled_requests(struct dwc3_ep *dep) break; } } + + if (!list_empty(&dep->cancelled_list)) + goto restart; } static int dwc3_gadget_ep_dequeue(struct usb_ep *ep, @@ -3200,8 +3207,12 @@ static void dwc3_gadget_ep_cleanup_completed_requests(struct dwc3_ep *dep, { struct dwc3_request *req; struct dwc3_request *tmp; + struct list_head local; - list_for_each_entry_safe(req, tmp, &dep->started_list, list) { +restart: + list_replace_init(&dep->started_list, &local); + + list_for_each_entry_safe(req, tmp, &local, list) { int ret; ret = dwc3_gadget_ep_cleanup_completed_request(dep, event, @@ -3209,6 +3220,9 @@ static void dwc3_gadget_ep_cleanup_completed_requests(struct dwc3_ep *dep, if (ret) break; } + + if (!list_empty(&dep->started_list)) + goto restart; } static bool dwc3_gadget_ep_should_continue(struct dwc3_ep *dep) From bed43a725d3c3f9fc153339f2e2a4f879e717be5 Mon Sep 17 00:00:00 2001 From: Wesley Cheng Date: Tue, 3 Aug 2021 23:24:05 -0700 Subject: [PATCH 08/12] FROMGIT: usb: dwc3: gadget: Avoid runtime resume if disabling pullup If the device is already in the runtime suspended state, any call to the pullup routine will issue a runtime resume on the DWC3 core device. If the USB gadget is disabling the pullup, then avoid having to issue a runtime resume, as DWC3 gadget has already been halted/stopped. This fixes an issue where the following condition occurs: usb_gadget_remove_driver() -->usb_gadget_disconnect() -->dwc3_gadget_pullup(0) -->pm_runtime_get_sync() -> ret = 0 -->pm_runtime_put() [async] -->usb_gadget_udc_stop() -->dwc3_gadget_stop() -->dwc->gadget_driver = NULL ... dwc3_suspend_common() -->dwc3_gadget_suspend() -->DWC3 halt/stop routine skipped, driver_data == NULL This leads to a situation where the DWC3 gadget is not properly stopped, as the runtime resume would have re-enabled EP0 and event interrupts, and since we avoided the DWC3 gadget suspend, these resources were never disabled. Fixes: 77adb8bdf422 ("usb: dwc3: gadget: Allow runtime suspend if UDC unbinded") Cc: stable Acked-by: Felipe Balbi Signed-off-by: Wesley Cheng Link: https://lore.kernel.org/r/1628058245-30692-1-git-send-email-wcheng@codeaurora.org Signed-off-by: Greg Kroah-Hartman (cherry picked from commit cb10f68ad8150f243964b19391711aaac5e8ff42 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-linus) Bug: 195568631 Signed-off-by: Greg Kroah-Hartman Change-Id: I98cb28c7cfbc2965aa6e470912e0eb6700a74be9 --- drivers/usb/dwc3/gadget.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 685ec18503c5..4e8af37da25f 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2438,6 +2438,17 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on) } } + /* + * Avoid issuing a runtime resume if the device is already in the + * suspended state during gadget disconnect. DWC3 gadget was already + * halted/stopped during runtime suspend. + */ + if (!is_on) { + pm_runtime_barrier(dwc->dev); + if (pm_runtime_suspended(dwc->dev)) + return 0; + } + /* * Check the return value for successful resume, or error. For a * successful resume, the DWC3 runtime PM resume routine will handle From 8914725a582861666a2a298efbcb5ae7613a47b7 Mon Sep 17 00:00:00 2001 From: Kyle Tso Date: Tue, 3 Aug 2021 17:13:14 +0800 Subject: [PATCH 09/12] FROMGIT: usb: typec: tcpm: Keep other events when receiving FRS and Sourcing_vbus events When receiving FRS and Sourcing_Vbus events from low-level drivers, keep other events which come a bit earlier so that they will not be ignored in the event handler. Fixes: 8dc4bd073663 ("usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)") Cc: stable Cc: Badhri Jagan Sridharan Reviewed-by: Guenter Roeck Reviewed-by: Badhri Jagan Sridharan Signed-off-by: Kyle Tso Link: https://lore.kernel.org/r/20210803091314.3051302-1-kyletso@google.com Signed-off-by: Greg Kroah-Hartman (cherry picked from commit 43ad944cd73f2360ec8ff31d29ea44830b3119af https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-linus) Bug: 194987217 Signed-off-by: Kyle Tso Change-Id: Ibb4a2ccd2bbb34e53d4fbe44803aad521bb7029f --- drivers/usb/typec/tcpm/tcpm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index 46000e32f2a2..50ab02c902a3 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -5489,7 +5489,7 @@ EXPORT_SYMBOL_GPL(tcpm_pd_hard_reset); void tcpm_sink_frs(struct tcpm_port *port) { spin_lock(&port->pd_event_lock); - port->pd_events = TCPM_FRS_EVENT; + port->pd_events |= TCPM_FRS_EVENT; spin_unlock(&port->pd_event_lock); kthread_queue_work(port->wq, &port->event_work); } @@ -5498,7 +5498,7 @@ EXPORT_SYMBOL_GPL(tcpm_sink_frs); void tcpm_sourcing_vbus(struct tcpm_port *port) { spin_lock(&port->pd_event_lock); - port->pd_events = TCPM_SOURCING_VBUS; + port->pd_events |= TCPM_SOURCING_VBUS; spin_unlock(&port->pd_event_lock); kthread_queue_work(port->wq, &port->event_work); } From d8b946254effbe36780f0b855da509a07470b8d2 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 3 Aug 2021 09:15:12 -0700 Subject: [PATCH 10/12] FROMGIT: blk-mq: Introduce the BLK_MQ_F_NO_SCHED_BY_DEFAULT flag elevator_get_default() uses the following algorithm to select an I/O scheduler from inside add_disk(): - In case of a single hardware queue or sharing hardware queues across multiple request queues (BLK_MQ_F_TAG_HCTX_SHARED), use mq-deadline. - Otherwise, use 'none'. This is a good choice for most but not for all block drivers. Make it possible to override the selection of mq-deadline with a new flag, namely BLK_MQ_F_NO_SCHED_BY_DEFAULT. Signed-off-by: Bart Van Assche Bug: 194450129 (cherry picked from commit 90b7198001f23ea37d3b46dc631bdaa2357a20b1 git://git.kernel.dk/linux-block/ for-5.15/block) Change-Id: I4fb658957c193f350e74bdb5876c20a8f628fcb1 Signed-off-by: Bart Van Assche --- block/elevator.c | 3 +++ include/linux/blk-mq.h | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/block/elevator.c b/block/elevator.c index 293c5c81397a..50230a94dc09 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -621,6 +621,9 @@ static inline bool elv_support_iosched(struct request_queue *q) */ static struct elevator_type *elevator_get_default(struct request_queue *q) { + if (q->tag_set && q->tag_set->flags & BLK_MQ_F_NO_SCHED_BY_DEFAULT) + return NULL; + if (q->nr_hw_queues != 1) return NULL; diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index 1626eb27be24..a2aa73d8437a 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -394,7 +394,13 @@ enum { BLK_MQ_F_STACKING = 1 << 2, BLK_MQ_F_TAG_HCTX_SHARED = 1 << 3, BLK_MQ_F_BLOCKING = 1 << 5, + /* Do not allow an I/O scheduler to be configured. */ BLK_MQ_F_NO_SCHED = 1 << 6, + /* + * Select 'none' during queue registration in case of a single hwq + * or shared hwqs instead of 'mq-deadline'. + */ + BLK_MQ_F_NO_SCHED_BY_DEFAULT = 1 << 7, BLK_MQ_F_ALLOC_POLICY_START_BIT = 8, BLK_MQ_F_ALLOC_POLICY_BITS = 1, From bda49ad0602e5250a9d3dd61deda19d3e5615c54 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 2 Aug 2021 10:05:29 -0700 Subject: [PATCH 11/12] FROMGIT: loop: Select I/O scheduler 'none' from inside add_disk() We noticed that the user interface of Android devices becomes very slow under memory pressure. This is because Android uses the zram driver on top of the loop driver for swapping, because under memory pressure the swap code alternates reads and writes quickly, because mq-deadline is the default scheduler for loop devices and because mq-deadline delays writes by five seconds for such a workload with default settings. Fix this by making the kernel select I/O scheduler 'none' from inside add_disk() for loop devices. This default can be overridden at any time from user space, e.g. via a udev rule. This approach has an advantage compared to changing the I/O scheduler from userspace from 'mq-deadline' into 'none', namely that synchronize_rcu() does not get called. Additionally, this patch reduces the Android boot time on my test setup with 0.5 seconds compared to configuring the loop I/O scheduler from user space. Signed-off-by: Bart Van Assche Bug: 194450129 (cherry picked from commit 2112f5c1330a671fa852051d85cb9eadc05d7eb7 git://git.kernel.dk/linux-block/ for-5.15/block) Change-Id: I6f9579b4cd2cb22fcb5c858d4f292f1870336fdd Signed-off-by: Bart Van Assche --- drivers/block/loop.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index a58084c2ed7c..a34fc3f42e3b 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -2113,7 +2113,8 @@ static int loop_add(struct loop_device **l, int i) lo->tag_set.queue_depth = 128; lo->tag_set.numa_node = NUMA_NO_NODE; lo->tag_set.cmd_size = sizeof(struct loop_cmd); - lo->tag_set.flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_STACKING; + lo->tag_set.flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_STACKING | + BLK_MQ_F_NO_SCHED_BY_DEFAULT; lo->tag_set.driver_data = lo; err = blk_mq_alloc_tag_set(&lo->tag_set); From 1efc36b815769cb8c7dae1d53373b190c017f5d1 Mon Sep 17 00:00:00 2001 From: JianMin Liu Date: Wed, 4 Aug 2021 11:52:40 +0800 Subject: [PATCH 12/12] ANDROID: sched: add a helper function to change PELT half-life Add a new helper function and export it for vendor module to dynamically switch to an alternative half-life at runtime. Bug: 195474490 Signed-off-by: JianMin Liu Change-Id: Ife41997a032fe3384cfa126cbf7aee929c5c11cf --- kernel/sched/pelt.c | 41 ++++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/kernel/sched/pelt.c b/kernel/sched/pelt.c index cd54fab42cf4..bbb0de2219f9 100644 --- a/kernel/sched/pelt.c +++ b/kernel/sched/pelt.c @@ -32,15 +32,16 @@ int pelt_load_avg_period = PELT32_LOAD_AVG_PERIOD; int pelt_load_avg_max = PELT32_LOAD_AVG_MAX; const u32 *pelt_runnable_avg_yN_inv = pelt32_runnable_avg_yN_inv; -static int __init set_pelt(char *str) +int get_pelt_halflife(void) { - int rc, num; + return pelt_load_avg_period; +} +EXPORT_SYMBOL_GPL(get_pelt_halflife); - rc = kstrtoint(str, 0, &num); - if (rc) { - pr_err("%s: kstrtoint failed. rc=%d\n", __func__, rc); - return 0; - } +static int __set_pelt_halflife(void *data) +{ + int rc = 0; + int num = *(int *)data; switch (num) { case PELT8_LOAD_AVG_PERIOD: @@ -56,10 +57,32 @@ static int __init set_pelt(char *str) pr_info("PELT half life is set to %dms\n", num); break; default: - pr_err("Default PELT half life is 32ms\n"); + rc = -EINVAL; + pr_err("Failed to set PELT half life to %dms, the current value is %dms\n", + num, pelt_load_avg_period); } - return 0; + return rc; +} + +int set_pelt_halflife(int num) +{ + return stop_machine(__set_pelt_halflife, &num, NULL); +} +EXPORT_SYMBOL_GPL(set_pelt_halflife); + +static int __init set_pelt(char *str) +{ + int rc, num; + + rc = kstrtoint(str, 0, &num); + if (rc) { + pr_err("%s: kstrtoint failed. rc=%d\n", __func__, rc); + return 0; + } + + __set_pelt_halflife(&num); + return rc; } early_param("pelt", set_pelt);