Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'ib-pdx86-properties'

Merge branch 'ib-pdx86-properties' of
git://git.infradead.org/linux-platform-drivers-x86.git
to avoid conflicts in PDx86.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

+3376 -2210
+19 -28
Documentation/admin-guide/sysctl/kernel.rst
··· 390 390 modprobe 391 391 ======== 392 392 393 - This gives the full path of the modprobe command which the kernel will 394 - use to load modules. This can be used to debug module loading 395 - requests:: 393 + The full path to the usermode helper for autoloading kernel modules, 394 + by default "/sbin/modprobe". This binary is executed when the kernel 395 + requests a module. For example, if userspace passes an unknown 396 + filesystem type to mount(), then the kernel will automatically request 397 + the corresponding filesystem module by executing this usermode helper. 398 + This usermode helper should insert the needed module into the kernel. 399 + 400 + This sysctl only affects module autoloading. It has no effect on the 401 + ability to explicitly insert modules. 402 + 403 + This sysctl can be used to debug module loading requests:: 396 404 397 405 echo '#! /bin/sh' > /tmp/modprobe 398 406 echo 'echo "$@" >> /tmp/modprobe.log' >> /tmp/modprobe ··· 408 400 chmod a+x /tmp/modprobe 409 401 echo /tmp/modprobe > /proc/sys/kernel/modprobe 410 402 411 - This only applies when the *kernel* is requesting that the module be 412 - loaded; it won't have any effect if the module is being loaded 413 - explicitly using ``modprobe`` from userspace. 403 + Alternatively, if this sysctl is set to the empty string, then module 404 + autoloading is completely disabled. The kernel will not try to 405 + execute a usermode helper at all, nor will it call the 406 + kernel_module_request LSM hook. 414 407 408 + If CONFIG_STATIC_USERMODEHELPER=y is set in the kernel configuration, 409 + then the configured static usermode helper overrides this sysctl, 410 + except that the empty string is still accepted to completely disable 411 + module autoloading as described above. 415 412 416 413 modules_disabled 417 414 ================ ··· 458 445 2) Toggle with non-default value will be set back to -1 by kernel after 459 446 successful IPC object allocation. If an IPC object allocation syscall 460 447 fails, it is undefined if the value remains unmodified or is reset to -1. 461 - 462 - modprobe: 463 - ========= 464 - 465 - The path to the usermode helper for autoloading kernel modules, by 466 - default "/sbin/modprobe". This binary is executed when the kernel 467 - requests a module. For example, if userspace passes an unknown 468 - filesystem type to mount(), then the kernel will automatically request 469 - the corresponding filesystem module by executing this usermode helper. 470 - This usermode helper should insert the needed module into the kernel. 471 - 472 - This sysctl only affects module autoloading. It has no effect on the 473 - ability to explicitly insert modules. 474 - 475 - If this sysctl is set to the empty string, then module autoloading is 476 - completely disabled. The kernel will not try to execute a usermode 477 - helper at all, nor will it call the kernel_module_request LSM hook. 478 - 479 - If CONFIG_STATIC_USERMODEHELPER=y is set in the kernel configuration, 480 - then the configured static usermode helper overrides this sysctl, 481 - except that the empty string is still accepted to completely disable 482 - module autoloading as described above. 483 448 484 449 nmi_watchdog 485 450 ============
+3 -3
Documentation/core-api/timekeeping.rst
··· 154 154 155 155 Use ktime_get() or ktime_get_ts64() instead. 156 156 157 - .. c:function:: struct timeval do_gettimeofday( void ) 158 - struct timespec getnstimeofday( void ) 159 - struct timespec64 getnstimeofday64( void ) 157 + .. c:function:: void do_gettimeofday( struct timeval * ) 158 + void getnstimeofday( struct timespec * ) 159 + void getnstimeofday64( struct timespec64 * ) 160 160 void ktime_get_real_ts( struct timespec * ) 161 161 162 162 ktime_get_real_ts64() is a direct replacement, but consider using
+6
Documentation/devicetree/bindings/arm/sunxi/allwinner,sun4i-a10-mbus.yaml
··· 42 42 description: 43 43 See section 2.3.9 of the DeviceTree Specification. 44 44 45 + '#address-cells': true 46 + 47 + '#size-cells': true 48 + 45 49 required: 46 50 - "#interconnect-cells" 47 51 - compatible ··· 63 59 compatible = "allwinner,sun5i-a13-mbus"; 64 60 reg = <0x01c01000 0x1000>; 65 61 clocks = <&ccu CLK_MBUS>; 62 + #address-cells = <1>; 63 + #size-cells = <1>; 66 64 dma-ranges = <0x00000000 0x40000000 0x20000000>; 67 65 #interconnect-cells = <1>; 68 66 };
+1 -1
Documentation/devicetree/bindings/clock/arm,syscon-icst.yaml
··· 91 91 92 92 examples: 93 93 - | 94 - vco1: clock@00 { 94 + vco1: clock { 95 95 compatible = "arm,impd1-vco1"; 96 96 #clock-cells = <0>; 97 97 lock-offset = <0x08>;
+2 -2
Documentation/devicetree/bindings/display/bridge/adi,adv7123.txt
··· 1 - Analog Device ADV7123 Video DAC 2 - ------------------------------- 1 + Analog Devices ADV7123 Video DAC 2 + -------------------------------- 3 3 4 4 The ADV7123 is a digital-to-analog converter that outputs VGA signals from a 5 5 parallel video input.
+2 -2
Documentation/devicetree/bindings/display/bridge/adi,adv7511.txt
··· 1 - Analog Device ADV7511(W)/13/33/35 HDMI Encoders 2 - ----------------------------------------- 1 + Analog Devices ADV7511(W)/13/33/35 HDMI Encoders 2 + ------------------------------------------------ 3 3 4 4 The ADV7511, ADV7511W, ADV7513, ADV7533 and ADV7535 are HDMI audio and video 5 5 transmitters compatible with HDMI 1.4 and DVI 1.0. They support color space
+1 -1
Documentation/devicetree/bindings/dma/adi,axi-dmac.txt
··· 1 - Analog Device AXI-DMAC DMA controller 1 + Analog Devices AXI-DMAC DMA controller 2 2 3 3 Required properties: 4 4 - compatible: Must be "adi,axi-dmac-1.00.a".
+2 -2
Documentation/devicetree/bindings/hwmon/adi,axi-fan-control.yaml
··· 2 2 # Copyright 2019 Analog Devices Inc. 3 3 %YAML 1.2 4 4 --- 5 - $id: http://devicetree.org/schemas/bindings/hwmon/adi,axi-fan-control.yaml# 5 + $id: http://devicetree.org/schemas/hwmon/adi,axi-fan-control.yaml# 6 6 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 7 8 8 title: Analog Devices AXI FAN Control Device Tree Bindings ··· 47 47 48 48 examples: 49 49 - | 50 - fpga_axi: fpga-axi@0 { 50 + fpga_axi: fpga-axi { 51 51 #address-cells = <0x2>; 52 52 #size-cells = <0x1>; 53 53
+1 -1
Documentation/devicetree/bindings/hwmon/adt7475.yaml
··· 1 1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 2 %YAML 1.2 3 3 --- 4 - $id: http://devicetree.org/schemas/adt7475.yaml# 4 + $id: http://devicetree.org/schemas/hwmon/adt7475.yaml# 5 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 6 6 7 7 title: ADT7475 hwmon sensor
+1 -1
Documentation/devicetree/bindings/iio/dac/ad5755.txt
··· 1 - * Analog Device AD5755 IIO Multi-Channel DAC Linux Driver 1 + * Analog Devices AD5755 IIO Multi-Channel DAC Linux Driver 2 2 3 3 Required properties: 4 4 - compatible: Has to contain one of the following:
+46 -51
Documentation/devicetree/bindings/iio/dac/adi,ad5770r.yaml
··· 2 2 # Copyright 2020 Analog Devices Inc. 3 3 %YAML 1.2 4 4 --- 5 - $id: http://devicetree.org/schemas/bindings/iio/dac/adi,ad5770r.yaml# 5 + $id: http://devicetree.org/schemas/iio/dac/adi,ad5770r.yaml# 6 6 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 7 8 8 title: Analog Devices AD5770R DAC device driver ··· 49 49 asserted during driver probe. 50 50 maxItems: 1 51 51 52 - channel0: 52 + channel@0: 53 53 description: Represents an external channel which are 54 54 connected to the DAC. Channel 0 can act both as a current 55 55 source and sink. 56 56 type: object 57 57 58 58 properties: 59 - num: 59 + reg: 60 60 description: This represents the channel number. 61 - items: 62 - const: 0 61 + const: 0 63 62 64 63 adi,range-microamp: 65 64 description: Output range of the channel. 66 65 oneOf: 67 - - $ref: /schemas/types.yaml#/definitions/int32-array 68 66 - items: 69 - - enum: [0 300000] 70 - - enum: [-60000 0] 71 - - enum: [-60000 300000] 67 + - const: 0 68 + - const: 300000 69 + - items: 70 + - const: -60000 71 + - const: 0 72 + - items: 73 + - const: -60000 74 + - const: 300000 72 75 73 - channel1: 76 + channel@1: 74 77 description: Represents an external channel which are 75 78 connected to the DAC. 76 79 type: object 77 80 78 81 properties: 79 - num: 82 + reg: 80 83 description: This represents the channel number. 81 - items: 82 - const: 1 84 + const: 1 83 85 84 86 adi,range-microamp: 85 87 description: Output range of the channel. 86 - oneOf: 87 - - $ref: /schemas/types.yaml#/definitions/uint32-array 88 - - items: 89 - - enum: [0 140000] 90 - - enum: [0 250000] 88 + items: 89 + - const: 0 90 + - enum: [ 140000, 250000 ] 91 91 92 - channel2: 92 + channel@2: 93 93 description: Represents an external channel which are 94 94 connected to the DAC. 95 95 type: object 96 96 97 97 properties: 98 - num: 98 + reg: 99 99 description: This represents the channel number. 100 - items: 101 - const: 2 100 + const: 2 102 101 103 102 adi,range-microamp: 104 103 description: Output range of the channel. 105 - oneOf: 106 - - $ref: /schemas/types.yaml#/definitions/uint32-array 107 - - items: 108 - - enum: [0 140000] 109 - - enum: [0 250000] 104 + items: 105 + - const: 0 106 + - enum: [ 55000, 150000 ] 110 107 111 108 patternProperties: 112 109 "^channel@([3-5])$": 113 110 type: object 114 111 description: Represents the external channels which are connected to the DAC. 115 112 properties: 116 - num: 113 + reg: 117 114 description: This represents the channel number. 118 - items: 119 - minimum: 3 120 - maximum: 5 115 + minimum: 3 116 + maximum: 5 121 117 122 118 adi,range-microamp: 123 119 description: Output range of the channel. 124 - oneOf: 125 - - $ref: /schemas/types.yaml#/definitions/uint32-array 126 - - items: 127 - - enum: [0 45000] 128 - - enum: [0 100000] 120 + items: 121 + - const: 0 122 + - enum: [ 45000, 100000 ] 129 123 130 124 required: 131 125 - reg 132 - - diff-channels 133 - - channel0 134 - - channel1 135 - - channel2 136 - - channel3 137 - - channel4 138 - - channel5 126 + - channel@0 127 + - channel@1 128 + - channel@2 129 + - channel@3 130 + - channel@4 131 + - channel@5 139 132 140 133 examples: 141 134 - | ··· 137 144 #size-cells = <0>; 138 145 139 146 ad5770r@0 { 140 - compatible = "ad5770r"; 147 + compatible = "adi,ad5770r"; 141 148 reg = <0>; 142 149 spi-max-frequency = <1000000>; 143 150 vref-supply = <&vref>; 144 151 adi,external-resistor; 145 152 reset-gpios = <&gpio 22 0>; 153 + #address-cells = <1>; 154 + #size-cells = <0>; 146 155 147 156 channel@0 { 148 - num = <0>; 149 - adi,range-microamp = <(-60000) 300000>; 157 + reg = <0>; 158 + adi,range-microamp = <0 300000>; 150 159 }; 151 160 152 161 channel@1 { 153 - num = <1>; 162 + reg = <1>; 154 163 adi,range-microamp = <0 140000>; 155 164 }; 156 165 157 166 channel@2 { 158 - num = <2>; 167 + reg = <2>; 159 168 adi,range-microamp = <0 55000>; 160 169 }; 161 170 162 171 channel@3 { 163 - num = <3>; 172 + reg = <3>; 164 173 adi,range-microamp = <0 45000>; 165 174 }; 166 175 167 176 channel@4 { 168 - num = <4>; 177 + reg = <4>; 169 178 adi,range-microamp = <0 45000>; 170 179 }; 171 180 172 181 channel@5 { 173 - num = <5>; 182 + reg = <5>; 174 183 adi,range-microamp = <0 45000>; 175 184 }; 176 185 };
+1 -1
Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.yaml
··· 109 109 - | 110 110 #include <dt-bindings/gpio/gpio.h> 111 111 #include <dt-bindings/interrupt-controller/arm-gic.h> 112 - i2c@00000000 { 112 + i2c { 113 113 #address-cells = <1>; 114 114 #size-cells = <0>; 115 115 edt-ft5x06@38 {
+2 -3
Documentation/devicetree/bindings/interrupt-controller/loongson,liointc.yaml
··· 56 56 cell with zero. 57 57 allOf: 58 58 - $ref: /schemas/types.yaml#/definitions/uint32-array 59 - - items: 60 - minItems: 4 61 - maxItems: 4 59 + - minItems: 4 60 + maxItems: 4 62 61 63 62 64 63 required:
+23 -18
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.yaml
··· 97 97 #include <dt-bindings/clock/tegra186-clock.h> 98 98 #include <dt-bindings/interrupt-controller/arm-gic.h> 99 99 100 - memory-controller@2c00000 { 101 - compatible = "nvidia,tegra186-mc"; 102 - reg = <0x0 0x02c00000 0x0 0xb0000>; 103 - interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>; 104 - 100 + bus { 105 101 #address-cells = <2>; 106 102 #size-cells = <2>; 107 103 108 - ranges = <0x0 0x02c00000 0x02c00000 0x0 0xb0000>; 104 + memory-controller@2c00000 { 105 + compatible = "nvidia,tegra186-mc"; 106 + reg = <0x0 0x02c00000 0x0 0xb0000>; 107 + interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>; 109 108 110 - /* 111 - * Memory clients have access to all 40 bits that the memory 112 - * controller can address. 113 - */ 114 - dma-ranges = <0x0 0x0 0x0 0x0 0x100 0x0>; 109 + #address-cells = <2>; 110 + #size-cells = <2>; 115 111 116 - external-memory-controller@2c60000 { 117 - compatible = "nvidia,tegra186-emc"; 118 - reg = <0x0 0x02c60000 0x0 0x50000>; 119 - interrupts = <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>; 120 - clocks = <&bpmp TEGRA186_CLK_EMC>; 121 - clock-names = "emc"; 112 + ranges = <0x0 0x02c00000 0x0 0x02c00000 0x0 0xb0000>; 122 113 123 - nvidia,bpmp = <&bpmp>; 114 + /* 115 + * Memory clients have access to all 40 bits that the memory 116 + * controller can address. 117 + */ 118 + dma-ranges = <0x0 0x0 0x0 0x0 0x100 0x0>; 119 + 120 + external-memory-controller@2c60000 { 121 + compatible = "nvidia,tegra186-emc"; 122 + reg = <0x0 0x02c60000 0x0 0x50000>; 123 + interrupts = <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>; 124 + clocks = <&bpmp TEGRA186_CLK_EMC>; 125 + clock-names = "emc"; 126 + 127 + nvidia,bpmp = <&bpmp>; 128 + }; 124 129 }; 125 130 }; 126 131
+3 -1
Documentation/devicetree/bindings/mfd/rohm,bd71837-pmic.yaml
··· 123 123 #include <dt-bindings/leds/common.h> 124 124 125 125 i2c { 126 - pmic: pmic@4b { 126 + #address-cells = <1>; 127 + #size-cells = <0>; 128 + pmic: pmic@4b { 127 129 compatible = "rohm,bd71837"; 128 130 reg = <0x4b>; 129 131 interrupt-parent = <&gpio1>;
+3 -1
Documentation/devicetree/bindings/mfd/rohm,bd71847-pmic.yaml
··· 128 128 #include <dt-bindings/leds/common.h> 129 129 130 130 i2c { 131 - pmic: pmic@4b { 131 + #address-cells = <1>; 132 + #size-cells = <0>; 133 + pmic: pmic@4b { 132 134 compatible = "rohm,bd71847"; 133 135 reg = <0x4b>; 134 136 interrupt-parent = <&gpio1>;
+1 -1
Documentation/devicetree/bindings/mfd/st,stpmic1.yaml
··· 274 274 - | 275 275 #include <dt-bindings/mfd/st,stpmic1.h> 276 276 #include <dt-bindings/interrupt-controller/arm-gic.h> 277 - i2c@0 { 277 + i2c { 278 278 #address-cells = <1>; 279 279 #size-cells = <0>; 280 280 pmic@33 {
+3
Documentation/devicetree/bindings/net/ethernet-phy.yaml
··· 45 45 bits of a vendor specific ID. 46 46 - items: 47 47 - pattern: "^ethernet-phy-id[a-f0-9]{4}\\.[a-f0-9]{4}$" 48 + - const: ethernet-phy-ieee802.3-c22 49 + - items: 50 + - pattern: "^ethernet-phy-id[a-f0-9]{4}\\.[a-f0-9]{4}$" 48 51 - const: ethernet-phy-ieee802.3-c45 49 52 50 53 reg:
+2
Documentation/devicetree/bindings/net/fsl-fec.txt
··· 22 22 - fsl,err006687-workaround-present: If present indicates that the system has 23 23 the hardware workaround for ERR006687 applied and does not need a software 24 24 workaround. 25 + - gpr: phandle of SoC general purpose register mode. Required for wake on LAN 26 + on some SoCs 25 27 -interrupt-names: names of the interrupts listed in interrupts property in 26 28 the same order. The defaults if not specified are 27 29 __Number of interrupts__ __Default__
+1
Documentation/devicetree/bindings/net/qcom,ipq8064-mdio.yaml
··· 48 48 49 49 switch@10 { 50 50 compatible = "qca,qca8337"; 51 + reg = <0x10>; 51 52 /* ... */ 52 53 }; 53 54 };
+1 -1
Documentation/devicetree/bindings/net/qualcomm-bluetooth.txt
··· 29 29 30 30 Optional properties for compatible string qcom,wcn399x-bt: 31 31 32 - - max-speed: see Documentation/devicetree/bindings/serial/slave-device.txt 32 + - max-speed: see Documentation/devicetree/bindings/serial/serial.yaml 33 33 - firmware-name: specify the name of nvm firmware to load 34 34 - clocks: clock provided to the controller 35 35
+1 -1
Documentation/devicetree/bindings/phy/ti,phy-j721e-wiz.yaml
··· 146 146 bindings specified in 147 147 Documentation/devicetree/bindings/phy/phy-cadence-sierra.txt 148 148 Torrent SERDES should follow the bindings specified in 149 - Documentation/devicetree/bindings/phy/phy-cadence-dp.txt 149 + Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml 150 150 151 151 required: 152 152 - compatible
+12 -5
Documentation/devicetree/bindings/pwm/google,cros-ec-pwm.yaml
··· 31 31 32 32 examples: 33 33 - | 34 - cros-ec@0 { 35 - compatible = "google,cros-ec-spi"; 36 - cros_ec_pwm: ec-pwm { 37 - compatible = "google,cros-ec-pwm"; 38 - #pwm-cells = <1>; 34 + spi { 35 + #address-cells = <1>; 36 + #size-cells = <0>; 37 + 38 + cros-ec@0 { 39 + compatible = "google,cros-ec-spi"; 40 + reg = <0>; 41 + 42 + cros_ec_pwm: ec-pwm { 43 + compatible = "google,cros-ec-pwm"; 44 + #pwm-cells = <1>; 45 + }; 39 46 }; 40 47 };
+1 -1
Documentation/devicetree/bindings/rng/brcm,bcm2835.yaml
··· 39 39 40 40 examples: 41 41 - | 42 - rng { 42 + rng@7e104000 { 43 43 compatible = "brcm,bcm2835-rng"; 44 44 reg = <0x7e104000 0x10>; 45 45 interrupts = <2 29>;
+1 -1
Documentation/devicetree/bindings/spi/qcom,spi-qcom-qspi.yaml
··· 61 61 #include <dt-bindings/clock/qcom,gcc-sdm845.h> 62 62 #include <dt-bindings/interrupt-controller/arm-gic.h> 63 63 64 - soc: soc@0 { 64 + soc: soc { 65 65 #address-cells = <2>; 66 66 #size-cells = <2>; 67 67
+1 -1
Documentation/devicetree/bindings/usb/ingenic,musb.yaml
··· 56 56 examples: 57 57 - | 58 58 #include <dt-bindings/clock/jz4740-cgu.h> 59 - usb_phy: usb-phy@0 { 59 + usb_phy: usb-phy { 60 60 compatible = "usb-nop-xceiv"; 61 61 #phy-cells = <0>; 62 62 };
+2 -2
Documentation/devicetree/bindings/usb/qcom,dwc3.txt
··· 52 52 the node is not important. The content of the node is defined in dwc3.txt. 53 53 54 54 Phy documentation is provided in the following places: 55 - Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt - USB3 QMP PHY 56 - Documentation/devicetree/bindings/phy/qcom-qusb2-phy.txt - USB2 QUSB2 PHY 55 + Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt - USB3 QMP PHY 56 + Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml - USB2 QUSB2 PHY 57 57 58 58 Example device nodes: 59 59
+1 -1
Documentation/devicetree/bindings/usb/rockchip,dwc3.txt
··· 16 16 the node is not important. The content of the node is defined in dwc3.txt. 17 17 18 18 Phy documentation is provided in the following places: 19 - Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt - USB2.0 PHY 19 + Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.yaml - USB2.0 PHY 20 20 Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt - Type-C PHY 21 21 22 22 Example device nodes:
+38 -38
Documentation/hwmon/isl68137.rst
··· 16 16 17 17 * Renesas ISL68220 18 18 19 - Prefix: 'raa_dmpvr2_2rail' 19 + Prefix: 'isl68220' 20 20 21 21 Addresses scanned: - 22 22 ··· 26 26 27 27 * Renesas ISL68221 28 28 29 - Prefix: 'raa_dmpvr2_3rail' 29 + Prefix: 'isl68221' 30 30 31 31 Addresses scanned: - 32 32 ··· 36 36 37 37 * Renesas ISL68222 38 38 39 - Prefix: 'raa_dmpvr2_2rail' 39 + Prefix: 'isl68222' 40 40 41 41 Addresses scanned: - 42 42 ··· 46 46 47 47 * Renesas ISL68223 48 48 49 - Prefix: 'raa_dmpvr2_2rail' 49 + Prefix: 'isl68223' 50 50 51 51 Addresses scanned: - 52 52 ··· 56 56 57 57 * Renesas ISL68224 58 58 59 - Prefix: 'raa_dmpvr2_3rail' 59 + Prefix: 'isl68224' 60 60 61 61 Addresses scanned: - 62 62 ··· 66 66 67 67 * Renesas ISL68225 68 68 69 - Prefix: 'raa_dmpvr2_2rail' 69 + Prefix: 'isl68225' 70 70 71 71 Addresses scanned: - 72 72 ··· 76 76 77 77 * Renesas ISL68226 78 78 79 - Prefix: 'raa_dmpvr2_3rail' 79 + Prefix: 'isl68226' 80 80 81 81 Addresses scanned: - 82 82 ··· 86 86 87 87 * Renesas ISL68227 88 88 89 - Prefix: 'raa_dmpvr2_1rail' 89 + Prefix: 'isl68227' 90 90 91 91 Addresses scanned: - 92 92 ··· 96 96 97 97 * Renesas ISL68229 98 98 99 - Prefix: 'raa_dmpvr2_3rail' 99 + Prefix: 'isl68229' 100 100 101 101 Addresses scanned: - 102 102 ··· 106 106 107 107 * Renesas ISL68233 108 108 109 - Prefix: 'raa_dmpvr2_2rail' 109 + Prefix: 'isl68233' 110 110 111 111 Addresses scanned: - 112 112 ··· 116 116 117 117 * Renesas ISL68239 118 118 119 - Prefix: 'raa_dmpvr2_3rail' 119 + Prefix: 'isl68239' 120 120 121 121 Addresses scanned: - 122 122 ··· 126 126 127 127 * Renesas ISL69222 128 128 129 - Prefix: 'raa_dmpvr2_2rail' 129 + Prefix: 'isl69222' 130 130 131 131 Addresses scanned: - 132 132 ··· 136 136 137 137 * Renesas ISL69223 138 138 139 - Prefix: 'raa_dmpvr2_3rail' 139 + Prefix: 'isl69223' 140 140 141 141 Addresses scanned: - 142 142 ··· 146 146 147 147 * Renesas ISL69224 148 148 149 - Prefix: 'raa_dmpvr2_2rail' 149 + Prefix: 'isl69224' 150 150 151 151 Addresses scanned: - 152 152 ··· 156 156 157 157 * Renesas ISL69225 158 158 159 - Prefix: 'raa_dmpvr2_2rail' 159 + Prefix: 'isl69225' 160 160 161 161 Addresses scanned: - 162 162 ··· 166 166 167 167 * Renesas ISL69227 168 168 169 - Prefix: 'raa_dmpvr2_3rail' 169 + Prefix: 'isl69227' 170 170 171 171 Addresses scanned: - 172 172 ··· 176 176 177 177 * Renesas ISL69228 178 178 179 - Prefix: 'raa_dmpvr2_3rail' 179 + Prefix: 'isl69228' 180 180 181 181 Addresses scanned: - 182 182 ··· 186 186 187 187 * Renesas ISL69234 188 188 189 - Prefix: 'raa_dmpvr2_2rail' 189 + Prefix: 'isl69234' 190 190 191 191 Addresses scanned: - 192 192 ··· 196 196 197 197 * Renesas ISL69236 198 198 199 - Prefix: 'raa_dmpvr2_2rail' 199 + Prefix: 'isl69236' 200 200 201 201 Addresses scanned: - 202 202 ··· 206 206 207 207 * Renesas ISL69239 208 208 209 - Prefix: 'raa_dmpvr2_3rail' 209 + Prefix: 'isl69239' 210 210 211 211 Addresses scanned: - 212 212 ··· 216 216 217 217 * Renesas ISL69242 218 218 219 - Prefix: 'raa_dmpvr2_2rail' 219 + Prefix: 'isl69242' 220 220 221 221 Addresses scanned: - 222 222 ··· 226 226 227 227 * Renesas ISL69243 228 228 229 - Prefix: 'raa_dmpvr2_1rail' 229 + Prefix: 'isl69243' 230 230 231 231 Addresses scanned: - 232 232 ··· 236 236 237 237 * Renesas ISL69247 238 238 239 - Prefix: 'raa_dmpvr2_2rail' 239 + Prefix: 'isl69247' 240 240 241 241 Addresses scanned: - 242 242 ··· 246 246 247 247 * Renesas ISL69248 248 248 249 - Prefix: 'raa_dmpvr2_2rail' 249 + Prefix: 'isl69248' 250 250 251 251 Addresses scanned: - 252 252 ··· 256 256 257 257 * Renesas ISL69254 258 258 259 - Prefix: 'raa_dmpvr2_2rail' 259 + Prefix: 'isl69254' 260 260 261 261 Addresses scanned: - 262 262 ··· 266 266 267 267 * Renesas ISL69255 268 268 269 - Prefix: 'raa_dmpvr2_2rail' 269 + Prefix: 'isl69255' 270 270 271 271 Addresses scanned: - 272 272 ··· 276 276 277 277 * Renesas ISL69256 278 278 279 - Prefix: 'raa_dmpvr2_2rail' 279 + Prefix: 'isl69256' 280 280 281 281 Addresses scanned: - 282 282 ··· 286 286 287 287 * Renesas ISL69259 288 288 289 - Prefix: 'raa_dmpvr2_2rail' 289 + Prefix: 'isl69259' 290 290 291 291 Addresses scanned: - 292 292 ··· 296 296 297 297 * Renesas ISL69260 298 298 299 - Prefix: 'raa_dmpvr2_2rail' 299 + Prefix: 'isl69260' 300 300 301 301 Addresses scanned: - 302 302 ··· 306 306 307 307 * Renesas ISL69268 308 308 309 - Prefix: 'raa_dmpvr2_2rail' 309 + Prefix: 'isl69268' 310 310 311 311 Addresses scanned: - 312 312 ··· 316 316 317 317 * Renesas ISL69269 318 318 319 - Prefix: 'raa_dmpvr2_3rail' 319 + Prefix: 'isl69269' 320 320 321 321 Addresses scanned: - 322 322 ··· 326 326 327 327 * Renesas ISL69298 328 328 329 - Prefix: 'raa_dmpvr2_2rail' 329 + Prefix: 'isl69298' 330 330 331 331 Addresses scanned: - 332 332 ··· 336 336 337 337 * Renesas RAA228000 338 338 339 - Prefix: 'raa_dmpvr2_hv' 339 + Prefix: 'raa228000' 340 340 341 341 Addresses scanned: - 342 342 ··· 346 346 347 347 * Renesas RAA228004 348 348 349 - Prefix: 'raa_dmpvr2_hv' 349 + Prefix: 'raa228004' 350 350 351 351 Addresses scanned: - 352 352 ··· 356 356 357 357 * Renesas RAA228006 358 358 359 - Prefix: 'raa_dmpvr2_hv' 359 + Prefix: 'raa228006' 360 360 361 361 Addresses scanned: - 362 362 ··· 366 366 367 367 * Renesas RAA228228 368 368 369 - Prefix: 'raa_dmpvr2_2rail' 369 + Prefix: 'raa228228' 370 370 371 371 Addresses scanned: - 372 372 ··· 376 376 377 377 * Renesas RAA229001 378 378 379 - Prefix: 'raa_dmpvr2_2rail' 379 + Prefix: 'raa229001' 380 380 381 381 Addresses scanned: - 382 382 ··· 386 386 387 387 * Renesas RAA229004 388 388 389 - Prefix: 'raa_dmpvr2_2rail' 389 + Prefix: 'raa229004' 390 390 391 391 Addresses scanned: - 392 392
+1
Documentation/networking/index.rst
··· 22 22 z8530book 23 23 msg_zerocopy 24 24 failover 25 + net_dim 25 26 net_failover 26 27 phy 27 28 sfp-phylink
+1 -1
Documentation/networking/ip-sysctl.txt
··· 812 812 tcp_challenge_ack_limit - INTEGER 813 813 Limits number of Challenge ACK sent per second, as recommended 814 814 in RFC 5961 (Improving TCP's Robustness to Blind In-Window Attacks) 815 - Default: 100 815 + Default: 1000 816 816 817 817 tcp_rx_skb_cache - BOOLEAN 818 818 Controls a per TCP socket cache of one skb, that might help
+49 -47
Documentation/networking/net_dim.txt Documentation/networking/net_dim.rst
··· 1 + ====================================================== 1 2 Net DIM - Generic Network Dynamic Interrupt Moderation 2 3 ====================================================== 3 4 4 - Author: 5 - Tal Gilboa <talgi@mellanox.com> 5 + :Author: Tal Gilboa <talgi@mellanox.com> 6 6 7 + .. contents:: :depth: 2 7 8 8 - Contents 9 - ========= 10 - 11 - - Assumptions 12 - - Introduction 13 - - The Net DIM Algorithm 14 - - Registering a Network Device to DIM 15 - - Example 16 - 17 - Part 0: Assumptions 18 - ====================== 9 + Assumptions 10 + =========== 19 11 20 12 This document assumes the reader has basic knowledge in network drivers 21 13 and in general interrupt moderation. 22 14 23 15 24 - Part I: Introduction 25 - ====================== 16 + Introduction 17 + ============ 26 18 27 19 Dynamic Interrupt Moderation (DIM) (in networking) refers to changing the 28 20 interrupt moderation configuration of a channel in order to optimize packet ··· 33 41 increase bandwidth over reducing interrupt rate. 34 42 35 43 36 - Part II: The Net DIM Algorithm 37 - =============================== 44 + Net DIM Algorithm 45 + ================= 38 46 39 47 Each iteration of the Net DIM algorithm follows these steps: 40 - 1. Calculates new data sample. 41 - 2. Compares it to previous sample. 42 - 3. Makes a decision - suggests interrupt moderation configuration fields. 43 - 4. Applies a schedule work function, which applies suggested configuration. 48 + 49 + #. Calculates new data sample. 50 + #. Compares it to previous sample. 51 + #. Makes a decision - suggests interrupt moderation configuration fields. 52 + #. Applies a schedule work function, which applies suggested configuration. 44 53 45 54 The first two steps are straightforward, both the new and the previous data are 46 55 supplied by the driver registered to Net DIM. The previous data is the new data ··· 82 89 under some conditions. 83 90 84 91 85 - Part III: Registering a Network Device to DIM 86 - ============================================== 92 + Registering a Network Device to DIM 93 + =================================== 87 94 88 - Net DIM API exposes the main function net_dim(struct dim *dim, 89 - struct dim_sample end_sample). This function is the entry point to the Net 95 + Net DIM API exposes the main function net_dim(). 96 + This function is the entry point to the Net 90 97 DIM algorithm and has to be called every time the driver would like to check if 91 98 it should change interrupt moderation parameters. The driver should provide two 92 - data structures: struct dim and struct dim_sample. Struct dim 99 + data structures: :c:type:`struct dim <dim>` and 100 + :c:type:`struct dim_sample <dim_sample>`. :c:type:`struct dim <dim>` 93 101 describes the state of DIM for a specific object (RX queue, TX queue, 94 102 other queues, etc.). This includes the current selected profile, previous data 95 103 samples, the callback function provided by the driver and more. 96 - Struct dim_sample describes a data sample, which will be compared to the 97 - data sample stored in struct dim in order to decide on the algorithm's next 104 + :c:type:`struct dim_sample <dim_sample>` describes a data sample, 105 + which will be compared to the data sample stored in :c:type:`struct dim <dim>` 106 + in order to decide on the algorithm's next 98 107 step. The sample should include bytes, packets and interrupts, measured by 99 108 the driver. 100 109 ··· 105 110 interrupt. Since Net DIM has a built-in moderation and it might decide to skip 106 111 iterations under certain conditions, there is no need to moderate the net_dim() 107 112 calls as well. As mentioned above, the driver needs to provide an object of type 108 - struct dim to the net_dim() function call. It is advised for each entity 109 - using Net DIM to hold a struct dim as part of its data structure and use it 110 - as the main Net DIM API object. The struct dim_sample should hold the latest 113 + :c:type:`struct dim <dim>` to the net_dim() function call. It is advised for 114 + each entity using Net DIM to hold a :c:type:`struct dim <dim>` as part of its 115 + data structure and use it as the main Net DIM API object. 116 + The :c:type:`struct dim_sample <dim_sample>` should hold the latest 111 117 bytes, packets and interrupts count. No need to perform any calculations, just 112 118 include the raw data. 113 119 ··· 120 124 the proper state in order to move to the next iteration. 121 125 122 126 123 - Part IV: Example 124 - ================= 127 + Example 128 + ======= 125 129 126 130 The following code demonstrates how to register a driver to Net DIM. The actual 127 131 usage is not complete but it should make the outline of the usage clear. 128 132 129 - my_driver.c: 133 + .. code-block:: c 130 134 131 - #include <linux/dim.h> 135 + #include <linux/dim.h> 132 136 133 - /* Callback for net DIM to schedule on a decision to change moderation */ 134 - void my_driver_do_dim_work(struct work_struct *work) 135 - { 137 + /* Callback for net DIM to schedule on a decision to change moderation */ 138 + void my_driver_do_dim_work(struct work_struct *work) 139 + { 136 140 /* Get struct dim from struct work_struct */ 137 141 struct dim *dim = container_of(work, struct dim, 138 142 work); ··· 141 145 142 146 /* Signal net DIM work is done and it should move to next iteration */ 143 147 dim->state = DIM_START_MEASURE; 144 - } 148 + } 145 149 146 - /* My driver's interrupt handler */ 147 - int my_driver_handle_interrupt(struct my_driver_entity *my_entity, ...) 148 - { 150 + /* My driver's interrupt handler */ 151 + int my_driver_handle_interrupt(struct my_driver_entity *my_entity, ...) 152 + { 149 153 ... 150 154 /* A struct to hold current measured data */ 151 155 struct dim_sample dim_sample; ··· 158 162 /* Call net DIM */ 159 163 net_dim(&my_entity->dim, dim_sample); 160 164 ... 161 - } 165 + } 162 166 163 - /* My entity's initialization function (my_entity was already allocated) */ 164 - int my_driver_init_my_entity(struct my_driver_entity *my_entity, ...) 165 - { 167 + /* My entity's initialization function (my_entity was already allocated) */ 168 + int my_driver_init_my_entity(struct my_driver_entity *my_entity, ...) 169 + { 166 170 ... 167 171 /* Initiate struct work_struct with my driver's callback function */ 168 172 INIT_WORK(&my_entity->dim.work, my_driver_do_dim_work); 169 173 ... 170 - } 174 + } 175 + 176 + Dynamic Interrupt Moderation (DIM) library API 177 + ============================================== 178 + 179 + .. kernel-doc:: include/linux/dim.h 180 + :internal:
+18 -3
Documentation/x86/boot.rst
··· 1399 1399 must be __BOOT_DS; interrupt must be disabled; %rsi must hold the base 1400 1400 address of the struct boot_params. 1401 1401 1402 - EFI Handover Protocol 1403 - ===================== 1402 + EFI Handover Protocol (deprecated) 1403 + ================================== 1404 1404 1405 1405 This protocol allows boot loaders to defer initialisation to the EFI 1406 1406 boot stub. The boot loader is required to load the kernel/initrd(s) 1407 1407 from the boot media and jump to the EFI handover protocol entry point 1408 1408 which is hdr->handover_offset bytes from the beginning of 1409 1409 startup_{32,64}. 1410 + 1411 + The boot loader MUST respect the kernel's PE/COFF metadata when it comes 1412 + to section alignment, the memory footprint of the executable image beyond 1413 + the size of the file itself, and any other aspect of the PE/COFF header 1414 + that may affect correct operation of the image as a PE/COFF binary in the 1415 + execution context provided by the EFI firmware. 1410 1416 1411 1417 The function prototype for the handover entry point looks like this:: 1412 1418 ··· 1425 1419 1426 1420 The boot loader *must* fill out the following fields in bp:: 1427 1421 1428 - - hdr.code32_start 1429 1422 - hdr.cmd_line_ptr 1430 1423 - hdr.ramdisk_image (if applicable) 1431 1424 - hdr.ramdisk_size (if applicable) 1432 1425 1433 1426 All other fields should be zero. 1427 + 1428 + NOTE: The EFI Handover Protocol is deprecated in favour of the ordinary PE/COFF 1429 + entry point, combined with the LINUX_EFI_INITRD_MEDIA_GUID based initrd 1430 + loading protocol (refer to [0] for an example of the bootloader side of 1431 + this), which removes the need for any knowledge on the part of the EFI 1432 + bootloader regarding the internal representation of boot_params or any 1433 + requirements/limitations regarding the placement of the command line 1434 + and ramdisk in memory, or the placement of the kernel image itself. 1435 + 1436 + [0] https://github.com/u-boot/u-boot/commit/ec80b4735a593961fe701cc3a5d717d4739b0fd0
+8 -3
MAINTAINERS
··· 1323 1323 M: Linus Walleij <linus.walleij@linaro.org> 1324 1324 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 1325 1325 S: Maintained 1326 - F: Documentation/devicetree/bindings/arm/arm-boards 1326 + F: Documentation/devicetree/bindings/arm/arm,integrator.yaml 1327 + F: Documentation/devicetree/bindings/arm/arm,realview.yaml 1328 + F: Documentation/devicetree/bindings/arm/arm,versatile.yaml 1329 + F: Documentation/devicetree/bindings/arm/arm,vexpress-juno.yaml 1327 1330 F: Documentation/devicetree/bindings/auxdisplay/arm-charlcd.txt 1328 1331 F: Documentation/devicetree/bindings/clock/arm,syscon-icst.yaml 1329 1332 F: Documentation/devicetree/bindings/i2c/i2c-versatile.txt ··· 5555 5552 L: dri-devel@lists.freedesktop.org 5556 5553 S: Supported 5557 5554 T: git git://anongit.freedesktop.org/drm/drm-misc 5558 - F: Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt 5555 + F: Documentation/devicetree/bindings/display/allwinner* 5559 5556 F: drivers/gpu/drm/sun4i/ 5560 5557 5561 5558 DRM DRIVERS FOR AMLOGIC SOCS ··· 5937 5934 S: Maintained 5938 5935 F: include/linux/dim.h 5939 5936 F: lib/dim/ 5937 + F: Documentation/networking/net_dim.rst 5940 5938 5941 5939 DZ DECSTATION DZ11 SERIAL DRIVER 5942 5940 M: "Maciej W. Rozycki" <macro@linux-mips.org> ··· 13857 13853 F: drivers/scsi/qla1280.[ch] 13858 13854 13859 13855 QLOGIC QLA2XXX FC-SCSI DRIVER 13860 - M: hmadhani@marvell.com 13856 + M: Nilesh Javali <njavali@marvell.com> 13857 + M: GR-QLogic-Storage-Upstream@marvell.com 13861 13858 L: linux-scsi@vger.kernel.org 13862 13859 S: Supported 13863 13860 F: Documentation/scsi/LICENSE.qla2xxx
+1 -1
Makefile
··· 2 2 VERSION = 5 3 3 PATCHLEVEL = 7 4 4 SUBLEVEL = 0 5 - EXTRAVERSION = -rc1 5 + EXTRAVERSION = -rc2 6 6 NAME = Kleptomaniac Octopus 7 7 8 8 # *DOCUMENTATION*
+2 -1
arch/arm/boot/compressed/head.S
··· 1450 1450 @ running beyond the PoU, and so calling cache_off below from 1451 1451 @ inside the PE/COFF loader allocated region is unsafe unless 1452 1452 @ we explicitly clean it to the PoC. 1453 - adr r0, call_cache_fn @ region of code we will 1453 + ARM( adrl r0, call_cache_fn ) 1454 + THUMB( adr r0, call_cache_fn ) @ region of code we will 1454 1455 adr r1, 0f @ run with MMU off 1455 1456 bl cache_clean_flush 1456 1457 bl cache_off
+3 -3
arch/arm/boot/dts/imx6qdl.dtsi
··· 1039 1039 compatible = "fsl,imx6q-fec"; 1040 1040 reg = <0x02188000 0x4000>; 1041 1041 interrupt-names = "int0", "pps"; 1042 - interrupts-extended = 1043 - <&intc 0 118 IRQ_TYPE_LEVEL_HIGH>, 1044 - <&intc 0 119 IRQ_TYPE_LEVEL_HIGH>; 1042 + interrupts = <0 118 IRQ_TYPE_LEVEL_HIGH>, 1043 + <0 119 IRQ_TYPE_LEVEL_HIGH>; 1045 1044 clocks = <&clks IMX6QDL_CLK_ENET>, 1046 1045 <&clks IMX6QDL_CLK_ENET>, 1047 1046 <&clks IMX6QDL_CLK_ENET_REF>; 1048 1047 clock-names = "ipg", "ahb", "ptp"; 1048 + gpr = <&gpr>; 1049 1049 status = "disabled"; 1050 1050 }; 1051 1051
-1
arch/arm/boot/dts/imx6qp.dtsi
··· 77 77 }; 78 78 79 79 &fec { 80 - /delete-property/interrupts-extended; 81 80 interrupts = <0 118 IRQ_TYPE_LEVEL_HIGH>, 82 81 <0 119 IRQ_TYPE_LEVEL_HIGH>; 83 82 };
+34 -18
arch/arm/net/bpf_jit_32.c
··· 929 929 rd = arm_bpf_get_reg64(dst, tmp, ctx); 930 930 931 931 /* Do LSR operation */ 932 - if (val < 32) { 932 + if (val == 0) { 933 + /* An immediate value of 0 encodes a shift amount of 32 934 + * for LSR. To shift by 0, don't do anything. 935 + */ 936 + } else if (val < 32) { 933 937 emit(ARM_MOV_SI(tmp2[1], rd[1], SRTYPE_LSR, val), ctx); 934 938 emit(ARM_ORR_SI(rd[1], tmp2[1], rd[0], SRTYPE_ASL, 32 - val), ctx); 935 939 emit(ARM_MOV_SI(rd[0], rd[0], SRTYPE_LSR, val), ctx); ··· 959 955 rd = arm_bpf_get_reg64(dst, tmp, ctx); 960 956 961 957 /* Do ARSH operation */ 962 - if (val < 32) { 958 + if (val == 0) { 959 + /* An immediate value of 0 encodes a shift amount of 32 960 + * for ASR. To shift by 0, don't do anything. 961 + */ 962 + } else if (val < 32) { 963 963 emit(ARM_MOV_SI(tmp2[1], rd[1], SRTYPE_LSR, val), ctx); 964 964 emit(ARM_ORR_SI(rd[1], tmp2[1], rd[0], SRTYPE_ASL, 32 - val), ctx); 965 965 emit(ARM_MOV_SI(rd[0], rd[0], SRTYPE_ASR, val), ctx); ··· 1000 992 arm_bpf_put_reg32(dst_hi, rd[0], ctx); 1001 993 } 1002 994 995 + static bool is_ldst_imm(s16 off, const u8 size) 996 + { 997 + s16 off_max = 0; 998 + 999 + switch (size) { 1000 + case BPF_B: 1001 + case BPF_W: 1002 + off_max = 0xfff; 1003 + break; 1004 + case BPF_H: 1005 + off_max = 0xff; 1006 + break; 1007 + case BPF_DW: 1008 + /* Need to make sure off+4 does not overflow. */ 1009 + off_max = 0xfff - 4; 1010 + break; 1011 + } 1012 + return -off_max <= off && off <= off_max; 1013 + } 1014 + 1003 1015 /* *(size *)(dst + off) = src */ 1004 1016 static inline void emit_str_r(const s8 dst, const s8 src[], 1005 - s32 off, struct jit_ctx *ctx, const u8 sz){ 1017 + s16 off, struct jit_ctx *ctx, const u8 sz){ 1006 1018 const s8 *tmp = bpf2a32[TMP_REG_1]; 1007 - s32 off_max; 1008 1019 s8 rd; 1009 1020 1010 1021 rd = arm_bpf_get_reg32(dst, tmp[1], ctx); 1011 1022 1012 - if (sz == BPF_H) 1013 - off_max = 0xff; 1014 - else 1015 - off_max = 0xfff; 1016 - 1017 - if (off < 0 || off > off_max) { 1023 + if (!is_ldst_imm(off, sz)) { 1018 1024 emit_a32_mov_i(tmp[0], off, ctx); 1019 1025 emit(ARM_ADD_R(tmp[0], tmp[0], rd), ctx); 1020 1026 rd = tmp[0]; ··· 1057 1035 1058 1036 /* dst = *(size*)(src + off) */ 1059 1037 static inline void emit_ldx_r(const s8 dst[], const s8 src, 1060 - s32 off, struct jit_ctx *ctx, const u8 sz){ 1038 + s16 off, struct jit_ctx *ctx, const u8 sz){ 1061 1039 const s8 *tmp = bpf2a32[TMP_REG_1]; 1062 1040 const s8 *rd = is_stacked(dst_lo) ? tmp : dst; 1063 1041 s8 rm = src; 1064 - s32 off_max; 1065 1042 1066 - if (sz == BPF_H) 1067 - off_max = 0xff; 1068 - else 1069 - off_max = 0xfff; 1070 - 1071 - if (off < 0 || off > off_max) { 1043 + if (!is_ldst_imm(off, sz)) { 1072 1044 emit_a32_mov_i(tmp[0], off, ctx); 1073 1045 emit(ARM_ADD_R(tmp[0], tmp[0], src), ctx); 1074 1046 rm = tmp[0];
+1 -1
arch/arm/xen/enlighten.c
··· 36 36 37 37 #include <linux/mm.h> 38 38 39 - struct start_info _xen_start_info; 39 + static struct start_info _xen_start_info; 40 40 struct start_info *xen_start_info = &_xen_start_info; 41 41 EXPORT_SYMBOL(xen_start_info); 42 42
+3 -1
arch/arm64/include/asm/sysreg.h
··· 49 49 #ifndef CONFIG_BROKEN_GAS_INST 50 50 51 51 #ifdef __ASSEMBLY__ 52 - #define __emit_inst(x) .inst (x) 52 + // The space separator is omitted so that __emit_inst(x) can be parsed as 53 + // either an assembler directive or an assembler macro argument. 54 + #define __emit_inst(x) .inst(x) 53 55 #else 54 56 #define __emit_inst(x) ".inst " __stringify((x)) "\n\t" 55 57 #endif
+1 -12
arch/arm64/kernel/vdso.c
··· 260 260 if (ret) 261 261 return ret; 262 262 263 - ret = aarch32_alloc_kuser_vdso_page(); 264 - if (ret) { 265 - unsigned long c_vvar = 266 - (unsigned long)page_to_virt(aarch32_vdso_pages[C_VVAR]); 267 - unsigned long c_vdso = 268 - (unsigned long)page_to_virt(aarch32_vdso_pages[C_VDSO]); 269 - 270 - free_page(c_vvar); 271 - free_page(c_vdso); 272 - } 273 - 274 - return ret; 263 + return aarch32_alloc_kuser_vdso_page(); 275 264 } 276 265 #else 277 266 static int __aarch32_alloc_vdso_pages(void)
-1
arch/m68k/include/asm/Kbuild
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 generated-y += syscall_table.h 3 3 generic-y += extable.h 4 - generic-y += hardirq.h 5 4 generic-y += kvm_para.h 6 5 generic-y += local64.h 7 6 generic-y += mcs_spinlock.h
+1 -1
arch/riscv/Kconfig
··· 55 55 select ARCH_HAS_PTE_SPECIAL 56 56 select ARCH_HAS_MMIOWB 57 57 select ARCH_HAS_DEBUG_VIRTUAL 58 - select HAVE_EBPF_JIT 58 + select HAVE_EBPF_JIT if MMU 59 59 select EDAC_SUPPORT 60 60 select ARCH_HAS_GIGANTIC_PAGE 61 61 select ARCH_HAS_SET_DIRECT_MAP
+32 -17
arch/riscv/net/bpf_jit_comp64.c
··· 110 110 return -(1L << 31) <= val && val < (1L << 31); 111 111 } 112 112 113 + static bool in_auipc_jalr_range(s64 val) 114 + { 115 + /* 116 + * auipc+jalr can reach any signed PC-relative offset in the range 117 + * [-2^31 - 2^11, 2^31 - 2^11). 118 + */ 119 + return (-(1L << 31) - (1L << 11)) <= val && 120 + val < ((1L << 31) - (1L << 11)); 121 + } 122 + 113 123 static void emit_imm(u8 rd, s64 val, struct rv_jit_context *ctx) 114 124 { 115 125 /* Note that the immediate from the add is sign-extended, ··· 390 380 *rd = RV_REG_T2; 391 381 } 392 382 393 - static void emit_jump_and_link(u8 rd, s64 rvoff, bool force_jalr, 394 - struct rv_jit_context *ctx) 383 + static int emit_jump_and_link(u8 rd, s64 rvoff, bool force_jalr, 384 + struct rv_jit_context *ctx) 395 385 { 396 386 s64 upper, lower; 397 387 398 388 if (rvoff && is_21b_int(rvoff) && !force_jalr) { 399 389 emit(rv_jal(rd, rvoff >> 1), ctx); 400 - return; 390 + return 0; 391 + } else if (in_auipc_jalr_range(rvoff)) { 392 + upper = (rvoff + (1 << 11)) >> 12; 393 + lower = rvoff & 0xfff; 394 + emit(rv_auipc(RV_REG_T1, upper), ctx); 395 + emit(rv_jalr(rd, RV_REG_T1, lower), ctx); 396 + return 0; 401 397 } 402 398 403 - upper = (rvoff + (1 << 11)) >> 12; 404 - lower = rvoff & 0xfff; 405 - emit(rv_auipc(RV_REG_T1, upper), ctx); 406 - emit(rv_jalr(rd, RV_REG_T1, lower), ctx); 399 + pr_err("bpf-jit: target offset 0x%llx is out of range\n", rvoff); 400 + return -ERANGE; 407 401 } 408 402 409 403 static bool is_signed_bpf_cond(u8 cond) ··· 421 407 s64 off = 0; 422 408 u64 ip; 423 409 u8 rd; 410 + int ret; 424 411 425 412 if (addr && ctx->insns) { 426 413 ip = (u64)(long)(ctx->insns + ctx->ninsns); 427 414 off = addr - ip; 428 - if (!is_32b_int(off)) { 429 - pr_err("bpf-jit: target call addr %pK is out of range\n", 430 - (void *)addr); 431 - return -ERANGE; 432 - } 433 415 } 434 416 435 - emit_jump_and_link(RV_REG_RA, off, !fixed, ctx); 417 + ret = emit_jump_and_link(RV_REG_RA, off, !fixed, ctx); 418 + if (ret) 419 + return ret; 436 420 rd = bpf_to_rv_reg(BPF_REG_0, ctx); 437 421 emit(rv_addi(rd, RV_REG_A0, 0), ctx); 438 422 return 0; ··· 441 429 { 442 430 bool is64 = BPF_CLASS(insn->code) == BPF_ALU64 || 443 431 BPF_CLASS(insn->code) == BPF_JMP; 444 - int s, e, rvoff, i = insn - ctx->prog->insnsi; 432 + int s, e, rvoff, ret, i = insn - ctx->prog->insnsi; 445 433 struct bpf_prog_aux *aux = ctx->prog->aux; 446 434 u8 rd = -1, rs = -1, code = insn->code; 447 435 s16 off = insn->off; ··· 711 699 /* JUMP off */ 712 700 case BPF_JMP | BPF_JA: 713 701 rvoff = rv_offset(i, off, ctx); 714 - emit_jump_and_link(RV_REG_ZERO, rvoff, false, ctx); 702 + ret = emit_jump_and_link(RV_REG_ZERO, rvoff, false, ctx); 703 + if (ret) 704 + return ret; 715 705 break; 716 706 717 707 /* IF (dst COND src) JUMP off */ ··· 815 801 case BPF_JMP | BPF_CALL: 816 802 { 817 803 bool fixed; 818 - int ret; 819 804 u64 addr; 820 805 821 806 mark_call(ctx); ··· 839 826 break; 840 827 841 828 rvoff = epilogue_offset(ctx); 842 - emit_jump_and_link(RV_REG_ZERO, rvoff, false, ctx); 829 + ret = emit_jump_and_link(RV_REG_ZERO, rvoff, false, ctx); 830 + if (ret) 831 + return ret; 843 832 break; 844 833 845 834 /* dst = imm64 */
+5 -1
arch/x86/hyperv/hv_init.c
··· 20 20 #include <linux/mm.h> 21 21 #include <linux/hyperv.h> 22 22 #include <linux/slab.h> 23 + #include <linux/kernel.h> 23 24 #include <linux/cpuhotplug.h> 24 25 #include <linux/syscore_ops.h> 25 26 #include <clocksource/hyperv_timer.h> ··· 420 419 } 421 420 EXPORT_SYMBOL_GPL(hyperv_cleanup); 422 421 423 - void hyperv_report_panic(struct pt_regs *regs, long err) 422 + void hyperv_report_panic(struct pt_regs *regs, long err, bool in_die) 424 423 { 425 424 static bool panic_reported; 426 425 u64 guest_id; 426 + 427 + if (in_die && !panic_on_oops) 428 + return; 427 429 428 430 /* 429 431 * We prefer to report panic on 'die' chain as we have proper
+2
arch/x86/include/asm/efi.h
··· 178 178 extern pgd_t * __init efi_uv1_memmap_phys_prolog(void); 179 179 extern void __init efi_uv1_memmap_phys_epilog(pgd_t *save_pgd); 180 180 181 + /* kexec external ABI */ 181 182 struct efi_setup_data { 182 183 u64 fw_vendor; 184 + u64 __unused; 183 185 u64 tables; 184 186 u64 smbios; 185 187 u64 reserved[8];
+1 -1
arch/x86/include/asm/microcode_amd.h
··· 41 41 unsigned int mpb[0]; 42 42 }; 43 43 44 - #define PATCH_MAX_SIZE PAGE_SIZE 44 + #define PATCH_MAX_SIZE (3 * PAGE_SIZE) 45 45 46 46 #ifdef CONFIG_MICROCODE_AMD 47 47 extern void __init load_ucode_amd_bsp(unsigned int family);
+36 -18
arch/x86/kernel/cpu/intel.c
··· 1119 1119 sld_update_msr(!(tifn & _TIF_SLD)); 1120 1120 } 1121 1121 1122 - #define SPLIT_LOCK_CPU(model) {X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY} 1123 - 1124 1122 /* 1125 - * The following processors have the split lock detection feature. But 1126 - * since they don't have the IA32_CORE_CAPABILITIES MSR, the feature cannot 1127 - * be enumerated. Enable it by family and model matching on these 1128 - * processors. 1123 + * Bits in the IA32_CORE_CAPABILITIES are not architectural, so they should 1124 + * only be trusted if it is confirmed that a CPU model implements a 1125 + * specific feature at a particular bit position. 1126 + * 1127 + * The possible driver data field values: 1128 + * 1129 + * - 0: CPU models that are known to have the per-core split-lock detection 1130 + * feature even though they do not enumerate IA32_CORE_CAPABILITIES. 1131 + * 1132 + * - 1: CPU models which may enumerate IA32_CORE_CAPABILITIES and if so use 1133 + * bit 5 to enumerate the per-core split-lock detection feature. 1129 1134 */ 1130 1135 static const struct x86_cpu_id split_lock_cpu_ids[] __initconst = { 1131 - SPLIT_LOCK_CPU(INTEL_FAM6_ICELAKE_X), 1132 - SPLIT_LOCK_CPU(INTEL_FAM6_ICELAKE_L), 1136 + X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_X, 0), 1137 + X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_L, 0), 1138 + X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT, 1), 1139 + X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT_D, 1), 1140 + X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT_L, 1), 1133 1141 {} 1134 1142 }; 1135 1143 1136 1144 void __init cpu_set_core_cap_bits(struct cpuinfo_x86 *c) 1137 1145 { 1138 - u64 ia32_core_caps = 0; 1146 + const struct x86_cpu_id *m; 1147 + u64 ia32_core_caps; 1139 1148 1140 - if (c->x86_vendor != X86_VENDOR_INTEL) 1149 + if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) 1141 1150 return; 1142 - if (cpu_has(c, X86_FEATURE_CORE_CAPABILITIES)) { 1143 - /* Enumerate features reported in IA32_CORE_CAPABILITIES MSR. */ 1151 + 1152 + m = x86_match_cpu(split_lock_cpu_ids); 1153 + if (!m) 1154 + return; 1155 + 1156 + switch (m->driver_data) { 1157 + case 0: 1158 + break; 1159 + case 1: 1160 + if (!cpu_has(c, X86_FEATURE_CORE_CAPABILITIES)) 1161 + return; 1144 1162 rdmsrl(MSR_IA32_CORE_CAPS, ia32_core_caps); 1145 - } else if (!boot_cpu_has(X86_FEATURE_HYPERVISOR)) { 1146 - /* Enumerate split lock detection by family and model. */ 1147 - if (x86_match_cpu(split_lock_cpu_ids)) 1148 - ia32_core_caps |= MSR_IA32_CORE_CAPS_SPLIT_LOCK_DETECT; 1163 + if (!(ia32_core_caps & MSR_IA32_CORE_CAPS_SPLIT_LOCK_DETECT)) 1164 + return; 1165 + break; 1166 + default: 1167 + return; 1149 1168 } 1150 1169 1151 - if (ia32_core_caps & MSR_IA32_CORE_CAPS_SPLIT_LOCK_DETECT) 1152 - split_lock_setup(); 1170 + split_lock_setup(); 1153 1171 }
+12 -2
arch/x86/kernel/cpu/mshyperv.c
··· 227 227 ms_hyperv.misc_features = cpuid_edx(HYPERV_CPUID_FEATURES); 228 228 ms_hyperv.hints = cpuid_eax(HYPERV_CPUID_ENLIGHTMENT_INFO); 229 229 230 - pr_info("Hyper-V: features 0x%x, hints 0x%x\n", 231 - ms_hyperv.features, ms_hyperv.hints); 230 + pr_info("Hyper-V: features 0x%x, hints 0x%x, misc 0x%x\n", 231 + ms_hyperv.features, ms_hyperv.hints, ms_hyperv.misc_features); 232 232 233 233 ms_hyperv.max_vp_index = cpuid_eax(HYPERV_CPUID_IMPLEMENT_LIMITS); 234 234 ms_hyperv.max_lp_index = cpuid_ebx(HYPERV_CPUID_IMPLEMENT_LIMITS); ··· 262 262 ms_hyperv.nested_features = 263 263 cpuid_eax(HYPERV_CPUID_NESTED_FEATURES); 264 264 } 265 + 266 + /* 267 + * Hyper-V expects to get crash register data or kmsg when 268 + * crash enlightment is available and system crashes. Set 269 + * crash_kexec_post_notifiers to be true to make sure that 270 + * calling crash enlightment interface before running kdump 271 + * kernel. 272 + */ 273 + if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) 274 + crash_kexec_post_notifiers = true; 265 275 266 276 #ifdef CONFIG_X86_LOCAL_APIC 267 277 if (ms_hyperv.features & HV_X64_ACCESS_FREQUENCY_MSRS &&
+2
arch/x86/kernel/cpu/resctrl/core.c
··· 578 578 d->id = id; 579 579 cpumask_set_cpu(cpu, &d->cpu_mask); 580 580 581 + rdt_domain_reconfigure_cdp(r); 582 + 581 583 if (r->alloc_capable && domain_setup_ctrlval(r, d)) { 582 584 kfree(d); 583 585 return;
+1
arch/x86/kernel/cpu/resctrl/internal.h
··· 601 601 void __check_limbo(struct rdt_domain *d, bool force_free); 602 602 bool cbm_validate_intel(char *buf, u32 *data, struct rdt_resource *r); 603 603 bool cbm_validate_amd(char *buf, u32 *data, struct rdt_resource *r); 604 + void rdt_domain_reconfigure_cdp(struct rdt_resource *r); 604 605 605 606 #endif /* _ASM_X86_RESCTRL_INTERNAL_H */
+15 -1
arch/x86/kernel/cpu/resctrl/rdtgroup.c
··· 1859 1859 return 0; 1860 1860 } 1861 1861 1862 + /* Restore the qos cfg state when a domain comes online */ 1863 + void rdt_domain_reconfigure_cdp(struct rdt_resource *r) 1864 + { 1865 + if (!r->alloc_capable) 1866 + return; 1867 + 1868 + if (r == &rdt_resources_all[RDT_RESOURCE_L2DATA]) 1869 + l2_qos_cfg_update(&r->alloc_enabled); 1870 + 1871 + if (r == &rdt_resources_all[RDT_RESOURCE_L3DATA]) 1872 + l3_qos_cfg_update(&r->alloc_enabled); 1873 + } 1874 + 1862 1875 /* 1863 1876 * Enable or disable the MBA software controller 1864 1877 * which helps user specify bandwidth in MBps. ··· 3085 3072 * If the rdtgroup is a mon group and parent directory 3086 3073 * is a valid "mon_groups" directory, remove the mon group. 3087 3074 */ 3088 - if (rdtgrp->type == RDTCTRL_GROUP && parent_kn == rdtgroup_default.kn) { 3075 + if (rdtgrp->type == RDTCTRL_GROUP && parent_kn == rdtgroup_default.kn && 3076 + rdtgrp != &rdtgroup_default) { 3089 3077 if (rdtgrp->mode == RDT_MODE_PSEUDO_LOCKSETUP || 3090 3078 rdtgrp->mode == RDT_MODE_PSEUDO_LOCKED) { 3091 3079 ret = rdtgroup_ctrl_remove(kn, rdtgrp);
+1 -1
arch/x86/kernel/umip.c
··· 81 81 #define UMIP_INST_SLDT 3 /* 0F 00 /0 */ 82 82 #define UMIP_INST_STR 4 /* 0F 00 /1 */ 83 83 84 - const char * const umip_insns[5] = { 84 + static const char * const umip_insns[5] = { 85 85 [UMIP_INST_SGDT] = "SGDT", 86 86 [UMIP_INST_SIDT] = "SIDT", 87 87 [UMIP_INST_SMSW] = "SMSW",
+12 -4
arch/x86/platform/efi/efi_64.c
··· 202 202 203 203 int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages) 204 204 { 205 - unsigned long pfn, text, pf; 205 + unsigned long pfn, text, pf, rodata; 206 206 struct page *page; 207 207 unsigned npages; 208 208 pgd_t *pgd = efi_mm.pgd; ··· 256 256 257 257 efi_scratch.phys_stack = page_to_phys(page + 1); /* stack grows down */ 258 258 259 - npages = (__end_rodata_aligned - _text) >> PAGE_SHIFT; 259 + npages = (_etext - _text) >> PAGE_SHIFT; 260 260 text = __pa(_text); 261 261 pfn = text >> PAGE_SHIFT; 262 262 263 263 pf = _PAGE_ENC; 264 264 if (kernel_map_pages_in_pgd(pgd, pfn, text, npages, pf)) { 265 265 pr_err("Failed to map kernel text 1:1\n"); 266 + return 1; 267 + } 268 + 269 + npages = (__end_rodata - __start_rodata) >> PAGE_SHIFT; 270 + rodata = __pa(__start_rodata); 271 + pfn = rodata >> PAGE_SHIFT; 272 + if (kernel_map_pages_in_pgd(pgd, pfn, rodata, npages, pf)) { 273 + pr_err("Failed to map kernel rodata 1:1\n"); 266 274 return 1; 267 275 } 268 276 ··· 646 638 phys_vendor = virt_to_phys_or_null(vnd); 647 639 phys_data = virt_to_phys_or_null_size(data, data_size); 648 640 649 - if (!phys_name || !phys_data) 641 + if (!phys_name || (data && !phys_data)) 650 642 status = EFI_INVALID_PARAMETER; 651 643 else 652 644 status = efi_thunk(set_variable, phys_name, phys_vendor, ··· 677 669 phys_vendor = virt_to_phys_or_null(vnd); 678 670 phys_data = virt_to_phys_or_null_size(data, data_size); 679 671 680 - if (!phys_name || !phys_data) 672 + if (!phys_name || (data && !phys_data)) 681 673 status = EFI_INVALID_PARAMETER; 682 674 else 683 675 status = efi_thunk(set_variable, phys_name, phys_vendor,
+3 -1
block/blk-mq.c
··· 1222 1222 rq = list_first_entry(list, struct request, queuelist); 1223 1223 1224 1224 hctx = rq->mq_hctx; 1225 - if (!got_budget && !blk_mq_get_dispatch_budget(hctx)) 1225 + if (!got_budget && !blk_mq_get_dispatch_budget(hctx)) { 1226 + blk_mq_put_driver_tag(rq); 1226 1227 break; 1228 + } 1227 1229 1228 1230 if (!blk_mq_get_driver_tag(rq)) { 1229 1231 /*
+2 -2
block/blk-wbt.c
··· 313 313 calc_wb_limits(rwb); 314 314 rwb->unknown_cnt = 0; 315 315 rwb_wake_all(rwb); 316 - rwb_trace_step(rwb, "scale up"); 316 + rwb_trace_step(rwb, tracepoint_string("scale up")); 317 317 } 318 318 319 319 static void scale_down(struct rq_wb *rwb, bool hard_throttle) ··· 322 322 return; 323 323 calc_wb_limits(rwb); 324 324 rwb->unknown_cnt = 0; 325 - rwb_trace_step(rwb, "scale down"); 325 + rwb_trace_step(rwb, tracepoint_string("scale down")); 326 326 } 327 327 328 328 static void rwb_arm_timer(struct rq_wb *rwb)
+1
drivers/ata/ahci.c
··· 410 410 { PCI_VDEVICE(INTEL, 0x22a3), board_ahci_mobile }, /* Cherry Tr. AHCI */ 411 411 { PCI_VDEVICE(INTEL, 0x5ae3), board_ahci_mobile }, /* ApolloLake AHCI */ 412 412 { PCI_VDEVICE(INTEL, 0x34d3), board_ahci_mobile }, /* Ice Lake LP AHCI */ 413 + { PCI_VDEVICE(INTEL, 0x02d3), board_ahci_mobile }, /* Comet Lake PCH-U AHCI */ 413 414 { PCI_VDEVICE(INTEL, 0x02d7), board_ahci_mobile }, /* Comet Lake PCH RAID */ 414 415 415 416 /* JMicron 360/1/3/5/6, match class to avoid IDE function */
+1
drivers/base/core.c
··· 3891 3891 else 3892 3892 dev->fwnode = fwnode; 3893 3893 } 3894 + EXPORT_SYMBOL_GPL(set_secondary_fwnode); 3894 3895 3895 3896 /** 3896 3897 * device_set_of_node_from_dev - reuse device-tree node of another device
+48
drivers/base/swnode.c
··· 727 727 EXPORT_SYMBOL_GPL(software_node_unregister_nodes); 728 728 729 729 /** 730 + * software_node_register_node_group - Register a group of software nodes 731 + * @node_group: NULL terminated array of software node pointers to be registered 732 + * 733 + * Register multiple software nodes at once. 734 + */ 735 + int software_node_register_node_group(const struct software_node **node_group) 736 + { 737 + unsigned int i; 738 + int ret; 739 + 740 + if (!node_group) 741 + return 0; 742 + 743 + for (i = 0; node_group[i]; i++) { 744 + ret = software_node_register(node_group[i]); 745 + if (ret) { 746 + software_node_unregister_node_group(node_group); 747 + return ret; 748 + } 749 + } 750 + 751 + return 0; 752 + } 753 + EXPORT_SYMBOL_GPL(software_node_register_node_group); 754 + 755 + /** 756 + * software_node_unregister_node_group - Unregister a group of software nodes 757 + * @node_group: NULL terminated array of software node pointers to be unregistered 758 + * 759 + * Unregister multiple software nodes at once. 760 + */ 761 + void software_node_unregister_node_group(const struct software_node **node_group) 762 + { 763 + struct swnode *swnode; 764 + unsigned int i; 765 + 766 + if (!node_group) 767 + return; 768 + 769 + for (i = 0; node_group[i]; i++) { 770 + swnode = software_node_to_swnode(node_group[i]); 771 + if (swnode) 772 + fwnode_remove_software_node(&swnode->fwnode); 773 + } 774 + } 775 + EXPORT_SYMBOL_GPL(software_node_unregister_node_group); 776 + 777 + /** 730 778 * software_node_register - Register static software node 731 779 * @node: The software node to be registered 732 780 */
+19 -14
drivers/block/rbd.c
··· 3754 3754 static void rbd_notify_op_lock(struct rbd_device *rbd_dev, 3755 3755 enum rbd_notify_op notify_op) 3756 3756 { 3757 - struct page **reply_pages; 3758 - size_t reply_len; 3759 - 3760 - __rbd_notify_op_lock(rbd_dev, notify_op, &reply_pages, &reply_len); 3761 - ceph_release_page_vector(reply_pages, calc_pages_for(0, reply_len)); 3757 + __rbd_notify_op_lock(rbd_dev, notify_op, NULL, NULL); 3762 3758 } 3763 3759 3764 3760 static void rbd_notify_acquired_lock(struct work_struct *work) ··· 4523 4527 cancel_work_sync(&rbd_dev->unlock_work); 4524 4528 } 4525 4529 4530 + /* 4531 + * header_rwsem must not be held to avoid a deadlock with 4532 + * rbd_dev_refresh() when flushing notifies. 4533 + */ 4526 4534 static void rbd_unregister_watch(struct rbd_device *rbd_dev) 4527 4535 { 4528 4536 cancel_tasks_sync(rbd_dev); ··· 6894 6894 6895 6895 static void rbd_dev_image_release(struct rbd_device *rbd_dev) 6896 6896 { 6897 - rbd_dev_unprobe(rbd_dev); 6898 - if (rbd_dev->opts) 6897 + if (!rbd_is_ro(rbd_dev)) 6899 6898 rbd_unregister_watch(rbd_dev); 6899 + 6900 + rbd_dev_unprobe(rbd_dev); 6900 6901 rbd_dev->image_format = 0; 6901 6902 kfree(rbd_dev->spec->image_id); 6902 6903 rbd_dev->spec->image_id = NULL; ··· 6908 6907 * device. If this image is the one being mapped (i.e., not a 6909 6908 * parent), initiate a watch on its header object before using that 6910 6909 * object to get detailed information about the rbd image. 6910 + * 6911 + * On success, returns with header_rwsem held for write if called 6912 + * with @depth == 0. 6911 6913 */ 6912 6914 static int rbd_dev_image_probe(struct rbd_device *rbd_dev, int depth) 6913 6915 { ··· 6940 6936 } 6941 6937 } 6942 6938 6939 + if (!depth) 6940 + down_write(&rbd_dev->header_rwsem); 6941 + 6943 6942 ret = rbd_dev_header_info(rbd_dev); 6944 6943 if (ret) { 6945 6944 if (ret == -ENOENT && !need_watch) 6946 6945 rbd_print_dne(rbd_dev, false); 6947 - goto err_out_watch; 6946 + goto err_out_probe; 6948 6947 } 6949 6948 6950 6949 /* ··· 6992 6985 return 0; 6993 6986 6994 6987 err_out_probe: 6995 - rbd_dev_unprobe(rbd_dev); 6996 - err_out_watch: 6988 + if (!depth) 6989 + up_write(&rbd_dev->header_rwsem); 6997 6990 if (need_watch) 6998 6991 rbd_unregister_watch(rbd_dev); 6992 + rbd_dev_unprobe(rbd_dev); 6999 6993 err_out_format: 7000 6994 rbd_dev->image_format = 0; 7001 6995 kfree(rbd_dev->spec->image_id); ··· 7058 7050 goto err_out_rbd_dev; 7059 7051 } 7060 7052 7061 - down_write(&rbd_dev->header_rwsem); 7062 7053 rc = rbd_dev_image_probe(rbd_dev, 0); 7063 - if (rc < 0) { 7064 - up_write(&rbd_dev->header_rwsem); 7054 + if (rc < 0) 7065 7055 goto err_out_rbd_dev; 7066 - } 7067 7056 7068 7057 if (rbd_dev->opts->alloc_size > rbd_dev->layout.object_size) { 7069 7058 rbd_warn(rbd_dev, "alloc_size adjusted to %u",
+1 -1
drivers/clk/clk-asm9260.c
··· 276 276 277 277 /* TODO: Convert to DT parent scheme */ 278 278 ref_clk = of_clk_get_parent_name(np, 0); 279 - hw = __clk_hw_register_fixed_rate_with_accuracy(NULL, NULL, pll_clk, 279 + hw = __clk_hw_register_fixed_rate(NULL, NULL, pll_clk, 280 280 ref_clk, NULL, NULL, 0, rate, 0, 281 281 CLK_FIXED_RATE_PARENT_ACCURACY); 282 282
+32 -1
drivers/clk/mmp/clk-pll.c
··· 97 97 .recalc_rate = mmp_clk_pll_recalc_rate, 98 98 }; 99 99 100 - struct clk *mmp_clk_register_pll(char *name, 100 + static struct clk *mmp_clk_register_pll(char *name, 101 101 unsigned long default_rate, 102 102 void __iomem *enable_reg, u32 enable, 103 103 void __iomem *reg, u8 shift, ··· 136 136 kfree(pll); 137 137 138 138 return clk; 139 + } 140 + 141 + void mmp_register_pll_clks(struct mmp_clk_unit *unit, 142 + struct mmp_param_pll_clk *clks, 143 + void __iomem *base, int size) 144 + { 145 + struct clk *clk; 146 + int i; 147 + 148 + for (i = 0; i < size; i++) { 149 + void __iomem *reg = NULL; 150 + 151 + if (clks[i].offset) 152 + reg = base + clks[i].offset; 153 + 154 + clk = mmp_clk_register_pll(clks[i].name, 155 + clks[i].default_rate, 156 + base + clks[i].enable_offset, 157 + clks[i].enable, 158 + reg, clks[i].shift, 159 + clks[i].input_rate, 160 + base + clks[i].postdiv_offset, 161 + clks[i].postdiv_shift); 162 + if (IS_ERR(clk)) { 163 + pr_err("%s: failed to register clock %s\n", 164 + __func__, clks[i].name); 165 + continue; 166 + } 167 + if (clks[i].id) 168 + unit->clk_table[clks[i].id] = clk; 169 + } 139 170 }
-31
drivers/clk/mmp/clk.c
··· 176 176 } 177 177 } 178 178 179 - void mmp_register_pll_clks(struct mmp_clk_unit *unit, 180 - struct mmp_param_pll_clk *clks, 181 - void __iomem *base, int size) 182 - { 183 - struct clk *clk; 184 - int i; 185 - 186 - for (i = 0; i < size; i++) { 187 - void __iomem *reg = NULL; 188 - 189 - if (clks[i].offset) 190 - reg = base + clks[i].offset; 191 - 192 - clk = mmp_clk_register_pll(clks[i].name, 193 - clks[i].default_rate, 194 - base + clks[i].enable_offset, 195 - clks[i].enable, 196 - reg, clks[i].shift, 197 - clks[i].input_rate, 198 - base + clks[i].postdiv_offset, 199 - clks[i].postdiv_shift); 200 - if (IS_ERR(clk)) { 201 - pr_err("%s: failed to register clock %s\n", 202 - __func__, clks[i].name); 203 - continue; 204 - } 205 - if (clks[i].id) 206 - unit->clk_table[clks[i].id] = clk; 207 - } 208 - } 209 - 210 179 void mmp_clk_add(struct mmp_clk_unit *unit, unsigned int id, 211 180 struct clk *clk) 212 181 {
-7
drivers/clk/mmp/clk.h
··· 238 238 struct mmp_param_pll_clk *clks, 239 239 void __iomem *base, int size); 240 240 241 - extern struct clk *mmp_clk_register_pll(char *name, 242 - unsigned long default_rate, 243 - void __iomem *enable_reg, u32 enable, 244 - void __iomem *reg, u8 shift, 245 - unsigned long input_rate, 246 - void __iomem *postdiv_reg, u8 postdiv_shift); 247 - 248 241 #define DEFINE_MIX_REG_INFO(w_d, s_d, w_m, s_m, fc) \ 249 242 { \ 250 243 .width_div = (w_d), \
+2 -1
drivers/clk/sprd/sc9863a-clk.c
··· 1641 1641 0x1000, BIT(12), 0, 0); 1642 1642 static SPRD_SC_GATE_CLK_FW_NAME(uart0_eb, "uart0-eb", "ext-26m", 0x0, 1643 1643 0x1000, BIT(13), 0, 0); 1644 + /* uart1_eb is for console, don't gate even if unused */ 1644 1645 static SPRD_SC_GATE_CLK_FW_NAME(uart1_eb, "uart1-eb", "ext-26m", 0x0, 1645 - 0x1000, BIT(14), 0, 0); 1646 + 0x1000, BIT(14), CLK_IGNORE_UNUSED, 0); 1646 1647 static SPRD_SC_GATE_CLK_FW_NAME(uart2_eb, "uart2-eb", "ext-26m", 0x0, 1647 1648 0x1000, BIT(15), 0, 0); 1648 1649 static SPRD_SC_GATE_CLK_FW_NAME(uart3_eb, "uart3-eb", "ext-26m", 0x0,
+1 -1
drivers/firmware/efi/cper.c
··· 101 101 if (!len) 102 102 len = snprintf(buf, sizeof(buf), "%s%s", pfx, str); 103 103 else 104 - len += snprintf(buf+len, sizeof(buf)-len, ", %s", str); 104 + len += scnprintf(buf+len, sizeof(buf)-len, ", %s", str); 105 105 } 106 106 if (len) 107 107 printk("%s\n", buf);
+1 -1
drivers/firmware/efi/libstub/efistub.h
··· 25 25 #define EFI_ALLOC_ALIGN EFI_PAGE_SIZE 26 26 #endif 27 27 28 - #ifdef CONFIG_ARM 28 + #if defined(CONFIG_ARM) || defined(CONFIG_X86) 29 29 #define __efistub_global __section(.data) 30 30 #else 31 31 #define __efistub_global
+14 -13
drivers/firmware/efi/libstub/file.c
··· 29 29 */ 30 30 #define EFI_READ_CHUNK_SIZE SZ_1M 31 31 32 + struct finfo { 33 + efi_file_info_t info; 34 + efi_char16_t filename[MAX_FILENAME_SIZE]; 35 + }; 36 + 32 37 static efi_status_t efi_open_file(efi_file_protocol_t *volume, 33 - efi_char16_t *filename_16, 38 + struct finfo *fi, 34 39 efi_file_protocol_t **handle, 35 40 unsigned long *file_size) 36 41 { 37 - struct { 38 - efi_file_info_t info; 39 - efi_char16_t filename[MAX_FILENAME_SIZE]; 40 - } finfo; 41 42 efi_guid_t info_guid = EFI_FILE_INFO_ID; 42 43 efi_file_protocol_t *fh; 43 44 unsigned long info_sz; 44 45 efi_status_t status; 45 46 46 - status = volume->open(volume, &fh, filename_16, EFI_FILE_MODE_READ, 0); 47 + status = volume->open(volume, &fh, fi->filename, EFI_FILE_MODE_READ, 0); 47 48 if (status != EFI_SUCCESS) { 48 49 pr_efi_err("Failed to open file: "); 49 - efi_char16_printk(filename_16); 50 + efi_char16_printk(fi->filename); 50 51 efi_printk("\n"); 51 52 return status; 52 53 } 53 54 54 - info_sz = sizeof(finfo); 55 - status = fh->get_info(fh, &info_guid, &info_sz, &finfo); 55 + info_sz = sizeof(struct finfo); 56 + status = fh->get_info(fh, &info_guid, &info_sz, fi); 56 57 if (status != EFI_SUCCESS) { 57 58 pr_efi_err("Failed to get file info\n"); 58 59 fh->close(fh); ··· 61 60 } 62 61 63 62 *handle = fh; 64 - *file_size = finfo.info.file_size; 63 + *file_size = fi->info.file_size; 65 64 return EFI_SUCCESS; 66 65 } 67 66 ··· 147 146 148 147 alloc_addr = alloc_size = 0; 149 148 do { 150 - efi_char16_t filename[MAX_FILENAME_SIZE]; 149 + struct finfo fi; 151 150 unsigned long size; 152 151 void *addr; 153 152 154 153 offset = find_file_option(cmdline, cmdline_len, 155 154 optstr, optstr_size, 156 - filename, ARRAY_SIZE(filename)); 155 + fi.filename, ARRAY_SIZE(fi.filename)); 157 156 158 157 if (!offset) 159 158 break; ··· 167 166 return status; 168 167 } 169 168 170 - status = efi_open_file(volume, filename, &file, &size); 169 + status = efi_open_file(volume, &fi, &file, &size); 171 170 if (status != EFI_SUCCESS) 172 171 goto err_close_volume; 173 172
+11 -7
drivers/firmware/efi/libstub/x86-stub.c
··· 20 20 /* Maximum physical address for 64-bit kernel with 4-level paging */ 21 21 #define MAXMEM_X86_64_4LEVEL (1ull << 46) 22 22 23 - static efi_system_table_t *sys_table; 23 + static efi_system_table_t *sys_table __efistub_global; 24 24 extern const bool efi_is64; 25 25 extern u32 image_offset; 26 26 ··· 392 392 image_base = efi_table_attr(image, image_base); 393 393 image_offset = (void *)startup_32 - image_base; 394 394 395 - hdr = &((struct boot_params *)image_base)->hdr; 396 - 397 395 status = efi_allocate_pages(0x4000, (unsigned long *)&boot_params, ULONG_MAX); 398 396 if (status != EFI_SUCCESS) { 399 397 efi_printk("Failed to allocate lowmem for boot params\n"); ··· 740 742 * now use KERNEL_IMAGE_SIZE, which will be 512MiB, the same as what 741 743 * KASLR uses. 742 744 * 743 - * Also relocate it if image_offset is zero, i.e. we weren't loaded by 744 - * LoadImage, but we are not aligned correctly. 745 + * Also relocate it if image_offset is zero, i.e. the kernel wasn't 746 + * loaded by LoadImage, but rather by a bootloader that called the 747 + * handover entry. The reason we must always relocate in this case is 748 + * to handle the case of systemd-boot booting a unified kernel image, 749 + * which is a PE executable that contains the bzImage and an initrd as 750 + * COFF sections. The initrd section is placed after the bzImage 751 + * without ensuring that there are at least init_size bytes available 752 + * for the bzImage, and thus the compressed kernel's startup code may 753 + * overwrite the initrd unless it is moved out of the way. 745 754 */ 746 755 747 756 buffer_start = ALIGN(bzimage_addr - image_offset, ··· 758 753 if ((buffer_start < LOAD_PHYSICAL_ADDR) || 759 754 (IS_ENABLED(CONFIG_X86_32) && buffer_end > KERNEL_IMAGE_SIZE) || 760 755 (IS_ENABLED(CONFIG_X86_64) && buffer_end > MAXMEM_X86_64_4LEVEL) || 761 - (image_offset == 0 && !IS_ALIGNED(bzimage_addr, 762 - hdr->kernel_alignment))) { 756 + (image_offset == 0)) { 763 757 status = efi_relocate_kernel(&bzimage_addr, 764 758 hdr->init_size, hdr->init_size, 765 759 hdr->pref_address,
+20 -2
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
··· 2008 2008 */ 2009 2009 static bool amdgpu_device_check_vram_lost(struct amdgpu_device *adev) 2010 2010 { 2011 - return !!memcmp(adev->gart.ptr, adev->reset_magic, 2012 - AMDGPU_RESET_MAGIC_NUM); 2011 + if (memcmp(adev->gart.ptr, adev->reset_magic, 2012 + AMDGPU_RESET_MAGIC_NUM)) 2013 + return true; 2014 + 2015 + if (!adev->in_gpu_reset) 2016 + return false; 2017 + 2018 + /* 2019 + * For all ASICs with baco/mode1 reset, the VRAM is 2020 + * always assumed to be lost. 2021 + */ 2022 + switch (amdgpu_asic_reset_method(adev)) { 2023 + case AMD_RESET_METHOD_BACO: 2024 + case AMD_RESET_METHOD_MODE1: 2025 + return true; 2026 + default: 2027 + return false; 2028 + } 2013 2029 } 2014 2030 2015 2031 /** ··· 2356 2340 { 2357 2341 int i, r; 2358 2342 2343 + amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE); 2344 + amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE); 2359 2345 2360 2346 for (i = adev->num_ip_blocks - 1; i >= 0; i--) { 2361 2347 if (!adev->ip_blocks[i].status.valid)
-2
drivers/gpu/drm/amd/amdgpu/cik.c
··· 1358 1358 int r; 1359 1359 1360 1360 if (cik_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) { 1361 - if (!adev->in_suspend) 1362 - amdgpu_inc_vram_lost(adev); 1363 1361 r = amdgpu_dpm_baco_reset(adev); 1364 1362 } else { 1365 1363 r = cik_asic_pci_config_reset(adev);
+1 -1
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
··· 279 279 280 280 #define DEFAULT_SH_MEM_CONFIG \ 281 281 ((SH_MEM_ADDRESS_MODE_64 << SH_MEM_CONFIG__ADDRESS_MODE__SHIFT) | \ 282 - (SH_MEM_ALIGNMENT_MODE_DWORD << SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT) | \ 282 + (SH_MEM_ALIGNMENT_MODE_UNALIGNED << SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT) | \ 283 283 (SH_MEM_RETRY_MODE_ALL << SH_MEM_CONFIG__RETRY_MODE__SHIFT) | \ 284 284 (3 << SH_MEM_CONFIG__INITIAL_INST_PREFETCH__SHIFT)) 285 285
+2
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
··· 1234 1234 static const struct amdgpu_gfxoff_quirk amdgpu_gfxoff_quirk_list[] = { 1235 1235 /* https://bugzilla.kernel.org/show_bug.cgi?id=204689 */ 1236 1236 { 0x1002, 0x15dd, 0x1002, 0x15dd, 0xc8 }, 1237 + /* https://bugzilla.kernel.org/show_bug.cgi?id=207171 */ 1238 + { 0x1002, 0x15dd, 0x103c, 0x83e7, 0xd3 }, 1237 1239 { 0, 0, 0, 0, 0 }, 1238 1240 }; 1239 1241
-4
drivers/gpu/drm/amd/amdgpu/nv.c
··· 351 351 struct smu_context *smu = &adev->smu; 352 352 353 353 if (nv_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) { 354 - if (!adev->in_suspend) 355 - amdgpu_inc_vram_lost(adev); 356 354 ret = smu_baco_enter(smu); 357 355 if (ret) 358 356 return ret; ··· 358 360 if (ret) 359 361 return ret; 360 362 } else { 361 - if (!adev->in_suspend) 362 - amdgpu_inc_vram_lost(adev); 363 363 ret = nv_asic_mode1_reset(adev); 364 364 } 365 365
-4
drivers/gpu/drm/amd/amdgpu/soc15.c
··· 569 569 570 570 switch (soc15_asic_reset_method(adev)) { 571 571 case AMD_RESET_METHOD_BACO: 572 - if (!adev->in_suspend) 573 - amdgpu_inc_vram_lost(adev); 574 572 return soc15_asic_baco_reset(adev); 575 573 case AMD_RESET_METHOD_MODE2: 576 574 return amdgpu_dpm_mode2_reset(adev); 577 575 default: 578 - if (!adev->in_suspend) 579 - amdgpu_inc_vram_lost(adev); 580 576 return soc15_asic_mode1_reset(adev); 581 577 } 582 578 }
-2
drivers/gpu/drm/amd/amdgpu/vi.c
··· 765 765 int r; 766 766 767 767 if (vi_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) { 768 - if (!adev->in_suspend) 769 - amdgpu_inc_vram_lost(adev); 770 768 r = amdgpu_dpm_baco_reset(adev); 771 769 } else { 772 770 r = vi_asic_pci_config_reset(adev);
+4 -1
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
··· 3804 3804 { 3805 3805 uint32_t i; 3806 3806 3807 + /* force the trim if mclk_switching is disabled to prevent flicker */ 3808 + bool force_trim = (low_limit == high_limit); 3807 3809 for (i = 0; i < dpm_table->count; i++) { 3808 3810 /*skip the trim if od is enabled*/ 3809 - if (!hwmgr->od_enabled && (dpm_table->dpm_levels[i].value < low_limit 3811 + if ((!hwmgr->od_enabled || force_trim) 3812 + && (dpm_table->dpm_levels[i].value < low_limit 3810 3813 || dpm_table->dpm_levels[i].value > high_limit)) 3811 3814 dpm_table->dpm_levels[i].enabled = false; 3812 3815 else
+6
drivers/gpu/drm/amd/powerplay/smu_v11_0.c
··· 1718 1718 if (ret) 1719 1719 goto out; 1720 1720 1721 + if (ras && ras->supported) { 1722 + ret = smu_send_smc_msg(smu, SMU_MSG_PrepareMp1ForUnload, NULL); 1723 + if (ret) 1724 + goto out; 1725 + } 1726 + 1721 1727 /* clear vbios scratch 6 and 7 for coming asic reinit */ 1722 1728 WREG32(adev->bios_scratch_reg_offset + 6, 0); 1723 1729 WREG32(adev->bios_scratch_reg_offset + 7, 0);
+22 -24
drivers/gpu/drm/i915/gvt/kvmgt.c
··· 131 131 struct work_struct release_work; 132 132 atomic_t released; 133 133 struct vfio_device *vfio_device; 134 + struct vfio_group *vfio_group; 134 135 }; 135 136 136 137 static inline struct kvmgt_vdev *kvmgt_vdev(struct intel_vgpu *vgpu) ··· 152 151 unsigned long size) 153 152 { 154 153 struct drm_i915_private *i915 = vgpu->gvt->gt->i915; 154 + struct kvmgt_vdev *vdev = kvmgt_vdev(vgpu); 155 155 int total_pages; 156 156 int npage; 157 157 int ret; ··· 162 160 for (npage = 0; npage < total_pages; npage++) { 163 161 unsigned long cur_gfn = gfn + npage; 164 162 165 - ret = vfio_unpin_pages(mdev_dev(kvmgt_vdev(vgpu)->mdev), &cur_gfn, 1); 163 + ret = vfio_group_unpin_pages(vdev->vfio_group, &cur_gfn, 1); 166 164 drm_WARN_ON(&i915->drm, ret != 1); 167 165 } 168 166 } ··· 171 169 static int gvt_pin_guest_page(struct intel_vgpu *vgpu, unsigned long gfn, 172 170 unsigned long size, struct page **page) 173 171 { 172 + struct kvmgt_vdev *vdev = kvmgt_vdev(vgpu); 174 173 unsigned long base_pfn = 0; 175 174 int total_pages; 176 175 int npage; ··· 186 183 unsigned long cur_gfn = gfn + npage; 187 184 unsigned long pfn; 188 185 189 - ret = vfio_pin_pages(mdev_dev(kvmgt_vdev(vgpu)->mdev), &cur_gfn, 1, 190 - IOMMU_READ | IOMMU_WRITE, &pfn); 186 + ret = vfio_group_pin_pages(vdev->vfio_group, &cur_gfn, 1, 187 + IOMMU_READ | IOMMU_WRITE, &pfn); 191 188 if (ret != 1) { 192 189 gvt_vgpu_err("vfio_pin_pages failed for gfn 0x%lx, ret %d\n", 193 190 cur_gfn, ret); ··· 795 792 struct kvmgt_vdev *vdev = kvmgt_vdev(vgpu); 796 793 unsigned long events; 797 794 int ret; 795 + struct vfio_group *vfio_group; 798 796 799 797 vdev->iommu_notifier.notifier_call = intel_vgpu_iommu_notifier; 800 798 vdev->group_notifier.notifier_call = intel_vgpu_group_notifier; ··· 818 814 goto undo_iommu; 819 815 } 820 816 817 + vfio_group = vfio_group_get_external_user_from_dev(mdev_dev(mdev)); 818 + if (IS_ERR_OR_NULL(vfio_group)) { 819 + ret = !vfio_group ? -EFAULT : PTR_ERR(vfio_group); 820 + gvt_vgpu_err("vfio_group_get_external_user_from_dev failed\n"); 821 + goto undo_register; 822 + } 823 + vdev->vfio_group = vfio_group; 824 + 821 825 /* Take a module reference as mdev core doesn't take 822 826 * a reference for vendor driver. 823 827 */ ··· 842 830 return ret; 843 831 844 832 undo_group: 833 + vfio_group_put_external_user(vdev->vfio_group); 834 + vdev->vfio_group = NULL; 835 + 836 + undo_register: 845 837 vfio_unregister_notifier(mdev_dev(mdev), VFIO_GROUP_NOTIFY, 846 838 &vdev->group_notifier); 847 839 ··· 900 884 kvmgt_guest_exit(info); 901 885 902 886 intel_vgpu_release_msi_eventfd_ctx(vgpu); 887 + vfio_group_put_external_user(vdev->vfio_group); 903 888 904 889 vdev->kvm = NULL; 905 890 vgpu->handle = 0; ··· 2052 2035 void *buf, unsigned long len, bool write) 2053 2036 { 2054 2037 struct kvmgt_guest_info *info; 2055 - struct kvm *kvm; 2056 - int idx, ret; 2057 - bool kthread = current->mm == NULL; 2058 2038 2059 2039 if (!handle_valid(handle)) 2060 2040 return -ESRCH; 2061 2041 2062 2042 info = (struct kvmgt_guest_info *)handle; 2063 - kvm = info->kvm; 2064 2043 2065 - if (kthread) { 2066 - if (!mmget_not_zero(kvm->mm)) 2067 - return -EFAULT; 2068 - use_mm(kvm->mm); 2069 - } 2070 - 2071 - idx = srcu_read_lock(&kvm->srcu); 2072 - ret = write ? kvm_write_guest(kvm, gpa, buf, len) : 2073 - kvm_read_guest(kvm, gpa, buf, len); 2074 - srcu_read_unlock(&kvm->srcu, idx); 2075 - 2076 - if (kthread) { 2077 - unuse_mm(kvm->mm); 2078 - mmput(kvm->mm); 2079 - } 2080 - 2081 - return ret; 2044 + return vfio_dma_rw(kvmgt_vdev(info->vgpu)->vfio_group, 2045 + gpa, buf, len, write); 2082 2046 } 2083 2047 2084 2048 static int kvmgt_read_gpa(unsigned long handle, unsigned long gpa,
+11 -54
drivers/gpu/drm/i915/i915_perf.c
··· 2941 2941 } 2942 2942 2943 2943 /** 2944 - * i915_perf_read_locked - &i915_perf_stream_ops->read with error normalisation 2945 - * @stream: An i915 perf stream 2946 - * @file: An i915 perf stream file 2947 - * @buf: destination buffer given by userspace 2948 - * @count: the number of bytes userspace wants to read 2949 - * @ppos: (inout) file seek position (unused) 2950 - * 2951 - * Besides wrapping &i915_perf_stream_ops->read this provides a common place to 2952 - * ensure that if we've successfully copied any data then reporting that takes 2953 - * precedence over any internal error status, so the data isn't lost. 2954 - * 2955 - * For example ret will be -ENOSPC whenever there is more buffered data than 2956 - * can be copied to userspace, but that's only interesting if we weren't able 2957 - * to copy some data because it implies the userspace buffer is too small to 2958 - * receive a single record (and we never split records). 2959 - * 2960 - * Another case with ret == -EFAULT is more of a grey area since it would seem 2961 - * like bad form for userspace to ask us to overrun its buffer, but the user 2962 - * knows best: 2963 - * 2964 - * http://yarchive.net/comp/linux/partial_reads_writes.html 2965 - * 2966 - * Returns: The number of bytes copied or a negative error code on failure. 2967 - */ 2968 - static ssize_t i915_perf_read_locked(struct i915_perf_stream *stream, 2969 - struct file *file, 2970 - char __user *buf, 2971 - size_t count, 2972 - loff_t *ppos) 2973 - { 2974 - /* Note we keep the offset (aka bytes read) separate from any 2975 - * error status so that the final check for whether we return 2976 - * the bytes read with a higher precedence than any error (see 2977 - * comment below) doesn't need to be handled/duplicated in 2978 - * stream->ops->read() implementations. 2979 - */ 2980 - size_t offset = 0; 2981 - int ret = stream->ops->read(stream, buf, count, &offset); 2982 - 2983 - return offset ?: (ret ?: -EAGAIN); 2984 - } 2985 - 2986 - /** 2987 2944 * i915_perf_read - handles read() FOP for i915 perf stream FDs 2988 2945 * @file: An i915 perf stream file 2989 2946 * @buf: destination buffer given by userspace ··· 2965 3008 { 2966 3009 struct i915_perf_stream *stream = file->private_data; 2967 3010 struct i915_perf *perf = stream->perf; 2968 - ssize_t ret; 3011 + size_t offset = 0; 3012 + int ret; 2969 3013 2970 3014 /* To ensure it's handled consistently we simply treat all reads of a 2971 3015 * disabled stream as an error. In particular it might otherwise lead ··· 2989 3031 return ret; 2990 3032 2991 3033 mutex_lock(&perf->lock); 2992 - ret = i915_perf_read_locked(stream, file, 2993 - buf, count, ppos); 3034 + ret = stream->ops->read(stream, buf, count, &offset); 2994 3035 mutex_unlock(&perf->lock); 2995 - } while (ret == -EAGAIN); 3036 + } while (!offset && !ret); 2996 3037 } else { 2997 3038 mutex_lock(&perf->lock); 2998 - ret = i915_perf_read_locked(stream, file, buf, count, ppos); 3039 + ret = stream->ops->read(stream, buf, count, &offset); 2999 3040 mutex_unlock(&perf->lock); 3000 3041 } 3001 3042 ··· 3005 3048 * and read() returning -EAGAIN. Clearing the oa.pollin state here 3006 3049 * effectively ensures we back off until the next hrtimer callback 3007 3050 * before reporting another EPOLLIN event. 3051 + * The exception to this is if ops->read() returned -ENOSPC which means 3052 + * that more OA data is available than could fit in the user provided 3053 + * buffer. In this case we want the next poll() call to not block. 3008 3054 */ 3009 - if (ret >= 0 || ret == -EAGAIN) { 3010 - /* Maybe make ->pollin per-stream state if we support multiple 3011 - * concurrent streams in the future. 3012 - */ 3055 + if (ret != -ENOSPC) 3013 3056 stream->pollin = false; 3014 - } 3015 3057 3016 - return ret; 3058 + /* Possible values for ret are 0, -EFAULT, -ENOSPC, -EIO, ... */ 3059 + return offset ?: (ret ?: -EAGAIN); 3017 3060 } 3018 3061 3019 3062 static enum hrtimer_restart oa_poll_check_timer_cb(struct hrtimer *hrtimer)
+3
drivers/gpu/drm/nouveau/nvkm/engine/sec2/gp108.c
··· 25 25 MODULE_FIRMWARE("nvidia/gp108/sec2/desc.bin"); 26 26 MODULE_FIRMWARE("nvidia/gp108/sec2/image.bin"); 27 27 MODULE_FIRMWARE("nvidia/gp108/sec2/sig.bin"); 28 + MODULE_FIRMWARE("nvidia/gv100/sec2/desc.bin"); 29 + MODULE_FIRMWARE("nvidia/gv100/sec2/image.bin"); 30 + MODULE_FIRMWARE("nvidia/gv100/sec2/sig.bin"); 28 31 29 32 static const struct nvkm_sec2_fwif 30 33 gp108_sec2_fwif[] = {
+16
drivers/gpu/drm/nouveau/nvkm/engine/sec2/tu102.c
··· 56 56 return 0; 57 57 } 58 58 59 + MODULE_FIRMWARE("nvidia/tu102/sec2/desc.bin"); 60 + MODULE_FIRMWARE("nvidia/tu102/sec2/image.bin"); 61 + MODULE_FIRMWARE("nvidia/tu102/sec2/sig.bin"); 62 + MODULE_FIRMWARE("nvidia/tu104/sec2/desc.bin"); 63 + MODULE_FIRMWARE("nvidia/tu104/sec2/image.bin"); 64 + MODULE_FIRMWARE("nvidia/tu104/sec2/sig.bin"); 65 + MODULE_FIRMWARE("nvidia/tu106/sec2/desc.bin"); 66 + MODULE_FIRMWARE("nvidia/tu106/sec2/image.bin"); 67 + MODULE_FIRMWARE("nvidia/tu106/sec2/sig.bin"); 68 + MODULE_FIRMWARE("nvidia/tu116/sec2/desc.bin"); 69 + MODULE_FIRMWARE("nvidia/tu116/sec2/image.bin"); 70 + MODULE_FIRMWARE("nvidia/tu116/sec2/sig.bin"); 71 + MODULE_FIRMWARE("nvidia/tu117/sec2/desc.bin"); 72 + MODULE_FIRMWARE("nvidia/tu117/sec2/image.bin"); 73 + MODULE_FIRMWARE("nvidia/tu117/sec2/sig.bin"); 74 + 59 75 static const struct nvkm_sec2_fwif 60 76 tu102_sec2_fwif[] = { 61 77 { 0, gp102_sec2_load, &tu102_sec2, &gp102_sec2_acr_1 },
+3
drivers/hv/channel_mgmt.c
··· 839 839 { 840 840 struct vmbus_channel_message_header hdr; 841 841 842 + if (xchg(&vmbus_connection.conn_state, DISCONNECTED) == DISCONNECTED) 843 + return; 844 + 842 845 /* Pre-Win2012R2 hosts don't support reconnect */ 843 846 if (vmbus_proto_version < VERSION_WIN8_1) 844 847 return;
+1 -1
drivers/hv/hv_debugfs.c
··· 11 11 12 12 #include "hyperv_vmbus.h" 13 13 14 - struct dentry *hv_debug_root; 14 + static struct dentry *hv_debug_root; 15 15 16 16 static int hv_debugfs_delay_get(void *data, u64 *val) 17 17 {
+1 -1
drivers/hv/hyperv_vmbus.h
··· 292 292 struct list_head msglist_entry; 293 293 294 294 /* The message itself */ 295 - unsigned char msg[0]; 295 + unsigned char msg[]; 296 296 }; 297 297 298 298
+44 -18
drivers/hv/vmbus_drv.c
··· 31 31 #include <linux/kdebug.h> 32 32 #include <linux/efi.h> 33 33 #include <linux/random.h> 34 + #include <linux/kernel.h> 34 35 #include <linux/syscore_ops.h> 35 36 #include <clocksource/hyperv_timer.h> 36 37 #include "hyperv_vmbus.h" ··· 49 48 50 49 static void *hv_panic_page; 51 50 51 + /* 52 + * Boolean to control whether to report panic messages over Hyper-V. 53 + * 54 + * It can be set via /proc/sys/kernel/hyperv/record_panic_msg 55 + */ 56 + static int sysctl_record_panic_msg = 1; 57 + 58 + static int hyperv_report_reg(void) 59 + { 60 + return !sysctl_record_panic_msg || !hv_panic_page; 61 + } 62 + 52 63 static int hyperv_panic_event(struct notifier_block *nb, unsigned long val, 53 64 void *args) 54 65 { 55 66 struct pt_regs *regs; 56 67 57 - regs = current_pt_regs(); 68 + vmbus_initiate_unload(true); 58 69 59 - hyperv_report_panic(regs, val); 70 + /* 71 + * Hyper-V should be notified only once about a panic. If we will be 72 + * doing hyperv_report_panic_msg() later with kmsg data, don't do 73 + * the notification here. 74 + */ 75 + if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE 76 + && hyperv_report_reg()) { 77 + regs = current_pt_regs(); 78 + hyperv_report_panic(regs, val, false); 79 + } 60 80 return NOTIFY_DONE; 61 81 } 62 82 ··· 87 65 struct die_args *die = (struct die_args *)args; 88 66 struct pt_regs *regs = die->regs; 89 67 90 - hyperv_report_panic(regs, val); 68 + /* 69 + * Hyper-V should be notified only once about a panic. If we will be 70 + * doing hyperv_report_panic_msg() later with kmsg data, don't do 71 + * the notification here. 72 + */ 73 + if (hyperv_report_reg()) 74 + hyperv_report_panic(regs, val, true); 91 75 return NOTIFY_DONE; 92 76 } 93 77 ··· 1281 1253 } 1282 1254 1283 1255 /* 1284 - * Boolean to control whether to report panic messages over Hyper-V. 1285 - * 1286 - * It can be set via /proc/sys/kernel/hyperv/record_panic_msg 1287 - */ 1288 - static int sysctl_record_panic_msg = 1; 1289 - 1290 - /* 1291 1256 * Callback from kmsg_dump. Grab as much as possible from the end of the kmsg 1292 1257 * buffer and call into Hyper-V to transfer the data. 1293 1258 */ ··· 1403 1382 hv_panic_page = (void *)hv_alloc_hyperv_zeroed_page(); 1404 1383 if (hv_panic_page) { 1405 1384 ret = kmsg_dump_register(&hv_kmsg_dumper); 1406 - if (ret) 1385 + if (ret) { 1407 1386 pr_err("Hyper-V: kmsg dump register " 1408 1387 "error 0x%x\n", ret); 1388 + hv_free_hyperv_page( 1389 + (unsigned long)hv_panic_page); 1390 + hv_panic_page = NULL; 1391 + } 1409 1392 } else 1410 1393 pr_err("Hyper-V: panic message page memory " 1411 1394 "allocation failed"); 1412 1395 } 1413 1396 1414 1397 register_die_notifier(&hyperv_die_block); 1415 - atomic_notifier_chain_register(&panic_notifier_list, 1416 - &hyperv_panic_block); 1417 1398 } 1399 + 1400 + /* 1401 + * Always register the panic notifier because we need to unload 1402 + * the VMbus channel connection to prevent any VMbus 1403 + * activity after the VM panics. 1404 + */ 1405 + atomic_notifier_chain_register(&panic_notifier_list, 1406 + &hyperv_panic_block); 1418 1407 1419 1408 vmbus_request_offers(); 1420 1409 ··· 1438 1407 hv_remove_vmbus_irq(); 1439 1408 1440 1409 bus_unregister(&hv_bus); 1441 - hv_free_hyperv_page((unsigned long)hv_panic_page); 1442 1410 unregister_sysctl_table(hv_ctl_table_hdr); 1443 1411 hv_ctl_table_hdr = NULL; 1444 1412 return ret; ··· 2234 2204 2235 2205 vmbus_initiate_unload(false); 2236 2206 2237 - vmbus_connection.conn_state = DISCONNECTED; 2238 - 2239 2207 /* Reset the event for the next resume. */ 2240 2208 reinit_completion(&vmbus_connection.ready_for_resume_event); 2241 2209 ··· 2317 2289 { 2318 2290 hv_stimer_global_cleanup(); 2319 2291 vmbus_initiate_unload(false); 2320 - vmbus_connection.conn_state = DISCONNECTED; 2321 2292 /* Make sure conn_state is set as hv_synic_cleanup checks for it */ 2322 2293 mb(); 2323 2294 cpuhp_remove_state(hyperv_cpuhp_online); ··· 2333 2306 * doing the cleanup for current CPU only. This should be sufficient 2334 2307 * for kdump. 2335 2308 */ 2336 - vmbus_connection.conn_state = DISCONNECTED; 2337 2309 cpu = smp_processor_id(); 2338 2310 hv_stimer_cleanup(cpu); 2339 2311 hv_synic_disable_regs(cpu);
+1 -1
drivers/hwmon/Kconfig
··· 412 412 hard disk drives. 413 413 414 414 This driver can also be built as a module. If so, the module 415 - will be called satatemp. 415 + will be called drivetemp. 416 416 417 417 config SENSORS_DS620 418 418 tristate "Dallas Semiconductor DS620"
+6
drivers/hwmon/drivetemp.c
··· 264 264 return err; 265 265 switch (attr) { 266 266 case hwmon_temp_input: 267 + if (!temp_is_valid(buf[SCT_STATUS_TEMP])) 268 + return -ENODATA; 267 269 *val = temp_from_sct(buf[SCT_STATUS_TEMP]); 268 270 break; 269 271 case hwmon_temp_lowest: 272 + if (!temp_is_valid(buf[SCT_STATUS_TEMP_LOWEST])) 273 + return -ENODATA; 270 274 *val = temp_from_sct(buf[SCT_STATUS_TEMP_LOWEST]); 271 275 break; 272 276 case hwmon_temp_highest: 277 + if (!temp_is_valid(buf[SCT_STATUS_TEMP_HIGHEST])) 278 + return -ENODATA; 273 279 *val = temp_from_sct(buf[SCT_STATUS_TEMP_HIGHEST]); 274 280 break; 275 281 default:
+1 -1
drivers/hwmon/jc42.c
··· 506 506 } 507 507 data->config = config; 508 508 509 - hwmon_dev = devm_hwmon_device_register_with_info(dev, client->name, 509 + hwmon_dev = devm_hwmon_device_register_with_info(dev, "jc42", 510 510 data, &jc42_chip_info, 511 511 NULL); 512 512 return PTR_ERR_OR_ZERO(hwmon_dev);
+3 -3
drivers/hwmon/k10temp.c
··· 186 186 return temp; 187 187 } 188 188 189 - const char *k10temp_temp_label[] = { 189 + static const char *k10temp_temp_label[] = { 190 190 "Tctl", 191 191 "Tdie", 192 192 "Tccd1", ··· 199 199 "Tccd8", 200 200 }; 201 201 202 - const char *k10temp_in_label[] = { 202 + static const char *k10temp_in_label[] = { 203 203 "Vcore", 204 204 "Vsoc", 205 205 }; 206 206 207 - const char *k10temp_curr_label[] = { 207 + static const char *k10temp_curr_label[] = { 208 208 "Icore", 209 209 "Isoc", 210 210 };
+85 -7
drivers/hwmon/pmbus/isl68137.c
··· 21 21 #define ISL68137_VOUT_AVS 0x30 22 22 #define RAA_DMPVR2_READ_VMON 0xc8 23 23 24 - enum versions { 24 + enum chips { 25 25 isl68137, 26 + isl68220, 27 + isl68221, 28 + isl68222, 29 + isl68223, 30 + isl68224, 31 + isl68225, 32 + isl68226, 33 + isl68227, 34 + isl68229, 35 + isl68233, 36 + isl68239, 37 + isl69222, 38 + isl69223, 39 + isl69224, 40 + isl69225, 41 + isl69227, 42 + isl69228, 43 + isl69234, 44 + isl69236, 45 + isl69239, 46 + isl69242, 47 + isl69243, 48 + isl69247, 49 + isl69248, 50 + isl69254, 51 + isl69255, 52 + isl69256, 53 + isl69259, 54 + isl69260, 55 + isl69268, 56 + isl69269, 57 + isl69298, 58 + raa228000, 59 + raa228004, 60 + raa228006, 61 + raa228228, 62 + raa229001, 63 + raa229004, 64 + }; 65 + 66 + enum variants { 67 + raa_dmpvr1_2rail, 26 68 raa_dmpvr2_1rail, 27 69 raa_dmpvr2_2rail, 28 70 raa_dmpvr2_3rail, ··· 228 186 memcpy(info, &raa_dmpvr_info, sizeof(*info)); 229 187 230 188 switch (id->driver_data) { 231 - case isl68137: 189 + case raa_dmpvr1_2rail: 232 190 info->pages = 2; 233 191 info->R[PSC_VOLTAGE_IN] = 3; 234 192 info->func[0] &= ~PMBUS_HAVE_VMON; ··· 266 224 } 267 225 268 226 static const struct i2c_device_id raa_dmpvr_id[] = { 269 - {"isl68137", isl68137}, 270 - {"raa_dmpvr2_1rail", raa_dmpvr2_1rail}, 271 - {"raa_dmpvr2_2rail", raa_dmpvr2_2rail}, 272 - {"raa_dmpvr2_3rail", raa_dmpvr2_3rail}, 273 - {"raa_dmpvr2_hv", raa_dmpvr2_hv}, 227 + {"isl68137", raa_dmpvr1_2rail}, 228 + {"isl68220", raa_dmpvr2_2rail}, 229 + {"isl68221", raa_dmpvr2_3rail}, 230 + {"isl68222", raa_dmpvr2_2rail}, 231 + {"isl68223", raa_dmpvr2_2rail}, 232 + {"isl68224", raa_dmpvr2_3rail}, 233 + {"isl68225", raa_dmpvr2_2rail}, 234 + {"isl68226", raa_dmpvr2_3rail}, 235 + {"isl68227", raa_dmpvr2_1rail}, 236 + {"isl68229", raa_dmpvr2_3rail}, 237 + {"isl68233", raa_dmpvr2_2rail}, 238 + {"isl68239", raa_dmpvr2_3rail}, 239 + 240 + {"isl69222", raa_dmpvr2_2rail}, 241 + {"isl69223", raa_dmpvr2_3rail}, 242 + {"isl69224", raa_dmpvr2_2rail}, 243 + {"isl69225", raa_dmpvr2_2rail}, 244 + {"isl69227", raa_dmpvr2_3rail}, 245 + {"isl69228", raa_dmpvr2_3rail}, 246 + {"isl69234", raa_dmpvr2_2rail}, 247 + {"isl69236", raa_dmpvr2_2rail}, 248 + {"isl69239", raa_dmpvr2_3rail}, 249 + {"isl69242", raa_dmpvr2_2rail}, 250 + {"isl69243", raa_dmpvr2_1rail}, 251 + {"isl69247", raa_dmpvr2_2rail}, 252 + {"isl69248", raa_dmpvr2_2rail}, 253 + {"isl69254", raa_dmpvr2_2rail}, 254 + {"isl69255", raa_dmpvr2_2rail}, 255 + {"isl69256", raa_dmpvr2_2rail}, 256 + {"isl69259", raa_dmpvr2_2rail}, 257 + {"isl69260", raa_dmpvr2_2rail}, 258 + {"isl69268", raa_dmpvr2_2rail}, 259 + {"isl69269", raa_dmpvr2_3rail}, 260 + {"isl69298", raa_dmpvr2_2rail}, 261 + 262 + {"raa228000", raa_dmpvr2_hv}, 263 + {"raa228004", raa_dmpvr2_hv}, 264 + {"raa228006", raa_dmpvr2_hv}, 265 + {"raa228228", raa_dmpvr2_2rail}, 266 + {"raa229001", raa_dmpvr2_2rail}, 267 + {"raa229004", raa_dmpvr2_2rail}, 274 268 {} 275 269 }; 276 270
+4 -5
drivers/i2c/busses/i2c-altera.c
··· 384 384 struct altr_i2c_dev *idev = NULL; 385 385 struct resource *res; 386 386 int irq, ret; 387 - u32 val; 388 387 389 388 idev = devm_kzalloc(&pdev->dev, sizeof(*idev), GFP_KERNEL); 390 389 if (!idev) ··· 410 411 init_completion(&idev->msg_complete); 411 412 spin_lock_init(&idev->lock); 412 413 413 - val = device_property_read_u32(idev->dev, "fifo-size", 414 + ret = device_property_read_u32(idev->dev, "fifo-size", 414 415 &idev->fifo_size); 415 - if (val) { 416 + if (ret) { 416 417 dev_err(&pdev->dev, "FIFO size set to default of %d\n", 417 418 ALTR_I2C_DFLT_FIFO_SZ); 418 419 idev->fifo_size = ALTR_I2C_DFLT_FIFO_SZ; 419 420 } 420 421 421 - val = device_property_read_u32(idev->dev, "clock-frequency", 422 + ret = device_property_read_u32(idev->dev, "clock-frequency", 422 423 &idev->bus_clk_rate); 423 - if (val) { 424 + if (ret) { 424 425 dev_err(&pdev->dev, "Default to 100kHz\n"); 425 426 idev->bus_clk_rate = I2C_MAX_STANDARD_MODE_FREQ; /* default clock rate */ 426 427 }
+10 -4
drivers/i2c/busses/i2c-designware-platdrv.c
··· 354 354 adap->dev.of_node = pdev->dev.of_node; 355 355 adap->nr = -1; 356 356 357 - dev_pm_set_driver_flags(&pdev->dev, 358 - DPM_FLAG_SMART_PREPARE | 359 - DPM_FLAG_SMART_SUSPEND | 360 - DPM_FLAG_LEAVE_SUSPENDED); 357 + if (dev->flags & ACCESS_NO_IRQ_SUSPEND) { 358 + dev_pm_set_driver_flags(&pdev->dev, 359 + DPM_FLAG_SMART_PREPARE | 360 + DPM_FLAG_LEAVE_SUSPENDED); 361 + } else { 362 + dev_pm_set_driver_flags(&pdev->dev, 363 + DPM_FLAG_SMART_PREPARE | 364 + DPM_FLAG_SMART_SUSPEND | 365 + DPM_FLAG_LEAVE_SUSPENDED); 366 + } 361 367 362 368 /* The code below assumes runtime PM to be disabled. */ 363 369 WARN_ON(pm_runtime_enabled(&pdev->dev));
+24 -12
drivers/i2c/busses/i2c-tegra.c
··· 996 996 do { 997 997 u32 status = i2c_readl(i2c_dev, I2C_INT_STATUS); 998 998 999 - if (status) { 999 + if (status) 1000 1000 tegra_i2c_isr(i2c_dev->irq, i2c_dev); 1001 1001 1002 - if (completion_done(complete)) { 1003 - s64 delta = ktime_ms_delta(ktimeout, ktime); 1002 + if (completion_done(complete)) { 1003 + s64 delta = ktime_ms_delta(ktimeout, ktime); 1004 1004 1005 - return msecs_to_jiffies(delta) ?: 1; 1006 - } 1005 + return msecs_to_jiffies(delta) ?: 1; 1007 1006 } 1008 1007 1009 1008 ktime = ktime_get(); ··· 1029 1030 disable_irq(i2c_dev->irq); 1030 1031 1031 1032 /* 1032 - * There is a chance that completion may happen after IRQ 1033 - * synchronization, which is done by disable_irq(). 1033 + * Under some rare circumstances (like running KASAN + 1034 + * NFS root) CPU, which handles interrupt, may stuck in 1035 + * uninterruptible state for a significant time. In this 1036 + * case we will get timeout if I2C transfer is running on 1037 + * a sibling CPU, despite of IRQ being raised. 1038 + * 1039 + * In order to handle this rare condition, the IRQ status 1040 + * needs to be checked after timeout. 1034 1041 */ 1035 - if (ret == 0 && completion_done(complete)) { 1036 - dev_warn(i2c_dev->dev, 1037 - "completion done after timeout\n"); 1038 - ret = 1; 1039 - } 1042 + if (ret == 0) 1043 + ret = tegra_i2c_poll_completion_timeout(i2c_dev, 1044 + complete, 0); 1040 1045 } 1041 1046 1042 1047 return ret; ··· 1218 1215 if (dma) { 1219 1216 time_left = tegra_i2c_wait_completion_timeout( 1220 1217 i2c_dev, &i2c_dev->dma_complete, xfer_time); 1218 + 1219 + /* 1220 + * Synchronize DMA first, since dmaengine_terminate_sync() 1221 + * performs synchronization after the transfer's termination 1222 + * and we want to get a completion if transfer succeeded. 1223 + */ 1224 + dmaengine_synchronize(i2c_dev->msg_read ? 1225 + i2c_dev->rx_dma_chan : 1226 + i2c_dev->tx_dma_chan); 1221 1227 1222 1228 dmaengine_terminate_sync(i2c_dev->msg_read ? 1223 1229 i2c_dev->rx_dma_chan :
-13
drivers/i2c/i2c-core-base.c
··· 2273 2273 } 2274 2274 EXPORT_SYMBOL_GPL(i2c_new_scanned_device); 2275 2275 2276 - struct i2c_client * 2277 - i2c_new_probed_device(struct i2c_adapter *adap, 2278 - struct i2c_board_info *info, 2279 - unsigned short const *addr_list, 2280 - int (*probe)(struct i2c_adapter *adap, unsigned short addr)) 2281 - { 2282 - struct i2c_client *client; 2283 - 2284 - client = i2c_new_scanned_device(adap, info, addr_list, probe); 2285 - return IS_ERR(client) ? NULL : client; 2286 - } 2287 - EXPORT_SYMBOL_GPL(i2c_new_probed_device); 2288 - 2289 2276 struct i2c_adapter *i2c_get_adapter(int nr) 2290 2277 { 2291 2278 struct i2c_adapter *adapter;
+1 -1
drivers/irqchip/irq-bcm7038-l1.c
··· 416 416 .map = bcm7038_l1_map, 417 417 }; 418 418 419 - int __init bcm7038_l1_of_init(struct device_node *dn, 419 + static int __init bcm7038_l1_of_init(struct device_node *dn, 420 420 struct device_node *parent) 421 421 { 422 422 struct bcm7038_l1_chip *intc;
+20
drivers/irqchip/irq-gic-v3-its.c
··· 14 14 #include <linux/dma-iommu.h> 15 15 #include <linux/efi.h> 16 16 #include <linux/interrupt.h> 17 + #include <linux/iopoll.h> 17 18 #include <linux/irqdomain.h> 18 19 #include <linux/list.h> 19 20 #include <linux/log2.h> ··· 3673 3672 return IRQ_SET_MASK_OK_DONE; 3674 3673 } 3675 3674 3675 + static void its_wait_vpt_parse_complete(void) 3676 + { 3677 + void __iomem *vlpi_base = gic_data_rdist_vlpi_base(); 3678 + u64 val; 3679 + 3680 + if (!gic_rdists->has_vpend_valid_dirty) 3681 + return; 3682 + 3683 + WARN_ON_ONCE(readq_relaxed_poll_timeout(vlpi_base + GICR_VPENDBASER, 3684 + val, 3685 + !(val & GICR_VPENDBASER_Dirty), 3686 + 10, 500)); 3687 + } 3688 + 3676 3689 static void its_vpe_schedule(struct its_vpe *vpe) 3677 3690 { 3678 3691 void __iomem *vlpi_base = gic_data_rdist_vlpi_base(); ··· 3717 3702 val |= vpe->idai ? GICR_VPENDBASER_IDAI : 0; 3718 3703 val |= GICR_VPENDBASER_Valid; 3719 3704 gicr_write_vpendbaser(val, vlpi_base + GICR_VPENDBASER); 3705 + 3706 + its_wait_vpt_parse_complete(); 3720 3707 } 3721 3708 3722 3709 static void its_vpe_deschedule(struct its_vpe *vpe) ··· 3927 3910 val |= FIELD_PREP(GICR_VPENDBASER_4_1_VPEID, vpe->vpe_id); 3928 3911 3929 3912 gicr_write_vpendbaser(val, vlpi_base + GICR_VPENDBASER); 3913 + 3914 + its_wait_vpt_parse_complete(); 3930 3915 } 3931 3916 3932 3917 static void its_vpe_4_1_deschedule(struct its_vpe *vpe, ··· 4054 4035 * not on the host (since they can only be targetting a vPE). 4055 4036 * Tell the kernel we've done whatever it asked for. 4056 4037 */ 4038 + irq_data_update_effective_affinity(d, mask_val); 4057 4039 return IRQ_SET_MASK_OK; 4058 4040 } 4059 4041
+7 -4
drivers/irqchip/irq-gic-v3.c
··· 873 873 gic_data.rdists.has_rvpeid &= !!(typer & GICR_TYPER_RVPEID); 874 874 gic_data.rdists.has_direct_lpi &= (!!(typer & GICR_TYPER_DirectLPIS) | 875 875 gic_data.rdists.has_rvpeid); 876 + gic_data.rdists.has_vpend_valid_dirty &= !!(typer & GICR_TYPER_DIRTY); 876 877 877 878 /* Detect non-sensical configurations */ 878 879 if (WARN_ON_ONCE(gic_data.rdists.has_rvpeid && !gic_data.rdists.has_vlpis)) { ··· 894 893 if (WARN_ON(gic_data.ppi_nr == UINT_MAX)) 895 894 gic_data.ppi_nr = 0; 896 895 pr_info("%d PPIs implemented\n", gic_data.ppi_nr); 897 - pr_info("%sVLPI support, %sdirect LPI support, %sRVPEID support\n", 898 - !gic_data.rdists.has_vlpis ? "no " : "", 899 - !gic_data.rdists.has_direct_lpi ? "no " : "", 900 - !gic_data.rdists.has_rvpeid ? "no " : ""); 896 + if (gic_data.rdists.has_vlpis) 897 + pr_info("GICv4 features: %s%s%s\n", 898 + gic_data.rdists.has_direct_lpi ? "DirectLPI " : "", 899 + gic_data.rdists.has_rvpeid ? "RVPEID " : "", 900 + gic_data.rdists.has_vpend_valid_dirty ? "Valid+Dirty " : ""); 901 901 } 902 902 903 903 /* Check whether it's single security state view */ ··· 1622 1620 gic_data.rdists.has_rvpeid = true; 1623 1621 gic_data.rdists.has_vlpis = true; 1624 1622 gic_data.rdists.has_direct_lpi = true; 1623 + gic_data.rdists.has_vpend_valid_dirty = true; 1625 1624 1626 1625 if (WARN_ON(!gic_data.domain) || WARN_ON(!gic_data.rdists.rdist)) { 1627 1626 err = -ENOMEM;
+7 -1
drivers/irqchip/irq-mbigen.c
··· 220 220 return 0; 221 221 } 222 222 223 + static void mbigen_irq_domain_free(struct irq_domain *domain, unsigned int virq, 224 + unsigned int nr_irqs) 225 + { 226 + platform_msi_domain_free(domain, virq, nr_irqs); 227 + } 228 + 223 229 static const struct irq_domain_ops mbigen_domain_ops = { 224 230 .translate = mbigen_domain_translate, 225 231 .alloc = mbigen_irq_domain_alloc, 226 - .free = irq_domain_free_irqs_common, 232 + .free = mbigen_irq_domain_free, 227 233 }; 228 234 229 235 static int mbigen_of_create_domain(struct platform_device *pdev,
+10 -8
drivers/irqchip/irq-meson-gpio.c
··· 144 144 static void meson_gpio_irq_update_bits(struct meson_gpio_irq_controller *ctl, 145 145 unsigned int reg, u32 mask, u32 val) 146 146 { 147 + unsigned long flags; 147 148 u32 tmp; 149 + 150 + spin_lock_irqsave(&ctl->lock, flags); 148 151 149 152 tmp = readl_relaxed(ctl->base + reg); 150 153 tmp &= ~mask; 151 154 tmp |= val; 152 155 writel_relaxed(tmp, ctl->base + reg); 156 + 157 + spin_unlock_irqrestore(&ctl->lock, flags); 153 158 } 154 159 155 160 static void meson_gpio_irq_init_dummy(struct meson_gpio_irq_controller *ctl) ··· 201 196 unsigned long hwirq, 202 197 u32 **channel_hwirq) 203 198 { 199 + unsigned long flags; 204 200 unsigned int idx; 205 201 206 - spin_lock(&ctl->lock); 202 + spin_lock_irqsave(&ctl->lock, flags); 207 203 208 204 /* Find a free channel */ 209 205 idx = find_first_zero_bit(ctl->channel_map, NUM_CHANNEL); 210 206 if (idx >= NUM_CHANNEL) { 211 - spin_unlock(&ctl->lock); 207 + spin_unlock_irqrestore(&ctl->lock, flags); 212 208 pr_err("No channel available\n"); 213 209 return -ENOSPC; 214 210 } 215 211 216 212 /* Mark the channel as used */ 217 213 set_bit(idx, ctl->channel_map); 214 + 215 + spin_unlock_irqrestore(&ctl->lock, flags); 218 216 219 217 /* 220 218 * Setup the mux of the channel to route the signal of the pad ··· 232 224 * it, using the table base. 233 225 */ 234 226 *channel_hwirq = &(ctl->channel_irqs[idx]); 235 - 236 - spin_unlock(&ctl->lock); 237 227 238 228 pr_debug("hwirq %lu assigned to channel %d - irq %u\n", 239 229 hwirq, idx, **channel_hwirq); ··· 293 287 val |= REG_EDGE_POL_LOW(params, idx); 294 288 } 295 289 296 - spin_lock(&ctl->lock); 297 - 298 290 meson_gpio_irq_update_bits(ctl, REG_EDGE_POL, 299 291 REG_EDGE_POL_MASK(params, idx), val); 300 - 301 - spin_unlock(&ctl->lock); 302 292 303 293 return 0; 304 294 }
+1 -1
drivers/irqchip/irq-mvebu-icu.c
··· 66 66 unsigned int type; 67 67 }; 68 68 69 - DEFINE_STATIC_KEY_FALSE(legacy_bindings); 69 + static DEFINE_STATIC_KEY_FALSE(legacy_bindings); 70 70 71 71 static void mvebu_icu_init(struct mvebu_icu *icu, 72 72 struct mvebu_icu_msi_data *msi_data,
+1 -1
drivers/irqchip/irq-sifive-plic.c
··· 56 56 #define CONTEXT_THRESHOLD 0x00 57 57 #define CONTEXT_CLAIM 0x04 58 58 59 - #define PLIC_DISABLE_THRESHOLD 0xf 59 + #define PLIC_DISABLE_THRESHOLD 0x7 60 60 #define PLIC_ENABLE_THRESHOLD 0 61 61 62 62 struct plic_priv {
+2 -1
drivers/irqchip/irq-ti-sci-inta.c
··· 37 37 #define VINT_ENABLE_SET_OFFSET 0x0 38 38 #define VINT_ENABLE_CLR_OFFSET 0x8 39 39 #define VINT_STATUS_OFFSET 0x18 40 + #define VINT_STATUS_MASKED_OFFSET 0x20 40 41 41 42 /** 42 43 * struct ti_sci_inta_event_desc - Description of an event coming to ··· 117 116 chained_irq_enter(irq_desc_get_chip(desc), desc); 118 117 119 118 val = readq_relaxed(inta->base + vint_desc->vint_id * 0x1000 + 120 - VINT_STATUS_OFFSET); 119 + VINT_STATUS_MASKED_OFFSET); 121 120 122 121 for_each_set_bit(bit, &val, MAX_EVENTS_PER_VINT) { 123 122 virq = irq_find_mapping(domain, vint_desc->events[bit].hwirq);
+2 -2
drivers/isdn/hardware/mISDN/mISDNisar.c
··· 743 743 } 744 744 } 745 745 746 - const char *dmril[] = {"NO SPEED", "1200/75", "NODEF2", "75/1200", "NODEF4", 746 + static const char *dmril[] = {"NO SPEED", "1200/75", "NODEF2", "75/1200", "NODEF4", 747 747 "300", "600", "1200", "2400", "4800", "7200", 748 748 "9600nt", "9600t", "12000", "14400", "WRONG"}; 749 - const char *dmrim[] = {"NO MOD", "NO DEF", "V32/V32b", "V22", "V21", 749 + static const char *dmrim[] = {"NO MOD", "NO DEF", "V32/V32b", "V22", "V21", 750 750 "Bell103", "V23", "Bell202", "V17", "V29", "V27ter"}; 751 751 752 752 static void
+2
drivers/mtd/spi-nor/Makefile
··· 18 18 spi-nor-objs += xilinx.o 19 19 spi-nor-objs += xmc.o 20 20 obj-$(CONFIG_MTD_SPI_NOR) += spi-nor.o 21 + 22 + obj-$(CONFIG_MTD_SPI_NOR) += controllers/
+12 -91
drivers/net/dsa/mt7530.c
··· 67 67 }; 68 68 69 69 static int 70 - mt7623_trgmii_write(struct mt7530_priv *priv, u32 reg, u32 val) 71 - { 72 - int ret; 73 - 74 - ret = regmap_write(priv->ethernet, TRGMII_BASE(reg), val); 75 - if (ret < 0) 76 - dev_err(priv->dev, 77 - "failed to priv write register\n"); 78 - return ret; 79 - } 80 - 81 - static u32 82 - mt7623_trgmii_read(struct mt7530_priv *priv, u32 reg) 83 - { 84 - int ret; 85 - u32 val; 86 - 87 - ret = regmap_read(priv->ethernet, TRGMII_BASE(reg), &val); 88 - if (ret < 0) { 89 - dev_err(priv->dev, 90 - "failed to priv read register\n"); 91 - return ret; 92 - } 93 - 94 - return val; 95 - } 96 - 97 - static void 98 - mt7623_trgmii_rmw(struct mt7530_priv *priv, u32 reg, 99 - u32 mask, u32 set) 100 - { 101 - u32 val; 102 - 103 - val = mt7623_trgmii_read(priv, reg); 104 - val &= ~mask; 105 - val |= set; 106 - mt7623_trgmii_write(priv, reg, val); 107 - } 108 - 109 - static void 110 - mt7623_trgmii_set(struct mt7530_priv *priv, u32 reg, u32 val) 111 - { 112 - mt7623_trgmii_rmw(priv, reg, 0, val); 113 - } 114 - 115 - static void 116 - mt7623_trgmii_clear(struct mt7530_priv *priv, u32 reg, u32 val) 117 - { 118 - mt7623_trgmii_rmw(priv, reg, val, 0); 119 - } 120 - 121 - static int 122 70 core_read_mmd_indirect(struct mt7530_priv *priv, int prtad, int devad) 123 71 { 124 72 struct mii_bus *bus = priv->bus; ··· 478 530 for (i = 0 ; i < NUM_TRGMII_CTRL; i++) 479 531 mt7530_rmw(priv, MT7530_TRGMII_RD(i), 480 532 RD_TAP_MASK, RD_TAP(16)); 481 - else 482 - if (priv->id != ID_MT7621) 483 - mt7623_trgmii_set(priv, GSW_INTF_MODE, 484 - INTF_MODE_TRGMII); 485 - 486 - return 0; 487 - } 488 - 489 - static int 490 - mt7623_pad_clk_setup(struct dsa_switch *ds) 491 - { 492 - struct mt7530_priv *priv = ds->priv; 493 - int i; 494 - 495 - for (i = 0 ; i < NUM_TRGMII_CTRL; i++) 496 - mt7623_trgmii_write(priv, GSW_TRGMII_TD_ODT(i), 497 - TD_DM_DRVP(8) | TD_DM_DRVN(8)); 498 - 499 - mt7623_trgmii_set(priv, GSW_TRGMII_RCK_CTRL, RX_RST | RXC_DQSISEL); 500 - mt7623_trgmii_clear(priv, GSW_TRGMII_RCK_CTRL, RX_RST); 501 - 502 533 return 0; 503 534 } 504 535 ··· 773 846 */ 774 847 mt7530_rmw(priv, MT7530_PCR_P(port), PCR_PORT_VLAN_MASK, 775 848 MT7530_PORT_MATRIX_MODE); 776 - mt7530_rmw(priv, MT7530_PVC_P(port), VLAN_ATTR_MASK, 777 - VLAN_ATTR(MT7530_VLAN_TRANSPARENT)); 849 + mt7530_rmw(priv, MT7530_PVC_P(port), VLAN_ATTR_MASK | PVC_EG_TAG_MASK, 850 + VLAN_ATTR(MT7530_VLAN_TRANSPARENT) | 851 + PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT)); 778 852 779 853 for (i = 0; i < MT7530_NUM_PORTS; i++) { 780 854 if (dsa_is_user_port(ds, i) && ··· 791 863 if (all_user_ports_removed) { 792 864 mt7530_write(priv, MT7530_PCR_P(MT7530_CPU_PORT), 793 865 PCR_MATRIX(dsa_user_ports(priv->ds))); 794 - mt7530_write(priv, MT7530_PVC_P(MT7530_CPU_PORT), 795 - PORT_SPEC_TAG); 866 + mt7530_write(priv, MT7530_PVC_P(MT7530_CPU_PORT), PORT_SPEC_TAG 867 + | PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT)); 796 868 } 797 869 } 798 870 ··· 818 890 /* Set the port as a user port which is to be able to recognize VID 819 891 * from incoming packets before fetching entry within the VLAN table. 820 892 */ 821 - mt7530_rmw(priv, MT7530_PVC_P(port), VLAN_ATTR_MASK, 822 - VLAN_ATTR(MT7530_VLAN_USER)); 893 + mt7530_rmw(priv, MT7530_PVC_P(port), VLAN_ATTR_MASK | PVC_EG_TAG_MASK, 894 + VLAN_ATTR(MT7530_VLAN_USER) | 895 + PVC_EG_TAG(MT7530_VLAN_EG_DISABLED)); 823 896 } 824 897 825 898 static void ··· 1232 1303 dn = dsa_to_port(ds, MT7530_CPU_PORT)->master->dev.of_node->parent; 1233 1304 1234 1305 if (priv->id == ID_MT7530) { 1235 - priv->ethernet = syscon_node_to_regmap(dn); 1236 - if (IS_ERR(priv->ethernet)) 1237 - return PTR_ERR(priv->ethernet); 1238 - 1239 1306 regulator_set_voltage(priv->core_pwr, 1000000, 1000000); 1240 1307 ret = regulator_enable(priv->core_pwr); 1241 1308 if (ret < 0) { ··· 1305 1380 mt7530_cpu_port_enable(priv, i); 1306 1381 else 1307 1382 mt7530_port_disable(ds, i); 1383 + 1384 + /* Enable consistent egress tag */ 1385 + mt7530_rmw(priv, MT7530_PVC_P(i), PVC_EG_TAG_MASK, 1386 + PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT)); 1308 1387 } 1309 1388 1310 1389 /* Setup port 5 */ ··· 1396 1467 1397 1468 /* Setup TX circuit incluing relevant PAD and driving */ 1398 1469 mt7530_pad_clk_setup(ds, state->interface); 1399 - 1400 - if (priv->id == ID_MT7530) { 1401 - /* Setup RX circuit, relevant PAD and driving on the 1402 - * host which must be placed after the setup on the 1403 - * device side is all finished. 1404 - */ 1405 - mt7623_pad_clk_setup(ds); 1406 - } 1407 1470 1408 1471 priv->p6_interface = state->interface; 1409 1472 break;
+7 -10
drivers/net/dsa/mt7530.h
··· 172 172 /* Register for port vlan control */ 173 173 #define MT7530_PVC_P(x) (0x2010 + ((x) * 0x100)) 174 174 #define PORT_SPEC_TAG BIT(5) 175 + #define PVC_EG_TAG(x) (((x) & 0x7) << 8) 176 + #define PVC_EG_TAG_MASK PVC_EG_TAG(7) 175 177 #define VLAN_ATTR(x) (((x) & 0x3) << 6) 176 178 #define VLAN_ATTR_MASK VLAN_ATTR(3) 179 + 180 + enum mt7530_vlan_port_eg_tag { 181 + MT7530_VLAN_EG_DISABLED = 0, 182 + MT7530_VLAN_EG_CONSISTENT = 1, 183 + }; 177 184 178 185 enum mt7530_vlan_port_attr { 179 186 MT7530_VLAN_USER = 0, ··· 284 277 285 278 /* Registers for TRGMII on the both side */ 286 279 #define MT7530_TRGMII_RCK_CTRL 0x7a00 287 - #define GSW_TRGMII_RCK_CTRL 0x300 288 280 #define RX_RST BIT(31) 289 281 #define RXC_DQSISEL BIT(30) 290 282 #define DQSI1_TAP_MASK (0x7f << 8) ··· 292 286 #define DQSI0_TAP(x) ((x) & 0x7f) 293 287 294 288 #define MT7530_TRGMII_RCK_RTT 0x7a04 295 - #define GSW_TRGMII_RCK_RTT 0x304 296 289 #define DQS1_GATE BIT(31) 297 290 #define DQS0_GATE BIT(30) 298 291 299 292 #define MT7530_TRGMII_RD(x) (0x7a10 + (x) * 8) 300 - #define GSW_TRGMII_RD(x) (0x310 + (x) * 8) 301 293 #define BSLIP_EN BIT(31) 302 294 #define EDGE_CHK BIT(30) 303 295 #define RD_TAP_MASK 0x7f 304 296 #define RD_TAP(x) ((x) & 0x7f) 305 297 306 - #define GSW_TRGMII_TXCTRL 0x340 307 298 #define MT7530_TRGMII_TXCTRL 0x7a40 308 299 #define TRAIN_TXEN BIT(31) 309 300 #define TXC_INV BIT(30) 310 301 #define TX_RST BIT(28) 311 302 312 303 #define MT7530_TRGMII_TD_ODT(i) (0x7a54 + 8 * (i)) 313 - #define GSW_TRGMII_TD_ODT(i) (0x354 + 8 * (i)) 314 304 #define TD_DM_DRVP(x) ((x) & 0xf) 315 305 #define TD_DM_DRVN(x) (((x) & 0xf) << 4) 316 - 317 - #define GSW_INTF_MODE 0x390 318 - #define INTF_MODE_TRGMII BIT(1) 319 306 320 307 #define MT7530_TRGMII_TCK_CTRL 0x7a78 321 308 #define TCK_TAP(x) (((x) & 0xf) << 8) ··· 442 443 * @ds: The pointer to the dsa core structure 443 444 * @bus: The bus used for the device and built-in PHY 444 445 * @rstc: The pointer to reset control used by MCM 445 - * @ethernet: The regmap used for access TRGMII-based registers 446 446 * @core_pwr: The power supplied into the core 447 447 * @io_pwr: The power supplied into the I/O 448 448 * @reset: The descriptor for GPIO line tied to its reset pin ··· 458 460 struct dsa_switch *ds; 459 461 struct mii_bus *bus; 460 462 struct reset_control *rstc; 461 - struct regmap *ethernet; 462 463 struct regulator *core_pwr; 463 464 struct regulator *io_pwr; 464 465 struct gpio_desc *reset;
+3 -2
drivers/net/dsa/mv88e6xxx/chip.c
··· 709 709 ops = chip->info->ops; 710 710 711 711 mv88e6xxx_reg_lock(chip); 712 - if (!mv88e6xxx_port_ppu_updates(chip, port) && ops->port_set_link) 712 + if ((!mv88e6xxx_port_ppu_updates(chip, port) || 713 + mode == MLO_AN_FIXED) && ops->port_set_link) 713 714 err = ops->port_set_link(chip, port, LINK_FORCED_DOWN); 714 715 mv88e6xxx_reg_unlock(chip); 715 716 ··· 732 731 ops = chip->info->ops; 733 732 734 733 mv88e6xxx_reg_lock(chip); 735 - if (!mv88e6xxx_port_ppu_updates(chip, port)) { 734 + if (!mv88e6xxx_port_ppu_updates(chip, port) || mode == MLO_AN_FIXED) { 736 735 /* FIXME: for an automedia port, should we force the link 737 736 * down here - what if the link comes up due to "other" media 738 737 * while we're bringing the port up, how is the exclusivity
+1 -4
drivers/net/dsa/ocelot/felix.c
··· 46 46 const unsigned char *addr, u16 vid) 47 47 { 48 48 struct ocelot *ocelot = ds->priv; 49 - bool vlan_aware; 50 49 51 - vlan_aware = dsa_port_is_vlan_filtering(dsa_to_port(ds, port)); 52 - 53 - return ocelot_fdb_add(ocelot, port, addr, vid, vlan_aware); 50 + return ocelot_fdb_add(ocelot, port, addr, vid); 54 51 } 55 52 56 53 static int felix_fdb_del(struct dsa_switch *ds, int port,
+1 -1
drivers/net/ethernet/amd/xgbe/xgbe-drv.c
··· 514 514 xgbe_disable_rx_tx_ints(pdata); 515 515 516 516 /* Turn on polling */ 517 - __napi_schedule_irqoff(&pdata->napi); 517 + __napi_schedule(&pdata->napi); 518 518 } 519 519 } else { 520 520 /* Don't clear Rx/Tx status if doing per channel DMA
+1 -1
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
··· 3742 3742 FW_PARAMS_PARAM_Z_V(FW_PARAMS_PARAM_DEV_PHYFW_VERSION)); 3743 3743 ret = t4_query_params(adap, adap->mbox, adap->pf, 0, 1, 3744 3744 &param, &val); 3745 - if (ret < 0) 3745 + if (ret) 3746 3746 return ret; 3747 3747 *phy_fw_ver = val; 3748 3748 return 0;
+1 -1
drivers/net/ethernet/dec/tulip/tulip_core.c
··· 1277 1277 #endif 1278 1278 }; 1279 1279 1280 - const struct pci_device_id early_486_chipsets[] = { 1280 + static const struct pci_device_id early_486_chipsets[] = { 1281 1281 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82424) }, 1282 1282 { PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_496) }, 1283 1283 { },
+7
drivers/net/ethernet/freescale/fec.h
··· 488 488 struct sk_buff *rx_skbuff[RX_RING_SIZE]; 489 489 }; 490 490 491 + struct fec_stop_mode_gpr { 492 + struct regmap *gpr; 493 + u8 reg; 494 + u8 bit; 495 + }; 496 + 491 497 /* The FEC buffer descriptors track the ring buffers. The rx_bd_base and 492 498 * tx_bd_base always point to the base of the buffer descriptors. The 493 499 * cur_rx and cur_tx point to the currently available buffer. ··· 568 562 int hwts_tx_en; 569 563 struct delayed_work time_keep; 570 564 struct regulator *reg_phy; 565 + struct fec_stop_mode_gpr stop_gpr; 571 566 572 567 unsigned int tx_align; 573 568 unsigned int rx_align;
+120 -29
drivers/net/ethernet/freescale/fec_main.c
··· 62 62 #include <linux/if_vlan.h> 63 63 #include <linux/pinctrl/consumer.h> 64 64 #include <linux/prefetch.h> 65 + #include <linux/mfd/syscon.h> 66 + #include <linux/regmap.h> 65 67 #include <soc/imx/cpuidle.h> 66 68 67 69 #include <asm/cacheflush.h> ··· 86 84 #define FEC_ENET_OPD_V 0xFFF0 87 85 #define FEC_MDIO_PM_TIMEOUT 100 /* ms */ 88 86 87 + struct fec_devinfo { 88 + u32 quirks; 89 + u8 stop_gpr_reg; 90 + u8 stop_gpr_bit; 91 + }; 92 + 93 + static const struct fec_devinfo fec_imx25_info = { 94 + .quirks = FEC_QUIRK_USE_GASKET | FEC_QUIRK_MIB_CLEAR | 95 + FEC_QUIRK_HAS_FRREG, 96 + }; 97 + 98 + static const struct fec_devinfo fec_imx27_info = { 99 + .quirks = FEC_QUIRK_MIB_CLEAR | FEC_QUIRK_HAS_FRREG, 100 + }; 101 + 102 + static const struct fec_devinfo fec_imx28_info = { 103 + .quirks = FEC_QUIRK_ENET_MAC | FEC_QUIRK_SWAP_FRAME | 104 + FEC_QUIRK_SINGLE_MDIO | FEC_QUIRK_HAS_RACC | 105 + FEC_QUIRK_HAS_FRREG, 106 + }; 107 + 108 + static const struct fec_devinfo fec_imx6q_info = { 109 + .quirks = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT | 110 + FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM | 111 + FEC_QUIRK_HAS_VLAN | FEC_QUIRK_ERR006358 | 112 + FEC_QUIRK_HAS_RACC, 113 + .stop_gpr_reg = 0x34, 114 + .stop_gpr_bit = 27, 115 + }; 116 + 117 + static const struct fec_devinfo fec_mvf600_info = { 118 + .quirks = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_RACC, 119 + }; 120 + 121 + static const struct fec_devinfo fec_imx6x_info = { 122 + .quirks = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT | 123 + FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM | 124 + FEC_QUIRK_HAS_VLAN | FEC_QUIRK_HAS_AVB | 125 + FEC_QUIRK_ERR007885 | FEC_QUIRK_BUG_CAPTURE | 126 + FEC_QUIRK_HAS_RACC | FEC_QUIRK_HAS_COALESCE, 127 + }; 128 + 129 + static const struct fec_devinfo fec_imx6ul_info = { 130 + .quirks = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT | 131 + FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM | 132 + FEC_QUIRK_HAS_VLAN | FEC_QUIRK_ERR007885 | 133 + FEC_QUIRK_BUG_CAPTURE | FEC_QUIRK_HAS_RACC | 134 + FEC_QUIRK_HAS_COALESCE, 135 + }; 136 + 89 137 static struct platform_device_id fec_devtype[] = { 90 138 { 91 139 /* keep it for coldfire */ ··· 143 91 .driver_data = 0, 144 92 }, { 145 93 .name = "imx25-fec", 146 - .driver_data = FEC_QUIRK_USE_GASKET | FEC_QUIRK_MIB_CLEAR | 147 - FEC_QUIRK_HAS_FRREG, 94 + .driver_data = (kernel_ulong_t)&fec_imx25_info, 148 95 }, { 149 96 .name = "imx27-fec", 150 - .driver_data = FEC_QUIRK_MIB_CLEAR | FEC_QUIRK_HAS_FRREG, 97 + .driver_data = (kernel_ulong_t)&fec_imx27_info, 151 98 }, { 152 99 .name = "imx28-fec", 153 - .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_SWAP_FRAME | 154 - FEC_QUIRK_SINGLE_MDIO | FEC_QUIRK_HAS_RACC | 155 - FEC_QUIRK_HAS_FRREG, 100 + .driver_data = (kernel_ulong_t)&fec_imx28_info, 156 101 }, { 157 102 .name = "imx6q-fec", 158 - .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT | 159 - FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM | 160 - FEC_QUIRK_HAS_VLAN | FEC_QUIRK_ERR006358 | 161 - FEC_QUIRK_HAS_RACC, 103 + .driver_data = (kernel_ulong_t)&fec_imx6q_info, 162 104 }, { 163 105 .name = "mvf600-fec", 164 - .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_RACC, 106 + .driver_data = (kernel_ulong_t)&fec_mvf600_info, 165 107 }, { 166 108 .name = "imx6sx-fec", 167 - .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT | 168 - FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM | 169 - FEC_QUIRK_HAS_VLAN | FEC_QUIRK_HAS_AVB | 170 - FEC_QUIRK_ERR007885 | FEC_QUIRK_BUG_CAPTURE | 171 - FEC_QUIRK_HAS_RACC | FEC_QUIRK_HAS_COALESCE, 109 + .driver_data = (kernel_ulong_t)&fec_imx6x_info, 172 110 }, { 173 111 .name = "imx6ul-fec", 174 - .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT | 175 - FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM | 176 - FEC_QUIRK_HAS_VLAN | FEC_QUIRK_ERR007885 | 177 - FEC_QUIRK_BUG_CAPTURE | FEC_QUIRK_HAS_RACC | 178 - FEC_QUIRK_HAS_COALESCE, 112 + .driver_data = (kernel_ulong_t)&fec_imx6ul_info, 179 113 }, { 180 114 /* sentinel */ 181 115 } ··· 1130 1092 1131 1093 } 1132 1094 1095 + static void fec_enet_stop_mode(struct fec_enet_private *fep, bool enabled) 1096 + { 1097 + struct fec_platform_data *pdata = fep->pdev->dev.platform_data; 1098 + struct fec_stop_mode_gpr *stop_gpr = &fep->stop_gpr; 1099 + 1100 + if (stop_gpr->gpr) { 1101 + if (enabled) 1102 + regmap_update_bits(stop_gpr->gpr, stop_gpr->reg, 1103 + BIT(stop_gpr->bit), 1104 + BIT(stop_gpr->bit)); 1105 + else 1106 + regmap_update_bits(stop_gpr->gpr, stop_gpr->reg, 1107 + BIT(stop_gpr->bit), 0); 1108 + } else if (pdata && pdata->sleep_mode_enable) { 1109 + pdata->sleep_mode_enable(enabled); 1110 + } 1111 + } 1112 + 1133 1113 static void 1134 1114 fec_stop(struct net_device *ndev) 1135 1115 { 1136 1116 struct fec_enet_private *fep = netdev_priv(ndev); 1137 - struct fec_platform_data *pdata = fep->pdev->dev.platform_data; 1138 1117 u32 rmii_mode = readl(fep->hwp + FEC_R_CNTRL) & (1 << 8); 1139 1118 u32 val; 1140 1119 ··· 1180 1125 val = readl(fep->hwp + FEC_ECNTRL); 1181 1126 val |= (FEC_ECR_MAGICEN | FEC_ECR_SLEEP); 1182 1127 writel(val, fep->hwp + FEC_ECNTRL); 1183 - 1184 - if (pdata && pdata->sleep_mode_enable) 1185 - pdata->sleep_mode_enable(true); 1128 + fec_enet_stop_mode(fep, true); 1186 1129 } 1187 1130 writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED); 1188 1131 ··· 3451 3398 return irq_cnt; 3452 3399 } 3453 3400 3401 + static int fec_enet_init_stop_mode(struct fec_enet_private *fep, 3402 + struct fec_devinfo *dev_info, 3403 + struct device_node *np) 3404 + { 3405 + struct device_node *gpr_np; 3406 + int ret = 0; 3407 + 3408 + if (!dev_info) 3409 + return 0; 3410 + 3411 + gpr_np = of_parse_phandle(np, "gpr", 0); 3412 + if (!gpr_np) 3413 + return 0; 3414 + 3415 + fep->stop_gpr.gpr = syscon_node_to_regmap(gpr_np); 3416 + if (IS_ERR(fep->stop_gpr.gpr)) { 3417 + dev_err(&fep->pdev->dev, "could not find gpr regmap\n"); 3418 + ret = PTR_ERR(fep->stop_gpr.gpr); 3419 + fep->stop_gpr.gpr = NULL; 3420 + goto out; 3421 + } 3422 + 3423 + fep->stop_gpr.reg = dev_info->stop_gpr_reg; 3424 + fep->stop_gpr.bit = dev_info->stop_gpr_bit; 3425 + 3426 + out: 3427 + of_node_put(gpr_np); 3428 + 3429 + return ret; 3430 + } 3431 + 3454 3432 static int 3455 3433 fec_probe(struct platform_device *pdev) 3456 3434 { ··· 3497 3413 int num_rx_qs; 3498 3414 char irq_name[8]; 3499 3415 int irq_cnt; 3416 + struct fec_devinfo *dev_info; 3500 3417 3501 3418 fec_enet_get_queue_num(pdev, &num_tx_qs, &num_rx_qs); 3502 3419 ··· 3515 3430 of_id = of_match_device(fec_dt_ids, &pdev->dev); 3516 3431 if (of_id) 3517 3432 pdev->id_entry = of_id->data; 3518 - fep->quirks = pdev->id_entry->driver_data; 3433 + dev_info = (struct fec_devinfo *)pdev->id_entry->driver_data; 3434 + if (dev_info) 3435 + fep->quirks = dev_info->quirks; 3519 3436 3520 3437 fep->netdev = ndev; 3521 3438 fep->num_rx_queues = num_rx_qs; ··· 3550 3463 3551 3464 if (of_get_property(np, "fsl,magic-packet", NULL)) 3552 3465 fep->wol_flag |= FEC_WOL_HAS_MAGIC_PACKET; 3466 + 3467 + ret = fec_enet_init_stop_mode(fep, dev_info, np); 3468 + if (ret) 3469 + goto failed_stop_mode; 3553 3470 3554 3471 phy_node = of_parse_phandle(np, "phy-handle", 0); 3555 3472 if (!phy_node && of_phy_is_fixed_link(np)) { ··· 3723 3632 if (of_phy_is_fixed_link(np)) 3724 3633 of_phy_deregister_fixed_link(np); 3725 3634 of_node_put(phy_node); 3635 + failed_stop_mode: 3726 3636 failed_phy: 3727 3637 dev_id--; 3728 3638 failed_ioremap: ··· 3801 3709 { 3802 3710 struct net_device *ndev = dev_get_drvdata(dev); 3803 3711 struct fec_enet_private *fep = netdev_priv(ndev); 3804 - struct fec_platform_data *pdata = fep->pdev->dev.platform_data; 3805 3712 int ret; 3806 3713 int val; 3807 3714 ··· 3818 3727 goto failed_clk; 3819 3728 } 3820 3729 if (fep->wol_flag & FEC_WOL_FLAG_ENABLE) { 3821 - if (pdata && pdata->sleep_mode_enable) 3822 - pdata->sleep_mode_enable(false); 3730 + fec_enet_stop_mode(fep, false); 3731 + 3823 3732 val = readl(fep->hwp + FEC_ECNTRL); 3824 3733 val &= ~(FEC_ECR_MAGICEN | FEC_ECR_SLEEP); 3825 3734 writel(val, fep->hwp + FEC_ECNTRL);
+1 -1
drivers/net/ethernet/marvell/mvneta.c
··· 5383 5383 { 5384 5384 int ret; 5385 5385 5386 - ret = cpuhp_setup_state_multi(CPUHP_AP_ONLINE_DYN, "net/mvmeta:online", 5386 + ret = cpuhp_setup_state_multi(CPUHP_AP_ONLINE_DYN, "net/mvneta:online", 5387 5387 mvneta_cpu_online, 5388 5388 mvneta_cpu_down_prepare); 5389 5389 if (ret < 0)
+23 -1
drivers/net/ethernet/mediatek/mtk_eth_soc.c
··· 65 65 return __raw_readl(eth->base + reg); 66 66 } 67 67 68 + u32 mtk_m32(struct mtk_eth *eth, u32 mask, u32 set, unsigned reg) 69 + { 70 + u32 val; 71 + 72 + val = mtk_r32(eth, reg); 73 + val &= ~mask; 74 + val |= set; 75 + mtk_w32(eth, val, reg); 76 + return reg; 77 + } 78 + 68 79 static int mtk_mdio_busy_wait(struct mtk_eth *eth) 69 80 { 70 81 unsigned long t_start = jiffies; ··· 204 193 struct mtk_mac *mac = container_of(config, struct mtk_mac, 205 194 phylink_config); 206 195 struct mtk_eth *eth = mac->hw; 207 - u32 mcr_cur, mcr_new, sid; 196 + u32 mcr_cur, mcr_new, sid, i; 208 197 int val, ge_mode, err; 209 198 210 199 /* MT76x8 has no hardware settings between for the MAC */ ··· 266 255 PHY_INTERFACE_MODE_TRGMII) 267 256 mtk_gmac0_rgmii_adjust(mac->hw, 268 257 state->speed); 258 + 259 + /* mt7623_pad_clk_setup */ 260 + for (i = 0 ; i < NUM_TRGMII_CTRL; i++) 261 + mtk_w32(mac->hw, 262 + TD_DM_DRVP(8) | TD_DM_DRVN(8), 263 + TRGMII_TD_ODT(i)); 264 + 265 + /* Assert/release MT7623 RXC reset */ 266 + mtk_m32(mac->hw, 0, RXC_RST | RXC_DQSISEL, 267 + TRGMII_RCK_CTRL); 268 + mtk_m32(mac->hw, RXC_RST, 0, TRGMII_RCK_CTRL); 269 269 } 270 270 } 271 271
+8
drivers/net/ethernet/mediatek/mtk_eth_soc.h
··· 352 352 #define DQSI0(x) ((x << 0) & GENMASK(6, 0)) 353 353 #define DQSI1(x) ((x << 8) & GENMASK(14, 8)) 354 354 #define RXCTL_DMWTLAT(x) ((x << 16) & GENMASK(18, 16)) 355 + #define RXC_RST BIT(31) 355 356 #define RXC_DQSISEL BIT(30) 356 357 #define RCK_CTRL_RGMII_1000 (RXC_DQSISEL | RXCTL_DMWTLAT(2) | DQSI1(16)) 357 358 #define RCK_CTRL_RGMII_10_100 RXCTL_DMWTLAT(2) 359 + 360 + #define NUM_TRGMII_CTRL 5 358 361 359 362 /* TRGMII RXC control register */ 360 363 #define TRGMII_TCK_CTRL 0x10340 ··· 365 362 #define TXC_INV BIT(30) 366 363 #define TCK_CTRL_RGMII_1000 TXCTL_DMWTLAT(2) 367 364 #define TCK_CTRL_RGMII_10_100 (TXC_INV | TXCTL_DMWTLAT(2)) 365 + 366 + /* TRGMII TX Drive Strength */ 367 + #define TRGMII_TD_ODT(i) (0x10354 + 8 * (i)) 368 + #define TD_DM_DRVP(x) ((x) & 0xf) 369 + #define TD_DM_DRVN(x) (((x) & 0xf) << 4) 368 370 369 371 /* TRGMII Interface mode register */ 370 372 #define INTF_MODE 0x10390
+4 -1
drivers/net/ethernet/mellanox/mlx5/core/devlink.c
··· 23 23 if (err) 24 24 return err; 25 25 26 - return mlx5_firmware_flash(dev, fw, extack); 26 + err = mlx5_firmware_flash(dev, fw, extack); 27 + release_firmware(fw); 28 + 29 + return err; 27 30 } 28 31 29 32 static u8 mlx5_fw_ver_major(u32 version)
+7 -12
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c
··· 67 67 struct nf_flowtable *nf_ft; 68 68 struct mlx5_tc_ct_priv *ct_priv; 69 69 struct rhashtable ct_entries_ht; 70 - struct list_head ct_entries_list; 71 70 }; 72 71 73 72 struct mlx5_ct_entry { 74 - struct list_head list; 75 73 u16 zone; 76 74 struct rhash_head node; 77 75 struct flow_rule *flow_rule; ··· 615 617 if (err) 616 618 goto err_insert; 617 619 618 - list_add(&entry->list, &ft->ct_entries_list); 619 - 620 620 return 0; 621 621 622 622 err_insert: ··· 642 646 WARN_ON(rhashtable_remove_fast(&ft->ct_entries_ht, 643 647 &entry->node, 644 648 cts_ht_params)); 645 - list_del(&entry->list); 646 649 kfree(entry); 647 650 648 651 return 0; ··· 813 818 ft->zone = zone; 814 819 ft->nf_ft = nf_ft; 815 820 ft->ct_priv = ct_priv; 816 - INIT_LIST_HEAD(&ft->ct_entries_list); 817 821 refcount_set(&ft->refcount, 1); 818 822 819 823 err = rhashtable_init(&ft->ct_entries_ht, &cts_ht_params); ··· 841 847 } 842 848 843 849 static void 844 - mlx5_tc_ct_flush_ft(struct mlx5_tc_ct_priv *ct_priv, struct mlx5_ct_ft *ft) 850 + mlx5_tc_ct_flush_ft_entry(void *ptr, void *arg) 845 851 { 846 - struct mlx5_ct_entry *entry; 852 + struct mlx5_tc_ct_priv *ct_priv = arg; 853 + struct mlx5_ct_entry *entry = ptr; 847 854 848 - list_for_each_entry(entry, &ft->ct_entries_list, list) 849 - mlx5_tc_ct_entry_del_rules(ft->ct_priv, entry); 855 + mlx5_tc_ct_entry_del_rules(ct_priv, entry); 850 856 } 851 857 852 858 static void ··· 857 863 858 864 nf_flow_table_offload_del_cb(ft->nf_ft, 859 865 mlx5_tc_ct_block_flow_offload, ft); 860 - mlx5_tc_ct_flush_ft(ct_priv, ft); 861 866 rhashtable_remove_fast(&ct_priv->zone_ht, &ft->node, zone_params); 862 - rhashtable_destroy(&ft->ct_entries_ht); 867 + rhashtable_free_and_destroy(&ft->ct_entries_ht, 868 + mlx5_tc_ct_flush_ft_entry, 869 + ct_priv); 863 870 kfree(ft); 864 871 } 865 872
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
··· 5526 5526 #ifdef CONFIG_MLX5_CORE_EN_DCB 5527 5527 mlx5e_dcbnl_delete_app(priv); 5528 5528 #endif 5529 - mlx5e_devlink_port_unregister(priv); 5530 5529 unregister_netdev(priv->netdev); 5530 + mlx5e_devlink_port_unregister(priv); 5531 5531 mlx5e_detach(mdev, vpriv); 5532 5532 mlx5e_destroy_netdev(priv); 5533 5533 }
+5 -4
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
··· 2050 2050 struct mlx5_eswitch_rep *rep = rpriv->rep; 2051 2051 struct netdev_phys_item_id ppid = {}; 2052 2052 unsigned int dl_port_index = 0; 2053 + u16 pfnum; 2053 2054 2054 2055 if (!is_devlink_port_supported(dev, rpriv)) 2055 2056 return 0; 2056 2057 2057 2058 mlx5e_rep_get_port_parent_id(rpriv->netdev, &ppid); 2059 + pfnum = PCI_FUNC(dev->pdev->devfn); 2058 2060 2059 2061 if (rep->vport == MLX5_VPORT_UPLINK) { 2060 2062 devlink_port_attrs_set(&rpriv->dl_port, 2061 2063 DEVLINK_PORT_FLAVOUR_PHYSICAL, 2062 - PCI_FUNC(dev->pdev->devfn), false, 0, 2064 + pfnum, false, 0, 2063 2065 &ppid.id[0], ppid.id_len); 2064 2066 dl_port_index = vport_to_devlink_port_index(dev, rep->vport); 2065 2067 } else if (rep->vport == MLX5_VPORT_PF) { 2066 2068 devlink_port_attrs_pci_pf_set(&rpriv->dl_port, 2067 2069 &ppid.id[0], ppid.id_len, 2068 - dev->pdev->devfn); 2070 + pfnum); 2069 2071 dl_port_index = rep->vport; 2070 2072 } else if (mlx5_eswitch_is_vf_vport(dev->priv.eswitch, 2071 2073 rpriv->rep->vport)) { 2072 2074 devlink_port_attrs_pci_vf_set(&rpriv->dl_port, 2073 2075 &ppid.id[0], ppid.id_len, 2074 - dev->pdev->devfn, 2075 - rep->vport - 1); 2076 + pfnum, rep->vport - 1); 2076 2077 dl_port_index = vport_to_devlink_port_index(dev, rep->vport); 2077 2078 } 2078 2079
+5 -3
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
··· 1343 1343 if (err) 1344 1344 return err; 1345 1345 1346 - if (attr->action & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR) { 1346 + if (attr->action & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR && 1347 + !(attr->ct_attr.ct_action & TCA_CT_ACT_CLEAR)) { 1347 1348 err = mlx5e_attach_mod_hdr(priv, flow, parse_attr); 1348 1349 dealloc_mod_hdr_actions(&parse_attr->mod_hdr_acts); 1349 1350 if (err) ··· 3559 3558 struct mlx5_esw_flow_attr *attr, 3560 3559 u32 *action) 3561 3560 { 3562 - int nest_level = attr->parse_attr->filter_dev->lower_level; 3563 3561 struct flow_action_entry vlan_act = { 3564 3562 .id = FLOW_ACTION_VLAN_POP, 3565 3563 }; 3566 - int err = 0; 3564 + int nest_level, err = 0; 3567 3565 3566 + nest_level = attr->parse_attr->filter_dev->lower_level - 3567 + priv->netdev->lower_level; 3568 3568 while (nest_level--) { 3569 3569 err = parse_tc_vlan_action(priv, &vlan_act, attr, action); 3570 3570 if (err)
-1
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
··· 403 403 MLX5_ESW_ATTR_FLAG_VLAN_HANDLED = BIT(0), 404 404 MLX5_ESW_ATTR_FLAG_SLOW_PATH = BIT(1), 405 405 MLX5_ESW_ATTR_FLAG_NO_IN_PORT = BIT(2), 406 - MLX5_ESW_ATTR_FLAG_HAIRPIN = BIT(3), 407 406 }; 408 407 409 408 struct mlx5_esw_flow_attr {
+3 -9
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
··· 300 300 bool split = !!(attr->split_count); 301 301 struct mlx5_flow_handle *rule; 302 302 struct mlx5_flow_table *fdb; 303 - bool hairpin = false; 304 303 int j, i = 0; 305 304 306 305 if (esw->mode != MLX5_ESWITCH_OFFLOADS) ··· 397 398 goto err_esw_get; 398 399 } 399 400 400 - if (mlx5_eswitch_termtbl_required(esw, attr, &flow_act, spec)) { 401 + if (mlx5_eswitch_termtbl_required(esw, attr, &flow_act, spec)) 401 402 rule = mlx5_eswitch_add_termtbl_rule(esw, fdb, spec, attr, 402 403 &flow_act, dest, i); 403 - hairpin = true; 404 - } else { 404 + else 405 405 rule = mlx5_add_flow_rules(fdb, spec, &flow_act, dest, i); 406 - } 407 406 if (IS_ERR(rule)) 408 407 goto err_add_rule; 409 408 else 410 409 atomic64_inc(&esw->offloads.num_flows); 411 - 412 - if (hairpin) 413 - attr->flags |= MLX5_ESW_ATTR_FLAG_HAIRPIN; 414 410 415 411 return rule; 416 412 ··· 495 501 496 502 mlx5_del_flow_rules(rule); 497 503 498 - if (attr->flags & MLX5_ESW_ATTR_FLAG_HAIRPIN) { 504 + if (!(attr->flags & MLX5_ESW_ATTR_FLAG_SLOW_PATH)) { 499 505 /* unref the term table */ 500 506 for (i = 0; i < MLX5_MAX_FLOW_FWD_VPORTS; i++) { 501 507 if (attr->dests[i].termtbl)
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/health.c
··· 243 243 if (mlx5_get_nic_state(dev) == MLX5_NIC_IFC_DISABLED) 244 244 break; 245 245 246 - cond_resched(); 246 + msleep(20); 247 247 } while (!time_after(jiffies, end)); 248 248 249 249 if (mlx5_get_nic_state(dev) != MLX5_NIC_IFC_DISABLED) {
+56 -54
drivers/net/ethernet/mscc/ocelot.c
··· 183 183 ocelot_write(ocelot, val, ANA_VLANMASK); 184 184 } 185 185 186 - void ocelot_port_vlan_filtering(struct ocelot *ocelot, int port, 187 - bool vlan_aware) 188 - { 189 - struct ocelot_port *ocelot_port = ocelot->ports[port]; 190 - u32 val; 191 - 192 - if (vlan_aware) 193 - val = ANA_PORT_VLAN_CFG_VLAN_AWARE_ENA | 194 - ANA_PORT_VLAN_CFG_VLAN_POP_CNT(1); 195 - else 196 - val = 0; 197 - ocelot_rmw_gix(ocelot, val, 198 - ANA_PORT_VLAN_CFG_VLAN_AWARE_ENA | 199 - ANA_PORT_VLAN_CFG_VLAN_POP_CNT_M, 200 - ANA_PORT_VLAN_CFG, port); 201 - 202 - if (vlan_aware && !ocelot_port->vid) 203 - /* If port is vlan-aware and tagged, drop untagged and priority 204 - * tagged frames. 205 - */ 206 - val = ANA_PORT_DROP_CFG_DROP_UNTAGGED_ENA | 207 - ANA_PORT_DROP_CFG_DROP_PRIO_S_TAGGED_ENA | 208 - ANA_PORT_DROP_CFG_DROP_PRIO_C_TAGGED_ENA; 209 - else 210 - val = 0; 211 - ocelot_rmw_gix(ocelot, val, 212 - ANA_PORT_DROP_CFG_DROP_UNTAGGED_ENA | 213 - ANA_PORT_DROP_CFG_DROP_PRIO_S_TAGGED_ENA | 214 - ANA_PORT_DROP_CFG_DROP_PRIO_C_TAGGED_ENA, 215 - ANA_PORT_DROP_CFG, port); 216 - 217 - if (vlan_aware) { 218 - if (ocelot_port->vid) 219 - /* Tag all frames except when VID == DEFAULT_VLAN */ 220 - val |= REW_TAG_CFG_TAG_CFG(1); 221 - else 222 - /* Tag all frames */ 223 - val |= REW_TAG_CFG_TAG_CFG(3); 224 - } else { 225 - /* Port tagging disabled. */ 226 - val = REW_TAG_CFG_TAG_CFG(0); 227 - } 228 - ocelot_rmw_gix(ocelot, val, 229 - REW_TAG_CFG_TAG_CFG_M, 230 - REW_TAG_CFG, port); 231 - } 232 - EXPORT_SYMBOL(ocelot_port_vlan_filtering); 233 - 234 186 static int ocelot_port_set_native_vlan(struct ocelot *ocelot, int port, 235 187 u16 vid) 236 188 { 237 189 struct ocelot_port *ocelot_port = ocelot->ports[port]; 190 + u32 val = 0; 238 191 239 192 if (ocelot_port->vid != vid) { 240 193 /* Always permit deleting the native VLAN (vid = 0) */ ··· 204 251 REW_PORT_VLAN_CFG_PORT_VID_M, 205 252 REW_PORT_VLAN_CFG, port); 206 253 254 + if (ocelot_port->vlan_aware && !ocelot_port->vid) 255 + /* If port is vlan-aware and tagged, drop untagged and priority 256 + * tagged frames. 257 + */ 258 + val = ANA_PORT_DROP_CFG_DROP_UNTAGGED_ENA | 259 + ANA_PORT_DROP_CFG_DROP_PRIO_S_TAGGED_ENA | 260 + ANA_PORT_DROP_CFG_DROP_PRIO_C_TAGGED_ENA; 261 + ocelot_rmw_gix(ocelot, val, 262 + ANA_PORT_DROP_CFG_DROP_UNTAGGED_ENA | 263 + ANA_PORT_DROP_CFG_DROP_PRIO_S_TAGGED_ENA | 264 + ANA_PORT_DROP_CFG_DROP_PRIO_C_TAGGED_ENA, 265 + ANA_PORT_DROP_CFG, port); 266 + 267 + if (ocelot_port->vlan_aware) { 268 + if (ocelot_port->vid) 269 + /* Tag all frames except when VID == DEFAULT_VLAN */ 270 + val = REW_TAG_CFG_TAG_CFG(1); 271 + else 272 + /* Tag all frames */ 273 + val = REW_TAG_CFG_TAG_CFG(3); 274 + } else { 275 + /* Port tagging disabled. */ 276 + val = REW_TAG_CFG_TAG_CFG(0); 277 + } 278 + ocelot_rmw_gix(ocelot, val, 279 + REW_TAG_CFG_TAG_CFG_M, 280 + REW_TAG_CFG, port); 281 + 207 282 return 0; 208 283 } 284 + 285 + void ocelot_port_vlan_filtering(struct ocelot *ocelot, int port, 286 + bool vlan_aware) 287 + { 288 + struct ocelot_port *ocelot_port = ocelot->ports[port]; 289 + u32 val; 290 + 291 + ocelot_port->vlan_aware = vlan_aware; 292 + 293 + if (vlan_aware) 294 + val = ANA_PORT_VLAN_CFG_VLAN_AWARE_ENA | 295 + ANA_PORT_VLAN_CFG_VLAN_POP_CNT(1); 296 + else 297 + val = 0; 298 + ocelot_rmw_gix(ocelot, val, 299 + ANA_PORT_VLAN_CFG_VLAN_AWARE_ENA | 300 + ANA_PORT_VLAN_CFG_VLAN_POP_CNT_M, 301 + ANA_PORT_VLAN_CFG, port); 302 + 303 + ocelot_port_set_native_vlan(ocelot, port, ocelot_port->vid); 304 + } 305 + EXPORT_SYMBOL(ocelot_port_vlan_filtering); 209 306 210 307 /* Default vlan to clasify for untagged frames (may be zero) */ 211 308 static void ocelot_port_set_pvid(struct ocelot *ocelot, int port, u16 pvid) ··· 876 873 } 877 874 878 875 int ocelot_fdb_add(struct ocelot *ocelot, int port, 879 - const unsigned char *addr, u16 vid, bool vlan_aware) 876 + const unsigned char *addr, u16 vid) 880 877 { 881 878 struct ocelot_port *ocelot_port = ocelot->ports[port]; 882 879 883 880 if (!vid) { 884 - if (!vlan_aware) 881 + if (!ocelot_port->vlan_aware) 885 882 /* If the bridge is not VLAN aware and no VID was 886 883 * provided, set it to pvid to ensure the MAC entry 887 884 * matches incoming untagged packets ··· 908 905 struct ocelot *ocelot = priv->port.ocelot; 909 906 int port = priv->chip_port; 910 907 911 - return ocelot_fdb_add(ocelot, port, addr, vid, priv->vlan_aware); 908 + return ocelot_fdb_add(ocelot, port, addr, vid); 912 909 } 913 910 914 911 int ocelot_fdb_del(struct ocelot *ocelot, int port, ··· 1499 1496 ocelot_port_attr_ageing_set(ocelot, port, attr->u.ageing_time); 1500 1497 break; 1501 1498 case SWITCHDEV_ATTR_ID_BRIDGE_VLAN_FILTERING: 1502 - priv->vlan_aware = attr->u.vlan_filtering; 1503 - ocelot_port_vlan_filtering(ocelot, port, priv->vlan_aware); 1499 + ocelot_port_vlan_filtering(ocelot, port, 1500 + attr->u.vlan_filtering); 1504 1501 break; 1505 1502 case SWITCHDEV_ATTR_ID_BRIDGE_MC_DISABLED: 1506 1503 ocelot_port_attr_mc_set(ocelot, port, !attr->u.mc_disabled); ··· 1871 1868 } else { 1872 1869 err = ocelot_port_bridge_leave(ocelot, port, 1873 1870 info->upper_dev); 1874 - priv->vlan_aware = false; 1875 1871 } 1876 1872 } 1877 1873 if (netif_is_lag_master(info->upper_dev)) {
-2
drivers/net/ethernet/mscc/ocelot.h
··· 56 56 struct phy_device *phy; 57 57 u8 chip_port; 58 58 59 - u8 vlan_aware; 60 - 61 59 struct phy *serdes; 62 60 63 61 struct ocelot_port_tc tc;
+1 -1
drivers/net/ethernet/neterion/s2io.c
··· 5155 5155 /* read mac entries from CAM */ 5156 5156 static u64 do_s2io_read_unicast_mc(struct s2io_nic *sp, int offset) 5157 5157 { 5158 - u64 tmp64 = 0xffffffffffff0000ULL, val64; 5158 + u64 tmp64, val64; 5159 5159 struct XENA_dev_config __iomem *bar0 = sp->bar0; 5160 5160 5161 5161 /* read mac addr */
+27 -17
drivers/net/ethernet/pensando/ionic/ionic_lif.c
··· 2127 2127 if (lif->registered) 2128 2128 ionic_lif_set_netdev_info(lif); 2129 2129 2130 + ionic_rx_filter_replay(lif); 2131 + 2130 2132 if (netif_running(lif->netdev)) { 2131 2133 err = ionic_txrx_alloc(lif); 2132 2134 if (err) ··· 2208 2206 if (!test_bit(IONIC_LIF_F_FW_RESET, lif->state)) { 2209 2207 cancel_work_sync(&lif->deferred.work); 2210 2208 cancel_work_sync(&lif->tx_timeout_work); 2209 + ionic_rx_filters_deinit(lif); 2211 2210 } 2212 2211 2213 - ionic_rx_filters_deinit(lif); 2214 2212 if (lif->netdev->features & NETIF_F_RXHASH) 2215 2213 ionic_lif_rss_deinit(lif); 2216 2214 ··· 2341 2339 err = ionic_adminq_post_wait(lif, &ctx); 2342 2340 if (err) 2343 2341 return err; 2344 - 2342 + netdev_dbg(lif->netdev, "found initial MAC addr %pM\n", 2343 + ctx.comp.lif_getattr.mac); 2345 2344 if (is_zero_ether_addr(ctx.comp.lif_getattr.mac)) 2346 2345 return 0; 2347 2346 2348 - memcpy(addr.sa_data, ctx.comp.lif_getattr.mac, netdev->addr_len); 2349 - addr.sa_family = AF_INET; 2350 - err = eth_prepare_mac_addr_change(netdev, &addr); 2351 - if (err) { 2352 - netdev_warn(lif->netdev, "ignoring bad MAC addr from NIC %pM - err %d\n", 2353 - addr.sa_data, err); 2354 - return 0; 2347 + if (!ether_addr_equal(ctx.comp.lif_getattr.mac, netdev->dev_addr)) { 2348 + memcpy(addr.sa_data, ctx.comp.lif_getattr.mac, netdev->addr_len); 2349 + addr.sa_family = AF_INET; 2350 + err = eth_prepare_mac_addr_change(netdev, &addr); 2351 + if (err) { 2352 + netdev_warn(lif->netdev, "ignoring bad MAC addr from NIC %pM - err %d\n", 2353 + addr.sa_data, err); 2354 + return 0; 2355 + } 2356 + 2357 + if (!is_zero_ether_addr(netdev->dev_addr)) { 2358 + netdev_dbg(lif->netdev, "deleting station MAC addr %pM\n", 2359 + netdev->dev_addr); 2360 + ionic_lif_addr(lif, netdev->dev_addr, false); 2361 + } 2362 + 2363 + eth_commit_mac_addr_change(netdev, &addr); 2355 2364 } 2356 2365 2357 - netdev_dbg(lif->netdev, "deleting station MAC addr %pM\n", 2358 - netdev->dev_addr); 2359 - ionic_lif_addr(lif, netdev->dev_addr, false); 2360 - 2361 - eth_commit_mac_addr_change(netdev, &addr); 2362 2366 netdev_dbg(lif->netdev, "adding station MAC addr %pM\n", 2363 2367 netdev->dev_addr); 2364 2368 ionic_lif_addr(lif, netdev->dev_addr, true); ··· 2429 2421 if (err) 2430 2422 goto err_out_notifyq_deinit; 2431 2423 2432 - err = ionic_rx_filters_init(lif); 2433 - if (err) 2434 - goto err_out_notifyq_deinit; 2424 + if (!test_bit(IONIC_LIF_F_FW_RESET, lif->state)) { 2425 + err = ionic_rx_filters_init(lif); 2426 + if (err) 2427 + goto err_out_notifyq_deinit; 2428 + } 2435 2429 2436 2430 err = ionic_station_set(lif); 2437 2431 if (err)
+42 -9
drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c
··· 2 2 /* Copyright(c) 2017 - 2019 Pensando Systems, Inc */ 3 3 4 4 #include <linux/netdevice.h> 5 + #include <linux/dynamic_debug.h> 5 6 #include <linux/etherdevice.h> 6 7 7 8 #include "ionic.h" ··· 18 17 devm_kfree(dev, f); 19 18 } 20 19 21 - int ionic_rx_filter_del(struct ionic_lif *lif, struct ionic_rx_filter *f) 20 + void ionic_rx_filter_replay(struct ionic_lif *lif) 22 21 { 23 - struct ionic_admin_ctx ctx = { 24 - .work = COMPLETION_INITIALIZER_ONSTACK(ctx.work), 25 - .cmd.rx_filter_del = { 26 - .opcode = IONIC_CMD_RX_FILTER_DEL, 27 - .filter_id = cpu_to_le32(f->filter_id), 28 - }, 29 - }; 22 + struct ionic_rx_filter_add_cmd *ac; 23 + struct ionic_admin_ctx ctx; 24 + struct ionic_rx_filter *f; 25 + struct hlist_head *head; 26 + struct hlist_node *tmp; 27 + unsigned int i; 28 + int err; 30 29 31 - return ionic_adminq_post_wait(lif, &ctx); 30 + ac = &ctx.cmd.rx_filter_add; 31 + 32 + for (i = 0; i < IONIC_RX_FILTER_HLISTS; i++) { 33 + head = &lif->rx_filters.by_id[i]; 34 + hlist_for_each_entry_safe(f, tmp, head, by_id) { 35 + ctx.work = COMPLETION_INITIALIZER_ONSTACK(ctx.work); 36 + memcpy(ac, &f->cmd, sizeof(f->cmd)); 37 + dev_dbg(&lif->netdev->dev, "replay filter command:\n"); 38 + dynamic_hex_dump("cmd ", DUMP_PREFIX_OFFSET, 16, 1, 39 + &ctx.cmd, sizeof(ctx.cmd), true); 40 + 41 + err = ionic_adminq_post_wait(lif, &ctx); 42 + if (err) { 43 + switch (le16_to_cpu(ac->match)) { 44 + case IONIC_RX_FILTER_MATCH_VLAN: 45 + netdev_info(lif->netdev, "Replay failed - %d: vlan %d\n", 46 + err, 47 + le16_to_cpu(ac->vlan.vlan)); 48 + break; 49 + case IONIC_RX_FILTER_MATCH_MAC: 50 + netdev_info(lif->netdev, "Replay failed - %d: mac %pM\n", 51 + err, ac->mac.addr); 52 + break; 53 + case IONIC_RX_FILTER_MATCH_MAC_VLAN: 54 + netdev_info(lif->netdev, "Replay failed - %d: vlan %d mac %pM\n", 55 + err, 56 + le16_to_cpu(ac->vlan.vlan), 57 + ac->mac.addr); 58 + break; 59 + } 60 + } 61 + } 62 + } 32 63 } 33 64 34 65 int ionic_rx_filters_init(struct ionic_lif *lif)
+1 -1
drivers/net/ethernet/pensando/ionic/ionic_rx_filter.h
··· 24 24 }; 25 25 26 26 void ionic_rx_filter_free(struct ionic_lif *lif, struct ionic_rx_filter *f); 27 - int ionic_rx_filter_del(struct ionic_lif *lif, struct ionic_rx_filter *f); 27 + void ionic_rx_filter_replay(struct ionic_lif *lif); 28 28 int ionic_rx_filters_init(struct ionic_lif *lif); 29 29 void ionic_rx_filters_deinit(struct ionic_lif *lif); 30 30 int ionic_rx_filter_save(struct ionic_lif *lif, u32 flow_id, u16 rxq_index,
+2
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
··· 241 241 switch (phymode) { 242 242 case PHY_INTERFACE_MODE_RGMII: 243 243 case PHY_INTERFACE_MODE_RGMII_ID: 244 + case PHY_INTERFACE_MODE_RGMII_RXID: 245 + case PHY_INTERFACE_MODE_RGMII_TXID: 244 246 *val = SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_RGMII; 245 247 break; 246 248 case PHY_INTERFACE_MODE_MII:
+2
drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
··· 150 150 plat_dat->init = sun7i_gmac_init; 151 151 plat_dat->exit = sun7i_gmac_exit; 152 152 plat_dat->fix_mac_speed = sun7i_fix_speed; 153 + plat_dat->tx_fifo_size = 4096; 154 + plat_dat->rx_fifo_size = 16384; 153 155 154 156 ret = sun7i_gmac_init(pdev, plat_dat->bsp_priv); 155 157 if (ret)
+3 -3
drivers/net/ethernet/ti/am65-cpsw-nuss.c
··· 1372 1372 err: 1373 1373 i = devm_add_action(dev, am65_cpsw_nuss_free_tx_chns, common); 1374 1374 if (i) { 1375 - dev_err(dev, "failed to add free_tx_chns action %d", i); 1375 + dev_err(dev, "Failed to add free_tx_chns action %d\n", i); 1376 1376 return i; 1377 1377 } 1378 1378 ··· 1481 1481 err: 1482 1482 i = devm_add_action(dev, am65_cpsw_nuss_free_rx_chns, common); 1483 1483 if (i) { 1484 - dev_err(dev, "failed to add free_rx_chns action %d", i); 1484 + dev_err(dev, "Failed to add free_rx_chns action %d\n", i); 1485 1485 return i; 1486 1486 } 1487 1487 ··· 1691 1691 ret = devm_add_action_or_reset(dev, am65_cpsw_pcpu_stats_free, 1692 1692 ndev_priv->stats); 1693 1693 if (ret) { 1694 - dev_err(dev, "failed to add percpu stat free action %d", ret); 1694 + dev_err(dev, "Failed to add percpu stat free action %d\n", ret); 1695 1695 return ret; 1696 1696 } 1697 1697
+2 -3
drivers/net/ipa/ipa_modem.c
··· 297 297 298 298 ret = ipa_endpoint_modem_exception_reset_all(ipa); 299 299 if (ret) 300 - dev_err(dev, "error %d resetting exception endpoint", 301 - ret); 300 + dev_err(dev, "error %d resetting exception endpoint\n", ret); 302 301 303 302 ipa_endpoint_modem_pause_all(ipa, false); 304 303 305 304 ret = ipa_modem_stop(ipa); 306 305 if (ret) 307 - dev_err(dev, "error %d stopping modem", ret); 306 + dev_err(dev, "error %d stopping modem\n", ret); 308 307 309 308 /* Now prepare for the next modem boot */ 310 309 ret = ipa_mem_zero_modem(ipa);
+1 -1
drivers/net/macsec.c
··· 3809 3809 struct netlink_ext_ack *extack) 3810 3810 { 3811 3811 struct macsec_dev *macsec = macsec_priv(dev); 3812 - struct macsec_tx_sa tx_sc; 3812 + struct macsec_tx_sc tx_sc; 3813 3813 struct macsec_secy secy; 3814 3814 int ret; 3815 3815
+24 -22
drivers/net/phy/marvell.c
··· 1263 1263 int lpa; 1264 1264 int err; 1265 1265 1266 + if (!(status & MII_M1011_PHY_STATUS_RESOLVED)) { 1267 + phydev->link = 0; 1268 + return 0; 1269 + } 1270 + 1271 + if (status & MII_M1011_PHY_STATUS_FULLDUPLEX) 1272 + phydev->duplex = DUPLEX_FULL; 1273 + else 1274 + phydev->duplex = DUPLEX_HALF; 1275 + 1276 + switch (status & MII_M1011_PHY_STATUS_SPD_MASK) { 1277 + case MII_M1011_PHY_STATUS_1000: 1278 + phydev->speed = SPEED_1000; 1279 + break; 1280 + 1281 + case MII_M1011_PHY_STATUS_100: 1282 + phydev->speed = SPEED_100; 1283 + break; 1284 + 1285 + default: 1286 + phydev->speed = SPEED_10; 1287 + break; 1288 + } 1289 + 1266 1290 if (!fiber) { 1267 1291 err = genphy_read_lpa(phydev); 1268 1292 if (err < 0) ··· 1313 1289 phydev->asym_pause = 0; 1314 1290 } 1315 1291 } 1316 - } 1317 - 1318 - if (!(status & MII_M1011_PHY_STATUS_RESOLVED)) 1319 - return 0; 1320 - 1321 - if (status & MII_M1011_PHY_STATUS_FULLDUPLEX) 1322 - phydev->duplex = DUPLEX_FULL; 1323 - else 1324 - phydev->duplex = DUPLEX_HALF; 1325 - 1326 - switch (status & MII_M1011_PHY_STATUS_SPD_MASK) { 1327 - case MII_M1011_PHY_STATUS_1000: 1328 - phydev->speed = SPEED_1000; 1329 - break; 1330 - 1331 - case MII_M1011_PHY_STATUS_100: 1332 - phydev->speed = SPEED_100; 1333 - break; 1334 - 1335 - default: 1336 - phydev->speed = SPEED_10; 1337 - break; 1338 1292 } 1339 1293 1340 1294 return 0;
+33 -3
drivers/net/phy/marvell10g.c
··· 33 33 #define MV_PHY_ALASKA_NBT_QUIRK_REV (MARVELL_PHY_ID_88X3310 | 0xa) 34 34 35 35 enum { 36 + MV_PMA_FW_VER0 = 0xc011, 37 + MV_PMA_FW_VER1 = 0xc012, 36 38 MV_PMA_BOOT = 0xc050, 37 39 MV_PMA_BOOT_FATAL = BIT(0), 38 40 ··· 75 73 76 74 /* Vendor2 MMD registers */ 77 75 MV_V2_PORT_CTRL = 0xf001, 78 - MV_V2_PORT_CTRL_PWRDOWN = 0x0800, 76 + MV_V2_PORT_CTRL_SWRST = BIT(15), 77 + MV_V2_PORT_CTRL_PWRDOWN = BIT(11), 79 78 MV_V2_TEMP_CTRL = 0xf08a, 80 79 MV_V2_TEMP_CTRL_MASK = 0xc000, 81 80 MV_V2_TEMP_CTRL_SAMPLE = 0x0000, ··· 86 83 }; 87 84 88 85 struct mv3310_priv { 86 + u32 firmware_ver; 87 + 89 88 struct device *hwmon_dev; 90 89 char *hwmon_name; 91 90 }; ··· 240 235 241 236 static int mv3310_power_up(struct phy_device *phydev) 242 237 { 243 - return phy_clear_bits_mmd(phydev, MDIO_MMD_VEND2, MV_V2_PORT_CTRL, 244 - MV_V2_PORT_CTRL_PWRDOWN); 238 + struct mv3310_priv *priv = dev_get_drvdata(&phydev->mdio.dev); 239 + int ret; 240 + 241 + ret = phy_clear_bits_mmd(phydev, MDIO_MMD_VEND2, MV_V2_PORT_CTRL, 242 + MV_V2_PORT_CTRL_PWRDOWN); 243 + 244 + if (priv->firmware_ver < 0x00030000) 245 + return ret; 246 + 247 + return phy_set_bits_mmd(phydev, MDIO_MMD_VEND2, MV_V2_PORT_CTRL, 248 + MV_V2_PORT_CTRL_SWRST); 245 249 } 246 250 247 251 static int mv3310_reset(struct phy_device *phydev, u32 unit) ··· 368 354 return -ENOMEM; 369 355 370 356 dev_set_drvdata(&phydev->mdio.dev, priv); 357 + 358 + ret = phy_read_mmd(phydev, MDIO_MMD_PMAPMD, MV_PMA_FW_VER0); 359 + if (ret < 0) 360 + return ret; 361 + 362 + priv->firmware_ver = ret << 16; 363 + 364 + ret = phy_read_mmd(phydev, MDIO_MMD_PMAPMD, MV_PMA_FW_VER1); 365 + if (ret < 0) 366 + return ret; 367 + 368 + priv->firmware_ver |= ret; 369 + 370 + phydev_info(phydev, "Firmware version %u.%u.%u.%u\n", 371 + priv->firmware_ver >> 24, (priv->firmware_ver >> 16) & 255, 372 + (priv->firmware_ver >> 8) & 255, priv->firmware_ver & 255); 371 373 372 374 /* Powering down the port when not in use saves about 600mW */ 373 375 ret = mv3310_power_down(phydev);
+1 -1
drivers/net/phy/mdio_bus.c
··· 464 464 465 465 /** 466 466 * mdio_find_bus - Given the name of a mdiobus, find the mii_bus. 467 - * @mdio_bus_np: Pointer to the mii_bus. 467 + * @mdio_name: The name of a mdiobus. 468 468 * 469 469 * Returns a reference to the mii_bus, or NULL if none found. The 470 470 * embedded struct device will have its reference count incremented,
+1 -1
drivers/net/phy/micrel.c
··· 1204 1204 .driver_data = &ksz9021_type, 1205 1205 .probe = kszphy_probe, 1206 1206 .config_init = ksz9131_config_init, 1207 - .read_status = ksz9031_read_status, 1207 + .read_status = genphy_read_status, 1208 1208 .ack_interrupt = kszphy_ack_interrupt, 1209 1209 .config_intr = kszphy_config_intr, 1210 1210 .get_sset_count = kszphy_get_sset_count,
+2 -1
drivers/net/tun.c
··· 1888 1888 1889 1889 skb_reset_network_header(skb); 1890 1890 skb_probe_transport_header(skb); 1891 + skb_record_rx_queue(skb, tfile->queue_index); 1891 1892 1892 1893 if (skb_xdp) { 1893 1894 struct bpf_prog *xdp_prog; ··· 2460 2459 skb->protocol = eth_type_trans(skb, tun->dev); 2461 2460 skb_reset_network_header(skb); 2462 2461 skb_probe_transport_header(skb); 2462 + skb_record_rx_queue(skb, tfile->queue_index); 2463 2463 2464 2464 if (skb_xdp) { 2465 2465 err = do_xdp_generic(xdp_prog, skb); ··· 2472 2470 !tfile->detached) 2473 2471 rxhash = __skb_get_hash_symmetric(skb); 2474 2472 2475 - skb_record_rx_queue(skb, tfile->queue_index); 2476 2473 netif_receive_skb(skb); 2477 2474 2478 2475 /* No need for get_cpu_ptr() here since this function is
+2 -1
drivers/net/wireless/ath/ath11k/thermal.h
··· 36 36 return 0; 37 37 } 38 38 39 - static inline void ath11k_thermal_unregister(struct ath11k *ar) 39 + static inline void ath11k_thermal_unregister(struct ath11k_base *sc) 40 40 { 41 41 } 42 42 43 43 static inline int ath11k_thermal_set_throttling(struct ath11k *ar, u32 throttle_state) 44 44 { 45 + return 0; 45 46 } 46 47 47 48 static inline void ath11k_thermal_event_temperature(struct ath11k *ar,
+9
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
··· 729 729 return err; 730 730 } 731 731 732 + static netdev_tx_t brcmf_net_mon_start_xmit(struct sk_buff *skb, 733 + struct net_device *ndev) 734 + { 735 + dev_kfree_skb_any(skb); 736 + 737 + return NETDEV_TX_OK; 738 + } 739 + 732 740 static const struct net_device_ops brcmf_netdev_ops_mon = { 733 741 .ndo_open = brcmf_net_mon_open, 734 742 .ndo_stop = brcmf_net_mon_stop, 743 + .ndo_start_xmit = brcmf_net_mon_start_xmit, 735 744 }; 736 745 737 746 int brcmf_net_mon_attach(struct brcmf_if *ifp)
+6 -6
drivers/net/wireless/mac80211_hwsim.c
··· 3669 3669 } 3670 3670 3671 3671 if (info->attrs[HWSIM_ATTR_RADIO_NAME]) { 3672 - hwname = kasprintf(GFP_KERNEL, "%.*s", 3673 - nla_len(info->attrs[HWSIM_ATTR_RADIO_NAME]), 3674 - (char *)nla_data(info->attrs[HWSIM_ATTR_RADIO_NAME])); 3672 + hwname = kstrndup((char *)nla_data(info->attrs[HWSIM_ATTR_RADIO_NAME]), 3673 + nla_len(info->attrs[HWSIM_ATTR_RADIO_NAME]), 3674 + GFP_KERNEL); 3675 3675 if (!hwname) 3676 3676 return -ENOMEM; 3677 3677 param.hwname = hwname; ··· 3691 3691 if (info->attrs[HWSIM_ATTR_RADIO_ID]) { 3692 3692 idx = nla_get_u32(info->attrs[HWSIM_ATTR_RADIO_ID]); 3693 3693 } else if (info->attrs[HWSIM_ATTR_RADIO_NAME]) { 3694 - hwname = kasprintf(GFP_KERNEL, "%.*s", 3695 - nla_len(info->attrs[HWSIM_ATTR_RADIO_NAME]), 3696 - (char *)nla_data(info->attrs[HWSIM_ATTR_RADIO_NAME])); 3694 + hwname = kstrndup((char *)nla_data(info->attrs[HWSIM_ATTR_RADIO_NAME]), 3695 + nla_len(info->attrs[HWSIM_ATTR_RADIO_NAME]), 3696 + GFP_KERNEL); 3697 3697 if (!hwname) 3698 3698 return -ENOMEM; 3699 3699 } else
+3 -8
drivers/net/wireless/realtek/rtw88/pci.c
··· 1338 1338 rtw_pci_link_cfg(rtwdev); 1339 1339 } 1340 1340 1341 - #ifdef CONFIG_PM 1342 - static int rtw_pci_suspend(struct device *dev) 1341 + static int __maybe_unused rtw_pci_suspend(struct device *dev) 1343 1342 { 1344 1343 return 0; 1345 1344 } 1346 1345 1347 - static int rtw_pci_resume(struct device *dev) 1346 + static int __maybe_unused rtw_pci_resume(struct device *dev) 1348 1347 { 1349 1348 return 0; 1350 1349 } 1351 1350 1352 1351 static SIMPLE_DEV_PM_OPS(rtw_pm_ops, rtw_pci_suspend, rtw_pci_resume); 1353 - #define RTW_PM_OPS (&rtw_pm_ops) 1354 - #else 1355 - #define RTW_PM_OPS NULL 1356 - #endif 1357 1352 1358 1353 static int rtw_pci_claim(struct rtw_dev *rtwdev, struct pci_dev *pdev) 1359 1354 { ··· 1577 1582 .id_table = rtw_pci_id_table, 1578 1583 .probe = rtw_pci_probe, 1579 1584 .remove = rtw_pci_remove, 1580 - .driver.pm = RTW_PM_OPS, 1585 + .driver.pm = &rtw_pm_ops, 1581 1586 }; 1582 1587 module_pci_driver(rtw_pci_driver); 1583 1588
+2
drivers/of/overlay.c
··· 261 261 262 262 of_property_set_flag(new_prop, OF_DYNAMIC); 263 263 264 + kfree(target_path); 265 + 264 266 return new_prop; 265 267 266 268 err_free_new_prop:
+19 -4
drivers/of/unittest-data/overlay_bad_add_dup_prop.dts
··· 3 3 /plugin/; 4 4 5 5 /* 6 - * &electric_1/motor-1 and &spin_ctrl_1 are the same node: 7 - * /testcase-data-2/substation@100/motor-1 6 + * &electric_1/motor-1/electric and &spin_ctrl_1/electric are the same node: 7 + * /testcase-data-2/substation@100/motor-1/electric 8 8 * 9 9 * Thus the property "rpm_avail" in each fragment will 10 10 * result in an attempt to update the same property twice. 11 11 * This will result in an error and the overlay apply 12 12 * will fail. 13 + * 14 + * The previous version of this test did not include the extra 15 + * level of node 'electric'. That resulted in the 'rpm_avail' 16 + * property being located in the pre-existing node 'motor-1'. 17 + * Modifying a property results in a WARNING that a memory leak 18 + * will occur if the overlay is removed. Since the overlay apply 19 + * fails, the memory leak does actually occur, and kmemleak will 20 + * further report the memory leak if CONFIG_DEBUG_KMEMLEAK is 21 + * enabled. Adding the overlay node 'electric' avoids the 22 + * memory leak and thus people who use kmemleak will not 23 + * have to debug this non-problem again. 13 24 */ 14 25 15 26 &electric_1 { 16 27 17 28 motor-1 { 18 - rpm_avail = < 100 >; 29 + electric { 30 + rpm_avail = < 100 >; 31 + }; 19 32 }; 20 33 }; 21 34 22 35 &spin_ctrl_1 { 23 - rpm_avail = < 100 200 >; 36 + electric { 37 + rpm_avail = < 100 200 >; 38 + }; 24 39 };
+19 -9
drivers/of/unittest.c
··· 861 861 unittest(!of_changeset_revert(&chgset), "revert failed\n"); 862 862 863 863 of_changeset_destroy(&chgset); 864 + 865 + of_node_put(n1); 866 + of_node_put(n2); 867 + of_node_put(n21); 864 868 #endif 865 869 } 866 870 ··· 1247 1243 1248 1244 of_platform_populate(np, match, NULL, &test_bus->dev); 1249 1245 for_each_child_of_node(np, child) { 1250 - for_each_child_of_node(child, grandchild) 1251 - unittest(of_find_device_by_node(grandchild), 1246 + for_each_child_of_node(child, grandchild) { 1247 + pdev = of_find_device_by_node(grandchild); 1248 + unittest(pdev, 1252 1249 "Could not create device for node '%pOFn'\n", 1253 1250 grandchild); 1251 + of_dev_put(pdev); 1252 + } 1254 1253 } 1255 1254 1256 1255 of_platform_depopulate(&test_bus->dev); ··· 3094 3087 goto err_unlock; 3095 3088 } 3096 3089 if (__of_add_property(of_symbols, new_prop)) { 3090 + kfree(new_prop->name); 3091 + kfree(new_prop->value); 3092 + kfree(new_prop); 3097 3093 /* "name" auto-generated by unflatten */ 3098 - if (!strcmp(new_prop->name, "name")) 3094 + if (!strcmp(prop->name, "name")) 3099 3095 continue; 3100 3096 unittest(0, "duplicate property '%s' in overlay_base node __symbols__", 3101 3097 prop->name); ··· 3181 3171 "OF: overlay: ERROR: multiple fragments add and/or delete node /testcase-data-2/substation@100/motor-1/controller"); 3182 3172 3183 3173 EXPECT_BEGIN(KERN_ERR, 3184 - "OF: overlay: WARNING: memory leak will occur if overlay removed, property: /testcase-data-2/substation@100/motor-1/rpm_avail"); 3174 + "OF: overlay: ERROR: multiple fragments add and/or delete node /testcase-data-2/substation@100/motor-1/electric"); 3185 3175 EXPECT_BEGIN(KERN_ERR, 3186 - "OF: overlay: WARNING: memory leak will occur if overlay removed, property: /testcase-data-2/substation@100/motor-1/rpm_avail"); 3176 + "OF: overlay: ERROR: multiple fragments add, update, and/or delete property /testcase-data-2/substation@100/motor-1/electric/rpm_avail"); 3187 3177 EXPECT_BEGIN(KERN_ERR, 3188 - "OF: overlay: ERROR: multiple fragments add, update, and/or delete property /testcase-data-2/substation@100/motor-1/rpm_avail"); 3178 + "OF: overlay: ERROR: multiple fragments add, update, and/or delete property /testcase-data-2/substation@100/motor-1/electric/name"); 3189 3179 3190 3180 unittest(overlay_data_apply("overlay_bad_add_dup_prop", NULL), 3191 3181 "Adding overlay 'overlay_bad_add_dup_prop' failed\n"); 3192 3182 3193 3183 EXPECT_END(KERN_ERR, 3194 - "OF: overlay: ERROR: multiple fragments add, update, and/or delete property /testcase-data-2/substation@100/motor-1/rpm_avail"); 3184 + "OF: overlay: ERROR: multiple fragments add, update, and/or delete property /testcase-data-2/substation@100/motor-1/electric/name"); 3195 3185 EXPECT_END(KERN_ERR, 3196 - "OF: overlay: WARNING: memory leak will occur if overlay removed, property: /testcase-data-2/substation@100/motor-1/rpm_avail"); 3186 + "OF: overlay: ERROR: multiple fragments add, update, and/or delete property /testcase-data-2/substation@100/motor-1/electric/rpm_avail"); 3197 3187 EXPECT_END(KERN_ERR, 3198 - "OF: overlay: WARNING: memory leak will occur if overlay removed, property: /testcase-data-2/substation@100/motor-1/rpm_avail"); 3188 + "OF: overlay: ERROR: multiple fragments add and/or delete node /testcase-data-2/substation@100/motor-1/electric"); 3199 3189 3200 3190 unittest(overlay_data_apply("overlay_bad_phandle", NULL), 3201 3191 "Adding overlay 'overlay_bad_phandle' failed\n");
+14
drivers/opp/core.c
··· 819 819 if (unlikely(!target_freq)) { 820 820 if (opp_table->required_opp_tables) { 821 821 ret = _set_required_opps(dev, opp_table, NULL); 822 + } else if (!_get_opp_count(opp_table)) { 823 + return 0; 822 824 } else { 823 825 dev_err(dev, "target frequency can't be 0\n"); 824 826 ret = -EINVAL; ··· 848 846 dev_dbg(dev, "%s: old/new frequencies (%lu Hz) are same, nothing to do\n", 849 847 __func__, freq); 850 848 ret = 0; 849 + goto put_opp_table; 850 + } 851 + 852 + /* 853 + * For IO devices which require an OPP on some platforms/SoCs 854 + * while just needing to scale the clock on some others 855 + * we look for empty OPP tables with just a clock handle and 856 + * scale only the clk. This makes dev_pm_opp_set_rate() 857 + * equivalent to a clk_set_rate() 858 + */ 859 + if (!_get_opp_count(opp_table)) { 860 + ret = _generic_set_opp_clk_only(dev, clk, freq); 851 861 goto put_opp_table; 852 862 } 853 863
+4 -4
drivers/platform/chrome/cros_ec_sensorhub_ring.c
··· 40 40 int id = sample->sensor_id; 41 41 struct iio_dev *indio_dev; 42 42 43 - if (id > sensorhub->sensor_num) 43 + if (id >= sensorhub->sensor_num) 44 44 return -EINVAL; 45 45 46 46 cb = sensorhub->push_data[id].push_data_cb; ··· 820 820 if (fifo_info->count > sensorhub->fifo_size || 821 821 fifo_info->size != sensorhub->fifo_size) { 822 822 dev_warn(sensorhub->dev, 823 - "Mismatch EC data: count %d, size %d - expected %d", 823 + "Mismatch EC data: count %d, size %d - expected %d\n", 824 824 fifo_info->count, fifo_info->size, 825 825 sensorhub->fifo_size); 826 826 goto error; ··· 851 851 } 852 852 if (number_data > fifo_info->count - i) { 853 853 dev_warn(sensorhub->dev, 854 - "Invalid EC data: too many entry received: %d, expected %d", 854 + "Invalid EC data: too many entry received: %d, expected %d\n", 855 855 number_data, fifo_info->count - i); 856 856 break; 857 857 } 858 858 if (out + number_data > 859 859 sensorhub->ring + fifo_info->count) { 860 860 dev_warn(sensorhub->dev, 861 - "Too many samples: %d (%zd data) to %d entries for expected %d entries", 861 + "Too many samples: %d (%zd data) to %d entries for expected %d entries\n", 862 862 i, out - sensorhub->ring, i + number_data, 863 863 fifo_info->count); 864 864 break;
+56 -50
drivers/platform/x86/intel_cht_int33fe_typec.c
··· 6 6 * 7 7 * Some Intel Cherry Trail based device which ship with Windows 10, have 8 8 * this weird INT33FE ACPI device with a CRS table with 4 I2cSerialBusV2 9 - * resources, for 4 different chips attached to various i2c busses: 10 - * 1. The Whiskey Cove pmic, which is also described by the INT34D3 ACPI device 9 + * resources, for 4 different chips attached to various I²C buses: 10 + * 1. The Whiskey Cove PMIC, which is also described by the INT34D3 ACPI device 11 11 * 2. Maxim MAX17047 Fuel Gauge Controller 12 12 * 3. FUSB302 USB Type-C Controller 13 13 * 4. PI3USB30532 USB switch 14 14 * 15 15 * So this driver is a stub / pseudo driver whose only purpose is to 16 - * instantiate i2c-clients for chips 2 - 4, so that standard i2c drivers 16 + * instantiate I²C clients for chips 2 - 4, so that standard I²C drivers 17 17 * for these chips can bind to the them. 18 18 */ 19 19 ··· 21 21 #include <linux/interrupt.h> 22 22 #include <linux/pci.h> 23 23 #include <linux/platform_device.h> 24 + #include <linux/property.h> 24 25 #include <linux/regulator/consumer.h> 25 26 #include <linux/slab.h> 26 27 #include <linux/usb/pd.h> 27 28 28 29 #include "intel_cht_int33fe_common.h" 29 30 30 - enum { 31 - INT33FE_NODE_FUSB302, 32 - INT33FE_NODE_MAX17047, 33 - INT33FE_NODE_PI3USB30532, 34 - INT33FE_NODE_DISPLAYPORT, 35 - INT33FE_NODE_USB_CONNECTOR, 36 - INT33FE_NODE_MAX, 37 - }; 38 - 39 31 /* 40 - * Grrr I severly dislike buggy BIOS-es. At least one BIOS enumerates 32 + * Grrr, I severely dislike buggy BIOS-es. At least one BIOS enumerates 41 33 * the max17047 both through the INT33FE ACPI device (it is right there 42 34 * in the resources table) as well as through a separate MAX17047 device. 43 35 * 44 - * These helpers are used to work around this by checking if an i2c-client 36 + * These helpers are used to work around this by checking if an I²C client 45 37 * for the max17047 has already been registered. 46 38 */ 47 39 static int cht_int33fe_check_for_max17047(struct device *dev, void *data) 48 40 { 49 41 struct i2c_client **max17047 = data; 50 42 struct acpi_device *adev; 51 - const char *hid; 52 43 53 44 adev = ACPI_COMPANION(dev); 54 45 if (!adev) 55 46 return 0; 56 47 57 - hid = acpi_device_hid(adev); 58 - 59 48 /* The MAX17047 ACPI node doesn't have an UID, so we don't check that */ 60 - if (strcmp(hid, "MAX17047")) 49 + if (!acpi_dev_hid_uid_match(adev, "MAX17047", NULL)) 61 50 return 0; 62 51 63 52 *max17047 = to_i2c_client(dev); ··· 55 66 56 67 static const char * const max17047_suppliers[] = { "bq24190-charger" }; 57 68 58 - static const struct property_entry max17047_props[] = { 69 + static const struct property_entry max17047_properties[] = { 59 70 PROPERTY_ENTRY_STRING_ARRAY("supplied-from", max17047_suppliers), 60 71 { } 72 + }; 73 + 74 + static const struct software_node max17047_node = { 75 + .name = "max17047", 76 + .properties = max17047_properties, 61 77 }; 62 78 63 79 /* ··· 74 80 { .node = NULL }, 75 81 }; 76 82 77 - static const struct property_entry fusb302_props[] = { 83 + static const struct property_entry fusb302_properties[] = { 78 84 PROPERTY_ENTRY_STRING("linux,extcon-name", "cht_wcove_pwrsrc"), 79 85 PROPERTY_ENTRY_REF_ARRAY("usb-role-switch", fusb302_mux_refs), 80 86 { } 87 + }; 88 + 89 + static const struct software_node fusb302_node = { 90 + .name = "fusb302", 91 + .properties = fusb302_properties, 81 92 }; 82 93 83 94 #define PDO_FIXED_FLAGS \ ··· 97 98 PDO_VAR(5000, 12000, 3000), 98 99 }; 99 100 100 - static const struct software_node nodes[]; 101 + static const struct software_node pi3usb30532_node = { 102 + .name = "pi3usb30532", 103 + }; 101 104 102 - static const struct property_entry usb_connector_props[] = { 105 + static const struct software_node displayport_node = { 106 + .name = "displayport", 107 + }; 108 + 109 + static const struct property_entry usb_connector_properties[] = { 103 110 PROPERTY_ENTRY_STRING("data-role", "dual"), 104 111 PROPERTY_ENTRY_STRING("power-role", "dual"), 105 112 PROPERTY_ENTRY_STRING("try-power-role", "sink"), 106 113 PROPERTY_ENTRY_U32_ARRAY("source-pdos", src_pdo), 107 114 PROPERTY_ENTRY_U32_ARRAY("sink-pdos", snk_pdo), 108 115 PROPERTY_ENTRY_U32("op-sink-microwatt", 2500000), 109 - PROPERTY_ENTRY_REF("orientation-switch", 110 - &nodes[INT33FE_NODE_PI3USB30532]), 111 - PROPERTY_ENTRY_REF("mode-switch", 112 - &nodes[INT33FE_NODE_PI3USB30532]), 113 - PROPERTY_ENTRY_REF("displayport", 114 - &nodes[INT33FE_NODE_DISPLAYPORT]), 116 + PROPERTY_ENTRY_REF("orientation-switch", &pi3usb30532_node), 117 + PROPERTY_ENTRY_REF("mode-switch", &pi3usb30532_node), 118 + PROPERTY_ENTRY_REF("displayport", &displayport_node), 115 119 { } 116 120 }; 117 121 118 - static const struct software_node nodes[] = { 119 - { "fusb302", NULL, fusb302_props }, 120 - { "max17047", NULL, max17047_props }, 121 - { "pi3usb30532" }, 122 - { "displayport" }, 123 - { "connector", &nodes[0], usb_connector_props }, 124 - { } 122 + static const struct software_node usb_connector_node = { 123 + .name = "connector", 124 + .parent = &fusb302_node, 125 + .properties = usb_connector_properties, 126 + }; 127 + 128 + static const struct software_node *node_group[] = { 129 + &fusb302_node, 130 + &max17047_node, 131 + &pi3usb30532_node, 132 + &displayport_node, 133 + &usb_connector_node, 134 + NULL 125 135 }; 126 136 127 137 static int cht_int33fe_setup_dp(struct cht_int33fe_data *data) ··· 138 130 struct fwnode_handle *fwnode; 139 131 struct pci_dev *pdev; 140 132 141 - fwnode = software_node_fwnode(&nodes[INT33FE_NODE_DISPLAYPORT]); 133 + fwnode = software_node_fwnode(&displayport_node); 142 134 if (!fwnode) 143 135 return -ENODEV; 144 136 ··· 163 155 164 156 static void cht_int33fe_remove_nodes(struct cht_int33fe_data *data) 165 157 { 166 - software_node_unregister_nodes(nodes); 158 + software_node_unregister_node_group(node_group); 167 159 168 160 if (fusb302_mux_refs[0].node) { 169 - fwnode_handle_put( 170 - software_node_fwnode(fusb302_mux_refs[0].node)); 161 + fwnode_handle_put(software_node_fwnode(fusb302_mux_refs[0].node)); 171 162 fusb302_mux_refs[0].node = NULL; 172 163 } 173 164 ··· 199 192 */ 200 193 fusb302_mux_refs[0].node = mux_ref_node; 201 194 202 - ret = software_node_register_nodes(nodes); 195 + ret = software_node_register_node_group(node_group); 203 196 if (ret) 204 197 return ret; 205 198 ··· 229 222 struct fwnode_handle *fwnode; 230 223 int ret; 231 224 232 - fwnode = software_node_fwnode(&nodes[INT33FE_NODE_MAX17047]); 225 + fwnode = software_node_fwnode(&max17047_node); 233 226 if (!fwnode) 234 227 return -ENODEV; 235 228 236 229 i2c_for_each_dev(&max17047, cht_int33fe_check_for_max17047); 237 230 if (max17047) { 238 - /* Pre-existing i2c-client for the max17047, add device-props */ 239 - fwnode->secondary = ERR_PTR(-ENODEV); 240 - max17047->dev.fwnode->secondary = fwnode; 241 - /* And re-probe to get the new device-props applied. */ 231 + /* Pre-existing I²C client for the max17047, add device properties */ 232 + set_secondary_fwnode(&max17047->dev, fwnode); 233 + /* And re-probe to get the new device properties applied */ 242 234 ret = device_reprobe(&max17047->dev); 243 235 if (ret) 244 236 dev_warn(dev, "Reprobing max17047 error: %d\n", ret); ··· 272 266 * must be registered before the fusb302 is instantiated, otherwise 273 267 * it will end up with a dummy-regulator. 274 268 * Note "cht_wc_usb_typec_vbus" comes from the regulator_init_data 275 - * which is defined in i2c-cht-wc.c from where the bq24292i i2c-client 269 + * which is defined in i2c-cht-wc.c from where the bq24292i I²C client 276 270 * gets instantiated. We use regulator_get_optional here so that we 277 271 * don't end up getting a dummy-regulator ourselves. 278 272 */ ··· 283 277 } 284 278 regulator_put(regulator); 285 279 286 - /* The FUSB302 uses the irq at index 1 and is the only irq user */ 280 + /* The FUSB302 uses the IRQ at index 1 and is the only IRQ user */ 287 281 fusb302_irq = acpi_dev_gpio_irq_get(ACPI_COMPANION(dev), 1); 288 282 if (fusb302_irq < 0) { 289 283 if (fusb302_irq != -EPROBE_DEFER) ··· 295 289 if (ret) 296 290 return ret; 297 291 298 - /* Work around BIOS bug, see comment on cht_int33fe_check_for_max17047 */ 292 + /* Work around BIOS bug, see comment on cht_int33fe_check_for_max17047() */ 299 293 ret = cht_int33fe_register_max17047(dev, data); 300 294 if (ret) 301 295 goto out_remove_nodes; 302 296 303 - fwnode = software_node_fwnode(&nodes[INT33FE_NODE_FUSB302]); 297 + fwnode = software_node_fwnode(&fusb302_node); 304 298 if (!fwnode) { 305 299 ret = -ENODEV; 306 300 goto out_unregister_max17047; ··· 318 312 goto out_unregister_max17047; 319 313 } 320 314 321 - fwnode = software_node_fwnode(&nodes[INT33FE_NODE_PI3USB30532]); 315 + fwnode = software_node_fwnode(&pi3usb30532_node); 322 316 if (!fwnode) { 323 317 ret = -ENODEV; 324 318 goto out_unregister_fusb302;
-1
drivers/s390/block/Kconfig
··· 26 26 def_tristate y 27 27 prompt "Support for DASD devices" 28 28 depends on CCW && BLOCK 29 - select IOSCHED_DEADLINE 30 29 help 31 30 Enable this option if you want to access DASDs directly utilizing 32 31 S/390s channel subsystem commands. This is necessary for running
+1
drivers/scsi/hisi_sas/Kconfig
··· 6 6 select SCSI_SAS_LIBSAS 7 7 select BLK_DEV_INTEGRITY 8 8 depends on ATA 9 + select SATA_HOST 9 10 help 10 11 This driver supports HiSilicon's SAS HBA, including support based 11 12 on platform device
+2 -1
drivers/scsi/qla2xxx/qla_dbg.c
··· 2539 2539 { 2540 2540 va_list va; 2541 2541 struct va_format vaf; 2542 - char pbuf[64]; 2543 2542 2544 2543 va_start(va, fmt); 2545 2544 ··· 2546 2547 vaf.va = &va; 2547 2548 2548 2549 if (!ql_mask_match(level)) { 2550 + char pbuf[64]; 2551 + 2549 2552 if (vha != NULL) { 2550 2553 const struct pci_dev *pdev = vha->hw->pdev; 2551 2554 /* <module-name> <msg-id>:<host> Message */
-2
drivers/scsi/qla2xxx/qla_init.c
··· 3611 3611 ha->lr_distance = LR_DISTANCE_5K; 3612 3612 } 3613 3613 3614 - if (!vha->flags.init_done) 3615 - rc = QLA_SUCCESS; 3616 3614 out: 3617 3615 ql_dbg(ql_dbg_async, vha, 0x507b, 3618 3616 "SFP detect: %s-Range SFP %s (nvr=%x ll=%x lr=%x lrd=%x).\n",
-1
drivers/scsi/qla2xxx/qla_isr.c
··· 87 87 } 88 88 89 89 /* terminate exchange */ 90 - memset(rsp_els, 0, sizeof(*rsp_els)); 91 90 rsp_els->entry_type = ELS_IOCB_TYPE; 92 91 rsp_els->entry_count = 1; 93 92 rsp_els->nport_handle = ~0;
-2
drivers/scsi/qla2xxx/qla_mbx.c
··· 4894 4894 return QLA_MEMORY_ALLOC_FAILED; 4895 4895 } 4896 4896 4897 - memset(els_cmd_map, 0, ELS_CMD_MAP_SIZE); 4898 - 4899 4897 els_cmd_map[index] |= 1 << bit; 4900 4898 4901 4899 mcp->mb[0] = MBC_SET_RNID_PARAMS;
+3 -1
drivers/scsi/sg.c
··· 793 793 "sg_common_write: scsi opcode=0x%02x, cmd_size=%d\n", 794 794 (int) cmnd[0], (int) hp->cmd_len)); 795 795 796 - if (hp->dxfer_len >= SZ_256M) 796 + if (hp->dxfer_len >= SZ_256M) { 797 + sg_remove_request(sfp, srp); 797 798 return -EINVAL; 799 + } 798 800 799 801 k = sg_start_req(srp, cmnd); 800 802 if (k) {
+3 -2
drivers/target/target_core_fabric_lib.c
··· 63 63 * encoded TransportID. 64 64 */ 65 65 ptr = &se_nacl->initiatorname[0]; 66 - for (i = 0; i < 24; ) { 66 + for (i = 0; i < 23; ) { 67 67 if (!strncmp(&ptr[i], ":", 1)) { 68 68 i++; 69 69 continue; ··· 341 341 *p = tolower(*p); 342 342 p++; 343 343 } 344 - } 344 + } else 345 + *port_nexus_ptr = NULL; 345 346 346 347 return &buf[4]; 347 348 }
+1
drivers/target/target_core_user.c
··· 2073 2073 mb->cmd_tail = 0; 2074 2074 mb->cmd_head = 0; 2075 2075 tcmu_flush_dcache_range(mb, sizeof(*mb)); 2076 + clear_bit(TCMU_DEV_BIT_BROKEN, &udev->flags); 2076 2077 2077 2078 del_timer(&udev->cmd_timer); 2078 2079
+4
drivers/watchdog/sp805_wdt.c
··· 137 137 { 138 138 struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); 139 139 140 + writel_relaxed(UNLOCK, wdt->base + WDTLOCK); 140 141 writel_relaxed(0, wdt->base + WDTCONTROL); 141 142 writel_relaxed(0, wdt->base + WDTLOAD); 142 143 writel_relaxed(INT_ENABLE | RESET_ENABLE, wdt->base + WDTCONTROL); 144 + 145 + /* Flush posted writes. */ 146 + readl_relaxed(wdt->base + WDTLOCK); 143 147 144 148 return 0; 145 149 }
+8 -1
drivers/xen/xenbus/xenbus_client.c
··· 448 448 int xenbus_map_ring_valloc(struct xenbus_device *dev, grant_ref_t *gnt_refs, 449 449 unsigned int nr_grefs, void **vaddr) 450 450 { 451 - return ring_ops->map(dev, gnt_refs, nr_grefs, vaddr); 451 + int err; 452 + 453 + err = ring_ops->map(dev, gnt_refs, nr_grefs, vaddr); 454 + /* Some hypervisors are buggy and can return 1. */ 455 + if (err > 0) 456 + err = GNTST_general_error; 457 + 458 + return err; 452 459 } 453 460 EXPORT_SYMBOL_GPL(xenbus_map_ring_valloc); 454 461
+67 -41
fs/afs/dir.c
··· 1032 1032 struct dentry *parent; 1033 1033 struct inode *inode; 1034 1034 struct key *key; 1035 - afs_dataversion_t dir_version; 1035 + afs_dataversion_t dir_version, invalid_before; 1036 1036 long de_version; 1037 1037 int ret; 1038 1038 ··· 1084 1084 if (de_version == (long)dir_version) 1085 1085 goto out_valid_noupdate; 1086 1086 1087 - dir_version = dir->invalid_before; 1088 - if (de_version - (long)dir_version >= 0) 1087 + invalid_before = dir->invalid_before; 1088 + if (de_version - (long)invalid_before >= 0) 1089 1089 goto out_valid; 1090 1090 1091 1091 _debug("dir modified"); ··· 1275 1275 struct afs_fs_cursor fc; 1276 1276 struct afs_vnode *dvnode = AFS_FS_I(dir); 1277 1277 struct key *key; 1278 + afs_dataversion_t data_version; 1278 1279 int ret; 1279 1280 1280 1281 mode |= S_IFDIR; ··· 1296 1295 1297 1296 ret = -ERESTARTSYS; 1298 1297 if (afs_begin_vnode_operation(&fc, dvnode, key, true)) { 1299 - afs_dataversion_t data_version = dvnode->status.data_version + 1; 1298 + data_version = dvnode->status.data_version + 1; 1300 1299 1301 1300 while (afs_select_fileserver(&fc)) { 1302 1301 fc.cb_break = afs_calc_vnode_cb_break(dvnode); ··· 1317 1316 goto error_key; 1318 1317 } 1319 1318 1320 - if (ret == 0 && 1321 - test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags)) 1322 - afs_edit_dir_add(dvnode, &dentry->d_name, &iget_data.fid, 1323 - afs_edit_dir_for_create); 1319 + if (ret == 0) { 1320 + down_write(&dvnode->validate_lock); 1321 + if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags) && 1322 + dvnode->status.data_version == data_version) 1323 + afs_edit_dir_add(dvnode, &dentry->d_name, &iget_data.fid, 1324 + afs_edit_dir_for_create); 1325 + up_write(&dvnode->validate_lock); 1326 + } 1324 1327 1325 1328 key_put(key); 1326 1329 kfree(scb); ··· 1365 1360 struct afs_fs_cursor fc; 1366 1361 struct afs_vnode *dvnode = AFS_FS_I(dir), *vnode = NULL; 1367 1362 struct key *key; 1363 + afs_dataversion_t data_version; 1368 1364 int ret; 1369 1365 1370 1366 _enter("{%llx:%llu},{%pd}", ··· 1397 1391 1398 1392 ret = -ERESTARTSYS; 1399 1393 if (afs_begin_vnode_operation(&fc, dvnode, key, true)) { 1400 - afs_dataversion_t data_version = dvnode->status.data_version + 1; 1394 + data_version = dvnode->status.data_version + 1; 1401 1395 1402 1396 while (afs_select_fileserver(&fc)) { 1403 1397 fc.cb_break = afs_calc_vnode_cb_break(dvnode); ··· 1410 1404 ret = afs_end_vnode_operation(&fc); 1411 1405 if (ret == 0) { 1412 1406 afs_dir_remove_subdir(dentry); 1413 - if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags)) 1407 + down_write(&dvnode->validate_lock); 1408 + if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags) && 1409 + dvnode->status.data_version == data_version) 1414 1410 afs_edit_dir_remove(dvnode, &dentry->d_name, 1415 1411 afs_edit_dir_for_rmdir); 1412 + up_write(&dvnode->validate_lock); 1416 1413 } 1417 1414 } 1418 1415 ··· 1553 1544 ret = afs_end_vnode_operation(&fc); 1554 1545 if (ret == 0 && !(scb[1].have_status || scb[1].have_error)) 1555 1546 ret = afs_dir_remove_link(dvnode, dentry, key); 1556 - if (ret == 0 && 1557 - test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags)) 1558 - afs_edit_dir_remove(dvnode, &dentry->d_name, 1559 - afs_edit_dir_for_unlink); 1547 + 1548 + if (ret == 0) { 1549 + down_write(&dvnode->validate_lock); 1550 + if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags) && 1551 + dvnode->status.data_version == data_version) 1552 + afs_edit_dir_remove(dvnode, &dentry->d_name, 1553 + afs_edit_dir_for_unlink); 1554 + up_write(&dvnode->validate_lock); 1555 + } 1560 1556 } 1561 1557 1562 1558 if (need_rehash && ret < 0 && ret != -ENOENT) ··· 1587 1573 struct afs_status_cb *scb; 1588 1574 struct afs_vnode *dvnode = AFS_FS_I(dir); 1589 1575 struct key *key; 1576 + afs_dataversion_t data_version; 1590 1577 int ret; 1591 1578 1592 1579 mode |= S_IFREG; ··· 1612 1597 1613 1598 ret = -ERESTARTSYS; 1614 1599 if (afs_begin_vnode_operation(&fc, dvnode, key, true)) { 1615 - afs_dataversion_t data_version = dvnode->status.data_version + 1; 1600 + data_version = dvnode->status.data_version + 1; 1616 1601 1617 1602 while (afs_select_fileserver(&fc)) { 1618 1603 fc.cb_break = afs_calc_vnode_cb_break(dvnode); ··· 1633 1618 goto error_key; 1634 1619 } 1635 1620 1636 - if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags)) 1621 + down_write(&dvnode->validate_lock); 1622 + if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags) && 1623 + dvnode->status.data_version == data_version) 1637 1624 afs_edit_dir_add(dvnode, &dentry->d_name, &iget_data.fid, 1638 1625 afs_edit_dir_for_create); 1626 + up_write(&dvnode->validate_lock); 1639 1627 1640 1628 kfree(scb); 1641 1629 key_put(key); ··· 1666 1648 struct afs_vnode *dvnode = AFS_FS_I(dir); 1667 1649 struct afs_vnode *vnode = AFS_FS_I(d_inode(from)); 1668 1650 struct key *key; 1651 + afs_dataversion_t data_version; 1669 1652 int ret; 1670 1653 1671 1654 _enter("{%llx:%llu},{%llx:%llu},{%pd}", ··· 1691 1672 1692 1673 ret = -ERESTARTSYS; 1693 1674 if (afs_begin_vnode_operation(&fc, dvnode, key, true)) { 1694 - afs_dataversion_t data_version = dvnode->status.data_version + 1; 1675 + data_version = dvnode->status.data_version + 1; 1695 1676 1696 1677 if (mutex_lock_interruptible_nested(&vnode->io_lock, 1) < 0) { 1697 1678 afs_end_vnode_operation(&fc); ··· 1721 1702 goto error_key; 1722 1703 } 1723 1704 1724 - if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags)) 1705 + down_write(&dvnode->validate_lock); 1706 + if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags) && 1707 + dvnode->status.data_version == data_version) 1725 1708 afs_edit_dir_add(dvnode, &dentry->d_name, &vnode->fid, 1726 1709 afs_edit_dir_for_link); 1710 + up_write(&dvnode->validate_lock); 1727 1711 1728 1712 key_put(key); 1729 1713 kfree(scb); ··· 1754 1732 struct afs_status_cb *scb; 1755 1733 struct afs_vnode *dvnode = AFS_FS_I(dir); 1756 1734 struct key *key; 1735 + afs_dataversion_t data_version; 1757 1736 int ret; 1758 1737 1759 1738 _enter("{%llx:%llu},{%pd},%s", ··· 1782 1759 1783 1760 ret = -ERESTARTSYS; 1784 1761 if (afs_begin_vnode_operation(&fc, dvnode, key, true)) { 1785 - afs_dataversion_t data_version = dvnode->status.data_version + 1; 1762 + data_version = dvnode->status.data_version + 1; 1786 1763 1787 1764 while (afs_select_fileserver(&fc)) { 1788 1765 fc.cb_break = afs_calc_vnode_cb_break(dvnode); ··· 1803 1780 goto error_key; 1804 1781 } 1805 1782 1806 - if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags)) 1783 + down_write(&dvnode->validate_lock); 1784 + if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags) && 1785 + dvnode->status.data_version == data_version) 1807 1786 afs_edit_dir_add(dvnode, &dentry->d_name, &iget_data.fid, 1808 1787 afs_edit_dir_for_symlink); 1788 + up_write(&dvnode->validate_lock); 1809 1789 1810 1790 key_put(key); 1811 1791 kfree(scb); ··· 1838 1812 struct dentry *tmp = NULL, *rehash = NULL; 1839 1813 struct inode *new_inode; 1840 1814 struct key *key; 1815 + afs_dataversion_t orig_data_version; 1816 + afs_dataversion_t new_data_version; 1841 1817 bool new_negative = d_is_negative(new_dentry); 1842 1818 int ret; 1843 1819 ··· 1918 1890 1919 1891 ret = -ERESTARTSYS; 1920 1892 if (afs_begin_vnode_operation(&fc, orig_dvnode, key, true)) { 1921 - afs_dataversion_t orig_data_version; 1922 - afs_dataversion_t new_data_version; 1923 - struct afs_status_cb *new_scb = &scb[1]; 1924 - 1925 1893 orig_data_version = orig_dvnode->status.data_version + 1; 1926 1894 1927 1895 if (orig_dvnode != new_dvnode) { ··· 1928 1904 new_data_version = new_dvnode->status.data_version + 1; 1929 1905 } else { 1930 1906 new_data_version = orig_data_version; 1931 - new_scb = &scb[0]; 1932 1907 } 1933 1908 1934 1909 while (afs_select_fileserver(&fc)) { ··· 1935 1912 fc.cb_break_2 = afs_calc_vnode_cb_break(new_dvnode); 1936 1913 afs_fs_rename(&fc, old_dentry->d_name.name, 1937 1914 new_dvnode, new_dentry->d_name.name, 1938 - &scb[0], new_scb); 1915 + &scb[0], &scb[1]); 1939 1916 } 1940 1917 1941 1918 afs_vnode_commit_status(&fc, orig_dvnode, fc.cb_break, ··· 1953 1930 if (ret == 0) { 1954 1931 if (rehash) 1955 1932 d_rehash(rehash); 1956 - if (test_bit(AFS_VNODE_DIR_VALID, &orig_dvnode->flags)) 1957 - afs_edit_dir_remove(orig_dvnode, &old_dentry->d_name, 1958 - afs_edit_dir_for_rename_0); 1933 + down_write(&orig_dvnode->validate_lock); 1934 + if (test_bit(AFS_VNODE_DIR_VALID, &orig_dvnode->flags) && 1935 + orig_dvnode->status.data_version == orig_data_version) 1936 + afs_edit_dir_remove(orig_dvnode, &old_dentry->d_name, 1937 + afs_edit_dir_for_rename_0); 1938 + if (orig_dvnode != new_dvnode) { 1939 + up_write(&orig_dvnode->validate_lock); 1959 1940 1960 - if (!new_negative && 1961 - test_bit(AFS_VNODE_DIR_VALID, &new_dvnode->flags)) 1962 - afs_edit_dir_remove(new_dvnode, &new_dentry->d_name, 1963 - afs_edit_dir_for_rename_1); 1941 + down_write(&new_dvnode->validate_lock); 1942 + } 1943 + if (test_bit(AFS_VNODE_DIR_VALID, &new_dvnode->flags) && 1944 + orig_dvnode->status.data_version == new_data_version) { 1945 + if (!new_negative) 1946 + afs_edit_dir_remove(new_dvnode, &new_dentry->d_name, 1947 + afs_edit_dir_for_rename_1); 1964 1948 1965 - if (test_bit(AFS_VNODE_DIR_VALID, &new_dvnode->flags)) 1966 1949 afs_edit_dir_add(new_dvnode, &new_dentry->d_name, 1967 1950 &vnode->fid, afs_edit_dir_for_rename_2); 1951 + } 1968 1952 1969 1953 new_inode = d_inode(new_dentry); 1970 1954 if (new_inode) { ··· 1987 1957 * Note that if we ever implement RENAME_EXCHANGE, we'll have 1988 1958 * to update both dentries with opposing dir versions. 1989 1959 */ 1990 - if (new_dvnode != orig_dvnode) { 1991 - afs_update_dentry_version(&fc, old_dentry, &scb[1]); 1992 - afs_update_dentry_version(&fc, new_dentry, &scb[1]); 1993 - } else { 1994 - afs_update_dentry_version(&fc, old_dentry, &scb[0]); 1995 - afs_update_dentry_version(&fc, new_dentry, &scb[0]); 1996 - } 1960 + afs_update_dentry_version(&fc, old_dentry, &scb[1]); 1961 + afs_update_dentry_version(&fc, new_dentry, &scb[1]); 1997 1962 d_move(old_dentry, new_dentry); 1963 + up_write(&new_dvnode->validate_lock); 1998 1964 goto error_tmp; 1999 1965 } 2000 1966
+15 -7
fs/afs/dir_silly.c
··· 21 21 { 22 22 struct afs_fs_cursor fc; 23 23 struct afs_status_cb *scb; 24 + afs_dataversion_t dir_data_version; 24 25 int ret = -ERESTARTSYS; 25 26 26 27 _enter("%pd,%pd", old, new); ··· 32 31 33 32 trace_afs_silly_rename(vnode, false); 34 33 if (afs_begin_vnode_operation(&fc, dvnode, key, true)) { 35 - afs_dataversion_t dir_data_version = dvnode->status.data_version + 1; 34 + dir_data_version = dvnode->status.data_version + 1; 36 35 37 36 while (afs_select_fileserver(&fc)) { 38 37 fc.cb_break = afs_calc_vnode_cb_break(dvnode); ··· 55 54 dvnode->silly_key = key_get(key); 56 55 } 57 56 58 - if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags)) 57 + down_write(&dvnode->validate_lock); 58 + if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags) && 59 + dvnode->status.data_version == dir_data_version) { 59 60 afs_edit_dir_remove(dvnode, &old->d_name, 60 61 afs_edit_dir_for_silly_0); 61 - if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags)) 62 62 afs_edit_dir_add(dvnode, &new->d_name, 63 63 &vnode->fid, afs_edit_dir_for_silly_1); 64 + } 65 + up_write(&dvnode->validate_lock); 64 66 } 65 67 66 68 kfree(scb); ··· 185 181 clear_bit(AFS_VNODE_CB_PROMISED, &vnode->flags); 186 182 } 187 183 } 188 - if (ret == 0 && 189 - test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags)) 190 - afs_edit_dir_remove(dvnode, &dentry->d_name, 191 - afs_edit_dir_for_unlink); 184 + if (ret == 0) { 185 + down_write(&dvnode->validate_lock); 186 + if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags) && 187 + dvnode->status.data_version == dir_data_version) 188 + afs_edit_dir_remove(dvnode, &dentry->d_name, 189 + afs_edit_dir_for_unlink); 190 + up_write(&dvnode->validate_lock); 191 + } 192 192 } 193 193 194 194 kfree(scb);
+16 -11
fs/afs/fsclient.c
··· 65 65 bool inline_error = (call->operation_ID == afs_FS_InlineBulkStatus); 66 66 u64 data_version, size; 67 67 u32 type, abort_code; 68 + int ret; 68 69 69 70 abort_code = ntohl(xdr->abort_code); 70 71 ··· 79 78 */ 80 79 status->abort_code = abort_code; 81 80 scb->have_error = true; 82 - return 0; 81 + goto good; 83 82 } 84 83 85 84 pr_warn("Unknown AFSFetchStatus version %u\n", ntohl(xdr->if_version)); ··· 88 87 89 88 if (abort_code != 0 && inline_error) { 90 89 status->abort_code = abort_code; 91 - return 0; 90 + scb->have_error = true; 91 + goto good; 92 92 } 93 93 94 94 type = ntohl(xdr->type); ··· 125 123 data_version |= (u64)ntohl(xdr->data_version_hi) << 32; 126 124 status->data_version = data_version; 127 125 scb->have_status = true; 128 - 126 + good: 127 + ret = 0; 128 + advance: 129 129 *_bp = (const void *)*_bp + sizeof(*xdr); 130 - return 0; 130 + return ret; 131 131 132 132 bad: 133 133 xdr_dump_bad(*_bp); 134 - return afs_protocol_error(call, -EBADMSG, afs_eproto_bad_status); 134 + ret = afs_protocol_error(call, -EBADMSG, afs_eproto_bad_status); 135 + goto advance; 135 136 } 136 137 137 138 static time64_t xdr_decode_expiry(struct afs_call *call, u32 expiry) ··· 986 981 if (ret < 0) 987 982 return ret; 988 983 989 - /* unmarshall the reply once we've received all of it */ 984 + /* If the two dirs are the same, we have two copies of the same status 985 + * report, so we just decode it twice. 986 + */ 990 987 bp = call->buffer; 991 988 ret = xdr_decode_AFSFetchStatus(&bp, call, call->out_dir_scb); 992 989 if (ret < 0) 993 990 return ret; 994 - if (call->out_dir_scb != call->out_scb) { 995 - ret = xdr_decode_AFSFetchStatus(&bp, call, call->out_scb); 996 - if (ret < 0) 997 - return ret; 998 - } 991 + ret = xdr_decode_AFSFetchStatus(&bp, call, call->out_scb); 992 + if (ret < 0) 993 + return ret; 999 994 xdr_decode_AFSVolSync(&bp, call->out_volsync); 1000 995 1001 996 _leave(" = 0 [done]");
+14 -12
fs/afs/yfsclient.c
··· 165 165 int i; 166 166 167 167 pr_notice("YFS XDR: Bad status record\n"); 168 - for (i = 0; i < 5 * 4 * 4; i += 16) { 168 + for (i = 0; i < 6 * 4 * 4; i += 16) { 169 169 memcpy(x, bp, 16); 170 170 bp += 4; 171 171 pr_notice("%03x: %08x %08x %08x %08x\n", 172 172 i, ntohl(x[0]), ntohl(x[1]), ntohl(x[2]), ntohl(x[3])); 173 173 } 174 174 175 - memcpy(x, bp, 4); 176 - pr_notice("0x50: %08x\n", ntohl(x[0])); 175 + memcpy(x, bp, 8); 176 + pr_notice("0x60: %08x %08x\n", ntohl(x[0]), ntohl(x[1])); 177 177 } 178 178 179 179 /* ··· 186 186 const struct yfs_xdr_YFSFetchStatus *xdr = (const void *)*_bp; 187 187 struct afs_file_status *status = &scb->status; 188 188 u32 type; 189 + int ret; 189 190 190 191 status->abort_code = ntohl(xdr->abort_code); 191 192 if (status->abort_code != 0) { 192 193 if (status->abort_code == VNOVNODE) 193 194 status->nlink = 0; 194 195 scb->have_error = true; 195 - return 0; 196 + goto good; 196 197 } 197 198 198 199 type = ntohl(xdr->type); ··· 221 220 status->size = xdr_to_u64(xdr->size); 222 221 status->data_version = xdr_to_u64(xdr->data_version); 223 222 scb->have_status = true; 224 - 223 + good: 224 + ret = 0; 225 + advance: 225 226 *_bp += xdr_size(xdr); 226 - return 0; 227 + return ret; 227 228 228 229 bad: 229 230 xdr_dump_bad(*_bp); 230 - return afs_protocol_error(call, -EBADMSG, afs_eproto_bad_status); 231 + ret = afs_protocol_error(call, -EBADMSG, afs_eproto_bad_status); 232 + goto advance; 231 233 } 232 234 233 235 /* ··· 1157 1153 ret = xdr_decode_YFSFetchStatus(&bp, call, call->out_dir_scb); 1158 1154 if (ret < 0) 1159 1155 return ret; 1160 - if (call->out_dir_scb != call->out_scb) { 1161 - ret = xdr_decode_YFSFetchStatus(&bp, call, call->out_scb); 1162 - if (ret < 0) 1163 - return ret; 1164 - } 1156 + ret = xdr_decode_YFSFetchStatus(&bp, call, call->out_scb); 1157 + if (ret < 0) 1158 + return ret; 1165 1159 1166 1160 xdr_decode_YFSVolSync(&bp, call->out_volsync); 1167 1161 _leave(" = 0 [done]");
+1
fs/btrfs/block-group.c
··· 3370 3370 space_info->bytes_reserved > 0 || 3371 3371 space_info->bytes_may_use > 0)) 3372 3372 btrfs_dump_space_info(info, space_info, 0, 0); 3373 + WARN_ON(space_info->reclaim_size > 0); 3373 3374 list_del(&space_info->list); 3374 3375 btrfs_sysfs_remove_space_info(space_info); 3375 3376 }
+15
fs/btrfs/file.c
··· 2098 2098 atomic_inc(&root->log_batch); 2099 2099 2100 2100 /* 2101 + * If the inode needs a full sync, make sure we use a full range to 2102 + * avoid log tree corruption, due to hole detection racing with ordered 2103 + * extent completion for adjacent ranges and races between logging and 2104 + * completion of ordered extents for adjancent ranges - both races 2105 + * could lead to file extent items in the log with overlapping ranges. 2106 + * Do this while holding the inode lock, to avoid races with other 2107 + * tasks. 2108 + */ 2109 + if (test_bit(BTRFS_INODE_NEEDS_FULL_SYNC, 2110 + &BTRFS_I(inode)->runtime_flags)) { 2111 + start = 0; 2112 + end = LLONG_MAX; 2113 + } 2114 + 2115 + /* 2101 2116 * Before we acquired the inode's lock, someone may have dirtied more 2102 2117 * pages in the target range. We need to make sure that writeback for 2103 2118 * any such pages does not start while we are logging the inode, because
+1
fs/btrfs/reflink.c
··· 264 264 size); 265 265 inode_add_bytes(dst, datal); 266 266 set_bit(BTRFS_INODE_NEEDS_FULL_SYNC, &BTRFS_I(dst)->runtime_flags); 267 + ret = btrfs_inode_set_file_extent_range(BTRFS_I(dst), 0, aligned_end); 267 268 out: 268 269 if (!ret && !trans) { 269 270 /*
+19 -4
fs/btrfs/relocation.c
··· 611 611 if (!reloc_root) 612 612 return 0; 613 613 614 - if (btrfs_root_last_snapshot(&reloc_root->root_item) == 615 - root->fs_info->running_transaction->transid - 1) 614 + if (btrfs_header_generation(reloc_root->commit_root) == 615 + root->fs_info->running_transaction->transid) 616 616 return 0; 617 617 /* 618 618 * if there is reloc tree and it was created in previous ··· 1527 1527 int clear_rsv = 0; 1528 1528 int ret; 1529 1529 1530 - if (!rc || !rc->create_reloc_tree || 1531 - root->root_key.objectid == BTRFS_TREE_RELOC_OBJECTID) 1530 + if (!rc) 1532 1531 return 0; 1533 1532 1534 1533 /* ··· 1537 1538 if (reloc_root_is_dead(root)) 1538 1539 return 0; 1539 1540 1541 + /* 1542 + * This is subtle but important. We do not do 1543 + * record_root_in_transaction for reloc roots, instead we record their 1544 + * corresponding fs root, and then here we update the last trans for the 1545 + * reloc root. This means that we have to do this for the entire life 1546 + * of the reloc root, regardless of which stage of the relocation we are 1547 + * in. 1548 + */ 1540 1549 if (root->reloc_root) { 1541 1550 reloc_root = root->reloc_root; 1542 1551 reloc_root->last_trans = trans->transid; 1543 1552 return 0; 1544 1553 } 1554 + 1555 + /* 1556 + * We are merging reloc roots, we do not need new reloc trees. Also 1557 + * reloc trees never need their own reloc tree. 1558 + */ 1559 + if (!rc->create_reloc_tree || 1560 + root->root_key.objectid == BTRFS_TREE_RELOC_OBJECTID) 1561 + return 0; 1545 1562 1546 1563 if (!trans->reloc_reserved) { 1547 1564 rsv = trans->block_rsv;
+14 -6
fs/btrfs/space-info.c
··· 361 361 return 0; 362 362 } 363 363 364 + static void remove_ticket(struct btrfs_space_info *space_info, 365 + struct reserve_ticket *ticket) 366 + { 367 + if (!list_empty(&ticket->list)) { 368 + list_del_init(&ticket->list); 369 + ASSERT(space_info->reclaim_size >= ticket->bytes); 370 + space_info->reclaim_size -= ticket->bytes; 371 + } 372 + } 373 + 364 374 /* 365 375 * This is for space we already have accounted in space_info->bytes_may_use, so 366 376 * basically when we're returning space from block_rsv's. ··· 398 388 btrfs_space_info_update_bytes_may_use(fs_info, 399 389 space_info, 400 390 ticket->bytes); 401 - list_del_init(&ticket->list); 402 - ASSERT(space_info->reclaim_size >= ticket->bytes); 403 - space_info->reclaim_size -= ticket->bytes; 391 + remove_ticket(space_info, ticket); 404 392 ticket->bytes = 0; 405 393 space_info->tickets_id++; 406 394 wake_up(&ticket->wait); ··· 907 899 btrfs_info(fs_info, "failing ticket with %llu bytes", 908 900 ticket->bytes); 909 901 910 - list_del_init(&ticket->list); 902 + remove_ticket(space_info, ticket); 911 903 ticket->error = -ENOSPC; 912 904 wake_up(&ticket->wait); 913 905 ··· 1071 1063 * despite getting an error, resulting in a space leak 1072 1064 * (bytes_may_use counter of our space_info). 1073 1065 */ 1074 - list_del_init(&ticket->list); 1066 + remove_ticket(space_info, ticket); 1075 1067 ticket->error = -EINTR; 1076 1068 break; 1077 1069 } ··· 1129 1121 * either the async reclaim job deletes the ticket from the list 1130 1122 * or we delete it ourselves at wait_reserve_ticket(). 1131 1123 */ 1132 - list_del_init(&ticket->list); 1124 + remove_ticket(space_info, ticket); 1133 1125 if (!ret) 1134 1126 ret = -ENOSPC; 1135 1127 }
+14 -79
fs/btrfs/tree-log.c
··· 96 96 static int btrfs_log_inode(struct btrfs_trans_handle *trans, 97 97 struct btrfs_root *root, struct btrfs_inode *inode, 98 98 int inode_only, 99 - u64 start, 100 - u64 end, 99 + const loff_t start, 100 + const loff_t end, 101 101 struct btrfs_log_ctx *ctx); 102 102 static int link_to_fixup_dir(struct btrfs_trans_handle *trans, 103 103 struct btrfs_root *root, ··· 4533 4533 static int btrfs_log_holes(struct btrfs_trans_handle *trans, 4534 4534 struct btrfs_root *root, 4535 4535 struct btrfs_inode *inode, 4536 - struct btrfs_path *path, 4537 - const u64 start, 4538 - const u64 end) 4536 + struct btrfs_path *path) 4539 4537 { 4540 4538 struct btrfs_fs_info *fs_info = root->fs_info; 4541 4539 struct btrfs_key key; 4542 4540 const u64 ino = btrfs_ino(inode); 4543 4541 const u64 i_size = i_size_read(&inode->vfs_inode); 4544 - u64 prev_extent_end = start; 4542 + u64 prev_extent_end = 0; 4545 4543 int ret; 4546 4544 4547 4545 if (!btrfs_fs_incompat(fs_info, NO_HOLES) || i_size == 0) ··· 4547 4549 4548 4550 key.objectid = ino; 4549 4551 key.type = BTRFS_EXTENT_DATA_KEY; 4550 - key.offset = start; 4552 + key.offset = 0; 4551 4553 4552 4554 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); 4553 4555 if (ret < 0) 4554 4556 return ret; 4555 4557 4556 - if (ret > 0 && path->slots[0] > 0) { 4557 - btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0] - 1); 4558 - if (key.objectid == ino && key.type == BTRFS_EXTENT_DATA_KEY) 4559 - path->slots[0]--; 4560 - } 4561 - 4562 4558 while (true) { 4563 4559 struct extent_buffer *leaf = path->nodes[0]; 4564 - u64 extent_end; 4565 4560 4566 4561 if (path->slots[0] >= btrfs_header_nritems(path->nodes[0])) { 4567 4562 ret = btrfs_next_leaf(root, path); ··· 4571 4580 if (key.objectid != ino || key.type != BTRFS_EXTENT_DATA_KEY) 4572 4581 break; 4573 4582 4574 - extent_end = btrfs_file_extent_end(path); 4575 - if (extent_end <= start) 4576 - goto next_slot; 4577 - 4578 4583 /* We have a hole, log it. */ 4579 4584 if (prev_extent_end < key.offset) { 4580 - u64 hole_len; 4581 - 4582 - if (key.offset >= end) 4583 - hole_len = end - prev_extent_end; 4584 - else 4585 - hole_len = key.offset - prev_extent_end; 4585 + const u64 hole_len = key.offset - prev_extent_end; 4586 4586 4587 4587 /* 4588 4588 * Release the path to avoid deadlocks with other code ··· 4603 4621 leaf = path->nodes[0]; 4604 4622 } 4605 4623 4606 - prev_extent_end = min(extent_end, end); 4607 - if (extent_end >= end) 4608 - break; 4609 - next_slot: 4624 + prev_extent_end = btrfs_file_extent_end(path); 4610 4625 path->slots[0]++; 4611 4626 cond_resched(); 4612 4627 } 4613 4628 4614 - if (prev_extent_end < end && prev_extent_end < i_size) { 4629 + if (prev_extent_end < i_size) { 4615 4630 u64 hole_len; 4616 4631 4617 4632 btrfs_release_path(path); 4618 - hole_len = min(ALIGN(i_size, fs_info->sectorsize), end); 4619 - hole_len -= prev_extent_end; 4633 + hole_len = ALIGN(i_size - prev_extent_end, fs_info->sectorsize); 4620 4634 ret = btrfs_insert_file_extent(trans, root->log_root, 4621 4635 ino, prev_extent_end, 0, 0, 4622 4636 hole_len, 0, hole_len, ··· 4949 4971 const u64 logged_isize, 4950 4972 const bool recursive_logging, 4951 4973 const int inode_only, 4952 - const u64 start, 4953 - const u64 end, 4954 4974 struct btrfs_log_ctx *ctx, 4955 4975 bool *need_log_inode_item) 4956 4976 { ··· 4957 4981 int ins_nr = 0; 4958 4982 int ret; 4959 4983 4960 - /* 4961 - * We must make sure we don't copy extent items that are entirely out of 4962 - * the range [start, end - 1]. This is not just an optimization to avoid 4963 - * copying but also needed to avoid a corruption where we end up with 4964 - * file extent items in the log tree that have overlapping ranges - this 4965 - * can happen if we race with ordered extent completion for ranges that 4966 - * are outside our target range. For example we copy an extent item and 4967 - * when we move to the next leaf, that extent was trimmed and a new one 4968 - * covering a subrange of it, but with a higher key, was inserted - we 4969 - * would then copy this other extent too, resulting in a log tree with 4970 - * 2 extent items that represent overlapping ranges. 4971 - * 4972 - * We can copy the entire extents at the range bondaries however, even 4973 - * if they cover an area outside the target range. That's ok. 4974 - */ 4975 4984 while (1) { 4976 4985 ret = btrfs_search_forward(root, min_key, path, trans->transid); 4977 4986 if (ret < 0) ··· 5024 5063 goto next_slot; 5025 5064 } 5026 5065 5027 - if (min_key->type == BTRFS_EXTENT_DATA_KEY) { 5028 - const u64 extent_end = btrfs_file_extent_end(path); 5029 - 5030 - if (extent_end <= start) { 5031 - if (ins_nr > 0) { 5032 - ret = copy_items(trans, inode, dst_path, 5033 - path, ins_start_slot, 5034 - ins_nr, inode_only, 5035 - logged_isize); 5036 - if (ret < 0) 5037 - return ret; 5038 - ins_nr = 0; 5039 - } 5040 - goto next_slot; 5041 - } 5042 - if (extent_end >= end) { 5043 - ins_nr++; 5044 - if (ins_nr == 1) 5045 - ins_start_slot = path->slots[0]; 5046 - break; 5047 - } 5048 - } 5049 - 5050 5066 if (ins_nr && ins_start_slot + ins_nr == path->slots[0]) { 5051 5067 ins_nr++; 5052 5068 goto next_slot; ··· 5089 5151 static int btrfs_log_inode(struct btrfs_trans_handle *trans, 5090 5152 struct btrfs_root *root, struct btrfs_inode *inode, 5091 5153 int inode_only, 5092 - u64 start, 5093 - u64 end, 5154 + const loff_t start, 5155 + const loff_t end, 5094 5156 struct btrfs_log_ctx *ctx) 5095 5157 { 5096 5158 struct btrfs_fs_info *fs_info = root->fs_info; ··· 5117 5179 btrfs_free_path(path); 5118 5180 return -ENOMEM; 5119 5181 } 5120 - 5121 - start = ALIGN_DOWN(start, fs_info->sectorsize); 5122 - end = ALIGN(end, fs_info->sectorsize); 5123 5182 5124 5183 min_key.objectid = ino; 5125 5184 min_key.type = BTRFS_INODE_ITEM_KEY; ··· 5233 5298 5234 5299 err = copy_inode_items_to_log(trans, inode, &min_key, &max_key, 5235 5300 path, dst_path, logged_isize, 5236 - recursive_logging, inode_only, 5237 - start, end, ctx, &need_log_inode_item); 5301 + recursive_logging, inode_only, ctx, 5302 + &need_log_inode_item); 5238 5303 if (err) 5239 5304 goto out_unlock; 5240 5305 ··· 5247 5312 if (max_key.type >= BTRFS_EXTENT_DATA_KEY && !fast_search) { 5248 5313 btrfs_release_path(path); 5249 5314 btrfs_release_path(dst_path); 5250 - err = btrfs_log_holes(trans, root, inode, path, start, end); 5315 + err = btrfs_log_holes(trans, root, inode, path); 5251 5316 if (err) 5252 5317 goto out_unlock; 5253 5318 }
+11
fs/buffer.c
··· 1371 1371 } 1372 1372 EXPORT_SYMBOL(__breadahead); 1373 1373 1374 + void __breadahead_gfp(struct block_device *bdev, sector_t block, unsigned size, 1375 + gfp_t gfp) 1376 + { 1377 + struct buffer_head *bh = __getblk_gfp(bdev, block, size, gfp); 1378 + if (likely(bh)) { 1379 + ll_rw_block(REQ_OP_READ, REQ_RAHEAD, 1, &bh); 1380 + brelse(bh); 1381 + } 1382 + } 1383 + EXPORT_SYMBOL(__breadahead_gfp); 1384 + 1374 1385 /** 1375 1386 * __bread_gfp() - reads a specified block and returns the bh 1376 1387 * @bdev: the block_device to read from
+2 -2
fs/ceph/dir.c
··· 1051 1051 1052 1052 /* If op failed, mark everyone involved for errors */ 1053 1053 if (result) { 1054 - int pathlen; 1055 - u64 base; 1054 + int pathlen = 0; 1055 + u64 base = 0; 1056 1056 char *path = ceph_mdsc_build_path(req->r_dentry, &pathlen, 1057 1057 &base, 0); 1058 1058
+2 -2
fs/ceph/file.c
··· 527 527 528 528 if (result) { 529 529 struct dentry *dentry = req->r_dentry; 530 - int pathlen; 531 - u64 base; 530 + int pathlen = 0; 531 + u64 base = 0; 532 532 char *path = ceph_mdsc_build_path(req->r_dentry, &pathlen, 533 533 &base, 0); 534 534
+1 -1
fs/ceph/mds_client.h
··· 521 521 522 522 static inline void ceph_mdsc_free_path(char *path, int len) 523 523 { 524 - if (path) 524 + if (!IS_ERR_OR_NULL(path)) 525 525 __putname(path - (PATH_MAX - 1 - len)); 526 526 } 527 527
+4
fs/cifs/cifssmb.c
··· 594 594 cifs_max_pending); 595 595 set_credits(server, server->maxReq); 596 596 server->maxBuf = le16_to_cpu(rsp->MaxBufSize); 597 + /* set up max_read for readpages check */ 598 + server->max_read = server->maxBuf; 597 599 /* even though we do not use raw we might as well set this 598 600 accurately, in case we ever find a need for it */ 599 601 if ((le16_to_cpu(rsp->RawMode) & RAW_ENABLE) == RAW_ENABLE) { ··· 757 755 set_credits(server, server->maxReq); 758 756 /* probably no need to store and check maxvcs */ 759 757 server->maxBuf = le32_to_cpu(pSMBr->MaxBufferSize); 758 + /* set up max_read for readpages check */ 759 + server->max_read = server->maxBuf; 760 760 server->max_rw = le32_to_cpu(pSMBr->MaxRawSize); 761 761 cifs_dbg(NOISY, "Max buf = %d\n", ses->server->maxBuf); 762 762 server->capabilities = le32_to_cpu(pSMBr->Capabilities);
+1 -1
fs/cifs/inode.c
··· 61 61 } 62 62 63 63 /* check if server can support readpages */ 64 - if (cifs_sb_master_tcon(cifs_sb)->ses->server->maxBuf < 64 + if (cifs_sb_master_tcon(cifs_sb)->ses->server->max_read < 65 65 PAGE_SIZE + MAX_CIFS_HDR_SIZE) 66 66 inode->i_data.a_ops = &cifs_addr_ops_smallbuf; 67 67 else
+15
fs/cifs/smb2pdu.c
··· 1552 1552 } 1553 1553 1554 1554 rc = SMB2_sess_establish_session(sess_data); 1555 + #ifdef CONFIG_CIFS_DEBUG_DUMP_KEYS 1556 + if (ses->server->dialect < SMB30_PROT_ID) { 1557 + cifs_dbg(VFS, "%s: dumping generated SMB2 session keys\n", __func__); 1558 + /* 1559 + * The session id is opaque in terms of endianness, so we can't 1560 + * print it as a long long. we dump it as we got it on the wire 1561 + */ 1562 + cifs_dbg(VFS, "Session Id %*ph\n", (int)sizeof(ses->Suid), 1563 + &ses->Suid); 1564 + cifs_dbg(VFS, "Session Key %*ph\n", 1565 + SMB2_NTLMV2_SESSKEY_SIZE, ses->auth_key.response); 1566 + cifs_dbg(VFS, "Signing Key %*ph\n", 1567 + SMB3_SIGN_KEY_SIZE, ses->auth_key.response); 1568 + } 1569 + #endif 1555 1570 out: 1556 1571 kfree(ntlmssp_blob); 1557 1572 SMB2_sess_free_buffer(sess_data);
+2 -2
fs/cifs/smb2transport.c
··· 660 660 return rc; 661 661 662 662 if (memcmp(server_response_sig, shdr->Signature, SMB2_SIGNATURE_SIZE)) { 663 - dump_stack(); 664 - cifs_dbg(VFS, "sign fail cmd 0x%x message id 0x%llx\n", shdr->Command, shdr->MessageId); 663 + cifs_dbg(VFS, "sign fail cmd 0x%x message id 0x%llx\n", 664 + shdr->Command, shdr->MessageId); 665 665 return -EACCES; 666 666 } else 667 667 return 0;
+2 -2
fs/ext4/balloc.c
··· 410 410 * Read the bitmap for a given block_group,and validate the 411 411 * bits for block/inode/inode tables are set in the bitmaps 412 412 * 413 - * Return buffer_head on success or NULL in case of failure. 413 + * Return buffer_head on success or an ERR_PTR in case of failure. 414 414 */ 415 415 struct buffer_head * 416 416 ext4_read_block_bitmap_nowait(struct super_block *sb, ext4_group_t block_group) ··· 502 502 return ERR_PTR(err); 503 503 } 504 504 505 - /* Returns 0 on success, 1 on error */ 505 + /* Returns 0 on success, -errno on error */ 506 506 int ext4_wait_block_bitmap(struct super_block *sb, ext4_group_t block_group, 507 507 struct buffer_head *bh) 508 508 {
-3
fs/ext4/ext4_jbd2.c
··· 338 338 if (inode && inode_needs_sync(inode)) { 339 339 sync_dirty_buffer(bh); 340 340 if (buffer_req(bh) && !buffer_uptodate(bh)) { 341 - struct ext4_super_block *es; 342 - 343 - es = EXT4_SB(inode->i_sb)->s_es; 344 341 ext4_error_inode_err(inode, where, line, 345 342 bh->b_blocknr, EIO, 346 343 "IO error syncing itable block");
+4 -4
fs/ext4/extents.c
··· 3374 3374 (unsigned long long)map->m_lblk, map_len); 3375 3375 3376 3376 sbi = EXT4_SB(inode->i_sb); 3377 - eof_block = (inode->i_size + inode->i_sb->s_blocksize - 1) >> 3378 - inode->i_sb->s_blocksize_bits; 3377 + eof_block = (EXT4_I(inode)->i_disksize + inode->i_sb->s_blocksize - 1) 3378 + >> inode->i_sb->s_blocksize_bits; 3379 3379 if (eof_block < map->m_lblk + map_len) 3380 3380 eof_block = map->m_lblk + map_len; 3381 3381 ··· 3627 3627 __func__, inode->i_ino, 3628 3628 (unsigned long long)map->m_lblk, map->m_len); 3629 3629 3630 - eof_block = (inode->i_size + inode->i_sb->s_blocksize - 1) >> 3631 - inode->i_sb->s_blocksize_bits; 3630 + eof_block = (EXT4_I(inode)->i_disksize + inode->i_sb->s_blocksize - 1) 3631 + >> inode->i_sb->s_blocksize_bits; 3632 3632 if (eof_block < map->m_lblk + map->m_len) 3633 3633 eof_block = map->m_lblk + map->m_len; 3634 3634 /*
+2 -2
fs/ext4/ialloc.c
··· 113 113 * Read the inode allocation bitmap for a given block_group, reading 114 114 * into the specified slot in the superblock's bitmap cache. 115 115 * 116 - * Return buffer_head of bitmap on success or NULL. 116 + * Return buffer_head of bitmap on success, or an ERR_PTR on error. 117 117 */ 118 118 static struct buffer_head * 119 119 ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group) ··· 662 662 * block has been written back to disk. (Yes, these values are 663 663 * somewhat arbitrary...) 664 664 */ 665 - #define RECENTCY_MIN 5 665 + #define RECENTCY_MIN 60 666 666 #define RECENTCY_DIRTY 300 667 667 668 668 static int recently_deleted(struct super_block *sb, ext4_group_t group, int ino)
+2 -2
fs/ext4/inode.c
··· 1973 1973 bool keep_towrite = false; 1974 1974 1975 1975 if (unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb)))) { 1976 - ext4_invalidatepage(page, 0, PAGE_SIZE); 1976 + inode->i_mapping->a_ops->invalidatepage(page, 0, PAGE_SIZE); 1977 1977 unlock_page(page); 1978 1978 return -EIO; 1979 1979 } ··· 4364 4364 if (end > table) 4365 4365 end = table; 4366 4366 while (b <= end) 4367 - sb_breadahead(sb, b++); 4367 + sb_breadahead_unmovable(sb, b++); 4368 4368 } 4369 4369 4370 4370 /*
+4 -2
fs/ext4/mballoc.c
··· 1943 1943 int free; 1944 1944 1945 1945 free = e4b->bd_info->bb_free; 1946 - BUG_ON(free <= 0); 1946 + if (WARN_ON(free <= 0)) 1947 + return; 1947 1948 1948 1949 i = e4b->bd_info->bb_first_free; 1949 1950 ··· 1967 1966 } 1968 1967 1969 1968 mb_find_extent(e4b, i, ac->ac_g_ex.fe_len, &ex); 1970 - BUG_ON(ex.fe_len <= 0); 1969 + if (WARN_ON(ex.fe_len <= 0)) 1970 + break; 1971 1971 if (free < ex.fe_len) { 1972 1972 ext4_grp_locked_error(sb, e4b->bd_group, 0, 0, 1973 1973 "%d free clusters as per "
+1 -3
fs/ext4/super.c
··· 596 596 { 597 597 va_list args; 598 598 struct va_format vaf; 599 - struct ext4_super_block *es; 600 599 struct inode *inode = file_inode(file); 601 600 char pathname[80], *path; 602 601 ··· 603 604 return; 604 605 605 606 trace_ext4_error(inode->i_sb, function, line); 606 - es = EXT4_SB(inode->i_sb)->s_es; 607 607 if (ext4_error_ratelimit(inode->i_sb)) { 608 608 path = file_path(file, pathname, sizeof(pathname)); 609 609 if (IS_ERR(path)) ··· 4338 4340 /* Pre-read the descriptors into the buffer cache */ 4339 4341 for (i = 0; i < db_count; i++) { 4340 4342 block = descriptor_loc(sb, logical_sb_block, i); 4341 - sb_breadahead(sb, block); 4343 + sb_breadahead_unmovable(sb, block); 4342 4344 } 4343 4345 4344 4346 for (i = 0; i < db_count; i++) {
+163 -140
fs/io_uring.c
··· 357 357 struct hrtimer timer; 358 358 struct timespec64 ts; 359 359 enum hrtimer_mode mode; 360 - u32 seq_offset; 361 360 }; 362 361 363 362 struct io_accept { ··· 384 385 struct file *file; 385 386 u64 addr; 386 387 int flags; 387 - unsigned count; 388 + u32 count; 388 389 }; 389 390 390 391 struct io_rw { ··· 507 508 REQ_F_FORCE_ASYNC_BIT = IOSQE_ASYNC_BIT, 508 509 REQ_F_BUFFER_SELECT_BIT = IOSQE_BUFFER_SELECT_BIT, 509 510 511 + REQ_F_LINK_HEAD_BIT, 510 512 REQ_F_LINK_NEXT_BIT, 511 513 REQ_F_FAIL_LINK_BIT, 512 514 REQ_F_INFLIGHT_BIT, ··· 543 543 /* IOSQE_BUFFER_SELECT */ 544 544 REQ_F_BUFFER_SELECT = BIT(REQ_F_BUFFER_SELECT_BIT), 545 545 546 + /* head of a link */ 547 + REQ_F_LINK_HEAD = BIT(REQ_F_LINK_HEAD_BIT), 546 548 /* already grabbed next link */ 547 549 REQ_F_LINK_NEXT = BIT(REQ_F_LINK_NEXT_BIT), 548 550 /* fail rest of links */ ··· 957 955 { 958 956 struct io_ring_ctx *ctx = req->ctx; 959 957 960 - return req->sequence != ctx->cached_cq_tail + ctx->cached_sq_dropped 961 - + atomic_read(&ctx->cached_cq_overflow); 958 + return req->sequence != ctx->cached_cq_tail 959 + + atomic_read(&ctx->cached_cq_overflow); 962 960 } 963 961 964 962 static inline bool req_need_defer(struct io_kiocb *req) ··· 1439 1437 if (ret != -1) { 1440 1438 io_cqring_fill_event(req, -ECANCELED); 1441 1439 io_commit_cqring(ctx); 1442 - req->flags &= ~REQ_F_LINK; 1440 + req->flags &= ~REQ_F_LINK_HEAD; 1443 1441 io_put_req(req); 1444 1442 return true; 1445 1443 } ··· 1475 1473 1476 1474 list_del_init(&req->link_list); 1477 1475 if (!list_empty(&nxt->link_list)) 1478 - nxt->flags |= REQ_F_LINK; 1476 + nxt->flags |= REQ_F_LINK_HEAD; 1479 1477 *nxtptr = nxt; 1480 1478 break; 1481 1479 } ··· 1486 1484 } 1487 1485 1488 1486 /* 1489 - * Called if REQ_F_LINK is set, and we fail the head request 1487 + * Called if REQ_F_LINK_HEAD is set, and we fail the head request 1490 1488 */ 1491 1489 static void io_fail_links(struct io_kiocb *req) 1492 1490 { ··· 1519 1517 1520 1518 static void io_req_find_next(struct io_kiocb *req, struct io_kiocb **nxt) 1521 1519 { 1522 - if (likely(!(req->flags & REQ_F_LINK))) 1520 + if (likely(!(req->flags & REQ_F_LINK_HEAD))) 1523 1521 return; 1524 1522 1525 1523 /* ··· 1671 1669 1672 1670 static inline bool io_req_multi_free(struct req_batch *rb, struct io_kiocb *req) 1673 1671 { 1674 - if ((req->flags & REQ_F_LINK) || io_is_fallback_req(req)) 1672 + if ((req->flags & REQ_F_LINK_HEAD) || io_is_fallback_req(req)) 1675 1673 return false; 1676 1674 1677 1675 if (!(req->flags & REQ_F_FIXED_FILE) || req->io) ··· 2564 2562 2565 2563 req->result = 0; 2566 2564 io_size = ret; 2567 - if (req->flags & REQ_F_LINK) 2565 + if (req->flags & REQ_F_LINK_HEAD) 2568 2566 req->result = io_size; 2569 2567 2570 2568 /* ··· 2655 2653 2656 2654 req->result = 0; 2657 2655 io_size = ret; 2658 - if (req->flags & REQ_F_LINK) 2656 + if (req->flags & REQ_F_LINK_HEAD) 2659 2657 req->result = io_size; 2660 2658 2661 2659 /* ··· 2762 2760 return false; 2763 2761 if (!io_file_supports_async(file)) 2764 2762 return true; 2765 - return !(file->f_mode & O_NONBLOCK); 2763 + return !(file->f_flags & O_NONBLOCK); 2766 2764 } 2767 2765 2768 2766 static int io_splice(struct io_kiocb *req, bool force_nonblock) ··· 4155 4153 return 1; 4156 4154 } 4157 4155 4156 + static bool io_poll_rewait(struct io_kiocb *req, struct io_poll_iocb *poll) 4157 + __acquires(&req->ctx->completion_lock) 4158 + { 4159 + struct io_ring_ctx *ctx = req->ctx; 4160 + 4161 + if (!req->result && !READ_ONCE(poll->canceled)) { 4162 + struct poll_table_struct pt = { ._key = poll->events }; 4163 + 4164 + req->result = vfs_poll(req->file, &pt) & poll->events; 4165 + } 4166 + 4167 + spin_lock_irq(&ctx->completion_lock); 4168 + if (!req->result && !READ_ONCE(poll->canceled)) { 4169 + add_wait_queue(poll->head, &poll->wait); 4170 + return true; 4171 + } 4172 + 4173 + return false; 4174 + } 4175 + 4158 4176 static void io_async_task_func(struct callback_head *cb) 4159 4177 { 4160 4178 struct io_kiocb *req = container_of(cb, struct io_kiocb, task_work); 4161 4179 struct async_poll *apoll = req->apoll; 4162 4180 struct io_ring_ctx *ctx = req->ctx; 4181 + bool canceled; 4163 4182 4164 4183 trace_io_uring_task_run(req->ctx, req->opcode, req->user_data); 4165 4184 4166 - WARN_ON_ONCE(!list_empty(&req->apoll->poll.wait.entry)); 4167 - 4168 - if (hash_hashed(&req->hash_node)) { 4169 - spin_lock_irq(&ctx->completion_lock); 4170 - hash_del(&req->hash_node); 4185 + if (io_poll_rewait(req, &apoll->poll)) { 4171 4186 spin_unlock_irq(&ctx->completion_lock); 4187 + return; 4188 + } 4189 + 4190 + if (hash_hashed(&req->hash_node)) 4191 + hash_del(&req->hash_node); 4192 + 4193 + canceled = READ_ONCE(apoll->poll.canceled); 4194 + if (canceled) { 4195 + io_cqring_fill_event(req, -ECANCELED); 4196 + io_commit_cqring(ctx); 4197 + } 4198 + 4199 + spin_unlock_irq(&ctx->completion_lock); 4200 + 4201 + if (canceled) { 4202 + kfree(apoll); 4203 + io_cqring_ev_posted(ctx); 4204 + req_set_fail_links(req); 4205 + io_put_req(req); 4206 + return; 4172 4207 } 4173 4208 4174 4209 /* restore ->work in case we need to retry again */ ··· 4354 4315 4355 4316 static bool io_poll_remove_one(struct io_kiocb *req) 4356 4317 { 4318 + struct async_poll *apoll = NULL; 4357 4319 bool do_complete; 4358 4320 4359 4321 if (req->opcode == IORING_OP_POLL_ADD) { 4360 4322 do_complete = __io_poll_remove_one(req, &req->poll); 4361 4323 } else { 4324 + apoll = req->apoll; 4362 4325 /* non-poll requests have submit ref still */ 4363 4326 do_complete = __io_poll_remove_one(req, &req->apoll->poll); 4364 4327 if (do_complete) ··· 4368 4327 } 4369 4328 4370 4329 hash_del(&req->hash_node); 4330 + 4331 + if (apoll) { 4332 + /* 4333 + * restore ->work because we need to call io_req_work_drop_env. 4334 + */ 4335 + memcpy(&req->work, &apoll->work, sizeof(req->work)); 4336 + kfree(apoll); 4337 + } 4371 4338 4372 4339 if (do_complete) { 4373 4340 io_cqring_fill_event(req, -ECANCELED); ··· 4391 4342 { 4392 4343 struct hlist_node *tmp; 4393 4344 struct io_kiocb *req; 4394 - int i; 4345 + int posted = 0, i; 4395 4346 4396 4347 spin_lock_irq(&ctx->completion_lock); 4397 4348 for (i = 0; i < (1U << ctx->cancel_hash_bits); i++) { ··· 4399 4350 4400 4351 list = &ctx->cancel_hash[i]; 4401 4352 hlist_for_each_entry_safe(req, tmp, list, hash_node) 4402 - io_poll_remove_one(req); 4353 + posted += io_poll_remove_one(req); 4403 4354 } 4404 4355 spin_unlock_irq(&ctx->completion_lock); 4405 4356 4406 - io_cqring_ev_posted(ctx); 4357 + if (posted) 4358 + io_cqring_ev_posted(ctx); 4407 4359 } 4408 4360 4409 4361 static int io_poll_cancel(struct io_ring_ctx *ctx, __u64 sqe_addr) ··· 4473 4423 struct io_ring_ctx *ctx = req->ctx; 4474 4424 struct io_poll_iocb *poll = &req->poll; 4475 4425 4476 - if (!req->result && !READ_ONCE(poll->canceled)) { 4477 - struct poll_table_struct pt = { ._key = poll->events }; 4478 - 4479 - req->result = vfs_poll(req->file, &pt) & poll->events; 4480 - } 4481 - 4482 - spin_lock_irq(&ctx->completion_lock); 4483 - if (!req->result && !READ_ONCE(poll->canceled)) { 4484 - add_wait_queue(poll->head, &poll->wait); 4426 + if (io_poll_rewait(req, poll)) { 4485 4427 spin_unlock_irq(&ctx->completion_lock); 4486 4428 return; 4487 4429 } 4430 + 4488 4431 hash_del(&req->hash_node); 4489 4432 io_poll_complete(req, req->result, 0); 4490 4433 req->flags |= REQ_F_COMP_LOCKED; ··· 4708 4665 4709 4666 static int io_timeout(struct io_kiocb *req) 4710 4667 { 4711 - unsigned count; 4712 4668 struct io_ring_ctx *ctx = req->ctx; 4713 4669 struct io_timeout_data *data; 4714 4670 struct list_head *entry; 4715 4671 unsigned span = 0; 4672 + u32 count = req->timeout.count; 4673 + u32 seq = req->sequence; 4716 4674 4717 4675 data = &req->io->timeout; 4718 4676 ··· 4722 4678 * timeout event to be satisfied. If it isn't set, then this is 4723 4679 * a pure timeout request, sequence isn't used. 4724 4680 */ 4725 - count = req->timeout.count; 4726 4681 if (!count) { 4727 4682 req->flags |= REQ_F_TIMEOUT_NOSEQ; 4728 4683 spin_lock_irq(&ctx->completion_lock); ··· 4729 4686 goto add; 4730 4687 } 4731 4688 4732 - req->sequence = ctx->cached_sq_head + count - 1; 4733 - data->seq_offset = count; 4689 + req->sequence = seq + count; 4734 4690 4735 4691 /* 4736 4692 * Insertion sort, ensuring the first entry in the list is always ··· 4738 4696 spin_lock_irq(&ctx->completion_lock); 4739 4697 list_for_each_prev(entry, &ctx->timeout_list) { 4740 4698 struct io_kiocb *nxt = list_entry(entry, struct io_kiocb, list); 4741 - unsigned nxt_sq_head; 4699 + unsigned nxt_seq; 4742 4700 long long tmp, tmp_nxt; 4743 - u32 nxt_offset = nxt->io->timeout.seq_offset; 4701 + u32 nxt_offset = nxt->timeout.count; 4744 4702 4745 4703 if (nxt->flags & REQ_F_TIMEOUT_NOSEQ) 4746 4704 continue; 4747 4705 4748 4706 /* 4749 - * Since cached_sq_head + count - 1 can overflow, use type long 4707 + * Since seq + count can overflow, use type long 4750 4708 * long to store it. 4751 4709 */ 4752 - tmp = (long long)ctx->cached_sq_head + count - 1; 4753 - nxt_sq_head = nxt->sequence - nxt_offset + 1; 4754 - tmp_nxt = (long long)nxt_sq_head + nxt_offset - 1; 4710 + tmp = (long long)seq + count; 4711 + nxt_seq = nxt->sequence - nxt_offset; 4712 + tmp_nxt = (long long)nxt_seq + nxt_offset; 4755 4713 4756 4714 /* 4757 4715 * cached_sq_head may overflow, and it will never overflow twice 4758 4716 * once there is some timeout req still be valid. 4759 4717 */ 4760 - if (ctx->cached_sq_head < nxt_sq_head) 4718 + if (seq < nxt_seq) 4761 4719 tmp += UINT_MAX; 4762 4720 4763 4721 if (tmp > tmp_nxt) ··· 5518 5476 { 5519 5477 struct io_kiocb *nxt; 5520 5478 5521 - if (!(req->flags & REQ_F_LINK)) 5479 + if (!(req->flags & REQ_F_LINK_HEAD)) 5522 5480 return NULL; 5523 5481 /* for polled retry, if flag is set, we already went through here */ 5524 5482 if (req->flags & REQ_F_POLLED) ··· 5646 5604 io_queue_sqe(req, NULL); 5647 5605 } 5648 5606 5649 - #define SQE_VALID_FLAGS (IOSQE_FIXED_FILE|IOSQE_IO_DRAIN|IOSQE_IO_LINK| \ 5650 - IOSQE_IO_HARDLINK | IOSQE_ASYNC | \ 5651 - IOSQE_BUFFER_SELECT) 5652 - 5653 - static bool io_submit_sqe(struct io_kiocb *req, const struct io_uring_sqe *sqe, 5607 + static int io_submit_sqe(struct io_kiocb *req, const struct io_uring_sqe *sqe, 5654 5608 struct io_submit_state *state, struct io_kiocb **link) 5655 5609 { 5656 5610 struct io_ring_ctx *ctx = req->ctx; 5657 - unsigned int sqe_flags; 5658 - int ret, id, fd; 5659 - 5660 - sqe_flags = READ_ONCE(sqe->flags); 5661 - 5662 - /* enforce forwards compatibility on users */ 5663 - if (unlikely(sqe_flags & ~SQE_VALID_FLAGS)) { 5664 - ret = -EINVAL; 5665 - goto err_req; 5666 - } 5667 - 5668 - if ((sqe_flags & IOSQE_BUFFER_SELECT) && 5669 - !io_op_defs[req->opcode].buffer_select) { 5670 - ret = -EOPNOTSUPP; 5671 - goto err_req; 5672 - } 5673 - 5674 - id = READ_ONCE(sqe->personality); 5675 - if (id) { 5676 - req->work.creds = idr_find(&ctx->personality_idr, id); 5677 - if (unlikely(!req->work.creds)) { 5678 - ret = -EINVAL; 5679 - goto err_req; 5680 - } 5681 - get_cred(req->work.creds); 5682 - } 5683 - 5684 - /* same numerical values with corresponding REQ_F_*, safe to copy */ 5685 - req->flags |= sqe_flags & (IOSQE_IO_DRAIN | IOSQE_IO_HARDLINK | 5686 - IOSQE_ASYNC | IOSQE_FIXED_FILE | 5687 - IOSQE_BUFFER_SELECT); 5688 - 5689 - fd = READ_ONCE(sqe->fd); 5690 - ret = io_req_set_file(state, req, fd, sqe_flags); 5691 - if (unlikely(ret)) { 5692 - err_req: 5693 - io_cqring_add_event(req, ret); 5694 - io_double_put_req(req); 5695 - return false; 5696 - } 5611 + int ret; 5697 5612 5698 5613 /* 5699 5614 * If we already have a head request, queue this one for async ··· 5669 5670 * next after the link request. The last one is done via 5670 5671 * drain_next flag to persist the effect across calls. 5671 5672 */ 5672 - if (sqe_flags & IOSQE_IO_DRAIN) { 5673 + if (req->flags & REQ_F_IO_DRAIN) { 5673 5674 head->flags |= REQ_F_IO_DRAIN; 5674 5675 ctx->drain_next = 1; 5675 5676 } 5676 - if (io_alloc_async_ctx(req)) { 5677 - ret = -EAGAIN; 5678 - goto err_req; 5679 - } 5677 + if (io_alloc_async_ctx(req)) 5678 + return -EAGAIN; 5680 5679 5681 5680 ret = io_req_defer_prep(req, sqe); 5682 5681 if (ret) { 5683 5682 /* fail even hard links since we don't submit */ 5684 5683 head->flags |= REQ_F_FAIL_LINK; 5685 - goto err_req; 5684 + return ret; 5686 5685 } 5687 5686 trace_io_uring_link(ctx, req, head); 5688 5687 list_add_tail(&req->link_list, &head->link_list); 5689 5688 5690 5689 /* last request of a link, enqueue the link */ 5691 - if (!(sqe_flags & (IOSQE_IO_LINK|IOSQE_IO_HARDLINK))) { 5690 + if (!(req->flags & (REQ_F_LINK | REQ_F_HARDLINK))) { 5692 5691 io_queue_link_head(head); 5693 5692 *link = NULL; 5694 5693 } 5695 5694 } else { 5696 5695 if (unlikely(ctx->drain_next)) { 5697 5696 req->flags |= REQ_F_IO_DRAIN; 5698 - req->ctx->drain_next = 0; 5697 + ctx->drain_next = 0; 5699 5698 } 5700 - if (sqe_flags & (IOSQE_IO_LINK|IOSQE_IO_HARDLINK)) { 5701 - req->flags |= REQ_F_LINK; 5699 + if (req->flags & (REQ_F_LINK | REQ_F_HARDLINK)) { 5700 + req->flags |= REQ_F_LINK_HEAD; 5702 5701 INIT_LIST_HEAD(&req->link_list); 5703 5702 5704 - if (io_alloc_async_ctx(req)) { 5705 - ret = -EAGAIN; 5706 - goto err_req; 5707 - } 5703 + if (io_alloc_async_ctx(req)) 5704 + return -EAGAIN; 5705 + 5708 5706 ret = io_req_defer_prep(req, sqe); 5709 5707 if (ret) 5710 5708 req->flags |= REQ_F_FAIL_LINK; ··· 5711 5715 } 5712 5716 } 5713 5717 5714 - return true; 5718 + return 0; 5715 5719 } 5716 5720 5717 5721 /* ··· 5785 5789 ctx->cached_sq_head++; 5786 5790 } 5787 5791 5788 - static void io_init_req(struct io_ring_ctx *ctx, struct io_kiocb *req, 5789 - const struct io_uring_sqe *sqe) 5792 + #define SQE_VALID_FLAGS (IOSQE_FIXED_FILE|IOSQE_IO_DRAIN|IOSQE_IO_LINK| \ 5793 + IOSQE_IO_HARDLINK | IOSQE_ASYNC | \ 5794 + IOSQE_BUFFER_SELECT) 5795 + 5796 + static int io_init_req(struct io_ring_ctx *ctx, struct io_kiocb *req, 5797 + const struct io_uring_sqe *sqe, 5798 + struct io_submit_state *state, bool async) 5790 5799 { 5800 + unsigned int sqe_flags; 5801 + int id, fd; 5802 + 5791 5803 /* 5792 5804 * All io need record the previous position, if LINK vs DARIN, 5793 5805 * it can be used to mark the position of the first IO in the 5794 5806 * link list. 5795 5807 */ 5796 - req->sequence = ctx->cached_sq_head; 5808 + req->sequence = ctx->cached_sq_head - ctx->cached_sq_dropped; 5797 5809 req->opcode = READ_ONCE(sqe->opcode); 5798 5810 req->user_data = READ_ONCE(sqe->user_data); 5799 5811 req->io = NULL; ··· 5812 5808 refcount_set(&req->refs, 2); 5813 5809 req->task = NULL; 5814 5810 req->result = 0; 5811 + req->needs_fixed_file = async; 5815 5812 INIT_IO_WORK(&req->work, io_wq_submit_work); 5813 + 5814 + if (unlikely(req->opcode >= IORING_OP_LAST)) 5815 + return -EINVAL; 5816 + 5817 + if (io_op_defs[req->opcode].needs_mm && !current->mm) { 5818 + if (unlikely(!mmget_not_zero(ctx->sqo_mm))) 5819 + return -EFAULT; 5820 + use_mm(ctx->sqo_mm); 5821 + } 5822 + 5823 + sqe_flags = READ_ONCE(sqe->flags); 5824 + /* enforce forwards compatibility on users */ 5825 + if (unlikely(sqe_flags & ~SQE_VALID_FLAGS)) 5826 + return -EINVAL; 5827 + 5828 + if ((sqe_flags & IOSQE_BUFFER_SELECT) && 5829 + !io_op_defs[req->opcode].buffer_select) 5830 + return -EOPNOTSUPP; 5831 + 5832 + id = READ_ONCE(sqe->personality); 5833 + if (id) { 5834 + req->work.creds = idr_find(&ctx->personality_idr, id); 5835 + if (unlikely(!req->work.creds)) 5836 + return -EINVAL; 5837 + get_cred(req->work.creds); 5838 + } 5839 + 5840 + /* same numerical values with corresponding REQ_F_*, safe to copy */ 5841 + req->flags |= sqe_flags & (IOSQE_IO_DRAIN | IOSQE_IO_HARDLINK | 5842 + IOSQE_ASYNC | IOSQE_FIXED_FILE | 5843 + IOSQE_BUFFER_SELECT | IOSQE_IO_LINK); 5844 + 5845 + fd = READ_ONCE(sqe->fd); 5846 + return io_req_set_file(state, req, fd, sqe_flags); 5816 5847 } 5817 5848 5818 5849 static int io_submit_sqes(struct io_ring_ctx *ctx, unsigned int nr, 5819 - struct file *ring_file, int ring_fd, 5820 - struct mm_struct **mm, bool async) 5850 + struct file *ring_file, int ring_fd, bool async) 5821 5851 { 5822 5852 struct io_submit_state state, *statep = NULL; 5823 5853 struct io_kiocb *link = NULL; 5824 5854 int i, submitted = 0; 5825 - bool mm_fault = false; 5826 5855 5827 5856 /* if we have a backlog and couldn't flush it all, return BUSY */ 5828 5857 if (test_bit(0, &ctx->sq_check_overflow)) { ··· 5895 5858 break; 5896 5859 } 5897 5860 5898 - io_init_req(ctx, req, sqe); 5861 + err = io_init_req(ctx, req, sqe, statep, async); 5899 5862 io_consume_sqe(ctx); 5900 5863 /* will complete beyond this point, count as submitted */ 5901 5864 submitted++; 5902 5865 5903 - if (unlikely(req->opcode >= IORING_OP_LAST)) { 5904 - err = -EINVAL; 5866 + if (unlikely(err)) { 5905 5867 fail_req: 5906 5868 io_cqring_add_event(req, err); 5907 5869 io_double_put_req(req); 5908 5870 break; 5909 5871 } 5910 5872 5911 - if (io_op_defs[req->opcode].needs_mm && !*mm) { 5912 - mm_fault = mm_fault || !mmget_not_zero(ctx->sqo_mm); 5913 - if (unlikely(mm_fault)) { 5914 - err = -EFAULT; 5915 - goto fail_req; 5916 - } 5917 - use_mm(ctx->sqo_mm); 5918 - *mm = ctx->sqo_mm; 5919 - } 5920 - 5921 - req->needs_fixed_file = async; 5922 5873 trace_io_uring_submit_sqe(ctx, req->opcode, req->user_data, 5923 5874 true, async); 5924 - if (!io_submit_sqe(req, sqe, statep, &link)) 5925 - break; 5875 + err = io_submit_sqe(req, sqe, statep, &link); 5876 + if (err) 5877 + goto fail_req; 5926 5878 } 5927 5879 5928 5880 if (unlikely(submitted != nr)) { ··· 5930 5904 return submitted; 5931 5905 } 5932 5906 5907 + static inline void io_sq_thread_drop_mm(struct io_ring_ctx *ctx) 5908 + { 5909 + struct mm_struct *mm = current->mm; 5910 + 5911 + if (mm) { 5912 + unuse_mm(mm); 5913 + mmput(mm); 5914 + } 5915 + } 5916 + 5933 5917 static int io_sq_thread(void *data) 5934 5918 { 5935 5919 struct io_ring_ctx *ctx = data; 5936 - struct mm_struct *cur_mm = NULL; 5937 5920 const struct cred *old_cred; 5938 5921 mm_segment_t old_fs; 5939 5922 DEFINE_WAIT(wait); ··· 5983 5948 * adding ourselves to the waitqueue, as the unuse/drop 5984 5949 * may sleep. 5985 5950 */ 5986 - if (cur_mm) { 5987 - unuse_mm(cur_mm); 5988 - mmput(cur_mm); 5989 - cur_mm = NULL; 5990 - } 5951 + io_sq_thread_drop_mm(ctx); 5991 5952 5992 5953 /* 5993 5954 * We're polling. If we're within the defined idle ··· 6047 6016 } 6048 6017 6049 6018 mutex_lock(&ctx->uring_lock); 6050 - ret = io_submit_sqes(ctx, to_submit, NULL, -1, &cur_mm, true); 6019 + ret = io_submit_sqes(ctx, to_submit, NULL, -1, true); 6051 6020 mutex_unlock(&ctx->uring_lock); 6052 6021 timeout = jiffies + ctx->sq_thread_idle; 6053 6022 } ··· 6056 6025 task_work_run(); 6057 6026 6058 6027 set_fs(old_fs); 6059 - if (cur_mm) { 6060 - unuse_mm(cur_mm); 6061 - mmput(cur_mm); 6062 - } 6028 + io_sq_thread_drop_mm(ctx); 6063 6029 revert_creds(old_cred); 6064 6030 6065 6031 kthread_parkme(); ··· 7537 7509 wake_up(&ctx->sqo_wait); 7538 7510 submitted = to_submit; 7539 7511 } else if (to_submit) { 7540 - struct mm_struct *cur_mm; 7541 - 7542 7512 mutex_lock(&ctx->uring_lock); 7543 - /* already have mm, so io_submit_sqes() won't try to grab it */ 7544 - cur_mm = ctx->sqo_mm; 7545 - submitted = io_submit_sqes(ctx, to_submit, f.file, fd, 7546 - &cur_mm, false); 7513 + submitted = io_submit_sqes(ctx, to_submit, f.file, fd, false); 7547 7514 mutex_unlock(&ctx->uring_lock); 7548 7515 7549 7516 if (submitted != to_submit)
+2 -1
fs/nfs/pnfs.c
··· 2023 2023 goto lookup_again; 2024 2024 } 2025 2025 2026 + spin_unlock(&ino->i_lock); 2026 2027 first = true; 2027 2028 status = nfs4_select_rw_stateid(ctx->state, 2028 2029 iomode == IOMODE_RW ? FMODE_WRITE : FMODE_READ, ··· 2033 2032 trace_pnfs_update_layout(ino, pos, count, 2034 2033 iomode, lo, lseg, 2035 2034 PNFS_UPDATE_LAYOUT_INVALID_OPEN); 2036 - spin_unlock(&ino->i_lock); 2037 2035 nfs4_schedule_stateid_recovery(server, ctx->state); 2038 2036 pnfs_clear_first_layoutget(lo); 2039 2037 pnfs_put_layout_hdr(lo); 2040 2038 goto lookup_again; 2041 2039 } 2040 + spin_lock(&ino->i_lock); 2042 2041 } else { 2043 2042 nfs4_stateid_copy(&stateid, &lo->plh_stateid); 2044 2043 }
+13 -1
fs/proc/base.c
··· 1573 1573 noffsets = 0; 1574 1574 for (pos = kbuf; pos; pos = next_line) { 1575 1575 struct proc_timens_offset *off = &offsets[noffsets]; 1576 + char clock[10]; 1576 1577 int err; 1577 1578 1578 1579 /* Find the end of line and ensure we don't look past it */ ··· 1585 1584 next_line = NULL; 1586 1585 } 1587 1586 1588 - err = sscanf(pos, "%u %lld %lu", &off->clockid, 1587 + err = sscanf(pos, "%9s %lld %lu", clock, 1589 1588 &off->val.tv_sec, &off->val.tv_nsec); 1590 1589 if (err != 3 || off->val.tv_nsec >= NSEC_PER_SEC) 1591 1590 goto out; 1591 + 1592 + clock[sizeof(clock) - 1] = 0; 1593 + if (strcmp(clock, "monotonic") == 0 || 1594 + strcmp(clock, __stringify(CLOCK_MONOTONIC)) == 0) 1595 + off->clockid = CLOCK_MONOTONIC; 1596 + else if (strcmp(clock, "boottime") == 0 || 1597 + strcmp(clock, __stringify(CLOCK_BOOTTIME)) == 0) 1598 + off->clockid = CLOCK_BOOTTIME; 1599 + else 1600 + goto out; 1601 + 1592 1602 noffsets++; 1593 1603 if (noffsets == ARRAY_SIZE(offsets)) { 1594 1604 if (next_line)
+7
fs/proc/root.c
··· 196 196 if (ns->proc_thread_self) 197 197 dput(ns->proc_thread_self); 198 198 kill_anon_super(sb); 199 + 200 + /* Make the pid namespace safe for the next mount of proc */ 201 + ns->proc_self = NULL; 202 + ns->proc_thread_self = NULL; 203 + ns->pid_gid = GLOBAL_ROOT_GID; 204 + ns->hide_pid = 0; 205 + 199 206 put_pid_ns(ns); 200 207 } 201 208
+10
fs/xfs/xfs_icache.c
··· 911 911 { 912 912 struct xfs_mount *mp = container_of(to_delayed_work(work), 913 913 struct xfs_mount, m_eofblocks_work); 914 + 915 + if (!sb_start_write_trylock(mp->m_super)) 916 + return; 914 917 xfs_icache_free_eofblocks(mp, NULL); 918 + sb_end_write(mp->m_super); 919 + 915 920 xfs_queue_eofblocks(mp); 916 921 } 917 922 ··· 943 938 { 944 939 struct xfs_mount *mp = container_of(to_delayed_work(work), 945 940 struct xfs_mount, m_cowblocks_work); 941 + 942 + if (!sb_start_write_trylock(mp->m_super)) 943 + return; 946 944 xfs_icache_free_cowblocks(mp, NULL); 945 + sb_end_write(mp->m_super); 946 + 947 947 xfs_queue_cowblocks(mp); 948 948 } 949 949
+4 -1
fs/xfs/xfs_ioctl.c
··· 2363 2363 if (error) 2364 2364 return error; 2365 2365 2366 - return xfs_icache_free_eofblocks(mp, &keofb); 2366 + sb_start_write(mp->m_super); 2367 + error = xfs_icache_free_eofblocks(mp, &keofb); 2368 + sb_end_write(mp->m_super); 2369 + return error; 2367 2370 } 2368 2371 2369 2372 default:
+5 -1
fs/xfs/xfs_mount.h
··· 167 167 struct xfs_kobj m_error_meta_kobj; 168 168 struct xfs_error_cfg m_error_cfg[XFS_ERR_CLASS_MAX][XFS_ERR_ERRNO_MAX]; 169 169 struct xstats m_stats; /* per-fs stats */ 170 - struct ratelimit_state m_flush_inodes_ratelimit; 171 170 171 + /* 172 + * Workqueue item so that we can coalesce multiple inode flush attempts 173 + * into a single flush. 174 + */ 175 + struct work_struct m_flush_inodes_work; 172 176 struct workqueue_struct *m_buf_workqueue; 173 177 struct workqueue_struct *m_unwritten_workqueue; 174 178 struct workqueue_struct *m_cil_workqueue;
+1
fs/xfs/xfs_reflink.c
··· 1051 1051 uirec.br_startblock = irec->br_startblock + rlen; 1052 1052 uirec.br_startoff = irec->br_startoff + rlen; 1053 1053 uirec.br_blockcount = unmap_len - rlen; 1054 + uirec.br_state = irec->br_state; 1054 1055 unmap_len = rlen; 1055 1056 1056 1057 /* If this isn't a real mapping, we're done. */
+22 -18
fs/xfs/xfs_super.c
··· 516 516 destroy_workqueue(mp->m_buf_workqueue); 517 517 } 518 518 519 + static void 520 + xfs_flush_inodes_worker( 521 + struct work_struct *work) 522 + { 523 + struct xfs_mount *mp = container_of(work, struct xfs_mount, 524 + m_flush_inodes_work); 525 + struct super_block *sb = mp->m_super; 526 + 527 + if (down_read_trylock(&sb->s_umount)) { 528 + sync_inodes_sb(sb); 529 + up_read(&sb->s_umount); 530 + } 531 + } 532 + 519 533 /* 520 534 * Flush all dirty data to disk. Must not be called while holding an XFS_ILOCK 521 535 * or a page lock. We use sync_inodes_sb() here to ensure we block while waiting ··· 540 526 xfs_flush_inodes( 541 527 struct xfs_mount *mp) 542 528 { 543 - struct super_block *sb = mp->m_super; 544 - 545 - if (!__ratelimit(&mp->m_flush_inodes_ratelimit)) 529 + /* 530 + * If flush_work() returns true then that means we waited for a flush 531 + * which was already in progress. Don't bother running another scan. 532 + */ 533 + if (flush_work(&mp->m_flush_inodes_work)) 546 534 return; 547 535 548 - if (down_read_trylock(&sb->s_umount)) { 549 - sync_inodes_sb(sb); 550 - up_read(&sb->s_umount); 551 - } 536 + queue_work(mp->m_sync_workqueue, &mp->m_flush_inodes_work); 537 + flush_work(&mp->m_flush_inodes_work); 552 538 } 553 539 554 540 /* Catch misguided souls that try to use this interface on XFS */ ··· 1383 1369 if (error) 1384 1370 goto out_free_names; 1385 1371 1386 - /* 1387 - * Cap the number of invocations of xfs_flush_inodes to 16 for every 1388 - * quarter of a second. The magic numbers here were determined by 1389 - * observation neither to cause stalls in writeback when there are a 1390 - * lot of IO threads and the fs is near ENOSPC, nor cause any fstest 1391 - * regressions. YMMV. 1392 - */ 1393 - ratelimit_state_init(&mp->m_flush_inodes_ratelimit, HZ / 4, 16); 1394 - ratelimit_set_flags(&mp->m_flush_inodes_ratelimit, 1395 - RATELIMIT_MSG_ON_RELEASE); 1396 - 1397 1372 error = xfs_init_mount_workqueues(mp); 1398 1373 if (error) 1399 1374 goto out_close_devices; ··· 1755 1752 spin_lock_init(&mp->m_perag_lock); 1756 1753 mutex_init(&mp->m_growlock); 1757 1754 atomic_set(&mp->m_active_trans, 0); 1755 + INIT_WORK(&mp->m_flush_inodes_work, xfs_flush_inodes_worker); 1758 1756 INIT_DELAYED_WORK(&mp->m_reclaim_work, xfs_reclaim_worker); 1759 1757 INIT_DELAYED_WORK(&mp->m_eofblocks_work, xfs_eofblocks_worker); 1760 1758 INIT_DELAYED_WORK(&mp->m_cowblocks_work, xfs_cowblocks_worker);
+1 -1
include/asm-generic/mshyperv.h
··· 163 163 return nr_bank; 164 164 } 165 165 166 - void hyperv_report_panic(struct pt_regs *regs, long err); 166 + void hyperv_report_panic(struct pt_regs *regs, long err, bool in_die); 167 167 void hyperv_report_panic_msg(phys_addr_t pa, size_t size); 168 168 bool hv_is_hyperv_initialized(void); 169 169 bool hv_is_hibernation_supported(void);
+1 -1
include/linux/bio.h
··· 319 319 struct work_struct bip_work; /* I/O completion */ 320 320 321 321 struct bio_vec *bip_vec; 322 - struct bio_vec bip_inline_vecs[0];/* embedded bvec array */ 322 + struct bio_vec bip_inline_vecs[];/* embedded bvec array */ 323 323 }; 324 324 325 325 #if defined(CONFIG_BLK_DEV_INTEGRITY)
+1 -1
include/linux/blk-mq.h
··· 173 173 * blocking (BLK_MQ_F_BLOCKING). Must be the last member - see also 174 174 * blk_mq_hw_ctx_size(). 175 175 */ 176 - struct srcu_struct srcu[0]; 176 + struct srcu_struct srcu[]; 177 177 }; 178 178 179 179 /**
+1 -1
include/linux/blk_types.h
··· 198 198 * double allocations for a small number of bio_vecs. This member 199 199 * MUST obviously be kept at the very end of the bio. 200 200 */ 201 - struct bio_vec bi_inline_vecs[0]; 201 + struct bio_vec bi_inline_vecs[]; 202 202 }; 203 203 204 204 #define BIO_RESET_BYTES offsetof(struct bio, bi_max_vecs)
+8
include/linux/buffer_head.h
··· 189 189 void __brelse(struct buffer_head *); 190 190 void __bforget(struct buffer_head *); 191 191 void __breadahead(struct block_device *, sector_t block, unsigned int size); 192 + void __breadahead_gfp(struct block_device *, sector_t block, unsigned int size, 193 + gfp_t gfp); 192 194 struct buffer_head *__bread_gfp(struct block_device *, 193 195 sector_t block, unsigned size, gfp_t gfp); 194 196 void invalidate_bh_lrus(void); ··· 319 317 sb_breadahead(struct super_block *sb, sector_t block) 320 318 { 321 319 __breadahead(sb->s_bdev, block, sb->s_blocksize); 320 + } 321 + 322 + static inline void 323 + sb_breadahead_unmovable(struct super_block *sb, sector_t block) 324 + { 325 + __breadahead_gfp(sb->s_bdev, block, sb->s_blocksize, 0); 322 326 } 323 327 324 328 static inline struct buffer_head *
+2 -2
include/linux/can/dev/peak_canfd.h
··· 189 189 u8 client; 190 190 __le16 flags; 191 191 __le32 can_id; 192 - u8 d[0]; 192 + u8 d[]; 193 193 }; 194 194 195 195 /* uCAN error types */ ··· 266 266 u8 client; 267 267 __le16 flags; 268 268 __le32 can_id; 269 - u8 d[0]; 269 + u8 d[]; 270 270 }; 271 271 272 272 /* build the cmd opcode_channel field with respect to the correct endianness */
+1 -1
include/linux/cpu_rmap.h
··· 28 28 struct { 29 29 u16 index; 30 30 u16 dist; 31 - } near[0]; 31 + } near[]; 32 32 }; 33 33 #define CPU_RMAP_DIST_INF 0xffff 34 34
+2 -2
include/linux/digsig.h
··· 29 29 uint32_t timestamp; /* key made, always 0 for now */ 30 30 uint8_t algo; 31 31 uint8_t nmpi; 32 - char mpi[0]; 32 + char mpi[]; 33 33 } __packed; 34 34 35 35 struct signature_hdr { ··· 39 39 uint8_t hash; 40 40 uint8_t keyid[8]; 41 41 uint8_t nmpi; 42 - char mpi[0]; 42 + char mpi[]; 43 43 } __packed; 44 44 45 45 #if defined(CONFIG_SIGNATURE) || defined(CONFIG_SIGNATURE_MODULE)
+1 -1
include/linux/dirent.h
··· 7 7 s64 d_off; 8 8 unsigned short d_reclen; 9 9 unsigned char d_type; 10 - char d_name[0]; 10 + char d_name[]; 11 11 }; 12 12 13 13 #endif
+1 -1
include/linux/enclosure.h
··· 101 101 struct device edev; 102 102 struct enclosure_component_callbacks *cb; 103 103 int components; 104 - struct enclosure_component component[0]; 104 + struct enclosure_component component[]; 105 105 }; 106 106 107 107 static inline struct enclosure_device *
+1 -1
include/linux/energy_model.h
··· 36 36 struct em_perf_domain { 37 37 struct em_cap_state *table; 38 38 int nr_cap_states; 39 - unsigned long cpus[0]; 39 + unsigned long cpus[]; 40 40 }; 41 41 42 42 #ifdef CONFIG_ENERGY_MODEL
+2 -2
include/linux/ethtool.h
··· 35 35 compat_u64 data; 36 36 struct compat_ethtool_rx_flow_spec fs; 37 37 u32 rule_cnt; 38 - u32 rule_locs[0]; 38 + u32 rule_locs[]; 39 39 }; 40 40 41 41 #endif /* CONFIG_COMPAT */ ··· 462 462 463 463 struct ethtool_rx_flow_rule { 464 464 struct flow_rule *rule; 465 - unsigned long priv[0]; 465 + unsigned long priv[]; 466 466 }; 467 467 468 468 struct ethtool_rx_flow_spec_input {
+1 -1
include/linux/genalloc.h
··· 76 76 void *owner; /* private data to retrieve at alloc time */ 77 77 unsigned long start_addr; /* start address of memory chunk */ 78 78 unsigned long end_addr; /* end address of memory chunk (inclusive) */ 79 - unsigned long bits[0]; /* bitmap for allocating memory chunk */ 79 + unsigned long bits[]; /* bitmap for allocating memory chunk */ 80 80 }; 81 81 82 82 /*
-6
include/linux/i2c.h
··· 461 461 unsigned short const *addr_list, 462 462 int (*probe)(struct i2c_adapter *adap, unsigned short addr)); 463 463 464 - struct i2c_client * 465 - i2c_new_probed_device(struct i2c_adapter *adap, 466 - struct i2c_board_info *info, 467 - unsigned short const *addr_list, 468 - int (*probe)(struct i2c_adapter *adap, unsigned short addr)); 469 - 470 464 /* Common custom probe functions */ 471 465 int i2c_probe_func_quick_read(struct i2c_adapter *adap, unsigned short addr); 472 466
+1 -1
include/linux/igmp.h
··· 38 38 unsigned int sl_max; 39 39 unsigned int sl_count; 40 40 struct rcu_head rcu; 41 - __be32 sl_addr[0]; 41 + __be32 sl_addr[]; 42 42 }; 43 43 44 44 #define IP_SFLSIZE(count) (sizeof(struct ip_sf_socklist) + \
+1 -1
include/linux/ihex.h
··· 18 18 struct ihex_binrec { 19 19 __be32 addr; 20 20 __be16 len; 21 - uint8_t data[0]; 21 + uint8_t data[]; 22 22 } __attribute__((packed)); 23 23 24 24 static inline uint16_t ihex_binrec_size(const struct ihex_binrec *p)
+2 -4
include/linux/irq.h
··· 573 573 #define IRQ_DEFAULT_INIT_FLAGS ARCH_IRQ_INIT_FLAGS 574 574 575 575 struct irqaction; 576 - extern int setup_irq(unsigned int irq, struct irqaction *new); 577 - extern void remove_irq(unsigned int irq, struct irqaction *act); 578 576 extern int setup_percpu_irq(unsigned int irq, struct irqaction *new); 579 577 extern void remove_percpu_irq(unsigned int irq, struct irqaction *act); 580 578 ··· 1041 1043 unsigned long unused; 1042 1044 struct irq_domain *domain; 1043 1045 struct list_head list; 1044 - struct irq_chip_type chip_types[0]; 1046 + struct irq_chip_type chip_types[]; 1045 1047 }; 1046 1048 1047 1049 /** ··· 1077 1079 unsigned int irq_flags_to_clear; 1078 1080 unsigned int irq_flags_to_set; 1079 1081 enum irq_gc_flags gc_flags; 1080 - struct irq_chip_generic *gc[0]; 1082 + struct irq_chip_generic *gc[]; 1081 1083 }; 1082 1084 1083 1085 /* Generic chip callback functions */
+2
include/linux/irqchip/arm-gic-v3.h
··· 243 243 244 244 #define GICR_TYPER_PLPIS (1U << 0) 245 245 #define GICR_TYPER_VLPIS (1U << 1) 246 + #define GICR_TYPER_DIRTY (1U << 2) 246 247 #define GICR_TYPER_DirectLPIS (1U << 3) 247 248 #define GICR_TYPER_LAST (1U << 4) 248 249 #define GICR_TYPER_RVPEID (1U << 7) ··· 687 686 bool has_vlpis; 688 687 bool has_rvpeid; 689 688 bool has_direct_lpi; 689 + bool has_vpend_valid_dirty; 690 690 }; 691 691 692 692 struct irq_domain;
+1 -1
include/linux/list_lru.h
··· 34 34 struct list_lru_memcg { 35 35 struct rcu_head rcu; 36 36 /* array of per cgroup lists, indexed by memcg_cache_id */ 37 - struct list_lru_one *lru[0]; 37 + struct list_lru_one *lru[]; 38 38 }; 39 39 40 40 struct list_lru_node {
+2 -2
include/linux/memcontrol.h
··· 106 106 */ 107 107 struct memcg_shrinker_map { 108 108 struct rcu_head rcu; 109 - unsigned long map[0]; 109 + unsigned long map[]; 110 110 }; 111 111 112 112 /* ··· 148 148 /* Size of entries[] */ 149 149 unsigned int size; 150 150 /* Array of thresholds */ 151 - struct mem_cgroup_threshold entries[0]; 151 + struct mem_cgroup_threshold entries[]; 152 152 }; 153 153 154 154 struct mem_cgroup_thresholds {
+1 -1
include/linux/platform_data/wilco-ec.h
··· 83 83 u16 result; 84 84 u16 data_size; 85 85 u8 reserved[2]; 86 - u8 data[0]; 86 + u8 data[]; 87 87 } __packed; 88 88 89 89 /**
+1 -1
include/linux/posix_acl.h
··· 28 28 refcount_t a_refcount; 29 29 struct rcu_head a_rcu; 30 30 unsigned int a_count; 31 - struct posix_acl_entry a_entries[0]; 31 + struct posix_acl_entry a_entries[]; 32 32 }; 33 33 34 34 #define FOREACH_ACL_ENTRY(pa, acl, pe) \
+3
include/linux/property.h
··· 440 440 int software_node_register_nodes(const struct software_node *nodes); 441 441 void software_node_unregister_nodes(const struct software_node *nodes); 442 442 443 + int software_node_register_node_group(const struct software_node **node_group); 444 + void software_node_unregister_node_group(const struct software_node **node_group); 445 + 443 446 int software_node_register(const struct software_node *node); 444 447 445 448 int software_node_notify(struct device *dev, unsigned long action);
+2 -2
include/linux/rio.h
··· 100 100 u32 port_ok; 101 101 struct rio_switch_ops *ops; 102 102 spinlock_t lock; 103 - struct rio_dev *nextdev[0]; 103 + struct rio_dev *nextdev[]; 104 104 }; 105 105 106 106 /** ··· 201 201 u8 hopcount; 202 202 struct rio_dev *prev; 203 203 atomic_t state; 204 - struct rio_switch rswitch[0]; /* RIO switch info */ 204 + struct rio_switch rswitch[]; /* RIO switch info */ 205 205 }; 206 206 207 207 #define rio_dev_g(n) list_entry(n, struct rio_dev, global_list)
+1 -1
include/linux/rslib.h
··· 54 54 */ 55 55 struct rs_control { 56 56 struct rs_codec *codec; 57 - uint16_t buffers[0]; 57 + uint16_t buffers[]; 58 58 }; 59 59 60 60 /* General purpose RS codec, 8-bit data width, symbol width 1-15 bit */
+1 -1
include/linux/sched/topology.h
··· 142 142 * by attaching extra space to the end of the structure, 143 143 * depending on how many CPUs the kernel has booted up with) 144 144 */ 145 - unsigned long span[0]; 145 + unsigned long span[]; 146 146 }; 147 147 148 148 static inline struct cpumask *sched_domain_span(struct sched_domain *sd)
+1 -1
include/linux/skbuff.h
··· 4162 4162 refcount_t refcnt; 4163 4163 u8 offset[SKB_EXT_NUM]; /* in chunks of 8 bytes */ 4164 4164 u8 chunks; /* same */ 4165 - char data[0] __aligned(8); 4165 + char data[] __aligned(8); 4166 4166 }; 4167 4167 4168 4168 struct skb_ext *__skb_ext_alloc(void);
+1 -1
include/linux/swap.h
··· 275 275 */ 276 276 struct work_struct discard_work; /* discard worker */ 277 277 struct swap_cluster_list discard_clusters; /* discard clusters list */ 278 - struct plist_node avail_lists[0]; /* 278 + struct plist_node avail_lists[]; /* 279 279 * entries in swap_avail_heads, one 280 280 * entry per node. 281 281 * Must be last as the number of the
+3 -3
include/linux/tpm_eventlog.h
··· 28 28 u32 event_type; 29 29 u8 pcr_value[20]; /* SHA1 */ 30 30 u32 event_size; 31 - u8 event_data[0]; 31 + u8 event_data[]; 32 32 }; 33 33 34 34 enum tcpa_event_types { ··· 55 55 struct tcpa_pc_event { 56 56 u32 event_id; 57 57 u32 event_size; 58 - u8 event_data[0]; 58 + u8 event_data[]; 59 59 }; 60 60 61 61 enum tcpa_pc_event_ids { ··· 102 102 103 103 struct tcg_event_field { 104 104 u32 event_size; 105 - u8 event[0]; 105 + u8 event[]; 106 106 } __packed; 107 107 108 108 struct tcg_pcr_event2_head {
+1 -1
include/linux/xattr.h
··· 73 73 struct list_head list; 74 74 char *name; 75 75 size_t size; 76 - char value[0]; 76 + char value[]; 77 77 }; 78 78 79 79 /*
+10
include/net/cfg80211.h
··· 905 905 * protocol frames. 906 906 * @control_port_over_nl80211: TRUE if userspace expects to exchange control 907 907 * port frames over NL80211 instead of the network interface. 908 + * @control_port_no_preauth: disables pre-auth rx over the nl80211 control 909 + * port for mac80211 908 910 * @wep_keys: static WEP keys, if not NULL points to an array of 909 911 * CFG80211_MAX_WEP_KEYS WEP keys 910 912 * @wep_tx_key: key index (0..3) of the default TX static WEP key ··· 1224 1222 * @he_capa: HE capabilities of station 1225 1223 * @he_capa_len: the length of the HE capabilities 1226 1224 * @airtime_weight: airtime scheduler weight for this station 1225 + * @txpwr: transmit power for an associated station 1227 1226 */ 1228 1227 struct station_parameters { 1229 1228 const u8 *supported_rates; ··· 4669 4666 * @txq_memory_limit: configuration internal TX queue memory limit 4670 4667 * @txq_quantum: configuration of internal TX queue scheduler quantum 4671 4668 * 4669 + * @tx_queue_len: allow setting transmit queue len for drivers not using 4670 + * wake_tx_queue 4671 + * 4672 4672 * @support_mbssid: can HW support association with nontransmitted AP 4673 4673 * @support_only_he_mbssid: don't parse MBSSID elements if it is not 4674 4674 * HE AP, in order to avoid compatibility issues. ··· 4687 4681 * supported by the driver for each peer 4688 4682 * @tid_config_support.max_retry: maximum supported retry count for 4689 4683 * long/short retry configuration 4684 + * 4685 + * @max_data_retry_count: maximum supported per TID retry count for 4686 + * configuration through the %NL80211_TID_CONFIG_ATTR_RETRY_SHORT and 4687 + * %NL80211_TID_CONFIG_ATTR_RETRY_LONG attributes 4690 4688 */ 4691 4689 struct wiphy { 4692 4690 /* assign these fields before you register the wiphy */
+1
include/net/ip6_route.h
··· 254 254 255 255 return rt->rt6i_flags & RTF_ANYCAST || 256 256 (rt->rt6i_dst.plen < 127 && 257 + !(rt->rt6i_flags & (RTF_GATEWAY | RTF_NONEXTHOP)) && 257 258 ipv6_addr_equal(&rt->rt6i_dst.addr, daddr)); 258 259 } 259 260
+1 -1
include/net/netfilter/nf_tables.h
··· 901 901 { 902 902 struct nft_expr *expr; 903 903 904 - if (nft_set_ext_exists(ext, NFT_SET_EXT_EXPR)) { 904 + if (__nft_set_ext_exists(ext, NFT_SET_EXT_EXPR)) { 905 905 expr = nft_set_ext_expr(ext); 906 906 expr->ops->eval(expr, regs, pkt); 907 907 }
+3 -3
include/net/sock.h
··· 2553 2553 } 2554 2554 2555 2555 /** 2556 - * skb_steal_sock 2557 - * @skb to steal the socket from 2558 - * @refcounted is set to true if the socket is reference-counted 2556 + * skb_steal_sock - steal a socket from an sk_buff 2557 + * @skb: sk_buff to steal the socket from 2558 + * @refcounted: is set to true if the socket is reference-counted 2559 2559 */ 2560 2560 static inline struct sock * 2561 2561 skb_steal_sock(struct sk_buff *skb, bool *refcounted)
+3 -1
include/soc/mscc/ocelot.h
··· 476 476 477 477 void __iomem *regs; 478 478 479 + bool vlan_aware; 480 + 479 481 /* Ingress default VLAN (pvid) */ 480 482 u16 pvid; 481 483 ··· 612 610 int ocelot_fdb_dump(struct ocelot *ocelot, int port, 613 611 dsa_fdb_dump_cb_t *cb, void *data); 614 612 int ocelot_fdb_add(struct ocelot *ocelot, int port, 615 - const unsigned char *addr, u16 vid, bool vlan_aware); 613 + const unsigned char *addr, u16 vid); 616 614 int ocelot_fdb_del(struct ocelot *ocelot, int port, 617 615 const unsigned char *addr, u16 vid); 618 616 int ocelot_vlan_add(struct ocelot *ocelot, int port, u16 vid, bool pvid,
+5
include/sound/hda_codec.h
··· 494 494 static inline void snd_hda_set_power_save(struct hda_bus *bus, int delay) {} 495 495 #endif 496 496 497 + static inline bool hda_codec_need_resume(struct hda_codec *codec) 498 + { 499 + return !codec->relaxed_resume && codec->jacktbl.used; 500 + } 501 + 497 502 #ifdef CONFIG_SND_HDA_PATCH_LOADER 498 503 /* 499 504 * patch firmware
+4 -4
include/trace/events/wbt.h
··· 46 46 ), 47 47 48 48 TP_printk("%s: rmean=%llu, rmin=%llu, rmax=%llu, rsamples=%llu, " 49 - "wmean=%llu, wmin=%llu, wmax=%llu, wsamples=%llu\n", 49 + "wmean=%llu, wmin=%llu, wmax=%llu, wsamples=%llu", 50 50 __entry->name, __entry->rmean, __entry->rmin, __entry->rmax, 51 51 __entry->rnr_samples, __entry->wmean, __entry->wmin, 52 52 __entry->wmax, __entry->wnr_samples) ··· 73 73 __entry->lat = div_u64(lat, 1000); 74 74 ), 75 75 76 - TP_printk("%s: latency %lluus\n", __entry->name, 76 + TP_printk("%s: latency %lluus", __entry->name, 77 77 (unsigned long long) __entry->lat) 78 78 ); 79 79 ··· 115 115 __entry->max = max; 116 116 ), 117 117 118 - TP_printk("%s: %s: step=%d, window=%luus, background=%u, normal=%u, max=%u\n", 118 + TP_printk("%s: %s: step=%d, window=%luus, background=%u, normal=%u, max=%u", 119 119 __entry->name, __entry->msg, __entry->step, __entry->window, 120 120 __entry->bg, __entry->normal, __entry->max) 121 121 ); ··· 148 148 __entry->inflight = inflight; 149 149 ), 150 150 151 - TP_printk("%s: status=%u, step=%d, inflight=%u\n", __entry->name, 151 + TP_printk("%s: status=%u, step=%d, inflight=%u", __entry->name, 152 152 __entry->status, __entry->step, __entry->inflight) 153 153 ); 154 154
+4 -6
include/uapi/linux/btrfs.h
··· 36 36 #define BTRFS_DEVICE_PATH_NAME_MAX 1024 37 37 #define BTRFS_SUBVOL_NAME_MAX 4039 38 38 39 - /* 40 - * Deprecated since 5.7: 41 - * 42 - * BTRFS_SUBVOL_CREATE_ASYNC (1ULL << 0) 43 - */ 44 - 39 + #ifndef __KERNEL__ 40 + /* Deprecated since 5.7 */ 41 + # define BTRFS_SUBVOL_CREATE_ASYNC (1ULL << 0) 42 + #endif 45 43 #define BTRFS_SUBVOL_RDONLY (1ULL << 1) 46 44 #define BTRFS_SUBVOL_QGROUP_INHERIT (1ULL << 2) 47 45
+2 -2
include/uapi/linux/dlm_device.h
··· 45 45 void __user *bastaddr; 46 46 struct dlm_lksb __user *lksb; 47 47 char lvb[DLM_USER_LVB_LEN]; 48 - char name[0]; 48 + char name[]; 49 49 }; 50 50 51 51 struct dlm_lspace_params { 52 52 __u32 flags; 53 53 __u32 minor; 54 - char name[0]; 54 + char name[]; 55 55 }; 56 56 57 57 struct dlm_purge_params {
+1 -1
include/uapi/linux/fiemap.h
··· 34 34 __u32 fm_mapped_extents;/* number of extents that were mapped (out) */ 35 35 __u32 fm_extent_count; /* size of fm_extents array (in) */ 36 36 __u32 fm_reserved; 37 - struct fiemap_extent fm_extents[0]; /* array of mapped extents (out) */ 37 + struct fiemap_extent fm_extents[]; /* array of mapped extents (out) */ 38 38 }; 39 39 40 40 #define FIEMAP_MAX_OFFSET (~0ULL)
+2
include/uapi/linux/netfilter/nf_tables.h
··· 276 276 * @NFT_SET_TIMEOUT: set uses timeouts 277 277 * @NFT_SET_EVAL: set can be updated from the evaluation path 278 278 * @NFT_SET_OBJECT: set contains stateful objects 279 + * @NFT_SET_CONCAT: set contains a concatenation 279 280 */ 280 281 enum nft_set_flags { 281 282 NFT_SET_ANONYMOUS = 0x1, ··· 286 285 NFT_SET_TIMEOUT = 0x10, 287 286 NFT_SET_EVAL = 0x20, 288 287 NFT_SET_OBJECT = 0x40, 288 + NFT_SET_CONCAT = 0x80, 289 289 }; 290 290 291 291 /**
+1
include/uapi/linux/netfilter/xt_IDLETIMER.h
··· 48 48 49 49 char label[MAX_IDLETIMER_LABEL_SIZE]; 50 50 51 + __u8 send_nl_msg; /* unused: for compatibility with Android */ 51 52 __u8 timer_type; 52 53 53 54 /* for kernel module internal use only */
+1 -1
kernel/bpf/bpf_lru_list.h
··· 30 30 struct bpf_lru_list { 31 31 struct list_head lists[NR_BPF_LRU_LIST_T]; 32 32 unsigned int counts[NR_BPF_LRU_LIST_COUNT]; 33 - /* The next inacitve list rotation starts from here */ 33 + /* The next inactive list rotation starts from here */ 34 34 struct list_head *next_inactive_rotation; 35 35 36 36 raw_spinlock_t lock ____cacheline_aligned_in_smp;
+7 -9
kernel/bpf/syscall.c
··· 586 586 { 587 587 struct bpf_map *map = vma->vm_file->private_data; 588 588 589 - bpf_map_inc_with_uref(map); 590 - 591 - if (vma->vm_flags & VM_WRITE) { 589 + if (vma->vm_flags & VM_MAYWRITE) { 592 590 mutex_lock(&map->freeze_mutex); 593 591 map->writecnt++; 594 592 mutex_unlock(&map->freeze_mutex); ··· 598 600 { 599 601 struct bpf_map *map = vma->vm_file->private_data; 600 602 601 - if (vma->vm_flags & VM_WRITE) { 603 + if (vma->vm_flags & VM_MAYWRITE) { 602 604 mutex_lock(&map->freeze_mutex); 603 605 map->writecnt--; 604 606 mutex_unlock(&map->freeze_mutex); 605 607 } 606 - 607 - bpf_map_put_with_uref(map); 608 608 } 609 609 610 610 static const struct vm_operations_struct bpf_map_default_vmops = { ··· 631 635 /* set default open/close callbacks */ 632 636 vma->vm_ops = &bpf_map_default_vmops; 633 637 vma->vm_private_data = map; 638 + vma->vm_flags &= ~VM_MAYEXEC; 639 + if (!(vma->vm_flags & VM_WRITE)) 640 + /* disallow re-mapping with PROT_WRITE */ 641 + vma->vm_flags &= ~VM_MAYWRITE; 634 642 635 643 err = map->ops->map_mmap(map, vma); 636 644 if (err) 637 645 goto out; 638 646 639 - bpf_map_inc_with_uref(map); 640 - 641 - if (vma->vm_flags & VM_WRITE) 647 + if (vma->vm_flags & VM_MAYWRITE) 642 648 map->writecnt++; 643 649 out: 644 650 mutex_unlock(&map->freeze_mutex);
+1 -2
kernel/bpf/verifier.c
··· 1255 1255 reg->type = SCALAR_VALUE; 1256 1256 reg->var_off = tnum_unknown; 1257 1257 reg->frameno = 0; 1258 - reg->precise = env->subprog_cnt > 1 || !env->allow_ptr_leaks ? 1259 - true : false; 1258 + reg->precise = env->subprog_cnt > 1 || !env->allow_ptr_leaks; 1260 1259 __mark_reg_unbounded(reg); 1261 1260 } 1262 1261
+10 -1
kernel/fork.c
··· 2605 2605 struct clone_args args; 2606 2606 pid_t *kset_tid = kargs->set_tid; 2607 2607 2608 + BUILD_BUG_ON(offsetofend(struct clone_args, tls) != 2609 + CLONE_ARGS_SIZE_VER0); 2610 + BUILD_BUG_ON(offsetofend(struct clone_args, set_tid_size) != 2611 + CLONE_ARGS_SIZE_VER1); 2612 + BUILD_BUG_ON(offsetofend(struct clone_args, cgroup) != 2613 + CLONE_ARGS_SIZE_VER2); 2614 + BUILD_BUG_ON(sizeof(struct clone_args) != CLONE_ARGS_SIZE_VER2); 2615 + 2608 2616 if (unlikely(usize > PAGE_SIZE)) 2609 2617 return -E2BIG; 2610 2618 if (unlikely(usize < CLONE_ARGS_SIZE_VER0)) ··· 2639 2631 !valid_signal(args.exit_signal))) 2640 2632 return -EINVAL; 2641 2633 2642 - if ((args.flags & CLONE_INTO_CGROUP) && args.cgroup < 0) 2634 + if ((args.flags & CLONE_INTO_CGROUP) && 2635 + (args.cgroup > INT_MAX || usize < CLONE_ARGS_SIZE_VER2)) 2643 2636 return -EINVAL; 2644 2637 2645 2638 *kargs = (struct kernel_clone_args){
-44
kernel/irq/manage.c
··· 1690 1690 return ret; 1691 1691 } 1692 1692 1693 - /** 1694 - * setup_irq - setup an interrupt 1695 - * @irq: Interrupt line to setup 1696 - * @act: irqaction for the interrupt 1697 - * 1698 - * Used to statically setup interrupts in the early boot process. 1699 - */ 1700 - int setup_irq(unsigned int irq, struct irqaction *act) 1701 - { 1702 - int retval; 1703 - struct irq_desc *desc = irq_to_desc(irq); 1704 - 1705 - if (!desc || WARN_ON(irq_settings_is_per_cpu_devid(desc))) 1706 - return -EINVAL; 1707 - 1708 - retval = irq_chip_pm_get(&desc->irq_data); 1709 - if (retval < 0) 1710 - return retval; 1711 - 1712 - retval = __setup_irq(irq, desc, act); 1713 - 1714 - if (retval) 1715 - irq_chip_pm_put(&desc->irq_data); 1716 - 1717 - return retval; 1718 - } 1719 - EXPORT_SYMBOL_GPL(setup_irq); 1720 - 1721 1693 /* 1722 1694 * Internal function to unregister an irqaction - used to free 1723 1695 * regular and special interrupts that are part of the architecture. ··· 1829 1857 kfree(action->secondary); 1830 1858 return action; 1831 1859 } 1832 - 1833 - /** 1834 - * remove_irq - free an interrupt 1835 - * @irq: Interrupt line to free 1836 - * @act: irqaction for the interrupt 1837 - * 1838 - * Used to remove interrupts statically setup by the early boot process. 1839 - */ 1840 - void remove_irq(unsigned int irq, struct irqaction *act) 1841 - { 1842 - struct irq_desc *desc = irq_to_desc(irq); 1843 - 1844 - if (desc && !WARN_ON(irq_settings_is_per_cpu_devid(desc))) 1845 - __free_irq(desc, act->dev_id); 1846 - } 1847 - EXPORT_SYMBOL_GPL(remove_irq); 1848 1860 1849 1861 /** 1850 1862 * free_irq - free an interrupt allocated with request_irq
+1 -1
kernel/rcu/tree.c
··· 825 825 rcu_cleanup_after_idle(); 826 826 827 827 incby = 1; 828 - } else if (tick_nohz_full_cpu(rdp->cpu) && 828 + } else if (irq && tick_nohz_full_cpu(rdp->cpu) && 829 829 rdp->dynticks_nmi_nesting == DYNTICK_IRQ_NONIDLE && 830 830 READ_ONCE(rdp->rcu_urgent_qs) && 831 831 !READ_ONCE(rdp->rcu_forced_tick)) {
+2 -2
kernel/sched/cputime.c
··· 1003 1003 enum cpu_usage_stat usage, int cpu) 1004 1004 { 1005 1005 u64 *cpustat = kcpustat->cpustat; 1006 + u64 val = cpustat[usage]; 1006 1007 struct rq *rq; 1007 - u64 val; 1008 1008 int err; 1009 1009 1010 1010 if (!vtime_accounting_enabled_cpu(cpu)) 1011 - return cpustat[usage]; 1011 + return val; 1012 1012 1013 1013 rq = cpu_rq(cpu); 1014 1014
+19 -2
kernel/sched/isolation.c
··· 149 149 static int __init housekeeping_isolcpus_setup(char *str) 150 150 { 151 151 unsigned int flags = 0; 152 + bool illegal = false; 153 + char *par; 154 + int len; 152 155 153 156 while (isalpha(*str)) { 154 157 if (!strncmp(str, "nohz,", 5)) { ··· 172 169 continue; 173 170 } 174 171 175 - pr_warn("isolcpus: Error, unknown flag\n"); 176 - return 0; 172 + /* 173 + * Skip unknown sub-parameter and validate that it is not 174 + * containing an invalid character. 175 + */ 176 + for (par = str, len = 0; *str && *str != ','; str++, len++) { 177 + if (!isalpha(*str) && *str != '_') 178 + illegal = true; 179 + } 180 + 181 + if (illegal) { 182 + pr_warn("isolcpus: Invalid flag %.*s\n", len, par); 183 + return 0; 184 + } 185 + 186 + pr_info("isolcpus: Skipped unknown flag %.*s\n", len, par); 187 + str++; 177 188 } 178 189 179 190 /* Default behaviour for isolcpus without flags */
+5 -9
kernel/signal.c
··· 1510 1510 unsigned long flags; 1511 1511 int ret = -EINVAL; 1512 1512 1513 + if (!valid_signal(sig)) 1514 + return ret; 1515 + 1513 1516 clear_siginfo(&info); 1514 1517 info.si_signo = sig; 1515 1518 info.si_errno = errno; 1516 1519 info.si_code = SI_ASYNCIO; 1517 1520 *((sigval_t *)&info.si_pid) = addr; 1518 - 1519 - if (!valid_signal(sig)) 1520 - return ret; 1521 1521 1522 1522 rcu_read_lock(); 1523 1523 p = pid_task(pid, PIDTYPE_PID); ··· 1557 1557 { 1558 1558 int ret; 1559 1559 1560 - if (pid > 0) { 1561 - rcu_read_lock(); 1562 - ret = kill_pid_info(sig, info, find_vpid(pid)); 1563 - rcu_read_unlock(); 1564 - return ret; 1565 - } 1560 + if (pid > 0) 1561 + return kill_proc_info(sig, info, pid); 1566 1562 1567 1563 /* -INT_MIN is undefined. Exclude this case to avoid a UBSAN warning */ 1568 1564 if (pid == INT_MIN)
+14 -1
kernel/time/namespace.c
··· 338 338 339 339 static void show_offset(struct seq_file *m, int clockid, struct timespec64 *ts) 340 340 { 341 - seq_printf(m, "%d %lld %ld\n", clockid, ts->tv_sec, ts->tv_nsec); 341 + char *clock; 342 + 343 + switch (clockid) { 344 + case CLOCK_BOOTTIME: 345 + clock = "boottime"; 346 + break; 347 + case CLOCK_MONOTONIC: 348 + clock = "monotonic"; 349 + break; 350 + default: 351 + clock = "unknown"; 352 + break; 353 + } 354 + seq_printf(m, "%-10s %10lld %9ld\n", clock, ts->tv_sec, ts->tv_nsec); 342 355 } 343 356 344 357 void proc_timens_show_offsets(struct task_struct *p, struct seq_file *m)
+3 -7
kernel/trace/trace_events_trigger.c
··· 1088 1088 struct event_trigger_data *data, 1089 1089 struct trace_event_file *file) 1090 1090 { 1091 - int ret = register_trigger(glob, ops, data, file); 1091 + if (tracing_alloc_snapshot_instance(file->tr) != 0) 1092 + return 0; 1092 1093 1093 - if (ret > 0 && tracing_alloc_snapshot_instance(file->tr) != 0) { 1094 - unregister_trigger(glob, ops, data, file); 1095 - ret = 0; 1096 - } 1097 - 1098 - return ret; 1094 + return register_trigger(glob, ops, data, file); 1099 1095 } 1100 1096 1101 1097 static int
+2
lib/Kconfig.debug
··· 242 242 config DEBUG_INFO_BTF 243 243 bool "Generate BTF typeinfo" 244 244 depends on DEBUG_INFO 245 + depends on !DEBUG_INFO_SPLIT && !DEBUG_INFO_REDUCED 246 + depends on !GCC_PLUGIN_RANDSTRUCT || COMPILE_TEST 245 247 help 246 248 Generate deduplicated BTF type information from DWARF debug info. 247 249 Turning this on expects presence of pahole tool, which will convert
+12 -1
mm/mremap.c
··· 413 413 /* Always put back VM_ACCOUNT since we won't unmap */ 414 414 vma->vm_flags |= VM_ACCOUNT; 415 415 416 - vm_acct_memory(vma_pages(new_vma)); 416 + vm_acct_memory(new_len >> PAGE_SHIFT); 417 417 } 418 + 419 + /* 420 + * VMAs can actually be merged back together in copy_vma 421 + * calling merge_vma. This can happen with anonymous vmas 422 + * which have not yet been faulted, so if we were to consider 423 + * this VMA split we'll end up adding VM_ACCOUNT on the 424 + * next VMA, which is completely unrelated if this VMA 425 + * was re-merged. 426 + */ 427 + if (split && new_vma == vma) 428 + split = 0; 418 429 419 430 /* We always clear VM_LOCKED[ONFAULT] on the old vma */ 420 431 vma->vm_flags &= VM_LOCKED_CLEAR_MASK;
+4 -2
net/core/dev.c
··· 4140 4140 4141 4141 int netdev_tstamp_prequeue __read_mostly = 1; 4142 4142 int netdev_budget __read_mostly = 300; 4143 - unsigned int __read_mostly netdev_budget_usecs = 2000; 4143 + /* Must be at least 2 jiffes to guarantee 1 jiffy timeout */ 4144 + unsigned int __read_mostly netdev_budget_usecs = 2 * USEC_PER_SEC / HZ; 4144 4145 int weight_p __read_mostly = 64; /* old backlog weight */ 4145 4146 int dev_weight_rx_bias __read_mostly = 1; /* bias for backlog weight */ 4146 4147 int dev_weight_tx_bias __read_mostly = 1; /* bias for output_queue quota */ ··· 8667 8666 const struct net_device_ops *ops = dev->netdev_ops; 8668 8667 enum bpf_netdev_command query; 8669 8668 u32 prog_id, expected_id = 0; 8670 - struct bpf_prog *prog = NULL; 8671 8669 bpf_op_t bpf_op, bpf_chk; 8670 + struct bpf_prog *prog; 8672 8671 bool offload; 8673 8672 int err; 8674 8673 ··· 8734 8733 } else { 8735 8734 if (!prog_id) 8736 8735 return 0; 8736 + prog = NULL; 8737 8737 } 8738 8738 8739 8739 err = dev_xdp_install(dev, bpf_op, extack, flags, prog);
+1 -1
net/core/filter.c
··· 5925 5925 return -EOPNOTSUPP; 5926 5926 if (unlikely(dev_net(skb->dev) != sock_net(sk))) 5927 5927 return -ENETUNREACH; 5928 - if (unlikely(sk->sk_reuseport)) 5928 + if (unlikely(sk_fullsock(sk) && sk->sk_reuseport)) 5929 5929 return -ESOCKTNOSUPPORT; 5930 5930 if (sk_is_refcounted(sk) && 5931 5931 unlikely(!refcount_inc_not_zero(&sk->sk_refcnt)))
+1 -1
net/core/net-sysfs.c
··· 80 80 struct net_device *netdev = to_net_dev(dev); 81 81 struct net *net = dev_net(netdev); 82 82 unsigned long new; 83 - int ret = -EINVAL; 83 + int ret; 84 84 85 85 if (!ns_capable(net->user_ns, CAP_NET_ADMIN)) 86 86 return -EPERM;
+1 -1
net/core/sock.c
··· 1872 1872 * as not suitable for copying when cloning. 1873 1873 */ 1874 1874 if (sk_user_data_is_nocopy(newsk)) 1875 - RCU_INIT_POINTER(newsk->sk_user_data, NULL); 1875 + newsk->sk_user_data = NULL; 1876 1876 1877 1877 newsk->sk_err = 0; 1878 1878 newsk->sk_err_soft = 0;
+6 -1
net/dsa/port.c
··· 670 670 { 671 671 struct dsa_switch *ds = dp->ds; 672 672 struct device_node *phy_np; 673 + int port = dp->index; 673 674 674 675 if (!ds->ops->adjust_link) { 675 676 phy_np = of_parse_phandle(dp->dn, "phy-handle", 0); 676 - if (of_phy_is_fixed_link(dp->dn) || phy_np) 677 + if (of_phy_is_fixed_link(dp->dn) || phy_np) { 678 + if (ds->ops->phylink_mac_link_down) 679 + ds->ops->phylink_mac_link_down(ds, port, 680 + MLO_AN_FIXED, PHY_INTERFACE_MODE_NA); 677 681 return dsa_port_phylink_register(dp); 682 + } 678 683 return 0; 679 684 } 680 685
+8 -2
net/hsr/hsr_netlink.c
··· 69 69 else 70 70 multicast_spec = nla_get_u8(data[IFLA_HSR_MULTICAST_SPEC]); 71 71 72 - if (!data[IFLA_HSR_VERSION]) 72 + if (!data[IFLA_HSR_VERSION]) { 73 73 hsr_version = 0; 74 - else 74 + } else { 75 75 hsr_version = nla_get_u8(data[IFLA_HSR_VERSION]); 76 + if (hsr_version > 1) { 77 + NL_SET_ERR_MSG_MOD(extack, 78 + "Only versions 0..1 are supported"); 79 + return -EINVAL; 80 + } 81 + } 76 82 77 83 return hsr_dev_finalize(dev, link, multicast_spec, hsr_version, extack); 78 84 }
+9 -4
net/ipv4/devinet.c
··· 614 614 return NULL; 615 615 } 616 616 617 - static int ip_mc_config(struct sock *sk, bool join, const struct in_ifaddr *ifa) 617 + static int ip_mc_autojoin_config(struct net *net, bool join, 618 + const struct in_ifaddr *ifa) 618 619 { 620 + #if defined(CONFIG_IP_MULTICAST) 619 621 struct ip_mreqn mreq = { 620 622 .imr_multiaddr.s_addr = ifa->ifa_address, 621 623 .imr_ifindex = ifa->ifa_dev->dev->ifindex, 622 624 }; 625 + struct sock *sk = net->ipv4.mc_autojoin_sk; 623 626 int ret; 624 627 625 628 ASSERT_RTNL(); ··· 635 632 release_sock(sk); 636 633 637 634 return ret; 635 + #else 636 + return -EOPNOTSUPP; 637 + #endif 638 638 } 639 639 640 640 static int inet_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, ··· 681 675 continue; 682 676 683 677 if (ipv4_is_multicast(ifa->ifa_address)) 684 - ip_mc_config(net->ipv4.mc_autojoin_sk, false, ifa); 678 + ip_mc_autojoin_config(net, false, ifa); 685 679 __inet_del_ifa(in_dev, ifap, 1, nlh, NETLINK_CB(skb).portid); 686 680 return 0; 687 681 } ··· 946 940 */ 947 941 set_ifa_lifetime(ifa, valid_lft, prefered_lft); 948 942 if (ifa->ifa_flags & IFA_F_MCAUTOJOIN) { 949 - int ret = ip_mc_config(net->ipv4.mc_autojoin_sk, 950 - true, ifa); 943 + int ret = ip_mc_autojoin_config(net, true, ifa); 951 944 952 945 if (ret < 0) { 953 946 inet_free_ifa(ifa);
+20 -1
net/ipv6/icmp.c
··· 229 229 return res; 230 230 } 231 231 232 + static bool icmpv6_rt_has_prefsrc(struct sock *sk, u8 type, 233 + struct flowi6 *fl6) 234 + { 235 + struct net *net = sock_net(sk); 236 + struct dst_entry *dst; 237 + bool res = false; 238 + 239 + dst = ip6_route_output(net, sk, fl6); 240 + if (!dst->error) { 241 + struct rt6_info *rt = (struct rt6_info *)dst; 242 + struct in6_addr prefsrc; 243 + 244 + rt6_get_prefsrc(rt, &prefsrc); 245 + res = !ipv6_addr_any(&prefsrc); 246 + } 247 + dst_release(dst); 248 + return res; 249 + } 250 + 232 251 /* 233 252 * an inline helper for the "simple" if statement below 234 253 * checks if parameter problem report is caused by an ··· 546 527 saddr = force_saddr; 547 528 if (saddr) { 548 529 fl6.saddr = *saddr; 549 - } else { 530 + } else if (!icmpv6_rt_has_prefsrc(sk, type, &fl6)) { 550 531 /* select a more meaningful saddr from input if */ 551 532 struct net_device *in_netdev; 552 533
+1 -1
net/ipv6/seg6.c
··· 434 434 435 435 int __init seg6_init(void) 436 436 { 437 - int err = -ENOMEM; 437 + int err; 438 438 439 439 err = genl_register_family(&seg6_genl_family); 440 440 if (err)
+8 -8
net/l2tp/l2tp_netlink.c
··· 920 920 .cmd = L2TP_CMD_TUNNEL_CREATE, 921 921 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, 922 922 .doit = l2tp_nl_cmd_tunnel_create, 923 - .flags = GENL_ADMIN_PERM, 923 + .flags = GENL_UNS_ADMIN_PERM, 924 924 }, 925 925 { 926 926 .cmd = L2TP_CMD_TUNNEL_DELETE, 927 927 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, 928 928 .doit = l2tp_nl_cmd_tunnel_delete, 929 - .flags = GENL_ADMIN_PERM, 929 + .flags = GENL_UNS_ADMIN_PERM, 930 930 }, 931 931 { 932 932 .cmd = L2TP_CMD_TUNNEL_MODIFY, 933 933 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, 934 934 .doit = l2tp_nl_cmd_tunnel_modify, 935 - .flags = GENL_ADMIN_PERM, 935 + .flags = GENL_UNS_ADMIN_PERM, 936 936 }, 937 937 { 938 938 .cmd = L2TP_CMD_TUNNEL_GET, 939 939 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, 940 940 .doit = l2tp_nl_cmd_tunnel_get, 941 941 .dumpit = l2tp_nl_cmd_tunnel_dump, 942 - .flags = GENL_ADMIN_PERM, 942 + .flags = GENL_UNS_ADMIN_PERM, 943 943 }, 944 944 { 945 945 .cmd = L2TP_CMD_SESSION_CREATE, 946 946 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, 947 947 .doit = l2tp_nl_cmd_session_create, 948 - .flags = GENL_ADMIN_PERM, 948 + .flags = GENL_UNS_ADMIN_PERM, 949 949 }, 950 950 { 951 951 .cmd = L2TP_CMD_SESSION_DELETE, 952 952 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, 953 953 .doit = l2tp_nl_cmd_session_delete, 954 - .flags = GENL_ADMIN_PERM, 954 + .flags = GENL_UNS_ADMIN_PERM, 955 955 }, 956 956 { 957 957 .cmd = L2TP_CMD_SESSION_MODIFY, 958 958 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, 959 959 .doit = l2tp_nl_cmd_session_modify, 960 - .flags = GENL_ADMIN_PERM, 960 + .flags = GENL_UNS_ADMIN_PERM, 961 961 }, 962 962 { 963 963 .cmd = L2TP_CMD_SESSION_GET, 964 964 .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, 965 965 .doit = l2tp_nl_cmd_session_get, 966 966 .dumpit = l2tp_nl_cmd_session_dump, 967 - .flags = GENL_ADMIN_PERM, 967 + .flags = GENL_UNS_ADMIN_PERM, 968 968 }, 969 969 }; 970 970
+13 -11
net/mac80211/main.c
··· 1069 1069 local->hw.wiphy->signal_type = CFG80211_SIGNAL_TYPE_UNSPEC; 1070 1070 if (hw->max_signal <= 0) { 1071 1071 result = -EINVAL; 1072 - goto fail_wiphy_register; 1072 + goto fail_workqueue; 1073 1073 } 1074 1074 } 1075 1075 ··· 1135 1135 1136 1136 result = ieee80211_init_cipher_suites(local); 1137 1137 if (result < 0) 1138 - goto fail_wiphy_register; 1138 + goto fail_workqueue; 1139 1139 1140 1140 if (!local->ops->remain_on_channel) 1141 1141 local->hw.wiphy->max_remain_on_channel_duration = 5000; ··· 1160 1160 } 1161 1161 1162 1162 local->hw.wiphy->max_num_csa_counters = IEEE80211_MAX_CSA_COUNTERS_NUM; 1163 - 1164 - result = wiphy_register(local->hw.wiphy); 1165 - if (result < 0) 1166 - goto fail_wiphy_register; 1167 1163 1168 1164 /* 1169 1165 * We use the number of queues for feature tests (QoS, HT) internally ··· 1213 1217 goto fail_flows; 1214 1218 1215 1219 rtnl_lock(); 1216 - 1217 1220 result = ieee80211_init_rate_ctrl_alg(local, 1218 1221 hw->rate_control_algorithm); 1222 + rtnl_unlock(); 1219 1223 if (result < 0) { 1220 1224 wiphy_debug(local->hw.wiphy, 1221 1225 "Failed to initialize rate control algorithm\n"); ··· 1269 1273 local->sband_allocated |= BIT(band); 1270 1274 } 1271 1275 1276 + result = wiphy_register(local->hw.wiphy); 1277 + if (result < 0) 1278 + goto fail_wiphy_register; 1279 + 1280 + rtnl_lock(); 1281 + 1272 1282 /* add one default STA interface if supported */ 1273 1283 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_STATION) && 1274 1284 !ieee80211_hw_check(hw, NO_AUTO_VIF)) { ··· 1314 1312 #if defined(CONFIG_INET) || defined(CONFIG_IPV6) 1315 1313 fail_ifa: 1316 1314 #endif 1315 + wiphy_unregister(local->hw.wiphy); 1316 + fail_wiphy_register: 1317 1317 rtnl_lock(); 1318 1318 rate_control_deinitialize(local); 1319 1319 ieee80211_remove_interfaces(local); 1320 - fail_rate: 1321 1320 rtnl_unlock(); 1321 + fail_rate: 1322 1322 fail_flows: 1323 1323 ieee80211_led_exit(local); 1324 1324 destroy_workqueue(local->workqueue); 1325 1325 fail_workqueue: 1326 - wiphy_unregister(local->hw.wiphy); 1327 - fail_wiphy_register: 1328 1326 if (local->wiphy_ciphers_allocated) 1329 1327 kfree(local->hw.wiphy->cipher_suites); 1330 1328 kfree(local->int_scan_req); ··· 1374 1372 skb_queue_purge(&local->skb_queue_unreliable); 1375 1373 skb_queue_purge(&local->skb_queue_tdls_chsw); 1376 1374 1377 - destroy_workqueue(local->workqueue); 1378 1375 wiphy_unregister(local->hw.wiphy); 1376 + destroy_workqueue(local->workqueue); 1379 1377 ieee80211_led_exit(local); 1380 1378 kfree(local->int_scan_req); 1381 1379 }
+7 -4
net/mac80211/mesh.c
··· 1257 1257 sdata->u.mesh.mshcfg.rssi_threshold < rx_status->signal) 1258 1258 mesh_neighbour_update(sdata, mgmt->sa, &elems, 1259 1259 rx_status); 1260 + 1261 + if (ifmsh->csa_role != IEEE80211_MESH_CSA_ROLE_INIT && 1262 + !sdata->vif.csa_active) 1263 + ieee80211_mesh_process_chnswitch(sdata, &elems, true); 1260 1264 } 1261 1265 1262 1266 if (ifmsh->sync_ops) 1263 1267 ifmsh->sync_ops->rx_bcn_presp(sdata, 1264 1268 stype, mgmt, &elems, rx_status); 1265 - 1266 - if (ifmsh->csa_role != IEEE80211_MESH_CSA_ROLE_INIT && 1267 - !sdata->vif.csa_active) 1268 - ieee80211_mesh_process_chnswitch(sdata, &elems, true); 1269 1269 } 1270 1270 1271 1271 int ieee80211_mesh_finish_csa(struct ieee80211_sub_if_data *sdata) ··· 1372 1372 u.action.u.chan_switch.variable); 1373 1373 ieee802_11_parse_elems(pos, len - baselen, true, &elems, 1374 1374 mgmt->bssid, NULL); 1375 + 1376 + if (!mesh_matches_local(sdata, &elems)) 1377 + return; 1375 1378 1376 1379 ifmsh->chsw_ttl = elems.mesh_chansw_params_ie->mesh_ttl; 1377 1380 if (!--ifmsh->chsw_ttl)
+13 -12
net/mptcp/protocol.c
··· 97 97 if (likely(!__mptcp_needs_tcp_fallback(msk))) 98 98 return NULL; 99 99 100 - if (msk->subflow) { 101 - release_sock((struct sock *)msk); 102 - return msk->subflow; 103 - } 104 - 105 - return NULL; 100 + return msk->subflow; 106 101 } 107 102 108 103 static bool __mptcp_can_create_subflow(const struct mptcp_sock *msk) ··· 729 734 goto out; 730 735 } 731 736 737 + fallback: 732 738 ssock = __mptcp_tcp_fallback(msk); 733 739 if (unlikely(ssock)) { 734 - fallback: 740 + release_sock(sk); 735 741 pr_debug("fallback passthrough"); 736 742 ret = sock_sendmsg(ssock, msg); 737 743 return ret >= 0 ? ret + copied : (copied ? copied : ret); ··· 765 769 if (ret < 0) 766 770 break; 767 771 if (ret == 0 && unlikely(__mptcp_needs_tcp_fallback(msk))) { 772 + /* Can happen for passive sockets: 773 + * 3WHS negotiated MPTCP, but first packet after is 774 + * plain TCP (e.g. due to middlebox filtering unknown 775 + * options). 776 + * 777 + * Fall back to TCP. 778 + */ 768 779 release_sock(ssk); 769 - ssock = __mptcp_tcp_fallback(msk); 770 780 goto fallback; 771 781 } 772 782 ··· 885 883 ssock = __mptcp_tcp_fallback(msk); 886 884 if (unlikely(ssock)) { 887 885 fallback: 886 + release_sock(sk); 888 887 pr_debug("fallback-read subflow=%p", 889 888 mptcp_subflow_ctx(ssock->sk)); 890 889 copied = sock_recvmsg(ssock, msg, flags); ··· 1470 1467 */ 1471 1468 lock_sock(sk); 1472 1469 ssock = __mptcp_tcp_fallback(msk); 1470 + release_sock(sk); 1473 1471 if (ssock) 1474 1472 return tcp_setsockopt(ssock->sk, level, optname, optval, 1475 1473 optlen); 1476 - 1477 - release_sock(sk); 1478 1474 1479 1475 return -EOPNOTSUPP; 1480 1476 } ··· 1494 1492 */ 1495 1493 lock_sock(sk); 1496 1494 ssock = __mptcp_tcp_fallback(msk); 1495 + release_sock(sk); 1497 1496 if (ssock) 1498 1497 return tcp_getsockopt(ssock->sk, level, optname, optval, 1499 1498 option); 1500 - 1501 - release_sock(sk); 1502 1499 1503 1500 return -EOPNOTSUPP; 1504 1501 }
+2 -1
net/netfilter/ipset/ip_set_core.c
··· 86 86 { 87 87 struct ip_set_type *type; 88 88 89 - list_for_each_entry_rcu(type, &ip_set_type_list, list) 89 + list_for_each_entry_rcu(type, &ip_set_type_list, list, 90 + lockdep_is_held(&ip_set_type_mutex)) 90 91 if (STRNCMP(type->name, name) && 91 92 (type->family == family || 92 93 type->family == NFPROTO_UNSPEC) &&
+4 -3
net/netfilter/nf_tables_api.c
··· 3542 3542 continue; 3543 3543 if (!strcmp(set->name, i->name)) { 3544 3544 kfree(set->name); 3545 + set->name = NULL; 3545 3546 return -ENFILE; 3546 3547 } 3547 3548 } ··· 3962 3961 if (flags & ~(NFT_SET_ANONYMOUS | NFT_SET_CONSTANT | 3963 3962 NFT_SET_INTERVAL | NFT_SET_TIMEOUT | 3964 3963 NFT_SET_MAP | NFT_SET_EVAL | 3965 - NFT_SET_OBJECT)) 3966 - return -EINVAL; 3964 + NFT_SET_OBJECT | NFT_SET_CONCAT)) 3965 + return -EOPNOTSUPP; 3967 3966 /* Only one of these operations is supported */ 3968 3967 if ((flags & (NFT_SET_MAP | NFT_SET_OBJECT)) == 3969 3968 (NFT_SET_MAP | NFT_SET_OBJECT)) ··· 4001 4000 objtype = ntohl(nla_get_be32(nla[NFTA_SET_OBJ_TYPE])); 4002 4001 if (objtype == NFT_OBJECT_UNSPEC || 4003 4002 objtype > NFT_OBJECT_MAX) 4004 - return -EINVAL; 4003 + return -EOPNOTSUPP; 4005 4004 } else if (flags & NFT_SET_OBJECT) 4006 4005 return -EINVAL; 4007 4006 else
+7 -5
net/netfilter/nft_lookup.c
··· 29 29 { 30 30 const struct nft_lookup *priv = nft_expr_priv(expr); 31 31 const struct nft_set *set = priv->set; 32 - const struct nft_set_ext *ext; 32 + const struct nft_set_ext *ext = NULL; 33 33 bool found; 34 34 35 35 found = set->ops->lookup(nft_net(pkt), set, &regs->data[priv->sreg], ··· 39 39 return; 40 40 } 41 41 42 - if (set->flags & NFT_SET_MAP) 43 - nft_data_copy(&regs->data[priv->dreg], 44 - nft_set_ext_data(ext), set->dlen); 42 + if (ext) { 43 + if (set->flags & NFT_SET_MAP) 44 + nft_data_copy(&regs->data[priv->dreg], 45 + nft_set_ext_data(ext), set->dlen); 45 46 46 - nft_set_elem_update_expr(ext, regs, pkt); 47 + nft_set_elem_update_expr(ext, regs, pkt); 48 + } 47 49 } 48 50 49 51 static const struct nla_policy nft_lookup_policy[NFTA_LOOKUP_MAX + 1] = {
-1
net/netfilter/nft_set_bitmap.c
··· 81 81 u32 idx, off; 82 82 83 83 nft_bitmap_location(set, key, &idx, &off); 84 - *ext = NULL; 85 84 86 85 return nft_bitmap_active(priv->bitmap, idx, off, genmask); 87 86 }
+11 -12
net/netfilter/nft_set_rbtree.c
··· 218 218 219 219 /* Detect overlaps as we descend the tree. Set the flag in these cases: 220 220 * 221 - * a1. |__ _ _? >|__ _ _ (insert start after existing start) 222 - * a2. _ _ __>| ?_ _ __| (insert end before existing end) 223 - * a3. _ _ ___| ?_ _ _>| (insert end after existing end) 224 - * a4. >|__ _ _ _ _ __| (insert start before existing end) 221 + * a1. _ _ __>| ?_ _ __| (insert end before existing end) 222 + * a2. _ _ ___| ?_ _ _>| (insert end after existing end) 223 + * a3. _ _ ___? >|_ _ __| (insert start before existing end) 225 224 * 226 225 * and clear it later on, as we eventually reach the points indicated by 227 226 * '?' above, in the cases described below. We'll always meet these 228 227 * later, locally, due to tree ordering, and overlaps for the intervals 229 228 * that are the closest together are always evaluated last. 230 229 * 231 - * b1. |__ _ _! >|__ _ _ (insert start after existing end) 232 - * b2. _ _ __>| !_ _ __| (insert end before existing start) 233 - * b3. !_____>| (insert end after existing start) 230 + * b1. _ _ __>| !_ _ __| (insert end before existing start) 231 + * b2. _ _ ___| !_ _ _>| (insert end after existing start) 232 + * b3. _ _ ___! >|_ _ __| (insert start after existing end) 234 233 * 235 - * Case a4. resolves to b1.: 234 + * Case a3. resolves to b3.: 236 235 * - if the inserted start element is the leftmost, because the '0' 237 236 * element in the tree serves as end element 238 237 * - otherwise, if an existing end is found. Note that end elements are 239 238 * always inserted after corresponding start elements. 240 239 * 241 - * For a new, rightmost pair of elements, we'll hit cases b1. and b3., 240 + * For a new, rightmost pair of elements, we'll hit cases b3. and b2., 242 241 * in that order. 243 242 * 244 243 * The flag is also cleared in two special cases: ··· 261 262 p = &parent->rb_left; 262 263 263 264 if (nft_rbtree_interval_start(new)) { 264 - overlap = nft_rbtree_interval_start(rbe) && 265 - nft_set_elem_active(&rbe->ext, 266 - genmask); 265 + if (nft_rbtree_interval_end(rbe) && 266 + nft_set_elem_active(&rbe->ext, genmask)) 267 + overlap = false; 267 268 } else { 268 269 overlap = nft_rbtree_interval_end(rbe) && 269 270 nft_set_elem_active(&rbe->ext,
+3
net/netfilter/xt_IDLETIMER.c
··· 346 346 347 347 pr_debug("checkentry targinfo%s\n", info->label); 348 348 349 + if (info->send_nl_msg) 350 + return -EOPNOTSUPP; 351 + 349 352 ret = idletimer_tg_helper((struct idletimer_tg_info *)info); 350 353 if(ret < 0) 351 354 {
+4 -3
net/qrtr/qrtr.c
··· 906 906 907 907 node = NULL; 908 908 if (addr->sq_node == QRTR_NODE_BCAST) { 909 - enqueue_fn = qrtr_bcast_enqueue; 910 - if (addr->sq_port != QRTR_PORT_CTRL) { 909 + if (addr->sq_port != QRTR_PORT_CTRL && 910 + qrtr_local_nid != QRTR_NODE_BCAST) { 911 911 release_sock(sk); 912 912 return -ENOTCONN; 913 913 } 914 + enqueue_fn = qrtr_bcast_enqueue; 914 915 } else if (addr->sq_node == ipc->us.sq_node) { 915 916 enqueue_fn = qrtr_local_enqueue; 916 917 } else { 917 - enqueue_fn = qrtr_node_enqueue; 918 918 node = qrtr_node_lookup(addr->sq_node); 919 919 if (!node) { 920 920 release_sock(sk); 921 921 return -ECONNRESET; 922 922 } 923 + enqueue_fn = qrtr_node_enqueue; 923 924 } 924 925 925 926 plen = (len + 3) & ~3;
+9 -16
net/rds/message.c
··· 1 1 /* 2 - * Copyright (c) 2006 Oracle. All rights reserved. 2 + * Copyright (c) 2006, 2020 Oracle and/or its affiliates. 3 3 * 4 4 * This software is available to you under a choice of one of two 5 5 * licenses. You may choose to be licensed under the terms of the GNU ··· 162 162 if (rm->rdma.op_active) 163 163 rds_rdma_free_op(&rm->rdma); 164 164 if (rm->rdma.op_rdma_mr) 165 - rds_mr_put(rm->rdma.op_rdma_mr); 165 + kref_put(&rm->rdma.op_rdma_mr->r_kref, __rds_put_mr_final); 166 166 167 167 if (rm->atomic.op_active) 168 168 rds_atomic_free_op(&rm->atomic); 169 169 if (rm->atomic.op_rdma_mr) 170 - rds_mr_put(rm->atomic.op_rdma_mr); 170 + kref_put(&rm->atomic.op_rdma_mr->r_kref, __rds_put_mr_final); 171 171 } 172 172 173 173 void rds_message_put(struct rds_message *rm) ··· 308 308 /* 309 309 * RDS ops use this to grab SG entries from the rm's sg pool. 310 310 */ 311 - struct scatterlist *rds_message_alloc_sgs(struct rds_message *rm, int nents, 312 - int *ret) 311 + struct scatterlist *rds_message_alloc_sgs(struct rds_message *rm, int nents) 313 312 { 314 313 struct scatterlist *sg_first = (struct scatterlist *) &rm[1]; 315 314 struct scatterlist *sg_ret; 316 315 317 - if (WARN_ON(!ret)) 318 - return NULL; 319 - 320 316 if (nents <= 0) { 321 317 pr_warn("rds: alloc sgs failed! nents <= 0\n"); 322 - *ret = -EINVAL; 323 - return NULL; 318 + return ERR_PTR(-EINVAL); 324 319 } 325 320 326 321 if (rm->m_used_sgs + nents > rm->m_total_sgs) { 327 322 pr_warn("rds: alloc sgs failed! total %d used %d nents %d\n", 328 323 rm->m_total_sgs, rm->m_used_sgs, nents); 329 - *ret = -ENOMEM; 330 - return NULL; 324 + return ERR_PTR(-ENOMEM); 331 325 } 332 326 333 327 sg_ret = &sg_first[rm->m_used_sgs]; ··· 337 343 unsigned int i; 338 344 int num_sgs = DIV_ROUND_UP(total_len, PAGE_SIZE); 339 345 int extra_bytes = num_sgs * sizeof(struct scatterlist); 340 - int ret; 341 346 342 347 rm = rds_message_alloc(extra_bytes, GFP_NOWAIT); 343 348 if (!rm) ··· 345 352 set_bit(RDS_MSG_PAGEVEC, &rm->m_flags); 346 353 rm->m_inc.i_hdr.h_len = cpu_to_be32(total_len); 347 354 rm->data.op_nents = DIV_ROUND_UP(total_len, PAGE_SIZE); 348 - rm->data.op_sg = rds_message_alloc_sgs(rm, num_sgs, &ret); 349 - if (!rm->data.op_sg) { 355 + rm->data.op_sg = rds_message_alloc_sgs(rm, num_sgs); 356 + if (IS_ERR(rm->data.op_sg)) { 350 357 rds_message_put(rm); 351 - return ERR_PTR(ret); 358 + return ERR_CAST(rm->data.op_sg); 352 359 } 353 360 354 361 for (i = 0; i < rm->data.op_nents; ++i) {
+35 -30
net/rds/rdma.c
··· 1 1 /* 2 - * Copyright (c) 2007, 2017 Oracle and/or its affiliates. All rights reserved. 2 + * Copyright (c) 2007, 2020 Oracle and/or its affiliates. 3 3 * 4 4 * This software is available to you under a choice of one of two 5 5 * licenses. You may choose to be licensed under the terms of the GNU ··· 84 84 if (insert) { 85 85 rb_link_node(&insert->r_rb_node, parent, p); 86 86 rb_insert_color(&insert->r_rb_node, root); 87 - refcount_inc(&insert->r_refcount); 87 + kref_get(&insert->r_kref); 88 88 } 89 89 return NULL; 90 90 } ··· 99 99 unsigned long flags; 100 100 101 101 rdsdebug("RDS: destroy mr key is %x refcnt %u\n", 102 - mr->r_key, refcount_read(&mr->r_refcount)); 103 - 104 - if (test_and_set_bit(RDS_MR_DEAD, &mr->r_state)) 105 - return; 102 + mr->r_key, kref_read(&mr->r_kref)); 106 103 107 104 spin_lock_irqsave(&rs->rs_rdma_lock, flags); 108 105 if (!RB_EMPTY_NODE(&mr->r_rb_node)) ··· 112 115 mr->r_trans->free_mr(trans_private, mr->r_invalidate); 113 116 } 114 117 115 - void __rds_put_mr_final(struct rds_mr *mr) 118 + void __rds_put_mr_final(struct kref *kref) 116 119 { 120 + struct rds_mr *mr = container_of(kref, struct rds_mr, r_kref); 121 + 117 122 rds_destroy_mr(mr); 118 123 kfree(mr); 119 124 } ··· 139 140 rb_erase(&mr->r_rb_node, &rs->rs_rdma_keys); 140 141 RB_CLEAR_NODE(&mr->r_rb_node); 141 142 spin_unlock_irqrestore(&rs->rs_rdma_lock, flags); 142 - rds_destroy_mr(mr); 143 - rds_mr_put(mr); 143 + kref_put(&mr->r_kref, __rds_put_mr_final); 144 144 spin_lock_irqsave(&rs->rs_rdma_lock, flags); 145 145 } 146 146 spin_unlock_irqrestore(&rs->rs_rdma_lock, flags); ··· 240 242 goto out; 241 243 } 242 244 243 - refcount_set(&mr->r_refcount, 1); 245 + kref_init(&mr->r_kref); 244 246 RB_CLEAR_NODE(&mr->r_rb_node); 245 247 mr->r_trans = rs->rs_transport; 246 248 mr->r_sock = rs; ··· 341 343 342 344 rdsdebug("RDS: get_mr key is %x\n", mr->r_key); 343 345 if (mr_ret) { 344 - refcount_inc(&mr->r_refcount); 346 + kref_get(&mr->r_kref); 345 347 *mr_ret = mr; 346 348 } 347 349 ··· 349 351 out: 350 352 kfree(pages); 351 353 if (mr) 352 - rds_mr_put(mr); 354 + kref_put(&mr->r_kref, __rds_put_mr_final); 353 355 return ret; 354 356 } 355 357 ··· 432 434 if (!mr) 433 435 return -EINVAL; 434 436 435 - /* 436 - * call rds_destroy_mr() ourselves so that we're sure it's done by the time 437 - * we return. If we let rds_mr_put() do it it might not happen until 438 - * someone else drops their ref. 439 - */ 440 - rds_destroy_mr(mr); 441 - rds_mr_put(mr); 437 + kref_put(&mr->r_kref, __rds_put_mr_final); 442 438 return 0; 443 439 } 444 440 ··· 456 464 return; 457 465 } 458 466 467 + /* Get a reference so that the MR won't go away before calling 468 + * sync_mr() below. 469 + */ 470 + kref_get(&mr->r_kref); 471 + 472 + /* If it is going to be freed, remove it from the tree now so 473 + * that no other thread can find it and free it. 474 + */ 459 475 if (mr->r_use_once || force) { 460 476 rb_erase(&mr->r_rb_node, &rs->rs_rdma_keys); 461 477 RB_CLEAR_NODE(&mr->r_rb_node); ··· 477 477 if (mr->r_trans->sync_mr) 478 478 mr->r_trans->sync_mr(mr->r_trans_private, DMA_FROM_DEVICE); 479 479 480 + /* Release the reference held above. */ 481 + kref_put(&mr->r_kref, __rds_put_mr_final); 482 + 480 483 /* If the MR was marked as invalidate, this will 481 484 * trigger an async flush. */ 482 - if (zot_me) { 483 - rds_destroy_mr(mr); 484 - rds_mr_put(mr); 485 - } 485 + if (zot_me) 486 + kref_put(&mr->r_kref, __rds_put_mr_final); 486 487 } 487 488 488 489 void rds_rdma_free_op(struct rm_rdma_op *ro) ··· 491 490 unsigned int i; 492 491 493 492 if (ro->op_odp_mr) { 494 - rds_mr_put(ro->op_odp_mr); 493 + kref_put(&ro->op_odp_mr->r_kref, __rds_put_mr_final); 495 494 } else { 496 495 for (i = 0; i < ro->op_nents; i++) { 497 496 struct page *page = sg_page(&ro->op_sg[i]); ··· 665 664 op->op_odp_mr = NULL; 666 665 667 666 WARN_ON(!nr_pages); 668 - op->op_sg = rds_message_alloc_sgs(rm, nr_pages, &ret); 669 - if (!op->op_sg) 667 + op->op_sg = rds_message_alloc_sgs(rm, nr_pages); 668 + if (IS_ERR(op->op_sg)) { 669 + ret = PTR_ERR(op->op_sg); 670 670 goto out_pages; 671 + } 671 672 672 673 if (op->op_notify || op->op_recverr) { 673 674 /* We allocate an uninitialized notifier here, because ··· 733 730 goto out_pages; 734 731 } 735 732 RB_CLEAR_NODE(&local_odp_mr->r_rb_node); 736 - refcount_set(&local_odp_mr->r_refcount, 1); 733 + kref_init(&local_odp_mr->r_kref); 737 734 local_odp_mr->r_trans = rs->rs_transport; 738 735 local_odp_mr->r_sock = rs; 739 736 local_odp_mr->r_trans_private = ··· 830 827 if (!mr) 831 828 err = -EINVAL; /* invalid r_key */ 832 829 else 833 - refcount_inc(&mr->r_refcount); 830 + kref_get(&mr->r_kref); 834 831 spin_unlock_irqrestore(&rs->rs_rdma_lock, flags); 835 832 836 833 if (mr) { ··· 908 905 rm->atomic.op_silent = !!(args->flags & RDS_RDMA_SILENT); 909 906 rm->atomic.op_active = 1; 910 907 rm->atomic.op_recverr = rs->rs_recverr; 911 - rm->atomic.op_sg = rds_message_alloc_sgs(rm, 1, &ret); 912 - if (!rm->atomic.op_sg) 908 + rm->atomic.op_sg = rds_message_alloc_sgs(rm, 1); 909 + if (IS_ERR(rm->atomic.op_sg)) { 910 + ret = PTR_ERR(rm->atomic.op_sg); 913 911 goto err; 912 + } 914 913 915 914 /* verify 8 byte-aligned */ 916 915 if (args->local_addr & 0x7) {
+3 -17
net/rds/rds.h
··· 291 291 292 292 struct rds_mr { 293 293 struct rb_node r_rb_node; 294 - refcount_t r_refcount; 294 + struct kref r_kref; 295 295 u32 r_key; 296 296 297 297 /* A copy of the creation flags */ ··· 299 299 unsigned int r_invalidate:1; 300 300 unsigned int r_write:1; 301 301 302 - /* This is for RDS_MR_DEAD. 303 - * It would be nice & consistent to make this part of the above 304 - * bit field here, but we need to use test_and_set_bit. 305 - */ 306 - unsigned long r_state; 307 302 struct rds_sock *r_sock; /* back pointer to the socket that owns us */ 308 303 struct rds_transport *r_trans; 309 304 void *r_trans_private; 310 305 }; 311 - 312 - /* Flags for mr->r_state */ 313 - #define RDS_MR_DEAD 0 314 306 315 307 static inline rds_rdma_cookie_t rds_rdma_make_cookie(u32 r_key, u32 offset) 316 308 { ··· 844 852 845 853 /* message.c */ 846 854 struct rds_message *rds_message_alloc(unsigned int nents, gfp_t gfp); 847 - struct scatterlist *rds_message_alloc_sgs(struct rds_message *rm, int nents, 848 - int *ret); 855 + struct scatterlist *rds_message_alloc_sgs(struct rds_message *rm, int nents); 849 856 int rds_message_copy_from_user(struct rds_message *rm, struct iov_iter *from, 850 857 bool zcopy); 851 858 struct rds_message *rds_message_map_pages(unsigned long *page_addrs, unsigned int total_len); ··· 937 946 int rds_cmsg_atomic(struct rds_sock *rs, struct rds_message *rm, 938 947 struct cmsghdr *cmsg); 939 948 940 - void __rds_put_mr_final(struct rds_mr *mr); 941 - static inline void rds_mr_put(struct rds_mr *mr) 942 - { 943 - if (refcount_dec_and_test(&mr->r_refcount)) 944 - __rds_put_mr_final(mr); 945 - } 949 + void __rds_put_mr_final(struct kref *kref); 946 950 947 951 static inline bool rds_destroy_pending(struct rds_connection *conn) 948 952 {
+4 -2
net/rds/send.c
··· 1274 1274 1275 1275 /* Attach data to the rm */ 1276 1276 if (payload_len) { 1277 - rm->data.op_sg = rds_message_alloc_sgs(rm, num_sgs, &ret); 1278 - if (!rm->data.op_sg) 1277 + rm->data.op_sg = rds_message_alloc_sgs(rm, num_sgs); 1278 + if (IS_ERR(rm->data.op_sg)) { 1279 + ret = PTR_ERR(rm->data.op_sg); 1279 1280 goto out; 1281 + } 1280 1282 ret = rds_message_copy_from_user(rm, &msg->msg_iter, zcopy); 1281 1283 if (ret) 1282 1284 goto out;
-9
net/rxrpc/local_object.c
··· 165 165 goto error; 166 166 } 167 167 168 - /* we want to set the don't fragment bit */ 169 - opt = IPV6_PMTUDISC_DO; 170 - ret = kernel_setsockopt(local->socket, SOL_IPV6, IPV6_MTU_DISCOVER, 171 - (char *) &opt, sizeof(opt)); 172 - if (ret < 0) { 173 - _debug("setsockopt failed"); 174 - goto error; 175 - } 176 - 177 168 /* Fall through and set IPv4 options too otherwise we don't get 178 169 * errors from IPv4 packets sent through the IPv6 socket. 179 170 */
+11 -31
net/rxrpc/output.c
··· 474 474 skb->tstamp = ktime_get_real(); 475 475 476 476 switch (conn->params.local->srx.transport.family) { 477 + case AF_INET6: 477 478 case AF_INET: 478 479 opt = IP_PMTUDISC_DONT; 479 - ret = kernel_setsockopt(conn->params.local->socket, 480 - SOL_IP, IP_MTU_DISCOVER, 481 - (char *)&opt, sizeof(opt)); 482 - if (ret == 0) { 483 - ret = kernel_sendmsg(conn->params.local->socket, &msg, 484 - iov, 2, len); 485 - conn->params.peer->last_tx_at = ktime_get_seconds(); 480 + kernel_setsockopt(conn->params.local->socket, 481 + SOL_IP, IP_MTU_DISCOVER, 482 + (char *)&opt, sizeof(opt)); 483 + ret = kernel_sendmsg(conn->params.local->socket, &msg, 484 + iov, 2, len); 485 + conn->params.peer->last_tx_at = ktime_get_seconds(); 486 486 487 - opt = IP_PMTUDISC_DO; 488 - kernel_setsockopt(conn->params.local->socket, SOL_IP, 489 - IP_MTU_DISCOVER, 490 - (char *)&opt, sizeof(opt)); 491 - } 487 + opt = IP_PMTUDISC_DO; 488 + kernel_setsockopt(conn->params.local->socket, 489 + SOL_IP, IP_MTU_DISCOVER, 490 + (char *)&opt, sizeof(opt)); 492 491 break; 493 - 494 - #ifdef CONFIG_AF_RXRPC_IPV6 495 - case AF_INET6: 496 - opt = IPV6_PMTUDISC_DONT; 497 - ret = kernel_setsockopt(conn->params.local->socket, 498 - SOL_IPV6, IPV6_MTU_DISCOVER, 499 - (char *)&opt, sizeof(opt)); 500 - if (ret == 0) { 501 - ret = kernel_sendmsg(conn->params.local->socket, &msg, 502 - iov, 2, len); 503 - conn->params.peer->last_tx_at = ktime_get_seconds(); 504 - 505 - opt = IPV6_PMTUDISC_DO; 506 - kernel_setsockopt(conn->params.local->socket, 507 - SOL_IPV6, IPV6_MTU_DISCOVER, 508 - (char *)&opt, sizeof(opt)); 509 - } 510 - break; 511 - #endif 512 492 513 493 default: 514 494 BUG();
+1
net/sched/cls_api.c
··· 1667 1667 skb_ext_del(skb, TC_SKB_EXT); 1668 1668 1669 1669 tp = rcu_dereference_bh(fchain->filter_chain); 1670 + last_executed_chain = fchain->index; 1670 1671 } 1671 1672 1672 1673 ret = __tcf_classify(skb, tp, orig_tp, res, compat_mode,
+1 -1
net/tipc/link.c
··· 1065 1065 /* Enter fast recovery */ 1066 1066 if (unlikely(retransmitted)) { 1067 1067 l->ssthresh = max_t(u16, l->window / 2, 300); 1068 - l->window = l->ssthresh; 1068 + l->window = min_t(u16, l->ssthresh, l->window); 1069 1069 return; 1070 1070 } 1071 1071 /* Enter slow start */
+2 -2
net/tls/tls_main.c
··· 56 56 TLS_NUM_PROTS, 57 57 }; 58 58 59 - static struct proto *saved_tcpv6_prot; 59 + static const struct proto *saved_tcpv6_prot; 60 60 static DEFINE_MUTEX(tcpv6_prot_mutex); 61 - static struct proto *saved_tcpv4_prot; 61 + static const struct proto *saved_tcpv4_prot; 62 62 static DEFINE_MUTEX(tcpv4_prot_mutex); 63 63 static struct proto tls_prots[TLS_NUM_PROTS][TLS_NUM_CONFIG][TLS_NUM_CONFIG]; 64 64 static struct proto_ops tls_sw_proto_ops;
+2 -4
net/wireless/nl80211.c
··· 644 644 [NL80211_ATTR_HE_CAPABILITY] = { .type = NLA_BINARY, 645 645 .len = NL80211_HE_MAX_CAPABILITY_LEN }, 646 646 647 - [NL80211_ATTR_FTM_RESPONDER] = { 648 - .type = NLA_NESTED, 649 - .validation_data = nl80211_ftm_responder_policy, 650 - }, 647 + [NL80211_ATTR_FTM_RESPONDER] = 648 + NLA_POLICY_NESTED(nl80211_ftm_responder_policy), 651 649 [NL80211_ATTR_TIMEOUT] = NLA_POLICY_MIN(NLA_U32, 1), 652 650 [NL80211_ATTR_PEER_MEASUREMENTS] = 653 651 NLA_POLICY_NESTED(nl80211_pmsr_attr_policy),
+2 -3
net/xdp/xdp_umem.c
··· 343 343 u32 chunk_size = mr->chunk_size, headroom = mr->headroom; 344 344 unsigned int chunks, chunks_per_page; 345 345 u64 addr = mr->addr, size = mr->len; 346 - int size_chk, err; 346 + int err; 347 347 348 348 if (chunk_size < XDP_UMEM_MIN_CHUNK_SIZE || chunk_size > PAGE_SIZE) { 349 349 /* Strictly speaking we could support this, if: ··· 382 382 return -EINVAL; 383 383 } 384 384 385 - size_chk = chunk_size - headroom - XDP_PACKET_HEADROOM; 386 - if (size_chk < 0) 385 + if (headroom >= chunk_size - XDP_PACKET_HEADROOM) 387 386 return -EINVAL; 388 387 389 388 umem->address = (unsigned long)addr;
+3 -2
net/xdp/xsk.c
··· 131 131 u64 page_start = addr & ~(PAGE_SIZE - 1); 132 132 u64 first_len = PAGE_SIZE - (addr - page_start); 133 133 134 - memcpy(to_buf, from_buf, first_len + metalen); 135 - memcpy(next_pg_addr, from_buf + first_len, len - first_len); 134 + memcpy(to_buf, from_buf, first_len); 135 + memcpy(next_pg_addr, from_buf + first_len, 136 + len + metalen - first_len); 136 137 137 138 return; 138 139 }
+1 -1
scripts/documentation-file-ref-check
··· 25 25 my $warn = 0; 26 26 27 27 if (! -d ".git") { 28 - printf "Warning: can't check if file exists, as this is not a git tree"; 28 + printf "Warning: can't check if file exists, as this is not a git tree\n"; 29 29 exit 0; 30 30 } 31 31
+1 -1
scripts/dtc/Makefile
··· 13 13 HOST_EXTRACFLAGS := -I $(srctree)/$(src)/libfdt 14 14 15 15 ifeq ($(shell pkg-config --exists yaml-0.1 2>/dev/null && echo yes),) 16 - ifneq ($(CHECK_DTBS),) 16 + ifneq ($(CHECK_DT_BINDING)$(CHECK_DTBS),) 17 17 $(error dtc needs libyaml for DT schema validation support. \ 18 18 Install the necessary libyaml development package.) 19 19 endif
+1 -1
scripts/kernel-doc
··· 853 853 854 854 if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { 855 855 # pointer-to-function 856 - print $1 . $parameter . ") (" . $2; 856 + print $1 . $parameter . ") (" . $2 . ")"; 857 857 } else { 858 858 print $type . " " . $parameter; 859 859 }
+2
security/keys/proc.c
··· 139 139 n = key_serial_next(p, v); 140 140 if (n) 141 141 *_pos = key_node_serial(n); 142 + else 143 + (*_pos)++; 142 144 return n; 143 145 } 144 146
+4 -4
security/selinux/ss/policydb.c
··· 1035 1035 if (!str) 1036 1036 return -ENOMEM; 1037 1037 1038 - /* it's expected the caller should free the str */ 1039 - *strp = str; 1040 - 1041 1038 rc = next_entry(str, fp, len); 1042 - if (rc) 1039 + if (rc) { 1040 + kfree(str); 1043 1041 return rc; 1042 + } 1044 1043 1045 1044 str[len] = '\0'; 1045 + *strp = str; 1046 1046 return 0; 1047 1047 } 1048 1048
+4 -3
sound/hda/Kconfig
··· 21 21 select SND_HDA_CORE 22 22 23 23 config SND_HDA_PREALLOC_SIZE 24 - int "Pre-allocated buffer size for HD-audio driver" if !SND_DMA_SGBUF 24 + int "Pre-allocated buffer size for HD-audio driver" 25 25 range 0 32768 26 - default 0 if SND_DMA_SGBUF 26 + default 2048 if SND_DMA_SGBUF 27 27 default 64 if !SND_DMA_SGBUF 28 28 help 29 29 Specifies the default pre-allocated buffer-size in kB for the 30 30 HD-audio driver. A larger buffer (e.g. 2048) is preferred 31 31 for systems using PulseAudio. The default 64 is chosen just 32 32 for compatibility reasons. 33 - On x86 systems, the default is zero as we need no preallocation. 33 + On x86 systems, the default is 2048 as a reasonable value for 34 + most of modern systems. 34 35 35 36 Note that the pre-allocation size can be changed dynamically 36 37 via a proc file (/proc/asound/card*/pcm*/sub*/prealloc), too.
+7 -7
sound/pci/ctxfi/cthw20k1.c
··· 168 168 169 169 static int src_put_rsc_ctrl_blk(void *blk) 170 170 { 171 - kfree((struct src_rsc_ctrl_blk *)blk); 171 + kfree(blk); 172 172 173 173 return 0; 174 174 } ··· 494 494 495 495 static int src_mgr_put_ctrl_blk(void *blk) 496 496 { 497 - kfree((struct src_mgr_ctrl_blk *)blk); 497 + kfree(blk); 498 498 499 499 return 0; 500 500 } ··· 515 515 516 516 static int srcimp_mgr_put_ctrl_blk(void *blk) 517 517 { 518 - kfree((struct srcimp_mgr_ctrl_blk *)blk); 518 + kfree(blk); 519 519 520 520 return 0; 521 521 } ··· 702 702 703 703 static int amixer_rsc_put_ctrl_blk(void *blk) 704 704 { 705 - kfree((struct amixer_rsc_ctrl_blk *)blk); 705 + kfree(blk); 706 706 707 707 return 0; 708 708 } ··· 909 909 910 910 static int dai_put_ctrl_blk(void *blk) 911 911 { 912 - kfree((struct dai_ctrl_blk *)blk); 912 + kfree(blk); 913 913 914 914 return 0; 915 915 } ··· 958 958 959 959 static int dao_put_ctrl_blk(void *blk) 960 960 { 961 - kfree((struct dao_ctrl_blk *)blk); 961 + kfree(blk); 962 962 963 963 return 0; 964 964 } ··· 1156 1156 1157 1157 static int daio_mgr_put_ctrl_blk(void *blk) 1158 1158 { 1159 - kfree((struct daio_mgr_ctrl_blk *)blk); 1159 + kfree(blk); 1160 1160 1161 1161 return 0; 1162 1162 }
+1 -1
sound/pci/hda/hda_codec.c
··· 2951 2951 static int hda_codec_force_resume(struct device *dev) 2952 2952 { 2953 2953 struct hda_codec *codec = dev_to_hda_codec(dev); 2954 - bool forced_resume = !codec->relaxed_resume && codec->jacktbl.used; 2954 + bool forced_resume = hda_codec_need_resume(codec); 2955 2955 int ret; 2956 2956 2957 2957 /* The get/put pair below enforces the runtime resume even if the
+63 -44
sound/pci/hda/hda_intel.c
··· 1027 1027 chip = card->private_data; 1028 1028 bus = azx_bus(chip); 1029 1029 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); 1030 - __azx_runtime_suspend(chip); 1030 + pm_runtime_force_suspend(dev); 1031 1031 if (bus->irq >= 0) { 1032 1032 free_irq(bus->irq, chip); 1033 1033 bus->irq = -1; ··· 1044 1044 static int azx_resume(struct device *dev) 1045 1045 { 1046 1046 struct snd_card *card = dev_get_drvdata(dev); 1047 + struct hda_codec *codec; 1047 1048 struct azx *chip; 1049 + bool forced_resume = false; 1048 1050 1049 1051 if (!azx_is_pm_ready(card)) 1050 1052 return 0; ··· 1057 1055 chip->msi = 0; 1058 1056 if (azx_acquire_irq(chip, 1) < 0) 1059 1057 return -EIO; 1060 - __azx_runtime_resume(chip, false); 1058 + 1059 + /* check for the forced resume */ 1060 + list_for_each_codec(codec, &chip->bus) { 1061 + if (hda_codec_need_resume(codec)) { 1062 + forced_resume = true; 1063 + break; 1064 + } 1065 + } 1066 + 1067 + if (forced_resume) 1068 + pm_runtime_get_noresume(dev); 1069 + pm_runtime_force_resume(dev); 1070 + if (forced_resume) 1071 + pm_runtime_put(dev); 1061 1072 snd_power_change_state(card, SNDRV_CTL_POWER_D0); 1062 1073 1063 1074 trace_azx_resume(chip); ··· 1086 1071 struct azx *chip = card->private_data; 1087 1072 struct pci_dev *pci = to_pci_dev(dev); 1088 1073 1074 + if (!azx_is_pm_ready(card)) 1075 + return 0; 1089 1076 if (chip->driver_type == AZX_DRIVER_SKL) 1090 1077 pci_set_power_state(pci, PCI_D3hot); 1091 1078 ··· 1100 1083 struct azx *chip = card->private_data; 1101 1084 struct pci_dev *pci = to_pci_dev(dev); 1102 1085 1086 + if (!azx_is_pm_ready(card)) 1087 + return 0; 1103 1088 if (chip->driver_type == AZX_DRIVER_SKL) 1104 1089 pci_set_power_state(pci, PCI_D0); 1105 1090 ··· 1117 1098 if (!azx_is_pm_ready(card)) 1118 1099 return 0; 1119 1100 chip = card->private_data; 1120 - if (!azx_has_pm_runtime(chip)) 1121 - return 0; 1122 1101 1123 1102 /* enable controller wake up event */ 1124 - azx_writew(chip, WAKEEN, azx_readw(chip, WAKEEN) | 1125 - STATESTS_INT_MASK); 1103 + if (snd_power_get_state(card) == SNDRV_CTL_POWER_D0) { 1104 + azx_writew(chip, WAKEEN, azx_readw(chip, WAKEEN) | 1105 + STATESTS_INT_MASK); 1106 + } 1126 1107 1127 1108 __azx_runtime_suspend(chip); 1128 1109 trace_azx_runtime_suspend(chip); ··· 1133 1114 { 1134 1115 struct snd_card *card = dev_get_drvdata(dev); 1135 1116 struct azx *chip; 1117 + bool from_rt = snd_power_get_state(card) == SNDRV_CTL_POWER_D0; 1136 1118 1137 1119 if (!azx_is_pm_ready(card)) 1138 1120 return 0; 1139 1121 chip = card->private_data; 1140 - if (!azx_has_pm_runtime(chip)) 1141 - return 0; 1142 - __azx_runtime_resume(chip, true); 1122 + __azx_runtime_resume(chip, from_rt); 1143 1123 1144 1124 /* disable controller Wake Up event*/ 1145 - azx_writew(chip, WAKEEN, azx_readw(chip, WAKEEN) & 1146 - ~STATESTS_INT_MASK); 1125 + if (from_rt) { 1126 + azx_writew(chip, WAKEEN, azx_readw(chip, WAKEEN) & 1127 + ~STATESTS_INT_MASK); 1128 + } 1147 1129 1148 1130 trace_azx_runtime_resume(chip); 1149 1131 return 0; ··· 1219 1199 if (!disabled) { 1220 1200 dev_info(chip->card->dev, 1221 1201 "Start delayed initialization\n"); 1222 - if (azx_probe_continue(chip) < 0) { 1202 + if (azx_probe_continue(chip) < 0) 1223 1203 dev_err(chip->card->dev, "initialization error\n"); 1224 - hda->init_failed = true; 1225 - } 1226 1204 } 1227 1205 } else { 1228 1206 dev_info(chip->card->dev, "%s via vga_switcheroo\n", ··· 1353 1335 /* 1354 1336 * destructor 1355 1337 */ 1356 - static int azx_free(struct azx *chip) 1338 + static void azx_free(struct azx *chip) 1357 1339 { 1358 1340 struct pci_dev *pci = chip->pci; 1359 1341 struct hda_intel *hda = container_of(chip, struct hda_intel, chip); 1360 1342 struct hdac_bus *bus = azx_bus(chip); 1343 + 1344 + if (hda->freed) 1345 + return; 1361 1346 1362 1347 if (azx_has_pm_runtime(chip) && chip->running) 1363 1348 pm_runtime_get_noresume(&pci->dev); ··· 1405 1384 1406 1385 if (chip->driver_caps & AZX_DCAPS_I915_COMPONENT) 1407 1386 snd_hdac_i915_exit(bus); 1408 - kfree(hda); 1409 1387 1410 - return 0; 1388 + hda->freed = 1; 1411 1389 } 1412 1390 1413 1391 static int azx_dev_disconnect(struct snd_device *device) ··· 1422 1402 1423 1403 static int azx_dev_free(struct snd_device *device) 1424 1404 { 1425 - return azx_free(device->device_data); 1405 + azx_free(device->device_data); 1406 + return 0; 1426 1407 } 1427 1408 1428 1409 #ifdef SUPPORT_VGA_SWITCHEROO ··· 1790 1769 if (err < 0) 1791 1770 return err; 1792 1771 1793 - hda = kzalloc(sizeof(*hda), GFP_KERNEL); 1772 + hda = devm_kzalloc(&pci->dev, sizeof(*hda), GFP_KERNEL); 1794 1773 if (!hda) { 1795 1774 pci_disable_device(pci); 1796 1775 return -ENOMEM; ··· 1831 1810 1832 1811 err = azx_bus_init(chip, model[dev]); 1833 1812 if (err < 0) { 1834 - kfree(hda); 1835 1813 pci_disable_device(pci); 1836 1814 return err; 1837 1815 } ··· 2025 2005 /* codec detection */ 2026 2006 if (!azx_bus(chip)->codec_mask) { 2027 2007 dev_err(card->dev, "no codecs found!\n"); 2028 - return -ENODEV; 2008 + /* keep running the rest for the runtime PM */ 2029 2009 } 2030 2010 2031 2011 if (azx_acquire_irq(chip, 0) < 0) ··· 2047 2027 { 2048 2028 struct snd_card *card = context; 2049 2029 struct azx *chip = card->private_data; 2050 - struct pci_dev *pci = chip->pci; 2051 2030 2052 - if (!fw) { 2053 - dev_err(card->dev, "Cannot load firmware, aborting\n"); 2054 - goto error; 2055 - } 2056 - 2057 - chip->fw = fw; 2031 + if (fw) 2032 + chip->fw = fw; 2033 + else 2034 + dev_err(card->dev, "Cannot load firmware, continue without patching\n"); 2058 2035 if (!chip->disabled) { 2059 2036 /* continue probing */ 2060 - if (azx_probe_continue(chip)) 2061 - goto error; 2037 + azx_probe_continue(chip); 2062 2038 } 2063 - return; /* OK */ 2064 - 2065 - error: 2066 - snd_card_free(card); 2067 - pci_set_drvdata(pci, NULL); 2068 2039 } 2069 2040 #endif 2070 2041 ··· 2319 2308 #endif 2320 2309 2321 2310 /* create codec instances */ 2322 - err = azx_probe_codecs(chip, azx_max_codecs[chip->driver_type]); 2323 - if (err < 0) 2324 - goto out_free; 2311 + if (bus->codec_mask) { 2312 + err = azx_probe_codecs(chip, azx_max_codecs[chip->driver_type]); 2313 + if (err < 0) 2314 + goto out_free; 2315 + } 2325 2316 2326 2317 #ifdef CONFIG_SND_HDA_PATCH_LOADER 2327 2318 if (chip->fw) { ··· 2337 2324 #endif 2338 2325 } 2339 2326 #endif 2340 - if ((probe_only[dev] & 1) == 0) { 2327 + if (bus->codec_mask && !(probe_only[dev] & 1)) { 2341 2328 err = azx_codec_configure(chip); 2342 2329 if (err < 0) 2343 2330 goto out_free; ··· 2354 2341 2355 2342 set_default_power_save(chip); 2356 2343 2357 - if (azx_has_pm_runtime(chip)) 2344 + if (azx_has_pm_runtime(chip)) { 2345 + pm_runtime_use_autosuspend(&pci->dev); 2346 + pm_runtime_allow(&pci->dev); 2358 2347 pm_runtime_put_autosuspend(&pci->dev); 2348 + } 2359 2349 2360 2350 out_free: 2361 - if (err < 0 || !hda->need_i915_power) 2351 + if (err < 0) { 2352 + azx_free(chip); 2353 + return err; 2354 + } 2355 + 2356 + if (!hda->need_i915_power) 2362 2357 display_power(chip, false); 2363 - if (err < 0) 2364 - hda->init_failed = 1; 2365 2358 complete_all(&hda->probe_wait); 2366 2359 to_hda_bus(bus)->bus_probing = 0; 2367 - return err; 2360 + return 0; 2368 2361 } 2369 2362 2370 2363 static void azx_remove(struct pci_dev *pci)
+1
sound/pci/hda/hda_intel.h
··· 27 27 unsigned int use_vga_switcheroo:1; 28 28 unsigned int vga_switcheroo_registered:1; 29 29 unsigned int init_failed:1; /* delayed init failed */ 30 + unsigned int freed:1; /* resources already released */ 30 31 31 32 bool need_i915_power:1; /* the hda controller needs i915 power */ 32 33 };
+1
sound/pci/hda/patch_realtek.c
··· 7378 7378 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), 7379 7379 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK), 7380 7380 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC), 7381 + SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC), 7381 7382 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE), 7382 7383 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), 7383 7384 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
+19 -12
sound/usb/mixer.c
··· 1457 1457 usb_audio_err(chip, 1458 1458 "cannot get connectors status: req = %#x, wValue = %#x, wIndex = %#x, type = %d\n", 1459 1459 UAC_GET_CUR, validx, idx, cval->val_type); 1460 - return ret; 1460 + return filter_error(cval, ret); 1461 1461 } 1462 1462 1463 1463 ucontrol->value.integer.value[0] = val; ··· 1771 1771 1772 1772 /* Build a mixer control for a UAC connector control (jack-detect) */ 1773 1773 static void build_connector_control(struct usb_mixer_interface *mixer, 1774 + const struct usbmix_name_map *imap, 1774 1775 struct usb_audio_term *term, bool is_input) 1775 1776 { 1776 1777 struct snd_kcontrol *kctl; 1777 1778 struct usb_mixer_elem_info *cval; 1779 + 1780 + if (check_ignored_ctl(find_map(imap, term->id, 0))) 1781 + return; 1778 1782 1779 1783 cval = kzalloc(sizeof(*cval), GFP_KERNEL); 1780 1784 if (!cval) ··· 2113 2109 check_input_term(state, term_id, &iterm); 2114 2110 2115 2111 /* Check for jack detection. */ 2116 - if (uac_v2v3_control_is_readable(bmctls, control)) 2117 - build_connector_control(state->mixer, &iterm, true); 2112 + if ((iterm.type & 0xff00) != 0x0100 && 2113 + uac_v2v3_control_is_readable(bmctls, control)) 2114 + build_connector_control(state->mixer, state->map, &iterm, true); 2118 2115 2119 2116 return 0; 2120 2117 } ··· 3076 3071 memset(&iterm, 0, sizeof(iterm)); 3077 3072 iterm.id = UAC3_BADD_IT_ID4; 3078 3073 iterm.type = UAC_BIDIR_TERMINAL_HEADSET; 3079 - build_connector_control(mixer, &iterm, true); 3074 + build_connector_control(mixer, map->map, &iterm, true); 3080 3075 3081 3076 /* Output Term - Insertion control */ 3082 3077 memset(&oterm, 0, sizeof(oterm)); 3083 3078 oterm.id = UAC3_BADD_OT_ID3; 3084 3079 oterm.type = UAC_BIDIR_TERMINAL_HEADSET; 3085 - build_connector_control(mixer, &oterm, false); 3080 + build_connector_control(mixer, map->map, &oterm, false); 3086 3081 } 3087 3082 3088 3083 return 0; ··· 3111 3106 if (map->id == state.chip->usb_id) { 3112 3107 state.map = map->map; 3113 3108 state.selector_map = map->selector_map; 3114 - mixer->ignore_ctl_error = map->ignore_ctl_error; 3109 + mixer->ignore_ctl_error |= map->ignore_ctl_error; 3115 3110 break; 3116 3111 } 3117 3112 } ··· 3154 3149 if (err < 0 && err != -EINVAL) 3155 3150 return err; 3156 3151 3157 - if (uac_v2v3_control_is_readable(le16_to_cpu(desc->bmControls), 3152 + if ((state.oterm.type & 0xff00) != 0x0100 && 3153 + uac_v2v3_control_is_readable(le16_to_cpu(desc->bmControls), 3158 3154 UAC2_TE_CONNECTOR)) { 3159 - build_connector_control(state.mixer, &state.oterm, 3160 - false); 3155 + build_connector_control(state.mixer, state.map, 3156 + &state.oterm, false); 3161 3157 } 3162 3158 } else { /* UAC_VERSION_3 */ 3163 3159 struct uac3_output_terminal_descriptor *desc = p; ··· 3180 3174 if (err < 0 && err != -EINVAL) 3181 3175 return err; 3182 3176 3183 - if (uac_v2v3_control_is_readable(le32_to_cpu(desc->bmControls), 3177 + if ((state.oterm.type & 0xff00) != 0x0100 && 3178 + uac_v2v3_control_is_readable(le32_to_cpu(desc->bmControls), 3184 3179 UAC3_TE_INSERTION)) { 3185 - build_connector_control(state.mixer, &state.oterm, 3186 - false); 3180 + build_connector_control(state.mixer, state.map, 3181 + &state.oterm, false); 3187 3182 } 3188 3183 } 3189 3184 }
+3 -1
sound/usb/mixer_maps.c
··· 360 360 }; 361 361 362 362 /* Some mobos shipped with a dummy HD-audio show the invalid GET_MIN/GET_MAX 363 - * response for Input Gain Pad (id=19, control=12). Skip it. 363 + * response for Input Gain Pad (id=19, control=12) and the connector status 364 + * for SPDIF terminal (id=18). Skip them. 364 365 */ 365 366 static const struct usbmix_name_map asus_rog_map[] = { 367 + { 18, NULL }, /* OT, connector control */ 366 368 { 19, NULL, 12 }, /* FU, Input Gain Pad */ 367 369 {} 368 370 };
+4 -1
tools/arch/x86/include/asm/cpufeatures.h
··· 217 217 #define X86_FEATURE_IBRS ( 7*32+25) /* Indirect Branch Restricted Speculation */ 218 218 #define X86_FEATURE_IBPB ( 7*32+26) /* Indirect Branch Prediction Barrier */ 219 219 #define X86_FEATURE_STIBP ( 7*32+27) /* Single Thread Indirect Branch Predictors */ 220 - #define X86_FEATURE_ZEN ( 7*32+28) /* "" CPU is AMD family 0x17 (Zen) */ 220 + #define X86_FEATURE_ZEN ( 7*32+28) /* "" CPU is AMD family 0x17 or above (Zen) */ 221 221 #define X86_FEATURE_L1TF_PTEINV ( 7*32+29) /* "" L1TF workaround PTE inversion */ 222 222 #define X86_FEATURE_IBRS_ENHANCED ( 7*32+30) /* Enhanced IBRS */ 223 223 #define X86_FEATURE_MSR_IA32_FEAT_CTL ( 7*32+31) /* "" MSR IA32_FEAT_CTL configured */ ··· 285 285 #define X86_FEATURE_CQM_MBM_LOCAL (11*32+ 3) /* LLC Local MBM monitoring */ 286 286 #define X86_FEATURE_FENCE_SWAPGS_USER (11*32+ 4) /* "" LFENCE in user entry SWAPGS path */ 287 287 #define X86_FEATURE_FENCE_SWAPGS_KERNEL (11*32+ 5) /* "" LFENCE in kernel entry SWAPGS path */ 288 + #define X86_FEATURE_SPLIT_LOCK_DETECT (11*32+ 6) /* #AC for split lock */ 288 289 289 290 /* Intel-defined CPU features, CPUID level 0x00000007:1 (EAX), word 12 */ 290 291 #define X86_FEATURE_AVX512_BF16 (12*32+ 5) /* AVX512 BFLOAT16 instructions */ ··· 300 299 #define X86_FEATURE_AMD_IBRS (13*32+14) /* "" Indirect Branch Restricted Speculation */ 301 300 #define X86_FEATURE_AMD_STIBP (13*32+15) /* "" Single Thread Indirect Branch Predictors */ 302 301 #define X86_FEATURE_AMD_STIBP_ALWAYS_ON (13*32+17) /* "" Single Thread Indirect Branch Predictors always-on preferred */ 302 + #define X86_FEATURE_AMD_PPIN (13*32+23) /* Protected Processor Inventory Number */ 303 303 #define X86_FEATURE_AMD_SSBD (13*32+24) /* "" Speculative Store Bypass Disable */ 304 304 #define X86_FEATURE_VIRT_SSBD (13*32+25) /* Virtualized Speculative Store Bypass Disable */ 305 305 #define X86_FEATURE_AMD_SSB_NO (13*32+26) /* "" Speculative Store Bypass is fixed in hardware. */ ··· 369 367 #define X86_FEATURE_INTEL_STIBP (18*32+27) /* "" Single Thread Indirect Branch Predictors */ 370 368 #define X86_FEATURE_FLUSH_L1D (18*32+28) /* Flush L1D cache */ 371 369 #define X86_FEATURE_ARCH_CAPABILITIES (18*32+29) /* IA32_ARCH_CAPABILITIES MSR (Intel) */ 370 + #define X86_FEATURE_CORE_CAPABILITIES (18*32+30) /* "" IA32_CORE_CAPABILITIES MSR */ 372 371 #define X86_FEATURE_SPEC_CTRL_SSBD (18*32+31) /* "" Speculative Store Bypass Disable */ 373 372 374 373 /*
+9
tools/arch/x86/include/asm/msr-index.h
··· 41 41 42 42 /* Intel MSRs. Some also available on other CPUs */ 43 43 44 + #define MSR_TEST_CTRL 0x00000033 45 + #define MSR_TEST_CTRL_SPLIT_LOCK_DETECT_BIT 29 46 + #define MSR_TEST_CTRL_SPLIT_LOCK_DETECT BIT(MSR_TEST_CTRL_SPLIT_LOCK_DETECT_BIT) 47 + 44 48 #define MSR_IA32_SPEC_CTRL 0x00000048 /* Speculation Control */ 45 49 #define SPEC_CTRL_IBRS BIT(0) /* Indirect Branch Restricted Speculation */ 46 50 #define SPEC_CTRL_STIBP_SHIFT 1 /* Single Thread Indirect Branch Predictor (STIBP) bit */ ··· 73 69 * bit[1:0] zero. 74 70 */ 75 71 #define MSR_IA32_UMWAIT_CONTROL_TIME_MASK (~0x03U) 72 + 73 + /* Abbreviated from Intel SDM name IA32_CORE_CAPABILITIES */ 74 + #define MSR_IA32_CORE_CAPS 0x000000cf 75 + #define MSR_IA32_CORE_CAPS_SPLIT_LOCK_DETECT_BIT 5 76 + #define MSR_IA32_CORE_CAPS_SPLIT_LOCK_DETECT BIT(MSR_IA32_CORE_CAPS_SPLIT_LOCK_DETECT_BIT) 76 77 77 78 #define MSR_PKG_CST_CONFIG_CONTROL 0x000000e2 78 79 #define NHM_C3_AUTO_DEMOTE (1UL << 25)
+3 -1
tools/bpf/bpftool/struct_ops.c
··· 591 591 592 592 err = cmd_select(cmds, argc, argv, do_help); 593 593 594 - btf__free(btf_vmlinux); 594 + if (!IS_ERR(btf_vmlinux)) 595 + btf__free(btf_vmlinux); 596 + 595 597 return err; 596 598 }
+21 -3
tools/include/linux/bits.h
··· 3 3 #define __LINUX_BITS_H 4 4 5 5 #include <linux/const.h> 6 + #include <vdso/bits.h> 6 7 #include <asm/bitsperlong.h> 7 8 8 - #define BIT(nr) (UL(1) << (nr)) 9 9 #define BIT_ULL(nr) (ULL(1) << (nr)) 10 10 #define BIT_MASK(nr) (UL(1) << ((nr) % BITS_PER_LONG)) 11 11 #define BIT_WORD(nr) ((nr) / BITS_PER_LONG) ··· 18 18 * position @h. For example 19 19 * GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000. 20 20 */ 21 - #define GENMASK(h, l) \ 21 + #if !defined(__ASSEMBLY__) && \ 22 + (!defined(CONFIG_CC_IS_GCC) || CONFIG_GCC_VERSION >= 49000) 23 + #include <linux/build_bug.h> 24 + #define GENMASK_INPUT_CHECK(h, l) \ 25 + (BUILD_BUG_ON_ZERO(__builtin_choose_expr( \ 26 + __builtin_constant_p((l) > (h)), (l) > (h), 0))) 27 + #else 28 + /* 29 + * BUILD_BUG_ON_ZERO is not available in h files included from asm files, 30 + * disable the input check if that is the case. 31 + */ 32 + #define GENMASK_INPUT_CHECK(h, l) 0 33 + #endif 34 + 35 + #define __GENMASK(h, l) \ 22 36 (((~UL(0)) - (UL(1) << (l)) + 1) & \ 23 37 (~UL(0) >> (BITS_PER_LONG - 1 - (h)))) 38 + #define GENMASK(h, l) \ 39 + (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l)) 24 40 25 - #define GENMASK_ULL(h, l) \ 41 + #define __GENMASK_ULL(h, l) \ 26 42 (((~ULL(0)) - (ULL(1) << (l)) + 1) & \ 27 43 (~ULL(0) >> (BITS_PER_LONG_LONG - 1 - (h)))) 44 + #define GENMASK_ULL(h, l) \ 45 + (GENMASK_INPUT_CHECK(h, l) + __GENMASK_ULL(h, l)) 28 46 29 47 #endif /* __LINUX_BITS_H */
+82
tools/include/linux/build_bug.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifndef _LINUX_BUILD_BUG_H 3 + #define _LINUX_BUILD_BUG_H 4 + 5 + #include <linux/compiler.h> 6 + 7 + #ifdef __CHECKER__ 8 + #define BUILD_BUG_ON_ZERO(e) (0) 9 + #else /* __CHECKER__ */ 10 + /* 11 + * Force a compilation error if condition is true, but also produce a 12 + * result (of value 0 and type int), so the expression can be used 13 + * e.g. in a structure initializer (or where-ever else comma expressions 14 + * aren't permitted). 15 + */ 16 + #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); }))) 17 + #endif /* __CHECKER__ */ 18 + 19 + /* Force a compilation error if a constant expression is not a power of 2 */ 20 + #define __BUILD_BUG_ON_NOT_POWER_OF_2(n) \ 21 + BUILD_BUG_ON(((n) & ((n) - 1)) != 0) 22 + #define BUILD_BUG_ON_NOT_POWER_OF_2(n) \ 23 + BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0)) 24 + 25 + /* 26 + * BUILD_BUG_ON_INVALID() permits the compiler to check the validity of the 27 + * expression but avoids the generation of any code, even if that expression 28 + * has side-effects. 29 + */ 30 + #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e)))) 31 + 32 + /** 33 + * BUILD_BUG_ON_MSG - break compile if a condition is true & emit supplied 34 + * error message. 35 + * @condition: the condition which the compiler should know is false. 36 + * 37 + * See BUILD_BUG_ON for description. 38 + */ 39 + #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) 40 + 41 + /** 42 + * BUILD_BUG_ON - break compile if a condition is true. 43 + * @condition: the condition which the compiler should know is false. 44 + * 45 + * If you have some code which relies on certain constants being equal, or 46 + * some other compile-time-evaluated condition, you should use BUILD_BUG_ON to 47 + * detect if someone changes it. 48 + */ 49 + #define BUILD_BUG_ON(condition) \ 50 + BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition) 51 + 52 + /** 53 + * BUILD_BUG - break compile if used. 54 + * 55 + * If you have some code that you expect the compiler to eliminate at 56 + * build time, you should use BUILD_BUG to detect if it is 57 + * unexpectedly used. 58 + */ 59 + #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") 60 + 61 + /** 62 + * static_assert - check integer constant expression at build time 63 + * 64 + * static_assert() is a wrapper for the C11 _Static_assert, with a 65 + * little macro magic to make the message optional (defaulting to the 66 + * stringification of the tested expression). 67 + * 68 + * Contrary to BUILD_BUG_ON(), static_assert() can be used at global 69 + * scope, but requires the expression to be an integer constant 70 + * expression (i.e., it is not enough that __builtin_constant_p() is 71 + * true for expr). 72 + * 73 + * Also note that BUILD_BUG_ON() fails the build if the condition is 74 + * true, while static_assert() fails the build if the expression is 75 + * false. 76 + */ 77 + #ifndef static_assert 78 + #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr) 79 + #define __static_assert(expr, msg, ...) _Static_assert(expr, msg) 80 + #endif // static_assert 81 + 82 + #endif /* _LINUX_BUILD_BUG_H */
+26
tools/include/linux/compiler.h
··· 10 10 # define __compiletime_error(message) 11 11 #endif 12 12 13 + #ifdef __OPTIMIZE__ 14 + # define __compiletime_assert(condition, msg, prefix, suffix) \ 15 + do { \ 16 + extern void prefix ## suffix(void) __compiletime_error(msg); \ 17 + if (!(condition)) \ 18 + prefix ## suffix(); \ 19 + } while (0) 20 + #else 21 + # define __compiletime_assert(condition, msg, prefix, suffix) do { } while (0) 22 + #endif 23 + 24 + #define _compiletime_assert(condition, msg, prefix, suffix) \ 25 + __compiletime_assert(condition, msg, prefix, suffix) 26 + 27 + /** 28 + * compiletime_assert - break build and emit msg if condition is false 29 + * @condition: a compile-time constant condition to check 30 + * @msg: a message to emit if condition is false 31 + * 32 + * In tradition of POSIX assert, this macro will break the build if the 33 + * supplied condition is *false*, emitting the supplied error message if the 34 + * compiler has support to do so. 35 + */ 36 + #define compiletime_assert(condition, msg) \ 37 + _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) 38 + 13 39 /* Optimization barrier */ 14 40 /* The "volatile" is due to gcc bugs */ 15 41 #define barrier() __asm__ __volatile__("": : :"memory")
+1 -4
tools/include/linux/const.h
··· 1 1 #ifndef _LINUX_CONST_H 2 2 #define _LINUX_CONST_H 3 3 4 - #include <uapi/linux/const.h> 5 - 6 - #define UL(x) (_UL(x)) 7 - #define ULL(x) (_ULL(x)) 4 + #include <vdso/const.h> 8 5 9 6 #endif /* _LINUX_CONST_H */
+1 -3
tools/include/linux/kernel.h
··· 5 5 #include <stdarg.h> 6 6 #include <stddef.h> 7 7 #include <assert.h> 8 + #include <linux/build_bug.h> 8 9 #include <linux/compiler.h> 9 10 #include <endian.h> 10 11 #include <byteswap.h> ··· 35 34 const typeof(((type *)0)->member) * __mptr = (ptr); \ 36 35 (type *)((char *)__mptr - offsetof(type, member)); }) 37 36 #endif 38 - 39 - #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) 40 - #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); })) 41 37 42 38 #ifndef max 43 39 #define max(x, y) ({ \
+2
tools/include/uapi/drm/drm.h
··· 948 948 #define DRM_IOCTL_SYNCOBJ_TRANSFER DRM_IOWR(0xCC, struct drm_syncobj_transfer) 949 949 #define DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL DRM_IOWR(0xCD, struct drm_syncobj_timeline_array) 950 950 951 + #define DRM_IOCTL_MODE_GETFB2 DRM_IOWR(0xCE, struct drm_mode_fb_cmd2) 952 + 951 953 /** 952 954 * Device specific ioctls should only be in their respective headers 953 955 * The device specific ioctl range is from 0x40 to 0x9f.
+21
tools/include/uapi/drm/i915_drm.h
··· 1619 1619 * By default, new contexts allow persistence. 1620 1620 */ 1621 1621 #define I915_CONTEXT_PARAM_PERSISTENCE 0xb 1622 + 1623 + /* 1624 + * I915_CONTEXT_PARAM_RINGSIZE: 1625 + * 1626 + * Sets the size of the CS ringbuffer to use for logical ring contexts. This 1627 + * applies a limit of how many batches can be queued to HW before the caller 1628 + * is blocked due to lack of space for more commands. 1629 + * 1630 + * Only reliably possible to be set prior to first use, i.e. during 1631 + * construction. At any later point, the current execution must be flushed as 1632 + * the ring can only be changed while the context is idle. Note, the ringsize 1633 + * can be specified as a constructor property, see 1634 + * I915_CONTEXT_CREATE_EXT_SETPARAM, but can also be set later if required. 1635 + * 1636 + * Only applies to the current set of engine and lost when those engines 1637 + * are replaced by a new mapping (see I915_CONTEXT_PARAM_ENGINES). 1638 + * 1639 + * Must be between 4 - 512 KiB, in intervals of page size [4 KiB]. 1640 + * Default is 16 KiB. 1641 + */ 1642 + #define I915_CONTEXT_PARAM_RINGSIZE 0xc 1622 1643 /* Must be kept compact -- no holes and well documented */ 1623 1644 1624 1645 __u64 value;
+1
tools/include/uapi/linux/fscrypt.h
··· 163 163 #define FS_IOC_REMOVE_ENCRYPTION_KEY _IOWR('f', 24, struct fscrypt_remove_key_arg) 164 164 #define FS_IOC_REMOVE_ENCRYPTION_KEY_ALL_USERS _IOWR('f', 25, struct fscrypt_remove_key_arg) 165 165 #define FS_IOC_GET_ENCRYPTION_KEY_STATUS _IOWR('f', 26, struct fscrypt_get_key_status_arg) 166 + #define FS_IOC_GET_ENCRYPTION_NONCE _IOR('f', 27, __u8[16]) 166 167 167 168 /**********************************************************************/ 168 169
+45 -2
tools/include/uapi/linux/kvm.h
··· 474 474 __u32 size; /* amount of bytes */ 475 475 __u32 op; /* type of operation */ 476 476 __u64 buf; /* buffer in userspace */ 477 - __u8 ar; /* the access register number */ 478 - __u8 reserved[31]; /* should be set to 0 */ 477 + union { 478 + __u8 ar; /* the access register number */ 479 + __u32 sida_offset; /* offset into the sida */ 480 + __u8 reserved[32]; /* should be set to 0 */ 481 + }; 479 482 }; 480 483 /* types for kvm_s390_mem_op->op */ 481 484 #define KVM_S390_MEMOP_LOGICAL_READ 0 482 485 #define KVM_S390_MEMOP_LOGICAL_WRITE 1 486 + #define KVM_S390_MEMOP_SIDA_READ 2 487 + #define KVM_S390_MEMOP_SIDA_WRITE 3 483 488 /* flags for kvm_s390_mem_op->flags */ 484 489 #define KVM_S390_MEMOP_F_CHECK_ONLY (1ULL << 0) 485 490 #define KVM_S390_MEMOP_F_INJECT_EXCEPTION (1ULL << 1) ··· 1015 1010 #define KVM_CAP_ARM_NISV_TO_USER 177 1016 1011 #define KVM_CAP_ARM_INJECT_EXT_DABT 178 1017 1012 #define KVM_CAP_S390_VCPU_RESETS 179 1013 + #define KVM_CAP_S390_PROTECTED 180 1014 + #define KVM_CAP_PPC_SECURE_GUEST 181 1018 1015 1019 1016 #ifdef KVM_CAP_IRQ_ROUTING 1020 1017 ··· 1485 1478 #define KVM_S390_NORMAL_RESET _IO(KVMIO, 0xc3) 1486 1479 #define KVM_S390_CLEAR_RESET _IO(KVMIO, 0xc4) 1487 1480 1481 + struct kvm_s390_pv_sec_parm { 1482 + __u64 origin; 1483 + __u64 length; 1484 + }; 1485 + 1486 + struct kvm_s390_pv_unp { 1487 + __u64 addr; 1488 + __u64 size; 1489 + __u64 tweak; 1490 + }; 1491 + 1492 + enum pv_cmd_id { 1493 + KVM_PV_ENABLE, 1494 + KVM_PV_DISABLE, 1495 + KVM_PV_SET_SEC_PARMS, 1496 + KVM_PV_UNPACK, 1497 + KVM_PV_VERIFY, 1498 + KVM_PV_PREP_RESET, 1499 + KVM_PV_UNSHARE_ALL, 1500 + }; 1501 + 1502 + struct kvm_pv_cmd { 1503 + __u32 cmd; /* Command to be executed */ 1504 + __u16 rc; /* Ultravisor return code */ 1505 + __u16 rrc; /* Ultravisor return reason code */ 1506 + __u64 data; /* Data or address */ 1507 + __u32 flags; /* flags for future extensions. Must be 0 for now */ 1508 + __u32 reserved[3]; 1509 + }; 1510 + 1511 + /* Available with KVM_CAP_S390_PROTECTED */ 1512 + #define KVM_S390_PV_COMMAND _IOWR(KVMIO, 0xc5, struct kvm_pv_cmd) 1513 + 1488 1514 /* Secure Encrypted Virtualization command */ 1489 1515 enum sev_cmd_id { 1490 1516 /* Guest initialization commands */ ··· 1667 1627 1668 1628 #define KVM_HYPERV_CONN_ID_MASK 0x00ffffff 1669 1629 #define KVM_HYPERV_EVENTFD_DEASSIGN (1 << 0) 1630 + 1631 + #define KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE (1 << 0) 1632 + #define KVM_DIRTY_LOG_INITIALLY_SET (1 << 1) 1670 1633 1671 1634 #endif /* __LINUX_KVM_H */
+3 -2
tools/include/uapi/linux/mman.h
··· 5 5 #include <asm/mman.h> 6 6 #include <asm-generic/hugetlb_encode.h> 7 7 8 - #define MREMAP_MAYMOVE 1 9 - #define MREMAP_FIXED 2 8 + #define MREMAP_MAYMOVE 1 9 + #define MREMAP_FIXED 2 10 + #define MREMAP_DONTUNMAP 4 10 11 11 12 #define OVERCOMMIT_GUESS 0 12 13 #define OVERCOMMIT_ALWAYS 1
+5
tools/include/uapi/linux/sched.h
··· 35 35 36 36 /* Flags for the clone3() syscall. */ 37 37 #define CLONE_CLEAR_SIGHAND 0x100000000ULL /* Clear any signal handler and reset to SIG_DFL. */ 38 + #define CLONE_INTO_CGROUP 0x200000000ULL /* Clone into a specific cgroup given the right permissions. */ 38 39 39 40 /* 40 41 * cloning flags intersect with CSIGNAL so can be used with unshare and clone3 ··· 82 81 * @set_tid_size: This defines the size of the array referenced 83 82 * in @set_tid. This cannot be larger than the 84 83 * kernel's limit of nested PID namespaces. 84 + * @cgroup: If CLONE_INTO_CGROUP is specified set this to 85 + * a file descriptor for the cgroup. 85 86 * 86 87 * The structure is versioned by size and thus extensible. 87 88 * New struct members must go at the end of the struct and ··· 100 97 __aligned_u64 tls; 101 98 __aligned_u64 set_tid; 102 99 __aligned_u64 set_tid_size; 100 + __aligned_u64 cgroup; 103 101 }; 104 102 #endif 105 103 106 104 #define CLONE_ARGS_SIZE_VER0 64 /* sizeof first published struct */ 107 105 #define CLONE_ARGS_SIZE_VER1 80 /* sizeof second published struct */ 106 + #define CLONE_ARGS_SIZE_VER2 88 /* sizeof third published struct */ 108 107 109 108 /* 110 109 * Scheduling policies
+24
tools/include/uapi/linux/vhost.h
··· 116 116 #define VHOST_VSOCK_SET_GUEST_CID _IOW(VHOST_VIRTIO, 0x60, __u64) 117 117 #define VHOST_VSOCK_SET_RUNNING _IOW(VHOST_VIRTIO, 0x61, int) 118 118 119 + /* VHOST_VDPA specific defines */ 120 + 121 + /* Get the device id. The device ids follow the same definition of 122 + * the device id defined in virtio-spec. 123 + */ 124 + #define VHOST_VDPA_GET_DEVICE_ID _IOR(VHOST_VIRTIO, 0x70, __u32) 125 + /* Get and set the status. The status bits follow the same definition 126 + * of the device status defined in virtio-spec. 127 + */ 128 + #define VHOST_VDPA_GET_STATUS _IOR(VHOST_VIRTIO, 0x71, __u8) 129 + #define VHOST_VDPA_SET_STATUS _IOW(VHOST_VIRTIO, 0x72, __u8) 130 + /* Get and set the device config. The device config follows the same 131 + * definition of the device config defined in virtio-spec. 132 + */ 133 + #define VHOST_VDPA_GET_CONFIG _IOR(VHOST_VIRTIO, 0x73, \ 134 + struct vhost_vdpa_config) 135 + #define VHOST_VDPA_SET_CONFIG _IOW(VHOST_VIRTIO, 0x74, \ 136 + struct vhost_vdpa_config) 137 + /* Enable/disable the ring. */ 138 + #define VHOST_VDPA_SET_VRING_ENABLE _IOW(VHOST_VIRTIO, 0x75, \ 139 + struct vhost_vring_state) 140 + /* Get the max ring size. */ 141 + #define VHOST_VDPA_GET_VRING_NUM _IOR(VHOST_VIRTIO, 0x76, __u16) 142 + 119 143 #endif
+9
tools/include/vdso/bits.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifndef __VDSO_BITS_H 3 + #define __VDSO_BITS_H 4 + 5 + #include <vdso/const.h> 6 + 7 + #define BIT(nr) (UL(1) << (nr)) 8 + 9 + #endif /* __VDSO_BITS_H */
+10
tools/include/vdso/const.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifndef __VDSO_CONST_H 3 + #define __VDSO_CONST_H 4 + 5 + #include <uapi/linux/const.h> 6 + 7 + #define UL(x) (_UL(x)) 8 + #define ULL(x) (_ULL(x)) 9 + 10 + #endif /* __VDSO_CONST_H */
+82 -44
tools/lib/bpf/libbpf.c
··· 178 178 __u32 array_mmap:1; 179 179 /* BTF_FUNC_GLOBAL is supported */ 180 180 __u32 btf_func_global:1; 181 + /* kernel support for expected_attach_type in BPF_PROG_LOAD */ 182 + __u32 exp_attach_type:1; 181 183 }; 182 184 183 185 enum reloc_type { ··· 196 194 int sym_off; 197 195 }; 198 196 197 + struct bpf_sec_def; 198 + 199 + typedef struct bpf_link *(*attach_fn_t)(const struct bpf_sec_def *sec, 200 + struct bpf_program *prog); 201 + 202 + struct bpf_sec_def { 203 + const char *sec; 204 + size_t len; 205 + enum bpf_prog_type prog_type; 206 + enum bpf_attach_type expected_attach_type; 207 + bool is_exp_attach_type_optional; 208 + bool is_attachable; 209 + bool is_attach_btf; 210 + attach_fn_t attach_fn; 211 + }; 212 + 199 213 /* 200 214 * bpf_prog should be a better name but it has been used in 201 215 * linux/filter.h. ··· 222 204 char *name; 223 205 int prog_ifindex; 224 206 char *section_name; 207 + const struct bpf_sec_def *sec_def; 225 208 /* section_name with / replaced by _; makes recursive pinning 226 209 * in bpf_object__pin_programs easier 227 210 */ ··· 3335 3316 } 3336 3317 3337 3318 static int 3319 + bpf_object__probe_exp_attach_type(struct bpf_object *obj) 3320 + { 3321 + struct bpf_load_program_attr attr; 3322 + struct bpf_insn insns[] = { 3323 + BPF_MOV64_IMM(BPF_REG_0, 0), 3324 + BPF_EXIT_INSN(), 3325 + }; 3326 + int fd; 3327 + 3328 + memset(&attr, 0, sizeof(attr)); 3329 + /* use any valid combination of program type and (optional) 3330 + * non-zero expected attach type (i.e., not a BPF_CGROUP_INET_INGRESS) 3331 + * to see if kernel supports expected_attach_type field for 3332 + * BPF_PROG_LOAD command 3333 + */ 3334 + attr.prog_type = BPF_PROG_TYPE_CGROUP_SOCK; 3335 + attr.expected_attach_type = BPF_CGROUP_INET_SOCK_CREATE; 3336 + attr.insns = insns; 3337 + attr.insns_cnt = ARRAY_SIZE(insns); 3338 + attr.license = "GPL"; 3339 + 3340 + fd = bpf_load_program_xattr(&attr, NULL, 0); 3341 + if (fd >= 0) { 3342 + obj->caps.exp_attach_type = 1; 3343 + close(fd); 3344 + return 1; 3345 + } 3346 + return 0; 3347 + } 3348 + 3349 + static int 3338 3350 bpf_object__probe_caps(struct bpf_object *obj) 3339 3351 { 3340 3352 int (*probe_fn[])(struct bpf_object *obj) = { ··· 3375 3325 bpf_object__probe_btf_func_global, 3376 3326 bpf_object__probe_btf_datasec, 3377 3327 bpf_object__probe_array_mmap, 3328 + bpf_object__probe_exp_attach_type, 3378 3329 }; 3379 3330 int i, ret; 3380 3331 ··· 4912 4861 4913 4862 memset(&load_attr, 0, sizeof(struct bpf_load_program_attr)); 4914 4863 load_attr.prog_type = prog->type; 4915 - load_attr.expected_attach_type = prog->expected_attach_type; 4864 + /* old kernels might not support specifying expected_attach_type */ 4865 + if (!prog->caps->exp_attach_type && prog->sec_def && 4866 + prog->sec_def->is_exp_attach_type_optional) 4867 + load_attr.expected_attach_type = 0; 4868 + else 4869 + load_attr.expected_attach_type = prog->expected_attach_type; 4916 4870 if (prog->caps->name) 4917 4871 load_attr.name = prog->name; 4918 4872 load_attr.insns = insns; ··· 5118 5062 return 0; 5119 5063 } 5120 5064 5065 + static const struct bpf_sec_def *find_sec_def(const char *sec_name); 5066 + 5121 5067 static struct bpf_object * 5122 5068 __bpf_object__open(const char *path, const void *obj_buf, size_t obj_buf_sz, 5123 5069 const struct bpf_object_open_opts *opts) ··· 5175 5117 bpf_object__elf_finish(obj); 5176 5118 5177 5119 bpf_object__for_each_program(prog, obj) { 5178 - enum bpf_prog_type prog_type; 5179 - enum bpf_attach_type attach_type; 5180 - 5181 - if (prog->type != BPF_PROG_TYPE_UNSPEC) 5182 - continue; 5183 - 5184 - err = libbpf_prog_type_by_name(prog->section_name, &prog_type, 5185 - &attach_type); 5186 - if (err == -ESRCH) 5120 + prog->sec_def = find_sec_def(prog->section_name); 5121 + if (!prog->sec_def) 5187 5122 /* couldn't guess, but user might manually specify */ 5188 5123 continue; 5189 - if (err) 5190 - goto out; 5191 5124 5192 - bpf_program__set_type(prog, prog_type); 5193 - bpf_program__set_expected_attach_type(prog, attach_type); 5194 - if (prog_type == BPF_PROG_TYPE_TRACING || 5195 - prog_type == BPF_PROG_TYPE_EXT) 5125 + bpf_program__set_type(prog, prog->sec_def->prog_type); 5126 + bpf_program__set_expected_attach_type(prog, 5127 + prog->sec_def->expected_attach_type); 5128 + 5129 + if (prog->sec_def->prog_type == BPF_PROG_TYPE_TRACING || 5130 + prog->sec_def->prog_type == BPF_PROG_TYPE_EXT) 5196 5131 prog->attach_prog_fd = OPTS_GET(opts, attach_prog_fd, 0); 5197 5132 } 5198 5133 ··· 6274 6223 prog->expected_attach_type = type; 6275 6224 } 6276 6225 6277 - #define BPF_PROG_SEC_IMPL(string, ptype, eatype, is_attachable, btf, atype) \ 6278 - { string, sizeof(string) - 1, ptype, eatype, is_attachable, btf, atype } 6226 + #define BPF_PROG_SEC_IMPL(string, ptype, eatype, eatype_optional, \ 6227 + attachable, attach_btf) \ 6228 + { \ 6229 + .sec = string, \ 6230 + .len = sizeof(string) - 1, \ 6231 + .prog_type = ptype, \ 6232 + .expected_attach_type = eatype, \ 6233 + .is_exp_attach_type_optional = eatype_optional, \ 6234 + .is_attachable = attachable, \ 6235 + .is_attach_btf = attach_btf, \ 6236 + } 6279 6237 6280 6238 /* Programs that can NOT be attached. */ 6281 6239 #define BPF_PROG_SEC(string, ptype) BPF_PROG_SEC_IMPL(string, ptype, 0, 0, 0, 0) 6282 6240 6283 6241 /* Programs that can be attached. */ 6284 6242 #define BPF_APROG_SEC(string, ptype, atype) \ 6285 - BPF_PROG_SEC_IMPL(string, ptype, 0, 1, 0, atype) 6243 + BPF_PROG_SEC_IMPL(string, ptype, atype, true, 1, 0) 6286 6244 6287 6245 /* Programs that must specify expected attach type at load time. */ 6288 6246 #define BPF_EAPROG_SEC(string, ptype, eatype) \ 6289 - BPF_PROG_SEC_IMPL(string, ptype, eatype, 1, 0, eatype) 6247 + BPF_PROG_SEC_IMPL(string, ptype, eatype, false, 1, 0) 6290 6248 6291 6249 /* Programs that use BTF to identify attach point */ 6292 6250 #define BPF_PROG_BTF(string, ptype, eatype) \ 6293 - BPF_PROG_SEC_IMPL(string, ptype, eatype, 0, 1, 0) 6251 + BPF_PROG_SEC_IMPL(string, ptype, eatype, false, 0, 1) 6294 6252 6295 6253 /* Programs that can be attached but attach type can't be identified by section 6296 6254 * name. Kept for backward compatibility. ··· 6313 6253 __VA_ARGS__ \ 6314 6254 } 6315 6255 6316 - struct bpf_sec_def; 6317 - 6318 - typedef struct bpf_link *(*attach_fn_t)(const struct bpf_sec_def *sec, 6319 - struct bpf_program *prog); 6320 - 6321 6256 static struct bpf_link *attach_kprobe(const struct bpf_sec_def *sec, 6322 6257 struct bpf_program *prog); 6323 6258 static struct bpf_link *attach_tp(const struct bpf_sec_def *sec, ··· 6323 6268 struct bpf_program *prog); 6324 6269 static struct bpf_link *attach_lsm(const struct bpf_sec_def *sec, 6325 6270 struct bpf_program *prog); 6326 - 6327 - struct bpf_sec_def { 6328 - const char *sec; 6329 - size_t len; 6330 - enum bpf_prog_type prog_type; 6331 - enum bpf_attach_type expected_attach_type; 6332 - bool is_attachable; 6333 - bool is_attach_btf; 6334 - enum bpf_attach_type attach_type; 6335 - attach_fn_t attach_fn; 6336 - }; 6337 6271 6338 6272 static const struct bpf_sec_def section_defs[] = { 6339 6273 BPF_PROG_SEC("socket", BPF_PROG_TYPE_SOCKET_FILTER), ··· 6757 6713 continue; 6758 6714 if (!section_defs[i].is_attachable) 6759 6715 return -EINVAL; 6760 - *attach_type = section_defs[i].attach_type; 6716 + *attach_type = section_defs[i].expected_attach_type; 6761 6717 return 0; 6762 6718 } 6763 6719 pr_debug("failed to guess attach type based on ELF section name '%s'\n", name); ··· 7586 7542 struct bpf_link * 7587 7543 bpf_program__attach_cgroup(struct bpf_program *prog, int cgroup_fd) 7588 7544 { 7589 - const struct bpf_sec_def *sec_def; 7590 7545 enum bpf_attach_type attach_type; 7591 7546 char errmsg[STRERR_BUFSIZE]; 7592 7547 struct bpf_link *link; ··· 7604 7561 link->detach = &bpf_link__detach_fd; 7605 7562 7606 7563 attach_type = bpf_program__get_expected_attach_type(prog); 7607 - if (!attach_type) { 7608 - sec_def = find_sec_def(bpf_program__title(prog, false)); 7609 - if (sec_def) 7610 - attach_type = sec_def->attach_type; 7611 - } 7612 7564 link_fd = bpf_link_create(prog_fd, cgroup_fd, attach_type, NULL); 7613 7565 if (link_fd < 0) { 7614 7566 link_fd = -errno;
+1 -1
tools/lib/bpf/libbpf.h
··· 458 458 459 459 struct bpf_xdp_set_link_opts { 460 460 size_t sz; 461 - __u32 old_fd; 461 + int old_fd; 462 462 }; 463 463 #define bpf_xdp_set_link_opts__last_field old_fd 464 464
+3 -3
tools/lib/bpf/netlink.c
··· 142 142 struct ifinfomsg ifinfo; 143 143 char attrbuf[64]; 144 144 } req; 145 - __u32 nl_pid; 145 + __u32 nl_pid = 0; 146 146 147 147 sock = libbpf_netlink_open(&nl_pid); 148 148 if (sock < 0) ··· 288 288 { 289 289 struct xdp_id_md xdp_id = {}; 290 290 int sock, ret; 291 - __u32 nl_pid; 291 + __u32 nl_pid = 0; 292 292 __u32 mask; 293 293 294 294 if (flags & ~XDP_FLAGS_MASK || !info_size) ··· 321 321 322 322 static __u32 get_xdp_id(struct xdp_link_info *info, __u32 flags) 323 323 { 324 - if (info->attach_mode != XDP_ATTACHED_MULTI) 324 + if (info->attach_mode != XDP_ATTACHED_MULTI && !flags) 325 325 return info->prog_id; 326 326 if (flags & XDP_FLAGS_DRV_MODE) 327 327 return info->drv_prog_id;
+18 -8
tools/objtool/check.c
··· 1050 1050 * it. 1051 1051 */ 1052 1052 for (; 1053 - &insn->list != &file->insn_list && 1054 - insn->sec == func->sec && 1055 - insn->offset >= func->offset; 1056 - 1053 + &insn->list != &file->insn_list && insn->func && insn->func->pfunc == func; 1057 1054 insn = insn->first_jump_src ?: list_prev_entry(insn, list)) { 1058 1055 1059 1056 if (insn != orig_insn && insn->type == INSN_JUMP_DYNAMIC) ··· 2005 2008 } 2006 2009 2007 2010 if (state->bp_scratch) { 2008 - WARN("%s uses BP as a scratch register", 2009 - func->name); 2011 + WARN_FUNC("BP used as a scratch register", 2012 + insn->sec, insn->offset); 2010 2013 return 1; 2011 2014 } 2012 2015 ··· 2361 2364 !strcmp(insn->sec->name, ".altinstr_aux")) 2362 2365 return true; 2363 2366 2367 + if (!insn->func) 2368 + return false; 2369 + 2370 + /* 2371 + * CONFIG_UBSAN_TRAP inserts a UD2 when it sees 2372 + * __builtin_unreachable(). The BUG() macro has an unreachable() after 2373 + * the UD2, which causes GCC's undefined trap logic to emit another UD2 2374 + * (or occasionally a JMP to UD2). 2375 + */ 2376 + if (list_prev_entry(insn, list)->dead_end && 2377 + (insn->type == INSN_BUG || 2378 + (insn->type == INSN_JUMP_UNCONDITIONAL && 2379 + insn->jump_dest && insn->jump_dest->type == INSN_BUG))) 2380 + return true; 2381 + 2364 2382 /* 2365 2383 * Check if this (or a subsequent) instruction is related to 2366 2384 * CONFIG_UBSAN or CONFIG_KASAN. 2367 2385 * 2368 2386 * End the search at 5 instructions to avoid going into the weeds. 2369 2387 */ 2370 - if (!insn->func) 2371 - return false; 2372 2388 for (i = 0; i < 5; i++) { 2373 2389 2374 2390 if (is_kasan_insn(insn) || is_ubsan_insn(insn))
+25 -15
tools/objtool/orc_dump.c
··· 66 66 char *name; 67 67 size_t nr_sections; 68 68 Elf64_Addr orc_ip_addr = 0; 69 - size_t shstrtab_idx; 69 + size_t shstrtab_idx, strtab_idx = 0; 70 70 Elf *elf; 71 71 Elf_Scn *scn; 72 72 GElf_Shdr sh; ··· 127 127 128 128 if (!strcmp(name, ".symtab")) { 129 129 symtab = data; 130 + } else if (!strcmp(name, ".strtab")) { 131 + strtab_idx = i; 130 132 } else if (!strcmp(name, ".orc_unwind")) { 131 133 orc = data->d_buf; 132 134 orc_size = sh.sh_size; ··· 140 138 } 141 139 } 142 140 143 - if (!symtab || !orc || !orc_ip) 141 + if (!symtab || !strtab_idx || !orc || !orc_ip) 144 142 return 0; 145 143 146 144 if (orc_size % sizeof(*orc) != 0) { ··· 161 159 return -1; 162 160 } 163 161 164 - scn = elf_getscn(elf, sym.st_shndx); 165 - if (!scn) { 166 - WARN_ELF("elf_getscn"); 167 - return -1; 168 - } 162 + if (GELF_ST_TYPE(sym.st_info) == STT_SECTION) { 163 + scn = elf_getscn(elf, sym.st_shndx); 164 + if (!scn) { 165 + WARN_ELF("elf_getscn"); 166 + return -1; 167 + } 169 168 170 - if (!gelf_getshdr(scn, &sh)) { 171 - WARN_ELF("gelf_getshdr"); 172 - return -1; 173 - } 169 + if (!gelf_getshdr(scn, &sh)) { 170 + WARN_ELF("gelf_getshdr"); 171 + return -1; 172 + } 174 173 175 - name = elf_strptr(elf, shstrtab_idx, sh.sh_name); 176 - if (!name || !*name) { 177 - WARN_ELF("elf_strptr"); 178 - return -1; 174 + name = elf_strptr(elf, shstrtab_idx, sh.sh_name); 175 + if (!name) { 176 + WARN_ELF("elf_strptr"); 177 + return -1; 178 + } 179 + } else { 180 + name = elf_strptr(elf, strtab_idx, sym.st_name); 181 + if (!name) { 182 + WARN_ELF("elf_strptr"); 183 + return -1; 184 + } 179 185 } 180 186 181 187 printf("%s+%llx:", name, (unsigned long long)rela.r_addend);
+26 -7
tools/objtool/orc_gen.c
··· 88 88 struct orc_entry *orc; 89 89 struct rela *rela; 90 90 91 - if (!insn_sec->sym) { 92 - WARN("missing symbol for section %s", insn_sec->name); 93 - return -1; 94 - } 95 - 96 91 /* populate ORC data */ 97 92 orc = (struct orc_entry *)u_sec->data->d_buf + idx; 98 93 memcpy(orc, o, sizeof(*orc)); ··· 100 105 } 101 106 memset(rela, 0, sizeof(*rela)); 102 107 103 - rela->sym = insn_sec->sym; 104 - rela->addend = insn_off; 108 + if (insn_sec->sym) { 109 + rela->sym = insn_sec->sym; 110 + rela->addend = insn_off; 111 + } else { 112 + /* 113 + * The Clang assembler doesn't produce section symbols, so we 114 + * have to reference the function symbol instead: 115 + */ 116 + rela->sym = find_symbol_containing(insn_sec, insn_off); 117 + if (!rela->sym) { 118 + /* 119 + * Hack alert. This happens when we need to reference 120 + * the NOP pad insn immediately after the function. 121 + */ 122 + rela->sym = find_symbol_containing(insn_sec, 123 + insn_off - 1); 124 + } 125 + if (!rela->sym) { 126 + WARN("missing symbol for insn at offset 0x%lx\n", 127 + insn_off); 128 + return -1; 129 + } 130 + 131 + rela->addend = insn_off - rela->sym->offset; 132 + } 133 + 105 134 rela->type = R_X86_64_PC32; 106 135 rela->offset = idx * sizeof(int); 107 136 rela->sec = ip_relasec;
+370 -370
tools/perf/arch/x86/entry/syscalls/syscall_64.tbl
··· 8 8 # 9 9 # The abi is "common", "64" or "x32" for this file. 10 10 # 11 - 0 common read __x64_sys_read 12 - 1 common write __x64_sys_write 13 - 2 common open __x64_sys_open 14 - 3 common close __x64_sys_close 15 - 4 common stat __x64_sys_newstat 16 - 5 common fstat __x64_sys_newfstat 17 - 6 common lstat __x64_sys_newlstat 18 - 7 common poll __x64_sys_poll 19 - 8 common lseek __x64_sys_lseek 20 - 9 common mmap __x64_sys_mmap 21 - 10 common mprotect __x64_sys_mprotect 22 - 11 common munmap __x64_sys_munmap 23 - 12 common brk __x64_sys_brk 24 - 13 64 rt_sigaction __x64_sys_rt_sigaction 25 - 14 common rt_sigprocmask __x64_sys_rt_sigprocmask 26 - 15 64 rt_sigreturn __x64_sys_rt_sigreturn/ptregs 27 - 16 64 ioctl __x64_sys_ioctl 28 - 17 common pread64 __x64_sys_pread64 29 - 18 common pwrite64 __x64_sys_pwrite64 30 - 19 64 readv __x64_sys_readv 31 - 20 64 writev __x64_sys_writev 32 - 21 common access __x64_sys_access 33 - 22 common pipe __x64_sys_pipe 34 - 23 common select __x64_sys_select 35 - 24 common sched_yield __x64_sys_sched_yield 36 - 25 common mremap __x64_sys_mremap 37 - 26 common msync __x64_sys_msync 38 - 27 common mincore __x64_sys_mincore 39 - 28 common madvise __x64_sys_madvise 40 - 29 common shmget __x64_sys_shmget 41 - 30 common shmat __x64_sys_shmat 42 - 31 common shmctl __x64_sys_shmctl 43 - 32 common dup __x64_sys_dup 44 - 33 common dup2 __x64_sys_dup2 45 - 34 common pause __x64_sys_pause 46 - 35 common nanosleep __x64_sys_nanosleep 47 - 36 common getitimer __x64_sys_getitimer 48 - 37 common alarm __x64_sys_alarm 49 - 38 common setitimer __x64_sys_setitimer 50 - 39 common getpid __x64_sys_getpid 51 - 40 common sendfile __x64_sys_sendfile64 52 - 41 common socket __x64_sys_socket 53 - 42 common connect __x64_sys_connect 54 - 43 common accept __x64_sys_accept 55 - 44 common sendto __x64_sys_sendto 56 - 45 64 recvfrom __x64_sys_recvfrom 57 - 46 64 sendmsg __x64_sys_sendmsg 58 - 47 64 recvmsg __x64_sys_recvmsg 59 - 48 common shutdown __x64_sys_shutdown 60 - 49 common bind __x64_sys_bind 61 - 50 common listen __x64_sys_listen 62 - 51 common getsockname __x64_sys_getsockname 63 - 52 common getpeername __x64_sys_getpeername 64 - 53 common socketpair __x64_sys_socketpair 65 - 54 64 setsockopt __x64_sys_setsockopt 66 - 55 64 getsockopt __x64_sys_getsockopt 67 - 56 common clone __x64_sys_clone/ptregs 68 - 57 common fork __x64_sys_fork/ptregs 69 - 58 common vfork __x64_sys_vfork/ptregs 70 - 59 64 execve __x64_sys_execve/ptregs 71 - 60 common exit __x64_sys_exit 72 - 61 common wait4 __x64_sys_wait4 73 - 62 common kill __x64_sys_kill 74 - 63 common uname __x64_sys_newuname 75 - 64 common semget __x64_sys_semget 76 - 65 common semop __x64_sys_semop 77 - 66 common semctl __x64_sys_semctl 78 - 67 common shmdt __x64_sys_shmdt 79 - 68 common msgget __x64_sys_msgget 80 - 69 common msgsnd __x64_sys_msgsnd 81 - 70 common msgrcv __x64_sys_msgrcv 82 - 71 common msgctl __x64_sys_msgctl 83 - 72 common fcntl __x64_sys_fcntl 84 - 73 common flock __x64_sys_flock 85 - 74 common fsync __x64_sys_fsync 86 - 75 common fdatasync __x64_sys_fdatasync 87 - 76 common truncate __x64_sys_truncate 88 - 77 common ftruncate __x64_sys_ftruncate 89 - 78 common getdents __x64_sys_getdents 90 - 79 common getcwd __x64_sys_getcwd 91 - 80 common chdir __x64_sys_chdir 92 - 81 common fchdir __x64_sys_fchdir 93 - 82 common rename __x64_sys_rename 94 - 83 common mkdir __x64_sys_mkdir 95 - 84 common rmdir __x64_sys_rmdir 96 - 85 common creat __x64_sys_creat 97 - 86 common link __x64_sys_link 98 - 87 common unlink __x64_sys_unlink 99 - 88 common symlink __x64_sys_symlink 100 - 89 common readlink __x64_sys_readlink 101 - 90 common chmod __x64_sys_chmod 102 - 91 common fchmod __x64_sys_fchmod 103 - 92 common chown __x64_sys_chown 104 - 93 common fchown __x64_sys_fchown 105 - 94 common lchown __x64_sys_lchown 106 - 95 common umask __x64_sys_umask 107 - 96 common gettimeofday __x64_sys_gettimeofday 108 - 97 common getrlimit __x64_sys_getrlimit 109 - 98 common getrusage __x64_sys_getrusage 110 - 99 common sysinfo __x64_sys_sysinfo 111 - 100 common times __x64_sys_times 112 - 101 64 ptrace __x64_sys_ptrace 113 - 102 common getuid __x64_sys_getuid 114 - 103 common syslog __x64_sys_syslog 115 - 104 common getgid __x64_sys_getgid 116 - 105 common setuid __x64_sys_setuid 117 - 106 common setgid __x64_sys_setgid 118 - 107 common geteuid __x64_sys_geteuid 119 - 108 common getegid __x64_sys_getegid 120 - 109 common setpgid __x64_sys_setpgid 121 - 110 common getppid __x64_sys_getppid 122 - 111 common getpgrp __x64_sys_getpgrp 123 - 112 common setsid __x64_sys_setsid 124 - 113 common setreuid __x64_sys_setreuid 125 - 114 common setregid __x64_sys_setregid 126 - 115 common getgroups __x64_sys_getgroups 127 - 116 common setgroups __x64_sys_setgroups 128 - 117 common setresuid __x64_sys_setresuid 129 - 118 common getresuid __x64_sys_getresuid 130 - 119 common setresgid __x64_sys_setresgid 131 - 120 common getresgid __x64_sys_getresgid 132 - 121 common getpgid __x64_sys_getpgid 133 - 122 common setfsuid __x64_sys_setfsuid 134 - 123 common setfsgid __x64_sys_setfsgid 135 - 124 common getsid __x64_sys_getsid 136 - 125 common capget __x64_sys_capget 137 - 126 common capset __x64_sys_capset 138 - 127 64 rt_sigpending __x64_sys_rt_sigpending 139 - 128 64 rt_sigtimedwait __x64_sys_rt_sigtimedwait 140 - 129 64 rt_sigqueueinfo __x64_sys_rt_sigqueueinfo 141 - 130 common rt_sigsuspend __x64_sys_rt_sigsuspend 142 - 131 64 sigaltstack __x64_sys_sigaltstack 143 - 132 common utime __x64_sys_utime 144 - 133 common mknod __x64_sys_mknod 11 + 0 common read sys_read 12 + 1 common write sys_write 13 + 2 common open sys_open 14 + 3 common close sys_close 15 + 4 common stat sys_newstat 16 + 5 common fstat sys_newfstat 17 + 6 common lstat sys_newlstat 18 + 7 common poll sys_poll 19 + 8 common lseek sys_lseek 20 + 9 common mmap sys_mmap 21 + 10 common mprotect sys_mprotect 22 + 11 common munmap sys_munmap 23 + 12 common brk sys_brk 24 + 13 64 rt_sigaction sys_rt_sigaction 25 + 14 common rt_sigprocmask sys_rt_sigprocmask 26 + 15 64 rt_sigreturn sys_rt_sigreturn 27 + 16 64 ioctl sys_ioctl 28 + 17 common pread64 sys_pread64 29 + 18 common pwrite64 sys_pwrite64 30 + 19 64 readv sys_readv 31 + 20 64 writev sys_writev 32 + 21 common access sys_access 33 + 22 common pipe sys_pipe 34 + 23 common select sys_select 35 + 24 common sched_yield sys_sched_yield 36 + 25 common mremap sys_mremap 37 + 26 common msync sys_msync 38 + 27 common mincore sys_mincore 39 + 28 common madvise sys_madvise 40 + 29 common shmget sys_shmget 41 + 30 common shmat sys_shmat 42 + 31 common shmctl sys_shmctl 43 + 32 common dup sys_dup 44 + 33 common dup2 sys_dup2 45 + 34 common pause sys_pause 46 + 35 common nanosleep sys_nanosleep 47 + 36 common getitimer sys_getitimer 48 + 37 common alarm sys_alarm 49 + 38 common setitimer sys_setitimer 50 + 39 common getpid sys_getpid 51 + 40 common sendfile sys_sendfile64 52 + 41 common socket sys_socket 53 + 42 common connect sys_connect 54 + 43 common accept sys_accept 55 + 44 common sendto sys_sendto 56 + 45 64 recvfrom sys_recvfrom 57 + 46 64 sendmsg sys_sendmsg 58 + 47 64 recvmsg sys_recvmsg 59 + 48 common shutdown sys_shutdown 60 + 49 common bind sys_bind 61 + 50 common listen sys_listen 62 + 51 common getsockname sys_getsockname 63 + 52 common getpeername sys_getpeername 64 + 53 common socketpair sys_socketpair 65 + 54 64 setsockopt sys_setsockopt 66 + 55 64 getsockopt sys_getsockopt 67 + 56 common clone sys_clone 68 + 57 common fork sys_fork 69 + 58 common vfork sys_vfork 70 + 59 64 execve sys_execve 71 + 60 common exit sys_exit 72 + 61 common wait4 sys_wait4 73 + 62 common kill sys_kill 74 + 63 common uname sys_newuname 75 + 64 common semget sys_semget 76 + 65 common semop sys_semop 77 + 66 common semctl sys_semctl 78 + 67 common shmdt sys_shmdt 79 + 68 common msgget sys_msgget 80 + 69 common msgsnd sys_msgsnd 81 + 70 common msgrcv sys_msgrcv 82 + 71 common msgctl sys_msgctl 83 + 72 common fcntl sys_fcntl 84 + 73 common flock sys_flock 85 + 74 common fsync sys_fsync 86 + 75 common fdatasync sys_fdatasync 87 + 76 common truncate sys_truncate 88 + 77 common ftruncate sys_ftruncate 89 + 78 common getdents sys_getdents 90 + 79 common getcwd sys_getcwd 91 + 80 common chdir sys_chdir 92 + 81 common fchdir sys_fchdir 93 + 82 common rename sys_rename 94 + 83 common mkdir sys_mkdir 95 + 84 common rmdir sys_rmdir 96 + 85 common creat sys_creat 97 + 86 common link sys_link 98 + 87 common unlink sys_unlink 99 + 88 common symlink sys_symlink 100 + 89 common readlink sys_readlink 101 + 90 common chmod sys_chmod 102 + 91 common fchmod sys_fchmod 103 + 92 common chown sys_chown 104 + 93 common fchown sys_fchown 105 + 94 common lchown sys_lchown 106 + 95 common umask sys_umask 107 + 96 common gettimeofday sys_gettimeofday 108 + 97 common getrlimit sys_getrlimit 109 + 98 common getrusage sys_getrusage 110 + 99 common sysinfo sys_sysinfo 111 + 100 common times sys_times 112 + 101 64 ptrace sys_ptrace 113 + 102 common getuid sys_getuid 114 + 103 common syslog sys_syslog 115 + 104 common getgid sys_getgid 116 + 105 common setuid sys_setuid 117 + 106 common setgid sys_setgid 118 + 107 common geteuid sys_geteuid 119 + 108 common getegid sys_getegid 120 + 109 common setpgid sys_setpgid 121 + 110 common getppid sys_getppid 122 + 111 common getpgrp sys_getpgrp 123 + 112 common setsid sys_setsid 124 + 113 common setreuid sys_setreuid 125 + 114 common setregid sys_setregid 126 + 115 common getgroups sys_getgroups 127 + 116 common setgroups sys_setgroups 128 + 117 common setresuid sys_setresuid 129 + 118 common getresuid sys_getresuid 130 + 119 common setresgid sys_setresgid 131 + 120 common getresgid sys_getresgid 132 + 121 common getpgid sys_getpgid 133 + 122 common setfsuid sys_setfsuid 134 + 123 common setfsgid sys_setfsgid 135 + 124 common getsid sys_getsid 136 + 125 common capget sys_capget 137 + 126 common capset sys_capset 138 + 127 64 rt_sigpending sys_rt_sigpending 139 + 128 64 rt_sigtimedwait sys_rt_sigtimedwait 140 + 129 64 rt_sigqueueinfo sys_rt_sigqueueinfo 141 + 130 common rt_sigsuspend sys_rt_sigsuspend 142 + 131 64 sigaltstack sys_sigaltstack 143 + 132 common utime sys_utime 144 + 133 common mknod sys_mknod 145 145 134 64 uselib 146 - 135 common personality __x64_sys_personality 147 - 136 common ustat __x64_sys_ustat 148 - 137 common statfs __x64_sys_statfs 149 - 138 common fstatfs __x64_sys_fstatfs 150 - 139 common sysfs __x64_sys_sysfs 151 - 140 common getpriority __x64_sys_getpriority 152 - 141 common setpriority __x64_sys_setpriority 153 - 142 common sched_setparam __x64_sys_sched_setparam 154 - 143 common sched_getparam __x64_sys_sched_getparam 155 - 144 common sched_setscheduler __x64_sys_sched_setscheduler 156 - 145 common sched_getscheduler __x64_sys_sched_getscheduler 157 - 146 common sched_get_priority_max __x64_sys_sched_get_priority_max 158 - 147 common sched_get_priority_min __x64_sys_sched_get_priority_min 159 - 148 common sched_rr_get_interval __x64_sys_sched_rr_get_interval 160 - 149 common mlock __x64_sys_mlock 161 - 150 common munlock __x64_sys_munlock 162 - 151 common mlockall __x64_sys_mlockall 163 - 152 common munlockall __x64_sys_munlockall 164 - 153 common vhangup __x64_sys_vhangup 165 - 154 common modify_ldt __x64_sys_modify_ldt 166 - 155 common pivot_root __x64_sys_pivot_root 167 - 156 64 _sysctl __x64_sys_sysctl 168 - 157 common prctl __x64_sys_prctl 169 - 158 common arch_prctl __x64_sys_arch_prctl 170 - 159 common adjtimex __x64_sys_adjtimex 171 - 160 common setrlimit __x64_sys_setrlimit 172 - 161 common chroot __x64_sys_chroot 173 - 162 common sync __x64_sys_sync 174 - 163 common acct __x64_sys_acct 175 - 164 common settimeofday __x64_sys_settimeofday 176 - 165 common mount __x64_sys_mount 177 - 166 common umount2 __x64_sys_umount 178 - 167 common swapon __x64_sys_swapon 179 - 168 common swapoff __x64_sys_swapoff 180 - 169 common reboot __x64_sys_reboot 181 - 170 common sethostname __x64_sys_sethostname 182 - 171 common setdomainname __x64_sys_setdomainname 183 - 172 common iopl __x64_sys_iopl/ptregs 184 - 173 common ioperm __x64_sys_ioperm 146 + 135 common personality sys_personality 147 + 136 common ustat sys_ustat 148 + 137 common statfs sys_statfs 149 + 138 common fstatfs sys_fstatfs 150 + 139 common sysfs sys_sysfs 151 + 140 common getpriority sys_getpriority 152 + 141 common setpriority sys_setpriority 153 + 142 common sched_setparam sys_sched_setparam 154 + 143 common sched_getparam sys_sched_getparam 155 + 144 common sched_setscheduler sys_sched_setscheduler 156 + 145 common sched_getscheduler sys_sched_getscheduler 157 + 146 common sched_get_priority_max sys_sched_get_priority_max 158 + 147 common sched_get_priority_min sys_sched_get_priority_min 159 + 148 common sched_rr_get_interval sys_sched_rr_get_interval 160 + 149 common mlock sys_mlock 161 + 150 common munlock sys_munlock 162 + 151 common mlockall sys_mlockall 163 + 152 common munlockall sys_munlockall 164 + 153 common vhangup sys_vhangup 165 + 154 common modify_ldt sys_modify_ldt 166 + 155 common pivot_root sys_pivot_root 167 + 156 64 _sysctl sys_sysctl 168 + 157 common prctl sys_prctl 169 + 158 common arch_prctl sys_arch_prctl 170 + 159 common adjtimex sys_adjtimex 171 + 160 common setrlimit sys_setrlimit 172 + 161 common chroot sys_chroot 173 + 162 common sync sys_sync 174 + 163 common acct sys_acct 175 + 164 common settimeofday sys_settimeofday 176 + 165 common mount sys_mount 177 + 166 common umount2 sys_umount 178 + 167 common swapon sys_swapon 179 + 168 common swapoff sys_swapoff 180 + 169 common reboot sys_reboot 181 + 170 common sethostname sys_sethostname 182 + 171 common setdomainname sys_setdomainname 183 + 172 common iopl sys_iopl 184 + 173 common ioperm sys_ioperm 185 185 174 64 create_module 186 - 175 common init_module __x64_sys_init_module 187 - 176 common delete_module __x64_sys_delete_module 186 + 175 common init_module sys_init_module 187 + 176 common delete_module sys_delete_module 188 188 177 64 get_kernel_syms 189 189 178 64 query_module 190 - 179 common quotactl __x64_sys_quotactl 190 + 179 common quotactl sys_quotactl 191 191 180 64 nfsservctl 192 192 181 common getpmsg 193 193 182 common putpmsg 194 194 183 common afs_syscall 195 195 184 common tuxcall 196 196 185 common security 197 - 186 common gettid __x64_sys_gettid 198 - 187 common readahead __x64_sys_readahead 199 - 188 common setxattr __x64_sys_setxattr 200 - 189 common lsetxattr __x64_sys_lsetxattr 201 - 190 common fsetxattr __x64_sys_fsetxattr 202 - 191 common getxattr __x64_sys_getxattr 203 - 192 common lgetxattr __x64_sys_lgetxattr 204 - 193 common fgetxattr __x64_sys_fgetxattr 205 - 194 common listxattr __x64_sys_listxattr 206 - 195 common llistxattr __x64_sys_llistxattr 207 - 196 common flistxattr __x64_sys_flistxattr 208 - 197 common removexattr __x64_sys_removexattr 209 - 198 common lremovexattr __x64_sys_lremovexattr 210 - 199 common fremovexattr __x64_sys_fremovexattr 211 - 200 common tkill __x64_sys_tkill 212 - 201 common time __x64_sys_time 213 - 202 common futex __x64_sys_futex 214 - 203 common sched_setaffinity __x64_sys_sched_setaffinity 215 - 204 common sched_getaffinity __x64_sys_sched_getaffinity 197 + 186 common gettid sys_gettid 198 + 187 common readahead sys_readahead 199 + 188 common setxattr sys_setxattr 200 + 189 common lsetxattr sys_lsetxattr 201 + 190 common fsetxattr sys_fsetxattr 202 + 191 common getxattr sys_getxattr 203 + 192 common lgetxattr sys_lgetxattr 204 + 193 common fgetxattr sys_fgetxattr 205 + 194 common listxattr sys_listxattr 206 + 195 common llistxattr sys_llistxattr 207 + 196 common flistxattr sys_flistxattr 208 + 197 common removexattr sys_removexattr 209 + 198 common lremovexattr sys_lremovexattr 210 + 199 common fremovexattr sys_fremovexattr 211 + 200 common tkill sys_tkill 212 + 201 common time sys_time 213 + 202 common futex sys_futex 214 + 203 common sched_setaffinity sys_sched_setaffinity 215 + 204 common sched_getaffinity sys_sched_getaffinity 216 216 205 64 set_thread_area 217 - 206 64 io_setup __x64_sys_io_setup 218 - 207 common io_destroy __x64_sys_io_destroy 219 - 208 common io_getevents __x64_sys_io_getevents 220 - 209 64 io_submit __x64_sys_io_submit 221 - 210 common io_cancel __x64_sys_io_cancel 217 + 206 64 io_setup sys_io_setup 218 + 207 common io_destroy sys_io_destroy 219 + 208 common io_getevents sys_io_getevents 220 + 209 64 io_submit sys_io_submit 221 + 210 common io_cancel sys_io_cancel 222 222 211 64 get_thread_area 223 - 212 common lookup_dcookie __x64_sys_lookup_dcookie 224 - 213 common epoll_create __x64_sys_epoll_create 223 + 212 common lookup_dcookie sys_lookup_dcookie 224 + 213 common epoll_create sys_epoll_create 225 225 214 64 epoll_ctl_old 226 226 215 64 epoll_wait_old 227 - 216 common remap_file_pages __x64_sys_remap_file_pages 228 - 217 common getdents64 __x64_sys_getdents64 229 - 218 common set_tid_address __x64_sys_set_tid_address 230 - 219 common restart_syscall __x64_sys_restart_syscall 231 - 220 common semtimedop __x64_sys_semtimedop 232 - 221 common fadvise64 __x64_sys_fadvise64 233 - 222 64 timer_create __x64_sys_timer_create 234 - 223 common timer_settime __x64_sys_timer_settime 235 - 224 common timer_gettime __x64_sys_timer_gettime 236 - 225 common timer_getoverrun __x64_sys_timer_getoverrun 237 - 226 common timer_delete __x64_sys_timer_delete 238 - 227 common clock_settime __x64_sys_clock_settime 239 - 228 common clock_gettime __x64_sys_clock_gettime 240 - 229 common clock_getres __x64_sys_clock_getres 241 - 230 common clock_nanosleep __x64_sys_clock_nanosleep 242 - 231 common exit_group __x64_sys_exit_group 243 - 232 common epoll_wait __x64_sys_epoll_wait 244 - 233 common epoll_ctl __x64_sys_epoll_ctl 245 - 234 common tgkill __x64_sys_tgkill 246 - 235 common utimes __x64_sys_utimes 227 + 216 common remap_file_pages sys_remap_file_pages 228 + 217 common getdents64 sys_getdents64 229 + 218 common set_tid_address sys_set_tid_address 230 + 219 common restart_syscall sys_restart_syscall 231 + 220 common semtimedop sys_semtimedop 232 + 221 common fadvise64 sys_fadvise64 233 + 222 64 timer_create sys_timer_create 234 + 223 common timer_settime sys_timer_settime 235 + 224 common timer_gettime sys_timer_gettime 236 + 225 common timer_getoverrun sys_timer_getoverrun 237 + 226 common timer_delete sys_timer_delete 238 + 227 common clock_settime sys_clock_settime 239 + 228 common clock_gettime sys_clock_gettime 240 + 229 common clock_getres sys_clock_getres 241 + 230 common clock_nanosleep sys_clock_nanosleep 242 + 231 common exit_group sys_exit_group 243 + 232 common epoll_wait sys_epoll_wait 244 + 233 common epoll_ctl sys_epoll_ctl 245 + 234 common tgkill sys_tgkill 246 + 235 common utimes sys_utimes 247 247 236 64 vserver 248 - 237 common mbind __x64_sys_mbind 249 - 238 common set_mempolicy __x64_sys_set_mempolicy 250 - 239 common get_mempolicy __x64_sys_get_mempolicy 251 - 240 common mq_open __x64_sys_mq_open 252 - 241 common mq_unlink __x64_sys_mq_unlink 253 - 242 common mq_timedsend __x64_sys_mq_timedsend 254 - 243 common mq_timedreceive __x64_sys_mq_timedreceive 255 - 244 64 mq_notify __x64_sys_mq_notify 256 - 245 common mq_getsetattr __x64_sys_mq_getsetattr 257 - 246 64 kexec_load __x64_sys_kexec_load 258 - 247 64 waitid __x64_sys_waitid 259 - 248 common add_key __x64_sys_add_key 260 - 249 common request_key __x64_sys_request_key 261 - 250 common keyctl __x64_sys_keyctl 262 - 251 common ioprio_set __x64_sys_ioprio_set 263 - 252 common ioprio_get __x64_sys_ioprio_get 264 - 253 common inotify_init __x64_sys_inotify_init 265 - 254 common inotify_add_watch __x64_sys_inotify_add_watch 266 - 255 common inotify_rm_watch __x64_sys_inotify_rm_watch 267 - 256 common migrate_pages __x64_sys_migrate_pages 268 - 257 common openat __x64_sys_openat 269 - 258 common mkdirat __x64_sys_mkdirat 270 - 259 common mknodat __x64_sys_mknodat 271 - 260 common fchownat __x64_sys_fchownat 272 - 261 common futimesat __x64_sys_futimesat 273 - 262 common newfstatat __x64_sys_newfstatat 274 - 263 common unlinkat __x64_sys_unlinkat 275 - 264 common renameat __x64_sys_renameat 276 - 265 common linkat __x64_sys_linkat 277 - 266 common symlinkat __x64_sys_symlinkat 278 - 267 common readlinkat __x64_sys_readlinkat 279 - 268 common fchmodat __x64_sys_fchmodat 280 - 269 common faccessat __x64_sys_faccessat 281 - 270 common pselect6 __x64_sys_pselect6 282 - 271 common ppoll __x64_sys_ppoll 283 - 272 common unshare __x64_sys_unshare 284 - 273 64 set_robust_list __x64_sys_set_robust_list 285 - 274 64 get_robust_list __x64_sys_get_robust_list 286 - 275 common splice __x64_sys_splice 287 - 276 common tee __x64_sys_tee 288 - 277 common sync_file_range __x64_sys_sync_file_range 289 - 278 64 vmsplice __x64_sys_vmsplice 290 - 279 64 move_pages __x64_sys_move_pages 291 - 280 common utimensat __x64_sys_utimensat 292 - 281 common epoll_pwait __x64_sys_epoll_pwait 293 - 282 common signalfd __x64_sys_signalfd 294 - 283 common timerfd_create __x64_sys_timerfd_create 295 - 284 common eventfd __x64_sys_eventfd 296 - 285 common fallocate __x64_sys_fallocate 297 - 286 common timerfd_settime __x64_sys_timerfd_settime 298 - 287 common timerfd_gettime __x64_sys_timerfd_gettime 299 - 288 common accept4 __x64_sys_accept4 300 - 289 common signalfd4 __x64_sys_signalfd4 301 - 290 common eventfd2 __x64_sys_eventfd2 302 - 291 common epoll_create1 __x64_sys_epoll_create1 303 - 292 common dup3 __x64_sys_dup3 304 - 293 common pipe2 __x64_sys_pipe2 305 - 294 common inotify_init1 __x64_sys_inotify_init1 306 - 295 64 preadv __x64_sys_preadv 307 - 296 64 pwritev __x64_sys_pwritev 308 - 297 64 rt_tgsigqueueinfo __x64_sys_rt_tgsigqueueinfo 309 - 298 common perf_event_open __x64_sys_perf_event_open 310 - 299 64 recvmmsg __x64_sys_recvmmsg 311 - 300 common fanotify_init __x64_sys_fanotify_init 312 - 301 common fanotify_mark __x64_sys_fanotify_mark 313 - 302 common prlimit64 __x64_sys_prlimit64 314 - 303 common name_to_handle_at __x64_sys_name_to_handle_at 315 - 304 common open_by_handle_at __x64_sys_open_by_handle_at 316 - 305 common clock_adjtime __x64_sys_clock_adjtime 317 - 306 common syncfs __x64_sys_syncfs 318 - 307 64 sendmmsg __x64_sys_sendmmsg 319 - 308 common setns __x64_sys_setns 320 - 309 common getcpu __x64_sys_getcpu 321 - 310 64 process_vm_readv __x64_sys_process_vm_readv 322 - 311 64 process_vm_writev __x64_sys_process_vm_writev 323 - 312 common kcmp __x64_sys_kcmp 324 - 313 common finit_module __x64_sys_finit_module 325 - 314 common sched_setattr __x64_sys_sched_setattr 326 - 315 common sched_getattr __x64_sys_sched_getattr 327 - 316 common renameat2 __x64_sys_renameat2 328 - 317 common seccomp __x64_sys_seccomp 329 - 318 common getrandom __x64_sys_getrandom 330 - 319 common memfd_create __x64_sys_memfd_create 331 - 320 common kexec_file_load __x64_sys_kexec_file_load 332 - 321 common bpf __x64_sys_bpf 333 - 322 64 execveat __x64_sys_execveat/ptregs 334 - 323 common userfaultfd __x64_sys_userfaultfd 335 - 324 common membarrier __x64_sys_membarrier 336 - 325 common mlock2 __x64_sys_mlock2 337 - 326 common copy_file_range __x64_sys_copy_file_range 338 - 327 64 preadv2 __x64_sys_preadv2 339 - 328 64 pwritev2 __x64_sys_pwritev2 340 - 329 common pkey_mprotect __x64_sys_pkey_mprotect 341 - 330 common pkey_alloc __x64_sys_pkey_alloc 342 - 331 common pkey_free __x64_sys_pkey_free 343 - 332 common statx __x64_sys_statx 344 - 333 common io_pgetevents __x64_sys_io_pgetevents 345 - 334 common rseq __x64_sys_rseq 248 + 237 common mbind sys_mbind 249 + 238 common set_mempolicy sys_set_mempolicy 250 + 239 common get_mempolicy sys_get_mempolicy 251 + 240 common mq_open sys_mq_open 252 + 241 common mq_unlink sys_mq_unlink 253 + 242 common mq_timedsend sys_mq_timedsend 254 + 243 common mq_timedreceive sys_mq_timedreceive 255 + 244 64 mq_notify sys_mq_notify 256 + 245 common mq_getsetattr sys_mq_getsetattr 257 + 246 64 kexec_load sys_kexec_load 258 + 247 64 waitid sys_waitid 259 + 248 common add_key sys_add_key 260 + 249 common request_key sys_request_key 261 + 250 common keyctl sys_keyctl 262 + 251 common ioprio_set sys_ioprio_set 263 + 252 common ioprio_get sys_ioprio_get 264 + 253 common inotify_init sys_inotify_init 265 + 254 common inotify_add_watch sys_inotify_add_watch 266 + 255 common inotify_rm_watch sys_inotify_rm_watch 267 + 256 common migrate_pages sys_migrate_pages 268 + 257 common openat sys_openat 269 + 258 common mkdirat sys_mkdirat 270 + 259 common mknodat sys_mknodat 271 + 260 common fchownat sys_fchownat 272 + 261 common futimesat sys_futimesat 273 + 262 common newfstatat sys_newfstatat 274 + 263 common unlinkat sys_unlinkat 275 + 264 common renameat sys_renameat 276 + 265 common linkat sys_linkat 277 + 266 common symlinkat sys_symlinkat 278 + 267 common readlinkat sys_readlinkat 279 + 268 common fchmodat sys_fchmodat 280 + 269 common faccessat sys_faccessat 281 + 270 common pselect6 sys_pselect6 282 + 271 common ppoll sys_ppoll 283 + 272 common unshare sys_unshare 284 + 273 64 set_robust_list sys_set_robust_list 285 + 274 64 get_robust_list sys_get_robust_list 286 + 275 common splice sys_splice 287 + 276 common tee sys_tee 288 + 277 common sync_file_range sys_sync_file_range 289 + 278 64 vmsplice sys_vmsplice 290 + 279 64 move_pages sys_move_pages 291 + 280 common utimensat sys_utimensat 292 + 281 common epoll_pwait sys_epoll_pwait 293 + 282 common signalfd sys_signalfd 294 + 283 common timerfd_create sys_timerfd_create 295 + 284 common eventfd sys_eventfd 296 + 285 common fallocate sys_fallocate 297 + 286 common timerfd_settime sys_timerfd_settime 298 + 287 common timerfd_gettime sys_timerfd_gettime 299 + 288 common accept4 sys_accept4 300 + 289 common signalfd4 sys_signalfd4 301 + 290 common eventfd2 sys_eventfd2 302 + 291 common epoll_create1 sys_epoll_create1 303 + 292 common dup3 sys_dup3 304 + 293 common pipe2 sys_pipe2 305 + 294 common inotify_init1 sys_inotify_init1 306 + 295 64 preadv sys_preadv 307 + 296 64 pwritev sys_pwritev 308 + 297 64 rt_tgsigqueueinfo sys_rt_tgsigqueueinfo 309 + 298 common perf_event_open sys_perf_event_open 310 + 299 64 recvmmsg sys_recvmmsg 311 + 300 common fanotify_init sys_fanotify_init 312 + 301 common fanotify_mark sys_fanotify_mark 313 + 302 common prlimit64 sys_prlimit64 314 + 303 common name_to_handle_at sys_name_to_handle_at 315 + 304 common open_by_handle_at sys_open_by_handle_at 316 + 305 common clock_adjtime sys_clock_adjtime 317 + 306 common syncfs sys_syncfs 318 + 307 64 sendmmsg sys_sendmmsg 319 + 308 common setns sys_setns 320 + 309 common getcpu sys_getcpu 321 + 310 64 process_vm_readv sys_process_vm_readv 322 + 311 64 process_vm_writev sys_process_vm_writev 323 + 312 common kcmp sys_kcmp 324 + 313 common finit_module sys_finit_module 325 + 314 common sched_setattr sys_sched_setattr 326 + 315 common sched_getattr sys_sched_getattr 327 + 316 common renameat2 sys_renameat2 328 + 317 common seccomp sys_seccomp 329 + 318 common getrandom sys_getrandom 330 + 319 common memfd_create sys_memfd_create 331 + 320 common kexec_file_load sys_kexec_file_load 332 + 321 common bpf sys_bpf 333 + 322 64 execveat sys_execveat 334 + 323 common userfaultfd sys_userfaultfd 335 + 324 common membarrier sys_membarrier 336 + 325 common mlock2 sys_mlock2 337 + 326 common copy_file_range sys_copy_file_range 338 + 327 64 preadv2 sys_preadv2 339 + 328 64 pwritev2 sys_pwritev2 340 + 329 common pkey_mprotect sys_pkey_mprotect 341 + 330 common pkey_alloc sys_pkey_alloc 342 + 331 common pkey_free sys_pkey_free 343 + 332 common statx sys_statx 344 + 333 common io_pgetevents sys_io_pgetevents 345 + 334 common rseq sys_rseq 346 346 # don't use numbers 387 through 423, add new calls after the last 347 347 # 'common' entry 348 - 424 common pidfd_send_signal __x64_sys_pidfd_send_signal 349 - 425 common io_uring_setup __x64_sys_io_uring_setup 350 - 426 common io_uring_enter __x64_sys_io_uring_enter 351 - 427 common io_uring_register __x64_sys_io_uring_register 352 - 428 common open_tree __x64_sys_open_tree 353 - 429 common move_mount __x64_sys_move_mount 354 - 430 common fsopen __x64_sys_fsopen 355 - 431 common fsconfig __x64_sys_fsconfig 356 - 432 common fsmount __x64_sys_fsmount 357 - 433 common fspick __x64_sys_fspick 358 - 434 common pidfd_open __x64_sys_pidfd_open 359 - 435 common clone3 __x64_sys_clone3/ptregs 360 - 437 common openat2 __x64_sys_openat2 361 - 438 common pidfd_getfd __x64_sys_pidfd_getfd 348 + 424 common pidfd_send_signal sys_pidfd_send_signal 349 + 425 common io_uring_setup sys_io_uring_setup 350 + 426 common io_uring_enter sys_io_uring_enter 351 + 427 common io_uring_register sys_io_uring_register 352 + 428 common open_tree sys_open_tree 353 + 429 common move_mount sys_move_mount 354 + 430 common fsopen sys_fsopen 355 + 431 common fsconfig sys_fsconfig 356 + 432 common fsmount sys_fsmount 357 + 433 common fspick sys_fspick 358 + 434 common pidfd_open sys_pidfd_open 359 + 435 common clone3 sys_clone3 360 + 437 common openat2 sys_openat2 361 + 438 common pidfd_getfd sys_pidfd_getfd 362 362 363 363 # 364 364 # x32-specific system call numbers start at 512 to avoid cache impact ··· 366 366 # on-the-fly for compat_sys_*() compatibility system calls if X86_X32 367 367 # is defined. 368 368 # 369 - 512 x32 rt_sigaction __x32_compat_sys_rt_sigaction 370 - 513 x32 rt_sigreturn sys32_x32_rt_sigreturn 371 - 514 x32 ioctl __x32_compat_sys_ioctl 372 - 515 x32 readv __x32_compat_sys_readv 373 - 516 x32 writev __x32_compat_sys_writev 374 - 517 x32 recvfrom __x32_compat_sys_recvfrom 375 - 518 x32 sendmsg __x32_compat_sys_sendmsg 376 - 519 x32 recvmsg __x32_compat_sys_recvmsg 377 - 520 x32 execve __x32_compat_sys_execve/ptregs 378 - 521 x32 ptrace __x32_compat_sys_ptrace 379 - 522 x32 rt_sigpending __x32_compat_sys_rt_sigpending 380 - 523 x32 rt_sigtimedwait __x32_compat_sys_rt_sigtimedwait_time64 381 - 524 x32 rt_sigqueueinfo __x32_compat_sys_rt_sigqueueinfo 382 - 525 x32 sigaltstack __x32_compat_sys_sigaltstack 383 - 526 x32 timer_create __x32_compat_sys_timer_create 384 - 527 x32 mq_notify __x32_compat_sys_mq_notify 385 - 528 x32 kexec_load __x32_compat_sys_kexec_load 386 - 529 x32 waitid __x32_compat_sys_waitid 387 - 530 x32 set_robust_list __x32_compat_sys_set_robust_list 388 - 531 x32 get_robust_list __x32_compat_sys_get_robust_list 389 - 532 x32 vmsplice __x32_compat_sys_vmsplice 390 - 533 x32 move_pages __x32_compat_sys_move_pages 391 - 534 x32 preadv __x32_compat_sys_preadv64 392 - 535 x32 pwritev __x32_compat_sys_pwritev64 393 - 536 x32 rt_tgsigqueueinfo __x32_compat_sys_rt_tgsigqueueinfo 394 - 537 x32 recvmmsg __x32_compat_sys_recvmmsg_time64 395 - 538 x32 sendmmsg __x32_compat_sys_sendmmsg 396 - 539 x32 process_vm_readv __x32_compat_sys_process_vm_readv 397 - 540 x32 process_vm_writev __x32_compat_sys_process_vm_writev 398 - 541 x32 setsockopt __x32_compat_sys_setsockopt 399 - 542 x32 getsockopt __x32_compat_sys_getsockopt 400 - 543 x32 io_setup __x32_compat_sys_io_setup 401 - 544 x32 io_submit __x32_compat_sys_io_submit 402 - 545 x32 execveat __x32_compat_sys_execveat/ptregs 403 - 546 x32 preadv2 __x32_compat_sys_preadv64v2 404 - 547 x32 pwritev2 __x32_compat_sys_pwritev64v2 369 + 512 x32 rt_sigaction compat_sys_rt_sigaction 370 + 513 x32 rt_sigreturn compat_sys_x32_rt_sigreturn 371 + 514 x32 ioctl compat_sys_ioctl 372 + 515 x32 readv compat_sys_readv 373 + 516 x32 writev compat_sys_writev 374 + 517 x32 recvfrom compat_sys_recvfrom 375 + 518 x32 sendmsg compat_sys_sendmsg 376 + 519 x32 recvmsg compat_sys_recvmsg 377 + 520 x32 execve compat_sys_execve 378 + 521 x32 ptrace compat_sys_ptrace 379 + 522 x32 rt_sigpending compat_sys_rt_sigpending 380 + 523 x32 rt_sigtimedwait compat_sys_rt_sigtimedwait_time64 381 + 524 x32 rt_sigqueueinfo compat_sys_rt_sigqueueinfo 382 + 525 x32 sigaltstack compat_sys_sigaltstack 383 + 526 x32 timer_create compat_sys_timer_create 384 + 527 x32 mq_notify compat_sys_mq_notify 385 + 528 x32 kexec_load compat_sys_kexec_load 386 + 529 x32 waitid compat_sys_waitid 387 + 530 x32 set_robust_list compat_sys_set_robust_list 388 + 531 x32 get_robust_list compat_sys_get_robust_list 389 + 532 x32 vmsplice compat_sys_vmsplice 390 + 533 x32 move_pages compat_sys_move_pages 391 + 534 x32 preadv compat_sys_preadv64 392 + 535 x32 pwritev compat_sys_pwritev64 393 + 536 x32 rt_tgsigqueueinfo compat_sys_rt_tgsigqueueinfo 394 + 537 x32 recvmmsg compat_sys_recvmmsg_time64 395 + 538 x32 sendmmsg compat_sys_sendmmsg 396 + 539 x32 process_vm_readv compat_sys_process_vm_readv 397 + 540 x32 process_vm_writev compat_sys_process_vm_writev 398 + 541 x32 setsockopt compat_sys_setsockopt 399 + 542 x32 getsockopt compat_sys_getsockopt 400 + 543 x32 io_setup compat_sys_io_setup 401 + 544 x32 io_submit compat_sys_io_submit 402 + 545 x32 execveat compat_sys_execveat 403 + 546 x32 preadv2 compat_sys_preadv64v2 404 + 547 x32 pwritev2 compat_sys_pwritev64v2
+3
tools/perf/check-headers.sh
··· 22 22 include/uapi/linux/vhost.h 23 23 include/uapi/sound/asound.h 24 24 include/linux/bits.h 25 + include/vdso/bits.h 25 26 include/linux/const.h 27 + include/vdso/const.h 26 28 include/linux/hash.h 27 29 include/uapi/linux/hw_breakpoint.h 28 30 arch/x86/include/asm/disabled-features.h ··· 117 115 check arch/x86/lib/memset_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>" -I"^SYM_FUNC_START\(_LOCAL\)*(memset_\(erms\|orig\))"' 118 116 check include/uapi/asm-generic/mman.h '-I "^#include <\(uapi/\)*asm-generic/mman-common\(-tools\)*.h>"' 119 117 check include/uapi/linux/mman.h '-I "^#include <\(uapi/\)*asm/mman.h>"' 118 + check include/linux/build_bug.h '-I "^#\(ifndef\|endif\)\( \/\/\)* static_assert$"' 120 119 check include/linux/ctype.h '-I "isdigit("' 121 120 check lib/ctype.c '-I "^EXPORT_SYMBOL" -I "^#include <linux/export.h>" -B' 122 121 check arch/x86/include/asm/inat.h '-I "^#include [\"<]\(asm/\)*inat_types.h[\">]"'
+1
tools/perf/trace/beauty/clone.c
··· 46 46 P_FLAG(NEWNET); 47 47 P_FLAG(IO); 48 48 P_FLAG(CLEAR_SIGHAND); 49 + P_FLAG(INTO_CGROUP); 49 50 #undef P_FLAG 50 51 51 52 if (flags)
+1
tools/perf/trace/beauty/mmap.c
··· 69 69 70 70 P_MREMAP_FLAG(MAYMOVE); 71 71 P_MREMAP_FLAG(FIXED); 72 + P_MREMAP_FLAG(DONTUNMAP); 72 73 #undef P_MREMAP_FLAG 73 74 74 75 if (flags)
+2
tools/perf/util/setup.py
··· 21 21 vars[var] = sub("-fstack-clash-protection", "", vars[var]) 22 22 if not clang_has_option("-fstack-protector-strong"): 23 23 vars[var] = sub("-fstack-protector-strong", "", vars[var]) 24 + if not clang_has_option("-fno-semantic-interposition"): 25 + vars[var] = sub("-fno-semantic-interposition", "", vars[var]) 24 26 25 27 from distutils.core import setup, Extension 26 28
+5 -2
tools/perf/util/stat-shadow.c
··· 803 803 out->force_header ? 804 804 (metric_name ? metric_name : name) : "", 0); 805 805 } 806 - } else 807 - print_metric(config, ctxp, NULL, NULL, "", 0); 806 + } else { 807 + print_metric(config, ctxp, NULL, NULL, 808 + out->force_header ? 809 + (metric_name ? metric_name : name) : "", 0); 810 + } 808 811 809 812 for (i = 1; i < pctx.num_ids; i++) 810 813 zfree(&pctx.ids[i].name);
+60 -2
tools/testing/selftests/bpf/prog_tests/mmap.c
··· 19 19 const size_t map_sz = roundup_page(sizeof(struct map_data)); 20 20 const int zero = 0, one = 1, two = 2, far = 1500; 21 21 const long page_size = sysconf(_SC_PAGE_SIZE); 22 - int err, duration = 0, i, data_map_fd; 22 + int err, duration = 0, i, data_map_fd, data_map_id, tmp_fd; 23 23 struct bpf_map *data_map, *bss_map; 24 24 void *bss_mmaped = NULL, *map_mmaped = NULL, *tmp1, *tmp2; 25 25 struct test_mmap__bss *bss_data; 26 + struct bpf_map_info map_info; 27 + __u32 map_info_sz = sizeof(map_info); 26 28 struct map_data *map_data; 27 29 struct test_mmap *skel; 28 30 __u64 val = 0; 29 - 30 31 31 32 skel = test_mmap__open_and_load(); 32 33 if (CHECK(!skel, "skel_open_and_load", "skeleton open/load failed\n")) ··· 37 36 data_map = skel->maps.data_map; 38 37 data_map_fd = bpf_map__fd(data_map); 39 38 39 + /* get map's ID */ 40 + memset(&map_info, 0, map_info_sz); 41 + err = bpf_obj_get_info_by_fd(data_map_fd, &map_info, &map_info_sz); 42 + if (CHECK(err, "map_get_info", "failed %d\n", errno)) 43 + goto cleanup; 44 + data_map_id = map_info.id; 45 + 46 + /* mmap BSS map */ 40 47 bss_mmaped = mmap(NULL, bss_sz, PROT_READ | PROT_WRITE, MAP_SHARED, 41 48 bpf_map__fd(bss_map), 0); 42 49 if (CHECK(bss_mmaped == MAP_FAILED, "bss_mmap", ··· 107 98 "data_map freeze succeeded: err=%d, errno=%d\n", err, errno)) 108 99 goto cleanup; 109 100 101 + err = mprotect(map_mmaped, map_sz, PROT_READ); 102 + if (CHECK(err, "mprotect_ro", "mprotect to r/o failed %d\n", errno)) 103 + goto cleanup; 104 + 110 105 /* unmap R/W mapping */ 111 106 err = munmap(map_mmaped, map_sz); 112 107 map_mmaped = NULL; ··· 124 111 map_mmaped = NULL; 125 112 goto cleanup; 126 113 } 114 + err = mprotect(map_mmaped, map_sz, PROT_WRITE); 115 + if (CHECK(!err, "mprotect_wr", "mprotect() succeeded unexpectedly!\n")) 116 + goto cleanup; 117 + err = mprotect(map_mmaped, map_sz, PROT_EXEC); 118 + if (CHECK(!err, "mprotect_ex", "mprotect() succeeded unexpectedly!\n")) 119 + goto cleanup; 127 120 map_data = map_mmaped; 128 121 129 122 /* map/unmap in a loop to test ref counting */ ··· 216 197 CHECK_FAIL(map_data->val[far] != 3 * 321); 217 198 218 199 munmap(tmp2, 4 * page_size); 200 + 201 + tmp1 = mmap(NULL, map_sz, PROT_READ, MAP_SHARED, data_map_fd, 0); 202 + if (CHECK(tmp1 == MAP_FAILED, "last_mmap", "failed %d\n", errno)) 203 + goto cleanup; 204 + 205 + test_mmap__destroy(skel); 206 + skel = NULL; 207 + CHECK_FAIL(munmap(bss_mmaped, bss_sz)); 208 + bss_mmaped = NULL; 209 + CHECK_FAIL(munmap(map_mmaped, map_sz)); 210 + map_mmaped = NULL; 211 + 212 + /* map should be still held by active mmap */ 213 + tmp_fd = bpf_map_get_fd_by_id(data_map_id); 214 + if (CHECK(tmp_fd < 0, "get_map_by_id", "failed %d\n", errno)) { 215 + munmap(tmp1, map_sz); 216 + goto cleanup; 217 + } 218 + close(tmp_fd); 219 + 220 + /* this should release data map finally */ 221 + munmap(tmp1, map_sz); 222 + 223 + /* we need to wait for RCU grace period */ 224 + for (i = 0; i < 10000; i++) { 225 + __u32 id = data_map_id - 1; 226 + if (bpf_map_get_next_id(id, &id) || id > data_map_id) 227 + break; 228 + usleep(1); 229 + } 230 + 231 + /* should fail to get map FD by non-existing ID */ 232 + tmp_fd = bpf_map_get_fd_by_id(data_map_id); 233 + if (CHECK(tmp_fd >= 0, "get_map_by_id_after", 234 + "unexpectedly succeeded %d\n", tmp_fd)) { 235 + close(tmp_fd); 236 + goto cleanup; 237 + } 238 + 219 239 cleanup: 220 240 if (bss_mmaped) 221 241 CHECK_FAIL(munmap(bss_mmaped, bss_sz));
+27 -15
tools/testing/selftests/bpf/prog_tests/section_names.c
··· 43 43 {"lwt_seg6local", {0, BPF_PROG_TYPE_LWT_SEG6LOCAL, 0}, {-EINVAL, 0} }, 44 44 { 45 45 "cgroup_skb/ingress", 46 - {0, BPF_PROG_TYPE_CGROUP_SKB, 0}, 46 + {0, BPF_PROG_TYPE_CGROUP_SKB, BPF_CGROUP_INET_INGRESS}, 47 47 {0, BPF_CGROUP_INET_INGRESS}, 48 48 }, 49 49 { 50 50 "cgroup_skb/egress", 51 - {0, BPF_PROG_TYPE_CGROUP_SKB, 0}, 51 + {0, BPF_PROG_TYPE_CGROUP_SKB, BPF_CGROUP_INET_EGRESS}, 52 52 {0, BPF_CGROUP_INET_EGRESS}, 53 53 }, 54 54 {"cgroup/skb", {0, BPF_PROG_TYPE_CGROUP_SKB, 0}, {-EINVAL, 0} }, 55 55 { 56 56 "cgroup/sock", 57 - {0, BPF_PROG_TYPE_CGROUP_SOCK, 0}, 57 + {0, BPF_PROG_TYPE_CGROUP_SOCK, BPF_CGROUP_INET_SOCK_CREATE}, 58 58 {0, BPF_CGROUP_INET_SOCK_CREATE}, 59 59 }, 60 60 { ··· 69 69 }, 70 70 { 71 71 "cgroup/dev", 72 - {0, BPF_PROG_TYPE_CGROUP_DEVICE, 0}, 72 + {0, BPF_PROG_TYPE_CGROUP_DEVICE, BPF_CGROUP_DEVICE}, 73 73 {0, BPF_CGROUP_DEVICE}, 74 74 }, 75 - {"sockops", {0, BPF_PROG_TYPE_SOCK_OPS, 0}, {0, BPF_CGROUP_SOCK_OPS} }, 75 + { 76 + "sockops", 77 + {0, BPF_PROG_TYPE_SOCK_OPS, BPF_CGROUP_SOCK_OPS}, 78 + {0, BPF_CGROUP_SOCK_OPS}, 79 + }, 76 80 { 77 81 "sk_skb/stream_parser", 78 - {0, BPF_PROG_TYPE_SK_SKB, 0}, 82 + {0, BPF_PROG_TYPE_SK_SKB, BPF_SK_SKB_STREAM_PARSER}, 79 83 {0, BPF_SK_SKB_STREAM_PARSER}, 80 84 }, 81 85 { 82 86 "sk_skb/stream_verdict", 83 - {0, BPF_PROG_TYPE_SK_SKB, 0}, 87 + {0, BPF_PROG_TYPE_SK_SKB, BPF_SK_SKB_STREAM_VERDICT}, 84 88 {0, BPF_SK_SKB_STREAM_VERDICT}, 85 89 }, 86 90 {"sk_skb", {0, BPF_PROG_TYPE_SK_SKB, 0}, {-EINVAL, 0} }, 87 - {"sk_msg", {0, BPF_PROG_TYPE_SK_MSG, 0}, {0, BPF_SK_MSG_VERDICT} }, 88 - {"lirc_mode2", {0, BPF_PROG_TYPE_LIRC_MODE2, 0}, {0, BPF_LIRC_MODE2} }, 91 + { 92 + "sk_msg", 93 + {0, BPF_PROG_TYPE_SK_MSG, BPF_SK_MSG_VERDICT}, 94 + {0, BPF_SK_MSG_VERDICT}, 95 + }, 96 + { 97 + "lirc_mode2", 98 + {0, BPF_PROG_TYPE_LIRC_MODE2, BPF_LIRC_MODE2}, 99 + {0, BPF_LIRC_MODE2}, 100 + }, 89 101 { 90 102 "flow_dissector", 91 - {0, BPF_PROG_TYPE_FLOW_DISSECTOR, 0}, 103 + {0, BPF_PROG_TYPE_FLOW_DISSECTOR, BPF_FLOW_DISSECTOR}, 92 104 {0, BPF_FLOW_DISSECTOR}, 93 105 }, 94 106 { ··· 170 158 &expected_attach_type); 171 159 172 160 CHECK(rc != test->expected_load.rc, "check_code", 173 - "prog: unexpected rc=%d for %s", rc, test->sec_name); 161 + "prog: unexpected rc=%d for %s\n", rc, test->sec_name); 174 162 175 163 if (rc) 176 164 return; 177 165 178 166 CHECK(prog_type != test->expected_load.prog_type, "check_prog_type", 179 - "prog: unexpected prog_type=%d for %s", 167 + "prog: unexpected prog_type=%d for %s\n", 180 168 prog_type, test->sec_name); 181 169 182 170 CHECK(expected_attach_type != test->expected_load.expected_attach_type, 183 - "check_attach_type", "prog: unexpected expected_attach_type=%d for %s", 171 + "check_attach_type", "prog: unexpected expected_attach_type=%d for %s\n", 184 172 expected_attach_type, test->sec_name); 185 173 } 186 174 ··· 192 180 rc = libbpf_attach_type_by_name(test->sec_name, &attach_type); 193 181 194 182 CHECK(rc != test->expected_attach.rc, "check_ret", 195 - "attach: unexpected rc=%d for %s", rc, test->sec_name); 183 + "attach: unexpected rc=%d for %s\n", rc, test->sec_name); 196 184 197 185 if (rc) 198 186 return; 199 187 200 188 CHECK(attach_type != test->expected_attach.attach_type, 201 - "check_attach_type", "attach: unexpected attach_type=%d for %s", 189 + "check_attach_type", "attach: unexpected attach_type=%d for %s\n", 202 190 attach_type, test->sec_name); 203 191 } 204 192
+9 -9
tools/testing/selftests/bpf/prog_tests/test_lsm.c
··· 15 15 16 16 char *CMD_ARGS[] = {"true", NULL}; 17 17 18 - int heap_mprotect(void) 18 + #define GET_PAGE_ADDR(ADDR, PAGE_SIZE) \ 19 + (char *)(((unsigned long) (ADDR + PAGE_SIZE)) & ~(PAGE_SIZE-1)) 20 + 21 + int stack_mprotect(void) 19 22 { 20 23 void *buf; 21 24 long sz; ··· 28 25 if (sz < 0) 29 26 return sz; 30 27 31 - buf = memalign(sz, 2 * sz); 32 - if (buf == NULL) 33 - return -ENOMEM; 34 - 35 - ret = mprotect(buf, sz, PROT_READ | PROT_WRITE | PROT_EXEC); 36 - free(buf); 28 + buf = alloca(sz * 3); 29 + ret = mprotect(GET_PAGE_ADDR(buf, sz), sz, 30 + PROT_READ | PROT_WRITE | PROT_EXEC); 37 31 return ret; 38 32 } 39 33 ··· 73 73 74 74 skel->bss->monitored_pid = getpid(); 75 75 76 - err = heap_mprotect(); 77 - if (CHECK(errno != EPERM, "heap_mprotect", "want errno=EPERM, got %d\n", 76 + err = stack_mprotect(); 77 + if (CHECK(errno != EPERM, "stack_mprotect", "want err=EPERM, got %d\n", 78 78 errno)) 79 79 goto close_prog; 80 80
+29 -1
tools/testing/selftests/bpf/prog_tests/xdp_attach.c
··· 6 6 7 7 void test_xdp_attach(void) 8 8 { 9 + __u32 duration = 0, id1, id2, id0 = 0, len; 9 10 struct bpf_object *obj1, *obj2, *obj3; 10 11 const char *file = "./test_xdp.o"; 12 + struct bpf_prog_info info = {}; 11 13 int err, fd1, fd2, fd3; 12 - __u32 duration = 0; 13 14 DECLARE_LIBBPF_OPTS(bpf_xdp_set_link_opts, opts, 14 15 .old_fd = -1); 16 + 17 + len = sizeof(info); 15 18 16 19 err = bpf_prog_load(file, BPF_PROG_TYPE_XDP, &obj1, &fd1); 17 20 if (CHECK_FAIL(err)) 18 21 return; 22 + err = bpf_obj_get_info_by_fd(fd1, &info, &len); 23 + if (CHECK_FAIL(err)) 24 + goto out_1; 25 + id1 = info.id; 26 + 19 27 err = bpf_prog_load(file, BPF_PROG_TYPE_XDP, &obj2, &fd2); 20 28 if (CHECK_FAIL(err)) 21 29 goto out_1; 30 + 31 + memset(&info, 0, sizeof(info)); 32 + err = bpf_obj_get_info_by_fd(fd2, &info, &len); 33 + if (CHECK_FAIL(err)) 34 + goto out_2; 35 + id2 = info.id; 36 + 22 37 err = bpf_prog_load(file, BPF_PROG_TYPE_XDP, &obj3, &fd3); 23 38 if (CHECK_FAIL(err)) 24 39 goto out_2; ··· 41 26 err = bpf_set_link_xdp_fd_opts(IFINDEX_LO, fd1, XDP_FLAGS_REPLACE, 42 27 &opts); 43 28 if (CHECK(err, "load_ok", "initial load failed")) 29 + goto out_close; 30 + 31 + err = bpf_get_link_xdp_id(IFINDEX_LO, &id0, 0); 32 + if (CHECK(err || id0 != id1, "id1_check", 33 + "loaded prog id %u != id1 %u, err %d", id0, id1, err)) 44 34 goto out_close; 45 35 46 36 err = bpf_set_link_xdp_fd_opts(IFINDEX_LO, fd2, XDP_FLAGS_REPLACE, ··· 57 37 err = bpf_set_link_xdp_fd_opts(IFINDEX_LO, fd2, 0, &opts); 58 38 if (CHECK(err, "replace_ok", "replace valid old_fd failed")) 59 39 goto out; 40 + err = bpf_get_link_xdp_id(IFINDEX_LO, &id0, 0); 41 + if (CHECK(err || id0 != id2, "id2_check", 42 + "loaded prog id %u != id2 %u, err %d", id0, id2, err)) 43 + goto out_close; 60 44 61 45 err = bpf_set_link_xdp_fd_opts(IFINDEX_LO, fd3, 0, &opts); 62 46 if (CHECK(!err, "replace_fail", "replace invalid old_fd didn't fail")) ··· 75 51 if (CHECK(err, "remove_ok", "remove valid old_fd failed")) 76 52 goto out; 77 53 54 + err = bpf_get_link_xdp_id(IFINDEX_LO, &id0, 0); 55 + if (CHECK(err || id0 != 0, "unload_check", 56 + "loaded prog id %u != 0, err %d", id0, err)) 57 + goto out_close; 78 58 out: 79 59 bpf_set_link_xdp_fd(IFINDEX_LO, -1, 0); 80 60 out_close:
+68
tools/testing/selftests/bpf/prog_tests/xdp_info.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + #include <linux/if_link.h> 3 + #include <test_progs.h> 4 + 5 + #define IFINDEX_LO 1 6 + 7 + void test_xdp_info(void) 8 + { 9 + __u32 len = sizeof(struct bpf_prog_info), duration = 0, prog_id; 10 + const char *file = "./xdp_dummy.o"; 11 + struct bpf_prog_info info = {}; 12 + struct bpf_object *obj; 13 + int err, prog_fd; 14 + 15 + /* Get prog_id for XDP_ATTACHED_NONE mode */ 16 + 17 + err = bpf_get_link_xdp_id(IFINDEX_LO, &prog_id, 0); 18 + if (CHECK(err, "get_xdp_none", "errno=%d\n", errno)) 19 + return; 20 + if (CHECK(prog_id, "prog_id_none", "unexpected prog_id=%u\n", prog_id)) 21 + return; 22 + 23 + err = bpf_get_link_xdp_id(IFINDEX_LO, &prog_id, XDP_FLAGS_SKB_MODE); 24 + if (CHECK(err, "get_xdp_none_skb", "errno=%d\n", errno)) 25 + return; 26 + if (CHECK(prog_id, "prog_id_none_skb", "unexpected prog_id=%u\n", 27 + prog_id)) 28 + return; 29 + 30 + /* Setup prog */ 31 + 32 + err = bpf_prog_load(file, BPF_PROG_TYPE_XDP, &obj, &prog_fd); 33 + if (CHECK_FAIL(err)) 34 + return; 35 + 36 + err = bpf_obj_get_info_by_fd(prog_fd, &info, &len); 37 + if (CHECK(err, "get_prog_info", "errno=%d\n", errno)) 38 + goto out_close; 39 + 40 + err = bpf_set_link_xdp_fd(IFINDEX_LO, prog_fd, XDP_FLAGS_SKB_MODE); 41 + if (CHECK(err, "set_xdp_skb", "errno=%d\n", errno)) 42 + goto out_close; 43 + 44 + /* Get prog_id for single prog mode */ 45 + 46 + err = bpf_get_link_xdp_id(IFINDEX_LO, &prog_id, 0); 47 + if (CHECK(err, "get_xdp", "errno=%d\n", errno)) 48 + goto out; 49 + if (CHECK(prog_id != info.id, "prog_id", "prog_id not available\n")) 50 + goto out; 51 + 52 + err = bpf_get_link_xdp_id(IFINDEX_LO, &prog_id, XDP_FLAGS_SKB_MODE); 53 + if (CHECK(err, "get_xdp_skb", "errno=%d\n", errno)) 54 + goto out; 55 + if (CHECK(prog_id != info.id, "prog_id_skb", "prog_id not available\n")) 56 + goto out; 57 + 58 + err = bpf_get_link_xdp_id(IFINDEX_LO, &prog_id, XDP_FLAGS_DRV_MODE); 59 + if (CHECK(err, "get_xdp_drv", "errno=%d\n", errno)) 60 + goto out; 61 + if (CHECK(prog_id, "prog_id_drv", "unexpected prog_id=%u\n", prog_id)) 62 + goto out; 63 + 64 + out: 65 + bpf_set_link_xdp_fd(IFINDEX_LO, -1, 0); 66 + out_close: 67 + bpf_object__close(obj); 68 + }
+4 -4
tools/testing/selftests/bpf/progs/lsm.c
··· 23 23 return ret; 24 24 25 25 __u32 pid = bpf_get_current_pid_tgid() >> 32; 26 - int is_heap = 0; 26 + int is_stack = 0; 27 27 28 - is_heap = (vma->vm_start >= vma->vm_mm->start_brk && 29 - vma->vm_end <= vma->vm_mm->brk); 28 + is_stack = (vma->vm_start <= vma->vm_mm->start_stack && 29 + vma->vm_end >= vma->vm_mm->start_stack); 30 30 31 - if (is_heap && monitored_pid == pid) { 31 + if (is_stack && monitored_pid == pid) { 32 32 mprotect_count++; 33 33 ret = -EPERM; 34 34 }
+2 -2
tools/testing/selftests/bpf/verifier/bounds.c
··· 501 501 .result = REJECT 502 502 }, 503 503 { 504 - "bounds check mixed 32bit and 64bit arithmatic. test1", 504 + "bounds check mixed 32bit and 64bit arithmetic. test1", 505 505 .insns = { 506 506 BPF_MOV64_IMM(BPF_REG_0, 0), 507 507 BPF_MOV64_IMM(BPF_REG_1, -1), ··· 520 520 .result = ACCEPT 521 521 }, 522 522 { 523 - "bounds check mixed 32bit and 64bit arithmatic. test2", 523 + "bounds check mixed 32bit and 64bit arithmetic. test2", 524 524 .insns = { 525 525 BPF_MOV64_IMM(BPF_REG_0, 0), 526 526 BPF_MOV64_IMM(BPF_REG_1, -1),
+2 -3
tools/testing/selftests/tc-testing/tdc.py
··· 713 713 exit(0) 714 714 715 715 if args.list: 716 - if args.list: 717 - list_test_cases(alltests) 718 - exit(0) 716 + list_test_cases(alltests) 717 + exit(0) 719 718 720 719 if len(alltests): 721 720 req_plugins = pm.get_required_plugins(alltests)