From 1869fba86a8f196715887133a040e6d3ded7ac6e Mon Sep 17 00:00:00 2001 From: Subbaraman Narayanamurthy Date: Tue, 8 Sep 2020 20:26:36 -0700 Subject: [PATCH 1/6] ANDROID: ABI: update allowed list for QCOM Leaf changes summary: 2 artifacts changed Changed leaf types summary: 0 leaf type changed Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 2 Added functions Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable 2 Added functions: [A] 'function int led_classdev_flash_register_ext(device*, led_classdev_flash*, led_init_data*)' [A] 'function void led_classdev_flash_unregister(led_classdev_flash*)' Bug: 168090628 Change-Id: I4006604af3341a67a253ca4184ed9daff2990cba Signed-off-by: Subbaraman Narayanamurthy --- android/abi_gki_aarch64.xml | 2133 ++++++++++++++++++---------------- android/abi_gki_aarch64_qcom | 2 + 2 files changed, 1143 insertions(+), 992 deletions(-) diff --git a/android/abi_gki_aarch64.xml b/android/abi_gki_aarch64.xml index a263c39a0a40..cd574f3cb18c 100644 --- a/android/abi_gki_aarch64.xml +++ b/android/abi_gki_aarch64.xml @@ -2145,6 +2145,8 @@ + + @@ -5037,258 +5039,258 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -5304,38 +5306,38 @@ - + - + - + - + - + - + - - + + - + - + - + - + @@ -11205,23 +11207,6 @@ - - - - - - - - - - - - - - - - - @@ -14033,28 +14018,28 @@ - + - + - + - + - + - + - + - + - + @@ -14158,12 +14143,12 @@ - + - + - + @@ -14209,6 +14194,23 @@ + + + + + + + + + + + + + + + + + @@ -14217,12 +14219,12 @@ - + - + - + @@ -14345,12 +14347,12 @@ - + - + - + @@ -14361,12 +14363,12 @@ - + - + - + @@ -17281,7 +17283,7 @@ - + @@ -18050,23 +18052,23 @@ - + - + - + - + - + - + - + @@ -20289,32 +20291,32 @@ - + - + - + - + - + - + - + - + - + - + @@ -22041,7 +22043,7 @@ - + @@ -26282,7 +26284,7 @@ - + @@ -26300,7 +26302,7 @@ - + @@ -36502,6 +36504,14 @@ + + + + + + + + @@ -36512,6 +36522,7 @@ + @@ -37107,7 +37118,7 @@ - + @@ -37493,7 +37504,7 @@ - + @@ -37516,7 +37527,7 @@ - + @@ -41224,9 +41235,9 @@ - - - + + + @@ -42008,7 +42019,7 @@ - + @@ -42028,7 +42039,7 @@ - + @@ -42631,13 +42642,13 @@ - + - + - + @@ -42663,7 +42674,7 @@ - + @@ -44262,7 +44273,7 @@ - + @@ -44324,7 +44335,7 @@ - + @@ -44631,6 +44642,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -45782,7 +45883,7 @@ - + @@ -46268,7 +46369,7 @@ - + @@ -46305,7 +46406,7 @@ - + @@ -46516,7 +46617,7 @@ - + @@ -47481,10 +47582,10 @@ - + - + @@ -50916,7 +51017,7 @@ - + @@ -51579,7 +51680,7 @@ - + @@ -53285,7 +53386,7 @@ - + @@ -53998,6 +54099,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -54023,10 +54198,10 @@ - + - + @@ -54055,6 +54230,8 @@ + + @@ -54064,7 +54241,7 @@ - + @@ -54075,24 +54252,24 @@ - + - + - + - + - + @@ -54102,7 +54279,7 @@ - + @@ -54111,11 +54288,11 @@ - + - + @@ -54648,14 +54825,6 @@ - - - - - - - - @@ -55317,12 +55486,12 @@ - + - + @@ -55406,12 +55575,12 @@ - + - + - + @@ -55619,7 +55788,7 @@ - + @@ -55633,7 +55802,7 @@ - + @@ -55681,7 +55850,7 @@ - + @@ -55691,7 +55860,7 @@ - + @@ -55737,37 +55906,37 @@ - + - + - + - + - + - + - + @@ -55976,26 +56145,26 @@ - + - + - + - + - + - + - + - + @@ -56181,7 +56350,7 @@ - + @@ -56191,7 +56360,7 @@ - + @@ -57773,12 +57942,6 @@ - - - - - - @@ -57786,7 +57949,7 @@ - + @@ -57799,13 +57962,19 @@ - + - + + + + + + + @@ -57817,13 +57986,13 @@ - + - + @@ -57832,7 +58001,7 @@ - + @@ -57842,7 +58011,7 @@ - + @@ -57856,7 +58025,7 @@ - + @@ -57872,7 +58041,7 @@ - + @@ -57903,7 +58072,7 @@ - + @@ -57912,7 +58081,7 @@ - + @@ -57927,11 +58096,11 @@ - + - + @@ -58696,7 +58865,7 @@ - + @@ -58723,7 +58892,7 @@ - + @@ -59189,23 +59358,23 @@ - + - + - + - + - + - + - + @@ -61080,6 +61249,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -62424,6 +62616,7 @@ + @@ -62630,12 +62823,12 @@ - + - + @@ -62643,7 +62836,7 @@ - + @@ -62651,7 +62844,7 @@ - + @@ -62683,7 +62876,7 @@ - + @@ -62701,7 +62894,7 @@ - + @@ -62718,12 +62911,12 @@ - + - + @@ -62750,7 +62943,7 @@ - + @@ -63499,7 +63692,7 @@ - + @@ -63583,7 +63776,7 @@ - + @@ -66305,7 +66498,7 @@ - + @@ -66316,7 +66509,7 @@ - + @@ -69814,41 +70007,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -69881,38 +70039,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -69955,10 +70081,8 @@ - - @@ -70086,7 +70210,7 @@ - + @@ -70160,9 +70284,9 @@ - + - + @@ -70681,7 +70805,7 @@ - + @@ -71325,7 +71449,7 @@ - + @@ -71741,10 +71865,10 @@ - + - + @@ -72540,11 +72664,11 @@ - + - + @@ -73382,17 +73506,17 @@ - - - + + + - - + + - - + + @@ -78897,23 +79021,6 @@ - - - - - - - - - - - - - - - - - @@ -80869,7 +80976,7 @@ - + @@ -82706,23 +82813,6 @@ - - - - - - - - - - - - - - - - - @@ -83554,7 +83644,7 @@ - + @@ -84283,7 +84373,7 @@ - + @@ -85229,6 +85319,23 @@ + + + + + + + + + + + + + + + + + @@ -86492,7 +86599,7 @@ - + @@ -86564,7 +86671,7 @@ - + @@ -86578,7 +86685,7 @@ - + @@ -86589,12 +86696,12 @@ - + - + - + @@ -86633,7 +86740,7 @@ - + @@ -87003,23 +87110,6 @@ - - - - - - - - - - - - - - - - - @@ -87269,7 +87359,7 @@ - + @@ -87341,10 +87431,10 @@ - + - + @@ -87778,13 +87868,13 @@ - + - + @@ -87980,6 +88070,23 @@ + + + + + + + + + + + + + + + + + @@ -88742,7 +88849,7 @@ - + @@ -88820,23 +88927,6 @@ - - - - - - - - - - - - - - - - - @@ -89696,7 +89786,7 @@ - + @@ -91430,7 +91520,7 @@ - + @@ -92561,7 +92651,7 @@ - + @@ -92579,7 +92669,7 @@ - + @@ -93893,7 +93983,7 @@ - + @@ -93914,7 +94004,7 @@ - + @@ -96126,7 +96216,7 @@ - + @@ -96159,7 +96249,7 @@ - + @@ -100382,7 +100472,7 @@ - + @@ -101625,7 +101715,24 @@ - + + + + + + + + + + + + + + + + + + @@ -102401,7 +102508,7 @@ - + @@ -104057,7 +104164,7 @@ - + @@ -104068,7 +104175,7 @@ - + @@ -104146,7 +104253,7 @@ - + @@ -104163,12 +104270,12 @@ - + - + @@ -104402,14 +104509,6 @@ - - - - - - - - @@ -104559,6 +104658,23 @@ + + + + + + + + + + + + + + + + + @@ -104630,10 +104746,10 @@ - + - + @@ -105002,209 +105118,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -105232,145 +105148,134 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - @@ -105543,13 +105448,6 @@ - - - - - - - @@ -105557,10 +105455,6 @@ - - - - @@ -105855,28 +105749,28 @@ - - - - - + + + + + - - - - - + + + + + - - - - + + + + - - + + @@ -105900,7 +105794,7 @@ - + @@ -105909,7 +105803,7 @@ - + @@ -106088,7 +105982,7 @@ - + @@ -106139,7 +106033,7 @@ - + @@ -108270,7 +108164,7 @@ - + @@ -108589,26 +108483,26 @@ - + - + - + - + @@ -109254,47 +109148,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -110143,10 +109996,10 @@ - + - + @@ -110315,7 +110168,7 @@ - + @@ -110325,7 +110178,7 @@ - + @@ -111023,52 +110876,52 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -111109,84 +110962,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -111209,12 +110984,12 @@ - + - + - + @@ -111279,7 +111054,85 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -111287,7 +111140,7 @@ - + @@ -112423,10 +112276,10 @@ - + - + @@ -112448,10 +112301,10 @@ - + - + @@ -112629,7 +112482,7 @@ - + @@ -112663,14 +112516,14 @@ - + - + @@ -112683,7 +112536,7 @@ - + @@ -113007,10 +112860,10 @@ - + - + @@ -113018,12 +112871,12 @@ - + - + - + @@ -113044,7 +112897,7 @@ - + @@ -113063,6 +112916,7 @@ + @@ -113085,6 +112939,23 @@ + + + + + + + + + + + + + + + + + @@ -113532,15 +113403,15 @@ - + - + - + - + @@ -113563,7 +113434,7 @@ - + @@ -113950,50 +113821,245 @@ - + + + + + + + + + + + + + - + + + + - - - - - - - - - - - - + - + - + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -114004,7 +114070,7 @@ - + @@ -114012,11 +114078,11 @@ - + - + - + @@ -114025,12 +114091,12 @@ - + - + @@ -114041,7 +114107,7 @@ - + @@ -114069,7 +114135,7 @@ - + @@ -114088,7 +114154,7 @@ - + @@ -114099,7 +114165,7 @@ - + @@ -114107,7 +114173,7 @@ - + @@ -114121,7 +114187,7 @@ - + @@ -114129,8 +114195,18 @@ - + + + + + + + + + + + @@ -114202,6 +114278,17 @@ + + + + + + + + + + + @@ -117305,7 +117392,7 @@ - + @@ -117317,7 +117404,7 @@ - + @@ -119584,7 +119671,23 @@ - + + + + + + + + + + + + + + + + + @@ -119693,7 +119796,7 @@ - + @@ -119726,7 +119829,7 @@ - + @@ -120211,6 +120314,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -120324,7 +120465,7 @@ - + @@ -120332,7 +120473,7 @@ - + @@ -120346,7 +120487,7 @@ - + @@ -120354,7 +120495,7 @@ - + @@ -120362,7 +120503,15 @@ - + + + + + + + + + @@ -120470,15 +120619,15 @@ - + - + - + - + @@ -120553,7 +120702,7 @@ - + @@ -120622,7 +120771,7 @@ - + @@ -120633,12 +120782,12 @@ - + - + - + @@ -120785,7 +120934,7 @@ - + @@ -121590,7 +121739,7 @@ - + @@ -121650,7 +121799,7 @@ - + @@ -121667,7 +121816,7 @@ - + @@ -121676,15 +121825,15 @@ - + - + - + - + @@ -121693,7 +121842,7 @@ - + @@ -121701,7 +121850,7 @@ - + @@ -121709,7 +121858,7 @@ - + @@ -121818,13 +121967,13 @@ - + - + @@ -123550,7 +123699,7 @@ - + @@ -123755,10 +123904,10 @@ - + - + @@ -123777,10 +123926,10 @@ - + - + @@ -124627,7 +124776,7 @@ - + diff --git a/android/abi_gki_aarch64_qcom b/android/abi_gki_aarch64_qcom index 4937eec64a99..ab8314462433 100644 --- a/android/abi_gki_aarch64_qcom +++ b/android/abi_gki_aarch64_qcom @@ -1289,6 +1289,8 @@ kvmalloc_node kzfree led_blink_set + led_classdev_flash_register_ext + led_classdev_flash_unregister led_classdev_register_ext led_classdev_unregister led_get_default_pattern From 54d9896ccd44728373d40a8b0501f5e02ebb3f4f Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 9 Sep 2020 17:06:18 +0000 Subject: [PATCH 2/6] Revert "Revert "BACKPORT: net: core: use listified Rx for GRO_NORMAL in napi_gro_receive()"" This reverts commit a81a69408ba51a8de65734828aa91ba276f8e910 as it is needed, and is in the upstream 5.4.y tree now. Bug: 167477898 Change-Id: Ica5a915027546a7f6f655c336db2489897b007f0 Cc: Hyunsoon Kim Signed-off-by: Greg Kroah-Hartman --- net/core/dev.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c index fb3238c916ab..bfb7bf0f2847 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -5609,12 +5609,13 @@ static void napi_skb_free_stolen_head(struct sk_buff *skb) kmem_cache_free(skbuff_head_cache, skb); } -static gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb) +static gro_result_t napi_skb_finish(struct napi_struct *napi, + struct sk_buff *skb, + gro_result_t ret) { switch (ret) { case GRO_NORMAL: - if (netif_receive_skb_internal(skb)) - ret = GRO_DROP; + gro_normal_one(napi, skb); break; case GRO_DROP: @@ -5646,7 +5647,7 @@ gro_result_t napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb) skb_gro_reset_offset(skb); - ret = napi_skb_finish(dev_gro_receive(napi, skb), skb); + ret = napi_skb_finish(napi, skb, dev_gro_receive(napi, skb)); trace_napi_gro_receive_exit(ret); return ret; From 415c56cf5315e100040331c45a4937057af8a803 Mon Sep 17 00:00:00 2001 From: Matthias Maennich Date: Wed, 9 Sep 2020 21:30:51 +0100 Subject: [PATCH 3/6] ANDROID: Address flaky behaviour in genksyms affecting CRC stability. Commit 1278a5bf16e7 ("ANDROID: ABI: Added symbols for allwinner") introduced ehci_* symbols to the symbol list. Due to a bug in genksyms, the CRC of those is not resilient to whether other symbols are exported as well. In particular, the CRC changes with the export/trimming of ehci_handshake. Add an artificial symbol list to contain ehci_handshake to make this stable. Also update the ABI representation accordingly: 1 Added function: [A] 'function int ehci_handshake(ehci_hcd*, void*, u32, u32, int)' Bug: 167230325 Signed-off-by: Matthias Maennich Change-Id: I58d3a93f49e70a66f34b66f9f8784b9c19c5a58b --- android/abi_gki_aarch64.xml | 2057 ++++++++++++++++++--------- android/abi_gki_aarch64_workarounds | 3 + build.config.gki.aarch64 | 1 + 3 files changed, 1407 insertions(+), 654 deletions(-) create mode 100644 android/abi_gki_aarch64_workarounds diff --git a/android/abi_gki_aarch64.xml b/android/abi_gki_aarch64.xml index cd574f3cb18c..0e226a9b0df5 100644 --- a/android/abi_gki_aarch64.xml +++ b/android/abi_gki_aarch64.xml @@ -1427,6 +1427,7 @@ + @@ -11207,6 +11208,23 @@ + + + + + + + + + + + + + + + + + @@ -14194,23 +14212,6 @@ - - - - - - - - - - - - - - - - - @@ -17283,7 +17284,7 @@ - + @@ -30602,6 +30603,23 @@ + + + + + + + + + + + + + + + + + @@ -32165,7 +32183,7 @@ - + @@ -32186,7 +32204,7 @@ - + @@ -32586,7 +32604,7 @@ - + @@ -33570,7 +33588,7 @@ - + @@ -33828,10 +33846,10 @@ - + - + @@ -34837,7 +34855,7 @@ - + @@ -36504,22 +36522,6 @@ - - - - - - - - - - - - - - - - @@ -37118,7 +37120,7 @@ - + @@ -37504,7 +37506,7 @@ - + @@ -37527,7 +37529,7 @@ - + @@ -42019,7 +42021,7 @@ - + @@ -42039,7 +42041,7 @@ - + @@ -42642,13 +42644,13 @@ - + - + - + @@ -42674,7 +42676,7 @@ - + @@ -44273,7 +44275,7 @@ - + @@ -44335,7 +44337,7 @@ - + @@ -45883,7 +45885,7 @@ - + @@ -46369,7 +46371,7 @@ - + @@ -46406,7 +46408,7 @@ - + @@ -46617,7 +46619,7 @@ - + @@ -47582,10 +47584,10 @@ - + - + @@ -48956,7 +48958,7 @@ - + @@ -48991,7 +48993,7 @@ - + @@ -49308,10 +49310,10 @@ - + - + @@ -51017,7 +51019,7 @@ - + @@ -51680,7 +51682,7 @@ - + @@ -53386,7 +53388,7 @@ - + @@ -54099,80 +54101,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -54198,10 +54126,10 @@ - + - + @@ -54230,8 +54158,6 @@ - - @@ -54241,7 +54167,7 @@ - + @@ -54825,6 +54751,14 @@ + + + + + + + + @@ -54842,8 +54776,8 @@ - - + + @@ -54871,6 +54805,20 @@ + + + + + + + + + + + + + + @@ -61249,29 +61197,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -62443,7 +62368,7 @@ - + @@ -62452,7 +62377,7 @@ - + @@ -62616,7 +62541,6 @@ - @@ -70007,6 +69931,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -70039,6 +69998,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -70081,8 +70072,10 @@ + + @@ -70284,9 +70277,9 @@ - + - + @@ -70805,7 +70798,7 @@ - + @@ -71449,7 +71442,7 @@ - + @@ -72664,11 +72657,11 @@ - + - + @@ -79021,6 +79014,23 @@ + + + + + + + + + + + + + + + + + @@ -81648,6 +81658,739 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -82813,6 +83556,23 @@ + + + + + + + + + + + + + + + + + @@ -85319,23 +86079,6 @@ - - - - - - - - - - - - - - - - - @@ -86025,14 +86768,6 @@ - - - - - - - - @@ -86599,23 +87334,6 @@ - - - - - - - - - - - - - - - - - @@ -86685,7 +87403,7 @@ - + @@ -86914,7 +87632,7 @@ - + @@ -87099,10 +87817,10 @@ - + - + @@ -87110,6 +87828,23 @@ + + + + + + + + + + + + + + + + + @@ -87431,10 +88166,10 @@ - + - + @@ -87621,7 +88356,7 @@ - + @@ -87669,7 +88404,7 @@ - + @@ -87854,7 +88589,7 @@ - + @@ -87866,7 +88601,7 @@ - + @@ -88022,7 +88757,7 @@ - + @@ -88070,23 +88805,6 @@ - - - - - - - - - - - - - - - - - @@ -88153,7 +88871,7 @@ - + @@ -88168,7 +88886,7 @@ - + @@ -88227,7 +88945,7 @@ - + @@ -88927,7 +89645,24 @@ - + + + + + + + + + + + + + + + + + + @@ -89592,7 +90327,7 @@ - + @@ -89640,7 +90375,7 @@ - + @@ -90350,7 +91085,7 @@ - + @@ -90772,7 +91507,7 @@ - + @@ -90865,6 +91600,14 @@ + + + + + + + + @@ -91520,7 +92263,7 @@ - + @@ -91554,7 +92297,7 @@ - + @@ -93804,10 +94547,10 @@ - + - + @@ -93983,7 +94726,7 @@ - + @@ -94004,7 +94747,7 @@ - + @@ -96047,10 +96790,10 @@ - + - + @@ -96216,7 +96959,7 @@ - + @@ -96249,7 +96992,7 @@ - + @@ -100472,7 +101215,7 @@ - + @@ -101701,7 +102444,7 @@ - + @@ -101732,7 +102475,7 @@ - + @@ -101992,7 +102735,7 @@ - + @@ -102508,7 +103251,7 @@ - + @@ -102792,7 +103535,7 @@ - + @@ -103030,7 +103773,7 @@ - + @@ -103075,7 +103818,7 @@ - + @@ -103425,10 +104168,10 @@ - + - + @@ -104158,7 +104901,7 @@ - + @@ -104167,7 +104910,7 @@ - + @@ -104270,12 +105013,55 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -104350,6 +105136,25 @@ + + + + + + + + + + + + + + + + + + + @@ -104509,6 +105314,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -104520,6 +105376,25 @@ + + + + + + + + + + + + + + + + + + + @@ -104658,23 +105533,6 @@ - - - - - - - - - - - - - - - - - @@ -104728,7 +105586,7 @@ - + @@ -104746,10 +105604,10 @@ - + - + @@ -104768,7 +105626,7 @@ - + @@ -104798,7 +105656,7 @@ - + @@ -104888,7 +105746,7 @@ - + @@ -105121,7 +105979,7 @@ - + @@ -105129,7 +105987,7 @@ - + @@ -105527,7 +106385,7 @@ - + @@ -105583,7 +106441,7 @@ - + @@ -106011,7 +106869,7 @@ - + @@ -106022,7 +106880,7 @@ - + @@ -106861,7 +107719,7 @@ - + @@ -106897,7 +107755,7 @@ - + @@ -107323,7 +108181,7 @@ - + @@ -107403,7 +108261,7 @@ - + @@ -107540,7 +108398,7 @@ - + @@ -107603,7 +108461,7 @@ - + @@ -108186,7 +109044,7 @@ - + @@ -108373,6 +109231,17 @@ + + + + + + + + + + + @@ -108435,13 +109304,24 @@ + + + + + + + + + + + - + @@ -109126,7 +110006,7 @@ - + @@ -109148,6 +110028,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -109996,10 +110917,10 @@ - + - + @@ -110168,7 +111089,7 @@ - + @@ -110178,7 +111099,7 @@ - + @@ -110876,7 +111797,7 @@ - + @@ -110884,7 +111805,7 @@ - + @@ -110892,7 +111813,7 @@ - + @@ -110900,7 +111821,7 @@ - + @@ -110908,7 +111829,7 @@ - + @@ -110916,7 +111837,7 @@ - + @@ -110962,6 +111883,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -111054,85 +112053,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -111140,7 +112061,7 @@ - + @@ -111364,7 +112285,7 @@ - + @@ -111373,7 +112294,7 @@ - + @@ -112124,62 +113045,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -112276,10 +113141,10 @@ - + - + @@ -112301,10 +113166,10 @@ - + - + @@ -112457,8 +113322,6 @@ - - @@ -112643,7 +113506,7 @@ - + @@ -112831,7 +113694,7 @@ - + @@ -112860,10 +113723,10 @@ - + - + @@ -112871,7 +113734,7 @@ - + @@ -112897,7 +113760,7 @@ - + @@ -112916,7 +113779,6 @@ - @@ -112939,23 +113801,6 @@ - - - - - - - - - - - - - - - - - @@ -113067,7 +113912,7 @@ - + @@ -113180,7 +114025,7 @@ - + @@ -113403,7 +114248,7 @@ - + @@ -113434,7 +114279,7 @@ - + @@ -114021,7 +114866,7 @@ - + @@ -114040,10 +114885,10 @@ - + - + @@ -114051,7 +114896,7 @@ - + @@ -117392,7 +118237,7 @@ - + @@ -117404,7 +118249,7 @@ - + @@ -118920,7 +119765,7 @@ - + @@ -118928,15 +119773,7 @@ - - - - - - - - - + @@ -118950,17 +119787,6 @@ - - - - - - - - - - - @@ -119649,7 +120475,6 @@ - @@ -119671,30 +120496,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -119791,10 +120592,10 @@ - + - + @@ -120314,44 +121115,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -120465,7 +121228,7 @@ - + @@ -120473,7 +121236,7 @@ - + @@ -120495,7 +121258,7 @@ - + @@ -120503,15 +121266,7 @@ - - - - - - - - - + @@ -120619,17 +121374,6 @@ - - - - - - - - - - - @@ -120771,7 +121515,7 @@ - + @@ -120782,7 +121526,7 @@ - + @@ -120804,13 +121548,13 @@ - + - + @@ -120994,13 +121738,13 @@ - + - + @@ -121736,19 +122480,19 @@ - + - + - + - + @@ -121760,7 +122504,7 @@ - + @@ -121799,7 +122543,7 @@ - + @@ -121816,7 +122560,7 @@ - + @@ -121825,18 +122569,18 @@ - + - + - + - + @@ -121850,7 +122594,7 @@ - + @@ -121858,7 +122602,7 @@ - + @@ -121866,7 +122610,7 @@ - + @@ -121889,7 +122633,7 @@ - + @@ -121967,13 +122711,13 @@ - + - + @@ -122617,6 +123361,14 @@ + + + + + + + + @@ -122847,7 +123599,7 @@ - + @@ -123015,7 +123767,7 @@ - + @@ -123086,9 +123838,6 @@ - - - @@ -123816,10 +124565,10 @@ - + - + @@ -123904,10 +124653,10 @@ - + - + @@ -123926,10 +124675,10 @@ - + - + @@ -125990,7 +126739,7 @@ - + @@ -126358,7 +127107,7 @@ - + @@ -126578,7 +127327,7 @@ - + @@ -126686,7 +127435,7 @@ - + @@ -126702,6 +127451,6 @@ diff --git a/android/abi_gki_aarch64_workarounds b/android/abi_gki_aarch64_workarounds new file mode 100644 index 000000000000..3e4b6d16c687 --- /dev/null +++ b/android/abi_gki_aarch64_workarounds @@ -0,0 +1,3 @@ +[abi_whitelist] + # b/167230325 + ehci_handshake diff --git a/build.config.gki.aarch64 b/build.config.gki.aarch64 index d80fb6a2ddbf..3a875c99c702 100644 --- a/build.config.gki.aarch64 +++ b/build.config.gki.aarch64 @@ -17,6 +17,7 @@ android/abi_gki_aarch64_qcom android/abi_gki_aarch64_sunxi android/abi_gki_aarch64_unisoc android/abi_gki_aarch64_vivo +android/abi_gki_aarch64_workarounds " TRIM_NONLISTED_KMI=1 KMI_SYMBOL_LIST_ADD_ONLY=1 From dea54268fb73a7020a35057f588c13748810650d Mon Sep 17 00:00:00 2001 From: Martijn Coenen Date: Fri, 21 Aug 2020 14:25:44 +0200 Subject: [PATCH 4/6] FROMGIT: binder: print warnings when detecting oneway spamming. The most common cause of the binder transaction buffer filling up is a client rapidly firing oneway transactions into a process, before it has a chance to handle them. Yet the root cause of this is often hard to debug, because either the system or the app will stop, and by that time binder debug information we dump in bugreports is no longer relevant. This change warns as soon as a process dips below 80% of its oneway space (less than 100kB available in the configuration), when any one process is responsible for either more than 50 transactions, or more than 50% of the oneway space. Signed-off-by: Martijn Coenen Signed-off-by: Martijn Coenen Acked-by: Todd Kjos Link: https://lore.kernel.org/r/20200821122544.1277051-1-maco@android.com Signed-off-by: Greg Kroah-Hartman (cherry picked from commit 261e7818f06ec51e488e007f787ccd7e77272918 git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git/ char-misc-next) Signed-off-by: Martijn Coenen Bug: 147795659 Change-Id: Idc2b03ddc779880ca4716fdae47a70df43211f25 --- drivers/android/binder.c | 2 +- drivers/android/binder_alloc.c | 55 +++++++++++++++++++++++-- drivers/android/binder_alloc.h | 5 ++- drivers/android/binder_alloc_selftest.c | 2 +- 4 files changed, 58 insertions(+), 6 deletions(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index 4d8ae842041d..02df51ede095 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -3306,7 +3306,7 @@ static void binder_transaction(struct binder_proc *proc, t->buffer = binder_alloc_new_buf(&target_proc->alloc, tr->data_size, tr->offsets_size, extra_buffers_size, - !reply && (t->flags & TF_ONE_WAY)); + !reply && (t->flags & TF_ONE_WAY), current->tgid); if (IS_ERR(t->buffer)) { /* * -ESRCH indicates VMA cleared. The target is dying. diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c index 2048ba6c8b08..f637998e3f69 100644 --- a/drivers/android/binder_alloc.c +++ b/drivers/android/binder_alloc.c @@ -339,12 +339,50 @@ static inline struct vm_area_struct *binder_alloc_get_vma( return vma; } +static void debug_low_async_space_locked(struct binder_alloc *alloc, int pid) +{ + /* + * Find the amount and size of buffers allocated by the current caller; + * The idea is that once we cross the threshold, whoever is responsible + * for the low async space is likely to try to send another async txn, + * and at some point we'll catch them in the act. This is more efficient + * than keeping a map per pid. + */ + struct rb_node *n = alloc->free_buffers.rb_node; + struct binder_buffer *buffer; + size_t total_alloc_size = 0; + size_t num_buffers = 0; + + for (n = rb_first(&alloc->allocated_buffers); n != NULL; + n = rb_next(n)) { + buffer = rb_entry(n, struct binder_buffer, rb_node); + if (buffer->pid != pid) + continue; + if (!buffer->async_transaction) + continue; + total_alloc_size += binder_alloc_buffer_size(alloc, buffer) + + sizeof(struct binder_buffer); + num_buffers++; + } + + /* + * Warn if this pid has more than 50 transactions, or more than 50% of + * async space (which is 25% of total buffer size). + */ + if (num_buffers > 50 || total_alloc_size > alloc->buffer_size / 4) { + binder_alloc_debug(BINDER_DEBUG_USER_ERROR, + "%d: pid %d spamming oneway? %zd buffers allocated for a total size of %zd\n", + alloc->pid, pid, num_buffers, total_alloc_size); + } +} + static struct binder_buffer *binder_alloc_new_buf_locked( struct binder_alloc *alloc, size_t data_size, size_t offsets_size, size_t extra_buffers_size, - int is_async) + int is_async, + int pid) { struct rb_node *n = alloc->free_buffers.rb_node; struct binder_buffer *buffer; @@ -487,11 +525,20 @@ static struct binder_buffer *binder_alloc_new_buf_locked( buffer->offsets_size = offsets_size; buffer->async_transaction = is_async; buffer->extra_buffers_size = extra_buffers_size; + buffer->pid = pid; if (is_async) { alloc->free_async_space -= size + sizeof(struct binder_buffer); binder_alloc_debug(BINDER_DEBUG_BUFFER_ALLOC_ASYNC, "%d: binder_alloc_buf size %zd async free %zd\n", alloc->pid, size, alloc->free_async_space); + if (alloc->free_async_space < alloc->buffer_size / 10) { + /* + * Start detecting spammers once we have less than 20% + * of async space left (which is less than 10% of total + * buffer size). + */ + debug_low_async_space_locked(alloc, pid); + } } return buffer; @@ -509,6 +556,7 @@ err_alloc_buf_struct_failed: * @offsets_size: user specified buffer offset * @extra_buffers_size: size of extra space for meta-data (eg, security context) * @is_async: buffer for async transaction + * @pid: pid to attribute allocation to (used for debugging) * * Allocate a new buffer given the requested sizes. Returns * the kernel version of the buffer pointer. The size allocated @@ -521,13 +569,14 @@ struct binder_buffer *binder_alloc_new_buf(struct binder_alloc *alloc, size_t data_size, size_t offsets_size, size_t extra_buffers_size, - int is_async) + int is_async, + int pid) { struct binder_buffer *buffer; mutex_lock(&alloc->mutex); buffer = binder_alloc_new_buf_locked(alloc, data_size, offsets_size, - extra_buffers_size, is_async); + extra_buffers_size, is_async, pid); mutex_unlock(&alloc->mutex); return buffer; } diff --git a/drivers/android/binder_alloc.h b/drivers/android/binder_alloc.h index db9c1b984695..55d8b4106766 100644 --- a/drivers/android/binder_alloc.h +++ b/drivers/android/binder_alloc.h @@ -32,6 +32,7 @@ struct binder_transaction; * @offsets_size: size of array of offsets * @extra_buffers_size: size of space for other objects (like sg lists) * @user_data: user pointer to base of buffer space + * @pid: pid to attribute the buffer to (caller) * * Bookkeeping structure for binder transaction buffers */ @@ -51,6 +52,7 @@ struct binder_buffer { size_t offsets_size; size_t extra_buffers_size; void __user *user_data; + int pid; }; /** @@ -117,7 +119,8 @@ extern struct binder_buffer *binder_alloc_new_buf(struct binder_alloc *alloc, size_t data_size, size_t offsets_size, size_t extra_buffers_size, - int is_async); + int is_async, + int pid); extern void binder_alloc_init(struct binder_alloc *alloc); extern int binder_alloc_shrinker_init(void); extern void binder_alloc_vma_close(struct binder_alloc *alloc); diff --git a/drivers/android/binder_alloc_selftest.c b/drivers/android/binder_alloc_selftest.c index 4151d9938255..c2b323bc3b3a 100644 --- a/drivers/android/binder_alloc_selftest.c +++ b/drivers/android/binder_alloc_selftest.c @@ -119,7 +119,7 @@ static void binder_selftest_alloc_buf(struct binder_alloc *alloc, int i; for (i = 0; i < BUFFER_NUM; i++) { - buffers[i] = binder_alloc_new_buf(alloc, sizes[i], 0, 0, 0); + buffers[i] = binder_alloc_new_buf(alloc, sizes[i], 0, 0, 0, 0); if (IS_ERR(buffers[i]) || !check_buffer_pages_allocated(alloc, buffers[i], sizes[i])) { From a52bcdb85fc4c73cb4d8c054092dc8a803e76d8c Mon Sep 17 00:00:00 2001 From: Haitao Shan Date: Wed, 9 Sep 2020 16:21:38 -0700 Subject: [PATCH 5/6] ANDROID: Setting up GS before calling __restore_processor_state. Android Common Kernel compiled by clang with Shadow Call Stack will use GS segment. However, __restore_processor_state is called when system wakes up from S3 and at the moment GS is not restored yet. This is a hack by copying a small code snippet(setting gs base) from __restore_processor_state to restore_processor_state. It prepares GS before __restore_processor_state is called. At the same time, restore_processor_state is still small enough so that SCS is not on, as SCS seems to be on only for large functions. Bug: 166163480 Change-Id: I3bfe4ac61dee876da57de6578c9a7f01431a1743 Signed-off-by: Haitao Shan --- arch/x86/power/cpu.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c index 915bb1639763..14863ad89f81 100644 --- a/arch/x86/power/cpu.c +++ b/arch/x86/power/cpu.c @@ -268,6 +268,19 @@ static void notrace __restore_processor_state(struct saved_context *ctxt) /* Needed by apm.c */ void notrace restore_processor_state(void) { +#ifdef __clang__ + // The following code snippet is copied from __restore_processor_state. + // Its purpose is to prepare GS segment before the function is called. + // Since the function is compiled with SCS on, it will use GS at its + // entry. + // TODO: Hack to be removed later when compiler bug is fixed. +#ifdef CONFIG_X86_64 + wrmsrl(MSR_GS_BASE, saved_context.kernelmode_gs_base); +#else + loadsegment(fs, __KERNEL_PERCPU); + loadsegment(gs, __KERNEL_STACK_CANARY); +#endif +#endif __restore_processor_state(&saved_context); } #ifdef CONFIG_X86_32 From bb168ca1805b33289aae802a940551dec93a24d3 Mon Sep 17 00:00:00 2001 From: Changki Kim Date: Fri, 11 Sep 2020 11:37:52 +0900 Subject: [PATCH 6/6] Revert "ANDROID: vendor_hooks: Add vendor hooks for key combination" This reverts commit 72f2bc5fc24c8980315f9177db3b391036c4174f. You can use input_handle_event instead of this vendor hook. Change-Id: I8c6c5705f07181710c99a01239d75ecf43f9c5bf Signed-off-by: Changki Kim --- drivers/android/vendor_hooks.c | 1 - drivers/input/input.c | 5 ----- include/trace/hooks/debug.h | 8 -------- 3 files changed, 14 deletions(-) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 0d3b4faa7bc7..7b4b1abbb537 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -55,4 +55,3 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alter_rwsem_list_add); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alter_futex_plist_add); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_is_fpsimd_save); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ipi_stop); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_input_handle_event); diff --git a/drivers/input/input.c b/drivers/input/input.c index 6434e0aec875..e2eb9b9b8363 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -26,10 +26,6 @@ #include "input-compat.h" #include "input-poller.h" -#ifndef __GENKSYMS__ -#include -#endif - MODULE_AUTHOR("Vojtech Pavlik "); MODULE_DESCRIPTION("Input core"); MODULE_LICENSE("GPL"); @@ -442,7 +438,6 @@ void input_event(struct input_dev *dev, if (is_event_supported(type, dev->evbit, EV_MAX)) { spin_lock_irqsave(&dev->event_lock, flags); - trace_android_vh_input_handle_event(dev, type, code, value); input_handle_event(dev, type, code, value); spin_unlock_irqrestore(&dev->event_lock, flags); } diff --git a/include/trace/hooks/debug.h b/include/trace/hooks/debug.h index d3127643ece8..99ae33889b0d 100644 --- a/include/trace/hooks/debug.h +++ b/include/trace/hooks/debug.h @@ -11,20 +11,12 @@ #include #if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS) - struct pt_regs; DECLARE_HOOK(android_vh_ipi_stop, TP_PROTO(struct pt_regs *regs), TP_ARGS(regs)) - -struct input_dev; -DECLARE_HOOK(android_vh_input_handle_event, - TP_PROTO(struct input_dev *dev, unsigned int type, - unsigned int code, int value), - TP_ARGS(dev, type, code, value)) #else #define trace_android_vh_ipi_stop(regs) -#define trace_android_vh_input_handle_event(dev, type, code, value) #endif #endif /* _TRACE_HOOK_DEBUG_H */