diff --git a/BUILD.bazel b/BUILD.bazel index 885571722c52..8a7f131ba6e7 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -19,8 +19,27 @@ package( load("//build/kernel/kleaf:common_kernels.bzl", "define_common_kernels") -# This uses android/abi_gki_aarch64* in kmi_configs. If the list of -# glob(["android/abi_gki_aarch64*"]) differs from -# KMI_SYMBOL_LIST + ADDITIONAL_KMI_SYMBOL_LISTS in build.config.gki.aarch64, -# or TRIM_NONLISTED_KMI changes, override kmi_configs here. -define_common_kernels() +_aarch64_additional_kmi_symbol_lists = [ + # keep sorted + "android/abi_gki_aarch64_core", + "android/abi_gki_aarch64_db845c", + "android/abi_gki_aarch64_fips140", + "android/abi_gki_aarch64_generic", + "android/abi_gki_aarch64_hikey960", + "android/abi_gki_aarch64_type_visibility", + "android/abi_gki_aarch64_virtual_device", +] + +define_common_kernels(target_configs = { + # Sync with build.config.gki.aarch64 + "kernel_aarch64": { + "kmi_symbol_list": "android/abi_gki_aarch64", + "additional_kmi_symbol_lists": _aarch64_additional_kmi_symbol_lists, + "abi_definition": "android/abi_gki_aarch64.xml", + }, + "kernel_aarch64_debug": { + "kmi_symbol_list": "android/abi_gki_aarch64", + "additional_kmi_symbol_lists": _aarch64_additional_kmi_symbol_lists, + "abi_definition": "android/abi_gki_aarch64.xml", + }, +}) diff --git a/Documentation/ABI/testing/OWNERS b/Documentation/ABI/testing/OWNERS deleted file mode 100644 index 75edfd5b3a32..000000000000 --- a/Documentation/ABI/testing/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# include OWNERS from the authoritative android-mainline branch -include kernel/common:android-mainline:/Documentation/ABI/testing/OWNERS diff --git a/Documentation/filesystems/OWNERS b/Documentation/filesystems/OWNERS deleted file mode 100644 index 5b6ec532f1e2..000000000000 --- a/Documentation/filesystems/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# include OWNERS from the authoritative android-mainline branch -include kernel/common:android-mainline:/Documentation/filesystems/OWNERS diff --git a/Documentation/filesystems/f2fs.rst b/Documentation/filesystems/f2fs.rst index 5fda320354a6..b8cdd1fcb83e 100644 --- a/Documentation/filesystems/f2fs.rst +++ b/Documentation/filesystems/f2fs.rst @@ -342,6 +342,11 @@ discard_unit=%s Control discard unit, the argument can be "block", "segment" default, it is helpful for large sized SMR or ZNS devices to reduce memory cost by getting rid of fs metadata supports small discard. +memory=%s Control memory mode. This supports "normal" and "low" modes. + "low" mode is introduced to support low memory devices. + Because of the nature of low memory devices, in this mode, f2fs + will try to save memory sometimes by sacrificing performance. + "normal" mode is the default mode and same as before. ======================== ============================================================ Debugfs Entries diff --git a/Documentation/sound/kernel-api/writing-an-alsa-driver.rst b/Documentation/sound/kernel-api/writing-an-alsa-driver.rst index 73bbd59afc33..690c5238f904 100644 --- a/Documentation/sound/kernel-api/writing-an-alsa-driver.rst +++ b/Documentation/sound/kernel-api/writing-an-alsa-driver.rst @@ -3508,14 +3508,15 @@ field must be set, though). “IEC958 Playback Con Mask” is used to return the bit-mask for the IEC958 status bits of consumer mode. Similarly, “IEC958 Playback Pro Mask” -returns the bitmask for professional mode. They are read-only controls, -and are defined as MIXER controls (iface = -``SNDRV_CTL_ELEM_IFACE_MIXER``). +returns the bitmask for professional mode. They are read-only controls. Meanwhile, “IEC958 Playback Default” control is defined for getting and -setting the current default IEC958 bits. Note that this one is usually -defined as a PCM control (iface = ``SNDRV_CTL_ELEM_IFACE_PCM``), -although in some places it's defined as a MIXER control. +setting the current default IEC958 bits. + +Due to historical reasons, both variants of the Playback Mask and the +Playback Default controls can be implemented on either a +``SNDRV_CTL_ELEM_IFACE_PCM`` or a ``SNDRV_CTL_ELEM_IFACE_MIXER`` iface. +Drivers should expose the mask and default on the same iface though. In addition, you can define the control switches to enable/disable or to set the raw bit mode. The implementation will depend on the chip, but diff --git a/android/OWNERS b/android/OWNERS deleted file mode 100644 index 3a9d87457d81..000000000000 --- a/android/OWNERS +++ /dev/null @@ -1,8 +0,0 @@ -# If we ever add another OWNERS above this directory, it's likely to be -# more permissive, so don't inherit from it -set noparent -include kernel/common:android-mainline:/OWNERS_DrNo - -# Downstream boards maintained directly in this manifest branch -per-file abi_gki_aarch64_cuttlefish = adelva@google.com, rammuthiah@google.com -per-file abi_gki_aarch64_goldfish = rkir@google.com diff --git a/android/abi_gki_aarch64.xml b/android/abi_gki_aarch64.xml index d301cf115e8d..8b6272d3145e 100644 --- a/android/abi_gki_aarch64.xml +++ b/android/abi_gki_aarch64.xml @@ -23,6 +23,7 @@ + @@ -259,6 +260,7 @@ + @@ -272,6 +274,7 @@ + @@ -284,6 +287,7 @@ + @@ -338,6 +342,7 @@ + @@ -1005,6 +1010,7 @@ + @@ -1014,6 +1020,7 @@ + @@ -1192,6 +1199,7 @@ + @@ -1412,6 +1420,7 @@ + @@ -1906,6 +1915,7 @@ + @@ -2018,6 +2028,7 @@ + @@ -2251,6 +2262,8 @@ + + @@ -2263,6 +2276,7 @@ + @@ -2714,6 +2728,7 @@ + @@ -2991,7 +3006,10 @@ + + + @@ -3704,6 +3722,8 @@ + + @@ -3765,6 +3785,7 @@ + @@ -3778,6 +3799,7 @@ + @@ -3790,6 +3812,7 @@ + @@ -3857,6 +3880,7 @@ + @@ -3875,6 +3899,7 @@ + @@ -3953,7 +3978,7 @@ - + @@ -4104,16 +4129,16 @@ - + - + - + - + @@ -4231,7 +4256,7 @@ - + @@ -4271,7 +4296,7 @@ - + @@ -4345,7 +4370,20 @@ - + + + + + + + + + + + + + + @@ -4422,7 +4460,7 @@ - + @@ -4434,15 +4472,15 @@ - + - + - + - + @@ -4457,7 +4495,7 @@ - + @@ -4471,51 +4509,51 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -4848,75 +4886,124 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5050,6 +5137,14 @@ + + + + + + + + @@ -5139,6 +5234,7 @@ + @@ -5169,6 +5265,14 @@ + + + + + + + + @@ -5232,7 +5336,7 @@ - + @@ -5326,9 +5430,12 @@ - + + + + @@ -5392,6 +5499,7 @@ + @@ -5447,14 +5555,15 @@ - + - + - + + @@ -5605,6 +5714,7 @@ + @@ -5751,6 +5861,7 @@ + @@ -6094,18 +6205,18 @@ - + - + - + - + - + @@ -6140,6 +6251,7 @@ + @@ -6369,7 +6481,7 @@ - + @@ -6378,7 +6490,7 @@ - + @@ -6397,21 +6509,6 @@ - - - - - - - - - - - - - - - @@ -6481,6 +6578,7 @@ + @@ -6901,7 +6999,7 @@ - + @@ -7041,12 +7139,20 @@ + + + + + + + + - + @@ -7299,6 +7405,7 @@ + @@ -7308,6 +7415,23 @@ + + + + + + + + + + + + + + + + + @@ -7574,7 +7698,7 @@ - + @@ -7583,6 +7707,9 @@ + + + @@ -7611,43 +7738,43 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -7799,6 +7926,12 @@ + + + + + + @@ -8152,6 +8285,17 @@ + + + + + + + + + + + @@ -8243,18 +8387,18 @@ - + - + - + - + - + @@ -8279,42 +8423,42 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -8331,7 +8475,19 @@ + + + + + + + + + + + + @@ -8720,7 +8876,7 @@ - + @@ -8778,6 +8934,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -8847,6 +9027,7 @@ + @@ -8906,21 +9087,21 @@ - + - + - + - + - + - + @@ -9006,6 +9187,7 @@ + @@ -9103,7 +9285,62 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -9133,7 +9370,7 @@ - + @@ -9309,6 +9546,17 @@ + + + + + + + + + + + @@ -9330,6 +9578,14 @@ + + + + + + + + @@ -9346,7 +9602,7 @@ - + @@ -9606,14 +9862,16 @@ + - + + @@ -9833,7 +10091,7 @@ - + @@ -9845,7 +10103,7 @@ - + @@ -9872,10 +10130,10 @@ - + - + @@ -10706,7 +10964,7 @@ - + @@ -10735,52 +10993,60 @@ - - + - - - - - - - + - + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -10873,12 +11139,12 @@ - + - + - + @@ -11097,42 +11363,42 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -11294,18 +11560,18 @@ - + - + - + - + - + @@ -11345,7 +11611,7 @@ - + @@ -11393,6 +11659,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -11404,15 +11711,15 @@ - + - + - + - + @@ -11449,7 +11756,7 @@ - + @@ -11556,7 +11863,7 @@ - + @@ -11574,60 +11881,60 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -11811,7 +12118,7 @@ - + @@ -12058,45 +12365,45 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -12154,6 +12461,7 @@ + @@ -12196,7 +12504,7 @@ - + @@ -12513,33 +12821,33 @@ - + - + - + - + - + - + - + - + - + - + @@ -12633,21 +12941,38 @@ - + - + - + - + - + + + + + + + + + + + + + + + + + + @@ -12664,21 +12989,43 @@ - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + - @@ -12940,72 +13287,72 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -13020,7 +13367,7 @@ - + @@ -13306,6 +13653,7 @@ + @@ -13324,6 +13672,12 @@ + + + + + + @@ -13375,7 +13729,7 @@ - + @@ -13533,6 +13887,14 @@ + + + + + + + + @@ -13688,6 +14050,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -13741,6 +14126,7 @@ + @@ -13773,7 +14159,65 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -14000,6 +14444,12 @@ + + + + + + @@ -14066,7 +14516,7 @@ - + @@ -14350,27 +14800,27 @@ - + - + - + - + - + - + - + - + @@ -14448,6 +14898,10 @@ + + + + @@ -14496,7 +14950,7 @@ - + @@ -14625,6 +15079,7 @@ + @@ -14662,6 +15117,12 @@ + + + + + + @@ -14720,7 +15181,7 @@ - + @@ -14741,9 +15202,12 @@ - + + + + @@ -15317,6 +15781,20 @@ + + + + + + + + + + + + + + @@ -15349,28 +15827,29 @@ + - + - + - + - + - + - + - + - + @@ -15390,11 +15869,12 @@ + - + @@ -15576,6 +16056,7 @@ + @@ -15799,7 +16280,7 @@ - + @@ -15817,42 +16298,42 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -15990,6 +16471,8 @@ + + @@ -16210,6 +16693,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -16230,75 +16796,75 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -16383,7 +16949,7 @@ - + @@ -16779,6 +17345,7 @@ + @@ -17229,7 +17796,197 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -17287,6 +18044,12 @@ + + + + + + @@ -17302,7 +18065,7 @@ - + @@ -17778,18 +18541,18 @@ - + - + - + - + - + @@ -17797,7 +18560,7 @@ - + @@ -17841,6 +18604,7 @@ + @@ -17914,6 +18678,7 @@ + @@ -18087,7 +18852,20 @@ - + + + + + + + + + + + + + + @@ -18185,6 +18963,7 @@ + @@ -18756,6 +19535,14 @@ + + + + + + + + @@ -18787,6 +19574,7 @@ + @@ -18829,7 +19617,7 @@ - + @@ -19077,6 +19865,7 @@ + @@ -19404,6 +20193,23 @@ + + + + + + + + + + + + + + + + + @@ -19630,6 +20436,7 @@ + @@ -19729,25 +20536,25 @@ - + - + - + - + - + - + - + @@ -19876,7 +20683,7 @@ - + @@ -19996,66 +20803,66 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -20391,6 +21198,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -20500,7 +21372,7 @@ - + @@ -20524,66 +21396,66 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -20649,7 +21521,7 @@ - + @@ -20769,12 +21641,12 @@ - + - + - + @@ -20945,19 +21817,27 @@ - + + + + + + + + + - + @@ -20977,6 +21857,7 @@ + @@ -21061,6 +21942,7 @@ + @@ -21070,7 +21952,7 @@ - + @@ -21089,6 +21971,7 @@ + @@ -21120,6 +22003,20 @@ + + + + + + + + + + + + + + @@ -21425,6 +22322,7 @@ + @@ -21570,6 +22468,16 @@ + + + + + + + + + + @@ -21641,6 +22549,10 @@ + + + + @@ -22027,6 +22939,9 @@ + + + @@ -22087,6 +23002,11 @@ + + + + + @@ -22095,6 +23015,12 @@ + + + + + + @@ -22105,6 +23031,7 @@ + @@ -22426,6 +23353,7 @@ + @@ -22498,6 +23426,7 @@ + @@ -22838,7 +23767,7 @@ - + @@ -22891,6 +23820,7 @@ + @@ -23070,6 +24000,7 @@ + @@ -23125,6 +24056,12 @@ + + + + + + @@ -23220,6 +24157,11 @@ + + + + + @@ -23319,7 +24261,7 @@ - + @@ -23422,100 +24364,100 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -23925,6 +24867,14 @@ + + + + + + + + @@ -24360,6 +25310,7 @@ + @@ -24370,6 +25321,7 @@ + @@ -25273,7 +26225,7 @@ - + @@ -25329,6 +26281,14 @@ + + + + + + + + @@ -25644,6 +26604,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -25653,6 +26636,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -25754,7 +26778,7 @@ - + @@ -26305,27 +27329,27 @@ - + - + - + - + - + - + - + - + @@ -26407,6 +27431,9 @@ + + + @@ -26527,6 +27554,7 @@ + @@ -26731,6 +27759,12 @@ + + + + + + @@ -26850,7 +27884,7 @@ - + @@ -26901,7 +27935,7 @@ - + @@ -26909,6 +27943,9 @@ + + + @@ -27118,7 +28155,7 @@ - + @@ -27164,7 +28201,7 @@ - + @@ -27270,32 +28307,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -27455,6 +28467,23 @@ + + + + + + + + + + + + + + + + + @@ -27475,7 +28504,7 @@ - + @@ -27488,6 +28517,11 @@ + + + + + @@ -27609,6 +28643,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -28081,11 +29147,12 @@ - + + @@ -28420,6 +29487,12 @@ + + + + + + @@ -28449,12 +29522,12 @@ - + - + - + @@ -28496,75 +29569,75 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -28690,6 +29763,10 @@ + + + + @@ -28698,6 +29775,7 @@ + @@ -28735,7 +29813,7 @@ - + @@ -28770,6 +29848,7 @@ + @@ -28780,7 +29859,7 @@ - + @@ -28937,7 +30016,7 @@ - + @@ -29028,6 +30107,14 @@ + + + + + + + + @@ -29081,6 +30168,7 @@ + @@ -29843,6 +30931,12 @@ + + + + + + @@ -30113,7 +31207,7 @@ - + @@ -30166,6 +31260,7 @@ + @@ -30244,7 +31339,7 @@ - + @@ -30295,6 +31390,12 @@ + + + + + + @@ -30567,6 +31668,10 @@ + + + + @@ -30725,6 +31830,7 @@ + @@ -30836,12 +31942,12 @@ - + - + - + @@ -31191,6 +32297,14 @@ + + + + + + + + @@ -31209,7 +32323,7 @@ - + @@ -31757,7 +32871,7 @@ - + @@ -31774,6 +32888,10 @@ + + + + @@ -31889,6 +33007,13 @@ + + + + + + + @@ -32016,153 +33141,153 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -32316,7 +33441,7 @@ - + @@ -32327,7 +33452,14 @@ - + + + + + + + + @@ -32463,24 +33595,24 @@ - + - + - + - + - + - + - + @@ -32671,7 +33803,7 @@ - + @@ -32706,36 +33838,36 @@ - + - + - + - + - + - + - + - + - + - + - + @@ -32889,7 +34021,7 @@ - + @@ -32927,6 +34059,14 @@ + + + + + + + + @@ -33103,7 +34243,7 @@ - + @@ -33323,6 +34463,7 @@ + @@ -33477,7 +34618,22 @@ + + + + + + + + + + + + + + + @@ -33524,18 +34680,18 @@ - + - + - + - + - + @@ -34101,6 +35257,17 @@ + + + + + + + + + + + @@ -34220,7 +35387,7 @@ - + @@ -34286,7 +35453,7 @@ - + @@ -34642,6 +35809,7 @@ + @@ -34742,79 +35910,79 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -35186,6 +36354,14 @@ + + + + + + + + @@ -35413,451 +36589,458 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + @@ -35963,6 +37146,7 @@ + @@ -36131,6 +37315,7 @@ + @@ -36774,6 +37959,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -36847,6 +38058,7 @@ + @@ -36869,20 +38081,42 @@ - + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -37050,7 +38284,7 @@ - + @@ -37059,7 +38293,7 @@ - + @@ -37518,7 +38752,23 @@ - + + + + + + + + + + + + + + + + + @@ -37651,81 +38901,81 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -37796,7 +39046,7 @@ - + @@ -38319,7 +39569,7 @@ - + @@ -38352,6 +39602,12 @@ + + + + + + @@ -38362,7 +39618,7 @@ - + @@ -39038,6 +40294,7 @@ + @@ -39068,7 +40325,7 @@ - + @@ -39421,6 +40678,14 @@ + + + + + + + + @@ -39601,6 +40866,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -39610,21 +40895,21 @@ - + - + - + - + - + - + @@ -39652,9 +40937,15 @@ - + + + + + + + @@ -39870,6 +41161,7 @@ + @@ -40021,6 +41313,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -40109,6 +41449,20 @@ + + + + + + + + + + + + + + @@ -40814,7 +42168,7 @@ - + @@ -40880,6 +42234,7 @@ + @@ -41011,6 +42366,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -41336,7 +42714,7 @@ - + @@ -41813,6 +43191,7 @@ + @@ -41927,14 +43306,14 @@ - + - + - + @@ -41978,8 +43357,13 @@ + + + + + - + @@ -42078,7 +43462,35 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -42086,9 +43498,9 @@ - + - + @@ -42432,6 +43844,11 @@ + + + + + @@ -42586,7 +44003,7 @@ - + @@ -42602,6 +44019,7 @@ + @@ -42863,24 +44281,24 @@ - + - + - + - + - + - + - + @@ -43205,6 +44623,7 @@ + @@ -43532,7 +44951,7 @@ - + @@ -43886,6 +45305,7 @@ + @@ -43981,15 +45401,15 @@ - + - + - + - + @@ -44045,6 +45465,7 @@ + @@ -44097,6 +45518,7 @@ + @@ -44329,24 +45751,24 @@ - + - + - + - + - + - + - + @@ -44359,6 +45781,12 @@ + + + + + + @@ -44575,6 +46003,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -44607,7 +46073,77 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -44647,168 +46183,168 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -45101,6 +46637,9 @@ + + + @@ -45819,81 +47358,81 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -46013,18 +47552,18 @@ - + - + - + - + - + @@ -46133,6 +47672,13 @@ + + + + + + + @@ -46235,6 +47781,7 @@ + @@ -46387,13 +47934,13 @@ - + - + - + @@ -46402,7 +47949,7 @@ - + @@ -46416,7 +47963,7 @@ - + @@ -46439,7 +47986,7 @@ - + @@ -46485,7 +48032,7 @@ - + @@ -46507,6 +48054,11 @@ + + + + + @@ -46580,6 +48132,14 @@ + + + + + + + + @@ -47023,6 +48583,10 @@ + + + + @@ -47097,6 +48661,23 @@ + + + + + + + + + + + + + + + + + @@ -47666,7 +49247,7 @@ - + @@ -47779,6 +49360,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -47870,6 +49483,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -47941,6 +49574,14 @@ + + + + + + + + @@ -48006,23 +49647,37 @@ - - - + - + + + + - + - + + + + + + + + + + + + + + - + - + @@ -48450,6 +50105,7 @@ + @@ -48563,7 +50219,7 @@ - + @@ -48726,6 +50382,12 @@ + + + + + + @@ -48781,39 +50443,39 @@ - + - + - + - + - + - + - + - + - + - + - + - + @@ -48909,114 +50571,114 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -49131,12 +50793,34 @@ + + + + + + + + + + + + + + + + + + + + + + @@ -49355,7 +51039,7 @@ - + @@ -49493,6 +51177,7 @@ + @@ -49639,7 +51324,29 @@ - + + + + + + + + + + + + + + + + + + + + + + + @@ -50374,7 +52081,7 @@ - + @@ -50416,30 +52123,30 @@ - + - + - + - + - + - + - + - + - + @@ -50840,6 +52547,7 @@ + @@ -50966,7 +52674,7 @@ - + @@ -51105,6 +52813,7 @@ + @@ -51256,7 +52965,7 @@ - + @@ -51292,6 +53001,7 @@ + @@ -51455,7 +53165,146 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -51641,6 +53490,7 @@ + @@ -52067,6 +53917,11 @@ + + + + + @@ -52075,7 +53930,7 @@ - + @@ -52170,6 +54025,14 @@ + + + + + + + + @@ -52320,6 +54183,15 @@ + + + + + + + + + @@ -52478,7 +54350,7 @@ - + @@ -52511,6 +54383,11 @@ + + + + + @@ -52902,6 +54779,20 @@ + + + + + + + + + + + + + + @@ -53090,102 +54981,110 @@ + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -53214,7 +55113,7 @@ - + @@ -53247,10 +55146,10 @@ - + - + @@ -53275,6 +55174,7 @@ + @@ -53443,7 +55343,7 @@ - + @@ -53550,6 +55450,7 @@ + @@ -53772,7 +55673,7 @@ - + @@ -53944,7 +55845,7 @@ - + @@ -54035,7 +55936,7 @@ - + @@ -54053,6 +55954,7 @@ + @@ -54234,36 +56136,36 @@ - + - + - + - + - + - + - + - + - + - + - + @@ -54538,10 +56440,15 @@ - + + + + + + @@ -54567,7 +56474,7 @@ - + @@ -54780,24 +56687,24 @@ - + - + - + - + - + - + - + @@ -55119,14 +57026,14 @@ - + - + @@ -55134,6 +57041,7 @@ + @@ -55402,7 +57310,20 @@ - + + + + + + + + + + + + + + @@ -55471,7 +57392,7 @@ - + @@ -55747,7 +57668,7 @@ - + @@ -55809,102 +57730,102 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -55973,7 +57894,7 @@ - + @@ -56035,13 +57956,13 @@ - + - + @@ -56193,61 +58114,61 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -56287,7 +58208,7 @@ - + @@ -56337,6 +58258,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -56379,16 +58320,16 @@ - + - + - + - + @@ -56532,7 +58473,53 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -57332,7 +59319,7 @@ - + @@ -57480,15 +59467,15 @@ - + - + - + - + @@ -57678,6 +59665,9 @@ + + + @@ -57747,6 +59737,13 @@ + + + + + + + @@ -57815,6 +59812,10 @@ + + + + @@ -57929,6 +59930,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -58174,7 +60201,7 @@ - + @@ -58364,72 +60391,72 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -58472,6 +60499,7 @@ + @@ -58491,6 +60519,13 @@ + + + + + + + @@ -58865,7 +60900,7 @@ - + @@ -58944,6 +60979,12 @@ + + + + + + @@ -59173,6 +61214,20 @@ + + + + + + + + + + + + + + @@ -59229,7 +61284,7 @@ - + @@ -59308,15 +61363,15 @@ - + - + - + - + @@ -59367,36 +61422,36 @@ - + - + - + - + - + - + - + - + - + - + - + @@ -59659,7 +61714,7 @@ - + @@ -59731,6 +61786,15 @@ + + + + + + + + + @@ -59741,7 +61805,7 @@ - + @@ -59843,6 +61907,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -59901,6 +61988,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -60060,7 +62170,7 @@ - + @@ -60101,6 +62211,7 @@ + @@ -60244,7 +62355,7 @@ - + @@ -60273,6 +62384,13 @@ + + + + + + + @@ -60311,13 +62429,13 @@ - + - + @@ -60329,7 +62447,7 @@ - + @@ -60588,7 +62706,7 @@ - + @@ -60708,6 +62826,7 @@ + @@ -60893,12 +63012,12 @@ - + - + - + @@ -61075,6 +63194,17 @@ + + + + + + + + + + + @@ -61207,7 +63337,7 @@ - + @@ -61268,7 +63398,7 @@ - + @@ -61307,7 +63437,191 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -61347,84 +63661,84 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -62050,6 +64364,7 @@ + @@ -62294,7 +64609,7 @@ - + @@ -62366,7 +64681,7 @@ - + @@ -62810,6 +65125,7 @@ + @@ -63201,6 +65517,7 @@ + @@ -63252,7 +65569,7 @@ - + @@ -63265,7 +65582,7 @@ - + @@ -63385,7 +65702,7 @@ - + @@ -63481,294 +65798,294 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -63797,16 +66114,27 @@ - + - + - + + + + + + + + + + + + @@ -63940,6 +66268,7 @@ + @@ -64205,12 +66534,12 @@ - + - + - + @@ -64263,7 +66592,7 @@ - + @@ -64452,6 +66781,9 @@ + + + @@ -64579,6 +66911,7 @@ + @@ -64702,7 +67035,8 @@ - + + @@ -64745,69 +67079,69 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -64898,6 +67232,7 @@ + @@ -64925,7 +67260,7 @@ - + @@ -65059,25 +67394,25 @@ - + - + - + - + - + - + - + @@ -65230,6 +67565,7 @@ + @@ -65285,12 +67621,12 @@ - + - + - + @@ -65322,6 +67658,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -65339,15 +67695,15 @@ - + - + - + - + @@ -65407,7 +67763,7 @@ - + @@ -65582,6 +67938,9 @@ + + + @@ -65845,11 +68204,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -65965,7 +68352,7 @@ - + @@ -66010,6 +68397,7 @@ + @@ -66021,6 +68409,7 @@ + @@ -66122,12 +68511,12 @@ - + - + - + @@ -66150,7 +68539,7 @@ - + @@ -66180,18 +68569,18 @@ - + - + - + - + - + @@ -66269,6 +68658,10 @@ + + + + @@ -66524,6 +68917,7 @@ + @@ -66635,7 +69029,7 @@ - + @@ -66776,6 +69170,7 @@ + @@ -66790,6 +69185,7 @@ + @@ -66859,7 +69255,7 @@ - + @@ -66873,24 +69269,24 @@ - + - + - + - + - + - + - + @@ -66926,59 +69322,65 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + @@ -67001,7 +69403,7 @@ - + @@ -67157,7 +69559,7 @@ - + @@ -67343,7 +69745,7 @@ - + @@ -67563,7 +69965,7 @@ - + @@ -67571,7 +69973,7 @@ - + @@ -67603,7 +70005,7 @@ - + @@ -67630,7 +70032,7 @@ - + @@ -67641,7 +70043,7 @@ - + @@ -67670,7 +70072,7 @@ - + @@ -67678,7 +70080,7 @@ - + @@ -67686,72 +70088,161 @@ - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - - - + - - - - - - - - - - - - - - - - - + - + - + @@ -67768,42 +70259,31 @@ - + - + - + - + - + - + - - - - + - - - - - - - - - + @@ -67820,7 +70300,7 @@ - + @@ -67828,7 +70308,7 @@ - + @@ -67839,12 +70319,23 @@ - + - + + + + + + + + + + + + @@ -67852,48 +70343,48 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -67910,21 +70401,21 @@ - + - + - + - + - + - + @@ -67935,7 +70426,7 @@ - + @@ -67943,12 +70434,12 @@ - + - + @@ -67956,7 +70447,7 @@ - + @@ -67967,7 +70458,7 @@ - + @@ -67978,7 +70469,7 @@ - + @@ -67989,12 +70480,12 @@ - + - + - + @@ -68002,13 +70493,13 @@ - + - + - + @@ -68016,7 +70507,7 @@ - + @@ -68024,7 +70515,7 @@ - + @@ -68032,7 +70523,7 @@ - + @@ -68040,7 +70531,7 @@ - + @@ -68051,7 +70542,7 @@ - + @@ -68065,7 +70556,7 @@ - + @@ -68073,7 +70564,7 @@ - + @@ -68081,7 +70572,7 @@ - + @@ -68089,7 +70580,7 @@ - + @@ -68115,12 +70606,12 @@ - + - + @@ -68128,23 +70619,23 @@ - + - + - + - + - + - + - + @@ -68152,7 +70643,7 @@ - + @@ -68178,7 +70669,7 @@ - + @@ -68189,7 +70680,7 @@ - + @@ -68197,7 +70688,7 @@ - + @@ -68205,7 +70696,7 @@ - + @@ -68216,7 +70707,7 @@ - + @@ -68224,7 +70715,7 @@ - + @@ -68235,19 +70726,19 @@ - + - + - + - - + + @@ -68255,7 +70746,7 @@ - + @@ -68266,7 +70757,7 @@ - + @@ -68277,7 +70768,7 @@ - + @@ -68285,7 +70776,7 @@ - + @@ -68305,18 +70796,18 @@ - + - + - + - + @@ -68324,7 +70815,7 @@ - + @@ -68332,7 +70823,7 @@ - + @@ -68340,7 +70831,7 @@ - + @@ -68348,7 +70839,7 @@ - + @@ -68359,15 +70850,15 @@ - + - + - + @@ -68375,15 +70866,15 @@ - + - + - + @@ -68391,26 +70882,26 @@ - + - + - + - + - + - + - + - + @@ -68418,7 +70909,7 @@ - + @@ -68426,7 +70917,7 @@ - + @@ -68437,7 +70928,7 @@ - + @@ -68448,15 +70939,15 @@ - + - + - + @@ -68464,7 +70955,7 @@ - + @@ -68472,31 +70963,31 @@ - + - + - + - + - + - + - + @@ -68504,33 +70995,33 @@ - + - + - + - + - + - + - + - + - + @@ -68544,7 +71035,7 @@ - + @@ -68552,15 +71043,15 @@ - + - + - + @@ -68568,10 +71059,10 @@ - + - + @@ -68579,15 +71070,15 @@ - + - + - + @@ -68598,7 +71089,7 @@ - + @@ -68606,7 +71097,7 @@ - + @@ -68617,7 +71108,7 @@ - + @@ -68625,15 +71116,15 @@ - + - + - + @@ -68647,31 +71138,31 @@ - + - + - + - + - + - + - + - + @@ -68679,7 +71170,7 @@ - + @@ -68690,7 +71181,7 @@ - + @@ -68698,7 +71189,15 @@ - + + + + + + + + + @@ -68706,7 +71205,7 @@ - + @@ -68714,18 +71213,18 @@ - + - + - + - + - + @@ -68733,53 +71232,53 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -68787,15 +71286,15 @@ - + - + - + - + @@ -68803,23 +71302,23 @@ - + - + - + - + - + @@ -68827,15 +71326,15 @@ - + - + - + @@ -68843,7 +71342,7 @@ - + @@ -68857,15 +71356,15 @@ - + - + - + - + @@ -68873,7 +71372,7 @@ - + @@ -68887,7 +71386,7 @@ - + @@ -68901,15 +71400,15 @@ - + - + - + @@ -68917,9 +71416,9 @@ - + - + @@ -68931,7 +71430,7 @@ - + @@ -68939,7 +71438,7 @@ - + @@ -68947,12 +71446,12 @@ - + - + - + @@ -68960,15 +71459,15 @@ - + - + - + @@ -68988,7 +71487,7 @@ - + @@ -68996,18 +71495,18 @@ - + - + - + - + - + @@ -69015,7 +71514,7 @@ - + @@ -69023,7 +71522,7 @@ - + @@ -69031,7 +71530,7 @@ - + @@ -69045,7 +71544,7 @@ - + @@ -69065,7 +71564,7 @@ - + @@ -69074,105 +71573,105 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -69180,7 +71679,7 @@ - + @@ -69197,7 +71696,7 @@ - + @@ -69205,15 +71704,15 @@ - + - + - + @@ -69221,7 +71720,7 @@ - + @@ -69247,12 +71746,12 @@ - + - + @@ -69293,7 +71792,7 @@ - + @@ -69301,7 +71800,7 @@ - + @@ -69309,7 +71808,7 @@ - + @@ -69317,7 +71816,7 @@ - + @@ -69325,15 +71824,15 @@ - + - + - + - + @@ -69341,7 +71840,7 @@ - + @@ -69349,7 +71848,7 @@ - + @@ -69357,18 +71856,18 @@ - + - + - + - + @@ -69376,32 +71875,32 @@ - + - + - + - + - + - + - + - + - + - + @@ -69409,30 +71908,49 @@ - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + @@ -69440,7 +71958,23 @@ - + + + + + + + + + + + + + + + + + @@ -69451,38 +71985,38 @@ - + - + - + - + - + - + - + - + - + - + - + - + @@ -69491,15 +72025,15 @@ - + - + - + @@ -69507,7 +72041,7 @@ - + @@ -69515,101 +72049,101 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -69617,38 +72151,38 @@ - + - + - + - + - + - + - + - + - + - + @@ -69656,7 +72190,7 @@ - + @@ -69664,7 +72198,7 @@ - + @@ -69672,7 +72206,7 @@ - + @@ -69680,7 +72214,7 @@ - + @@ -69688,7 +72222,7 @@ - + @@ -69696,7 +72230,7 @@ - + @@ -69707,7 +72241,7 @@ - + @@ -69715,7 +72249,7 @@ - + @@ -69725,9 +72259,10 @@ - + + - + @@ -69759,7 +72294,7 @@ - + @@ -69780,15 +72315,15 @@ - + - + - + - + @@ -69801,6 +72336,14 @@ + + + + + + + + @@ -70043,7 +72586,14 @@ - + + + + + + + + @@ -70185,6 +72735,7 @@ + @@ -70779,11 +73330,13 @@ + + @@ -70812,6 +73365,7 @@ + @@ -70928,7 +73482,26 @@ - + + + + + + + + + + + + + + + + + + + + @@ -71166,45 +73739,46 @@ - + + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -71323,7 +73897,7 @@ - + @@ -71541,21 +74115,21 @@ - + - + - + - + - + - + @@ -71615,6 +74189,7 @@ + @@ -71937,6 +74512,7 @@ + @@ -72118,6 +74694,11 @@ + + + + + @@ -72237,24 +74818,24 @@ - + - + - + - + - + - + - + @@ -72331,6 +74912,11 @@ + + + + + @@ -72361,10 +74947,12 @@ + + @@ -72472,7 +75060,7 @@ - + @@ -72506,6 +75094,11 @@ + + + + + @@ -72514,7 +75107,7 @@ - + @@ -72576,19 +75169,20 @@ + - + - + - + - + @@ -72642,10 +75236,26 @@ - + + + + + + + + + + + + + + + + + + - @@ -72868,81 +75478,81 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -72980,6 +75590,12 @@ + + + + + + @@ -73355,7 +75971,7 @@ - + @@ -73574,18 +76190,19 @@ - + - + - + - + + @@ -73833,6 +76450,7 @@ + @@ -73885,15 +76503,15 @@ - + - + - + - + @@ -73980,6 +76598,7 @@ + @@ -74029,11 +76648,18 @@ - + - + + + + + + + + @@ -74169,7 +76795,7 @@ - + @@ -74180,7 +76806,7 @@ - + @@ -74338,24 +76964,24 @@ - + - + - + - + - + - + - + @@ -74802,7 +77428,7 @@ - + @@ -74947,6 +77573,7 @@ + @@ -75129,240 +77756,240 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -75438,12 +78065,12 @@ - + - + - + @@ -75639,7 +78266,7 @@ - + @@ -75741,7 +78368,7 @@ - + @@ -75761,6 +78388,9 @@ + + + @@ -75783,213 +78413,213 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -76003,618 +78633,618 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -76627,7 +79257,7 @@ - + @@ -76653,312 +79283,312 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -77270,6 +79900,10 @@ + + + + @@ -77365,72 +79999,72 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -77699,6 +80333,7 @@ + @@ -77916,7 +80551,7 @@ - + @@ -78135,6 +80770,12 @@ + + + + + + @@ -78149,6 +80790,7 @@ + @@ -78224,6 +80866,14 @@ + + + + + + + + @@ -78232,6 +80882,7 @@ + @@ -78256,6 +80907,7 @@ + @@ -78345,6 +80997,20 @@ + + + + + + + + + + + + + + @@ -78353,6 +81019,7 @@ + @@ -78387,7 +81054,7 @@ - + @@ -78465,6 +81132,7 @@ + @@ -78772,6 +81440,20 @@ + + + + + + + + + + + + + + @@ -78831,7 +81513,7 @@ - + @@ -78870,6 +81552,12 @@ + + + + + + @@ -78952,10 +81640,10 @@ - + - + @@ -79058,6 +81746,23 @@ + + + + + + + + + + + + + + + + + @@ -79172,6 +81877,7 @@ + @@ -79323,7 +82029,7 @@ - + @@ -79658,7 +82364,7 @@ - + @@ -79760,7 +82466,7 @@ - + @@ -79777,15 +82483,15 @@ - + - + - + - + @@ -79839,6 +82545,13 @@ + + + + + + + @@ -79870,6 +82583,7 @@ + @@ -79963,6 +82677,7 @@ + @@ -80134,6 +82849,14 @@ + + + + + + + + @@ -80990,6 +83713,12 @@ + + + + + + @@ -81435,6 +84164,7 @@ + @@ -81523,6 +84253,7 @@ + @@ -81707,6 +84438,10 @@ + + + + @@ -81924,15 +84659,15 @@ - + - + - + - + @@ -82145,7 +84880,7 @@ - + @@ -82258,7 +84993,7 @@ - + @@ -82348,7 +85083,7 @@ - + @@ -82380,6 +85115,7 @@ + @@ -82749,7 +85485,7 @@ - + @@ -82785,7 +85521,7 @@ - + @@ -82980,51 +85716,51 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -83089,6 +85825,7 @@ + @@ -83556,16 +86293,16 @@ - + - + - + - + @@ -83660,7 +86397,7 @@ - + @@ -83774,7 +86511,7 @@ - + @@ -83788,7 +86525,7 @@ - + @@ -83910,13 +86647,13 @@ - + - + - + @@ -83964,7 +86701,7 @@ - + @@ -84056,20 +86793,28 @@ - + - + - + - + - + + + + + + + + + @@ -84187,7 +86932,7 @@ - + @@ -84267,22 +87012,22 @@ - + - + - + - + - + - + @@ -84429,6 +87174,17 @@ + + + + + + + + + + + @@ -84764,6 +87520,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -84842,7 +87654,7 @@ - + @@ -85068,7 +87880,7 @@ - + @@ -85203,7 +88015,7 @@ - + @@ -85308,7 +88120,7 @@ - + @@ -85520,6 +88332,7 @@ + @@ -85634,6 +88447,7 @@ + @@ -85666,7 +88480,28 @@ + + + + + + + + + + + + + + + + + + + + + @@ -85770,6 +88605,7 @@ + @@ -85913,7 +88749,7 @@ - + @@ -86096,7 +88932,7 @@ - + @@ -86118,12 +88954,12 @@ - + - + - + @@ -86167,6 +89003,17 @@ + + + + + + + + + + + @@ -86384,225 +89231,225 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -86704,6 +89551,11 @@ + + + + + @@ -87074,7 +89926,7 @@ - + @@ -87083,7 +89935,7 @@ - + @@ -87180,39 +90032,39 @@ - + - + - + - + - + - + - + - + - + - + - + - + @@ -87479,6 +90331,9 @@ + + + @@ -87643,6 +90498,7 @@ + @@ -87682,6 +90538,7 @@ + @@ -87762,51 +90619,51 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -88081,7 +90938,7 @@ - + @@ -88158,7 +91015,7 @@ - + @@ -88168,6 +91025,14 @@ + + + + + + + + @@ -88322,10 +91187,10 @@ - + - + @@ -89168,10 +92033,10 @@ - + - + @@ -89183,7 +92048,7 @@ - + @@ -89341,6 +92206,7 @@ + @@ -89541,6 +92407,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -89566,6 +92452,14 @@ + + + + + + + + @@ -89602,6 +92496,10 @@ + + + + @@ -89623,6 +92521,17 @@ + + + + + + + + + + + @@ -89702,7 +92611,86 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -89860,7 +92848,7 @@ - + @@ -89879,12 +92867,12 @@ - + - + - + @@ -89961,7 +92949,7 @@ - + @@ -90179,7 +93167,44 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -90266,6 +93291,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -90343,7 +93391,7 @@ - + @@ -90390,12 +93438,12 @@ - + - + - + @@ -90552,21 +93600,21 @@ - + - + - + - + - + - + @@ -90692,7 +93740,7 @@ - + @@ -90841,9 +93889,10 @@ + - + @@ -91501,6 +94550,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -91626,6 +94704,12 @@ + + + + + + @@ -91810,7 +94894,7 @@ - + @@ -91834,6 +94918,11 @@ + + + + + @@ -91972,7 +95061,7 @@ - + @@ -92243,7 +95332,7 @@ - + @@ -92328,7 +95417,7 @@ - + @@ -92550,6 +95639,11 @@ + + + + + @@ -93648,45 +96742,45 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -93892,21 +96986,21 @@ - + - + - + - + - + - + @@ -93958,6 +97052,9 @@ + + + @@ -94151,18 +97248,7 @@ - - - - - - - - - - - - + @@ -94170,7 +97256,7 @@ - + @@ -94178,7 +97264,7 @@ - + @@ -94186,7 +97272,7 @@ - + @@ -94194,7 +97280,214 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -94202,7 +97495,15 @@ - + + + + + + + + + @@ -94210,7 +97511,7 @@ - + @@ -94218,54 +97519,54 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -94276,7 +97577,7 @@ - + @@ -94296,7 +97597,7 @@ - + @@ -94319,7 +97620,7 @@ - + @@ -94339,26 +97640,26 @@ - + - + - + - + - + @@ -94372,7 +97673,7 @@ - + @@ -94380,7 +97681,7 @@ - + @@ -94400,7 +97701,7 @@ - + @@ -94423,7 +97724,7 @@ - + @@ -94431,7 +97732,7 @@ - + @@ -94439,7 +97740,7 @@ - + @@ -94447,7 +97748,7 @@ - + @@ -94455,7 +97756,7 @@ - + @@ -94481,17 +97782,17 @@ - + - + - + @@ -94499,17 +97800,17 @@ - + - + - + @@ -94526,100 +97827,111 @@ - + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -94633,7 +97945,7 @@ - + @@ -94647,7 +97959,7 @@ - + @@ -94658,7 +97970,7 @@ - + @@ -94672,10 +97984,10 @@ - + - + @@ -94683,7 +97995,7 @@ - + @@ -94697,12 +98009,12 @@ - + - + @@ -94710,7 +98022,7 @@ - + @@ -94718,7 +98030,7 @@ - + @@ -94729,7 +98041,7 @@ - + @@ -94737,7 +98049,7 @@ - + @@ -94745,18 +98057,18 @@ - + - + - + - + - + @@ -94764,7 +98076,7 @@ - + @@ -94781,7 +98093,7 @@ - + @@ -94789,7 +98101,7 @@ - + @@ -94797,7 +98109,7 @@ - + @@ -94811,7 +98123,7 @@ - + @@ -94825,14 +98137,14 @@ - + - + - + @@ -94841,10 +98153,10 @@ - + - + @@ -94861,7 +98173,7 @@ - + @@ -94872,7 +98184,7 @@ - + @@ -94883,13 +98195,13 @@ - + - + @@ -94897,7 +98209,7 @@ - + @@ -94908,7 +98220,7 @@ - + @@ -94919,7 +98231,7 @@ - + @@ -94927,7 +98239,7 @@ - + @@ -95103,13 +98415,13 @@ - + - + @@ -95120,7 +98432,7 @@ - + @@ -95128,10 +98440,10 @@ - + - + @@ -95139,7 +98451,7 @@ - + @@ -95147,7 +98459,7 @@ - + @@ -95161,7 +98473,7 @@ - + @@ -95169,7 +98481,7 @@ - + @@ -95177,7 +98489,7 @@ - + @@ -95185,7 +98497,7 @@ - + @@ -95193,7 +98505,7 @@ - + @@ -95204,29 +98516,29 @@ - + - + - + - + - + - + - + - + - + @@ -95237,7 +98549,7 @@ - + @@ -95245,7 +98557,7 @@ - + @@ -95253,7 +98565,7 @@ - + @@ -95261,7 +98573,7 @@ - + @@ -95281,7 +98593,7 @@ - + @@ -95289,13 +98601,13 @@ - + - + @@ -95312,21 +98624,21 @@ - + - + - + - + - + - + @@ -95340,7 +98652,7 @@ - + @@ -95348,7 +98660,7 @@ - + @@ -95362,7 +98674,7 @@ - + @@ -95373,7 +98685,7 @@ - + @@ -95390,15 +98702,15 @@ - + - + - + @@ -95406,7 +98718,7 @@ - + @@ -95417,7 +98729,7 @@ - + @@ -95428,7 +98740,7 @@ - + @@ -95436,24 +98748,24 @@ - + - + - + - + - + - + - + @@ -95476,7 +98788,7 @@ - + @@ -95484,7 +98796,7 @@ - + @@ -95495,7 +98807,7 @@ - + @@ -95509,18 +98821,18 @@ - + - + - + - + @@ -95546,7 +98858,7 @@ - + @@ -95557,7 +98869,7 @@ - + @@ -95565,7 +98877,7 @@ - + @@ -95585,7 +98897,7 @@ - + @@ -95596,31 +98908,31 @@ - + - + - + - + - + - + - + - + - + - + @@ -95628,7 +98940,7 @@ - + @@ -95636,7 +98948,7 @@ - + @@ -95644,12 +98956,12 @@ - + - + @@ -95657,47 +98969,47 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -95738,7 +99050,7 @@ - + @@ -95746,13 +99058,13 @@ - + - + @@ -95778,7 +99090,7 @@ - + @@ -95843,7 +99155,7 @@ - + @@ -95854,7 +99166,7 @@ - + @@ -95871,7 +99183,7 @@ - + @@ -95915,9 +99227,9 @@ - + - + @@ -95926,7 +99238,7 @@ - + @@ -95937,7 +99249,7 @@ - + @@ -95957,7 +99269,7 @@ - + @@ -95965,7 +99277,7 @@ - + @@ -95982,7 +99294,7 @@ - + @@ -96011,12 +99323,12 @@ - + - + @@ -96025,10 +99337,10 @@ - + - + @@ -96042,17 +99354,17 @@ - + - + - + @@ -96060,7 +99372,7 @@ - + @@ -96071,7 +99383,7 @@ - + @@ -96079,7 +99391,7 @@ - + @@ -96120,23 +99432,23 @@ - + - + - + - + - + - + - + @@ -96150,7 +99462,7 @@ - + @@ -96170,7 +99482,7 @@ - + @@ -96178,15 +99490,15 @@ - + - + - + - + @@ -96194,12 +99506,12 @@ - + - + @@ -96207,7 +99519,7 @@ - + @@ -96215,10 +99527,10 @@ - + - + @@ -96226,23 +99538,23 @@ - + - + - - + + - + @@ -96251,12 +99563,12 @@ - + - + @@ -96264,12 +99576,12 @@ - + - + @@ -96277,12 +99589,12 @@ - + - + @@ -96299,7 +99611,7 @@ - + @@ -96307,7 +99619,7 @@ - + @@ -96315,12 +99627,12 @@ - + - + @@ -96328,7 +99640,7 @@ - + @@ -96336,9 +99648,9 @@ - + - + @@ -96353,12 +99665,12 @@ - + - + @@ -96384,7 +99696,7 @@ - + @@ -96395,7 +99707,7 @@ - + @@ -96415,7 +99727,7 @@ - + @@ -96438,53 +99750,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -96498,12 +99764,12 @@ - + - + @@ -96514,7 +99780,7 @@ - + @@ -96528,7 +99794,7 @@ - + @@ -96539,7 +99805,7 @@ - + @@ -96553,7 +99819,7 @@ - + @@ -96567,20 +99833,20 @@ - + - + - + - + @@ -96594,7 +99860,7 @@ - + @@ -96602,7 +99868,7 @@ - + @@ -96613,7 +99879,7 @@ - + @@ -96630,7 +99896,7 @@ - + @@ -96650,7 +99916,7 @@ - + @@ -96667,7 +99933,7 @@ - + @@ -96678,7 +99944,7 @@ - + @@ -96686,7 +99952,7 @@ - + @@ -96694,7 +99960,7 @@ - + @@ -96702,7 +99968,7 @@ - + @@ -96716,7 +99982,7 @@ - + @@ -96724,7 +99990,7 @@ - + @@ -96735,7 +100001,7 @@ - + @@ -96752,7 +100018,7 @@ - + @@ -96778,7 +100044,7 @@ - + @@ -96789,7 +100055,7 @@ - + @@ -96800,7 +100066,7 @@ - + @@ -97106,6 +100372,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -97167,7 +100456,7 @@ - + @@ -97186,6 +100475,14 @@ + + + + + + + + @@ -97361,7 +100658,7 @@ - + @@ -97532,7 +100829,7 @@ - + @@ -97564,6 +100861,7 @@ + @@ -97666,30 +100964,30 @@ - + - + - + - + - + - + - + - + - + @@ -98447,6 +101745,7 @@ + @@ -98456,6 +101755,7 @@ + @@ -98657,6 +101957,7 @@ + @@ -98844,7 +102145,7 @@ - + @@ -99055,24 +102356,25 @@ - + + - + - + - + - + - + - + @@ -99195,84 +102497,84 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -99308,12 +102610,12 @@ - + - + @@ -99452,6 +102754,13 @@ + + + + + + + @@ -99663,6 +102972,7 @@ + @@ -100023,6 +103333,9 @@ + + + @@ -100043,7 +103356,7 @@ - + @@ -100337,6 +103650,23 @@ + + + + + + + + + + + + + + + + + @@ -100344,36 +103674,36 @@ - + - + - + - + - + - + - + - + - + - + - + @@ -100476,7 +103806,7 @@ - + @@ -100619,12 +103949,12 @@ - + - + - + @@ -100739,10 +104069,10 @@ - + - + @@ -100858,15 +104188,15 @@ - + - + - + - + @@ -101046,6 +104376,20 @@ + + + + + + + + + + + + + + @@ -101150,7 +104494,7 @@ - + @@ -101289,6 +104633,7 @@ + @@ -101327,6 +104672,7 @@ + @@ -101400,7 +104746,7 @@ - + @@ -101451,7 +104797,7 @@ - + @@ -101482,7 +104828,7 @@ - + @@ -101922,7 +105268,7 @@ - + @@ -102037,6 +105383,7 @@ + @@ -102112,15 +105459,15 @@ - + - + - + - + @@ -102171,6 +105518,7 @@ + @@ -102265,7 +105613,7 @@ - + @@ -102313,15 +105661,15 @@ - + - + - + - + @@ -102488,87 +105836,87 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -102843,6 +106191,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -102899,12 +106273,12 @@ - + - + - + @@ -102987,6 +106361,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -103199,8 +106665,9 @@ - + + @@ -103327,6 +106794,7 @@ + @@ -103431,6 +106899,9 @@ + + + @@ -103480,6 +106951,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -103629,7 +107126,7 @@ - + @@ -103743,7 +107240,7 @@ - + @@ -103892,6 +107389,10 @@ + + + + @@ -103917,19 +107418,20 @@ + - + - + - + - + - + @@ -103991,15 +107493,15 @@ - + - + - + - + @@ -104145,6 +107647,7 @@ + @@ -104197,7 +107700,7 @@ - + @@ -104420,6 +107923,7 @@ + @@ -104910,174 +108414,174 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -105093,6 +108597,23 @@ + + + + + + + + + + + + + + + + + @@ -105151,13 +108672,13 @@ - + - + @@ -105454,81 +108975,81 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -105650,7 +109171,8 @@ - + + @@ -105788,6 +109310,7 @@ + @@ -105810,6 +109333,17 @@ + + + + + + + + + + + @@ -105888,8 +109422,10 @@ - - + + + + @@ -105924,11 +109460,11 @@ - - - - - + + + + + @@ -105949,46 +109485,53 @@ - - - - - + + + + + - - - - + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - + + + - - - + + + + + + + + + + @@ -105998,27 +109541,27 @@ - - - - - - - - - + + + + + + + + + - - - - - + + + + + - - - + + + @@ -106044,9 +109587,9 @@ - - - + + + @@ -106154,10 +109697,10 @@ - - - - + + + + @@ -106373,14 +109916,14 @@ - - - + + + - - - + + + @@ -106585,13 +110128,13 @@ - - + + - - - + + + @@ -106649,8 +110192,8 @@ - - + + @@ -106669,8 +110212,8 @@ - - + + @@ -106683,8 +110226,8 @@ - - + + @@ -106730,9 +110273,9 @@ - - - + + + @@ -106761,34 +110304,34 @@ - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + @@ -106881,9 +110424,9 @@ - - - + + + @@ -106950,8 +110493,8 @@ - - + + @@ -106966,8 +110509,8 @@ - - + + @@ -107028,18 +110571,18 @@ - - - - + + + + - - + + - - + + @@ -107053,101 +110596,93 @@ - - - - - - - - - - - - - + - - - - - - + + + + - - - - - - - - - - - + + + + + - - - + + + + + - - - - + + + + + + + + + + + - - - - - - + + + - - - - - + + + + - - - - - + + + + + + - - - - + + + + + - - - - - - + + + + + - - - - - - + + + + - + + + + + + + + + @@ -107155,40 +110690,48 @@ - - - - - - + + + + + + - - - - + + + + + + - - - - - + + + + - - - - - + + + + + - - - - - - + + + + + + + + + + + + + @@ -107203,15 +110746,15 @@ - - - - + + + + - - - + + + @@ -107226,217 +110769,222 @@ - - - - + + + + - - - + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - + + + + - - - - + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - + + + + + + + - - - - - - + + + + + + - - - + + + - - - - + + + + - - - + + + - - - - - + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - + + + + - - - - - - - - + + + + + + + + - - - + + + - - - - + + + + - - - - + + + + - - - - - - - + + + + + + + - - - - + + + + - - - - - + + + + + + + + + + @@ -107445,50 +110993,50 @@ - - - - + + + + - - - - + + + + - - - + + + - - - + + + - - - - + + + + - - - - + + + + - - - + + + - - - - - + + + + + @@ -107497,62 +111045,67 @@ - - - - - - - + + + + + + + - - - - + + + + - - - - - - - - + + + - - - - - + + + + + + + + - - - + + + + + - - - - - + + + - - - - - - + + + + + - - - - + + + + + + + + + + + + @@ -107573,10 +111126,10 @@ - - - - + + + + @@ -107585,118 +111138,123 @@ - - - - - - + + + + + + - - - - - + + + - - - - - - - - + - - - + + + - + + + + + + + + + + + + + + + + + + + + + - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + - - - + + + + - - - + + + + + + - - - - - + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -107852,101 +111410,104 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + + - + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + @@ -107972,10 +111533,10 @@ - - - - + + + + @@ -108051,6 +111612,13 @@ + + + + + + + @@ -108074,42 +111642,42 @@ - - - - - - - - - - - - - + - + + + + + + + + + + + + + + + + + + + - + - - - - - - @@ -108224,13 +111792,13 @@ - - - + + + - - + + @@ -108253,9 +111821,9 @@ - - - + + + @@ -108342,32 +111910,32 @@ - - - - - - - + + + + + + + - - - + + + - - - - - - + + + + + + - - - - + + + + @@ -108459,8 +112027,8 @@ - - + + @@ -108576,8 +112144,8 @@ - - + + @@ -108595,45 +112163,45 @@ - - - - - - - + + + + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + @@ -108710,34 +112278,34 @@ - - + + - - + + - - + + - - - + + + - - - + + + - - + + - - + + @@ -108753,13 +112321,13 @@ - - + + - - - + + + @@ -108776,36 +112344,36 @@ - - - + + + - - - + + + - - + + - - - + + + - - + + - - + + - - - + + + @@ -108830,9 +112398,9 @@ - - - + + + @@ -108841,10 +112409,10 @@ - - - - + + + + @@ -109046,10 +112614,10 @@ - - - - + + + + @@ -109066,7 +112634,7 @@ - + @@ -109193,8 +112761,8 @@ - - + + @@ -109221,12 +112789,12 @@ - - + + - - + + @@ -109255,13 +112823,13 @@ - - + + - - - + + + @@ -109269,13 +112837,13 @@ - - + + - - - + + + @@ -109307,16 +112875,16 @@ - - + + - - + + - - + + @@ -109415,9 +112983,9 @@ - - - + + + @@ -109432,11 +113000,11 @@ - - - - - + + + + + @@ -109448,10 +113016,10 @@ - - - - + + + + @@ -109480,11 +113048,11 @@ - - - - - + + + + + @@ -109515,13 +113083,13 @@ - - - - - - - + + + + + + + @@ -109533,19 +113101,19 @@ - - - - - + + + + + - - - - - - + + + + + + @@ -109559,19 +113127,19 @@ - - - - - - + + + + + + - - - - - + + + + + @@ -109589,10 +113157,10 @@ - - - - + + + + @@ -109621,12 +113189,12 @@ - - - - - - + + + + + + @@ -109638,18 +113206,18 @@ - - - - + + + + - - + + - - + + @@ -109688,12 +113256,12 @@ - - + + - - + + @@ -109703,12 +113271,12 @@ - - + + - - + + @@ -109744,9 +113312,9 @@ - - - + + + @@ -109758,9 +113326,9 @@ - - - + + + @@ -109769,8 +113337,8 @@ - - + + @@ -109785,27 +113353,27 @@ - - - + + + - - - + + + - - + + - - - + + + @@ -109842,31 +113410,31 @@ - - - + + + - - - + + + - - - + + + - - + + - - + + - - + + @@ -110029,8 +113597,8 @@ - - + + @@ -110665,7 +114233,7 @@ - + @@ -110833,8 +114401,8 @@ - - + + @@ -110845,16 +114413,16 @@ - - + + - - + + @@ -110862,6 +114430,7 @@ + @@ -110883,14 +114452,14 @@ - - + + - - - - + + + + @@ -110908,9 +114477,9 @@ - - - + + + @@ -111169,32 +114738,32 @@ - - - - + + + + - - - - + + + + - - + + - - - + + + - - - + + + @@ -111272,8 +114841,8 @@ - - + + @@ -111282,67 +114851,67 @@ - - - + + + - - + + - - + + - - - - - - + + + + + + - - - + + + - - - + + + - - - - - - - + + + + + + + - - + + - - - + + + - - - - + + + + - - - - + + + + @@ -111378,23 +114947,23 @@ - - + + - - - - + + + + - - + + - - - + + + @@ -111429,32 +114998,32 @@ - - + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + @@ -111467,8 +115036,8 @@ - - + + @@ -111532,9 +115101,9 @@ - - - + + + @@ -111549,9 +115118,9 @@ - - - + + + @@ -111561,19 +115130,19 @@ - - - + + + - - - + + + - - - + + + @@ -111598,6 +115167,15 @@ + + + + + + + + + @@ -111655,6 +115233,12 @@ + + + + + + @@ -111805,10 +115389,10 @@ - - - - + + + + @@ -111885,14 +115469,14 @@ - - - - - - - - + + + + + + + + @@ -112619,8 +116203,8 @@ - - + + @@ -112669,6 +116253,11 @@ + + + + + @@ -112740,48 +116329,48 @@ - - - + + + - - - - + + + + - - + + - - - + + + - - + + - - - + + + - - - + + + - - - - + + + + - - + + @@ -112825,26 +116414,26 @@ - - - + + + - - - + + + - - + + - - - - - - + + + + + + @@ -112860,58 +116449,58 @@ - - - + + + - - - + + + - - - + + + - - + + - - - + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - + + - - - - + + + + - - - + + + @@ -113399,26 +116988,26 @@ - - + + - - - + + + - - + + - - + + - - - + + + @@ -113447,54 +117036,54 @@ - - + + - - + + - - - - + + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - + + @@ -113503,53 +117092,53 @@ - - - + + + - - + + - - + + - - - + + + - - - - - + + + + + - - - - - - + + + + + + - - - + + + - - - - + + + + - - - + + + @@ -113558,11 +117147,11 @@ - - - - - + + + + + @@ -113606,26 +117195,26 @@ - - - - + + + + - - - - + + + + - - - - - + + + + + @@ -113790,6 +117379,12 @@ + + + + + + @@ -113941,22 +117536,22 @@ - - - + + + - - - - + + + + - - - - - + + + + + @@ -114230,8 +117825,8 @@ - - + + @@ -114246,10 +117841,10 @@ - - - - + + + + @@ -114341,9 +117936,9 @@ - - - + + + @@ -114423,13 +118018,13 @@ - - - + + + - - + + @@ -114449,22 +118044,22 @@ - - - + + + - - + + - - - + + + - - + + @@ -114478,21 +118073,21 @@ - + - - + + - - + + - - + + @@ -114525,18 +118120,18 @@ - - + + - - - + + + - - - + + + @@ -114568,9 +118163,9 @@ - - - + + + @@ -114579,10 +118174,10 @@ - - - - + + + + @@ -114729,12 +118324,12 @@ - - - - - - + + + + + + @@ -114764,25 +118359,25 @@ - - - + + + - - - + + + - - + + - - - - - + + + + + @@ -114798,22 +118393,22 @@ - - - + + + - - - + + + - - - + + + - + @@ -114825,8 +118420,8 @@ - - + + @@ -114876,81 +118471,81 @@ - - + + - - + + - - + + - - + + - - - - + + + + - - - - + + + + - - - + + + - - - - + + + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - + + + - - + + @@ -115182,13 +118777,13 @@ - - + + - - - + + + @@ -115419,9 +119014,9 @@ - - - + + + @@ -115462,10 +119057,10 @@ - - - - + + + + @@ -115595,8 +119190,8 @@ - - + + @@ -115606,8 +119201,8 @@ - - + + @@ -115789,10 +119384,10 @@ - - - - + + + + @@ -115898,17 +119493,17 @@ - - - + + + - - + + - - + + @@ -116077,12 +119672,12 @@ - - + + - + @@ -116101,6 +119696,7 @@ + @@ -116261,11 +119857,11 @@ - + - - + + @@ -116341,6 +119937,10 @@ + + + + @@ -116704,7 +120304,7 @@ - + @@ -116760,7 +120360,7 @@ - + @@ -116936,6 +120536,11 @@ + + + + + @@ -116957,7 +120562,7 @@ - + @@ -117163,36 +120768,36 @@ - + - + - + - - + + - + - - + + - - + + - - + + - - + + @@ -117238,9 +120843,9 @@ - - - + + + @@ -117793,11 +121398,11 @@ - - - - - + + + + + @@ -117805,16 +121410,16 @@ - - - - - - + + + + + + - - + + @@ -117849,9 +121454,9 @@ - - - + + + @@ -117859,105 +121464,105 @@ - - + + - - - + + + - - - + + + - - + + - - + + - - - + + + - - - - + + + + - - - + + + - - - + + + - - - - - - + + + + + + - - - - + + + + - - - - + + + + - - + + - - + + - - - - + + + + - - - + + + - - - + + + @@ -117977,27 +121582,27 @@ - - - - - + + + + + - - + + - - + + - - + + - - + + @@ -118014,13 +121619,13 @@ - - - + + + - - + + @@ -118067,6 +121672,18 @@ + + + + + + + + + + + + @@ -118142,6 +121759,11 @@ + + + + + @@ -118222,45 +121844,45 @@ - - - - + + + + - - - - + + + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + @@ -118268,14 +121890,14 @@ - - - + + + - - - + + + @@ -118483,10 +122105,10 @@ - - - - + + + + @@ -118799,18 +122421,18 @@ - - - - + + + + - - + + - - + + @@ -118860,10 +122482,10 @@ - - - - + + + + @@ -118884,8 +122506,8 @@ - - + + @@ -118896,8 +122518,8 @@ - - + + @@ -118908,8 +122530,8 @@ - - + + @@ -118928,8 +122550,8 @@ - - + + @@ -118985,9 +122607,9 @@ - - - + + + @@ -119059,18 +122681,18 @@ - - - + + + - - + + - - - + + + @@ -119083,21 +122705,21 @@ - - - - + + + + - - - + + + - - - - + + + + @@ -119116,13 +122738,13 @@ - - - + + + - - + + @@ -119212,12 +122834,12 @@ - - - - - - + + + + + + @@ -119258,10 +122880,10 @@ - - - - + + + + @@ -119326,9 +122948,9 @@ - - - + + + @@ -119588,50 +123210,50 @@ - + - - + + - - + + - - + + - - + + - - + + - - - + + + - - + + - - - + + + - + @@ -119712,10 +123334,10 @@ - + - + @@ -119751,27 +123373,27 @@ - - - - - + + + + + - - - - - - + + + + + + - - - - - - + + + + + + @@ -119798,34 +123420,34 @@ - - - + + + - - - - - + + + + + - - + + - - - + + + - - - + + + - - + + @@ -119885,16 +123507,16 @@ - - + + - - + + @@ -119954,17 +123576,17 @@ - - - - - + + + + + - - - - + + + + @@ -120065,12 +123687,12 @@ - - + + - - + + @@ -120088,8 +123710,8 @@ - - + + @@ -120155,12 +123777,12 @@ - - + + - - + + @@ -120224,13 +123846,13 @@ - - - - - - - + + + + + + + @@ -120251,9 +123873,9 @@ - - - + + + @@ -120278,13 +123900,13 @@ - - + + - - - + + + @@ -120348,72 +123970,72 @@ - - - + + + - - - + + + - - - - + + + + - - + + - - + + - - + + - - - + + + - - - + + + - - + + - - + + - - - - + + + + @@ -120443,30 +124065,35 @@ - - - - + + + + - - + + - - - + + + - - - + + + - - - - + + + + + + + + + @@ -120474,31 +124101,31 @@ - - + + - - - + + + - - - + + + - - - + + + - - + + @@ -120519,9 +124146,9 @@ - - - + + + @@ -120650,11 +124277,11 @@ - - + + - + @@ -120744,7 +124371,7 @@ - + @@ -120843,67 +124470,67 @@ - - + + - - - + + + - - - - + + + + - - - - + + + + - - + + - - + + - - + + - - - - + + + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -121183,10 +124810,10 @@ - - - - + + + + @@ -121302,9 +124929,9 @@ - - - + + + @@ -121329,9 +124956,9 @@ - - - + + + @@ -121618,16 +125245,16 @@ - - - - + + + + - - - - + + + + @@ -121683,11 +125310,11 @@ - - - - - + + + + + @@ -121695,9 +125322,9 @@ - - - + + + @@ -121926,9 +125553,9 @@ - - - + + + @@ -121940,10 +125567,27 @@ - - - - + + + + + + + + + + + + + + + + + + + + + @@ -122195,118 +125839,118 @@ - - - - + + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - - - - + + + + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - + + - - + + @@ -122507,11 +126151,11 @@ - - - - - + + + + + @@ -122526,52 +126170,52 @@ - - - - - + + + + + - - - + + + - - - - - + + + + + - - - + + + - - - - + + + + - - - - - - + + + + + + - - - + + + - - - + + + @@ -122933,17 +126577,17 @@ - - + + - - - + + + - - + + @@ -122958,7 +126602,7 @@ - + @@ -123086,19 +126730,19 @@ - - - + + + - - - - + + + + - - - + + + @@ -123106,19 +126750,19 @@ - - - - + + + + - - + + - - - + + + @@ -123257,14 +126901,14 @@ - - - - + + + + - - + + @@ -123295,24 +126939,24 @@ - - - - + + + + - - + + - - + + - - - - + + + + @@ -123387,8 +127031,8 @@ - - + + @@ -123399,19 +127043,19 @@ - - + + - - - - - + + + + + @@ -123448,8 +127092,8 @@ - - + + @@ -123457,93 +127101,93 @@ - - + + - - - + + + - - - + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - + + - - - + + + - - - + + + - - - - - - - + + + + + + + - - - + + + - - - + + + - - + + - - - - + + + + - - - + + + @@ -123552,30 +127196,30 @@ - - - + + + - - - - + + + + - - - - - + + + + + - - - - - - + + + + + + @@ -123589,10 +127233,10 @@ - - - - + + + + @@ -123600,87 +127244,87 @@ - - + + - - - + + + - - + + - - - - - - - + + + + + + + - - - - - - + + + + + + - - - - - - - + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -123728,21 +127372,21 @@ - - + + - - + + - - - + + + @@ -124104,8 +127748,8 @@ - - + + @@ -124184,8 +127828,8 @@ - - + + @@ -124249,8 +127893,8 @@ - - + + @@ -124258,61 +127902,61 @@ - - + + - - - + + + - - - - + + + + - - + + - - + + - - - + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - + + - - - + + + @@ -124320,57 +127964,57 @@ - - - + + + - - - + + + - - - + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + @@ -125212,13 +128856,13 @@ - - - + + + - - + + @@ -125287,8 +128931,8 @@ - - + + @@ -125335,9 +128979,9 @@ - - - + + + @@ -125385,8 +129029,8 @@ - - + + @@ -125455,13 +129099,13 @@ - + - - - - + + + + @@ -125494,22 +129138,22 @@ - - - - + + + + - - - - - - - - - - + + + + + + + + + + @@ -125541,8 +129185,8 @@ - - + + @@ -125578,9 +129222,9 @@ - - - + + + diff --git a/android/abi_gki_aarch64_db845c b/android/abi_gki_aarch64_db845c index 69be1905a229..ec944e48a1b9 100644 --- a/android/abi_gki_aarch64_db845c +++ b/android/abi_gki_aarch64_db845c @@ -54,7 +54,6 @@ cpumask_next cpu_number __cpu_online_mask - crc32_le debugfs_create_dir debugfs_create_file debugfs_create_u32 @@ -185,7 +184,6 @@ free_irq generic_handle_irq get_device - get_random_bytes gic_nonsecure_priorities gpiochip_add_data_with_key gpiochip_add_pin_range @@ -419,7 +417,6 @@ preempt_schedule_notrace prepare_to_wait_event printk - pskb_expand_head put_device __put_task_struct qcom_smem_state_register @@ -505,7 +502,6 @@ simple_read_from_buffer single_open single_release - skb_clone skb_dequeue skb_pull skb_push @@ -553,6 +549,7 @@ strlen strncmp strncpy + strnlen strpbrk strsep __sw_hweight32 @@ -655,9 +652,11 @@ cfg80211_vendor_cmd_reply cpu_latency_qos_add_request cpu_latency_qos_remove_request + crc32_le device_get_mac_address device_set_wakeup_enable firmware_request_nowarn + get_random_bytes guid_gen idr_for_each ieee80211_alloc_hw_nm @@ -710,11 +709,13 @@ init_uts_ns __kfifo_alloc __kfifo_free + ktime_get_with_offset __local_bh_enable_ip memmove __nla_parse nla_put param_ops_ulong + pskb_expand_head regulatory_hint rfc1042_header skb_copy @@ -751,44 +752,6 @@ devm_clk_bulk_get_optional iommu_map -# required by ax88179_178a.ko - eth_platform_get_mac_address - ethtool_op_get_link - ethtool_op_get_ts_info - eth_validate_addr - generic_mii_ioctl - mii_ethtool_get_link_ksettings - mii_ethtool_gset - mii_ethtool_set_link_ksettings - mii_nway_restart - netdev_err - netdev_info - netdev_warn - netif_carrier_on - usb_deregister - usbnet_disconnect - usbnet_get_endpoints - usbnet_get_msglevel - usbnet_get_stats64 - usbnet_link_change - usbnet_nway_reset - usbnet_open - usbnet_probe - usbnet_read_cmd - usbnet_read_cmd_nopm - usbnet_resume - usbnet_set_msglevel - usbnet_skb_return - usbnet_start_xmit - usbnet_stop - usbnet_suspend - usbnet_tx_timeout - usbnet_update_max_qlen - usbnet_write_cmd - usbnet_write_cmd_async - usbnet_write_cmd_nopm - usb_register_driver - # required by bam_dma.ko dma_async_device_register dma_async_device_unregister @@ -1303,9 +1266,6 @@ usb_put_hcd usb_remove_hcd -# required by pdr_interface.ko - strnlen - # required by phy-qcom-qmp.ko of_clk_get_by_name __of_reset_control_get @@ -1489,6 +1449,7 @@ refcount_dec_and_mutex_lock release_sock sk_alloc + skb_clone skb_copy_bits skb_copy_datagram_iter skb_free_datagram @@ -1577,7 +1538,9 @@ snd_ctl_add snd_ctl_new1 snd_pcm_add_chmap_ctls - snd_pcm_create_iec958_consumer_hw_params + snd_pcm_create_iec958_consumer_default + snd_pcm_fill_iec958_consumer + snd_pcm_fill_iec958_consumer_hw_params snd_pcm_hw_constraint_eld # required by snd-soc-qcom-common.ko @@ -1701,3 +1664,42 @@ # required by wcd934x.ko mfd_add_devices mfd_remove_devices + +# preserved by --additions-only + eth_platform_get_mac_address + ethtool_op_get_link + ethtool_op_get_ts_info + eth_validate_addr + generic_mii_ioctl + mii_ethtool_get_link_ksettings + mii_ethtool_gset + mii_ethtool_set_link_ksettings + mii_nway_restart + netdev_err + netdev_info + netdev_warn + netif_carrier_on + snd_pcm_create_iec958_consumer_hw_params + usb_deregister + usbnet_disconnect + usbnet_get_endpoints + usbnet_get_msglevel + usbnet_get_stats64 + usbnet_link_change + usbnet_nway_reset + usbnet_open + usbnet_probe + usbnet_read_cmd + usbnet_read_cmd_nopm + usbnet_resume + usbnet_set_msglevel + usbnet_skb_return + usbnet_start_xmit + usbnet_stop + usbnet_suspend + usbnet_tx_timeout + usbnet_update_max_qlen + usbnet_write_cmd + usbnet_write_cmd_async + usbnet_write_cmd_nopm + usb_register_driver diff --git a/android/abi_gki_aarch64_generic b/android/abi_gki_aarch64_generic index ed5a0a57b1bc..a7069c587ab7 100644 --- a/android/abi_gki_aarch64_generic +++ b/android/abi_gki_aarch64_generic @@ -78,6 +78,7 @@ __bitmap_set bitmap_to_arr32 __bitmap_weight + __bitmap_xor blk_abort_request blk_alloc_queue blk_check_plugged @@ -332,6 +333,7 @@ crypto_register_notifier crypto_register_scomp crypto_register_shash + crypto_req_done crypto_shash_digest crypto_shash_final crypto_shash_finup @@ -374,6 +376,7 @@ desc_to_gpio destroy_workqueue dev_alloc_name + dev_base_lock dev_close _dev_crit dev_driver_string @@ -442,11 +445,13 @@ devm_extcon_dev_allocate devm_extcon_dev_register devm_free_irq + devm_fwnode_gpiod_get_index devm_fwnode_pwm_get devm_gen_pool_create devm_gpiochip_add_data_with_key devm_gpiod_get devm_gpiod_get_array + devm_gpiod_get_array_optional devm_gpiod_get_optional devm_gpiod_put_array devm_gpio_free @@ -624,6 +629,7 @@ drm_add_modes_noedid drm_atomic_add_affected_connectors drm_atomic_add_affected_planes + drm_atomic_bridge_chain_disable drm_atomic_commit drm_atomic_get_connector_state drm_atomic_get_crtc_state @@ -749,6 +755,7 @@ drm_mode_object_find drm_mode_object_get drm_mode_object_put + drm_mode_parse_command_line_for_connector drm_mode_probed_add drm_modeset_acquire_fini drm_modeset_acquire_init @@ -959,6 +966,7 @@ gpiod_get_raw_value_cansleep gpiod_get_value gpiod_get_value_cansleep + gpiod_set_debounce gpiod_set_raw_value gpiod_set_raw_value_cansleep gpiod_set_value @@ -1047,6 +1055,7 @@ __init_swait_queue_head init_task init_timer_key + init_user_ns init_wait_entry __init_waitqueue_head input_alloc_absinfo @@ -1088,6 +1097,7 @@ iommu_device_sysfs_remove iommu_device_unlink iommu_device_unregister + iommu_dma_enable_best_fit_algo iommu_domain_alloc iommu_domain_free iommu_fwspec_add_ids @@ -1191,6 +1201,7 @@ kobject_init kobject_init_and_add kobject_put + kobject_rename kobject_uevent kobject_uevent_env kobj_sysfs_ops @@ -1351,6 +1362,8 @@ netlink_kernel_release netlink_unicast net_ratelimit + nf_register_net_hooks + nf_unregister_net_hooks nla_append nla_memcpy __nla_parse @@ -1366,6 +1379,7 @@ nr_cpu_ids nr_irqs ns_capable + ns_capable_noaudit nsec_to_clock_t ns_to_timespec64 __num_online_cpus @@ -1765,6 +1779,7 @@ regulator_notifier_call_chain regulator_put regulator_register + regulator_set_active_discharge_regmap regulator_set_load regulator_set_voltage regulator_set_voltage_sel_regmap @@ -2229,6 +2244,7 @@ __traceiter_android_vh_cpu_idle_exit __traceiter_android_vh_dump_throttled_rt_tasks __traceiter_android_vh_dup_task_struct + __traceiter_android_vh_early_resume_begin __traceiter_android_vh_enable_thermal_genl_check __traceiter_android_vh_ep_create_wakeup_source __traceiter_android_vh_get_user_pages @@ -2241,6 +2257,7 @@ __traceiter_android_vh_of_i2c_get_board_info __traceiter_android_vh_pagecache_get_page __traceiter_android_vh_pin_user_pages + __traceiter_android_vh_resume_end __traceiter_android_vh_rmqueue __traceiter_android_vh_sched_setaffinity_early __traceiter_android_vh_scheduler_tick @@ -2252,6 +2269,7 @@ __traceiter_android_vh_thermal_pm_notify_suspend __traceiter_android_vh_timerfd_create __traceiter_android_vh_try_grab_compound_head + __traceiter_android_vh_try_to_freeze_todo_logging __traceiter_android_vh_typec_store_partner_src_caps __traceiter_android_vh_typec_tcpci_override_toggling __traceiter_android_vh_typec_tcpm_get_timer @@ -2342,6 +2360,7 @@ __tracepoint_android_vh_cpu_idle_exit __tracepoint_android_vh_dump_throttled_rt_tasks __tracepoint_android_vh_dup_task_struct + __tracepoint_android_vh_early_resume_begin __tracepoint_android_vh_enable_thermal_genl_check __tracepoint_android_vh_ep_create_wakeup_source __tracepoint_android_vh_get_user_pages @@ -2354,6 +2373,7 @@ __tracepoint_android_vh_of_i2c_get_board_info __tracepoint_android_vh_pagecache_get_page __tracepoint_android_vh_pin_user_pages + __tracepoint_android_vh_resume_end __tracepoint_android_vh_rmqueue __tracepoint_android_vh_sched_setaffinity_early __tracepoint_android_vh_scheduler_tick @@ -2365,6 +2385,7 @@ __tracepoint_android_vh_thermal_pm_notify_suspend __tracepoint_android_vh_timerfd_create __tracepoint_android_vh_try_grab_compound_head + __tracepoint_android_vh_try_to_freeze_todo_logging __tracepoint_android_vh_typec_store_partner_src_caps __tracepoint_android_vh_typec_tcpci_override_toggling __tracepoint_android_vh_typec_tcpm_get_timer @@ -2656,6 +2677,7 @@ xa_find xa_find_after xa_get_mark + __xa_insert xa_load xa_set_mark xa_store diff --git a/android/abi_gki_aarch64_type_visibility b/android/abi_gki_aarch64_type_visibility new file mode 100644 index 000000000000..8a98e59ea81b --- /dev/null +++ b/android/abi_gki_aarch64_type_visibility @@ -0,0 +1,5 @@ +[abi_symbol_list] + +# for type visibility + GKI_struct_blk_mq_alloc_data + GKI_struct_cgroup_taskset diff --git a/arch/arm/OWNERS b/arch/arm/OWNERS deleted file mode 100644 index 1e390c75956e..000000000000 --- a/arch/arm/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# include OWNERS from the authoritative android-mainline branch -include kernel/common:android-mainline:/arch/arm/OWNERS diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 175213d7a1aa..37c3036cd468 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile @@ -76,10 +76,10 @@ CPPFLAGS_vmlinux.lds += -DTEXT_OFFSET="$(TEXT_OFFSET)" CPPFLAGS_vmlinux.lds += -DMALLOC_SIZE="$(MALLOC_SIZE)" compress-$(CONFIG_KERNEL_GZIP) = gzip -compress-$(CONFIG_KERNEL_LZO) = lzo -compress-$(CONFIG_KERNEL_LZMA) = lzma -compress-$(CONFIG_KERNEL_XZ) = xzkern -compress-$(CONFIG_KERNEL_LZ4) = lz4 +compress-$(CONFIG_KERNEL_LZO) = lzo_with_size +compress-$(CONFIG_KERNEL_LZMA) = lzma_with_size +compress-$(CONFIG_KERNEL_XZ) = xzkern_with_size +compress-$(CONFIG_KERNEL_LZ4) = lz4_with_size libfdt_objs := fdt_rw.o fdt_ro.o fdt_wip.o fdt.o diff --git a/arch/arm64/OWNERS b/arch/arm64/OWNERS deleted file mode 100644 index 257f4cf26809..000000000000 --- a/arch/arm64/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# include OWNERS from the authoritative android-mainline branch -include kernel/common:android-mainline:/arch/arm64/OWNERS diff --git a/arch/arm64/include/asm/kvm_pkvm.h b/arch/arm64/include/asm/kvm_pkvm.h index 89895ed9c591..766811f71a48 100644 --- a/arch/arm64/include/asm/kvm_pkvm.h +++ b/arch/arm64/include/asm/kvm_pkvm.h @@ -327,10 +327,27 @@ static inline unsigned long host_s2_pgtable_pages(void) #define KVM_FFA_MBOX_NR_PAGES 1 +/* + * Maximum number of consitutents allowed in a descriptor. This number is + * arbitrary, see comment below on SG_MAX_SEGMENTS in hyp_ffa_proxy_pages(). + */ +#define KVM_FFA_MAX_NR_CONSTITUENTS 4096 + static inline unsigned long hyp_ffa_proxy_pages(void) { size_t desc_max; + /* + * SG_MAX_SEGMENTS is supposed to bound the number of elements in an + * sglist, which should match the number of consituents in the + * corresponding FFA descriptor. As such, the EL2 buffer needs to be + * large enough to hold a descriptor with SG_MAX_SEGMENTS consituents + * at least. But the kernel's DMA code doesn't enforce the limit, and + * it is sometimes abused, so let's allow larger descriptors and hope + * for the best. + */ + BUILD_BUG_ON(KVM_FFA_MAX_NR_CONSTITUENTS < SG_MAX_SEGMENTS); + /* * The hypervisor FFA proxy needs enough memory to buffer a fragmented * descriptor returned from EL3 in response to a RETRIEVE_REQ call. @@ -338,7 +355,7 @@ static inline unsigned long hyp_ffa_proxy_pages(void) desc_max = sizeof(struct ffa_mem_region) + sizeof(struct ffa_mem_region_attributes) + sizeof(struct ffa_composite_mem_region) + - SG_MAX_SEGMENTS * sizeof(struct ffa_mem_region_addr_range); + KVM_FFA_MAX_NR_CONSTITUENTS * sizeof(struct ffa_mem_region_addr_range); /* Plus a page each for the hypervisor's RX and TX mailboxes. */ return (2 * KVM_FFA_MBOX_NR_PAGES) + DIV_ROUND_UP(desc_max, PAGE_SIZE); diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h index ef43f8ec3236..c6a5b1a3ee51 100644 --- a/arch/arm64/include/asm/processor.h +++ b/arch/arm64/include/asm/processor.h @@ -149,6 +149,11 @@ struct thread_struct { struct user_fpsimd_state fpsimd_state; } uw; + /* + * Unused now that commit 74555f39924d ("ANDROID: vendor_hooks: FPSIMD + * save/restore by using vendor_hooks") is reverted, but remains to + * preserve the ABI in the android13-5.10 branch. + */ ANDROID_VENDOR_DATA(1); unsigned int fpsimd_cpu; diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c index cdb3d4549b3a..e41cee4e1bb9 100644 --- a/arch/arm64/kernel/perf_event.c +++ b/arch/arm64/kernel/perf_event.c @@ -1116,17 +1116,32 @@ static int armv8_pmu_init_nogroups(struct arm_pmu *cpu_pmu, char *name, return armv8_pmu_init(cpu_pmu, name, map_event, NULL, NULL, NULL); } -static int armv8_pmuv3_init(struct arm_pmu *cpu_pmu) -{ - return armv8_pmu_init_nogroups(cpu_pmu, "armv8_pmuv3", - armv8_pmuv3_map_event); +#define PMUV3_INIT_SIMPLE(name) \ +static int name##_pmu_init(struct arm_pmu *cpu_pmu) \ +{ \ + return armv8_pmu_init_nogroups(cpu_pmu, #name, armv8_pmuv3_map_event);\ } -static int armv8_a34_pmu_init(struct arm_pmu *cpu_pmu) -{ - return armv8_pmu_init_nogroups(cpu_pmu, "armv8_cortex_a34", - armv8_pmuv3_map_event); -} +PMUV3_INIT_SIMPLE(armv8_pmuv3) + +PMUV3_INIT_SIMPLE(armv8_cortex_a34) +PMUV3_INIT_SIMPLE(armv8_cortex_a55) +PMUV3_INIT_SIMPLE(armv8_cortex_a65) +PMUV3_INIT_SIMPLE(armv8_cortex_a75) +PMUV3_INIT_SIMPLE(armv8_cortex_a76) +PMUV3_INIT_SIMPLE(armv8_cortex_a77) +PMUV3_INIT_SIMPLE(armv8_cortex_a78) +PMUV3_INIT_SIMPLE(armv9_cortex_a510) +PMUV3_INIT_SIMPLE(armv9_cortex_a710) +PMUV3_INIT_SIMPLE(armv8_cortex_x1) +PMUV3_INIT_SIMPLE(armv9_cortex_x2) +PMUV3_INIT_SIMPLE(armv8_neoverse_e1) +PMUV3_INIT_SIMPLE(armv8_neoverse_n1) +PMUV3_INIT_SIMPLE(armv9_neoverse_n2) +PMUV3_INIT_SIMPLE(armv8_neoverse_v1) + +PMUV3_INIT_SIMPLE(armv8_nvidia_carmel) +PMUV3_INIT_SIMPLE(armv8_nvidia_denver) static int armv8_a35_pmu_init(struct arm_pmu *cpu_pmu) { @@ -1140,24 +1155,12 @@ static int armv8_a53_pmu_init(struct arm_pmu *cpu_pmu) armv8_a53_map_event); } -static int armv8_a55_pmu_init(struct arm_pmu *cpu_pmu) -{ - return armv8_pmu_init_nogroups(cpu_pmu, "armv8_cortex_a55", - armv8_pmuv3_map_event); -} - static int armv8_a57_pmu_init(struct arm_pmu *cpu_pmu) { return armv8_pmu_init_nogroups(cpu_pmu, "armv8_cortex_a57", armv8_a57_map_event); } -static int armv8_a65_pmu_init(struct arm_pmu *cpu_pmu) -{ - return armv8_pmu_init_nogroups(cpu_pmu, "armv8_cortex_a65", - armv8_pmuv3_map_event); -} - static int armv8_a72_pmu_init(struct arm_pmu *cpu_pmu) { return armv8_pmu_init_nogroups(cpu_pmu, "armv8_cortex_a72", @@ -1170,36 +1173,6 @@ static int armv8_a73_pmu_init(struct arm_pmu *cpu_pmu) armv8_a73_map_event); } -static int armv8_a75_pmu_init(struct arm_pmu *cpu_pmu) -{ - return armv8_pmu_init_nogroups(cpu_pmu, "armv8_cortex_a75", - armv8_pmuv3_map_event); -} - -static int armv8_a76_pmu_init(struct arm_pmu *cpu_pmu) -{ - return armv8_pmu_init_nogroups(cpu_pmu, "armv8_cortex_a76", - armv8_pmuv3_map_event); -} - -static int armv8_a77_pmu_init(struct arm_pmu *cpu_pmu) -{ - return armv8_pmu_init_nogroups(cpu_pmu, "armv8_cortex_a77", - armv8_pmuv3_map_event); -} - -static int armv8_e1_pmu_init(struct arm_pmu *cpu_pmu) -{ - return armv8_pmu_init_nogroups(cpu_pmu, "armv8_neoverse_e1", - armv8_pmuv3_map_event); -} - -static int armv8_n1_pmu_init(struct arm_pmu *cpu_pmu) -{ - return armv8_pmu_init_nogroups(cpu_pmu, "armv8_neoverse_n1", - armv8_pmuv3_map_event); -} - static int armv8_thunder_pmu_init(struct arm_pmu *cpu_pmu) { return armv8_pmu_init_nogroups(cpu_pmu, "armv8_cavium_thunder", @@ -1213,22 +1186,31 @@ static int armv8_vulcan_pmu_init(struct arm_pmu *cpu_pmu) } static const struct of_device_id armv8_pmu_of_device_ids[] = { - {.compatible = "arm,armv8-pmuv3", .data = armv8_pmuv3_init}, - {.compatible = "arm,cortex-a34-pmu", .data = armv8_a34_pmu_init}, + {.compatible = "arm,armv8-pmuv3", .data = armv8_pmuv3_pmu_init}, + {.compatible = "arm,cortex-a34-pmu", .data = armv8_cortex_a34_pmu_init}, {.compatible = "arm,cortex-a35-pmu", .data = armv8_a35_pmu_init}, {.compatible = "arm,cortex-a53-pmu", .data = armv8_a53_pmu_init}, - {.compatible = "arm,cortex-a55-pmu", .data = armv8_a55_pmu_init}, + {.compatible = "arm,cortex-a55-pmu", .data = armv8_cortex_a55_pmu_init}, {.compatible = "arm,cortex-a57-pmu", .data = armv8_a57_pmu_init}, - {.compatible = "arm,cortex-a65-pmu", .data = armv8_a65_pmu_init}, + {.compatible = "arm,cortex-a65-pmu", .data = armv8_cortex_a65_pmu_init}, {.compatible = "arm,cortex-a72-pmu", .data = armv8_a72_pmu_init}, {.compatible = "arm,cortex-a73-pmu", .data = armv8_a73_pmu_init}, - {.compatible = "arm,cortex-a75-pmu", .data = armv8_a75_pmu_init}, - {.compatible = "arm,cortex-a76-pmu", .data = armv8_a76_pmu_init}, - {.compatible = "arm,cortex-a77-pmu", .data = armv8_a77_pmu_init}, - {.compatible = "arm,neoverse-e1-pmu", .data = armv8_e1_pmu_init}, - {.compatible = "arm,neoverse-n1-pmu", .data = armv8_n1_pmu_init}, + {.compatible = "arm,cortex-a75-pmu", .data = armv8_cortex_a75_pmu_init}, + {.compatible = "arm,cortex-a76-pmu", .data = armv8_cortex_a76_pmu_init}, + {.compatible = "arm,cortex-a77-pmu", .data = armv8_cortex_a77_pmu_init}, + {.compatible = "arm,cortex-a78-pmu", .data = armv8_cortex_a78_pmu_init}, + {.compatible = "arm,cortex-a510-pmu", .data = armv9_cortex_a510_pmu_init}, + {.compatible = "arm,cortex-a710-pmu", .data = armv9_cortex_a710_pmu_init}, + {.compatible = "arm,cortex-x1-pmu", .data = armv8_cortex_x1_pmu_init}, + {.compatible = "arm,cortex-x2-pmu", .data = armv9_cortex_x2_pmu_init}, + {.compatible = "arm,neoverse-e1-pmu", .data = armv8_neoverse_e1_pmu_init}, + {.compatible = "arm,neoverse-n1-pmu", .data = armv8_neoverse_n1_pmu_init}, + {.compatible = "arm,neoverse-n2-pmu", .data = armv9_neoverse_n2_pmu_init}, + {.compatible = "arm,neoverse-v1-pmu", .data = armv8_neoverse_v1_pmu_init}, {.compatible = "cavium,thunder-pmu", .data = armv8_thunder_pmu_init}, {.compatible = "brcm,vulcan-pmu", .data = armv8_vulcan_pmu_init}, + {.compatible = "nvidia,carmel-pmu", .data = armv8_nvidia_carmel_pmu_init}, + {.compatible = "nvidia,denver-pmu", .data = armv8_nvidia_denver_pmu_init}, {}, }; @@ -1251,7 +1233,7 @@ static int __init armv8_pmu_driver_init(void) if (acpi_disabled) return platform_driver_register(&armv8_pmu_driver); else - return arm_pmu_acpi_probe(armv8_pmuv3_init); + return arm_pmu_acpi_probe(armv8_pmuv3_pmu_init); } device_initcall(armv8_pmu_driver_init) diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index 00bff856d496..d98512af85f1 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -44,7 +44,6 @@ #include #include #include -#include #include #include @@ -588,8 +587,6 @@ __notrace_funcgraph struct task_struct *__switch_to(struct task_struct *prev, if (prev->thread.sctlr_user != next->thread.sctlr_user) update_sctlr_el1(next->thread.sctlr_user); - trace_android_vh_is_fpsimd_save(prev, next); - /* the actual thread switch */ last = cpu_switch_to(prev, next); diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index fd9c0ce1b645..da66f6ac590b 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -915,7 +915,7 @@ static void do_handle_IPI(int ipinr) break; case IPI_CPU_STOP: - trace_android_vh_ipi_stop_rcuidle(get_irq_regs()); + trace_android_vh_ipi_stop(get_irq_regs()); local_cpu_stop(); break; diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index 86cbee644a39..8e22c300752c 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -2286,6 +2286,16 @@ static int __init early_kvm_mode_cfg(char *arg) if (!arg) return -EINVAL; + if (strcmp(arg, "none") == 0) { + kvm_mode = KVM_MODE_NONE; + return 0; + } + + if (!is_hyp_mode_available()) { + pr_warn_once("KVM is not available. Ignoring kvm-arm.mode\n"); + return 0; + } + if (strcmp(arg, "protected") == 0) { if (!is_kernel_in_hyp_mode()) kvm_mode = KVM_MODE_PROTECTED; @@ -2300,11 +2310,6 @@ static int __init early_kvm_mode_cfg(char *arg) return 0; } - if (strcmp(arg, "none") == 0) { - kvm_mode = KVM_MODE_NONE; - return 0; - } - return -EINVAL; } early_param("kvm-arm.mode", early_kvm_mode_cfg); diff --git a/arch/arm64/kvm/hyp/nvhe/pkvm.c b/arch/arm64/kvm/hyp/nvhe/pkvm.c index d97988b941ae..50717a46e735 100644 --- a/arch/arm64/kvm/hyp/nvhe/pkvm.c +++ b/arch/arm64/kvm/hyp/nvhe/pkvm.c @@ -414,6 +414,15 @@ static int set_host_vcpus(struct shadow_vcpu_state *shadow_vcpus, int nr_vcpus, return 0; } +static int init_ptrauth(struct kvm_vcpu *shadow_vcpu) +{ + int ret = 0; + if (test_bit(KVM_ARM_VCPU_PTRAUTH_ADDRESS, shadow_vcpu->arch.features) || + test_bit(KVM_ARM_VCPU_PTRAUTH_GENERIC, shadow_vcpu->arch.features)) + ret = kvm_vcpu_enable_ptrauth(shadow_vcpu); + return ret; +} + static int init_shadow_structs(struct kvm *kvm, struct kvm_shadow_vm *vm, struct kvm_vcpu **vcpu_array, int nr_vcpus) { @@ -438,6 +447,10 @@ static int init_shadow_structs(struct kvm *kvm, struct kvm_shadow_vm *vm, if (ret) return ret; + ret = init_ptrauth(shadow_vcpu); + if (ret) + return ret; + if (test_bit(KVM_ARM_VCPU_SVE, shadow_vcpu->arch.features)) { size_t sve_state_size; void *sve_state; @@ -600,6 +613,25 @@ static int check_shadow_size(int nr_vcpus, size_t shadow_size) return 0; } +static void drain_shadow_vcpus(struct shadow_vcpu_state *shadow_vcpus, + unsigned int nr_vcpus, + struct kvm_hyp_memcache *mc) +{ + int i; + + for (i = 0; i < nr_vcpus; i++) { + struct kvm_vcpu *shadow_vcpu = &shadow_vcpus[i].vcpu; + struct kvm_hyp_memcache *vcpu_mc = &shadow_vcpu->arch.pkvm_memcache; + void *addr; + + while (vcpu_mc->nr_pages) { + addr = pop_hyp_memcache(vcpu_mc, hyp_phys_to_virt); + push_hyp_memcache(mc, addr, hyp_virt_to_phys); + WARN_ON(__pkvm_hyp_donate_host(hyp_virt_to_pfn(addr), 1)); + } + } +} + /* * Initialize the shadow copy of the protected VM state using the memory * donated by the host. @@ -753,6 +785,7 @@ int __pkvm_teardown_shadow(int shadow_handle) /* Reclaim guest pages, and page-table pages */ mc = &vm->host_kvm->arch.pkvm.teardown_mc; reclaim_guest_pages(vm, mc); + drain_shadow_vcpus(vm->shadow_vcpus, vm->created_vcpus, mc); unpin_host_vcpus(vm->shadow_vcpus, vm->created_vcpus); /* Push the metadata pages to the teardown memcache */ @@ -831,14 +864,7 @@ void pkvm_reset_vcpu(struct kvm_vcpu *vcpu) WARN_ON(!reset_state->reset); - if (test_bit(KVM_ARM_VCPU_PTRAUTH_ADDRESS, vcpu->arch.features) || - test_bit(KVM_ARM_VCPU_PTRAUTH_GENERIC, vcpu->arch.features)) { - /* - * This call should not fail since we've already checked for - * feature support on initialization. - */ - WARN_ON(kvm_vcpu_enable_ptrauth(vcpu)); - } + init_ptrauth(vcpu); /* Reset core registers */ memset(vcpu_gp_regs(vcpu), 0, sizeof(*vcpu_gp_regs(vcpu))); diff --git a/arch/h8300/boot/compressed/Makefile b/arch/h8300/boot/compressed/Makefile index 5942793f77a0..6ab2fa5ba105 100644 --- a/arch/h8300/boot/compressed/Makefile +++ b/arch/h8300/boot/compressed/Makefile @@ -30,9 +30,11 @@ $(obj)/vmlinux.bin: vmlinux FORCE suffix-$(CONFIG_KERNEL_GZIP) := gzip suffix-$(CONFIG_KERNEL_LZO) := lzo +compress-$(CONFIG_KERNEL_GZIP) := gzip +compress-$(CONFIG_KERNEL_LZO) := lzo_with_size $(obj)/vmlinux.bin.$(suffix-y): $(obj)/vmlinux.bin FORCE - $(call if_changed,$(suffix-y)) + $(call if_changed,$(compress-y)) LDFLAGS_piggy.o := -r --format binary --oformat elf32-h8300-linux -T OBJCOPYFLAGS := -O binary diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile index eae0fad30f27..69eda7ab110a 100644 --- a/arch/mips/boot/compressed/Makefile +++ b/arch/mips/boot/compressed/Makefile @@ -71,12 +71,12 @@ $(obj)/vmlinux.bin: $(KBUILD_IMAGE) FORCE $(call if_changed,objcopy) tool_$(CONFIG_KERNEL_GZIP) = gzip -tool_$(CONFIG_KERNEL_BZIP2) = bzip2 -tool_$(CONFIG_KERNEL_LZ4) = lz4 -tool_$(CONFIG_KERNEL_LZMA) = lzma -tool_$(CONFIG_KERNEL_LZO) = lzo -tool_$(CONFIG_KERNEL_XZ) = xzkern -tool_$(CONFIG_KERNEL_ZSTD) = zstd22 +tool_$(CONFIG_KERNEL_BZIP2) = bzip2_with_size +tool_$(CONFIG_KERNEL_LZ4) = lz4_with_size +tool_$(CONFIG_KERNEL_LZMA) = lzma_with_size +tool_$(CONFIG_KERNEL_LZO) = lzo_with_size +tool_$(CONFIG_KERNEL_XZ) = xzkern_with_size +tool_$(CONFIG_KERNEL_ZSTD) = zstd22_with_size targets += vmlinux.bin.z $(obj)/vmlinux.bin.z: $(obj)/vmlinux.bin FORCE diff --git a/arch/parisc/boot/compressed/Makefile b/arch/parisc/boot/compressed/Makefile index dff453687530..c09300a6ba98 100644 --- a/arch/parisc/boot/compressed/Makefile +++ b/arch/parisc/boot/compressed/Makefile @@ -73,15 +73,15 @@ suffix-$(CONFIG_KERNEL_XZ) := xz $(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) $(call if_changed,gzip) $(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) - $(call if_changed,bzip2) + $(call if_changed,bzip2_with_size) $(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y) - $(call if_changed,lz4) + $(call if_changed,lz4_with_size) $(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) - $(call if_changed,lzma) + $(call if_changed,lzma_with_size) $(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) - $(call if_changed,lzo) + $(call if_changed,lzo_with_size) $(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) - $(call if_changed,xzkern) + $(call if_changed,xzkern_with_size) LDFLAGS_piggy.o := -r --format binary --oformat $(LD_BFD) -T $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) diff --git a/arch/s390/boot/compressed/Makefile b/arch/s390/boot/compressed/Makefile index b235ed95a3d8..0e4b585885f0 100644 --- a/arch/s390/boot/compressed/Makefile +++ b/arch/s390/boot/compressed/Makefile @@ -49,15 +49,15 @@ suffix-$(CONFIG_KERNEL_XZ) := .xz $(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE $(call if_changed,gzip) $(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE - $(call if_changed,bzip2) + $(call if_changed,bzip2_with_size) $(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y) FORCE - $(call if_changed,lz4) + $(call if_changed,lz4_with_size) $(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE - $(call if_changed,lzma) + $(call if_changed,lzma_with_size) $(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE - $(call if_changed,lzo) + $(call if_changed,lzo_with_size) $(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) FORCE - $(call if_changed,xzkern) + $(call if_changed,xzkern_with_size) OBJCOPYFLAGS_piggy.o := -I binary -O elf64-s390 -B s390:64-bit --rename-section .data=.vmlinux.bin.compressed $(obj)/piggy.o: $(obj)/vmlinux.bin$(suffix-y) FORCE diff --git a/arch/sh/boot/compressed/Makefile b/arch/sh/boot/compressed/Makefile index 589d2d8a573d..0525d8abdf45 100644 --- a/arch/sh/boot/compressed/Makefile +++ b/arch/sh/boot/compressed/Makefile @@ -58,13 +58,13 @@ vmlinux.bin.all-y := $(obj)/vmlinux.bin $(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE $(call if_changed,gzip) $(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE - $(call if_changed,bzip2) + $(call if_changed,bzip2_with_size) $(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE - $(call if_changed,lzma) + $(call if_changed,lzma_with_size) $(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) FORCE - $(call if_changed,xzkern) + $(call if_changed,xzkern_with_size) $(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE - $(call if_changed,lzo) + $(call if_changed,lzo_with_size) OBJCOPYFLAGS += -R .empty_zero_page diff --git a/arch/x86/OWNERS b/arch/x86/OWNERS deleted file mode 100644 index ae2c29f6c3b7..000000000000 --- a/arch/x86/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# include OWNERS from the authoritative android-mainline branch -include kernel/common:android-mainline:/arch/x86/OWNERS diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile index ad268a15bc7b..9911512c9196 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile @@ -127,17 +127,17 @@ vmlinux.bin.all-$(CONFIG_X86_NEED_RELOCS) += $(obj)/vmlinux.relocs $(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE $(call if_changed,gzip) $(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE - $(call if_changed,bzip2) + $(call if_changed,bzip2_with_size) $(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE - $(call if_changed,lzma) + $(call if_changed,lzma_with_size) $(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) FORCE - $(call if_changed,xzkern) + $(call if_changed,xzkern_with_size) $(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE - $(call if_changed,lzo) + $(call if_changed,lzo_with_size) $(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y) FORCE - $(call if_changed,lz4) + $(call if_changed,lz4_with_size) $(obj)/vmlinux.bin.zst: $(vmlinux.bin.all-y) FORCE - $(call if_changed,zstd22) + $(call if_changed,zstd22_with_size) suffix-$(CONFIG_KERNEL_GZIP) := gz suffix-$(CONFIG_KERNEL_BZIP2) := bz2 diff --git a/block/Makefile b/block/Makefile index af3d044abaf1..05daaf8282a1 100644 --- a/block/Makefile +++ b/block/Makefile @@ -39,3 +39,4 @@ obj-$(CONFIG_BLK_SED_OPAL) += sed-opal.o obj-$(CONFIG_BLK_PM) += blk-pm.o obj-$(CONFIG_BLK_INLINE_ENCRYPTION) += keyslot-manager.o blk-crypto.o obj-$(CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK) += blk-crypto-fallback.o +obj-$(CONFIG_ANDROID_VENDOR_HOOKS) += vendor_hooks.o diff --git a/block/OWNERS b/block/OWNERS deleted file mode 100644 index 7786d734d5c6..000000000000 --- a/block/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# include OWNERS from the authoritative android-mainline branch -include kernel/common:android-mainline:/block/OWNERS diff --git a/block/vendor_hooks.c b/block/vendor_hooks.c new file mode 100644 index 000000000000..db033b9e2835 --- /dev/null +++ b/block/vendor_hooks.c @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* vendor_hook.c + * + * Copyright 2022 Google LLC + */ +#include "blk.h" +#include "blk-mq-tag.h" +#include "blk-mq.h" +#include + +#define CREATE_TRACE_POINTS +#include +#include +#include + +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_blk_alloc_rqs); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_blk_rq_ctx_init); + +/* + * For type visibility + */ +const struct blk_mq_alloc_data *GKI_struct_blk_mq_alloc_data; +EXPORT_SYMBOL_GPL(GKI_struct_blk_mq_alloc_data); + diff --git a/build.config.gki.aarch64 b/build.config.gki.aarch64 index 479bed504395..dde70d69dd33 100644 --- a/build.config.gki.aarch64 +++ b/build.config.gki.aarch64 @@ -7,11 +7,11 @@ Image.lz4 Image.gz " +# Sync with BUILD.bazel ABI_DEFINITION=android/abi_gki_aarch64.xml -# Update BUILD.bazel, define_common_kernels() if the list differs from -# android/abi_gki_aarch64* in the filesystem. KMI_SYMBOL_LIST=android/abi_gki_aarch64 ADDITIONAL_KMI_SYMBOL_LISTS=" +android/abi_gki_aarch64_type_visibility android/abi_gki_aarch64_core android/abi_gki_aarch64_fips140 android/abi_gki_aarch64_generic diff --git a/build.config.gki.x86_64 b/build.config.gki.x86_64 index 7ecd1dfe7dcb..3d81fea6aacb 100644 --- a/build.config.gki.x86_64 +++ b/build.config.gki.x86_64 @@ -5,5 +5,7 @@ BUILD_SYSTEM_DLKM=1 MODULES_LIST=${ROOT_DIR}/${KERNEL_DIR}/android/gki_system_dlkm_modules +BUILD_GKI_CERTIFICATION_TOOLS=1 + BUILD_GKI_ARTIFACTS=1 BUILD_GKI_BOOT_IMG_SIZE=67108864 diff --git a/crypto/OWNERS b/crypto/OWNERS deleted file mode 100644 index f74b7ed228f7..000000000000 --- a/crypto/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# include OWNERS from the authoritative android-mainline branch -include kernel/common:android-mainline:/crypto/OWNERS diff --git a/drivers/OWNERS b/drivers/OWNERS deleted file mode 100644 index 22c7eece228f..000000000000 --- a/drivers/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# include OWNERS from the authoritative android-mainline branch -include kernel/common:android-mainline:/drivers/OWNERS diff --git a/drivers/android/binder.c b/drivers/android/binder.c index 03e4c2de87d0..07330027e6c5 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -173,8 +173,32 @@ static inline void binder_stats_created(enum binder_stat_types type) atomic_inc(&binder_stats.obj_created[type]); } -struct binder_transaction_log binder_transaction_log; -struct binder_transaction_log binder_transaction_log_failed; +struct binder_transaction_log_entry { + int debug_id; + int debug_id_done; + int call_type; + int from_proc; + int from_thread; + int target_handle; + int to_proc; + int to_thread; + int to_node; + int data_size; + int offsets_size; + int return_error_line; + uint32_t return_error; + uint32_t return_error_param; + char context_name[BINDERFS_MAX_NAME + 1]; +}; + +struct binder_transaction_log { + atomic_t cur; + bool full; + struct binder_transaction_log_entry entry[32]; +}; + +static struct binder_transaction_log binder_transaction_log; +static struct binder_transaction_log binder_transaction_log_failed; static struct binder_transaction_log_entry *binder_transaction_log_add( struct binder_transaction_log *log) @@ -657,8 +681,13 @@ static void binder_do_set_priority(struct binder_thread *thread, bool has_cap_nice; unsigned int policy = desired->sched_policy; - if (task->policy == policy && task->normal_prio == desired->prio) + if (task->policy == policy && task->normal_prio == desired->prio) { + spin_lock(&thread->prio_lock); + if (thread->prio_state == BINDER_PRIO_PENDING) + thread->prio_state = BINDER_PRIO_SET; + spin_unlock(&thread->prio_lock); return; + } has_cap_nice = has_capability_noaudit(task, CAP_SYS_NICE); @@ -2507,6 +2536,56 @@ static int binder_fixup_parent(struct binder_transaction *t, return 0; } +/** + * binder_can_update_transaction() - Can a txn be superseded by an updated one? + * @t1: the pending async txn in the frozen process + * @t2: the new async txn to supersede the outdated pending one + * + * Return: true if t2 can supersede t1 + * false if t2 can not supersede t1 + */ +static bool binder_can_update_transaction(struct binder_transaction *t1, + struct binder_transaction *t2) +{ + if ((t1->flags & t2->flags & (TF_ONE_WAY | TF_UPDATE_TXN)) != + (TF_ONE_WAY | TF_UPDATE_TXN) || !t1->to_proc || !t2->to_proc) + return false; + if (t1->to_proc->tsk == t2->to_proc->tsk && t1->code == t2->code && + t1->flags == t2->flags && t1->buffer->pid == t2->buffer->pid && + t1->buffer->target_node->ptr == t2->buffer->target_node->ptr && + t1->buffer->target_node->cookie == t2->buffer->target_node->cookie) + return true; + return false; +} + +/** + * binder_find_outdated_transaction_ilocked() - Find the outdated transaction + * @t: new async transaction + * @target_list: list to find outdated transaction + * + * Return: the outdated transaction if found + * NULL if no outdated transacton can be found + * + * Requires the proc->inner_lock to be held. + */ +static struct binder_transaction * +binder_find_outdated_transaction_ilocked(struct binder_transaction *t, + struct list_head *target_list) +{ + struct binder_work *w; + + list_for_each_entry(w, target_list, entry) { + struct binder_transaction *t_queued; + + if (w->type != BINDER_WORK_TRANSACTION) + continue; + t_queued = container_of(w, struct binder_transaction, work); + if (binder_can_update_transaction(t_queued, t)) + return t_queued; + } + return NULL; +} + /** * binder_proc_transaction() - sends a transaction to a process and wakes it up * @t: transaction to send @@ -2532,6 +2611,7 @@ static int binder_proc_transaction(struct binder_transaction *t, struct binder_node *node = t->buffer->target_node; bool oneway = !!(t->flags & TF_ONE_WAY); bool pending_async = false; + struct binder_transaction *t_outdated = NULL; BUG_ON(!node); binder_node_lock(node); @@ -2569,6 +2649,17 @@ static int binder_proc_transaction(struct binder_transaction *t, } else if (!pending_async) { binder_enqueue_work_ilocked(&t->work, &proc->todo); } else { + if ((t->flags & TF_UPDATE_TXN) && proc->is_frozen) { + t_outdated = binder_find_outdated_transaction_ilocked(t, + &node->async_todo); + if (t_outdated) { + binder_debug(BINDER_DEBUG_TRANSACTION, + "txn %d supersedes %d\n", + t->debug_id, t_outdated->debug_id); + list_del_init(&t_outdated->work.entry); + proc->outstanding_txns--; + } + } binder_enqueue_work_ilocked(&t->work, &node->async_todo); } @@ -2579,6 +2670,22 @@ static int binder_proc_transaction(struct binder_transaction *t, binder_inner_proc_unlock(proc); binder_node_unlock(node); + /* + * To reduce potential contention, free the outdated transaction and + * buffer after releasing the locks. + */ + if (t_outdated) { + struct binder_buffer *buffer = t_outdated->buffer; + + t_outdated->buffer = NULL; + buffer->transaction = NULL; + trace_binder_transaction_update_buffer_release(buffer); + binder_transaction_buffer_release(proc, NULL, buffer, 0, 0); + binder_alloc_free_buf(&proc->alloc, buffer); + kfree(t_outdated); + binder_stats_deleted(BINDER_STAT_TRANSACTION); + } + return 0; } @@ -5988,8 +6095,7 @@ static void print_binder_proc_stats(struct seq_file *m, print_binder_stats(m, " ", &proc->stats); } - -int binder_state_show(struct seq_file *m, void *unused) +static int state_show(struct seq_file *m, void *unused) { struct binder_proc *proc; struct binder_node *node; @@ -6028,7 +6134,7 @@ int binder_state_show(struct seq_file *m, void *unused) return 0; } -int binder_stats_show(struct seq_file *m, void *unused) +static int stats_show(struct seq_file *m, void *unused) { struct binder_proc *proc; @@ -6044,7 +6150,7 @@ int binder_stats_show(struct seq_file *m, void *unused) return 0; } -int binder_transactions_show(struct seq_file *m, void *unused) +static int transactions_show(struct seq_file *m, void *unused) { struct binder_proc *proc; @@ -6100,7 +6206,7 @@ static void print_binder_transaction_log_entry(struct seq_file *m, "\n" : " (incomplete)\n"); } -int binder_transaction_log_show(struct seq_file *m, void *unused) +static int transaction_log_show(struct seq_file *m, void *unused) { struct binder_transaction_log *log = m->private; unsigned int log_cur = atomic_read(&log->cur); @@ -6132,6 +6238,45 @@ const struct file_operations binder_fops = { .release = binder_release, }; +DEFINE_SHOW_ATTRIBUTE(state); +DEFINE_SHOW_ATTRIBUTE(stats); +DEFINE_SHOW_ATTRIBUTE(transactions); +DEFINE_SHOW_ATTRIBUTE(transaction_log); + +const struct binder_debugfs_entry binder_debugfs_entries[] = { + { + .name = "state", + .mode = 0444, + .fops = &state_fops, + .data = NULL, + }, + { + .name = "stats", + .mode = 0444, + .fops = &stats_fops, + .data = NULL, + }, + { + .name = "transactions", + .mode = 0444, + .fops = &transactions_fops, + .data = NULL, + }, + { + .name = "transaction_log", + .mode = 0444, + .fops = &transaction_log_fops, + .data = &binder_transaction_log, + }, + { + .name = "failed_transaction_log", + .mode = 0444, + .fops = &transaction_log_fops, + .data = &binder_transaction_log_failed, + }, + {} /* terminator */ +}; + static int __init init_binder_device(const char *name) { int ret; @@ -6177,36 +6322,18 @@ static int __init binder_init(void) atomic_set(&binder_transaction_log_failed.cur, ~0U); binder_debugfs_dir_entry_root = debugfs_create_dir("binder", NULL); - if (binder_debugfs_dir_entry_root) + if (binder_debugfs_dir_entry_root) { + const struct binder_debugfs_entry *db_entry; + + binder_for_each_debugfs_entry(db_entry) + debugfs_create_file(db_entry->name, + db_entry->mode, + binder_debugfs_dir_entry_root, + db_entry->data, + db_entry->fops); + binder_debugfs_dir_entry_proc = debugfs_create_dir("proc", binder_debugfs_dir_entry_root); - - if (binder_debugfs_dir_entry_root) { - debugfs_create_file("state", - 0444, - binder_debugfs_dir_entry_root, - NULL, - &binder_state_fops); - debugfs_create_file("stats", - 0444, - binder_debugfs_dir_entry_root, - NULL, - &binder_stats_fops); - debugfs_create_file("transactions", - 0444, - binder_debugfs_dir_entry_root, - NULL, - &binder_transactions_fops); - debugfs_create_file("transaction_log", - 0444, - binder_debugfs_dir_entry_root, - &binder_transaction_log, - &binder_transaction_log_fops); - debugfs_create_file("failed_transaction_log", - 0444, - binder_debugfs_dir_entry_root, - &binder_transaction_log_failed, - &binder_transaction_log_fops); } if (!IS_ENABLED(CONFIG_ANDROID_BINDERFS) && diff --git a/drivers/android/binder_internal.h b/drivers/android/binder_internal.h index a25df99bd30b..5bbd87dd6c25 100644 --- a/drivers/android/binder_internal.h +++ b/drivers/android/binder_internal.h @@ -107,41 +107,19 @@ static inline int __init init_binderfs(void) } #endif -int binder_stats_show(struct seq_file *m, void *unused); -DEFINE_SHOW_ATTRIBUTE(binder_stats); - -int binder_state_show(struct seq_file *m, void *unused); -DEFINE_SHOW_ATTRIBUTE(binder_state); - -int binder_transactions_show(struct seq_file *m, void *unused); -DEFINE_SHOW_ATTRIBUTE(binder_transactions); - -int binder_transaction_log_show(struct seq_file *m, void *unused); -DEFINE_SHOW_ATTRIBUTE(binder_transaction_log); - -struct binder_transaction_log_entry { - int debug_id; - int debug_id_done; - int call_type; - int from_proc; - int from_thread; - int target_handle; - int to_proc; - int to_thread; - int to_node; - int data_size; - int offsets_size; - int return_error_line; - uint32_t return_error; - uint32_t return_error_param; - char context_name[BINDERFS_MAX_NAME + 1]; +struct binder_debugfs_entry { + const char *name; + umode_t mode; + const struct file_operations *fops; + void *data; }; -struct binder_transaction_log { - atomic_t cur; - bool full; - struct binder_transaction_log_entry entry[32]; -}; +extern const struct binder_debugfs_entry binder_debugfs_entries[]; + +#define binder_for_each_debugfs_entry(entry) \ + for ((entry) = binder_debugfs_entries; \ + (entry)->name; \ + (entry)++) enum binder_stat_types { BINDER_STAT_PROC, @@ -617,6 +595,4 @@ struct binder_object { }; }; -extern struct binder_transaction_log binder_transaction_log; -extern struct binder_transaction_log binder_transaction_log_failed; #endif /* _LINUX_BINDER_INTERNAL_H */ diff --git a/drivers/android/binder_trace.h b/drivers/android/binder_trace.h index a70e23716ad0..8c4a6c3774a1 100644 --- a/drivers/android/binder_trace.h +++ b/drivers/android/binder_trace.h @@ -306,6 +306,10 @@ DEFINE_EVENT(binder_buffer_class, binder_transaction_failed_buffer_release, TP_PROTO(struct binder_buffer *buffer), TP_ARGS(buffer)); +DEFINE_EVENT(binder_buffer_class, binder_transaction_update_buffer_release, + TP_PROTO(struct binder_buffer *buffer), + TP_ARGS(buffer)); + TRACE_EVENT(binder_update_page_range, TP_PROTO(struct binder_alloc *alloc, bool allocate, void __user *start, void __user *end), diff --git a/drivers/android/binderfs.c b/drivers/android/binderfs.c index 346f315e8bd7..8d4eb491d4a6 100644 --- a/drivers/android/binderfs.c +++ b/drivers/android/binderfs.c @@ -619,6 +619,7 @@ static int init_binder_features(struct super_block *sb) static int init_binder_logs(struct super_block *sb) { struct dentry *binder_logs_root_dir, *dentry, *proc_log_dir; + const struct binder_debugfs_entry *db_entry; struct binderfs_info *info; int ret = 0; @@ -629,43 +630,15 @@ static int init_binder_logs(struct super_block *sb) goto out; } - dentry = binderfs_create_file(binder_logs_root_dir, "stats", - &binder_stats_fops, NULL); - if (IS_ERR(dentry)) { - ret = PTR_ERR(dentry); - goto out; - } - - dentry = binderfs_create_file(binder_logs_root_dir, "state", - &binder_state_fops, NULL); - if (IS_ERR(dentry)) { - ret = PTR_ERR(dentry); - goto out; - } - - dentry = binderfs_create_file(binder_logs_root_dir, "transactions", - &binder_transactions_fops, NULL); - if (IS_ERR(dentry)) { - ret = PTR_ERR(dentry); - goto out; - } - - dentry = binderfs_create_file(binder_logs_root_dir, - "transaction_log", - &binder_transaction_log_fops, - &binder_transaction_log); - if (IS_ERR(dentry)) { - ret = PTR_ERR(dentry); - goto out; - } - - dentry = binderfs_create_file(binder_logs_root_dir, - "failed_transaction_log", - &binder_transaction_log_fops, - &binder_transaction_log_failed); - if (IS_ERR(dentry)) { - ret = PTR_ERR(dentry); - goto out; + binder_for_each_debugfs_entry(db_entry) { + dentry = binderfs_create_file(binder_logs_root_dir, + db_entry->name, + db_entry->fops, + db_entry->data); + if (IS_ERR(dentry)) { + ret = PTR_ERR(dentry); + goto out; + } } proc_log_dir = binderfs_create_dir(binder_logs_root_dir, "proc"); diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index da2ecc40162e..73efd5503d2f 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -5,13 +5,34 @@ * * Copyright 2020 Google LLC */ +#ifndef __GENKSYMS__ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include <../drivers/net/wireless/intel/ipw2x00/libipw.h> +#include <../fs/mount.h> +#include <../fs/kernfs/kernfs-internal.h> +#include <../kernel/audit.h> +#include <../net/can/af_can.h> +#include <../net/tipc/bearer.h> +#include <../net/xdp/xsk_queue.h> +#include <../security/keys/internal.h> +#endif #define CREATE_TRACE_POINTS #include #include #include #include -#include #include #include #include @@ -20,7 +41,6 @@ #include #include #include -#include #include #include #include @@ -41,14 +61,14 @@ #include #include #include -#include +#ifdef __GENKSYMS__ #include +#endif #include #include #include #include #include -#include #include #include #include @@ -75,6 +95,7 @@ #include #include #include +#include /* * Export tracepoints that act as a bare tracehook (ie: have no trace event @@ -84,7 +105,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_select_task_rq_fair); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_select_task_rq_rt); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_select_task_rq_dl); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_select_fallback_rq); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_refrigerator); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_scheduler_tick); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_enqueue_task); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_dequeue_task); @@ -100,7 +120,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sk_free); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_nf_conn_alloc); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_nf_conn_free); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_arch_set_freq_scale); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_is_fpsimd_save); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_transaction_init); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_priority_skip); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_set_priority); @@ -128,7 +147,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpu_idle_exit); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mpam_set); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_find_busiest_group); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_gic_resume); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_wq_lockup_pool); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ipi_stop); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sysrq_crash); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_dump_throttled_rt_tasks); @@ -162,21 +180,8 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_preempt_enable); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_irqs_disable); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_irqs_enable); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_task_cpu); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_try_to_wake_up); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_try_to_wake_up_success); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_fork); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_wake_up_new_task); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_new_task_stats); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_flush_task); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_tick_entry); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_schedule); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_cpu_starting); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_cpu_dying); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_account_irq); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_place_entity); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_build_perf_domains); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_cpu_capacity); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_misfit_status); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpu_cgroup_attach); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpu_cgroup_can_attach); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpu_cgroup_online); @@ -201,6 +206,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_balance_rt); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_timer_calc_index); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_watchdog_timer_softlockup); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_try_to_freeze_todo); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_try_to_freeze_todo_logging); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_try_to_freeze_todo_unfrozen); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_dequeue_task_idle); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_die_kernel_fault); @@ -242,8 +248,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_uclamp_eff_get); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_uclamp_task_util); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_uclamp_rq_util_with); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpufreq_transition); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cgroup_set_task); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cgroup_force_kthread_migration); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_syscall_prctl_finished); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_create_worker); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_check_preempt_tick); @@ -262,8 +266,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_selinux_avc_insert); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_selinux_avc_node_delete); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_selinux_avc_node_replace); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_selinux_avc_lookup); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_blk_alloc_rqs); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_blk_rq_ctx_init); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_commit_creds); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_exit_creds); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_override_creds); @@ -272,8 +274,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_memory_x); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_memory_nx); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_memory_ro); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_memory_rw); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_module_permit_before_init); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_module_permit_after_init); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_util_est_update); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_meminfo_proc_show); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_exit_mm); @@ -312,7 +312,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tune_swappiness); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_shrink_slab_bypass); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_psi_event); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_psi_group); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpuset_fork); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_cpus_allowed_comm); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sched_setaffinity_early); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_task); @@ -330,7 +329,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_selinux_is_initialized); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tune_inactive_ratio); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_update_topology_flags_workfn); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_of_i2c_get_board_info); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cgroup_attach); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_dirty_limits); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_oom_check_panic); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_check_uninterruptible_tasks); @@ -344,7 +342,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mmc_gpio_cd_irqt); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_save_vmalloc_stack); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_show_stack_hash); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_save_track_hash); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_vmpressure); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_task_comm); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpufreq_acct_update_power); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_typec_tcpm_log); @@ -404,3 +401,12 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_rt_rq_load_avg); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_pci_d3_sleep); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_rq_clock_pelt); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpumask_any_and_distribute); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_resume_begin); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_resume_end); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tune_memcg_scan_type); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_pidfd_open); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mmput); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_early_resume_begin); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_pages_reclaim_bypass); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_pages_failure_bypass); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rebuild_root_domains_bypass); diff --git a/drivers/md/dm-verity-target.c b/drivers/md/dm-verity-target.c index 49d876ac2091..1c8038c665ec 100644 --- a/drivers/md/dm-verity-target.c +++ b/drivers/md/dm-verity-target.c @@ -1253,6 +1253,7 @@ static struct target_type verity_target = { .name = "verity", .features = DM_TARGET_IMMUTABLE, .version = {1, 7, 0}, + .features = DM_TARGET_IMMUTABLE, .module = THIS_MODULE, .ctr = verity_ctr, .dtr = verity_dtr, diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 31c435015691..45ee1adefc08 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -3016,37 +3016,58 @@ ufshcd_dev_cmd_completion(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) static int ufshcd_wait_for_dev_cmd(struct ufs_hba *hba, struct ufshcd_lrb *lrbp, int max_timeout) { - int err = 0; - unsigned long time_left; + unsigned long time_left = msecs_to_jiffies(max_timeout); unsigned long flags; + bool pending; + int err; +retry: time_left = wait_for_completion_timeout(hba->dev_cmd.complete, - msecs_to_jiffies(max_timeout)); + time_left); - spin_lock_irqsave(hba->host->host_lock, flags); - hba->dev_cmd.complete = NULL; if (likely(time_left)) { + /* + * The caller of this function still owns the @lrbp tag so the + * code below does not trigger any race conditions. + */ + hba->dev_cmd.complete = NULL; err = ufshcd_get_tr_ocs(lrbp); if (!err) err = ufshcd_dev_cmd_completion(hba, lrbp); - } - spin_unlock_irqrestore(hba->host->host_lock, flags); - - if (!time_left) { + } else { err = -ETIMEDOUT; dev_dbg(hba->dev, "%s: dev_cmd request timedout, tag %d\n", __func__, lrbp->task_tag); - if (!ufshcd_clear_cmds(hba, 1U << lrbp->task_tag)) + if (!ufshcd_clear_cmds(hba, 1U << lrbp->task_tag)) { /* successfully cleared the command, retry if needed */ err = -EAGAIN; - /* - * in case of an error, after clearing the doorbell, - * we also need to clear the outstanding_request - * field in hba - */ - spin_lock_irqsave(&hba->outstanding_lock, flags); - __clear_bit(lrbp->task_tag, &hba->outstanding_reqs); - spin_unlock_irqrestore(&hba->outstanding_lock, flags); + /* + * Since clearing the command succeeded we also need to + * clear the task tag bit from the outstanding_reqs + * variable. + */ + spin_lock_irqsave(&hba->outstanding_lock, flags); + pending = test_bit(lrbp->task_tag, + &hba->outstanding_reqs); + if (pending) { + hba->dev_cmd.complete = NULL; + __clear_bit(lrbp->task_tag, + &hba->outstanding_reqs); + } + spin_unlock_irqrestore(&hba->outstanding_lock, flags); + + if (!pending) { + /* + * A race occurred between this function and the + * completion handler. + */ + time_left = 1; + goto retry; + } + } else { + dev_err(hba->dev, "%s: failed to clear tag %d\n", __func__, + lrbp->task_tag); + } } return err; @@ -4532,7 +4553,7 @@ static int ufshcd_complete_dev_init(struct ufs_hba *hba) QUERY_FLAG_IDN_FDEVICEINIT, 0, &flag_res); if (!flag_res) break; - usleep_range(5000, 10000); + usleep_range(500, 1000); } while (ktime_before(ktime_get(), timeout)); if (err) { diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 644ddcb26e76..2a7ccc0035a5 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c @@ -1836,7 +1836,6 @@ struct xhci_command *xhci_alloc_command(struct xhci_hcd *xhci, INIT_LIST_HEAD(&command->cmd_list); return command; } -EXPORT_SYMBOL_GPL(xhci_alloc_command); struct xhci_command *xhci_alloc_command_with_ctx(struct xhci_hcd *xhci, bool allocate_completion, gfp_t mem_flags) @@ -1870,7 +1869,6 @@ void xhci_free_command(struct xhci_hcd *xhci, kfree(command->completion); kfree(command); } -EXPORT_SYMBOL_GPL(xhci_free_command); int xhci_alloc_erst(struct xhci_hcd *xhci, struct xhci_ring *evt_ring, @@ -1901,7 +1899,6 @@ int xhci_alloc_erst(struct xhci_hcd *xhci, return 0; } -EXPORT_SYMBOL_GPL(xhci_alloc_erst); void xhci_free_erst(struct xhci_hcd *xhci, struct xhci_erst *erst) { @@ -1915,7 +1912,6 @@ void xhci_free_erst(struct xhci_hcd *xhci, struct xhci_erst *erst) erst->erst_dma_addr); erst->entries = NULL; } -EXPORT_SYMBOL_GPL(xhci_free_erst); static struct xhci_device_context_array *xhci_vendor_alloc_dcbaa( struct xhci_hcd *xhci, gfp_t flags) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 45eabb3bf834..08ceb007c322 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -79,7 +79,6 @@ dma_addr_t xhci_trb_virt_to_dma(struct xhci_segment *seg, return 0; return seg->dma + (segment_offset * sizeof(*trb)); } -EXPORT_SYMBOL_GPL(xhci_trb_virt_to_dma); static bool trb_is_noop(union xhci_trb *trb) { @@ -312,7 +311,6 @@ void xhci_ring_cmd_db(struct xhci_hcd *xhci) /* Flush PCI posted writes */ readl(&xhci->dba->doorbell[0]); } -EXPORT_SYMBOL_GPL(xhci_ring_cmd_db); static bool xhci_mod_cmd_timer(struct xhci_hcd *xhci, unsigned long delay) { @@ -4414,7 +4412,6 @@ int xhci_queue_stop_endpoint(struct xhci_hcd *xhci, struct xhci_command *cmd, return queue_command(xhci, cmd, 0, 0, 0, trb_slot_id | trb_ep_index | type | trb_suspend, false); } -EXPORT_SYMBOL_GPL(xhci_queue_stop_endpoint); int xhci_queue_reset_ep(struct xhci_hcd *xhci, struct xhci_command *cmd, int slot_id, unsigned int ep_index, diff --git a/fs/OWNERS b/fs/OWNERS deleted file mode 100644 index a838344a1137..000000000000 --- a/fs/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# include OWNERS from the authoritative android-mainline branch -include kernel/common:android-mainline:/fs/OWNERS diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c index 03a3dafc82f3..bff7bf2f7586 100644 --- a/fs/erofs/zdata.c +++ b/fs/erofs/zdata.c @@ -770,12 +770,9 @@ static void z_erofs_decompress_kickoff(struct z_erofs_decompressqueue *io, /* wake up the caller thread for sync decompression */ if (sync) { - unsigned long flags; - - spin_lock_irqsave(&io->u.wait.lock, flags); if (!atomic_add_return(bios, &io->pending_bios)) - wake_up_locked(&io->u.wait); - spin_unlock_irqrestore(&io->u.wait.lock, flags); + complete(&io->u.done); + return; } @@ -1186,7 +1183,7 @@ jobqueue_init(struct super_block *sb, } else { fg_out: q = fgq; - init_waitqueue_head(&fgq->u.wait); + init_completion(&fgq->u.done); atomic_set(&fgq->pending_bios, 0); } q->sb = sb; @@ -1360,8 +1357,7 @@ static void z_erofs_runqueue(struct super_block *sb, return; /* wait until all bios are completed */ - io_wait_event(io[JQ_SUBMIT].u.wait, - !atomic_read(&io[JQ_SUBMIT].pending_bios)); + wait_for_completion_io(&io[JQ_SUBMIT].u.done); /* handle synchronous decompress queue in the caller context */ z_erofs_decompress_queue(&io[JQ_SUBMIT], pagepool); diff --git a/fs/erofs/zdata.h b/fs/erofs/zdata.h index 4a69515dea75..5e9a0eb54c89 100644 --- a/fs/erofs/zdata.h +++ b/fs/erofs/zdata.h @@ -89,7 +89,7 @@ struct z_erofs_decompressqueue { z_erofs_next_pcluster_t head; union { - wait_queue_head_t wait; + struct completion done; struct work_struct work; } u; }; diff --git a/fs/exfat/fatent.c b/fs/exfat/fatent.c index 084ae062f5b2..84b2885b8741 100644 --- a/fs/exfat/fatent.c +++ b/fs/exfat/fatent.c @@ -6,6 +6,7 @@ #include #include #include +#include #include "exfat_raw.h" #include "exfat_fs.h" @@ -225,10 +226,10 @@ int exfat_zeroed_cluster(struct inode *dir, unsigned int clu) { struct super_block *sb = dir->i_sb; struct exfat_sb_info *sbi = EXFAT_SB(sb); - struct buffer_head *bhs[MAX_BUF_PER_PAGE]; - int nr_bhs = MAX_BUF_PER_PAGE; + struct buffer_head *bh; + struct address_space *mapping = sb->s_bdev->bd_inode->i_mapping; sector_t blknr, last_blknr; - int err, i, n; + int i; blknr = exfat_cluster_to_sector(sbi, clu); last_blknr = blknr + sbi->sect_per_clus; @@ -242,30 +243,22 @@ int exfat_zeroed_cluster(struct inode *dir, unsigned int clu) } /* Zeroing the unused blocks on this cluster */ - while (blknr < last_blknr) { - for (n = 0; n < nr_bhs && blknr < last_blknr; n++, blknr++) { - bhs[n] = sb_getblk(sb, blknr); - if (!bhs[n]) { - err = -ENOMEM; - goto release_bhs; - } - memset(bhs[n]->b_data, 0, sb->s_blocksize); - } + for (i = blknr; i < last_blknr; i++) { + bh = sb_getblk(sb, i); + if (!bh) + return -ENOMEM; - err = exfat_update_bhs(bhs, n, IS_DIRSYNC(dir)); - if (err) - goto release_bhs; - - for (i = 0; i < n; i++) - brelse(bhs[i]); + memset(bh->b_data, 0, sb->s_blocksize); + set_buffer_uptodate(bh); + mark_buffer_dirty(bh); + brelse(bh); } - return 0; + if (IS_DIRSYNC(dir)) + return filemap_write_and_wait_range(mapping, + EXFAT_BLK_TO_B(blknr, sb), + EXFAT_BLK_TO_B(last_blknr, sb) - 1); -release_bhs: - exfat_err(sb, "failed zeroed sect %llu\n", (unsigned long long)blknr); - for (i = 0; i < n; i++) - bforget(bhs[i]); - return err; + return 0; } int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc, diff --git a/fs/f2fs/OWNERS b/fs/f2fs/OWNERS deleted file mode 100644 index f981f44fbffd..000000000000 --- a/fs/f2fs/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# include OWNERS from the authoritative android-mainline branch -include kernel/common:android-mainline:/fs/f2fs/OWNERS diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 1e5d98ad33d6..a90bd67ff176 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -98,13 +98,7 @@ repeat: } if (unlikely(!PageUptodate(page))) { - if (page->index == sbi->metapage_eio_ofs && - sbi->metapage_eio_cnt++ == MAX_RETRY_META_PAGE_EIO) { - set_ckpt_flags(sbi, CP_ERROR_FLAG); - } else { - sbi->metapage_eio_ofs = page->index; - sbi->metapage_eio_cnt = 0; - } + f2fs_handle_page_eio(sbi, page->index, META); f2fs_put_page(page, 1); return ERR_PTR(-EIO); } @@ -1901,15 +1895,27 @@ int f2fs_start_ckpt_thread(struct f2fs_sb_info *sbi) void f2fs_stop_ckpt_thread(struct f2fs_sb_info *sbi) { struct ckpt_req_control *cprc = &sbi->cprc_info; + struct task_struct *ckpt_task; - if (cprc->f2fs_issue_ckpt) { - struct task_struct *ckpt_task = cprc->f2fs_issue_ckpt; + if (!cprc->f2fs_issue_ckpt) + return; - cprc->f2fs_issue_ckpt = NULL; - kthread_stop(ckpt_task); + ckpt_task = cprc->f2fs_issue_ckpt; + cprc->f2fs_issue_ckpt = NULL; + kthread_stop(ckpt_task); - flush_remained_ckpt_reqs(sbi, NULL); - } + f2fs_flush_ckpt_thread(sbi); +} + +void f2fs_flush_ckpt_thread(struct f2fs_sb_info *sbi) +{ + struct ckpt_req_control *cprc = &sbi->cprc_info; + + flush_remained_ckpt_reqs(sbi, NULL); + + /* Let's wait for the previous dispatched checkpoint. */ + while (atomic_read(&cprc->queued_ckpt)) + io_schedule_timeout(DEFAULT_IO_TIMEOUT); } void f2fs_init_ckpt_req_control(struct f2fs_sb_info *sbi) diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index 750573d1feaa..1e76c80a3eeb 100644 --- a/fs/f2fs/compress.c +++ b/fs/f2fs/compress.c @@ -728,14 +728,19 @@ out: return ret; } -void f2fs_decompress_cluster(struct decompress_io_ctx *dic) +static int f2fs_prepare_decomp_mem(struct decompress_io_ctx *dic, + bool pre_alloc); +static void f2fs_release_decomp_mem(struct decompress_io_ctx *dic, + bool bypass_destroy_callback, bool pre_alloc); + +void f2fs_decompress_cluster(struct decompress_io_ctx *dic, bool in_task) { struct f2fs_sb_info *sbi = F2FS_I_SB(dic->inode); struct f2fs_inode_info *fi = F2FS_I(dic->inode); const struct f2fs_compress_ops *cops = f2fs_cops[fi->i_compress_algorithm]; + bool bypass_callback = false; int ret; - int i; trace_f2fs_decompress_pages_start(dic->inode, dic->cluster_idx, dic->cluster_size, fi->i_compress_algorithm); @@ -745,41 +750,10 @@ void f2fs_decompress_cluster(struct decompress_io_ctx *dic) goto out_end_io; } - dic->tpages = page_array_alloc(dic->inode, dic->cluster_size); - if (!dic->tpages) { - ret = -ENOMEM; - goto out_end_io; - } - - for (i = 0; i < dic->cluster_size; i++) { - if (dic->rpages[i]) { - dic->tpages[i] = dic->rpages[i]; - continue; - } - - dic->tpages[i] = f2fs_compress_alloc_page(); - if (!dic->tpages[i]) { - ret = -ENOMEM; - goto out_end_io; - } - } - - if (cops->init_decompress_ctx) { - ret = cops->init_decompress_ctx(dic); - if (ret) - goto out_end_io; - } - - dic->rbuf = f2fs_vmap(dic->tpages, dic->cluster_size); - if (!dic->rbuf) { - ret = -ENOMEM; - goto out_destroy_decompress_ctx; - } - - dic->cbuf = f2fs_vmap(dic->cpages, dic->nr_cpages); - if (!dic->cbuf) { - ret = -ENOMEM; - goto out_vunmap_rbuf; + ret = f2fs_prepare_decomp_mem(dic, false); + if (ret) { + bypass_callback = true; + goto out_release; } dic->clen = le32_to_cpu(dic->cbuf->clen); @@ -787,7 +761,7 @@ void f2fs_decompress_cluster(struct decompress_io_ctx *dic) if (dic->clen > PAGE_SIZE * dic->nr_cpages - COMPRESS_HEADER_SIZE) { ret = -EFSCORRUPTED; - goto out_vunmap_cbuf; + goto out_release; } ret = cops->decompress_pages(dic); @@ -808,17 +782,13 @@ void f2fs_decompress_cluster(struct decompress_io_ctx *dic) } } -out_vunmap_cbuf: - vm_unmap_ram(dic->cbuf, dic->nr_cpages); -out_vunmap_rbuf: - vm_unmap_ram(dic->rbuf, dic->cluster_size); -out_destroy_decompress_ctx: - if (cops->destroy_decompress_ctx) - cops->destroy_decompress_ctx(dic); +out_release: + f2fs_release_decomp_mem(dic, bypass_callback, false); + out_end_io: trace_f2fs_decompress_pages_end(dic->inode, dic->cluster_idx, dic->clen, ret); - f2fs_decompress_end_io(dic, ret); + f2fs_decompress_end_io(dic, ret, in_task); } /* @@ -828,7 +798,7 @@ out_end_io: * (or in the case of a failure, cleans up without actually decompressing). */ void f2fs_end_read_compressed_page(struct page *page, bool failed, - block_t blkaddr) + block_t blkaddr, bool in_task) { struct decompress_io_ctx *dic = (struct decompress_io_ctx *)page_private(page); @@ -838,12 +808,12 @@ void f2fs_end_read_compressed_page(struct page *page, bool failed, if (failed) WRITE_ONCE(dic->failed, true); - else if (blkaddr) + else if (blkaddr && in_task) f2fs_cache_compressed_page(sbi, page, dic->inode->i_ino, blkaddr); if (atomic_dec_and_test(&dic->remaining_pages)) - f2fs_decompress_cluster(dic); + f2fs_decompress_cluster(dic, in_task); } static bool is_page_in_cluster(struct compress_ctx *cc, pgoff_t index) @@ -1503,9 +1473,7 @@ continue_unlock: if (IS_NOQUOTA(cc->inode)) return 0; ret = 0; - cond_resched(); - congestion_wait(BLK_RW_ASYNC, - DEFAULT_IO_TIMEOUT); + f2fs_io_schedule_timeout(DEFAULT_IO_TIMEOUT); goto retry_write; } return ret; @@ -1553,16 +1521,85 @@ destroy_out: return err; } -static void f2fs_free_dic(struct decompress_io_ctx *dic); +static inline bool allow_memalloc_for_decomp(struct f2fs_sb_info *sbi, + bool pre_alloc) +{ + return pre_alloc ^ f2fs_low_mem_mode(sbi); +} + +static int f2fs_prepare_decomp_mem(struct decompress_io_ctx *dic, + bool pre_alloc) +{ + const struct f2fs_compress_ops *cops = + f2fs_cops[F2FS_I(dic->inode)->i_compress_algorithm]; + int i; + + if (!allow_memalloc_for_decomp(F2FS_I_SB(dic->inode), pre_alloc)) + return 0; + + dic->tpages = page_array_alloc(dic->inode, dic->cluster_size); + if (!dic->tpages) + return -ENOMEM; + + for (i = 0; i < dic->cluster_size; i++) { + if (dic->rpages[i]) { + dic->tpages[i] = dic->rpages[i]; + continue; + } + + dic->tpages[i] = f2fs_compress_alloc_page(); + if (!dic->tpages[i]) + return -ENOMEM; + } + + dic->rbuf = f2fs_vmap(dic->tpages, dic->cluster_size); + if (!dic->rbuf) + return -ENOMEM; + + dic->cbuf = f2fs_vmap(dic->cpages, dic->nr_cpages); + if (!dic->cbuf) + return -ENOMEM; + + if (cops->init_decompress_ctx) { + int ret = cops->init_decompress_ctx(dic); + + if (ret) + return ret; + } + + return 0; +} + +static void f2fs_release_decomp_mem(struct decompress_io_ctx *dic, + bool bypass_destroy_callback, bool pre_alloc) +{ + const struct f2fs_compress_ops *cops = + f2fs_cops[F2FS_I(dic->inode)->i_compress_algorithm]; + + if (!allow_memalloc_for_decomp(F2FS_I_SB(dic->inode), pre_alloc)) + return; + + if (!bypass_destroy_callback && cops->destroy_decompress_ctx) + cops->destroy_decompress_ctx(dic); + + if (dic->cbuf) + vm_unmap_ram(dic->cbuf, dic->nr_cpages); + + if (dic->rbuf) + vm_unmap_ram(dic->rbuf, dic->cluster_size); +} + +static void f2fs_free_dic(struct decompress_io_ctx *dic, + bool bypass_destroy_callback); struct decompress_io_ctx *f2fs_alloc_dic(struct compress_ctx *cc) { struct decompress_io_ctx *dic; pgoff_t start_idx = start_idx_of_cluster(cc); - int i; + struct f2fs_sb_info *sbi = F2FS_I_SB(cc->inode); + int i, ret; - dic = f2fs_kmem_cache_alloc(dic_entry_slab, GFP_F2FS_ZERO, - false, F2FS_I_SB(cc->inode)); + dic = f2fs_kmem_cache_alloc(dic_entry_slab, GFP_F2FS_ZERO, false, sbi); if (!dic) return ERR_PTR(-ENOMEM); @@ -1588,32 +1625,43 @@ struct decompress_io_ctx *f2fs_alloc_dic(struct compress_ctx *cc) dic->nr_rpages = cc->cluster_size; dic->cpages = page_array_alloc(dic->inode, dic->nr_cpages); - if (!dic->cpages) + if (!dic->cpages) { + ret = -ENOMEM; goto out_free; + } for (i = 0; i < dic->nr_cpages; i++) { struct page *page; page = f2fs_compress_alloc_page(); - if (!page) + if (!page) { + ret = -ENOMEM; goto out_free; + } f2fs_set_compressed_page(page, cc->inode, start_idx + i + 1, dic); dic->cpages[i] = page; } + ret = f2fs_prepare_decomp_mem(dic, true); + if (ret) + goto out_free; + return dic; out_free: - f2fs_free_dic(dic); - return ERR_PTR(-ENOMEM); + f2fs_free_dic(dic, true); + return ERR_PTR(ret); } -static void f2fs_free_dic(struct decompress_io_ctx *dic) +static void f2fs_free_dic(struct decompress_io_ctx *dic, + bool bypass_destroy_callback) { int i; + f2fs_release_decomp_mem(dic, bypass_destroy_callback, true); + if (dic->tpages) { for (i = 0; i < dic->cluster_size; i++) { if (dic->rpages[i]) @@ -1638,17 +1686,33 @@ static void f2fs_free_dic(struct decompress_io_ctx *dic) kmem_cache_free(dic_entry_slab, dic); } -static void f2fs_put_dic(struct decompress_io_ctx *dic) +static void f2fs_late_free_dic(struct work_struct *work) { - if (refcount_dec_and_test(&dic->refcnt)) - f2fs_free_dic(dic); + struct decompress_io_ctx *dic = + container_of(work, struct decompress_io_ctx, free_work); + + f2fs_free_dic(dic, false); +} + +static void f2fs_put_dic(struct decompress_io_ctx *dic, bool in_task) +{ + if (refcount_dec_and_test(&dic->refcnt)) { + if (in_task) { + f2fs_free_dic(dic, false); + } else { + INIT_WORK(&dic->free_work, f2fs_late_free_dic); + queue_work(F2FS_I_SB(dic->inode)->post_read_wq, + &dic->free_work); + } + } } /* * Update and unlock the cluster's pagecache pages, and release the reference to * the decompress_io_ctx that was being held for I/O completion. */ -static void __f2fs_decompress_end_io(struct decompress_io_ctx *dic, bool failed) +static void __f2fs_decompress_end_io(struct decompress_io_ctx *dic, bool failed, + bool in_task) { int i; @@ -1669,7 +1733,7 @@ static void __f2fs_decompress_end_io(struct decompress_io_ctx *dic, bool failed) unlock_page(rpage); } - f2fs_put_dic(dic); + f2fs_put_dic(dic, in_task); } static void f2fs_verify_cluster(struct work_struct *work) @@ -1686,14 +1750,15 @@ static void f2fs_verify_cluster(struct work_struct *work) SetPageError(rpage); } - __f2fs_decompress_end_io(dic, false); + __f2fs_decompress_end_io(dic, false, true); } /* * This is called when a compressed cluster has been decompressed * (or failed to be read and/or decompressed). */ -void f2fs_decompress_end_io(struct decompress_io_ctx *dic, bool failed) +void f2fs_decompress_end_io(struct decompress_io_ctx *dic, bool failed, + bool in_task) { if (!failed && dic->need_verity) { /* @@ -1705,7 +1770,7 @@ void f2fs_decompress_end_io(struct decompress_io_ctx *dic, bool failed) INIT_WORK(&dic->verity_work, f2fs_verify_cluster); fsverity_enqueue_verify_work(&dic->verity_work); } else { - __f2fs_decompress_end_io(dic, failed); + __f2fs_decompress_end_io(dic, failed, in_task); } } @@ -1714,12 +1779,12 @@ void f2fs_decompress_end_io(struct decompress_io_ctx *dic, bool failed) * * This is called when the page is no longer needed and can be freed. */ -void f2fs_put_page_dic(struct page *page) +void f2fs_put_page_dic(struct page *page, bool in_task) { struct decompress_io_ctx *dic = (struct decompress_io_ctx *)page_private(page); - f2fs_put_dic(dic); + f2fs_put_dic(dic, in_task); } /* diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 5c49817dbcc9..75446c54624b 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -122,7 +122,7 @@ struct bio_post_read_ctx { block_t fs_blkaddr; }; -static void f2fs_finish_read_bio(struct bio *bio) +static void f2fs_finish_read_bio(struct bio *bio, bool in_task) { struct bio_vec *bv; struct bvec_iter_all iter_all; @@ -136,8 +136,9 @@ static void f2fs_finish_read_bio(struct bio *bio) if (f2fs_is_compressed_page(page)) { if (bio->bi_status) - f2fs_end_read_compressed_page(page, true, 0); - f2fs_put_page_dic(page); + f2fs_end_read_compressed_page(page, true, 0, + in_task); + f2fs_put_page_dic(page, in_task); continue; } @@ -194,7 +195,7 @@ static void f2fs_verify_bio(struct work_struct *work) fsverity_verify_bio(bio); } - f2fs_finish_read_bio(bio); + f2fs_finish_read_bio(bio, true); } /* @@ -206,7 +207,7 @@ static void f2fs_verify_bio(struct work_struct *work) * can involve reading verity metadata pages from the file, and these verity * metadata pages may be encrypted and/or compressed. */ -static void f2fs_verify_and_finish_bio(struct bio *bio) +static void f2fs_verify_and_finish_bio(struct bio *bio, bool in_task) { struct bio_post_read_ctx *ctx = bio->bi_private; @@ -214,7 +215,7 @@ static void f2fs_verify_and_finish_bio(struct bio *bio) INIT_WORK(&ctx->work, f2fs_verify_bio); fsverity_enqueue_verify_work(&ctx->work); } else { - f2fs_finish_read_bio(bio); + f2fs_finish_read_bio(bio, in_task); } } @@ -227,7 +228,8 @@ static void f2fs_verify_and_finish_bio(struct bio *bio) * that the bio includes at least one compressed page. The actual decompression * is done on a per-cluster basis, not a per-bio basis. */ -static void f2fs_handle_step_decompress(struct bio_post_read_ctx *ctx) +static void f2fs_handle_step_decompress(struct bio_post_read_ctx *ctx, + bool in_task) { struct bio_vec *bv; struct bvec_iter_all iter_all; @@ -240,7 +242,7 @@ static void f2fs_handle_step_decompress(struct bio_post_read_ctx *ctx) /* PG_error was set if decryption failed. */ if (f2fs_is_compressed_page(page)) f2fs_end_read_compressed_page(page, PageError(page), - blkaddr); + blkaddr, in_task); else all_compressed = false; @@ -265,15 +267,16 @@ static void f2fs_post_read_work(struct work_struct *work) fscrypt_decrypt_bio(ctx->bio); if (ctx->enabled_steps & STEP_DECOMPRESS) - f2fs_handle_step_decompress(ctx); + f2fs_handle_step_decompress(ctx, true); - f2fs_verify_and_finish_bio(ctx->bio); + f2fs_verify_and_finish_bio(ctx->bio, true); } static void f2fs_read_end_io(struct bio *bio) { struct f2fs_sb_info *sbi = F2FS_P_SB(bio_first_page_all(bio)); struct bio_post_read_ctx *ctx; + bool intask = in_task(); iostat_update_and_unbind_ctx(bio, 0); ctx = bio->bi_private; @@ -284,16 +287,29 @@ static void f2fs_read_end_io(struct bio *bio) } if (bio->bi_status) { - f2fs_finish_read_bio(bio); + f2fs_finish_read_bio(bio, intask); return; } - if (ctx && (ctx->enabled_steps & (STEP_DECRYPT | STEP_DECOMPRESS))) { - INIT_WORK(&ctx->work, f2fs_post_read_work); - queue_work(ctx->sbi->post_read_wq, &ctx->work); - } else { - f2fs_verify_and_finish_bio(bio); + if (ctx) { + unsigned int enabled_steps = ctx->enabled_steps & + (STEP_DECRYPT | STEP_DECOMPRESS); + + /* + * If we have only decompression step between decompression and + * decrypt, we don't need post processing for this. + */ + if (enabled_steps == STEP_DECOMPRESS && + !f2fs_low_mem_mode(sbi)) { + f2fs_handle_step_decompress(ctx, intask); + } else if (enabled_steps) { + INIT_WORK(&ctx->work, f2fs_post_read_work); + queue_work(ctx->sbi->post_read_wq, &ctx->work); + return; + } } + + f2fs_verify_and_finish_bio(bio, intask); } static void f2fs_write_end_io(struct bio *bio) @@ -2228,7 +2244,7 @@ skip_reading_dnode: if (f2fs_load_compressed_page(sbi, page, blkaddr)) { if (atomic_dec_and_test(&dic->remaining_pages)) - f2fs_decompress_cluster(dic); + f2fs_decompress_cluster(dic, true); continue; } @@ -2246,7 +2262,7 @@ submit_and_realloc: page->index, for_write); if (IS_ERR(bio)) { ret = PTR_ERR(bio); - f2fs_decompress_end_io(dic, ret); + f2fs_decompress_end_io(dic, ret, true); f2fs_put_dnode(&dn); *bio_ret = NULL; return ret; @@ -2533,7 +2549,7 @@ bool f2fs_should_update_inplace(struct inode *inode, struct f2fs_io_info *fio) return true; /* if this is cold file, we should overwrite to avoid fragmentation */ - if (file_is_cold(inode)) + if (file_is_cold(inode) && !is_inode_flag_set(inode, FI_OPU_WRITE)) return true; return check_inplace_update_policy(inode, fio); @@ -3081,8 +3097,7 @@ result: } else if (ret == -EAGAIN) { ret = 0; if (wbc->sync_mode == WB_SYNC_ALL) { - cond_resched(); - congestion_wait(BLK_RW_ASYNC, + f2fs_io_schedule_timeout( DEFAULT_IO_TIMEOUT); goto retry_write; } diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 4307bcfac0c6..150c0172232d 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -157,6 +157,7 @@ struct f2fs_mount_info { int fsync_mode; /* fsync policy */ int fs_mode; /* fs mode: LFS or ADAPTIVE */ int bggc_mode; /* bggc mode: off, on or sync */ + int memory_mode; /* memory mode */ int discard_unit; /* * discard command's offset/size should * be aligned to this unit: block, @@ -577,8 +578,8 @@ enum { /* maximum retry quota flush count */ #define DEFAULT_RETRY_QUOTA_FLUSH_COUNT 8 -/* maximum retry of EIO'ed meta page */ -#define MAX_RETRY_META_PAGE_EIO 100 +/* maximum retry of EIO'ed page */ +#define MAX_RETRY_PAGE_EIO 100 #define F2FS_LINK_MAX 0xffffffff /* maximum link count per file */ @@ -1367,6 +1368,13 @@ enum { DISCARD_UNIT_SECTION, /* basic discard unit is section */ }; +enum { + MEMORY_MODE_NORMAL, /* memory mode for normal devices */ + MEMORY_MODE_LOW, /* memory mode for low memry devices */ +}; + + + static inline int f2fs_test_bit(unsigned int nr, char *addr); static inline void f2fs_set_bit(unsigned int nr, char *addr); static inline void f2fs_clear_bit(unsigned int nr, char *addr); @@ -1587,6 +1595,7 @@ struct decompress_io_ctx { void *private; /* payload buffer for specified decompression algorithm */ void *private2; /* extra payload buffer */ struct work_struct verity_work; /* work to verify the decompressed pages */ + struct work_struct free_work; /* work for late free this structure itself */ }; #define NULL_CLUSTER ((unsigned int)(~0)) @@ -1620,8 +1629,8 @@ struct f2fs_sb_info { /* keep migration IO order for LFS mode */ struct f2fs_rwsem io_order_lock; mempool_t *write_io_dummy; /* Dummy pages */ - pgoff_t metapage_eio_ofs; /* EIO page offset */ - int metapage_eio_cnt; /* EIO count */ + pgoff_t page_eio_ofs[NR_PAGE_TYPE]; /* EIO page offset */ + int page_eio_cnt[NR_PAGE_TYPE]; /* EIO count */ /* for checkpoint */ struct f2fs_checkpoint *ckpt; /* raw checkpoint pointer */ @@ -1719,7 +1728,6 @@ struct f2fs_sb_info { unsigned int gc_mode; /* current GC state */ unsigned int next_victim_seg[2]; /* next segment in victim section */ spinlock_t gc_urgent_high_lock; - bool gc_urgent_high_limited; /* indicates having limited trial count */ unsigned int gc_urgent_high_remaining; /* remaining trial count for GC_URGENT_HIGH */ /* for skip statistic */ @@ -3679,6 +3687,7 @@ static inline bool f2fs_need_rand_seg(struct f2fs_sb_info *sbi) * checkpoint.c */ void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io); +void f2fs_flush_ckpt_thread(struct f2fs_sb_info *sbi); struct page *f2fs_grab_meta_page(struct f2fs_sb_info *sbi, pgoff_t index); struct page *f2fs_get_meta_page(struct f2fs_sb_info *sbi, pgoff_t index); struct page *f2fs_get_meta_page_retry(struct f2fs_sb_info *sbi, pgoff_t index); @@ -4184,9 +4193,9 @@ void f2fs_compress_write_end_io(struct bio *bio, struct page *page); bool f2fs_is_compress_backend_ready(struct inode *inode); int f2fs_init_compress_mempool(void); void f2fs_destroy_compress_mempool(void); -void f2fs_decompress_cluster(struct decompress_io_ctx *dic); +void f2fs_decompress_cluster(struct decompress_io_ctx *dic, bool in_task); void f2fs_end_read_compressed_page(struct page *page, bool failed, - block_t blkaddr); + block_t blkaddr, bool in_task); bool f2fs_cluster_is_empty(struct compress_ctx *cc); bool f2fs_cluster_can_merge_page(struct compress_ctx *cc, pgoff_t index); bool f2fs_all_cluster_page_loaded(struct compress_ctx *cc, struct pagevec *pvec, @@ -4205,8 +4214,9 @@ int f2fs_read_multi_pages(struct compress_ctx *cc, struct bio **bio_ret, unsigned nr_pages, sector_t *last_block_in_bio, bool is_readahead, bool for_write); struct decompress_io_ctx *f2fs_alloc_dic(struct compress_ctx *cc); -void f2fs_decompress_end_io(struct decompress_io_ctx *dic, bool failed); -void f2fs_put_page_dic(struct page *page); +void f2fs_decompress_end_io(struct decompress_io_ctx *dic, bool failed, + bool in_task); +void f2fs_put_page_dic(struct page *page, bool in_task); unsigned int f2fs_cluster_blocks_are_contiguous(struct dnode_of_data *dn); int f2fs_init_compress_ctx(struct compress_ctx *cc); void f2fs_destroy_compress_ctx(struct compress_ctx *cc, bool reuse); @@ -4252,13 +4262,14 @@ static inline struct page *f2fs_compress_control_page(struct page *page) } static inline int f2fs_init_compress_mempool(void) { return 0; } static inline void f2fs_destroy_compress_mempool(void) { } -static inline void f2fs_decompress_cluster(struct decompress_io_ctx *dic) { } +static inline void f2fs_decompress_cluster(struct decompress_io_ctx *dic, + bool in_task) { } static inline void f2fs_end_read_compressed_page(struct page *page, - bool failed, block_t blkaddr) + bool failed, block_t blkaddr, bool in_task) { WARN_ON_ONCE(1); } -static inline void f2fs_put_page_dic(struct page *page) +static inline void f2fs_put_page_dic(struct page *page, bool in_task) { WARN_ON_ONCE(1); } @@ -4284,8 +4295,9 @@ static inline void f2fs_update_extent_tree_range_compressed(struct inode *inode, unsigned int c_len) { } #endif -static inline void set_compress_context(struct inode *inode) +static inline int set_compress_context(struct inode *inode) { +#ifdef CONFIG_F2FS_FS_COMPRESSION struct f2fs_sb_info *sbi = F2FS_I_SB(inode); F2FS_I(inode)->i_compress_algorithm = @@ -4308,6 +4320,10 @@ static inline void set_compress_context(struct inode *inode) stat_inc_compr_inode(inode); inc_compr_inode_stat(inode); f2fs_mark_inode_dirty_sync(inode, true); + return 0; +#else + return -EOPNOTSUPP; +#endif } static inline bool f2fs_disable_compressed_file(struct inode *inode) @@ -4425,6 +4441,11 @@ static inline bool f2fs_lfs_mode(struct f2fs_sb_info *sbi) return F2FS_OPTION(sbi).fs_mode == FS_MODE_LFS; } +static inline bool f2fs_low_mem_mode(struct f2fs_sb_info *sbi) +{ + return F2FS_OPTION(sbi).memory_mode == MEMORY_MODE_LOW; +} + static inline bool f2fs_may_compress(struct inode *inode) { if (IS_SWAPFILE(inode) || f2fs_is_pinned_file(inode) || @@ -4540,6 +4561,27 @@ static inline bool f2fs_block_unit_discard(struct f2fs_sb_info *sbi) return F2FS_OPTION(sbi).discard_unit == DISCARD_UNIT_BLOCK; } +static inline void f2fs_io_schedule_timeout(long timeout) +{ + set_current_state(TASK_UNINTERRUPTIBLE); + io_schedule_timeout(timeout); +} + +static inline void f2fs_handle_page_eio(struct f2fs_sb_info *sbi, pgoff_t ofs, + enum page_type type) +{ + if (unlikely(f2fs_cp_error(sbi))) + return; + + if (ofs == sbi->page_eio_ofs[type]) { + if (sbi->page_eio_cnt[type]++ == MAX_RETRY_PAGE_EIO) + set_ckpt_flags(sbi, CP_ERROR_FLAG); + } else { + sbi->page_eio_ofs[type] = ofs; + sbi->page_eio_cnt[type] = 0; + } +} + #define EFSBADCRC EBADMSG /* Bad CRC detected */ #define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */ diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 56e3ca14d43b..d3e40a3c0918 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1881,8 +1881,8 @@ static int f2fs_setflags_common(struct inode *inode, u32 iflags, u32 mask) return -EINVAL; if (S_ISREG(inode->i_mode) && inode->i_size) return -EINVAL; - - set_compress_context(inode); + if (set_compress_context(inode)) + return -EOPNOTSUPP; } } diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index cabab34210c6..7196ae9cf9c3 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -93,14 +93,10 @@ static int gc_thread_func(void *data) */ if (sbi->gc_mode == GC_URGENT_HIGH) { spin_lock(&sbi->gc_urgent_high_lock); - if (sbi->gc_urgent_high_limited) { - if (!sbi->gc_urgent_high_remaining) { - sbi->gc_urgent_high_limited = false; - spin_unlock(&sbi->gc_urgent_high_lock); - sbi->gc_mode = GC_NORMAL; - continue; - } + if (sbi->gc_urgent_high_remaining) { sbi->gc_urgent_high_remaining--; + if (!sbi->gc_urgent_high_remaining) + sbi->gc_mode = GC_NORMAL; } spin_unlock(&sbi->gc_urgent_high_lock); } diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 966d6144fca2..4cbdce62b892 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1420,8 +1420,7 @@ repeat: err = read_node_page(page, 0); if (err < 0) { - f2fs_put_page(page, 1); - return ERR_PTR(err); + goto out_put_err; } else if (err == LOCKED_PAGE) { err = 0; goto page_hit; @@ -1447,19 +1446,23 @@ repeat: goto out_err; } page_hit: - if (unlikely(nid != nid_of_node(page))) { - f2fs_warn(sbi, "inconsistent node block, nid:%lu, node_footer[nid:%u,ino:%u,ofs:%u,cpver:%llu,blkaddr:%u]", + if (likely(nid == nid_of_node(page))) + return page; + + f2fs_warn(sbi, "inconsistent node block, nid:%lu, node_footer[nid:%u,ino:%u,ofs:%u,cpver:%llu,blkaddr:%u]", nid, nid_of_node(page), ino_of_node(page), ofs_of_node(page), cpver_of_node(page), next_blkaddr_of_node(page)); - set_sbi_flag(sbi, SBI_NEED_FSCK); - err = -EINVAL; + set_sbi_flag(sbi, SBI_NEED_FSCK); + err = -EINVAL; out_err: - ClearPageUptodate(page); - f2fs_put_page(page, 1); - return ERR_PTR(err); - } - return page; + ClearPageUptodate(page); +out_put_err: + /* ENOENT comes from read_node_page which is not an error. */ + if (err != -ENOENT) + f2fs_handle_page_eio(sbi, page->index, NODE); + f2fs_put_page(page, 1); + return ERR_PTR(err); } struct page *f2fs_get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index e6744dec4f99..868f2d25625b 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -314,8 +314,7 @@ next: skip: iput(inode); } - congestion_wait(BLK_RW_ASYNC, DEFAULT_IO_TIMEOUT); - cond_resched(); + f2fs_io_schedule_timeout(DEFAULT_IO_TIMEOUT); if (gc_failure) { if (++looped >= count) return; @@ -809,8 +808,7 @@ int f2fs_flush_device_cache(struct f2fs_sb_info *sbi) do { ret = __submit_flush_wait(sbi, FDEV(i).bdev); if (ret) - congestion_wait(BLK_RW_ASYNC, - DEFAULT_IO_TIMEOUT); + f2fs_io_schedule_timeout(DEFAULT_IO_TIMEOUT); } while (ret && --count); if (ret) { @@ -3143,7 +3141,7 @@ next: blk_finish_plug(&plug); mutex_unlock(&dcc->cmd_lock); trimmed += __wait_all_discard_cmd(sbi, NULL); - congestion_wait(BLK_RW_ASYNC, DEFAULT_IO_TIMEOUT); + f2fs_io_schedule_timeout(DEFAULT_IO_TIMEOUT); goto next; } skip: diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 1ee30a099287..ca1160d7d5e5 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -160,6 +160,7 @@ enum { Opt_gc_merge, Opt_nogc_merge, Opt_discard_unit, + Opt_memory_mode, Opt_err, }; @@ -237,6 +238,7 @@ static match_table_t f2fs_tokens = { {Opt_gc_merge, "gc_merge"}, {Opt_nogc_merge, "nogc_merge"}, {Opt_discard_unit, "discard_unit=%s"}, + {Opt_memory_mode, "memory=%s"}, {Opt_err, NULL}, }; @@ -307,10 +309,10 @@ static void f2fs_destroy_casefold_cache(void) { } static inline void limit_reserve_root(struct f2fs_sb_info *sbi) { - block_t limit = min((sbi->user_block_count << 1) / 1000, + block_t limit = min((sbi->user_block_count >> 3), sbi->user_block_count - sbi->reserved_blocks); - /* limit is 0.2% */ + /* limit is 12.5% */ if (test_opt(sbi, RESERVE_ROOT) && F2FS_OPTION(sbi).root_reserved_blocks > limit) { F2FS_OPTION(sbi).root_reserved_blocks = limit; @@ -1246,6 +1248,22 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) } kfree(name); break; + case Opt_memory_mode: + name = match_strdup(&args[0]); + if (!name) + return -ENOMEM; + if (!strcmp(name, "normal")) { + F2FS_OPTION(sbi).memory_mode = + MEMORY_MODE_NORMAL; + } else if (!strcmp(name, "low")) { + F2FS_OPTION(sbi).memory_mode = + MEMORY_MODE_LOW; + } else { + kfree(name); + return -EINVAL; + } + kfree(name); + break; default: f2fs_err(sbi, "Unrecognized mount option \"%s\" or missing value", p); @@ -1671,9 +1689,8 @@ static int f2fs_freeze(struct super_block *sb) if (is_sbi_flag_set(F2FS_SB(sb), SBI_IS_DIRTY)) return -EINVAL; - /* ensure no checkpoint required */ - if (!llist_empty(&F2FS_SB(sb)->cprc_info.issue_list)) - return -EINVAL; + /* Let's flush checkpoints and stop the thread. */ + f2fs_flush_ckpt_thread(F2FS_SB(sb)); /* to avoid deadlock on f2fs_evict_inode->SB_FREEZE_FS */ set_sbi_flag(F2FS_SB(sb), SBI_IS_FREEZING); @@ -2028,6 +2045,11 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root) else if (F2FS_OPTION(sbi).discard_unit == DISCARD_UNIT_SECTION) seq_printf(seq, ",discard_unit=%s", "section"); + if (F2FS_OPTION(sbi).memory_mode == MEMORY_MODE_NORMAL) + seq_printf(seq, ",memory=%s", "normal"); + else if (F2FS_OPTION(sbi).memory_mode == MEMORY_MODE_LOW) + seq_printf(seq, ",memory=%s", "low"); + return 0; } @@ -2050,6 +2072,7 @@ static void default_options(struct f2fs_sb_info *sbi) F2FS_OPTION(sbi).compress_ext_cnt = 0; F2FS_OPTION(sbi).compress_mode = COMPR_MODE_FS; F2FS_OPTION(sbi).bggc_mode = BGGC_MODE_ON; + F2FS_OPTION(sbi).memory_mode = MEMORY_MODE_NORMAL; sbi->sb->s_flags &= ~SB_INLINECRYPT; @@ -2156,8 +2179,7 @@ static void f2fs_enable_checkpoint(struct f2fs_sb_info *sbi) /* we should flush all the data to keep data consistency */ do { sync_inodes_sb(sbi->sb); - cond_resched(); - congestion_wait(BLK_RW_ASYNC, DEFAULT_IO_TIMEOUT); + f2fs_io_schedule_timeout(DEFAULT_IO_TIMEOUT); } while (get_pages(sbi, F2FS_DIRTY_DATA) && retry--); if (unlikely(retry < 0)) @@ -2171,6 +2193,9 @@ static void f2fs_enable_checkpoint(struct f2fs_sb_info *sbi) f2fs_up_write(&sbi->gc_lock); f2fs_sync_fs(sbi->sb, 1); + + /* Let's ensure there's no pending checkpoint anymore */ + f2fs_flush_ckpt_thread(sbi); } static int f2fs_remount(struct super_block *sb, int *flags, char *data) @@ -2337,6 +2362,9 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data) f2fs_stop_ckpt_thread(sbi); need_restart_ckpt = true; } else { + /* Flush if the prevous checkpoint, if exists. */ + f2fs_flush_ckpt_thread(sbi); + err = f2fs_start_ckpt_thread(sbi); if (err) { f2fs_err(sbi, @@ -2526,8 +2554,7 @@ retry: &page, &fsdata); if (unlikely(err)) { if (err == -ENOMEM) { - congestion_wait(BLK_RW_ASYNC, - DEFAULT_IO_TIMEOUT); + f2fs_io_schedule_timeout(DEFAULT_IO_TIMEOUT); goto retry; } set_sbi_flag(F2FS_SB(sb), SBI_QUOTA_NEED_REPAIR); diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index f240f5593394..3ccbbee77cff 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -513,7 +513,6 @@ out: if (!strcmp(a->attr.name, "gc_urgent_high_remaining")) { spin_lock(&sbi->gc_urgent_high_lock); - sbi->gc_urgent_high_limited = t != 0; sbi->gc_urgent_high_remaining = t; spin_unlock(&sbi->gc_urgent_high_lock); diff --git a/fs/fuse/OWNERS b/fs/fuse/OWNERS deleted file mode 100644 index 6c04da7a65d5..000000000000 --- a/fs/fuse/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# include OWNERS from the authoritative android-mainline branch -include kernel/common:android-mainline:/fs/fuse/OWNERS diff --git a/fs/fuse/backing.c b/fs/fuse/backing.c index 0c39771a9527..9f78384b021f 100644 --- a/fs/fuse/backing.c +++ b/fs/fuse/backing.c @@ -23,6 +23,9 @@ struct fuse_bpf_aio_req { static struct kmem_cache *fuse_bpf_aio_request_cachep; +static void fuse_stat_to_attr(struct fuse_conn *fc, struct inode *inode, + struct kstat *stat, struct fuse_attr *attr); + static void fuse_file_accessed(struct file *dst_file, struct file *src_file) { struct inode *dst_inode; @@ -181,8 +184,10 @@ void *fuse_open_finalize(struct fuse_bpf_args *fa, struct fuse_file *ff = file->private_data; struct fuse_open_out *foo = fa->out_args[0].value; - if (ff) + if (ff) { ff->fh = foo->fh; + ff->nodeid = get_fuse_inode(inode)->nodeid; + } return 0; } @@ -262,7 +267,7 @@ int fuse_create_open_backing( struct dentry *newent; int err = 0; const struct fuse_create_in *fci = fa->in_args[0].value; - struct fuse_inode *fuse_inode = get_fuse_inode(entry->d_inode); + struct inode *d_inode = entry->d_inode; u64 target_nodeid = 0; if (!dir_fuse_inode || !dir_fuse_dentry) @@ -295,8 +300,8 @@ int fuse_create_open_backing( }; path_get(&get_fuse_dentry(entry)->backing_path); - if (fuse_inode) - target_nodeid = fuse_inode->nodeid; + if (d_inode) + target_nodeid = get_fuse_inode(d_inode)->nodeid; inode = fuse_iget_backing(dir->i_sb, target_nodeid, get_fuse_dentry(entry)->backing_path.dentry->d_inode); @@ -1153,6 +1158,9 @@ int fuse_lookup_backing(struct fuse_bpf_args *fa, struct inode *dir, struct dentry *dir_backing_entry = dir_fuse_entry->backing_path.dentry; struct inode *dir_backing_inode = dir_backing_entry->d_inode; struct dentry *backing_entry; + struct fuse_entry_out *feo = (void *)fa->out_args[0].value; + struct kstat stat; + int err; /* TODO this will not handle lookups over mount points */ inode_lock_nested(dir_backing_inode, I_MUTEX_PARENT); @@ -1165,10 +1173,113 @@ int fuse_lookup_backing(struct fuse_bpf_args *fa, struct inode *dir, fuse_entry->backing_path = (struct path) { .dentry = backing_entry, - .mnt = dir_fuse_entry->backing_path.mnt, + .mnt = mntget(dir_fuse_entry->backing_path.mnt), }; - mntget(fuse_entry->backing_path.mnt); + if (d_is_negative(backing_entry)) { + fa->error_in = -ENOENT; + return 0; + } + + err = vfs_getattr(&fuse_entry->backing_path, &stat, + STATX_BASIC_STATS, 0); + if (err) { + path_put_init(&fuse_entry->backing_path); + return err; + } + + fuse_stat_to_attr(get_fuse_conn(dir), + backing_entry->d_inode, &stat, &feo->attr); + return 0; +} + +int fuse_handle_backing(struct fuse_entry_bpf *feb, struct inode **backing_inode, + struct path *backing_path) { + switch (feb->out.backing_action) { + case FUSE_ACTION_KEEP: + /* backing inode/path are added in fuse_lookup_backing */ + break; + + case FUSE_ACTION_REMOVE: + iput(*backing_inode); + *backing_inode = NULL; + path_put_init(backing_path); + break; + + case FUSE_ACTION_REPLACE: { + struct file *backing_file = feb->backing_file; + + if (!backing_file) + return -EINVAL; + if (IS_ERR(backing_file)) + return PTR_ERR(backing_file); + + if (backing_inode) + iput(*backing_inode); + *backing_inode = backing_file->f_inode; + ihold(*backing_inode); + + path_put(backing_path); + *backing_path = backing_file->f_path; + path_get(backing_path); + + fput(backing_file); + break; + } + + default: + return -EINVAL; + } + + return 0; +} + +int fuse_handle_bpf_prog(struct fuse_entry_bpf *feb, struct inode *parent, + struct bpf_prog **bpf) +{ + struct fuse_inode *pi; + + // Parent isn't presented, but we want to keep + // Don't touch bpf program at all in this case + if (feb->out.bpf_action == FUSE_ACTION_KEEP && !parent) { + goto out; + } + + if (*bpf) { + bpf_prog_put(*bpf); + *bpf = NULL; + } + + switch (feb->out.bpf_action) { + case FUSE_ACTION_KEEP: + pi = get_fuse_inode(parent); + *bpf = pi->bpf; + if (*bpf) + bpf_prog_inc(*bpf); + break; + + case FUSE_ACTION_REMOVE: + break; + + case FUSE_ACTION_REPLACE: { + struct file *bpf_file = feb->bpf_file; + struct bpf_prog *bpf_prog = ERR_PTR(-EINVAL); + + if (bpf_file && !IS_ERR(bpf_file)) + bpf_prog = fuse_get_bpf_prog(bpf_file); + + if (IS_ERR(bpf_prog)) + return PTR_ERR(bpf_prog); + + *bpf = bpf_prog; + break; + } + + default: + return -EINVAL; + } + +out: return 0; } @@ -1178,10 +1289,11 @@ struct dentry *fuse_lookup_finalize(struct fuse_bpf_args *fa, struct inode *dir, struct fuse_dentry *fd; struct dentry *bd; struct inode *inode, *backing_inode; - struct fuse_inode *fuse_inode = get_fuse_inode(entry->d_inode); + struct inode *d_inode = entry->d_inode; struct fuse_entry_out *feo = fa->out_args[0].value; struct fuse_entry_bpf_out *febo = fa->out_args[1].value; struct fuse_entry_bpf *feb = container_of(febo, struct fuse_entry_bpf, out); + int error = -1; u64 target_nodeid = 0; fd = get_fuse_dentry(entry); @@ -1194,94 +1306,28 @@ struct dentry *fuse_lookup_finalize(struct fuse_bpf_args *fa, struct inode *dir, if (!backing_inode) return 0; - if (fuse_inode) - target_nodeid = fuse_inode->nodeid; + if (d_inode) + target_nodeid = get_fuse_inode(d_inode)->nodeid; inode = fuse_iget_backing(dir->i_sb, target_nodeid, backing_inode); if (IS_ERR(inode)) return ERR_PTR(PTR_ERR(inode)); - /* TODO Make sure this handles invalid handles */ - /* TODO Do we need the same code in revalidate */ - if (get_fuse_inode(inode)->bpf) { - bpf_prog_put(get_fuse_inode(inode)->bpf); - get_fuse_inode(inode)->bpf = NULL; - } + error = fuse_handle_bpf_prog(feb, dir, &get_fuse_inode(inode)->bpf); + if (error) + return ERR_PTR(error); - switch (febo->bpf_action) { - case FUSE_ACTION_KEEP: - get_fuse_inode(inode)->bpf = get_fuse_inode(dir)->bpf; - if (get_fuse_inode(inode)->bpf) - bpf_prog_inc(get_fuse_inode(inode)->bpf); - break; - - case FUSE_ACTION_REMOVE: - get_fuse_inode(inode)->bpf = NULL; - break; - - case FUSE_ACTION_REPLACE: { - struct file *bpf_file = feb->bpf_file; - struct bpf_prog *bpf_prog = ERR_PTR(-EINVAL); - - if (bpf_file && !IS_ERR(bpf_file)) - bpf_prog = fuse_get_bpf_prog(bpf_file); - - if (IS_ERR(bpf_prog)) - return ERR_PTR(PTR_ERR(bpf_prog)); - - get_fuse_inode(inode)->bpf = bpf_prog; - break; - } - - default: - return ERR_PTR(-EIO); - } - - switch (febo->backing_action) { - case FUSE_ACTION_KEEP: - /* backing inode/path are added in fuse_lookup_backing */ - break; - - case FUSE_ACTION_REMOVE: - iput(get_fuse_inode(inode)->backing_inode); - get_fuse_inode(inode)->backing_inode = NULL; - path_put_init(&get_fuse_dentry(entry)->backing_path); - break; - - case FUSE_ACTION_REPLACE: { - struct fuse_conn *fc; - struct file *backing_file; - - fc = get_fuse_mount(dir)->fc; - backing_file = feb->backing_file; - if (!backing_file || IS_ERR(backing_file)) - return ERR_PTR(-EIO); - - iput(get_fuse_inode(inode)->backing_inode); - get_fuse_inode(inode)->backing_inode = - backing_file->f_inode; - ihold(get_fuse_inode(inode)->backing_inode); - - path_put(&get_fuse_dentry(entry)->backing_path); - get_fuse_dentry(entry)->backing_path = backing_file->f_path; - path_get(&get_fuse_dentry(entry)->backing_path); - - fput(backing_file); - break; - } - - default: - return ERR_PTR(-EIO); - } + error = fuse_handle_backing(feb, &get_fuse_inode(inode)->backing_inode, &fd->backing_path); + if (error) + return ERR_PTR(error); get_fuse_inode(inode)->nodeid = feo->nodeid; return d_splice_alias(inode, entry); } -int fuse_revalidate_backing(struct fuse_bpf_args *fa, struct inode *dir, - struct dentry *entry, unsigned int flags) +int fuse_revalidate_backing(struct dentry *entry, unsigned int flags) { struct fuse_dentry *fuse_dentry = get_fuse_dentry(entry); struct dentry *backing_entry = fuse_dentry->backing_path.dentry; @@ -1298,12 +1344,6 @@ int fuse_revalidate_backing(struct fuse_bpf_args *fa, struct inode *dir, return 1; } -void *fuse_revalidate_finalize(struct fuse_bpf_args *fa, struct inode *dir, - struct dentry *entry, unsigned int flags) -{ - return 0; -} - int fuse_canonical_path_initialize(struct fuse_bpf_args *fa, struct fuse_dummy_io *fdi, const struct path *path, diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index b8debd29573c..25ddb77d7266 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -173,6 +173,44 @@ static void fuse_lookup_init(struct fuse_conn *fc, struct fuse_args *args, args->out_args[1].value = bpf_outarg; } +#ifdef CONFIG_FUSE_BPF +static bool backing_data_changed(struct fuse_inode *fi, struct dentry *entry, + struct fuse_entry_bpf *bpf_arg) +{ + struct path new_backing_path; + struct inode *new_backing_inode; + struct bpf_prog *bpf = NULL; + int err; + bool ret = true; + + if (!entry) + return false; + + get_fuse_backing_path(entry, &new_backing_path); + new_backing_inode = fi->backing_inode; + ihold(new_backing_inode); + + err = fuse_handle_backing(bpf_arg, &new_backing_inode, &new_backing_path); + + if (err) + goto put_inode; + + err = fuse_handle_bpf_prog(bpf_arg, entry->d_parent->d_inode, &bpf); + if (err) + goto put_bpf; + + ret = (bpf != fi->bpf || fi->backing_inode != new_backing_inode || + !path_equal(&get_fuse_dentry(entry)->backing_path, &new_backing_path)); +put_bpf: + if (bpf) + bpf_prog_put(bpf); +put_inode: + iput(new_backing_inode); + path_put(&new_backing_path); + return ret; +} +#endif + /* * Check whether the dentry is still valid * @@ -193,7 +231,20 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags) inode = d_inode_rcu(entry); if (inode && fuse_is_bad(inode)) goto invalid; - else if (time_before64(fuse_dentry_time(entry), get_jiffies_64()) || + +#ifdef CONFIG_FUSE_BPF + /* TODO: Do we need bpf support for revalidate? + * If the lower filesystem says the entry is invalid, FUSE probably shouldn't + * try to fix that without going through the normal lookup path... + */ + if (get_fuse_dentry(entry)->backing_path.dentry) { + ret = fuse_revalidate_backing(entry, flags); + if (ret <= 0) { + goto out; + } + } +#endif + if (time_before64(fuse_dentry_time(entry), get_jiffies_64()) || (flags & LOOKUP_REVAL)) { struct fuse_entry_out outarg; struct fuse_entry_bpf bpf_arg; @@ -208,61 +259,44 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags) ret = -ECHILD; if (flags & LOOKUP_RCU) goto out; -#ifdef CONFIG_FUSE_BPF - { - struct fuse_err_ret fer; - - fer = fuse_bpf_backing(entry->d_parent->d_inode, - struct fuse_lookup_io, - fuse_lookup_initialize, - fuse_revalidate_backing, - fuse_revalidate_finalize, - d_inode(entry->d_parent), entry, flags); - if (fer.ret) - return PTR_ERR(fer.result); - } -#endif fm = get_fuse_mount(inode); + parent = dget_parent(entry); + +#ifdef CONFIG_FUSE_BPF + /* TODO: Once we're handling timeouts for backing inodes, do a + * bpf based lookup_revalidate here. + */ + if (get_fuse_inode(parent->d_inode)->backing_inode) { + dput(parent); + ret = 1; + goto out; + } +#endif forget = fuse_alloc_forget(); ret = -ENOMEM; - if (!forget) + if (!forget) { + dput(parent); goto out; + } attr_version = fuse_get_attr_version(fm->fc); - parent = dget_parent(entry); - fuse_lookup_init(fm->fc, &args, get_node_id(d_inode(parent)), &entry->d_name, &outarg, &bpf_arg.out); ret = fuse_simple_request(fm, &args); dput(parent); - /* - * TODO This doesn't seem sufficient, though we don't plan to - * change the backing file ever, so not sure what is correct - * here yet, especially as we can't return an error to user - */ - if (bpf_arg.out.backing_action == FUSE_ACTION_REPLACE) { - struct file *file = bpf_arg.backing_file; - - if (file && !IS_ERR(file)) - fput(file); - } - - if (bpf_arg.out.bpf_action == FUSE_ACTION_REPLACE) { - struct file *file = bpf_arg.bpf_file; - - if (file && !IS_ERR(file)) - fput(file); - } - /* Zero nodeid is same as -ENOENT */ if (!ret && !outarg.nodeid) ret = -ENOENT; - if (!ret) { + if (!ret || ret == sizeof(bpf_arg.out)) { fi = get_fuse_inode(inode); if (outarg.nodeid != get_node_id(inode) || +#ifdef CONFIG_FUSE_BPF + (ret == sizeof(bpf_arg.out) && + backing_data_changed(fi, entry, &bpf_arg)) || +#endif (bool) IS_AUTOMOUNT(inode) != (bool) (outarg.attr.flags & FUSE_ATTR_SUBMOUNT)) { fuse_queue_forget(fm->fc, forget, outarg.nodeid, 1); @@ -528,7 +562,6 @@ int fuse_lookup_name(struct super_block *sb, u64 nodeid, const struct qstr *name #ifdef CONFIG_FUSE_BPF if (err == sizeof(bpf_arg.out)) { /* TODO Make sure this handles invalid handles */ - /* TODO Do we need the same code in revalidate */ struct file *backing_file; struct inode *backing_inode; @@ -537,37 +570,29 @@ int fuse_lookup_name(struct super_block *sb, u64 nodeid, const struct qstr *name goto out_queue_forget; err = -EINVAL; - if (bpf_arg.out.backing_action != FUSE_ACTION_REPLACE) + backing_file = bpf_arg.backing_file; + if (!backing_file) goto out_queue_forget; - backing_file = bpf_arg.backing_file; - if (!backing_file || IS_ERR(backing_file)) + if (IS_ERR(backing_file)) { + err = PTR_ERR(backing_file); goto out_queue_forget; + } backing_inode = backing_file->f_inode; *inode = fuse_iget_backing(sb, outarg->nodeid, backing_inode); if (!*inode) goto bpf_arg_out; - if (bpf_arg.out.bpf_action == FUSE_ACTION_REPLACE) { - struct file *bpf_file = bpf_arg.bpf_file; - struct bpf_prog *bpf_prog = ERR_PTR(-EINVAL); - - if (bpf_file && !IS_ERR(bpf_file)) - bpf_prog = fuse_get_bpf_prog(bpf_file);; - - if (IS_ERR(bpf_prog)) { - iput(*inode); - *inode = NULL; - err = PTR_ERR(bpf_prog); - goto bpf_arg_out; - } - get_fuse_inode(*inode)->bpf = bpf_prog; - } - - get_fuse_dentry(entry)->backing_path = backing_file->f_path; - path_get(&get_fuse_dentry(entry)->backing_path); + err = fuse_handle_backing(&bpf_arg, + &get_fuse_inode(*inode)->backing_inode, + &get_fuse_dentry(entry)->backing_path); + if (err) + goto out; + err = fuse_handle_bpf_prog(&bpf_arg, NULL, &get_fuse_inode(*inode)->bpf); + if (err) + goto out; bpf_arg_out: fput(backing_file); } else diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 38bdf467ee64..87de62763a6c 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -1597,16 +1597,18 @@ struct fuse_lookup_io { struct fuse_entry_bpf feb; }; +int fuse_handle_backing(struct fuse_entry_bpf *feb, struct inode **backing_inode, + struct path *backing_path); +int fuse_handle_bpf_prog(struct fuse_entry_bpf *feb, struct inode *parent, + struct bpf_prog **bpf); + int fuse_lookup_initialize(struct fuse_bpf_args *fa, struct fuse_lookup_io *feo, struct inode *dir, struct dentry *entry, unsigned int flags); int fuse_lookup_backing(struct fuse_bpf_args *fa, struct inode *dir, struct dentry *entry, unsigned int flags); struct dentry *fuse_lookup_finalize(struct fuse_bpf_args *fa, struct inode *dir, struct dentry *entry, unsigned int flags); -int fuse_revalidate_backing(struct fuse_bpf_args *fa, struct inode *dir, - struct dentry *entry, unsigned int flags); -void *fuse_revalidate_finalize(struct fuse_bpf_args *fa, struct inode *dir, - struct dentry *entry, unsigned int flags); +int fuse_revalidate_backing(struct dentry *entry, unsigned int flags); int fuse_canonical_path_initialize(struct fuse_bpf_args *fa, struct fuse_dummy_io *fdi, diff --git a/fs/fuse/readdir.c b/fs/fuse/readdir.c index 9787a197860d..5b3123316238 100644 --- a/fs/fuse/readdir.c +++ b/fs/fuse/readdir.c @@ -20,6 +20,8 @@ static bool fuse_use_readdirplus(struct inode *dir, struct dir_context *ctx) if (!fc->do_readdirplus) return false; + if (fi->nodeid == 0) + return false; if (!fc->readdirplus_auto) return true; if (test_and_clear_bit(FUSE_I_ADVISE_RDPLUS, &fi->state)) diff --git a/fs/incfs/OWNERS b/fs/incfs/OWNERS deleted file mode 100644 index 17131f337364..000000000000 --- a/fs/incfs/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# include OWNERS from the authoritative android-mainline branch -include kernel/common:android-mainline:/fs/incfs/OWNERS diff --git a/fs/incfs/vfs.c b/fs/incfs/vfs.c index e97b843a4da5..7d349ee73bc3 100644 --- a/fs/incfs/vfs.c +++ b/fs/incfs/vfs.c @@ -1592,6 +1592,10 @@ static int incfs_setattr(struct dentry *dentry, struct iattr *ia) if (ia->ia_valid & ATTR_SIZE) return -EINVAL; + if ((ia->ia_valid & (ATTR_KILL_SUID|ATTR_KILL_SGID)) && + (ia->ia_valid & ATTR_MODE)) + return -EINVAL; + if (!di) return -EINVAL; backing_dentry = di->backing_path.dentry; diff --git a/include/OWNERS b/include/OWNERS deleted file mode 100644 index ab8142b271b4..000000000000 --- a/include/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# include OWNERS from the authoritative android-mainline branch -include kernel/common:android-mainline:/include/OWNERS diff --git a/include/linux/OWNERS b/include/linux/OWNERS deleted file mode 100644 index c88808c07797..000000000000 --- a/include/linux/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# include OWNERS from the authoritative android-mainline branch -include kernel/common:android-mainline:/include/linux/OWNERS diff --git a/include/linux/fs.h b/include/linux/fs.h index 4019e6fa3b95..8cf258fc9162 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -515,6 +515,11 @@ static inline void i_mmap_unlock_write(struct address_space *mapping) up_write(&mapping->i_mmap_rwsem); } +static inline int i_mmap_trylock_read(struct address_space *mapping) +{ + return down_read_trylock(&mapping->i_mmap_rwsem); +} + static inline void i_mmap_lock_read(struct address_space *mapping) { down_read(&mapping->i_mmap_rwsem); diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 7482da1ea67b..26f49f146f02 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h @@ -130,6 +130,11 @@ static inline void anon_vma_lock_read(struct anon_vma *anon_vma) down_read(&anon_vma->root->rwsem); } +static inline int anon_vma_trylock_read(struct anon_vma *anon_vma) +{ + return down_read_trylock(&anon_vma->root->rwsem); +} + static inline void anon_vma_unlock_read(struct anon_vma *anon_vma) { up_read(&anon_vma->root->rwsem); @@ -252,17 +257,14 @@ void try_to_munlock(struct page *); void remove_migration_ptes(struct page *old, struct page *new, bool locked); -/* - * Called by memory-failure.c to kill processes. - */ -struct anon_vma *page_lock_anon_vma_read(struct page *page); -void page_unlock_anon_vma_read(struct anon_vma *anon_vma); int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); /* * rmap_walk_control: To control rmap traversing for specific needs * * arg: passed to rmap_one() and invalid_vma() + * try_lock: bail out if the rmap lock is contended + * contended: indicate the rmap traversal bailed out due to lock contention * rmap_one: executed on each vma where page is mapped * done: for checking traversing termination condition * anon_lock: for getting anon_lock by optimized way rather than default @@ -270,6 +272,8 @@ int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); */ struct rmap_walk_control { void *arg; + bool try_lock; + bool contended; /* * Return false if page table scanning in rmap_walk should be stopped. * Otherwise, return true. @@ -277,13 +281,21 @@ struct rmap_walk_control { bool (*rmap_one)(struct page *page, struct vm_area_struct *vma, unsigned long addr, void *arg); int (*done)(struct page *page); - struct anon_vma *(*anon_lock)(struct page *page); + struct anon_vma *(*anon_lock)(struct page *page, + struct rmap_walk_control *rwc); bool (*invalid_vma)(struct vm_area_struct *vma, void *arg); }; void rmap_walk(struct page *page, struct rmap_walk_control *rwc); void rmap_walk_locked(struct page *page, struct rmap_walk_control *rwc); +/* + * Called by memory-failure.c to kill processes. + */ +struct anon_vma *page_lock_anon_vma_read(struct page *page, + struct rmap_walk_control *rwc); +void page_unlock_anon_vma_read(struct anon_vma *anon_vma); + #else /* !CONFIG_MMU */ #define anon_vma_init() do {} while (0) diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h index 3c31ba88aca5..581ee79550de 100644 --- a/include/linux/sched/sysctl.h +++ b/include/linux/sched/sysctl.h @@ -92,6 +92,13 @@ int sysctl_numa_balancing(struct ctl_table *table, int write, void *buffer, int sysctl_schedstats(struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos); +#ifdef CONFIG_SMP +extern unsigned int sysctl_sched_pelt_multiplier; + +int sched_pelt_multiplier(struct ctl_table *table, int write, void *buffer, + size_t *lenp, loff_t *ppos); +#endif + #if defined(CONFIG_ENERGY_MODEL) && defined(CONFIG_CPU_FREQ_GOV_SCHEDUTIL) extern unsigned int sysctl_sched_energy_aware; int sched_energy_aware_handler(struct ctl_table *table, int write, diff --git a/include/net/xfrm.h b/include/net/xfrm.h index b07e6748f539..db752708b2a5 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -1034,6 +1034,7 @@ struct xfrm_offload { struct sec_path { int len; int olen; + int verified_cnt; struct xfrm_state *xvec[XFRM_MAX_DEPTH]; struct xfrm_offload ovec[XFRM_MAX_OFFLOAD_DEPTH]; diff --git a/include/sound/hdmi-codec.h b/include/sound/hdmi-codec.h index b55970859a13..4fc733c8c570 100644 --- a/include/sound/hdmi-codec.h +++ b/include/sound/hdmi-codec.h @@ -34,6 +34,11 @@ struct hdmi_codec_daifmt { unsigned int frame_clk_inv:1; unsigned int bit_clk_master:1; unsigned int frame_clk_master:1; + /* bit_fmt could be standard PCM format or + * IEC958 encoded format. ALSA IEC958 plugin will pass + * IEC958_SUBFRAME format to the underneath driver. + */ + snd_pcm_format_t bit_fmt; }; /* @@ -60,12 +65,22 @@ struct hdmi_codec_ops { /* * Configures HDMI-encoder for audio stream. - * Mandatory + * Having either prepare or hw_params is mandatory. */ int (*hw_params)(struct device *dev, void *data, struct hdmi_codec_daifmt *fmt, struct hdmi_codec_params *hparms); + /* + * Configures HDMI-encoder for audio stream. Can be called + * multiple times for each setup. + * + * Having either prepare or hw_params is mandatory. + */ + int (*prepare)(struct device *dev, void *data, + struct hdmi_codec_daifmt *fmt, + struct hdmi_codec_params *hparms); + /* * Shuts down the audio stream. * Mandatory diff --git a/include/sound/pcm_iec958.h b/include/sound/pcm_iec958.h index 0939aa45e2fe..64e84441cde1 100644 --- a/include/sound/pcm_iec958.h +++ b/include/sound/pcm_iec958.h @@ -4,6 +4,14 @@ #include +int snd_pcm_create_iec958_consumer_default(u8 *cs, size_t len); + +int snd_pcm_fill_iec958_consumer(struct snd_pcm_runtime *runtime, u8 *cs, + size_t len); + +int snd_pcm_fill_iec958_consumer_hw_params(struct snd_pcm_hw_params *params, + u8 *cs, size_t len); + int snd_pcm_create_iec958_consumer(struct snd_pcm_runtime *runtime, u8 *cs, size_t len); diff --git a/include/trace/events/OWNERS b/include/trace/events/OWNERS deleted file mode 100644 index de3838b6df38..000000000000 --- a/include/trace/events/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# include OWNERS from the authoritative android-mainline branch -include kernel/common:android-mainline:/include/trace/events/OWNERS diff --git a/include/trace/hooks/binder.h b/include/trace/hooks/binder.h index 001780156c5d..c46264c38dde 100644 --- a/include/trace/hooks/binder.h +++ b/include/trace/hooks/binder.h @@ -10,7 +10,6 @@ * Following tracepoints are not exported in tracefs and provide a * mechanism for vendor modules to hook and extend functionality */ -#ifdef __GENKSYMS__ struct binder_alloc; struct binder_proc; struct binder_thread; @@ -18,18 +17,7 @@ struct binder_transaction; struct task_struct; struct seq_file; struct binder_transaction_data; -#else -/* struct binder_alloc */ -#include <../drivers/android/binder_alloc.h> -/* struct binder_proc, struct binder_thread, struct binder_transaction */ -#include <../drivers/android/binder_internal.h> -/* struct task_struct */ -#include -/* struct seq_file */ -#include -/* struct binder_transaction_data */ -#include -#endif /* __GENKSYMS__ */ + DECLARE_HOOK(android_vh_binder_transaction_init, TP_PROTO(struct binder_transaction *t), TP_ARGS(t)); diff --git a/include/trace/hooks/block.h b/include/trace/hooks/block.h index 0828a306ea13..e8bee374f989 100644 --- a/include/trace/hooks/block.h +++ b/include/trace/hooks/block.h @@ -9,18 +9,9 @@ #include -#ifdef __GENKSYMS__ struct blk_mq_tags; struct blk_mq_alloc_data; struct blk_mq_tag_set; -#else -/* struct blk_mq_tags */ -#include <../block/blk-mq-tag.h> -/* struct blk_mq_alloc_data */ -#include <../block/blk-mq.h> -/* struct blk_mq_tag_set */ -#include -#endif /* __GENKSYMS__ */ DECLARE_HOOK(android_vh_blk_alloc_rqs, TP_PROTO(size_t *rq_size, struct blk_mq_tag_set *set, diff --git a/include/trace/hooks/cgroup.h b/include/trace/hooks/cgroup.h index 5546d390cb50..116a2afabf99 100644 --- a/include/trace/hooks/cgroup.h +++ b/include/trace/hooks/cgroup.h @@ -7,18 +7,10 @@ #define _TRACE_HOOK_CGROUP_H #include -#ifdef __GENKSYMS__ struct cgroup_taskset; struct cgroup_subsys; struct task_struct; -#else -/* Including ../kernel/cgroup/cgroup-internal.h breaks builds. */ -struct cgroup_taskset; -/* struct cgroup_subsys */ -#include -/* struct task_struct */ -#include -#endif /* __GENKSYMS__ */ + DECLARE_HOOK(android_vh_cgroup_set_task, TP_PROTO(int ret, struct task_struct *task), TP_ARGS(ret, task)); diff --git a/include/trace/hooks/cpufreq.h b/include/trace/hooks/cpufreq.h index 70f90a3ef25c..2739a0f9a547 100644 --- a/include/trace/hooks/cpufreq.h +++ b/include/trace/hooks/cpufreq.h @@ -6,10 +6,15 @@ #if !defined(_TRACE_HOOK_CPUFREQ_H) || defined(TRACE_HEADER_MULTI_READ) #define _TRACE_HOOK_CPUFREQ_H - -#include #include +#ifdef __GENKSYMS__ +#include +#endif + +struct cpufreq_policy; +struct task_struct; + DECLARE_HOOK(android_vh_show_max_freq, TP_PROTO(struct cpufreq_policy *policy, unsigned int *max_freq), TP_ARGS(policy, max_freq)); diff --git a/include/trace/hooks/cpuidle.h b/include/trace/hooks/cpuidle.h index 9addbdf32913..c2ddabe37b00 100644 --- a/include/trace/hooks/cpuidle.h +++ b/include/trace/hooks/cpuidle.h @@ -9,12 +9,7 @@ #include -#ifdef __GENKSYMS__ struct cpuidle_device; -#else -/* struct cpuidle_device */ -#include -#endif /* __GENKSYMS__ */ DECLARE_HOOK(android_vh_cpu_idle_enter, TP_PROTO(int *state, struct cpuidle_device *dev), diff --git a/include/trace/hooks/cpuidle_psci.h b/include/trace/hooks/cpuidle_psci.h index 4881f35712c0..3ca307a3d82b 100644 --- a/include/trace/hooks/cpuidle_psci.h +++ b/include/trace/hooks/cpuidle_psci.h @@ -10,12 +10,8 @@ * mechanism for vendor modules to hook and extend functionality */ -#ifdef __GENKSYMS__ struct cpuidle_device; -#else -/* struct cpuidle_device */ -#include -#endif /* __GENKSYMS__ */ + DECLARE_HOOK(android_vh_cpuidle_psci_enter, TP_PROTO(struct cpuidle_device *dev, bool s2idle), TP_ARGS(dev, s2idle)); diff --git a/include/trace/hooks/creds.h b/include/trace/hooks/creds.h index 9544ee2e827c..12f92be91c24 100644 --- a/include/trace/hooks/creds.h +++ b/include/trace/hooks/creds.h @@ -10,15 +10,9 @@ * Following tracepoints are not exported in tracefs and provide a * mechanism for vendor modules to hook and extend functionality */ -#ifdef __GENKSYMS__ struct cred; struct task_struct; -#else -/* struct cred */ -#include -/* struct task_struct */ -#include -#endif /* __GENKSYMS__ */ + DECLARE_HOOK(android_vh_commit_creds, TP_PROTO(const struct task_struct *task, const struct cred *new), TP_ARGS(task, new)); diff --git a/include/trace/hooks/debug.h b/include/trace/hooks/debug.h index 892c60ac6f34..5a20141d742b 100644 --- a/include/trace/hooks/debug.h +++ b/include/trace/hooks/debug.h @@ -9,21 +9,11 @@ #include -#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS) -#ifdef __GENKSYMS__ struct pt_regs; -#else -/* struct pt_regs */ -#include -#endif /* __GENKSYMS__ */ DECLARE_HOOK(android_vh_ipi_stop, TP_PROTO(struct pt_regs *regs), TP_ARGS(regs)) -#else -#define trace_android_vh_ipi_stop(regs) -#define trace_android_vh_ipi_stop_rcuidle(regs) -#endif #endif /* _TRACE_HOOK_DEBUG_H */ /* This part must be outside protection */ diff --git a/include/trace/hooks/dtask.h b/include/trace/hooks/dtask.h index be037865cdbc..749dc5b4078b 100644 --- a/include/trace/hooks/dtask.h +++ b/include/trace/hooks/dtask.h @@ -10,21 +10,11 @@ * Following tracepoints are not exported in tracefs and provide a * mechanism for vendor modules to hook and extend functionality */ -#ifdef __GENKSYMS__ struct mutex; struct rt_mutex; struct rw_semaphore; struct task_struct; -#else -/* struct mutex */ -#include -/* struct rt_mutex */ -#include -/* struct rw_semaphore */ -#include -/* struct task_struct */ -#include -#endif /* __GENKSYMS__ */ + DECLARE_HOOK(android_vh_mutex_wait_start, TP_PROTO(struct mutex *lock), TP_ARGS(lock)); diff --git a/include/trace/hooks/fault.h b/include/trace/hooks/fault.h index 920772177bb0..1b6e0b0911f5 100644 --- a/include/trace/hooks/fault.h +++ b/include/trace/hooks/fault.h @@ -10,12 +10,8 @@ * Following tracepoints are not exported in tracefs and provide a * mechanism for vendor modules to hook and extend functionality */ -#ifdef __GENKSYMS__ struct pt_regs; -#else -/* struct pt_regs */ -#include -#endif /* __GENKSYMS__ */ + DECLARE_RESTRICTED_HOOK(android_rvh_die_kernel_fault, TP_PROTO(struct pt_regs *regs, unsigned int esr, unsigned long addr, const char *msg), TP_ARGS(regs, esr, addr, msg), 1); diff --git a/include/trace/hooks/fips140.h b/include/trace/hooks/fips140.h index 6a777771a6c8..fd4a42c013c7 100644 --- a/include/trace/hooks/fips140.h +++ b/include/trace/hooks/fips140.h @@ -7,12 +7,7 @@ #define _TRACE_HOOK_FIPS140_H #include -#ifdef __GENKSYMS__ struct crypto_aes_ctx; -#else -/* struct crypto_aes_ctx */ -#include -#endif /* __GENKSYMS__ */ /* * These hooks exist only for the benefit of the FIPS140 crypto module, which diff --git a/include/trace/hooks/fpsimd.h b/include/trace/hooks/fpsimd.h deleted file mode 100644 index 1141ebb1a1c6..000000000000 --- a/include/trace/hooks/fpsimd.h +++ /dev/null @@ -1,27 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM fpsimd - -#define TRACE_INCLUDE_PATH trace/hooks - -#if !defined(_TRACE_HOOK_FPSIMD_H) || defined(TRACE_HEADER_MULTI_READ) -#define _TRACE_HOOK_FPSIMD_H - -#include - -#ifdef __GENKSYMS__ -struct task_struct; -#else -/* struct task_struct */ -#include -#endif /* __GENKSYMS__ */ - -DECLARE_HOOK(android_vh_is_fpsimd_save, - TP_PROTO(struct task_struct *prev, struct task_struct *next), - TP_ARGS(prev, next)) - -/* macro versions of hooks are no longer required */ - -#endif /* _TRACE_HOOK_FPSIMD_H */ -/* This part must be outside protection */ -#include diff --git a/include/trace/hooks/ftrace_dump.h b/include/trace/hooks/ftrace_dump.h index b63d9c809426..0594e8bee2e2 100644 --- a/include/trace/hooks/ftrace_dump.h +++ b/include/trace/hooks/ftrace_dump.h @@ -6,11 +6,14 @@ #if !defined(_TRACE_HOOK_FTRACE_DUMP_H) || defined(TRACE_HEADER_MULTI_READ) #define _TRACE_HOOK_FTRACE_DUMP_H +#include +#ifdef __GENKSYMS__ #include #include +#endif -#include +struct trace_seq; DECLARE_HOOK(android_vh_ftrace_oops_enter, TP_PROTO(bool *ftrace_check), diff --git a/include/trace/hooks/gic_v3.h b/include/trace/hooks/gic_v3.h index 8db98581eebc..647514f8d7a4 100644 --- a/include/trace/hooks/gic_v3.h +++ b/include/trace/hooks/gic_v3.h @@ -9,15 +9,9 @@ * Following tracepoints are not exported in tracefs and provide a * mechanism for vendor modules to hook and extend functionality */ -#ifdef __GENKSYMS__ struct cpumask; struct irq_data; -#else -/* struct cpumask */ -#include -/* struct irq_data */ -#include -#endif /* __GENKSYMS__ */ + DECLARE_HOOK(android_vh_gic_v3_affinity_init, TP_PROTO(int irq, u32 offset, u64 *affinity), TP_ARGS(irq, offset, affinity)); diff --git a/include/trace/hooks/gpiolib.h b/include/trace/hooks/gpiolib.h index 24cb3f54fb82..20115981de55 100644 --- a/include/trace/hooks/gpiolib.h +++ b/include/trace/hooks/gpiolib.h @@ -8,15 +8,16 @@ #define _TRACE_HOOK_GPIOLIB_H #include -#include "../drivers/gpio/gpiolib.h" -#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS) +#ifdef __GENKSYMS__ +#include "../drivers/gpio/gpiolib.h" +#endif + +struct gpio_device; + DECLARE_HOOK(android_vh_gpio_block_read, TP_PROTO(struct gpio_device *gdev, bool *block_gpio_read), TP_ARGS(gdev, block_gpio_read)); -#else -#define trace_android_vh_gpio_block_read(gdev, block_gpio_read) -#endif #endif /* _TRACE_HOOK_GPIOLIB_H */ /* This part must be outside protection */ diff --git a/include/trace/hooks/gup.h b/include/trace/hooks/gup.h index 3135cd538a92..47ea47eeede4 100644 --- a/include/trace/hooks/gup.h +++ b/include/trace/hooks/gup.h @@ -7,12 +7,7 @@ #define _TRACE_HOOK_GUP_H #include -#ifdef __GENKSYMS__ struct page; -#else -/* struct page */ -#include -#endif /* __GENKSYMS__ */ DECLARE_HOOK(android_vh_try_grab_compound_head, TP_PROTO(struct page *page, int refs, unsigned int flags, bool *ret), diff --git a/include/trace/hooks/iommu.h b/include/trace/hooks/iommu.h index 6c30cb7932fa..c09f1a4bf65a 100644 --- a/include/trace/hooks/iommu.h +++ b/include/trace/hooks/iommu.h @@ -11,7 +11,6 @@ #include -#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS) DECLARE_RESTRICTED_HOOK(android_rvh_iommu_setup_dma_ops, TP_PROTO(struct device *dev, u64 dma_base, u64 size), TP_ARGS(dev, dma_base, size), 1); @@ -23,13 +22,6 @@ DECLARE_HOOK(android_vh_iommu_alloc_iova, DECLARE_HOOK(android_vh_iommu_free_iova, TP_PROTO(dma_addr_t iova, size_t size), TP_ARGS(iova, size)); -#else - -#define trace_android_rvh_iommu_setup_dma_ops(dev, dma_base, size) -#define trace_android_vh_iommu_alloc_iova(dev, iova, size) -#define trace_android_vh_iommu_free_iova(iova, size) - -#endif #endif /* _TRACE_HOOK_IOMMU_H */ diff --git a/include/trace/hooks/logbuf.h b/include/trace/hooks/logbuf.h index caec0d062476..c5ad3ba85174 100644 --- a/include/trace/hooks/logbuf.h +++ b/include/trace/hooks/logbuf.h @@ -9,13 +9,8 @@ #include -#ifdef __GENKSYMS__ struct printk_record; struct printk_ringbuffer; -#else -/* struct printk_record, struct printk_ringbuffer */ -#include <../kernel/printk/printk_ringbuffer.h> -#endif /* __GENKSYMS__ */ DECLARE_HOOK(android_vh_logbuf, TP_PROTO(struct printk_ringbuffer *rb, struct printk_record *r), diff --git a/include/trace/hooks/mm.h b/include/trace/hooks/mm.h index c6a017a0ea4d..263b867d453c 100644 --- a/include/trace/hooks/mm.h +++ b/include/trace/hooks/mm.h @@ -8,31 +8,23 @@ #define _TRACE_HOOK_MM_H #include - -#include -#include #include #ifdef __GENKSYMS__ +#include +#include +#endif + +struct oom_control; struct cma; struct acr_info; struct compact_control; struct slabinfo; struct cgroup_subsys_state; struct mem_cgroup; -#else -/* struct compact_control */ -#include <../mm/internal.h> -/* struct slabinfo */ -#include <../mm/slab.h> -/* struct cgroup_subsys_state */ -#include -/* struct acr_info */ -#include -/* struct mem_cgroup */ -#include -#endif /* __GENKSYMS__ */ struct cma; +struct acr_info; +struct vm_unmapped_area_info; DECLARE_RESTRICTED_HOOK(android_rvh_set_skip_swapcache_flags, TP_PROTO(gfp_t *flags), @@ -130,9 +122,6 @@ DECLARE_HOOK(android_vh_show_stack_hash, DECLARE_HOOK(android_vh_save_track_hash, TP_PROTO(bool alloc, unsigned long p), TP_ARGS(alloc, p)); -DECLARE_HOOK(android_vh_vmpressure, - TP_PROTO(struct mem_cgroup *memcg, bool *bypass), - TP_ARGS(memcg, bypass)); DECLARE_HOOK(android_vh_mem_cgroup_alloc, TP_PROTO(struct mem_cgroup *memcg), TP_ARGS(memcg)); @@ -148,6 +137,14 @@ DECLARE_HOOK(android_vh_mem_cgroup_css_online, DECLARE_HOOK(android_vh_mem_cgroup_css_offline, TP_PROTO(struct cgroup_subsys_state *css, struct mem_cgroup *memcg), TP_ARGS(css, memcg)); +DECLARE_HOOK(android_vh_alloc_pages_reclaim_bypass, + TP_PROTO(gfp_t gfp_mask, int order, int alloc_flags, + int migratetype, struct page **page), + TP_ARGS(gfp_mask, order, alloc_flags, migratetype, page)); +DECLARE_HOOK(android_vh_alloc_pages_failure_bypass, + TP_PROTO(gfp_t gfp_mask, int order, int alloc_flags, + int migratetype, struct page **page), + TP_ARGS(gfp_mask, order, alloc_flags, migratetype, page)); /* macro versions of hooks are no longer required */ #endif /* _TRACE_HOOK_MM_H */ diff --git a/include/trace/hooks/mmc_core.h b/include/trace/hooks/mmc_core.h index 1889cc54a2b3..c59b4accc9fd 100644 --- a/include/trace/hooks/mmc_core.h +++ b/include/trace/hooks/mmc_core.h @@ -9,18 +9,9 @@ #include -#ifdef __GENKSYMS__ struct sdhci_host; struct mmc_card; struct mmc_host; -#else -/* struct sdhci_host */ -#include <../drivers/mmc/host/sdhci.h> -/* struct mmc_card */ -#include -/* struct mmc_host */ -#include -#endif /* __GENKSYMS__ */ DECLARE_HOOK(android_vh_mmc_blk_reset, TP_PROTO(struct mmc_host *host, int err, bool *allow), diff --git a/include/trace/hooks/module.h b/include/trace/hooks/module.h deleted file mode 100644 index 9188e5556aac..000000000000 --- a/include/trace/hooks/module.h +++ /dev/null @@ -1,29 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM module - -#define TRACE_INCLUDE_PATH trace/hooks -#if !defined(_TRACE_HOOK_MODULE_H) || defined(TRACE_HEADER_MULTI_READ) -#define _TRACE_HOOK_MODULE_H -#include -/* - * Following tracepoints are not exported in tracefs and provide a - * mechanism for vendor modules to hook and extend functionality - */ -#ifdef __GENKSYMS__ -struct module; -#else -/* struct module */ -#include -#endif /* __GENKSYMS__ */ -DECLARE_HOOK(android_vh_set_module_permit_before_init, - TP_PROTO(const struct module *mod), - TP_ARGS(mod)); - -DECLARE_HOOK(android_vh_set_module_permit_after_init, - TP_PROTO(const struct module *mod), - TP_ARGS(mod)); - -#endif /* _TRACE_HOOK_MODULE_H */ -/* This part must be outside protection */ -#include diff --git a/include/trace/hooks/mpam.h b/include/trace/hooks/mpam.h index f7f5e468bcef..06b96b1309f8 100644 --- a/include/trace/hooks/mpam.h +++ b/include/trace/hooks/mpam.h @@ -10,12 +10,8 @@ * Following tracepoints are not exported in tracefs and provide a * mechanism for vendor modules to hook and extend functionality */ -#ifdef __GENKSYMS__ struct task_struct; -#else -/* struct task_struct */ -#include -#endif /* __GENKSYMS__ */ + DECLARE_HOOK(android_vh_mpam_set, TP_PROTO(struct task_struct *prev, struct task_struct *next), TP_ARGS(prev, next)); diff --git a/include/trace/hooks/net.h b/include/trace/hooks/net.h index 97f15ba6ae3c..4fcd632b2f96 100644 --- a/include/trace/hooks/net.h +++ b/include/trace/hooks/net.h @@ -8,24 +8,12 @@ #define _TRACE_HOOK_NET_VH_H #include -#ifdef __GENKSYMS__ struct packet_type; struct sk_buff; struct list_head; struct nf_conn; struct sock; -#else -/* struct packet_type */ -#include -/* struct sk_buff */ -#include -/* struct list_head */ -#include -/* struct nf_conn */ -#include -/* struct sock */ -#include -#endif /* __GENKSYMS__ */ + DECLARE_HOOK(android_vh_ptype_head, TP_PROTO(const struct packet_type *pt, struct list_head *vendor_pt), TP_ARGS(pt, vendor_pt)); diff --git a/include/trace/hooks/pci.h b/include/trace/hooks/pci.h index 00d38980ec49..40255448c83c 100644 --- a/include/trace/hooks/pci.h +++ b/include/trace/hooks/pci.h @@ -6,6 +6,9 @@ #if !defined(_TRACE_HOOK_PCI_H) || defined(TRACE_HEADER_MULTI_READ) #define _TRACE_HOOK_PCI_H #include + +struct pci_dev; + /* * Following tracepoints are not exported in tracefs and provide a * mechanism for vendor modules to hook and extend functionality diff --git a/include/trace/hooks/pm_domain.h b/include/trace/hooks/pm_domain.h index 1a8ce26ccc3d..eaee85b9c00c 100644 --- a/include/trace/hooks/pm_domain.h +++ b/include/trace/hooks/pm_domain.h @@ -10,12 +10,8 @@ #include -#ifdef __GENKSYMS__ struct generic_pm_domain; -#else -/* struct generic_pm_domain */ -#include -#endif /* __GENKSYMS__ */ + DECLARE_HOOK(android_vh_allow_domain_state, TP_PROTO(struct generic_pm_domain *genpd, uint32_t idx, bool *allow), TP_ARGS(genpd, idx, allow)) diff --git a/include/trace/hooks/power.h b/include/trace/hooks/power.h index aab4b37b2d6a..f9b7bbec1531 100644 --- a/include/trace/hooks/power.h +++ b/include/trace/hooks/power.h @@ -10,21 +10,22 @@ * Following tracepoints are not exported in tracefs and provide a * mechanism for vendor modules to hook and extend functionality */ -#ifdef __GENKSYMS__ -enum freq_qos_req_type; + +/* needed for enum freq_qos_req_types */ +#include + struct freq_constraints; struct freq_qos_request; struct task_struct; -#else -/* enum freq_qos_req_type, struct freq_constraints, struct freq_qos_request */ -#include -/* struct task_struct */ -#include -#endif /* __GENKSYMS__ */ + DECLARE_HOOK(android_vh_try_to_freeze_todo, TP_PROTO(unsigned int todo, unsigned int elapsed_msecs, bool wq_busy), TP_ARGS(todo, elapsed_msecs, wq_busy)); +DECLARE_HOOK(android_vh_try_to_freeze_todo_logging, + TP_PROTO(bool *logging_on), + TP_ARGS(logging_on)); + DECLARE_HOOK(android_vh_try_to_freeze_todo_unfrozen, TP_PROTO(struct task_struct *p), TP_ARGS(p)); diff --git a/include/trace/hooks/psi.h b/include/trace/hooks/psi.h index ffda9543357e..deeb3dfbeeb0 100644 --- a/include/trace/hooks/psi.h +++ b/include/trace/hooks/psi.h @@ -9,15 +9,9 @@ #include -#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS) - -#ifdef __GENKSYMS__ struct psi_group; struct psi_trigger; -#else -/* struct psi_group, struct psi_trigger */ -#include -#endif /* __GENKSYMS__ */ + DECLARE_HOOK(android_vh_psi_event, TP_PROTO(struct psi_trigger *t), TP_ARGS(t)); @@ -26,11 +20,6 @@ DECLARE_HOOK(android_vh_psi_group, TP_PROTO(struct psi_group *group), TP_ARGS(group)); -#else -#define trace_android_vh_psi_event(t) -#define trace_android_vh_psi_group(group) -#endif - #endif /* _TRACE_HOOK_PSI_H */ /* This part must be outside protection */ diff --git a/include/trace/hooks/remoteproc.h b/include/trace/hooks/remoteproc.h index 4d3311b1fee4..ee0a2f0ea147 100644 --- a/include/trace/hooks/remoteproc.h +++ b/include/trace/hooks/remoteproc.h @@ -9,12 +9,7 @@ #include -#ifdef __GENKSYMS__ struct rproc; -#else -/* struct rproc */ -#include -#endif /* __GENKSYMS__ */ DECLARE_HOOK(android_vh_rproc_recovery, TP_PROTO(struct rproc *rproc), diff --git a/include/trace/hooks/rwsem.h b/include/trace/hooks/rwsem.h index 3d6877f166ed..e3fd21729eee 100644 --- a/include/trace/hooks/rwsem.h +++ b/include/trace/hooks/rwsem.h @@ -9,13 +9,9 @@ * Following tracepoints are not exported in tracefs and provide a * mechanism for vendor modules to hook and extend functionality */ -#ifdef __GENKSYMS__ struct rw_semaphore; struct rwsem_waiter; -#else -/* struct rw_semaphore, struct rwsem_waiter */ -#include -#endif /* __GENKSYMS__ */ + DECLARE_HOOK(android_vh_rwsem_init, TP_PROTO(struct rw_semaphore *sem), TP_ARGS(sem)); diff --git a/include/trace/hooks/sched.h b/include/trace/hooks/sched.h index cdb3bf7dda52..4233384f6ff8 100644 --- a/include/trace/hooks/sched.h +++ b/include/trace/hooks/sched.h @@ -9,7 +9,6 @@ * Following tracepoints are not exported in tracefs and provide a * mechanism for vendor modules to hook and extend functionality */ -#ifdef __GENKSYMS__ struct cgroup_taskset; struct cgroup_subsys_state; struct cpufreq_policy; @@ -18,20 +17,7 @@ enum uclamp_id; struct sched_entity; struct task_struct; struct uclamp_se; -#else -/* Including ../kernel/cgroup/cgroup-internal.h breaks builds. */ -struct cgroup_taskset; -/* struct cgroup_subsys_state */ -#include -/* struct cpufreq_policy */ -#include -/* struct em_perf_domain */ -#include -/* enum uclamp_id, struct sched_entity, struct task_struct, struct uclamp_se */ -#include -/* Only defined with CONFIG_UCLAMP_TASK, so declare unconditionally. */ -struct uclamp_se; -#endif /* __GENKSYMS__ */ + DECLARE_RESTRICTED_HOOK(android_rvh_select_task_rq_fair, TP_PROTO(struct task_struct *p, int prev_cpu, int sd_flag, int wake_flags, int *new_cpu), TP_ARGS(p, prev_cpu, sd_flag, wake_flags, new_cpu), 1); @@ -159,66 +145,14 @@ DECLARE_RESTRICTED_HOOK(android_rvh_set_task_cpu, TP_PROTO(struct task_struct *p, unsigned int new_cpu), TP_ARGS(p, new_cpu), 1); -DECLARE_RESTRICTED_HOOK(android_rvh_try_to_wake_up, - TP_PROTO(struct task_struct *p), - TP_ARGS(p), 1); - -DECLARE_RESTRICTED_HOOK(android_rvh_try_to_wake_up_success, - TP_PROTO(struct task_struct *p), - TP_ARGS(p), 1); - DECLARE_RESTRICTED_HOOK(android_rvh_sched_fork, TP_PROTO(struct task_struct *p), TP_ARGS(p), 1); -DECLARE_RESTRICTED_HOOK(android_rvh_wake_up_new_task, - TP_PROTO(struct task_struct *p), - TP_ARGS(p), 1); - -DECLARE_RESTRICTED_HOOK(android_rvh_new_task_stats, - TP_PROTO(struct task_struct *p), - TP_ARGS(p), 1); - -DECLARE_RESTRICTED_HOOK(android_rvh_flush_task, - TP_PROTO(struct task_struct *prev), - TP_ARGS(prev), 1); - -DECLARE_RESTRICTED_HOOK(android_rvh_tick_entry, - TP_PROTO(struct rq *rq), - TP_ARGS(rq), 1); - -DECLARE_RESTRICTED_HOOK(android_rvh_schedule, - TP_PROTO(struct task_struct *prev, struct task_struct *next, struct rq *rq), - TP_ARGS(prev, next, rq), 1); - -DECLARE_RESTRICTED_HOOK(android_rvh_sched_cpu_starting, - TP_PROTO(int cpu), - TP_ARGS(cpu), 1); - -DECLARE_RESTRICTED_HOOK(android_rvh_sched_cpu_dying, - TP_PROTO(int cpu), - TP_ARGS(cpu), 1); - -DECLARE_RESTRICTED_HOOK(android_rvh_account_irq, - TP_PROTO(struct task_struct *curr, int cpu, s64 delta), - TP_ARGS(curr, cpu, delta), 1); - -DECLARE_RESTRICTED_HOOK(android_rvh_place_entity, - TP_PROTO(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial, u64 vruntime), - TP_ARGS(cfs_rq, se, initial, vruntime), 1); - DECLARE_RESTRICTED_HOOK(android_rvh_build_perf_domains, TP_PROTO(bool *eas_check), TP_ARGS(eas_check), 1); -DECLARE_RESTRICTED_HOOK(android_rvh_update_cpu_capacity, - TP_PROTO(int cpu, unsigned long *capacity), - TP_ARGS(cpu, capacity), 1); - -DECLARE_RESTRICTED_HOOK(android_rvh_update_misfit_status, - TP_PROTO(struct task_struct *p, struct rq *rq, bool *need_update), - TP_ARGS(p, rq, need_update), 1); - DECLARE_RESTRICTED_HOOK(android_rvh_cpu_cgroup_attach, TP_PROTO(struct cgroup_taskset *tset), TP_ARGS(tset), 1); @@ -451,6 +385,17 @@ DECLARE_RESTRICTED_HOOK(android_rvh_update_rq_clock_pelt, TP_PROTO(struct rq *rq, s64 delta, bool *ret), TP_ARGS(rq, delta, ret), 1); +DECLARE_HOOK(android_vh_pidfd_open, + TP_PROTO(struct pid *p), + TP_ARGS(p)); + +DECLARE_HOOK(android_vh_mmput, + TP_PROTO(void *unused), + TP_ARGS(unused)); + +DECLARE_HOOK(android_vh_rebuild_root_domains_bypass, + TP_PROTO(bool tasks_frozen, bool *bypass), + TP_ARGS(tasks_frozen, bypass)); /* macro versions of hooks are no longer required */ #endif /* _TRACE_HOOK_SCHED_H */ diff --git a/include/trace/hooks/shmem_fs.h b/include/trace/hooks/shmem_fs.h index adfd05825928..29c45d1e0571 100644 --- a/include/trace/hooks/shmem_fs.h +++ b/include/trace/hooks/shmem_fs.h @@ -7,12 +7,8 @@ #define _TRACE_HOOK_SHMEM_FS_H #include -#ifdef __GENKSYMS__ struct page; -#else -/* struct page */ -#include -#endif /* __GENKSYMS__ */ + DECLARE_HOOK(android_vh_shmem_alloc_page, TP_PROTO(struct page **page), TP_ARGS(page)); diff --git a/include/trace/hooks/signal.h b/include/trace/hooks/signal.h index 04976ed38cc7..6338274f27c4 100644 --- a/include/trace/hooks/signal.h +++ b/include/trace/hooks/signal.h @@ -7,12 +7,8 @@ #define _TRACE_HOOK_SIGNAL_H #include -#ifdef __GENKSYMS__ struct task_struct; -#else -/* struct task_struct */ -#include -#endif /* __GENKSYMS__ */ + DECLARE_HOOK(android_vh_do_send_sig_info, TP_PROTO(int sig, struct task_struct *killer, struct task_struct *dst), TP_ARGS(sig, killer, dst)); diff --git a/include/trace/hooks/softlockup.h b/include/trace/hooks/softlockup.h index d90571a3f0fc..d9806aeb5aa8 100644 --- a/include/trace/hooks/softlockup.h +++ b/include/trace/hooks/softlockup.h @@ -10,12 +10,8 @@ * Following tracepoints are not exported in tracefs and provide a * mechanism for vendor modules to hook and extend functionality */ -#ifdef __GENKSYMS__ struct pt_regs; -#else -/* struct pt_regs */ -#include -#endif /* __GENKSYMS__ */ + DECLARE_HOOK(android_vh_watchdog_timer_softlockup, TP_PROTO(int duration, struct pt_regs *regs, bool is_panic), TP_ARGS(duration, regs, is_panic)); diff --git a/include/trace/hooks/suspend.h b/include/trace/hooks/suspend.h new file mode 100644 index 000000000000..6e78f3bfdbc0 --- /dev/null +++ b/include/trace/hooks/suspend.h @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM suspend + +#define TRACE_INCLUDE_PATH trace/hooks + +#if !defined(_TRACE_HOOK_SUSPEND_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_HOOK_SUSPEND_H + +#include + +DECLARE_HOOK(android_vh_resume_begin, + TP_PROTO(void *unused), + TP_ARGS(unused)) +DECLARE_HOOK(android_vh_resume_end, + TP_PROTO(void *unused), + TP_ARGS(unused)) +DECLARE_HOOK(android_vh_early_resume_begin, + TP_PROTO(void *unused), + TP_ARGS(unused)) + +/* macro versions of hooks are no longer required */ + +#endif /* _TRACE_HOOK_SUSPEND_H */ +/* This part must be outside protection */ +#include + diff --git a/include/trace/hooks/sys.h b/include/trace/hooks/sys.h index 819a126ce0ae..a14bd4135410 100644 --- a/include/trace/hooks/sys.h +++ b/include/trace/hooks/sys.h @@ -7,12 +7,8 @@ #define _TRACE_HOOK_SYS_H #include -#ifdef __GENKSYMS__ struct task_struct; -#else -/* struct task_struct */ -#include -#endif /* __GENKSYMS__ */ + DECLARE_HOOK(android_vh_syscall_prctl_finished, TP_PROTO(int option, struct task_struct *task), TP_ARGS(option, task)); diff --git a/include/trace/hooks/syscall_check.h b/include/trace/hooks/syscall_check.h index aa563ad1c510..c906ff6b8e7f 100644 --- a/include/trace/hooks/syscall_check.h +++ b/include/trace/hooks/syscall_check.h @@ -10,15 +10,9 @@ * Following tracepoints are not exported in tracefs and provide a * mechanism for vendor modules to hook and extend functionality */ -#ifdef __GENKSYMS__ struct file; union bpf_attr; -#else -/* struct file */ -#include -/* union bpf_attr */ -#include -#endif /* __GENKSYMS__ */ + DECLARE_HOOK(android_vh_check_mmap_file, TP_PROTO(const struct file *file, unsigned long prot, unsigned long flag, unsigned long ret), diff --git a/include/trace/hooks/thermal.h b/include/trace/hooks/thermal.h index e9a9a4ae3e07..97074725fb08 100644 --- a/include/trace/hooks/thermal.h +++ b/include/trace/hooks/thermal.h @@ -10,12 +10,8 @@ #include #include -#ifdef __GENKSYMS__ struct thermal_zone_device; -#else -/* struct thermal_zone_device */ -#include -#endif /* __GENKSYMS__ */ + DECLARE_HOOK(android_vh_enable_thermal_genl_check, TP_PROTO(int event, int tz_id, int *enable_thermal_genl), TP_ARGS(event, tz_id, enable_thermal_genl)); diff --git a/include/trace/hooks/topology.h b/include/trace/hooks/topology.h index 5d29893ba477..e924c97ab4d9 100644 --- a/include/trace/hooks/topology.h +++ b/include/trace/hooks/topology.h @@ -8,7 +8,12 @@ #define _TRACE_HOOK_TOPOLOGY_H #include + +#ifdef __GENKSYMS__ #include +#endif + +struct cpumask; DECLARE_HOOK(android_vh_arch_set_freq_scale, TP_PROTO(const struct cpumask *cpus, unsigned long freq, diff --git a/include/trace/hooks/traps.h b/include/trace/hooks/traps.h index 6b9b986f7a30..f0ede1e69b15 100644 --- a/include/trace/hooks/traps.h +++ b/include/trace/hooks/traps.h @@ -10,12 +10,8 @@ * Following tracepoints are not exported in tracefs and provide a * mechanism for vendor modules to hook and extend functionality */ -#ifdef __GENKSYMS__ struct pt_regs; -#else -/* struct pt_regs */ -#include -#endif /* __GENKSYMS__ */ + DECLARE_RESTRICTED_HOOK(android_rvh_do_undefinstr, TP_PROTO(struct pt_regs *regs, bool user), TP_ARGS(regs, user), diff --git a/include/trace/hooks/typec.h b/include/trace/hooks/typec.h index 8c31b8eff7c3..e386f487eeba 100644 --- a/include/trace/hooks/typec.h +++ b/include/trace/hooks/typec.h @@ -10,12 +10,8 @@ * Following tracepoints are not exported in tracefs and provide a * mechanism for vendor modules to hook and extend functionality */ -#ifdef __GENKSYMS__ +/* Including ../drivers/usb/typec/tcpm/tcpci.h breaks builds. */ struct tcpci_data; -#else -/* struct tcpci_data */ -#include <../drivers/usb/typec/tcpm/tcpci.h> -#endif /* __GENKSYMS__ */ struct tcpci; struct tcpm_port; diff --git a/include/trace/hooks/ufshcd.h b/include/trace/hooks/ufshcd.h index 32a7f98da4c1..ad2c067f02c4 100644 --- a/include/trace/hooks/ufshcd.h +++ b/include/trace/hooks/ufshcd.h @@ -9,20 +9,11 @@ * Following tracepoints are not exported in tracefs and provide a * mechanism for vendor modules to hook and extend functionality */ -#ifdef __GENKSYMS__ struct ufs_hba; struct ufshcd_lrb; struct uic_command; struct request; struct scsi_device; -#else -/* struct ufs_hba, struct ufshcd_lrb, struct uic_command */ -#include <../drivers/scsi/ufs/ufshcd.h> -/* struct request */ -#include -/* struct scsi_device */ -#include -#endif /* __GENKSYMS__ */ DECLARE_HOOK(android_vh_ufs_fill_prdt, TP_PROTO(struct ufs_hba *hba, struct ufshcd_lrb *lrbp, diff --git a/include/trace/hooks/usb.h b/include/trace/hooks/usb.h index f4d5ff04b6b8..3a22a2971c24 100644 --- a/include/trace/hooks/usb.h +++ b/include/trace/hooks/usb.h @@ -5,8 +5,14 @@ #define TRACE_INCLUDE_PATH trace/hooks #if !defined(_TRACE_HOOK_USB_H) || defined(TRACE_HEADER_MULTI_READ) #define _TRACE_HOOK_USB_H -#include #include + +#ifdef __GENKSYMS__ +#include +#endif + +struct usb_device; + /* * Following tracepoints are not exported in tracefs and provide a * mechanism for vendor modules to hook and extend functionality diff --git a/include/trace/hooks/user.h b/include/trace/hooks/user.h index 6a39785a52e1..1a41c12edd58 100644 --- a/include/trace/hooks/user.h +++ b/include/trace/hooks/user.h @@ -7,12 +7,8 @@ #define _TRACE_HOOK_USER_H #include -#ifdef __GENKSYMS__ struct user_struct; -#else -/* struct user_struct */ -#include -#endif /* __GENKSYMS__ */ + DECLARE_HOOK(android_vh_alloc_uid, TP_PROTO(struct user_struct *user), TP_ARGS(user)); diff --git a/include/trace/hooks/v4l2core.h b/include/trace/hooks/v4l2core.h index 3dec47042a86..e209621cd66c 100644 --- a/include/trace/hooks/v4l2core.h +++ b/include/trace/hooks/v4l2core.h @@ -9,7 +9,6 @@ #include -#ifdef __GENKSYMS__ struct v4l2_subdev; struct v4l2_subdev_pad_config; struct v4l2_subdev_format; @@ -17,14 +16,7 @@ struct v4l2_subdev_frame_interval; struct v4l2_subdev_selection; struct v4l2_fmtdesc; struct v4l2_format; -#else -/* struct v4l2_subdev, struct v4l2_subdev_pad_config */ -#include -/* struct v4l2_subdev_format, struct v4l2_subdev_frame_interval, struct v4l2_subdev_selection */ -#include -/* struct v4l2_fmtdesc, struct v4l2_format */ -#include -#endif /* __GENKSYMS__ */ + DECLARE_HOOK(android_vh_clear_reserved_fmt_fields, TP_PROTO(struct v4l2_format *fmt, int *ret), TP_ARGS(fmt, ret)); diff --git a/include/trace/hooks/v4l2mc.h b/include/trace/hooks/v4l2mc.h index 332a3a09680d..cafc74f14e9b 100644 --- a/include/trace/hooks/v4l2mc.h +++ b/include/trace/hooks/v4l2mc.h @@ -9,15 +9,9 @@ #include -#ifdef __GENKSYMS__ struct media_link; struct media_link_desc; -#else -/* struct media_link */ -#include -/* struct media_link_desc */ -#include -#endif /* __GENKSYMS__ */ + DECLARE_HOOK(android_vh_media_device_setup_link, TP_PROTO(struct media_link *link, struct media_link_desc *linkd, int *ret), TP_ARGS(link, linkd, ret)); diff --git a/include/trace/hooks/vmscan.h b/include/trace/hooks/vmscan.h index 4a3af8e75839..d3da574714ba 100644 --- a/include/trace/hooks/vmscan.h +++ b/include/trace/hooks/vmscan.h @@ -27,6 +27,9 @@ DECLARE_HOOK(android_vh_do_shrink_slab, DECLARE_RESTRICTED_HOOK(android_rvh_set_balance_anon_file_reclaim, TP_PROTO(bool *balance_anon_file_reclaim), TP_ARGS(balance_anon_file_reclaim), 1); +DECLARE_HOOK(android_vh_tune_memcg_scan_type, + TP_PROTO(struct mem_cgroup *memcg, char *scan_type), + TP_ARGS(memcg, scan_type)); #endif /* _TRACE_HOOK_VMSCAN_H */ /* This part must be outside protection */ #include diff --git a/include/trace/hooks/workqueue.h b/include/trace/hooks/workqueue.h index 3d6d0d61040d..284b3ff86fa8 100644 --- a/include/trace/hooks/workqueue.h +++ b/include/trace/hooks/workqueue.h @@ -10,12 +10,8 @@ * Following tracepoints are not exported in tracefs and provide a * mechanism for vendor modules to hook and extend functionality */ -#ifdef __GENKSYMS__ struct worker; -#else -/* struct worker */ -#include <../kernel/workqueue_internal.h> -#endif /* __GENKSYMS__ */ + DECLARE_HOOK(android_vh_create_worker, TP_PROTO(struct worker *worker, struct workqueue_attrs *attrs), TP_ARGS(worker, attrs)); diff --git a/include/trace/hooks/wqlockup.h b/include/trace/hooks/wqlockup.h deleted file mode 100644 index 2572ebf5eff4..000000000000 --- a/include/trace/hooks/wqlockup.h +++ /dev/null @@ -1,21 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM wqlockup -#define TRACE_INCLUDE_PATH trace/hooks - -#if !defined(_TRACE_HOOK_WQLOCKUP_H) || defined(TRACE_HEADER_MULTI_READ) -#define _TRACE_HOOK_WQLOCKUP_H -#include -/* - * Following tracepoints are not exported in tracefs and provide a - * mechanism for vendor modules to hook and extend functionality - */ -DECLARE_HOOK(android_vh_wq_lockup_pool, - TP_PROTO(int cpu, unsigned long pool_ts), - TP_ARGS(cpu, pool_ts)); - -/* macro versions of hooks are no longer required */ - -#endif /* _TRACE_HOOK_WQLOCKUP_H */ -/* This part must be outside protection */ -#include diff --git a/include/uapi/linux/OWNERS b/include/uapi/linux/OWNERS deleted file mode 100644 index 113046844b1c..000000000000 --- a/include/uapi/linux/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# include OWNERS from the authoritative android-mainline branch -include kernel/common:android-mainline:/include/uapi/linux/OWNERS diff --git a/include/uapi/linux/android/binder.h b/include/uapi/linux/android/binder.h index 2d3f015e2ae3..7badb670f24f 100644 --- a/include/uapi/linux/android/binder.h +++ b/include/uapi/linux/android/binder.h @@ -319,6 +319,7 @@ enum transaction_flags { TF_STATUS_CODE = 0x08, /* contents are a 32-bit status code */ TF_ACCEPT_FDS = 0x10, /* allow replies with file descriptors */ TF_CLEAR_BUF = 0x20, /* clear buffer on txn complete */ + TF_UPDATE_TXN = 0x40, /* update the outdated pending async txn */ }; struct binder_transaction_data { diff --git a/kernel/cgroup/Makefile b/kernel/cgroup/Makefile index 5d7a76bfbbb7..c8bc5cbe1d45 100644 --- a/kernel/cgroup/Makefile +++ b/kernel/cgroup/Makefile @@ -6,3 +6,4 @@ obj-$(CONFIG_CGROUP_PIDS) += pids.o obj-$(CONFIG_CGROUP_RDMA) += rdma.o obj-$(CONFIG_CPUSETS) += cpuset.o obj-$(CONFIG_CGROUP_DEBUG) += debug.o +obj-$(CONFIG_ANDROID_VENDOR_HOOKS) += vendor_hooks.o diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index 9da3871ca441..40dabc1d93be 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -941,6 +941,12 @@ static void rebuild_root_domains(void) { struct cpuset *cs = NULL; struct cgroup_subsys_state *pos_css; + bool bypass = false; + + trace_android_vh_rebuild_root_domains_bypass(cpuhp_tasks_frozen, &bypass); + + if (bypass) + return; lockdep_assert_held(&cpuset_mutex); lockdep_assert_cpus_held(); diff --git a/kernel/cgroup/vendor_hooks.c b/kernel/cgroup/vendor_hooks.c new file mode 100644 index 000000000000..95f7e3410d7d --- /dev/null +++ b/kernel/cgroup/vendor_hooks.c @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* vendor_hook.c + * + * Android Vendor Hook Support + * + * Copyright 2022 Google LLC + */ +#ifndef __GENKSYMS__ +#include "cgroup-internal.h" +#else +/* + * Needed to preserve CRC for cgroup-related hooks + */ +#include +#include <../drivers/gpio/gpiolib.h> +#endif + +#define CREATE_TRACE_POINTS +#include +#include +#include + +/* + * Export tracepoints that act as a bare tracehook (ie: have no trace event + * associated with them) to allow external modules to probe them. + */ +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cgroup_set_task); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpuset_fork); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cgroup_force_kthread_migration); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_refrigerator); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cgroup_attach); + +/* + * For type visibility + */ +const struct cgroup_taskset *GKI_struct_cgroup_taskset; +EXPORT_SYMBOL_GPL(GKI_struct_cgroup_taskset); diff --git a/kernel/fork.c b/kernel/fork.c index 93f4479aaa51..a0d95fd031d9 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1159,8 +1159,10 @@ void mmput(struct mm_struct *mm) { might_sleep(); - if (atomic_dec_and_test(&mm->mm_users)) + if (atomic_dec_and_test(&mm->mm_users)) { + trace_android_vh_mmput(NULL); __mmput(mm); + } } EXPORT_SYMBOL_GPL(mmput); diff --git a/kernel/irq/generic-chip.c b/kernel/irq/generic-chip.c index e2999a070a99..79cb6d063b80 100644 --- a/kernel/irq/generic-chip.c +++ b/kernel/irq/generic-chip.c @@ -200,6 +200,7 @@ int irq_gc_set_wake(struct irq_data *d, unsigned int on) irq_gc_unlock(gc); return 0; } +EXPORT_SYMBOL_GPL(irq_gc_set_wake); static u32 irq_readl_be(void __iomem *addr) { diff --git a/kernel/module.c b/kernel/module.c index 52f26c01d691..280ab186b2ef 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -63,10 +63,6 @@ #define CREATE_TRACE_POINTS #include -#undef CREATE_TRACE_POINTS -#include -#include - #ifndef ARCH_SHF_SMALL #define ARCH_SHF_SMALL 0 #endif @@ -2263,10 +2259,6 @@ static void free_module(struct module *mod) /* This may be empty, but that's OK */ module_arch_freeing_init(mod); - trace_android_vh_set_memory_rw((unsigned long)mod->init_layout.base, - (mod->init_layout.size)>>PAGE_SHIFT); - trace_android_vh_set_memory_nx((unsigned long)mod->init_layout.base, - (mod->init_layout.size)>>PAGE_SHIFT); module_memfree(mod->init_layout.base); kfree(mod->args); percpu_modfree(mod); @@ -2275,10 +2267,6 @@ static void free_module(struct module *mod) lockdep_free_key_range(mod->core_layout.base, mod->core_layout.size); /* Finally, free the core (containing the module structure) */ - trace_android_vh_set_memory_rw((unsigned long)mod->core_layout.base, - (mod->core_layout.size)>>PAGE_SHIFT); - trace_android_vh_set_memory_nx((unsigned long)mod->core_layout.base, - (mod->core_layout.size)>>PAGE_SHIFT); module_memfree(mod->core_layout.base); } @@ -3659,15 +3647,7 @@ static void module_deallocate(struct module *mod, struct load_info *info) { percpu_modfree(mod); module_arch_freeing_init(mod); - trace_android_vh_set_memory_rw((unsigned long)mod->init_layout.base, - (mod->init_layout.size)>>PAGE_SHIFT); - trace_android_vh_set_memory_nx((unsigned long)mod->init_layout.base, - (mod->init_layout.size)>>PAGE_SHIFT); module_memfree(mod->init_layout.base); - trace_android_vh_set_memory_rw((unsigned long)mod->core_layout.base, - (mod->core_layout.size)>>PAGE_SHIFT); - trace_android_vh_set_memory_nx((unsigned long)mod->core_layout.base, - (mod->core_layout.size)>>PAGE_SHIFT); module_memfree(mod->core_layout.base); } @@ -3810,13 +3790,8 @@ static noinline int do_init_module(struct module *mod) rcu_assign_pointer(mod->kallsyms, &mod->core_kallsyms); #endif module_enable_ro(mod, true); - trace_android_vh_set_module_permit_after_init(mod); mod_tree_remove_init(mod); module_arch_freeing_init(mod); - trace_android_vh_set_memory_rw((unsigned long)mod->init_layout.base, - (mod->init_layout.size)>>PAGE_SHIFT); - trace_android_vh_set_memory_nx((unsigned long)mod->init_layout.base, - (mod->init_layout.size)>>PAGE_SHIFT); mod->init_layout.base = NULL; mod->init_layout.size = 0; mod->init_layout.ro_size = 0; @@ -3923,7 +3898,6 @@ static int complete_formation(struct module *mod, struct load_info *info) module_enable_ro(mod, false); module_enable_nx(mod); module_enable_x(mod); - trace_android_vh_set_module_permit_before_init(mod); /* Mark state as coming so strong_try_module_get() ignores us, * but kallsyms etc. can see us. */ diff --git a/kernel/pid.c b/kernel/pid.c index 48babb1dd3e1..468d04810b40 100644 --- a/kernel/pid.c +++ b/kernel/pid.c @@ -45,6 +45,9 @@ #include #include +#undef CREATE_TRACE_POINTS +#include + struct pid init_struct_pid = { .count = REFCOUNT_INIT(1), .tasks = { @@ -602,6 +605,7 @@ SYSCALL_DEFINE2(pidfd_open, pid_t, pid, unsigned int, flags) else fd = -EINVAL; + trace_android_vh_pidfd_open(p); put_pid(p); return fd; } diff --git a/kernel/power/process.c b/kernel/power/process.c index ba51823759ea..7564fd30766b 100644 --- a/kernel/power/process.c +++ b/kernel/power/process.c @@ -40,6 +40,7 @@ static int try_to_freeze_tasks(bool user_only) unsigned int elapsed_msecs; bool wakeup = false; int sleep_usecs = USEC_PER_MSEC; + bool todo_logging_on = false; start = ktime_get_boottime(); @@ -101,7 +102,8 @@ static int try_to_freeze_tasks(bool user_only) if (wq_busy) show_workqueue_state(); - if (pm_debug_messages_on) { + trace_android_vh_try_to_freeze_todo_logging(&todo_logging_on); + if (pm_debug_messages_on || todo_logging_on) { read_lock(&tasklist_lock); for_each_process_thread(g, p) { if (p != current && !freezer_should_skip(p) diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index 0b20b2a456a3..e4c5dcf91033 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c @@ -31,6 +31,7 @@ #include #include #include +#include #include "power.h" @@ -439,7 +440,6 @@ static int suspend_enter(suspend_state_t state, bool *wakeup) BUG_ON(!irqs_disabled()); system_state = SYSTEM_SUSPEND; - error = syscore_suspend(); if (!error) { *wakeup = pm_wakeup_pending(); @@ -449,6 +449,7 @@ static int suspend_enter(suspend_state_t state, bool *wakeup) error = suspend_ops->enter(state); trace_suspend_resume(TPS("machine_suspend"), state, false); + trace_android_vh_early_resume_begin(NULL); } else if (*wakeup) { error = -EBUSY; } @@ -517,6 +518,7 @@ int suspend_devices_and_enter(suspend_state_t state) } while (!error && !wakeup && platform_suspend_again(state)); Resume_devices: + trace_android_vh_resume_begin(NULL); suspend_test_start(); dpm_resume_end(PMSG_RESUME); suspend_test_finish("resume devices"); @@ -527,6 +529,7 @@ int suspend_devices_and_enter(suspend_state_t state) Close: platform_resume_end(state); pm_suspend_target_state = PM_SUSPEND_ON; + trace_android_vh_resume_end(NULL); return error; Recover_platform: diff --git a/kernel/sched/OWNERS b/kernel/sched/OWNERS deleted file mode 100644 index fc027b64b61b..000000000000 --- a/kernel/sched/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# include OWNERS from the authoritative android-mainline branch -include kernel/common:android-mainline:/kernel/sched/OWNERS diff --git a/kernel/sched/core.c b/kernel/sched/core.c index c142b57d9315..fb2a0ba31331 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -3200,8 +3200,6 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags) */ smp_cond_load_acquire(&p->on_cpu, !VAL); - trace_android_rvh_try_to_wake_up(p); - cpu = select_task_rq(p, p->wake_cpu, SD_BALANCE_WAKE, wake_flags); if (task_cpu(p) != cpu) { if (p->in_iowait) { @@ -3221,10 +3219,8 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags) unlock: raw_spin_unlock_irqrestore(&p->pi_lock, flags); out: - if (success) { - trace_android_rvh_try_to_wake_up_success(p); + if (success) ttwu_stat(p, task_cpu(p), wake_flags); - } preempt_enable(); return success; @@ -3585,8 +3581,6 @@ void wake_up_new_task(struct task_struct *p) struct rq_flags rf; struct rq *rq; - trace_android_rvh_wake_up_new_task(p); - raw_spin_lock_irqsave(&p->pi_lock, rf.flags); p->state = TASK_RUNNING; #ifdef CONFIG_SMP @@ -3605,7 +3599,6 @@ void wake_up_new_task(struct task_struct *p) rq = __task_rq_lock(p, &rf); update_rq_clock(rq); post_init_entity_util_avg(p); - trace_android_rvh_new_task_stats(p); activate_task(rq, p, ENQUEUE_NOCLOCK); trace_sched_wakeup_new(p); @@ -3897,7 +3890,6 @@ static struct rq *finish_task_switch(struct task_struct *prev) * task and put them back on the free list. */ kprobe_flush_task(prev); - trace_android_rvh_flush_task(prev); /* Task is done with its stack. */ put_task_stack(prev); @@ -4253,7 +4245,6 @@ void scheduler_tick(void) rq_lock(rq, &rf); - trace_android_rvh_tick_entry(rq); update_rq_clock(rq); thermal_pressure = arch_scale_thermal_pressure(cpu_of(rq)); update_thermal_load_avg(rq_clock_thermal(rq), rq, thermal_pressure); @@ -4778,7 +4769,6 @@ static void __sched notrace __schedule(bool preempt) clear_tsk_need_resched(prev); clear_preempt_need_resched(); - trace_android_rvh_schedule(prev, next, rq); if (likely(prev != next)) { rq->nr_switches++; /* @@ -7369,7 +7359,6 @@ int sched_cpu_starting(unsigned int cpu) { sched_rq_cpu_starting(cpu); sched_tick_start(cpu); - trace_android_rvh_sched_cpu_starting(cpu); return 0; } @@ -7391,8 +7380,6 @@ int sched_cpu_dying(unsigned int cpu) BUG_ON(rq->nr_running != 1); rq_unlock_irqrestore(rq, &rf); - trace_android_rvh_sched_cpu_dying(cpu); - calc_load_migrate(rq); nohz_balance_exit_idle(rq); hrtick_clear(rq); diff --git a/kernel/sched/cpupri.c b/kernel/sched/cpupri.c index 450a724b4542..2896860c8333 100644 --- a/kernel/sched/cpupri.c +++ b/kernel/sched/cpupri.c @@ -150,7 +150,7 @@ int cpupri_find_fitness(struct cpupri *cp, struct task_struct *p, { int task_pri = convert_prio(p->prio); int idx, cpu; - bool drop_nopreempts = task_pri <= MAX_RT_PRIO; + bool drop_nopreempts = task_pri <= MAX_RT_PRIO + 1; BUG_ON(task_pri >= CPUPRI_NR_PRIORITIES); diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c index 7ffe3e2be485..807b948d22c9 100644 --- a/kernel/sched/cputime.c +++ b/kernel/sched/cputime.c @@ -73,8 +73,6 @@ void irqtime_account_irq(struct task_struct *curr) irqtime_account_delta(irqtime, delta, CPUTIME_IRQ); else if (in_serving_softirq() && curr != this_cpu_ksoftirqd()) irqtime_account_delta(irqtime, delta, CPUTIME_SOFTIRQ); - - trace_android_rvh_account_irq(curr, cpu, delta); } EXPORT_SYMBOL_GPL(irqtime_account_irq); diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index d15d24ccb1fc..c3478864e88b 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4111,7 +4111,6 @@ static inline void update_misfit_status(struct task_struct *p, struct rq *rq) { bool need_update = true; - trace_android_rvh_update_misfit_status(p, rq, &need_update); if (!static_branch_unlikely(&sched_asym_cpucapacity) || !need_update) return; @@ -4211,7 +4210,6 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial) /* ensure we never gain time by being placed backwards. */ se->vruntime = max_vruntime(se->vruntime, vruntime); - trace_android_rvh_place_entity(cfs_rq, se, initial, vruntime); } static void check_enqueue_throttle(struct cfs_rq *cfs_rq); @@ -4802,7 +4800,7 @@ static int tg_unthrottle_up(struct task_group *tg, void *data) cfs_rq->throttle_count--; if (!cfs_rq->throttle_count) { - cfs_rq->throttled_clock_pelt_time += rq_clock_pelt(rq) - + cfs_rq->throttled_clock_pelt_time += rq_clock_task_mult(rq) - cfs_rq->throttled_clock_pelt; /* Add cfs_rq with already running entity in the list */ @@ -4820,7 +4818,7 @@ static int tg_throttle_down(struct task_group *tg, void *data) /* group is entering throttled state, stop time */ if (!cfs_rq->throttle_count) { - cfs_rq->throttled_clock_pelt = rq_clock_pelt(rq); + cfs_rq->throttled_clock_pelt = rq_clock_task_mult(rq); list_del_leaf_cfs_rq(cfs_rq); } cfs_rq->throttle_count++; @@ -5238,7 +5236,7 @@ static void sync_throttle(struct task_group *tg, int cpu) pcfs_rq = tg->parent->cfs_rq[cpu]; cfs_rq->throttle_count = pcfs_rq->throttle_count; - cfs_rq->throttled_clock_pelt = rq_clock_pelt(cpu_rq(cpu)); + cfs_rq->throttled_clock_pelt = rq_clock_task_mult(cpu_rq(cpu)); } /* conditionally throttle active cfs_rq's from put_prev_entity() */ @@ -8338,7 +8336,6 @@ static void update_cpu_capacity(struct sched_domain *sd, int cpu) if (!capacity) capacity = 1; - trace_android_rvh_update_cpu_capacity(cpu, &capacity); cpu_rq(cpu)->cpu_capacity = capacity; trace_sched_cpu_capacity_tp(cpu_rq(cpu)); diff --git a/kernel/sched/pelt.c b/kernel/sched/pelt.c index e15a2fad146e..3e0d42dda717 100644 --- a/kernel/sched/pelt.c +++ b/kernel/sched/pelt.c @@ -509,3 +509,45 @@ int update_irq_load_avg(struct rq *rq, u64 running) return ret; } #endif + +DEFINE_PER_CPU(u64, clock_task_mult); + +unsigned int sysctl_sched_pelt_multiplier = 1; +__read_mostly unsigned int sched_pelt_lshift; + +int sched_pelt_multiplier(struct ctl_table *table, int write, void *buffer, + size_t *lenp, loff_t *ppos) +{ + static DEFINE_MUTEX(mutex); + unsigned int old; + int ret; + + mutex_lock(&mutex); + + old = sysctl_sched_pelt_multiplier; + ret = proc_dointvec(table, write, buffer, lenp, ppos); + if (ret) + goto undo; + if (!write) + goto done; + + switch (sysctl_sched_pelt_multiplier) { + case 1: + fallthrough; + case 2: + fallthrough; + case 4: + WRITE_ONCE(sched_pelt_lshift, + sysctl_sched_pelt_multiplier >> 1); + goto done; + default: + ret = -EINVAL; + } + +undo: + sysctl_sched_pelt_multiplier = old; +done: + mutex_unlock(&mutex); + + return ret; +} diff --git a/kernel/sched/pelt.h b/kernel/sched/pelt.h index 89150ced09cf..0245e3e21f93 100644 --- a/kernel/sched/pelt.h +++ b/kernel/sched/pelt.h @@ -61,6 +61,8 @@ static inline void cfs_se_util_change(struct sched_avg *avg) WRITE_ONCE(avg->util_est.enqueued, enqueued); } +extern unsigned int sched_pelt_lshift; + /* * The clock_pelt scales the time to reflect the effective amount of * computation done during the running delta time but then sync back to @@ -75,9 +77,13 @@ static inline void cfs_se_util_change(struct sched_avg *avg) */ static inline void update_rq_clock_pelt(struct rq *rq, s64 delta) { + delta <<= READ_ONCE(sched_pelt_lshift); + + per_cpu(clock_task_mult, rq->cpu) += delta; + if (unlikely(is_idle_task(rq->curr))) { /* The rq is idle, we can sync to clock_task */ - rq->clock_pelt = rq_clock_task(rq); + rq->clock_pelt = rq_clock_task_mult(rq); return; } @@ -129,7 +135,8 @@ static inline void update_idle_rq_clock_pelt(struct rq *rq) * rq's clock_task. */ if (util_sum >= divider) - rq->lost_idle_time += rq_clock_task(rq) - rq->clock_pelt; + rq->lost_idle_time += rq_clock_task_mult(rq) - + rq->clock_pelt; } static inline u64 rq_clock_pelt(struct rq *rq) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index a2d05d07dafb..9ed39ac2a841 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1193,6 +1193,16 @@ static inline u64 rq_clock_task(struct rq *rq) return rq->clock_task; } +DECLARE_PER_CPU(u64, clock_task_mult); + +static inline u64 rq_clock_task_mult(struct rq *rq) +{ + lockdep_assert_held(&rq->lock); + assert_clock_updated(rq); + + return per_cpu(clock_task_mult, cpu_of(rq)); +} + /** * By default the decay is the default pelt decay period. * The decay shift can change the decay period in diff --git a/kernel/signal.c b/kernel/signal.c index df381debb689..17c8e49c1116 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -1400,7 +1400,6 @@ struct sighand_struct *__lock_task_sighand(struct task_struct *tsk, return sighand; } -EXPORT_SYMBOL_GPL(__lock_task_sighand); /* * send signal info to all the members of a group diff --git a/kernel/softirq.c b/kernel/softirq.c index a6da60be62e8..e9455df99569 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -31,6 +31,10 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(irq_handler_entry); EXPORT_TRACEPOINT_SYMBOL_GPL(irq_handler_exit); +EXPORT_TRACEPOINT_SYMBOL_GPL(softirq_entry); +EXPORT_TRACEPOINT_SYMBOL_GPL(softirq_exit); +EXPORT_TRACEPOINT_SYMBOL_GPL(tasklet_entry); +EXPORT_TRACEPOINT_SYMBOL_GPL(tasklet_exit); /* - No shared variables, all the data are CPU local. diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 879ff5697d45..8c7d0493d3b7 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -1834,6 +1834,15 @@ static struct ctl_table kern_table[] = { .mode = 0644, .proc_handler = sched_rr_handler, }, +#ifdef CONFIG_SMP + { + .procname = "sched_pelt_multiplier", + .data = &sysctl_sched_pelt_multiplier, + .maxlen = sizeof(unsigned int), + .mode = 0644, + .proc_handler = sched_pelt_multiplier, + }, +#endif #ifdef CONFIG_UCLAMP_TASK { .procname = "sched_util_clamp_min", diff --git a/kernel/workqueue.c b/kernel/workqueue.c index c1fc53c42194..e4fdc09b688e 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -54,7 +54,6 @@ #include "workqueue_internal.h" -#include #include /* events/workqueue.h uses default TRACE_INCLUDE_PATH */ #undef TRACE_INCLUDE_PATH @@ -5843,7 +5842,6 @@ static void wq_watchdog_timer_fn(struct timer_list *unused) pr_cont_pool_info(pool); pr_cont(" stuck for %us!\n", jiffies_to_msecs(now - pool_ts) / 1000); - trace_android_vh_wq_lockup_pool(pool->cpu, pool_ts); } } diff --git a/mm/OWNERS b/mm/OWNERS deleted file mode 100644 index f89766e706e0..000000000000 --- a/mm/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# include OWNERS from the authoritative android-mainline branch -include kernel/common:android-mainline:/mm/OWNERS diff --git a/mm/filemap.c b/mm/filemap.c index d60dd67000fb..632734e9f8f1 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2996,6 +2996,8 @@ vm_fault_t filemap_map_pages(struct vm_fault *vmf, addr = vma->vm_start + ((start_pgoff - vma->vm_pgoff) << PAGE_SHIFT); if (!pte_map_lock_addr(vmf, addr)) { + unlock_page(head); + put_page(head); ret = VM_FAULT_RETRY; goto out; } diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 0cb0e19f3b59..db4950a230d8 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -1481,7 +1481,7 @@ vm_fault_t do_huge_pmd_numa_page(struct vm_fault *vmf, pmd_t pmd) */ get_page(page); spin_unlock(vmf->ptl); - anon_vma = page_lock_anon_vma_read(page); + anon_vma = page_lock_anon_vma_read(page, NULL); /* Confirm the PMD did not change while page_table_lock was released */ spin_lock(vmf->ptl); diff --git a/mm/ksm.c b/mm/ksm.c index 25b8362a4f89..d09f8d7d6417 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -2626,7 +2626,13 @@ again: struct vm_area_struct *vma; cond_resched(); - anon_vma_lock_read(anon_vma); + if (!anon_vma_trylock_read(anon_vma)) { + if (rwc->try_lock) { + rwc->contended = true; + return; + } + anon_vma_lock_read(anon_vma); + } anon_vma_interval_tree_foreach(vmac, &anon_vma->rb_root, 0, ULONG_MAX) { unsigned long addr; diff --git a/mm/memory-failure.c b/mm/memory-failure.c index aef267c6a724..4bd73d6dc18a 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -477,7 +477,7 @@ static void collect_procs_anon(struct page *page, struct list_head *to_kill, struct anon_vma *av; pgoff_t pgoff; - av = page_lock_anon_vma_read(page); + av = page_lock_anon_vma_read(page, NULL); if (av == NULL) /* Not actually mapped anymore */ return; diff --git a/mm/mmzone.c b/mm/mmzone.c index 483290ab301c..9d4c76ffe0dd 100644 --- a/mm/mmzone.c +++ b/mm/mmzone.c @@ -72,7 +72,6 @@ struct zoneref *__next_zones_zonelist(struct zoneref *z, return z; } -EXPORT_SYMBOL_GPL(__next_zones_zonelist); void lruvec_init(struct lruvec *lruvec) { @@ -119,4 +118,3 @@ enum zone_type gfp_zone(gfp_t flags) VM_BUG_ON((GFP_ZONE_BAD >> bit) & 1); return z; } -EXPORT_SYMBOL_GPL(gfp_zone); diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 4b4abbf52c97..7db99453549d 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3999,7 +3999,6 @@ bool zone_watermark_ok(struct zone *z, unsigned int order, unsigned long mark, return __zone_watermark_ok(z, order, mark, highest_zoneidx, alloc_flags, zone_page_state(z, NR_FREE_PAGES)); } -EXPORT_SYMBOL_GPL(zone_watermark_ok); static inline bool zone_watermark_fast(struct zone *z, unsigned int order, unsigned long mark, int highest_zoneidx, @@ -4056,7 +4055,6 @@ bool zone_watermark_ok_safe(struct zone *z, unsigned int order, return __zone_watermark_ok(z, order, mark, highest_zoneidx, 0, free_pages); } -EXPORT_SYMBOL_GPL(zone_watermark_ok_safe); #ifdef CONFIG_NUMA static bool zone_allows_reclaim(struct zone *local_zone, struct zone *zone) @@ -5106,6 +5104,12 @@ retry: if (current->flags & PF_MEMALLOC) goto nopage; + trace_android_vh_alloc_pages_reclaim_bypass(gfp_mask, order, + alloc_flags, ac->migratetype, &page); + + if (page) + goto got_pg; + /* Try direct reclaim and then allocating */ page = __alloc_pages_direct_reclaim(gfp_mask, order, alloc_flags, ac, &did_some_progress); @@ -5213,6 +5217,11 @@ nopage: goto retry; } fail: + trace_android_vh_alloc_pages_failure_bypass(gfp_mask, order, + alloc_flags, ac->migratetype, &page); + if (page) + goto got_pg; + warn_alloc(gfp_mask, ac->nodemask, "page allocation failure: order:%u", order); got_pg: diff --git a/mm/page_idle.c b/mm/page_idle.c index 144fb4ed961d..b5613232e881 100644 --- a/mm/page_idle.c +++ b/mm/page_idle.c @@ -92,10 +92,10 @@ static bool page_idle_clear_pte_refs_one(struct page *page, static void page_idle_clear_pte_refs(struct page *page) { /* - * Since rwc.arg is unused, rwc is effectively immutable, so we - * can make it static const to save some cycles and stack. + * Since rwc.try_lock is unused, rwc is effectively immutable, so we + * can make it static to save some cycles and stack. */ - static const struct rmap_walk_control rwc = { + static struct rmap_walk_control rwc = { .rmap_one = page_idle_clear_pte_refs_one, .anon_lock = page_lock_anon_vma_read, }; diff --git a/mm/rmap.c b/mm/rmap.c index a35c0f69ef97..663c0408760e 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -517,9 +517,11 @@ out: * * Its a little more complex as it tries to keep the fast path to a single * atomic op -- the trylock. If we fail the trylock, we fall back to getting a - * reference like with page_get_anon_vma() and then block on the mutex. + * reference like with page_get_anon_vma() and then block on the mutex + * on !rwc->try_lock case. */ -struct anon_vma *page_lock_anon_vma_read(struct page *page) +struct anon_vma *page_lock_anon_vma_read(struct page *page, + struct rmap_walk_control *rwc) { struct anon_vma *anon_vma = NULL; struct anon_vma *root_anon_vma; @@ -547,6 +549,12 @@ struct anon_vma *page_lock_anon_vma_read(struct page *page) goto out; } + if (rwc && rwc->try_lock) { + anon_vma = NULL; + rwc->contended = true; + goto out; + } + /* trylock failed, we got to sleep */ if (!atomic_inc_not_zero(&anon_vma->refcount)) { anon_vma = NULL; @@ -848,8 +856,10 @@ static bool invalid_page_referenced_vma(struct vm_area_struct *vma, void *arg) * @memcg: target memory cgroup * @vm_flags: collect encountered vma->vm_flags who actually referenced the page * - * Quick test_and_clear_referenced for all mappings to a page, - * returns the number of ptes which referenced the page. + * Quick test_and_clear_referenced for all mappings of a page, + * + * Return: The number of mappings which referenced the page. Return -1 if + * the function bailed out due to rmap lock contention. */ int page_referenced(struct page *page, int is_locked, @@ -865,6 +875,7 @@ int page_referenced(struct page *page, .rmap_one = page_referenced_one, .arg = (void *)&pra, .anon_lock = page_lock_anon_vma_read, + .try_lock = true, }; *vm_flags = 0; @@ -895,7 +906,7 @@ int page_referenced(struct page *page, if (we_locked) unlock_page(page); - return pra.referenced; + return rwc.contended ? -1 : pra.referenced; } static bool page_mkclean_one(struct page *page, struct vm_area_struct *vma, @@ -1842,7 +1853,7 @@ static struct anon_vma *rmap_walk_anon_lock(struct page *page, struct anon_vma *anon_vma; if (rwc->anon_lock) - return rwc->anon_lock(page); + return rwc->anon_lock(page, rwc); /* * Note: remove_migration_ptes() cannot use page_lock_anon_vma_read() @@ -1854,7 +1865,17 @@ static struct anon_vma *rmap_walk_anon_lock(struct page *page, if (!anon_vma) return NULL; + if (anon_vma_trylock_read(anon_vma)) + goto out; + + if (rwc->try_lock) { + anon_vma = NULL; + rwc->contended = true; + goto out; + } + anon_vma_lock_read(anon_vma); +out: return anon_vma; } @@ -1945,8 +1966,18 @@ static void rmap_walk_file(struct page *page, struct rmap_walk_control *rwc, pgoff_start = page_to_pgoff(page); pgoff_end = pgoff_start + thp_nr_pages(page) - 1; - if (!locked) + if (!locked) { + if (i_mmap_trylock_read(mapping)) + goto lookup; + + if (rwc->try_lock) { + rwc->contended = true; + return; + } + i_mmap_lock_read(mapping); + } +lookup: vma_interval_tree_foreach(vma, &mapping->i_mmap, pgoff_start, pgoff_end) { unsigned long address = vma_address(page, vma); diff --git a/mm/vmpressure.c b/mm/vmpressure.c index 632b88e9d49b..9b172561fded 100644 --- a/mm/vmpressure.c +++ b/mm/vmpressure.c @@ -21,8 +21,6 @@ #include #include -#include - /* * The window size (vmpressure_win) is the number of scanned pages before * we try to analyze scanned/reclaimed ratio. So the window is used as a @@ -243,17 +241,12 @@ void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, bool tree, unsigned long scanned, unsigned long reclaimed) { struct vmpressure *vmpr; - bool bypass = false; if (mem_cgroup_disabled()) return; vmpr = memcg_to_vmpressure(memcg); - trace_android_vh_vmpressure(memcg, &bypass); - if (unlikely(bypass)) - return; - /* * Here we only want to account pressure that userland is able to * help us with. For example, suppose that DMA zone is under diff --git a/mm/vmscan.c b/mm/vmscan.c index cb1a9b5b0729..d09d63861544 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1046,6 +1046,10 @@ static enum page_references page_check_references(struct page *page, if (vm_flags & VM_LOCKED) return PAGEREF_RECLAIM; + /* rmap lock contention: rotate */ + if (referenced_ptes == -1) + return PAGEREF_KEEP; + if (referenced_ptes) { /* * All mapped pages start out with page table @@ -2131,8 +2135,9 @@ static void shrink_active_list(unsigned long nr_to_scan, } } + /* Referenced or rmap lock contention: rotate */ if (page_referenced(page, 0, sc->target_mem_cgroup, - &vm_flags)) { + &vm_flags) != 0) { /* * Identify referenced, file-backed active pages and * give them one more trip around the active list. So @@ -2504,6 +2509,7 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc, denominator = ap + fp; out: trace_android_vh_tune_scan_type((char *)(&scan_balance)); + trace_android_vh_tune_memcg_scan_type(memcg, (char *)(&scan_balance)); for_each_evictable_lru(lru) { int file = is_file_lru(lru); unsigned long lruvec_size; diff --git a/net/OWNERS b/net/OWNERS deleted file mode 100644 index ddb7653770ec..000000000000 --- a/net/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# include OWNERS from the authoritative android-mainline branch -include kernel/common:android-mainline:/net/OWNERS diff --git a/net/core/net-traces.c b/net/core/net-traces.c index 465362a9b55d..42f242394135 100644 --- a/net/core/net-traces.c +++ b/net/core/net-traces.c @@ -54,6 +54,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(neigh_event_send_dead); EXPORT_TRACEPOINT_SYMBOL_GPL(neigh_cleanup_and_release); EXPORT_TRACEPOINT_SYMBOL_GPL(kfree_skb); +EXPORT_TRACEPOINT_SYMBOL_GPL(consume_skb); EXPORT_TRACEPOINT_SYMBOL_GPL(napi_poll); diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c index 77e82033ad70..ad7417b7e6e9 100644 --- a/net/xfrm/xfrm_input.c +++ b/net/xfrm/xfrm_input.c @@ -129,6 +129,7 @@ struct sec_path *secpath_set(struct sk_buff *skb) memset(sp->ovec, 0, sizeof(sp->ovec)); sp->olen = 0; sp->len = 0; + sp->verified_cnt = 0; return sp; } @@ -585,6 +586,20 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type) goto drop; } + /* If nested tunnel, check outer states before context is lost. + * Only nested tunnels need to be checked, since IP addresses change + * as a result of the tunnel mode decapsulation. Similarly, this check + * is limited to nested tunnels to avoid performing another policy + * check on non-nested tunnels. On success, this check also updates the + * secpath's verified_cnt variable, skipping future verifications of + * previously-verified secpath entries. + */ + if ((x->outer_mode.flags & XFRM_MODE_FLAG_TUNNEL) && + sp->verified_cnt < sp->len && + !xfrm_policy_check(NULL, XFRM_POLICY_IN, skb, family)) { + goto drop; + } + skb->mark = xfrm_smark_get(skb->mark, x); sp->xvec[sp->len++] = x; diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 78a687d5ab3e..157306607625 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -3271,6 +3271,13 @@ xfrm_policy_ok(const struct xfrm_tmpl *tmpl, const struct sec_path *sp, int star if (xfrm_state_ok(tmpl, sp->xvec[idx], family)) return ++idx; if (sp->xvec[idx]->props.mode != XFRM_MODE_TRANSPORT) { + if (idx < sp->verified_cnt) { + /* Secpath entry previously verified, consider optional and + * continue searching + */ + continue; + } + if (start == -1) start = -2-idx; break; @@ -3676,6 +3683,9 @@ int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb, * Order is _important_. Later we will implement * some barriers, but at the moment barriers * are implied between each two transformations. + * Upon success, marks secpath entries as having been + * verified to allow them to be skipped in future policy + * checks (e.g. nested tunnels). */ for (i = xfrm_nr-1, k = 0; i >= 0; i--) { k = xfrm_policy_ok(tpp[i], sp, k, family); @@ -3694,6 +3704,8 @@ int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb, } xfrm_pols_put(pols, npols); + sp->verified_cnt = k; + return 1; } XFRM_INC_STATS(net, LINUX_MIB_XFRMINPOLBLOCK); diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 3e5453d4a4df..cdc63f35b9fc 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -403,20 +403,31 @@ printf "%08x\n" $$dec_size | \ ) quiet_cmd_bzip2 = BZIP2 $@ - cmd_bzip2 = { cat $(real-prereqs) | $(KBZIP2) -9; $(size_append); } > $@ + cmd_bzip2 = cat $(real-prereqs) | $(KBZIP2) -9 > $@ + +quiet_cmd_bzip2_with_size = BZIP2 $@ + cmd_bzip2_with_size = { cat $(real-prereqs) | $(KBZIP2) -9; $(size_append); } > $@ # Lzma # --------------------------------------------------------------------------- quiet_cmd_lzma = LZMA $@ - cmd_lzma = { cat $(real-prereqs) | $(LZMA) -9; $(size_append); } > $@ + cmd_lzma = cat $(real-prereqs) | $(LZMA) -9 > $@ + +quiet_cmd_lzma_with_size = LZMA $@ + cmd_lzma_with_size = { cat $(real-prereqs) | $(LZMA) -9; $(size_append); } > $@ quiet_cmd_lzo = LZO $@ - cmd_lzo = { cat $(real-prereqs) | $(KLZOP) -9; $(size_append); } > $@ + cmd_lzo = cat $(real-prereqs) | $(KLZOP) -9 > $@ + +quiet_cmd_lzo_with_size = LZO $@ + cmd_lzo_with_size = { cat $(real-prereqs) | $(KLZOP) -9; $(size_append); } > $@ quiet_cmd_lz4 = LZ4 $@ - cmd_lz4 = { cat $(real-prereqs) | \ - $(LZ4) -l -12 --favor-decSpeed stdin stdout; \ + cmd_lz4 = cat $(real-prereqs) | $(LZ4) -l -12 --favor-decSpeed stdin stdout > $@ + +quiet_cmd_lz4_with_size = LZ4 $@ + cmd_lz4_with_size = { cat $(real-prereqs) | $(LZ4) -l -12 --favor-decSpeed stdin stdout; \ $(size_append); } > $@ # U-Boot mkimage @@ -459,7 +470,10 @@ quiet_cmd_uimage = UIMAGE $@ # big dictionary would increase the memory usage too much in the multi-call # decompression mode. A BCJ filter isn't used either. quiet_cmd_xzkern = XZKERN $@ - cmd_xzkern = { cat $(real-prereqs) | sh $(srctree)/scripts/xz_wrap.sh; \ + cmd_xzkern = cat $(real-prereqs) | sh $(srctree)/scripts/xz_wrap.sh > $@ + +quiet_cmd_xzkern_with_size = XZKERN $@ + cmd_xzkern_with_size = { cat $(real-prereqs) | sh $(srctree)/scripts/xz_wrap.sh; \ $(size_append); } > $@ quiet_cmd_xzmisc = XZMISC $@ @@ -485,7 +499,10 @@ quiet_cmd_zstd = ZSTD $@ cmd_zstd = { cat $(real-prereqs) | $(ZSTD) -19; $(size_append); } > $@ quiet_cmd_zstd22 = ZSTD22 $@ - cmd_zstd22 = { cat $(real-prereqs) | $(ZSTD) -22 --ultra; $(size_append); } > $@ + cmd_zstd22 = cat $(real-prereqs) | $(ZSTD) -22 --ultra > $@ + +quiet_cmd_zstd22_with_size = ZSTD22 $@ + cmd_zstd22_with_size = { cat $(real-prereqs) | $(ZSTD) -22 --ultra; $(size_append); } > $@ # ASM offsets # --------------------------------------------------------------------------- diff --git a/sound/core/pcm_iec958.c b/sound/core/pcm_iec958.c index f9a211cc1f2c..7a1b816f67cc 100644 --- a/sound/core/pcm_iec958.c +++ b/sound/core/pcm_iec958.c @@ -9,41 +9,85 @@ #include #include -static int create_iec958_consumer(uint rate, uint sample_width, - u8 *cs, size_t len) +/** + * snd_pcm_create_iec958_consumer_default - create default consumer format IEC958 channel status + * @cs: channel status buffer, at least four bytes + * @len: length of channel status buffer + * + * Create the consumer format channel status data in @cs of maximum size + * @len. When relevant, the configuration-dependant bits will be set as + * unspecified. + * + * Drivers should then call einter snd_pcm_fill_iec958_consumer() or + * snd_pcm_fill_iec958_consumer_hw_params() to replace these unspecified + * bits by their actual values. + * + * Drivers may wish to tweak the contents of the buffer after creation. + * + * Returns: length of buffer, or negative error code if something failed. + */ +int snd_pcm_create_iec958_consumer_default(u8 *cs, size_t len) { - unsigned int fs, ws; - if (len < 4) return -EINVAL; - switch (rate) { - case 32000: - fs = IEC958_AES3_CON_FS_32000; - break; - case 44100: - fs = IEC958_AES3_CON_FS_44100; - break; - case 48000: - fs = IEC958_AES3_CON_FS_48000; - break; - case 88200: - fs = IEC958_AES3_CON_FS_88200; - break; - case 96000: - fs = IEC958_AES3_CON_FS_96000; - break; - case 176400: - fs = IEC958_AES3_CON_FS_176400; - break; - case 192000: - fs = IEC958_AES3_CON_FS_192000; - break; - default: + memset(cs, 0, len); + + cs[0] = IEC958_AES0_CON_NOT_COPYRIGHT | IEC958_AES0_CON_EMPHASIS_NONE; + cs[1] = IEC958_AES1_CON_GENERAL; + cs[2] = IEC958_AES2_CON_SOURCE_UNSPEC | IEC958_AES2_CON_CHANNEL_UNSPEC; + cs[3] = IEC958_AES3_CON_CLOCK_1000PPM | IEC958_AES3_CON_FS_NOTID; + + if (len > 4) + cs[4] = IEC958_AES4_CON_WORDLEN_NOTID; + + return len; +} +EXPORT_SYMBOL_GPL(snd_pcm_create_iec958_consumer_default); + +static int fill_iec958_consumer(uint rate, uint sample_width, + u8 *cs, size_t len) +{ + if (len < 4) return -EINVAL; + + if ((cs[3] & IEC958_AES3_CON_FS) == IEC958_AES3_CON_FS_NOTID) { + unsigned int fs; + + switch (rate) { + case 32000: + fs = IEC958_AES3_CON_FS_32000; + break; + case 44100: + fs = IEC958_AES3_CON_FS_44100; + break; + case 48000: + fs = IEC958_AES3_CON_FS_48000; + break; + case 88200: + fs = IEC958_AES3_CON_FS_88200; + break; + case 96000: + fs = IEC958_AES3_CON_FS_96000; + break; + case 176400: + fs = IEC958_AES3_CON_FS_176400; + break; + case 192000: + fs = IEC958_AES3_CON_FS_192000; + break; + default: + return -EINVAL; + } + + cs[3] &= ~IEC958_AES3_CON_FS; + cs[3] |= fs; } - if (len > 4) { + if (len > 4 && + (cs[4] & IEC958_AES4_CON_WORDLEN) == IEC958_AES4_CON_WORDLEN_NOTID) { + unsigned int ws; + switch (sample_width) { case 16: ws = IEC958_AES4_CON_WORDLEN_20_16; @@ -64,21 +108,58 @@ static int create_iec958_consumer(uint rate, uint sample_width, default: return -EINVAL; } + + cs[4] &= ~IEC958_AES4_CON_WORDLEN; + cs[4] |= ws; } - memset(cs, 0, len); - - cs[0] = IEC958_AES0_CON_NOT_COPYRIGHT | IEC958_AES0_CON_EMPHASIS_NONE; - cs[1] = IEC958_AES1_CON_GENERAL; - cs[2] = IEC958_AES2_CON_SOURCE_UNSPEC | IEC958_AES2_CON_CHANNEL_UNSPEC; - cs[3] = IEC958_AES3_CON_CLOCK_1000PPM | fs; - - if (len > 4) - cs[4] = ws; - return len; } +/** + * snd_pcm_fill_iec958_consumer - Fill consumer format IEC958 channel status + * @runtime: pcm runtime structure with ->rate filled in + * @cs: channel status buffer, at least four bytes + * @len: length of channel status buffer + * + * Fill the unspecified bits in an IEC958 status bits array using the + * parameters of the PCM runtime @runtime. + * + * Drivers may wish to tweak the contents of the buffer after its been + * filled. + * + * Returns: length of buffer, or negative error code if something failed. + */ +int snd_pcm_fill_iec958_consumer(struct snd_pcm_runtime *runtime, + u8 *cs, size_t len) +{ + return fill_iec958_consumer(runtime->rate, + snd_pcm_format_width(runtime->format), + cs, len); +} +EXPORT_SYMBOL_GPL(snd_pcm_fill_iec958_consumer); + +/** + * snd_pcm_fill_iec958_consumer_hw_params - Fill consumer format IEC958 channel status + * @params: the hw_params instance for extracting rate and sample format + * @cs: channel status buffer, at least four bytes + * @len: length of channel status buffer + * + * Fill the unspecified bits in an IEC958 status bits array using the + * parameters of the PCM hardware parameters @params. + * + * Drivers may wish to tweak the contents of the buffer after its been + * filled.. + * + * Returns: length of buffer, or negative error code if something failed. + */ +int snd_pcm_fill_iec958_consumer_hw_params(struct snd_pcm_hw_params *params, + u8 *cs, size_t len) +{ + return fill_iec958_consumer(params_rate(params), params_width(params), cs, len); +} +EXPORT_SYMBOL_GPL(snd_pcm_fill_iec958_consumer_hw_params); + /** * snd_pcm_create_iec958_consumer - create consumer format IEC958 channel status * @runtime: pcm runtime structure with ->rate filled in @@ -95,9 +176,13 @@ static int create_iec958_consumer(uint rate, uint sample_width, int snd_pcm_create_iec958_consumer(struct snd_pcm_runtime *runtime, u8 *cs, size_t len) { - return create_iec958_consumer(runtime->rate, - snd_pcm_format_width(runtime->format), - cs, len); + int ret; + + ret = snd_pcm_create_iec958_consumer_default(cs, len); + if (ret < 0) + return ret; + + return snd_pcm_fill_iec958_consumer(runtime, cs, len); } EXPORT_SYMBOL(snd_pcm_create_iec958_consumer); @@ -117,7 +202,12 @@ EXPORT_SYMBOL(snd_pcm_create_iec958_consumer); int snd_pcm_create_iec958_consumer_hw_params(struct snd_pcm_hw_params *params, u8 *cs, size_t len) { - return create_iec958_consumer(params_rate(params), params_width(params), - cs, len); + int ret; + + ret = snd_pcm_create_iec958_consumer_default(cs, len); + if (ret < 0) + return ret; + + return fill_iec958_consumer(params_rate(params), params_width(params), cs, len); } EXPORT_SYMBOL(snd_pcm_create_iec958_consumer_hw_params); diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c index 403d4c6a49a8..d0fb04ae372c 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c @@ -22,7 +22,6 @@ struct hdmi_codec_channel_map_table { unsigned char map; /* ALSA API channel map position */ - unsigned long spk_mask; /* speaker position bit mask */ }; /* @@ -278,10 +277,12 @@ struct hdmi_codec_priv { bool busy; struct snd_soc_jack *jack; unsigned int jack_status; + u8 iec_status[5]; }; static const struct snd_soc_dapm_widget hdmi_widgets[] = { SND_SOC_DAPM_OUTPUT("TX"), + SND_SOC_DAPM_OUTPUT("RX"), }; enum { @@ -385,10 +386,52 @@ static int hdmi_codec_chmap_ctl_get(struct snd_kcontrol *kcontrol, return 0; } +static int hdmi_codec_iec958_info(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo) +{ + uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; + uinfo->count = 1; + return 0; +} + +static int hdmi_codec_iec958_default_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); + struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component); + + memcpy(ucontrol->value.iec958.status, hcp->iec_status, + sizeof(hcp->iec_status)); + + return 0; +} + +static int hdmi_codec_iec958_default_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); + struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component); + + memcpy(hcp->iec_status, ucontrol->value.iec958.status, + sizeof(hcp->iec_status)); + + return 0; +} + +static int hdmi_codec_iec958_mask_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + memset(ucontrol->value.iec958.status, 0xff, + sizeof_field(struct hdmi_codec_priv, iec_status)); + + return 0; +} + static int hdmi_codec_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); + bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; int ret = 0; mutex_lock(&hcp->lock); @@ -404,7 +447,7 @@ static int hdmi_codec_startup(struct snd_pcm_substream *substream, goto err; } - if (hcp->hcd.ops->get_eld) { + if (tx && hcp->hcd.ops->get_eld) { ret = hcp->hcd.ops->get_eld(dai->dev->parent, hcp->hcd.data, hcp->eld, sizeof(hcp->eld)); if (ret) @@ -438,6 +481,42 @@ static void hdmi_codec_shutdown(struct snd_pcm_substream *substream, mutex_unlock(&hcp->lock); } +static int hdmi_codec_fill_codec_params(struct snd_soc_dai *dai, + unsigned int sample_width, + unsigned int sample_rate, + unsigned int channels, + struct hdmi_codec_params *hp) +{ + struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); + int idx; + + /* Select a channel allocation that matches with ELD and pcm channels */ + idx = hdmi_codec_get_ch_alloc_table_idx(hcp, channels); + if (idx < 0) { + dev_err(dai->dev, "Not able to map channels to speakers (%d)\n", + idx); + hcp->chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN; + return idx; + } + + memset(hp, 0, sizeof(*hp)); + + hdmi_audio_infoframe_init(&hp->cea); + hp->cea.channels = channels; + hp->cea.coding_type = HDMI_AUDIO_CODING_TYPE_STREAM; + hp->cea.sample_size = HDMI_AUDIO_SAMPLE_SIZE_STREAM; + hp->cea.sample_frequency = HDMI_AUDIO_SAMPLE_FREQUENCY_STREAM; + hp->cea.channel_allocation = hdmi_codec_channel_alloc[idx].ca_id; + + hp->sample_width = sample_width; + hp->sample_rate = sample_rate; + hp->channels = channels; + + hcp->chmap_idx = hdmi_codec_channel_alloc[idx].ca_id; + + return 0; +} + static int hdmi_codec_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) @@ -452,45 +531,73 @@ static int hdmi_codec_hw_params(struct snd_pcm_substream *substream, .dig_subframe = { 0 }, } }; - int ret, idx; + int ret; + + if (!hcp->hcd.ops->hw_params) + return 0; dev_dbg(dai->dev, "%s() width %d rate %d channels %d\n", __func__, params_width(params), params_rate(params), params_channels(params)); - ret = snd_pcm_create_iec958_consumer_hw_params(params, hp.iec.status, - sizeof(hp.iec.status)); + ret = hdmi_codec_fill_codec_params(dai, + params_width(params), + params_rate(params), + params_channels(params), + &hp); + if (ret < 0) + return ret; + + memcpy(hp.iec.status, hcp->iec_status, sizeof(hp.iec.status)); + ret = snd_pcm_fill_iec958_consumer_hw_params(params, hp.iec.status, + sizeof(hp.iec.status)); if (ret < 0) { dev_err(dai->dev, "Creating IEC958 channel status failed %d\n", ret); return ret; } - hdmi_audio_infoframe_init(&hp.cea); - hp.cea.channels = params_channels(params); - hp.cea.coding_type = HDMI_AUDIO_CODING_TYPE_STREAM; - hp.cea.sample_size = HDMI_AUDIO_SAMPLE_SIZE_STREAM; - hp.cea.sample_frequency = HDMI_AUDIO_SAMPLE_FREQUENCY_STREAM; - - /* Select a channel allocation that matches with ELD and pcm channels */ - idx = hdmi_codec_get_ch_alloc_table_idx(hcp, hp.cea.channels); - if (idx < 0) { - dev_err(dai->dev, "Not able to map channels to speakers (%d)\n", - idx); - hcp->chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN; - return idx; - } - hp.cea.channel_allocation = hdmi_codec_channel_alloc[idx].ca_id; - hcp->chmap_idx = hdmi_codec_channel_alloc[idx].ca_id; - - hp.sample_width = params_width(params); - hp.sample_rate = params_rate(params); - hp.channels = params_channels(params); - + cf->bit_fmt = params_format(params); return hcp->hcd.ops->hw_params(dai->dev->parent, hcp->hcd.data, cf, &hp); } +static int hdmi_codec_prepare(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); + struct hdmi_codec_daifmt *cf = dai->playback_dma_data; + struct snd_pcm_runtime *runtime = substream->runtime; + unsigned int channels = runtime->channels; + unsigned int width = snd_pcm_format_width(runtime->format); + unsigned int rate = runtime->rate; + struct hdmi_codec_params hp; + int ret; + + if (!hcp->hcd.ops->prepare) + return 0; + + dev_dbg(dai->dev, "%s() width %d rate %d channels %d\n", __func__, + width, rate, channels); + + ret = hdmi_codec_fill_codec_params(dai, width, rate, channels, &hp); + if (ret < 0) + return ret; + + memcpy(hp.iec.status, hcp->iec_status, sizeof(hp.iec.status)); + ret = snd_pcm_fill_iec958_consumer(runtime, hp.iec.status, + sizeof(hp.iec.status)); + if (ret < 0) { + dev_err(dai->dev, "Creating IEC958 channel status failed %d\n", + ret); + return ret; + } + + cf->bit_fmt = runtime->format; + return hcp->hcd.ops->prepare(dai->dev->parent, hcp->hcd.data, + cf, &hp); +} + static int hdmi_codec_i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) { @@ -582,6 +689,7 @@ static const struct snd_soc_dai_ops hdmi_codec_i2s_dai_ops = { .startup = hdmi_codec_startup, .shutdown = hdmi_codec_shutdown, .hw_params = hdmi_codec_hw_params, + .prepare = hdmi_codec_prepare, .set_fmt = hdmi_codec_i2s_set_fmt, .mute_stream = hdmi_codec_mute, }; @@ -615,23 +723,40 @@ static const struct snd_soc_dai_ops hdmi_codec_spdif_dai_ops = { SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S20_3BE |\ SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S24_3BE |\ SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S24_BE |\ - SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S32_BE) + SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S32_BE |\ + SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE) + +static struct snd_kcontrol_new hdmi_codec_controls[] = { + { + .access = SNDRV_CTL_ELEM_ACCESS_READ, + .iface = SNDRV_CTL_ELEM_IFACE_PCM, + .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, MASK), + .info = hdmi_codec_iec958_info, + .get = hdmi_codec_iec958_mask_get, + }, + { + .iface = SNDRV_CTL_ELEM_IFACE_PCM, + .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, DEFAULT), + .info = hdmi_codec_iec958_info, + .get = hdmi_codec_iec958_default_get, + .put = hdmi_codec_iec958_default_put, + }, + { + .access = (SNDRV_CTL_ELEM_ACCESS_READ | + SNDRV_CTL_ELEM_ACCESS_VOLATILE), + .iface = SNDRV_CTL_ELEM_IFACE_PCM, + .name = "ELD", + .info = hdmi_eld_ctl_info, + .get = hdmi_eld_ctl_get, + }, +}; static int hdmi_codec_pcm_new(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) { struct snd_soc_dai_driver *drv = dai->driver; struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); - struct snd_kcontrol *kctl; - struct snd_kcontrol_new hdmi_eld_ctl = { - .access = SNDRV_CTL_ELEM_ACCESS_READ | - SNDRV_CTL_ELEM_ACCESS_VOLATILE, - .iface = SNDRV_CTL_ELEM_IFACE_PCM, - .name = "ELD", - .info = hdmi_eld_ctl_info, - .get = hdmi_eld_ctl_get, - .device = rtd->pcm->device, - }; + unsigned int i; int ret; ret = snd_pcm_add_chmap_ctls(rtd->pcm, SNDRV_PCM_STREAM_PLAYBACK, @@ -648,26 +773,41 @@ static int hdmi_codec_pcm_new(struct snd_soc_pcm_runtime *rtd, hcp->chmap_info->chmap = hdmi_codec_stereo_chmaps; hcp->chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN; - /* add ELD ctl with the device number corresponding to the PCM stream */ - kctl = snd_ctl_new1(&hdmi_eld_ctl, dai->component); - if (!kctl) - return -ENOMEM; + for (i = 0; i < ARRAY_SIZE(hdmi_codec_controls); i++) { + struct snd_kcontrol *kctl; - return snd_ctl_add(rtd->card->snd_card, kctl); + /* add ELD ctl with the device number corresponding to the PCM stream */ + kctl = snd_ctl_new1(&hdmi_codec_controls[i], dai->component); + if (!kctl) + return -ENOMEM; + + kctl->id.device = rtd->pcm->device; + ret = snd_ctl_add(rtd->card->snd_card, kctl); + if (ret < 0) + return ret; + } + + return 0; } static int hdmi_dai_probe(struct snd_soc_dai *dai) { struct snd_soc_dapm_context *dapm; struct hdmi_codec_daifmt *daifmt; - struct snd_soc_dapm_route route = { - .sink = "TX", - .source = dai->driver->playback.stream_name, + struct snd_soc_dapm_route route[] = { + { + .sink = "TX", + .source = dai->driver->playback.stream_name, + }, + { + .sink = dai->driver->capture.stream_name, + .source = "RX", + }, }; int ret; dapm = snd_soc_component_get_dapm(dai->component); - ret = snd_soc_dapm_add_routes(dapm, &route, 1); + ret = snd_soc_dapm_add_routes(dapm, route, 2); if (ret) return ret; @@ -692,10 +832,16 @@ static void plugged_cb(struct device *dev, bool plugged) { struct hdmi_codec_priv *hcp = dev_get_drvdata(dev); - if (plugged) + if (plugged) { + if (hcp->hcd.ops->get_eld) { + hcp->hcd.ops->get_eld(dev->parent, hcp->hcd.data, + hcp->eld, sizeof(hcp->eld)); + } hdmi_codec_jack_report(hcp, SND_JACK_LINEOUT); - else + } else { hdmi_codec_jack_report(hcp, 0); + memset(hcp->eld, 0, sizeof(hcp->eld)); + } } static int hdmi_codec_set_jack(struct snd_soc_component *component, @@ -703,7 +849,7 @@ static int hdmi_codec_set_jack(struct snd_soc_component *component, void *data) { struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component); - int ret = -EOPNOTSUPP; + int ret = -ENOTSUPP; if (hcp->hcd.ops->hook_plugged_cb) { hcp->jack = jack; @@ -719,7 +865,7 @@ static int hdmi_codec_set_jack(struct snd_soc_component *component, static int hdmi_dai_spdif_probe(struct snd_soc_dai *dai) { - struct hdmi_codec_daifmt *cf = dai->playback_dma_data; + struct hdmi_codec_daifmt *cf; int ret; ret = hdmi_dai_probe(dai); @@ -751,6 +897,14 @@ static const struct snd_soc_dai_driver hdmi_i2s_dai = { .formats = I2S_FORMATS, .sig_bits = 24, }, + .capture = { + .stream_name = "Capture", + .channels_min = 2, + .channels_max = 8, + .rates = HDMI_RATES, + .formats = I2S_FORMATS, + .sig_bits = 24, + }, .ops = &hdmi_codec_i2s_dai_ops, .pcm_new = hdmi_codec_pcm_new, }; @@ -767,6 +921,13 @@ static const struct snd_soc_dai_driver hdmi_spdif_dai = { .rates = HDMI_RATES, .formats = SPDIF_FORMATS, }, + .capture = { + .stream_name = "Capture", + .channels_min = 2, + .channels_max = 2, + .rates = HDMI_RATES, + .formats = SPDIF_FORMATS, + }, .ops = &hdmi_codec_spdif_dai_ops, .pcm_new = hdmi_codec_pcm_new, }; @@ -819,7 +980,8 @@ static int hdmi_codec_probe(struct platform_device *pdev) } dai_count = hcd->i2s + hcd->spdif; - if (dai_count < 1 || !hcd->ops || !hcd->ops->hw_params || + if (dai_count < 1 || !hcd->ops || + (!hcd->ops->hw_params && !hcd->ops->prepare) || !hcd->ops->audio_shutdown) { dev_err(dev, "%s: Invalid parameters\n", __func__); return -EINVAL; @@ -832,6 +994,11 @@ static int hdmi_codec_probe(struct platform_device *pdev) hcp->hcd = *hcd; mutex_init(&hcp->lock); + ret = snd_pcm_create_iec958_consumer_default(hcp->iec_status, + sizeof(hcp->iec_status)); + if (ret < 0) + return ret; + daidrv = devm_kcalloc(dev, dai_count, sizeof(*daidrv), GFP_KERNEL); if (!daidrv) return -ENOMEM; diff --git a/tools/testing/selftests/filesystems/fuse/OWNERS b/tools/testing/selftests/filesystems/fuse/OWNERS deleted file mode 100644 index 5eb371e1a5a3..000000000000 --- a/tools/testing/selftests/filesystems/fuse/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# include OWNERS from the authoritative android-mainline branch -include kernel/common:android-mainline:/tools/testing/selftests/filesystems/incfs/OWNERS diff --git a/tools/testing/selftests/filesystems/fuse/fuse_test.c b/tools/testing/selftests/filesystems/fuse/fuse_test.c index b94bbc8c0cbe..461b79656973 100644 --- a/tools/testing/selftests/filesystems/fuse/fuse_test.c +++ b/tools/testing/selftests/filesystems/fuse/fuse_test.c @@ -1677,8 +1677,351 @@ out: return result; } +static int bpf_test_no_readdirplus_without_nodeid(const char *mount_dir) +{ + const char *folder1 = "folder1"; + const char *folder2 = "folder2"; + int result = TEST_FAILURE; + int fuse_dev = -1; + int src_fd = -1; + int content_fd = -1; + int bpf_fd = -1; + int pid = -1; + int status; -static int parse_options(int argc, char *const *argv) + TESTEQUAL(install_elf_bpf("test_bpf.bpf", "test_readdirplus", + &bpf_fd, NULL, NULL), 0); + TESTSYSCALL(s_mkdir(s_path(s(ft_src), s(folder1)), 0777)); + TESTSYSCALL(s_mkdir(s_path(s(ft_src), s(folder2)), 0777)); + TESTEQUAL(mount_fuse_no_init(mount_dir, -1, -1, &fuse_dev), 0); + FUSE_ACTION + DIR *open_dir = NULL; + struct dirent *dirent; + + // Folder 1: Readdir with no nodeid + TEST(open_dir = s_opendir(s_path(s(ft_dst), s(folder1))), + open_dir != NULL); + TEST(dirent = readdir(open_dir), dirent == NULL); + TESTCOND(errno == EINVAL); + TESTSYSCALL(closedir(open_dir)); + open_dir = NULL; + + // Folder 2: Readdir with a nodeid + TEST(open_dir = s_opendir(s_path(s(ft_dst), s(folder2))), + open_dir != NULL); + TEST(dirent = readdir(open_dir), dirent == NULL); + TESTCOND(errno == EINVAL); + TESTSYSCALL(closedir(open_dir)); + open_dir = NULL; + FUSE_DAEMON + size_t read_size; + struct fuse_in_header *in_header = (struct fuse_in_header *)bytes_in; + struct fuse_attr attr = {}; + int backing_fd = -1; + + TESTFUSEINITFLAGS(FUSE_DO_READDIRPLUS | FUSE_READDIRPLUS_AUTO); + + // folder 1: Set 0 as nodeid, Expect READDIR + TESTFUSELOOKUP(folder1, 0); + TEST(backing_fd = s_open(s_path(s(ft_src), s(folder1)), + O_DIRECTORY | O_RDONLY | O_CLOEXEC), + backing_fd != -1); + TESTFUSEOUT2(fuse_entry_out, ((struct fuse_entry_out) { + .nodeid = 0, + .generation = 0, + .entry_valid = UINT64_MAX, + .attr_valid = UINT64_MAX, + .entry_valid_nsec = UINT32_MAX, + .attr_valid_nsec = UINT32_MAX, + .attr = attr, + }), fuse_entry_bpf_out, ((struct fuse_entry_bpf_out) { + .backing_action = FUSE_ACTION_REPLACE, + .backing_fd = backing_fd, + .bpf_action = FUSE_ACTION_REPLACE, + .bpf_fd = bpf_fd, + })); + TESTSYSCALL(close(backing_fd)); + TEST(read_size = read(fuse_dev, bytes_in, sizeof(bytes_in)), read_size > 0); + TESTEQUAL(in_header->opcode, FUSE_READDIR); + TESTFUSEOUTERROR(-EINVAL); + + // folder 2: Set 10 as nodeid, Expect READDIRPLUS + TESTFUSELOOKUP(folder2, 0); + TEST(backing_fd = s_open(s_path(s(ft_src), s(folder2)), + O_DIRECTORY | O_RDONLY | O_CLOEXEC), + backing_fd != -1); + TESTFUSEOUT2(fuse_entry_out, ((struct fuse_entry_out) { + .nodeid = 10, + .generation = 0, + .entry_valid = UINT64_MAX, + .attr_valid = UINT64_MAX, + .entry_valid_nsec = UINT32_MAX, + .attr_valid_nsec = UINT32_MAX, + .attr = attr, + }), fuse_entry_bpf_out, ((struct fuse_entry_bpf_out) { + .backing_action = FUSE_ACTION_REPLACE, + .backing_fd = backing_fd, + .bpf_action = FUSE_ACTION_REPLACE, + .bpf_fd = bpf_fd, + })); + TESTSYSCALL(close(backing_fd)); + TEST(read_size = read(fuse_dev, bytes_in, sizeof(bytes_in)), read_size > 0); + TESTEQUAL(in_header->opcode, FUSE_READDIRPLUS); + TESTFUSEOUTERROR(-EINVAL); + FUSE_DONE + result = TEST_SUCCESS; +out: + close(fuse_dev); + close(content_fd); + close(src_fd); + close(bpf_fd); + umount(mount_dir); + return result; +} + +/* + * State: + * Original: dst/folder1/content.txt + * ^ + * | + * | + * Backing: src/folder1/content.txt + * + * Step 1: open(folder1) - lookup folder1 with entry_timeout set to 0 + * Step 2: open(folder1) - lookup folder1 again to trigger revalidate wich will + * set backing fd + * + * Check 1: cat(content.txt) - check not receiving call on the fuse daemon + * and content is the same + */ +static int bpf_test_revalidate_handle_backing_fd(const char *mount_dir) +{ + const char *folder1 = "folder1"; + const char *content_file = "content.txt"; + const char *content = "hello world"; + int result = TEST_FAILURE; + int fuse_dev = -1; + int src_fd = -1; + int content_fd = -1; + int pid = -1; + int status; + TESTSYSCALL(s_mkdir(s_path(s(ft_src), s(folder1)), 0777)); + TEST(content_fd = s_creat(s_pathn(3, s(ft_src), s(folder1), s(content_file)), 0777), + content_fd != -1); + TESTEQUAL(write(content_fd, content, strlen(content)), strlen(content)); + TESTSYSCALL(close(content_fd)); + content_fd = -1; + TESTEQUAL(mount_fuse_no_init(mount_dir, -1, -1, &fuse_dev), 0); + FUSE_ACTION + int dst_folder1_fd = -1; + int dst_content_fd = -1; + int dst_content_read_size = -1; + char content_buffer[9] = {0}; + // Step 1: Lookup folder1 + TESTERR(dst_folder1_fd = s_open(s_path(s(mount_dir), s(folder1)), + O_RDONLY | O_CLOEXEC), dst_folder1_fd != -1); + TESTSYSCALL(close(dst_folder1_fd)); + dst_folder1_fd = -1; + // Step 2: Lookup folder1 again + TESTERR(dst_folder1_fd = s_open(s_path(s(mount_dir), s(folder1)), + O_RDONLY | O_CLOEXEC), dst_folder1_fd != -1); + TESTSYSCALL(close(dst_folder1_fd)); + dst_folder1_fd = -1; + // Check 1: Read content file (must be backed) + TESTERR(dst_content_fd = + s_open(s_pathn(3, s(mount_dir), s(folder1), s(content_file)), + O_RDONLY | O_CLOEXEC), dst_content_fd != -1); + TEST(dst_content_read_size = + read(dst_content_fd, content_buffer, strlen(content)), + dst_content_read_size == strlen(content) && + strcmp(content, content_buffer) == 0); + TESTSYSCALL(close(dst_content_fd)); + dst_content_fd = -1; + FUSE_DAEMON + struct fuse_attr attr = {}; + int backing_fd = -1; + TESTFUSEINITFLAGS(FUSE_DO_READDIRPLUS | FUSE_READDIRPLUS_AUTO); + // Step 1: Lookup folder1 set entry_timeout to 0 to trigger + // revalidate later + TESTFUSELOOKUP(folder1, 0); + TESTSYSCALL(s_fuse_attr(s_path(s(ft_src), s(folder1)), &attr)); + TEST(backing_fd = s_open(s_path(s(ft_src), s(folder1)), + O_DIRECTORY | O_RDONLY | O_CLOEXEC), + backing_fd != -1); + TESTFUSEOUT2(fuse_entry_out, ((struct fuse_entry_out) { + .nodeid = attr.ino, + .generation = 0, + .entry_valid = 0, + .attr_valid = UINT64_MAX, + .entry_valid_nsec = 0, + .attr_valid_nsec = UINT32_MAX, + .attr = attr, + }), fuse_entry_bpf_out, ((struct fuse_entry_bpf_out) { + .backing_action = FUSE_ACTION_REPLACE, + .backing_fd = backing_fd, + })); + TESTSYSCALL(close(backing_fd)); + // Step 1: Lookup folder1 as a reaction to revalidate call + // This attempts to change the backing node, which is not allowed on revalidate + TESTFUSELOOKUP(folder1, 0); + TESTSYSCALL(s_fuse_attr(s_path(s(ft_src), s(folder1)), &attr)); + TEST(backing_fd = s_open(s_path(s(ft_src), s(folder1)), + O_DIRECTORY | O_RDONLY | O_CLOEXEC), + backing_fd != -1); + TESTFUSEOUT2(fuse_entry_out, ((struct fuse_entry_out) { + .nodeid = attr.ino, + .generation = 0, + .entry_valid = UINT64_MAX, + .attr_valid = UINT64_MAX, + .entry_valid_nsec = UINT32_MAX, + .attr_valid_nsec = UINT32_MAX, + .attr = attr, + }), fuse_entry_bpf_out, ((struct fuse_entry_bpf_out) { + .backing_action = FUSE_ACTION_REPLACE, + .backing_fd = backing_fd, + })); + TESTSYSCALL(close(backing_fd)); + + // Lookup folder1 as a reaction to failed revalidate + TESTFUSELOOKUP(folder1, 0); + TESTSYSCALL(s_fuse_attr(s_path(s(ft_src), s(folder1)), &attr)); + TEST(backing_fd = s_open(s_path(s(ft_src), s(folder1)), + O_DIRECTORY | O_RDONLY | O_CLOEXEC), + backing_fd != -1); + TESTFUSEOUT2(fuse_entry_out, ((struct fuse_entry_out) { + .nodeid = attr.ino, + .generation = 0, + .entry_valid = UINT64_MAX, + .attr_valid = UINT64_MAX, + .entry_valid_nsec = UINT32_MAX, + .attr_valid_nsec = UINT32_MAX, + .attr = attr, + }), fuse_entry_bpf_out, ((struct fuse_entry_bpf_out) { + .backing_action = FUSE_ACTION_REPLACE, + .backing_fd = backing_fd, + })); + TESTSYSCALL(close(backing_fd)); + FUSE_DONE + result = TEST_SUCCESS; +out: + close(fuse_dev); + close(content_fd); + close(src_fd); + umount(mount_dir); + return result; +} + +static int bpf_test_lookup_postfilter(const char *mount_dir) +{ + const char *file1_name = "file1"; + const char *file2_name = "file2"; + const char *file3_name = "file3"; + int result = TEST_FAILURE; + int bpf_fd = -1; + int src_fd = -1; + int fuse_dev = -1; + int file_fd = -1; + int pid = -1; + int status; + + TEST(file_fd = s_creat(s_path(s(ft_src), s(file1_name)), 0777), + file_fd != -1); + TESTSYSCALL(close(file_fd)); + TEST(file_fd = s_creat(s_path(s(ft_src), s(file2_name)), 0777), + file_fd != -1); + TESTSYSCALL(close(file_fd)); + file_fd = -1; + TESTEQUAL(install_elf_bpf("test_bpf.bpf", "test_lookup_postfilter", + &bpf_fd, NULL, NULL), 0); + TEST(src_fd = open(ft_src, O_DIRECTORY | O_RDONLY | O_CLOEXEC), + src_fd != -1); + TESTEQUAL(mount_fuse(mount_dir, bpf_fd, src_fd, &fuse_dev), 0); + FUSE_ACTION + int fd = -1; + + TESTEQUAL(s_open(s_path(s(mount_dir), s(file1_name)), O_RDONLY), + -1); + TESTEQUAL(errno, ENOENT); + TEST(fd = s_open(s_path(s(mount_dir), s(file2_name)), O_RDONLY), + fd != -1); + TESTSYSCALL(close(fd)); + TESTEQUAL(s_open(s_path(s(mount_dir), s(file3_name)), O_RDONLY), + -1); + FUSE_DAEMON + struct fuse_in_header *in_header = + (struct fuse_in_header *)bytes_in; + struct fuse_entry_out *feo; + struct fuse_entry_bpf_out *febo; + + TESTFUSELOOKUP(file1_name, FUSE_POSTFILTER); + TESTFUSEOUTERROR(-ENOENT); + + TESTFUSELOOKUP(file2_name, FUSE_POSTFILTER); + feo = (struct fuse_entry_out *) (bytes_in + + sizeof(struct fuse_in_header) + strlen(file2_name) + 1); + febo = (struct fuse_entry_bpf_out *) ((char *)feo + + sizeof(*feo)); + TESTFUSEOUT2(fuse_entry_out, *feo, fuse_entry_bpf_out, *febo); + + TESTFUSELOOKUP(file3_name, FUSE_POSTFILTER); + TESTEQUAL(in_header->error_in, -ENOENT); + TESTFUSEOUTERROR(-ENOENT); + FUSE_DONE + + result = TEST_SUCCESS; +out: + close(file_fd); + close(fuse_dev); + umount(mount_dir); + close(src_fd); + close(bpf_fd); + return result; +} + +static void parse_range(const char *ranges, bool *run_test, size_t tests) +{ + size_t i; + char *range; + + for (i = 0; i < tests; ++i) + run_test[i] = false; + + range = strtok(optarg, ","); + while (range) { + char *dash = strchr(range, '-'); + + if (dash) { + size_t start = 1, end = tests; + char *end_ptr; + + if (dash > range) { + start = strtol(range, &end_ptr, 10); + if (*end_ptr != '-' || start <= 0 || start > tests) + ksft_exit_fail_msg("Bad range\n"); + } + + if (dash[1]) { + end = strtol(dash + 1, &end_ptr, 10); + if (*end_ptr || end <= start || end > tests) + ksft_exit_fail_msg("Bad range\n"); + } + + for (i = start; i <= end; ++i) + run_test[i - 1] = true; + } else { + char *end; + long value = strtol(range, &end, 10); + + if (*end || value <= 0 || value > tests) + ksft_exit_fail_msg("Bad range\n"); + run_test[value - 1] = true; + } + range = strtok(NULL, ","); + } +} + +static int parse_options(int argc, char *const *argv, bool *run_test, + size_t tests) { signed char c; @@ -1689,7 +2032,7 @@ static int parse_options(int argc, char *const *argv) break; case 't': - test_options.test = strtol(optarg, NULL, 10); + parse_range(optarg, run_test, tests); break; case 'v': @@ -1708,7 +2051,8 @@ struct test_case { const char *name; }; -static void run_one_test(const char *mount_dir, struct test_case *test_case) +static void run_one_test(const char *mount_dir, + const struct test_case *test_case) { ksft_print_msg("Running %s\n", test_case->name); if (test_case->pfunc(mount_dir) == TEST_SUCCESS) @@ -1724,37 +2068,11 @@ int main(int argc, char *argv[]) int i; int fd, count; - if (parse_options(argc, argv)) - ksft_exit_fail_msg("Bad options\n"); - - // Seed randomness pool for testing on QEMU - // NOTE - this abuses the concept of randomness - do *not* ever do this - // on a machine for production use - the device will think it has good - // randomness when it does not. - fd = open("/dev/urandom", O_WRONLY | O_CLOEXEC); - count = 4096; - for (int i = 0; i < 128; ++i) - ioctl(fd, RNDADDTOENTCNT, &count); - close(fd); - - ksft_print_header(); - - if (geteuid() != 0) - ksft_print_msg("Not a root, might fail to mount.\n"); - - if (tracing_on() != TEST_SUCCESS) - ksft_exit_fail_msg("Can't turn on tracing\n"); - - src_dir = setup_mount_dir(ft_src); - mount_dir = setup_mount_dir(ft_dst); - if (src_dir == NULL || mount_dir == NULL) - ksft_exit_fail_msg("Can't create a mount dir\n"); - #define MAKE_TEST(test) \ { \ test, #test \ } - struct test_case cases[] = { + const struct test_case cases[] = { MAKE_TEST(basic_test), MAKE_TEST(bpf_test_real), MAKE_TEST(bpf_test_partial), @@ -1782,27 +2100,53 @@ int main(int argc, char *argv[]) MAKE_TEST(inotify_test), MAKE_TEST(bpf_test_statfs), MAKE_TEST(bpf_test_lseek), - MAKE_TEST(bpf_test_readdirplus_not_overriding_backing) + MAKE_TEST(bpf_test_readdirplus_not_overriding_backing), + MAKE_TEST(bpf_test_no_readdirplus_without_nodeid), + MAKE_TEST(bpf_test_revalidate_handle_backing_fd), + MAKE_TEST(bpf_test_lookup_postfilter), }; #undef MAKE_TEST - if (test_options.test) { - if (test_options.test <= 0 || - test_options.test > ARRAY_SIZE(cases)) - ksft_exit_fail_msg("Invalid test\n"); + bool run_test[ARRAY_SIZE(cases)]; - ksft_set_plan(1); - delete_dir_tree(mount_dir, false); - delete_dir_tree(src_dir, false); - run_one_test(mount_dir, &cases[test_options.test - 1]); - } else { - ksft_set_plan(ARRAY_SIZE(cases)); - for (i = 0; i < ARRAY_SIZE(cases); ++i) { + for (int i = 0; i < ARRAY_SIZE(cases); ++i) + run_test[i] = true; + + if (parse_options(argc, argv, run_test, ARRAY_SIZE(cases))) + ksft_exit_fail_msg("Bad options\n"); + + // Seed randomness pool for testing on QEMU + // NOTE - this abuses the concept of randomness - do *not* ever do this + // on a machine for production use - the device will think it has good + // randomness when it does not. + fd = open("/dev/urandom", O_WRONLY | O_CLOEXEC); + count = 4096; + for (int i = 0; i < 128; ++i) + ioctl(fd, RNDADDTOENTCNT, &count); + close(fd); + + ksft_print_header(); + + if (geteuid() != 0) + ksft_print_msg("Not a root, might fail to mount.\n"); + + if (tracing_on() != TEST_SUCCESS) + ksft_exit_fail_msg("Can't turn on tracing\n"); + + src_dir = setup_mount_dir(ft_src); + mount_dir = setup_mount_dir(ft_dst); + if (src_dir == NULL || mount_dir == NULL) + ksft_exit_fail_msg("Can't create a mount dir\n"); + + ksft_set_plan(ARRAY_SIZE(run_test)); + + for (i = 0; i < ARRAY_SIZE(run_test); ++i) + if (run_test[i]) { delete_dir_tree(mount_dir, false); delete_dir_tree(src_dir, false); run_one_test(mount_dir, &cases[i]); - } - } + } else + ksft_cnt.ksft_xskip++; umount2(mount_dir, MNT_FORCE); delete_dir_tree(mount_dir, true); diff --git a/tools/testing/selftests/filesystems/fuse/test_bpf.c b/tools/testing/selftests/filesystems/fuse/test_bpf.c index 3f4a9e727b68..b47445735ab6 100644 --- a/tools/testing/selftests/filesystems/fuse/test_bpf.c +++ b/tools/testing/selftests/filesystems/fuse/test_bpf.c @@ -514,3 +514,26 @@ int error_test(struct fuse_bpf_args *fa) } } +SEC("test_readdirplus") +int readdirplus_test(struct fuse_bpf_args *fa) +{ + switch (fa->opcode) { + case FUSE_READDIR | FUSE_PREFILTER: { + return 0; + } + } + return FUSE_BPF_BACKING; +} + +SEC("test_lookup_postfilter") +int lookuppostfilter_test(struct fuse_bpf_args *fa) +{ + switch(fa->opcode) { + case FUSE_LOOKUP | FUSE_PREFILTER: + return FUSE_BPF_BACKING | FUSE_BPF_POST_FILTER; + case FUSE_LOOKUP | FUSE_POSTFILTER: + return FUSE_BPF_USER_FILTER; + default: + return FUSE_BPF_BACKING; + } +} diff --git a/tools/testing/selftests/filesystems/fuse/test_framework.h b/tools/testing/selftests/filesystems/fuse/test_framework.h index 945f141e9a66..7e832e901d50 100644 --- a/tools/testing/selftests/filesystems/fuse/test_framework.h +++ b/tools/testing/selftests/filesystems/fuse/test_framework.h @@ -40,7 +40,6 @@ static int test_case_fail; struct _test_options { int file; - int test; bool verbose; }; diff --git a/tools/testing/selftests/filesystems/incfs/OWNERS b/tools/testing/selftests/filesystems/incfs/OWNERS deleted file mode 100644 index 5eb371e1a5a3..000000000000 --- a/tools/testing/selftests/filesystems/incfs/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# include OWNERS from the authoritative android-mainline branch -include kernel/common:android-mainline:/tools/testing/selftests/filesystems/incfs/OWNERS diff --git a/usr/Makefile b/usr/Makefile index b1a81a40eab1..7b89c0175a3a 100644 --- a/usr/Makefile +++ b/usr/Makefile @@ -3,11 +3,6 @@ # kbuild file for usr/ - including initramfs image # -# cmd_bzip2, cmd_lzma, cmd_lzo, cmd_lz4 from scripts/Makefile.lib appends the -# size at the end of the compressed file, which unfortunately does not work -# with unpack_to_rootfs(). Make size_append no-op. -override size_append := : - compress-y := shipped compress-$(CONFIG_INITRAMFS_COMPRESSION_GZIP) := gzip compress-$(CONFIG_INITRAMFS_COMPRESSION_BZIP2) := bzip2