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

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Two easily resolvable overlapping change conflicts, one in
TCP and one in the eBPF verifier.

Signed-off-by: David S. Miller <davem@davemloft.net>

+1185 -745
+1 -1
Documentation/networking/msg_zerocopy.rst
··· 7 7 ===== 8 8 9 9 The MSG_ZEROCOPY flag enables copy avoidance for socket send calls. 10 - The feature is currently implemented for TCP sockets. 10 + The feature is currently implemented for TCP and UDP sockets. 11 11 12 12 13 13 Opportunity and Caveats
+1 -1
Makefile
··· 2 2 VERSION = 5 3 3 PATCHLEVEL = 0 4 4 SUBLEVEL = 0 5 - EXTRAVERSION = -rc6 5 + EXTRAVERSION = -rc7 6 6 NAME = Shy Crocodile 7 7 8 8 # *DOCUMENTATION*
+1
arch/arm/Kconfig
··· 1400 1400 config HOTPLUG_CPU 1401 1401 bool "Support for hot-pluggable CPUs" 1402 1402 depends on SMP 1403 + select GENERIC_IRQ_MIGRATION 1403 1404 help 1404 1405 Say Y here to experiment with turning CPUs off and on. CPUs 1405 1406 can be controlled through /sys/devices/system/cpu.
+11
arch/arm/boot/dts/omap4-droid4-xt894.dts
··· 644 644 }; 645 645 }; 646 646 647 + /* Configure pwm clock source for timers 8 & 9 */ 648 + &timer8 { 649 + assigned-clocks = <&abe_clkctrl OMAP4_TIMER8_CLKCTRL 24>; 650 + assigned-clock-parents = <&sys_clkin_ck>; 651 + }; 652 + 653 + &timer9 { 654 + assigned-clocks = <&l4_per_clkctrl OMAP4_TIMER9_CLKCTRL 24>; 655 + assigned-clock-parents = <&sys_clkin_ck>; 656 + }; 657 + 647 658 /* 648 659 * As uart1 is wired to mdm6600 with rts and cts, we can use the cts pin for 649 660 * uart1 wakeirq.
+6 -3
arch/arm/boot/dts/omap5-board-common.dtsi
··· 317 317 318 318 palmas_sys_nirq_pins: pinmux_palmas_sys_nirq_pins { 319 319 pinctrl-single,pins = < 320 - OMAP5_IOPAD(0x068, PIN_INPUT_PULLUP | MUX_MODE0) /* sys_nirq1 */ 320 + /* sys_nirq1 is pulled down as the SoC is inverting it for GIC */ 321 + OMAP5_IOPAD(0x068, PIN_INPUT_PULLUP | MUX_MODE0) 321 322 >; 322 323 }; 323 324 ··· 386 385 387 386 palmas: palmas@48 { 388 387 compatible = "ti,palmas"; 389 - interrupts = <GIC_SPI 7 IRQ_TYPE_NONE>; /* IRQ_SYS_1N */ 388 + /* sys_nirq/ext_sys_irq pins get inverted at mpuss wakeupgen */ 389 + interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_LOW>; 390 390 reg = <0x48>; 391 391 interrupt-controller; 392 392 #interrupt-cells = <2>; ··· 653 651 pinctrl-names = "default"; 654 652 pinctrl-0 = <&twl6040_pins>; 655 653 656 - interrupts = <GIC_SPI 119 IRQ_TYPE_NONE>; /* IRQ_SYS_2N cascaded to gic */ 654 + /* sys_nirq/ext_sys_irq pins get inverted at mpuss wakeupgen */ 655 + interrupts = <GIC_SPI 119 IRQ_TYPE_LEVEL_LOW>; 657 656 658 657 /* audpwron gpio defined in the board specific dts */ 659 658
+11 -1
arch/arm/boot/dts/omap5-cm-t54.dts
··· 181 181 OMAP5_IOPAD(0x0042, PIN_INPUT_PULLDOWN | MUX_MODE6) /* llib_wakereqin.gpio1_wk15 */ 182 182 >; 183 183 }; 184 + 185 + palmas_sys_nirq_pins: pinmux_palmas_sys_nirq_pins { 186 + pinctrl-single,pins = < 187 + /* sys_nirq1 is pulled down as the SoC is inverting it for GIC */ 188 + OMAP5_IOPAD(0x068, PIN_INPUT_PULLUP | MUX_MODE0) 189 + >; 190 + }; 184 191 }; 185 192 186 193 &omap5_pmx_core { ··· 421 414 422 415 palmas: palmas@48 { 423 416 compatible = "ti,palmas"; 424 - interrupts = <GIC_SPI 7 IRQ_TYPE_NONE>; /* IRQ_SYS_1N */ 425 417 reg = <0x48>; 418 + pinctrl-0 = <&palmas_sys_nirq_pins>; 419 + pinctrl-names = "default"; 420 + /* sys_nirq/ext_sys_irq pins get inverted at mpuss wakeupgen */ 421 + interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_LOW>; 426 422 interrupt-controller; 427 423 #interrupt-cells = <2>; 428 424 ti,system-power-controller;
-1
arch/arm/boot/dts/rk3188.dtsi
··· 719 719 pm_qos = <&qos_lcdc0>, 720 720 <&qos_lcdc1>, 721 721 <&qos_cif0>, 722 - <&qos_cif1>, 723 722 <&qos_ipp>, 724 723 <&qos_rga>; 725 724 };
-1
arch/arm/include/asm/irq.h
··· 25 25 #ifndef __ASSEMBLY__ 26 26 struct irqaction; 27 27 struct pt_regs; 28 - extern void migrate_irqs(void); 29 28 30 29 extern void asm_do_IRQ(unsigned int, struct pt_regs *); 31 30 void handle_IRQ(unsigned int, struct pt_regs *);
+10
arch/arm/include/asm/kvm_host.h
··· 48 48 #define KVM_REQ_SLEEP \ 49 49 KVM_ARCH_REQ_FLAGS(0, KVM_REQUEST_WAIT | KVM_REQUEST_NO_WAKEUP) 50 50 #define KVM_REQ_IRQ_PENDING KVM_ARCH_REQ(1) 51 + #define KVM_REQ_VCPU_RESET KVM_ARCH_REQ(2) 51 52 52 53 DECLARE_STATIC_KEY_FALSE(userspace_irqchip_in_use); 53 54 ··· 148 147 149 148 typedef struct kvm_cpu_context kvm_cpu_context_t; 150 149 150 + struct vcpu_reset_state { 151 + unsigned long pc; 152 + unsigned long r0; 153 + bool be; 154 + bool reset; 155 + }; 156 + 151 157 struct kvm_vcpu_arch { 152 158 struct kvm_cpu_context ctxt; 153 159 ··· 193 185 194 186 /* Cache some mmu pages needed inside spinlock regions */ 195 187 struct kvm_mmu_memory_cache mmu_page_cache; 188 + 189 + struct vcpu_reset_state reset_state; 196 190 197 191 /* Detect first run of a vcpu */ 198 192 bool has_run_once;
+5
arch/arm/include/asm/stage2_pgtable.h
··· 76 76 #define S2_PMD_MASK PMD_MASK 77 77 #define S2_PMD_SIZE PMD_SIZE 78 78 79 + static inline bool kvm_stage2_has_pmd(struct kvm *kvm) 80 + { 81 + return true; 82 + } 83 + 79 84 #endif /* __ARM_S2_PGTABLE_H_ */
-62
arch/arm/kernel/irq.c
··· 31 31 #include <linux/smp.h> 32 32 #include <linux/init.h> 33 33 #include <linux/seq_file.h> 34 - #include <linux/ratelimit.h> 35 34 #include <linux/errno.h> 36 35 #include <linux/list.h> 37 36 #include <linux/kallsyms.h> ··· 108 109 return nr_irqs; 109 110 } 110 111 #endif 111 - 112 - #ifdef CONFIG_HOTPLUG_CPU 113 - static bool migrate_one_irq(struct irq_desc *desc) 114 - { 115 - struct irq_data *d = irq_desc_get_irq_data(desc); 116 - const struct cpumask *affinity = irq_data_get_affinity_mask(d); 117 - struct irq_chip *c; 118 - bool ret = false; 119 - 120 - /* 121 - * If this is a per-CPU interrupt, or the affinity does not 122 - * include this CPU, then we have nothing to do. 123 - */ 124 - if (irqd_is_per_cpu(d) || !cpumask_test_cpu(smp_processor_id(), affinity)) 125 - return false; 126 - 127 - if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) { 128 - affinity = cpu_online_mask; 129 - ret = true; 130 - } 131 - 132 - c = irq_data_get_irq_chip(d); 133 - if (!c->irq_set_affinity) 134 - pr_debug("IRQ%u: unable to set affinity\n", d->irq); 135 - else if (c->irq_set_affinity(d, affinity, false) == IRQ_SET_MASK_OK && ret) 136 - cpumask_copy(irq_data_get_affinity_mask(d), affinity); 137 - 138 - return ret; 139 - } 140 - 141 - /* 142 - * The current CPU has been marked offline. Migrate IRQs off this CPU. 143 - * If the affinity settings do not allow other CPUs, force them onto any 144 - * available CPU. 145 - * 146 - * Note: we must iterate over all IRQs, whether they have an attached 147 - * action structure or not, as we need to get chained interrupts too. 148 - */ 149 - void migrate_irqs(void) 150 - { 151 - unsigned int i; 152 - struct irq_desc *desc; 153 - unsigned long flags; 154 - 155 - local_irq_save(flags); 156 - 157 - for_each_irq_desc(i, desc) { 158 - bool affinity_broken; 159 - 160 - raw_spin_lock(&desc->lock); 161 - affinity_broken = migrate_one_irq(desc); 162 - raw_spin_unlock(&desc->lock); 163 - 164 - if (affinity_broken) 165 - pr_warn_ratelimited("IRQ%u no longer affine to CPU%u\n", 166 - i, smp_processor_id()); 167 - } 168 - 169 - local_irq_restore(flags); 170 - } 171 - #endif /* CONFIG_HOTPLUG_CPU */
+1 -1
arch/arm/kernel/smp.c
··· 254 254 /* 255 255 * OK - migrate IRQs away from this CPU 256 256 */ 257 - migrate_irqs(); 257 + irq_migrate_all_off_this_cpu(); 258 258 259 259 /* 260 260 * Flush user cache and TLB mappings, and then remove this CPU
+2 -2
arch/arm/kvm/coproc.c
··· 1450 1450 reset_coproc_regs(vcpu, table, num); 1451 1451 1452 1452 for (num = 1; num < NR_CP15_REGS; num++) 1453 - if (vcpu_cp15(vcpu, num) == 0x42424242) 1454 - panic("Didn't reset vcpu_cp15(vcpu, %zi)", num); 1453 + WARN(vcpu_cp15(vcpu, num) == 0x42424242, 1454 + "Didn't reset vcpu_cp15(vcpu, %zi)", num); 1455 1455 }
+24
arch/arm/kvm/reset.c
··· 26 26 #include <asm/cputype.h> 27 27 #include <asm/kvm_arm.h> 28 28 #include <asm/kvm_coproc.h> 29 + #include <asm/kvm_emulate.h> 29 30 30 31 #include <kvm/arm_arch_timer.h> 31 32 ··· 69 68 70 69 /* Reset CP15 registers */ 71 70 kvm_reset_coprocs(vcpu); 71 + 72 + /* 73 + * Additional reset state handling that PSCI may have imposed on us. 74 + * Must be done after all the sys_reg reset. 75 + */ 76 + if (READ_ONCE(vcpu->arch.reset_state.reset)) { 77 + unsigned long target_pc = vcpu->arch.reset_state.pc; 78 + 79 + /* Gracefully handle Thumb2 entry point */ 80 + if (target_pc & 1) { 81 + target_pc &= ~1UL; 82 + vcpu_set_thumb(vcpu); 83 + } 84 + 85 + /* Propagate caller endianness */ 86 + if (vcpu->arch.reset_state.be) 87 + kvm_vcpu_set_be(vcpu); 88 + 89 + *vcpu_pc(vcpu) = target_pc; 90 + vcpu_set_reg(vcpu, 0, vcpu->arch.reset_state.r0); 91 + 92 + vcpu->arch.reset_state.reset = false; 93 + } 72 94 73 95 /* Reset arch_timer context */ 74 96 return kvm_timer_vcpu_reset(vcpu);
+4 -12
arch/arm/mach-omap2/cpuidle44xx.c
··· 152 152 mpuss_can_lose_context = (cx->mpu_state == PWRDM_POWER_RET) && 153 153 (cx->mpu_logic_state == PWRDM_POWER_OFF); 154 154 155 + /* Enter broadcast mode for periodic timers */ 156 + tick_broadcast_enable(); 157 + 158 + /* Enter broadcast mode for one-shot timers */ 155 159 tick_broadcast_enter(); 156 160 157 161 /* ··· 220 216 cpu_done[dev->cpu] = false; 221 217 222 218 return index; 223 - } 224 - 225 - /* 226 - * For each cpu, setup the broadcast timer because local timers 227 - * stops for the states above C1. 228 - */ 229 - static void omap_setup_broadcast_timer(void *arg) 230 - { 231 - tick_broadcast_enable(); 232 219 } 233 220 234 221 static struct cpuidle_driver omap4_idle_driver = { ··· 313 318 cpu_clkdm[1] = clkdm_lookup("mpu1_clkdm"); 314 319 if (!cpu_clkdm[0] || !cpu_clkdm[1]) 315 320 return -ENODEV; 316 - 317 - /* Configure the broadcast timer on each cpu */ 318 - on_each_cpu(omap_setup_broadcast_timer, NULL, 1); 319 321 320 322 return cpuidle_register(idle_driver, cpu_online_mask); 321 323 }
+6 -1
arch/arm/mach-omap2/display.c
··· 83 83 u32 enable_mask, enable_shift; 84 84 u32 pipd_mask, pipd_shift; 85 85 u32 reg; 86 + int ret; 86 87 87 88 if (dsi_id == 0) { 88 89 enable_mask = OMAP4_DSI1_LANEENABLE_MASK; ··· 99 98 return -ENODEV; 100 99 } 101 100 102 - regmap_read(omap4_dsi_mux_syscon, OMAP4_DSIPHY_SYSCON_OFFSET, &reg); 101 + ret = regmap_read(omap4_dsi_mux_syscon, 102 + OMAP4_DSIPHY_SYSCON_OFFSET, 103 + &reg); 104 + if (ret) 105 + return ret; 103 106 104 107 reg &= ~enable_mask; 105 108 reg &= ~pipd_mask;
+35 -1
arch/arm/mach-omap2/omap-wakeupgen.c
··· 50 50 #define OMAP4_NR_BANKS 4 51 51 #define OMAP4_NR_IRQS 128 52 52 53 + #define SYS_NIRQ1_EXT_SYS_IRQ_1 7 54 + #define SYS_NIRQ2_EXT_SYS_IRQ_2 119 55 + 53 56 static void __iomem *wakeupgen_base; 54 57 static void __iomem *sar_base; 55 58 static DEFINE_RAW_SPINLOCK(wakeupgen_lock); ··· 154 151 _wakeupgen_set(d->hwirq, irq_target_cpu[d->hwirq]); 155 152 raw_spin_unlock_irqrestore(&wakeupgen_lock, flags); 156 153 irq_chip_unmask_parent(d); 154 + } 155 + 156 + /* 157 + * The sys_nirq pins bypass peripheral modules and are wired directly 158 + * to MPUSS wakeupgen. They get automatically inverted for GIC. 159 + */ 160 + static int wakeupgen_irq_set_type(struct irq_data *d, unsigned int type) 161 + { 162 + bool inverted = false; 163 + 164 + switch (type) { 165 + case IRQ_TYPE_LEVEL_LOW: 166 + type &= ~IRQ_TYPE_LEVEL_MASK; 167 + type |= IRQ_TYPE_LEVEL_HIGH; 168 + inverted = true; 169 + break; 170 + case IRQ_TYPE_EDGE_FALLING: 171 + type &= ~IRQ_TYPE_EDGE_BOTH; 172 + type |= IRQ_TYPE_EDGE_RISING; 173 + inverted = true; 174 + break; 175 + default: 176 + break; 177 + } 178 + 179 + if (inverted && d->hwirq != SYS_NIRQ1_EXT_SYS_IRQ_1 && 180 + d->hwirq != SYS_NIRQ2_EXT_SYS_IRQ_2) 181 + pr_warn("wakeupgen: irq%li polarity inverted in dts\n", 182 + d->hwirq); 183 + 184 + return irq_chip_set_type_parent(d, type); 157 185 } 158 186 159 187 #ifdef CONFIG_HOTPLUG_CPU ··· 480 446 .irq_mask = wakeupgen_mask, 481 447 .irq_unmask = wakeupgen_unmask, 482 448 .irq_retrigger = irq_chip_retrigger_hierarchy, 483 - .irq_set_type = irq_chip_set_type_parent, 449 + .irq_set_type = wakeupgen_irq_set_type, 484 450 .flags = IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MASK_ON_SUSPEND, 485 451 #ifdef CONFIG_SMP 486 452 .irq_set_affinity = irq_chip_set_affinity_parent,
+2
arch/arm/mm/dma-mapping.c
··· 2390 2390 return; 2391 2391 2392 2392 arm_teardown_iommu_dma_ops(dev); 2393 + /* Let arch_setup_dma_ops() start again from scratch upon re-probe */ 2394 + set_dma_ops(dev, NULL); 2393 2395 }
+1 -1
arch/arm/probes/kprobes/opt-arm.c
··· 247 247 } 248 248 249 249 /* Copy arch-dep-instance from template. */ 250 - memcpy(code, (unsigned char *)optprobe_template_entry, 250 + memcpy(code, (unsigned long *)&optprobe_template_entry, 251 251 TMPL_END_IDX * sizeof(kprobe_opcode_t)); 252 252 253 253 /* Adjust buffer according to instruction. */
+22 -22
arch/arm64/boot/dts/freescale/imx8mq-evk.dts
··· 227 227 228 228 pinctrl_usdhc1_100mhz: usdhc1-100grp { 229 229 fsl,pins = < 230 - MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK 0x85 231 - MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD 0xc5 232 - MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0 0xc5 233 - MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1 0xc5 234 - MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2 0xc5 235 - MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3 0xc5 236 - MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4 0xc5 237 - MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5 0xc5 238 - MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6 0xc5 239 - MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7 0xc5 240 - MX8MQ_IOMUXC_SD1_STROBE_USDHC1_STROBE 0x85 230 + MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK 0x8d 231 + MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD 0xcd 232 + MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0 0xcd 233 + MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1 0xcd 234 + MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2 0xcd 235 + MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3 0xcd 236 + MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4 0xcd 237 + MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5 0xcd 238 + MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6 0xcd 239 + MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7 0xcd 240 + MX8MQ_IOMUXC_SD1_STROBE_USDHC1_STROBE 0x8d 241 241 MX8MQ_IOMUXC_SD1_RESET_B_USDHC1_RESET_B 0xc1 242 242 >; 243 243 }; 244 244 245 245 pinctrl_usdhc1_200mhz: usdhc1-200grp { 246 246 fsl,pins = < 247 - MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK 0x87 248 - MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD 0xc7 249 - MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0 0xc7 250 - MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1 0xc7 251 - MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2 0xc7 252 - MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3 0xc7 253 - MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4 0xc7 254 - MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5 0xc7 255 - MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6 0xc7 256 - MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7 0xc7 257 - MX8MQ_IOMUXC_SD1_STROBE_USDHC1_STROBE 0x87 247 + MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK 0x9f 248 + MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD 0xdf 249 + MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0 0xdf 250 + MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1 0xdf 251 + MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2 0xdf 252 + MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3 0xdf 253 + MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4 0xdf 254 + MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5 0xdf 255 + MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6 0xdf 256 + MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7 0xdf 257 + MX8MQ_IOMUXC_SD1_STROBE_USDHC1_STROBE 0x9f 258 258 MX8MQ_IOMUXC_SD1_RESET_B_USDHC1_RESET_B 0xc1 259 259 >; 260 260 };
+2
arch/arm64/boot/dts/freescale/imx8mq.dtsi
··· 360 360 <&clk IMX8MQ_CLK_NAND_USDHC_BUS>, 361 361 <&clk IMX8MQ_CLK_USDHC1_ROOT>; 362 362 clock-names = "ipg", "ahb", "per"; 363 + assigned-clocks = <&clk IMX8MQ_CLK_USDHC1>; 364 + assigned-clock-rates = <400000000>; 363 365 fsl,tuning-start-tap = <20>; 364 366 fsl,tuning-step = <2>; 365 367 bus-width = <4>;
+2
arch/arm64/boot/dts/rockchip/rk3328-rock64.dts
··· 40 40 pinctrl-0 = <&usb30_host_drv>; 41 41 regulator-name = "vcc_host_5v"; 42 42 regulator-always-on; 43 + regulator-boot-on; 43 44 vin-supply = <&vcc_sys>; 44 45 }; 45 46 ··· 52 51 pinctrl-0 = <&usb20_host_drv>; 53 52 regulator-name = "vcc_host1_5v"; 54 53 regulator-always-on; 54 + regulator-boot-on; 55 55 vin-supply = <&vcc_sys>; 56 56 }; 57 57
+1 -1
arch/arm64/boot/dts/rockchip/rk3399-gru-bob.dts
··· 22 22 backlight = <&backlight>; 23 23 power-supply = <&pp3300_disp>; 24 24 25 - ports { 25 + port { 26 26 panel_in_edp: endpoint { 27 27 remote-endpoint = <&edp_out_panel>; 28 28 };
+1 -1
arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts
··· 43 43 backlight = <&backlight>; 44 44 power-supply = <&pp3300_disp>; 45 45 46 - ports { 46 + port { 47 47 panel_in_edp: endpoint { 48 48 remote-endpoint = <&edp_out_panel>; 49 49 };
+1 -1
arch/arm64/boot/dts/rockchip/rk3399-sapphire-excavator.dts
··· 91 91 pinctrl-0 = <&lcd_panel_reset>; 92 92 power-supply = <&vcc3v3_s0>; 93 93 94 - ports { 94 + port { 95 95 panel_in_edp: endpoint { 96 96 remote-endpoint = <&edp_out_panel>; 97 97 };
+11
arch/arm64/include/asm/kvm_host.h
··· 48 48 #define KVM_REQ_SLEEP \ 49 49 KVM_ARCH_REQ_FLAGS(0, KVM_REQUEST_WAIT | KVM_REQUEST_NO_WAKEUP) 50 50 #define KVM_REQ_IRQ_PENDING KVM_ARCH_REQ(1) 51 + #define KVM_REQ_VCPU_RESET KVM_ARCH_REQ(2) 51 52 52 53 DECLARE_STATIC_KEY_FALSE(userspace_irqchip_in_use); 53 54 ··· 209 208 210 209 typedef struct kvm_cpu_context kvm_cpu_context_t; 211 210 211 + struct vcpu_reset_state { 212 + unsigned long pc; 213 + unsigned long r0; 214 + bool be; 215 + bool reset; 216 + }; 217 + 212 218 struct kvm_vcpu_arch { 213 219 struct kvm_cpu_context ctxt; 214 220 ··· 304 296 305 297 /* Virtual SError ESR to restore when HCR_EL2.VSE is set */ 306 298 u64 vsesr_el2; 299 + 300 + /* Additional reset state */ 301 + struct vcpu_reset_state reset_state; 307 302 308 303 /* True when deferrable sysregs are loaded on the physical CPU, 309 304 * see kvm_vcpu_load_sysregs and kvm_vcpu_put_sysregs. */
+11
arch/arm64/include/asm/memory.h
··· 332 332 #define virt_addr_valid(kaddr) \ 333 333 (_virt_addr_is_linear(kaddr) && _virt_addr_valid(kaddr)) 334 334 335 + /* 336 + * Given that the GIC architecture permits ITS implementations that can only be 337 + * configured with a LPI table address once, GICv3 systems with many CPUs may 338 + * end up reserving a lot of different regions after a kexec for their LPI 339 + * tables (one per CPU), as we are forced to reuse the same memory after kexec 340 + * (and thus reserve it persistently with EFI beforehand) 341 + */ 342 + #if defined(CONFIG_EFI) && defined(CONFIG_ARM_GIC_V3_ITS) 343 + # define INIT_MEMBLOCK_RESERVED_REGIONS (INIT_MEMBLOCK_REGIONS + NR_CPUS + 1) 344 + #endif 345 + 335 346 #include <asm-generic/memory_model.h> 336 347 337 348 #endif
-1
arch/arm64/kernel/setup.c
··· 313 313 arm64_memblock_init(); 314 314 315 315 paging_init(); 316 - efi_apply_persistent_mem_reservations(); 317 316 318 317 acpi_table_upgrade(); 319 318
+5
arch/arm64/kvm/hyp/switch.c
··· 23 23 #include <kvm/arm_psci.h> 24 24 25 25 #include <asm/cpufeature.h> 26 + #include <asm/kprobes.h> 26 27 #include <asm/kvm_asm.h> 27 28 #include <asm/kvm_emulate.h> 28 29 #include <asm/kvm_host.h> ··· 108 107 109 108 write_sysreg(kvm_get_hyp_vector(), vbar_el1); 110 109 } 110 + NOKPROBE_SYMBOL(activate_traps_vhe); 111 111 112 112 static void __hyp_text __activate_traps_nvhe(struct kvm_vcpu *vcpu) 113 113 { ··· 156 154 write_sysreg(CPACR_EL1_DEFAULT, cpacr_el1); 157 155 write_sysreg(vectors, vbar_el1); 158 156 } 157 + NOKPROBE_SYMBOL(deactivate_traps_vhe); 159 158 160 159 static void __hyp_text __deactivate_traps_nvhe(void) 161 160 { ··· 516 513 517 514 return exit_code; 518 515 } 516 + NOKPROBE_SYMBOL(kvm_vcpu_run_vhe); 519 517 520 518 /* Switch to the guest for legacy non-VHE systems */ 521 519 int __hyp_text __kvm_vcpu_run_nvhe(struct kvm_vcpu *vcpu) ··· 624 620 read_sysreg_el2(esr), read_sysreg_el2(far), 625 621 read_sysreg(hpfar_el2), par, vcpu); 626 622 } 623 + NOKPROBE_SYMBOL(__hyp_call_panic_vhe); 627 624 628 625 void __hyp_text __noreturn hyp_panic(struct kvm_cpu_context *host_ctxt) 629 626 {
+5
arch/arm64/kvm/hyp/sysreg-sr.c
··· 18 18 #include <linux/compiler.h> 19 19 #include <linux/kvm_host.h> 20 20 21 + #include <asm/kprobes.h> 21 22 #include <asm/kvm_asm.h> 22 23 #include <asm/kvm_emulate.h> 23 24 #include <asm/kvm_hyp.h> ··· 99 98 { 100 99 __sysreg_save_common_state(ctxt); 101 100 } 101 + NOKPROBE_SYMBOL(sysreg_save_host_state_vhe); 102 102 103 103 void sysreg_save_guest_state_vhe(struct kvm_cpu_context *ctxt) 104 104 { 105 105 __sysreg_save_common_state(ctxt); 106 106 __sysreg_save_el2_return_state(ctxt); 107 107 } 108 + NOKPROBE_SYMBOL(sysreg_save_guest_state_vhe); 108 109 109 110 static void __hyp_text __sysreg_restore_common_state(struct kvm_cpu_context *ctxt) 110 111 { ··· 191 188 { 192 189 __sysreg_restore_common_state(ctxt); 193 190 } 191 + NOKPROBE_SYMBOL(sysreg_restore_host_state_vhe); 194 192 195 193 void sysreg_restore_guest_state_vhe(struct kvm_cpu_context *ctxt) 196 194 { 197 195 __sysreg_restore_common_state(ctxt); 198 196 __sysreg_restore_el2_return_state(ctxt); 199 197 } 198 + NOKPROBE_SYMBOL(sysreg_restore_guest_state_vhe); 200 199 201 200 void __hyp_text __sysreg32_save_state(struct kvm_vcpu *vcpu) 202 201 {
+48 -2
arch/arm64/kvm/reset.c
··· 32 32 #include <asm/kvm_arm.h> 33 33 #include <asm/kvm_asm.h> 34 34 #include <asm/kvm_coproc.h> 35 + #include <asm/kvm_emulate.h> 35 36 #include <asm/kvm_mmu.h> 36 37 37 38 /* Maximum phys_shift supported for any VM on this host */ ··· 106 105 * This function finds the right table above and sets the registers on 107 106 * the virtual CPU struct to their architecturally defined reset 108 107 * values. 108 + * 109 + * Note: This function can be called from two paths: The KVM_ARM_VCPU_INIT 110 + * ioctl or as part of handling a request issued by another VCPU in the PSCI 111 + * handling code. In the first case, the VCPU will not be loaded, and in the 112 + * second case the VCPU will be loaded. Because this function operates purely 113 + * on the memory-backed valus of system registers, we want to do a full put if 114 + * we were loaded (handling a request) and load the values back at the end of 115 + * the function. Otherwise we leave the state alone. In both cases, we 116 + * disable preemption around the vcpu reset as we would otherwise race with 117 + * preempt notifiers which also call put/load. 109 118 */ 110 119 int kvm_reset_vcpu(struct kvm_vcpu *vcpu) 111 120 { 112 121 const struct kvm_regs *cpu_reset; 122 + int ret = -EINVAL; 123 + bool loaded; 124 + 125 + preempt_disable(); 126 + loaded = (vcpu->cpu != -1); 127 + if (loaded) 128 + kvm_arch_vcpu_put(vcpu); 113 129 114 130 switch (vcpu->arch.target) { 115 131 default: 116 132 if (test_bit(KVM_ARM_VCPU_EL1_32BIT, vcpu->arch.features)) { 117 133 if (!cpu_has_32bit_el1()) 118 - return -EINVAL; 134 + goto out; 119 135 cpu_reset = &default_regs_reset32; 120 136 } else { 121 137 cpu_reset = &default_regs_reset; ··· 147 129 /* Reset system registers */ 148 130 kvm_reset_sys_regs(vcpu); 149 131 132 + /* 133 + * Additional reset state handling that PSCI may have imposed on us. 134 + * Must be done after all the sys_reg reset. 135 + */ 136 + if (vcpu->arch.reset_state.reset) { 137 + unsigned long target_pc = vcpu->arch.reset_state.pc; 138 + 139 + /* Gracefully handle Thumb2 entry point */ 140 + if (vcpu_mode_is_32bit(vcpu) && (target_pc & 1)) { 141 + target_pc &= ~1UL; 142 + vcpu_set_thumb(vcpu); 143 + } 144 + 145 + /* Propagate caller endianness */ 146 + if (vcpu->arch.reset_state.be) 147 + kvm_vcpu_set_be(vcpu); 148 + 149 + *vcpu_pc(vcpu) = target_pc; 150 + vcpu_set_reg(vcpu, 0, vcpu->arch.reset_state.r0); 151 + 152 + vcpu->arch.reset_state.reset = false; 153 + } 154 + 150 155 /* Reset PMU */ 151 156 kvm_pmu_vcpu_reset(vcpu); 152 157 ··· 178 137 vcpu->arch.workaround_flags |= VCPU_WORKAROUND_2_FLAG; 179 138 180 139 /* Reset timer */ 181 - return kvm_timer_vcpu_reset(vcpu); 140 + ret = kvm_timer_vcpu_reset(vcpu); 141 + out: 142 + if (loaded) 143 + kvm_arch_vcpu_load(vcpu, smp_processor_id()); 144 + preempt_enable(); 145 + return ret; 182 146 } 183 147 184 148 void kvm_set_ipa_limit(void)
+32 -18
arch/arm64/kvm/sys_regs.c
··· 314 314 return read_zero(vcpu, p); 315 315 } 316 316 317 - static bool trap_undef(struct kvm_vcpu *vcpu, 318 - struct sys_reg_params *p, 319 - const struct sys_reg_desc *r) 317 + /* 318 + * ARMv8.1 mandates at least a trivial LORegion implementation, where all the 319 + * RW registers are RES0 (which we can implement as RAZ/WI). On an ARMv8.0 320 + * system, these registers should UNDEF. LORID_EL1 being a RO register, we 321 + * treat it separately. 322 + */ 323 + static bool trap_loregion(struct kvm_vcpu *vcpu, 324 + struct sys_reg_params *p, 325 + const struct sys_reg_desc *r) 320 326 { 321 - kvm_inject_undefined(vcpu); 322 - return false; 327 + u64 val = read_sanitised_ftr_reg(SYS_ID_AA64MMFR1_EL1); 328 + u32 sr = sys_reg((u32)r->Op0, (u32)r->Op1, 329 + (u32)r->CRn, (u32)r->CRm, (u32)r->Op2); 330 + 331 + if (!(val & (0xfUL << ID_AA64MMFR1_LOR_SHIFT))) { 332 + kvm_inject_undefined(vcpu); 333 + return false; 334 + } 335 + 336 + if (p->is_write && sr == SYS_LORID_EL1) 337 + return write_to_read_only(vcpu, p, r); 338 + 339 + return trap_raz_wi(vcpu, p, r); 323 340 } 324 341 325 342 static bool trap_oslsr_el1(struct kvm_vcpu *vcpu, ··· 1065 1048 if (val & ptrauth_mask) 1066 1049 kvm_debug("ptrauth unsupported for guests, suppressing\n"); 1067 1050 val &= ~ptrauth_mask; 1068 - } else if (id == SYS_ID_AA64MMFR1_EL1) { 1069 - if (val & (0xfUL << ID_AA64MMFR1_LOR_SHIFT)) 1070 - kvm_debug("LORegions unsupported for guests, suppressing\n"); 1071 - 1072 - val &= ~(0xfUL << ID_AA64MMFR1_LOR_SHIFT); 1073 1051 } 1074 1052 1075 1053 return val; ··· 1350 1338 { SYS_DESC(SYS_MAIR_EL1), access_vm_reg, reset_unknown, MAIR_EL1 }, 1351 1339 { SYS_DESC(SYS_AMAIR_EL1), access_vm_reg, reset_amair_el1, AMAIR_EL1 }, 1352 1340 1353 - { SYS_DESC(SYS_LORSA_EL1), trap_undef }, 1354 - { SYS_DESC(SYS_LOREA_EL1), trap_undef }, 1355 - { SYS_DESC(SYS_LORN_EL1), trap_undef }, 1356 - { SYS_DESC(SYS_LORC_EL1), trap_undef }, 1357 - { SYS_DESC(SYS_LORID_EL1), trap_undef }, 1341 + { SYS_DESC(SYS_LORSA_EL1), trap_loregion }, 1342 + { SYS_DESC(SYS_LOREA_EL1), trap_loregion }, 1343 + { SYS_DESC(SYS_LORN_EL1), trap_loregion }, 1344 + { SYS_DESC(SYS_LORC_EL1), trap_loregion }, 1345 + { SYS_DESC(SYS_LORID_EL1), trap_loregion }, 1358 1346 1359 1347 { SYS_DESC(SYS_VBAR_EL1), NULL, reset_val, VBAR_EL1, 0 }, 1360 1348 { SYS_DESC(SYS_DISR_EL1), NULL, reset_val, DISR_EL1, 0 }, ··· 2608 2596 table = get_target_table(vcpu->arch.target, true, &num); 2609 2597 reset_sys_reg_descs(vcpu, table, num); 2610 2598 2611 - for (num = 1; num < NR_SYS_REGS; num++) 2612 - if (__vcpu_sys_reg(vcpu, num) == 0x4242424242424242) 2613 - panic("Didn't reset __vcpu_sys_reg(%zi)", num); 2599 + for (num = 1; num < NR_SYS_REGS; num++) { 2600 + if (WARN(__vcpu_sys_reg(vcpu, num) == 0x4242424242424242, 2601 + "Didn't reset __vcpu_sys_reg(%zi)\n", num)) 2602 + break; 2603 + } 2614 2604 }
+7 -2
arch/csky/include/asm/pgtable.h
··· 45 45 ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset_t(address)) 46 46 #define pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT)) 47 47 #define pte_clear(mm, addr, ptep) set_pte((ptep), \ 48 - (((unsigned int)addr&0x80000000)?__pte(1):__pte(0))) 49 - #define pte_none(pte) (!(pte_val(pte)&0xfffffffe)) 48 + (((unsigned int) addr & PAGE_OFFSET) ? __pte(_PAGE_GLOBAL) : __pte(0))) 49 + #define pte_none(pte) (!(pte_val(pte) & ~_PAGE_GLOBAL)) 50 50 #define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT) 51 51 #define pte_pfn(x) ((unsigned long)((x).pte_low >> PAGE_SHIFT)) 52 52 #define pfn_pte(pfn, prot) __pte(((unsigned long long)(pfn) << PAGE_SHIFT) \ ··· 240 240 #define pgd_offset_k(address) pgd_offset(&init_mm, address) 241 241 242 242 #define pgd_index(address) ((address) >> PGDIR_SHIFT) 243 + 244 + #define __HAVE_PHYS_MEM_ACCESS_PROT 245 + struct file; 246 + extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, 247 + unsigned long size, pgprot_t vma_prot); 243 248 244 249 /* 245 250 * Macro to make mark a page protection value as "uncacheable". Note
+2 -2
arch/csky/include/asm/processor.h
··· 49 49 }; 50 50 51 51 #define INIT_THREAD { \ 52 - .ksp = (unsigned long) init_thread_union.stack + THREAD_SIZE, \ 52 + .ksp = sizeof(init_stack) + (unsigned long) &init_stack, \ 53 53 .sr = DEFAULT_PSR_VALUE, \ 54 54 } 55 55 ··· 95 95 #define KSTK_ESP(tsk) (task_pt_regs(tsk)->usp) 96 96 97 97 #define task_pt_regs(p) \ 98 - ((struct pt_regs *)(THREAD_SIZE + p->stack) - 1) 98 + ((struct pt_regs *)(THREAD_SIZE + task_stack_page(p)) - 1) 99 99 100 100 #define cpu_relax() barrier() 101 101
+4
arch/csky/kernel/dumpstack.c
··· 38 38 if (task) 39 39 stack = (unsigned long *)thread_saved_fp(task); 40 40 else 41 + #ifdef CONFIG_STACKTRACE 42 + asm volatile("mov %0, r8\n":"=r"(stack)::"memory"); 43 + #else 41 44 stack = (unsigned long *)&stack; 45 + #endif 42 46 } 43 47 44 48 show_trace(stack);
+2 -1
arch/csky/kernel/ptrace.c
··· 8 8 #include <linux/ptrace.h> 9 9 #include <linux/regset.h> 10 10 #include <linux/sched.h> 11 + #include <linux/sched/task_stack.h> 11 12 #include <linux/signal.h> 12 13 #include <linux/smp.h> 13 14 #include <linux/uaccess.h> ··· 160 159 static const struct user_regset csky_regsets[] = { 161 160 [REGSET_GPR] = { 162 161 .core_note_type = NT_PRSTATUS, 163 - .n = ELF_NGREG, 162 + .n = sizeof(struct pt_regs) / sizeof(u32), 164 163 .size = sizeof(u32), 165 164 .align = sizeof(u32), 166 165 .get = &gpr_get,
+2 -1
arch/csky/kernel/smp.c
··· 160 160 { 161 161 unsigned long mask = 1 << cpu; 162 162 163 - secondary_stack = (unsigned int)tidle->stack + THREAD_SIZE - 8; 163 + secondary_stack = 164 + (unsigned int) task_stack_page(tidle) + THREAD_SIZE - 8; 164 165 secondary_hint = mfcr("cr31"); 165 166 secondary_ccr = mfcr("cr18"); 166 167
+14
arch/csky/mm/ioremap.c
··· 46 46 vunmap((void *)((unsigned long)addr & PAGE_MASK)); 47 47 } 48 48 EXPORT_SYMBOL(iounmap); 49 + 50 + pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, 51 + unsigned long size, pgprot_t vma_prot) 52 + { 53 + if (!pfn_valid(pfn)) { 54 + vma_prot.pgprot |= _PAGE_SO; 55 + return pgprot_noncached(vma_prot); 56 + } else if (file->f_flags & O_SYNC) { 57 + return pgprot_noncached(vma_prot); 58 + } 59 + 60 + return vma_prot; 61 + } 62 + EXPORT_SYMBOL(phys_mem_access_prot);
+12 -12
arch/mips/net/ebpf_jit.c
··· 79 79 REG_64BIT_32BIT, 80 80 /* 32-bit compatible, need truncation for 64-bit ops. */ 81 81 REG_32BIT, 82 - /* 32-bit zero extended. */ 83 - REG_32BIT_ZERO_EX, 84 82 /* 32-bit no sign/zero extension needed. */ 85 83 REG_32BIT_POS 86 84 }; ··· 341 343 const struct bpf_prog *prog = ctx->skf; 342 344 int stack_adjust = ctx->stack_size; 343 345 int store_offset = stack_adjust - 8; 346 + enum reg_val_type td; 344 347 int r0 = MIPS_R_V0; 345 348 346 - if (dest_reg == MIPS_R_RA && 347 - get_reg_val_type(ctx, prog->len, BPF_REG_0) == REG_32BIT_ZERO_EX) 349 + if (dest_reg == MIPS_R_RA) { 348 350 /* Don't let zero extended value escape. */ 349 - emit_instr(ctx, sll, r0, r0, 0); 351 + td = get_reg_val_type(ctx, prog->len, BPF_REG_0); 352 + if (td == REG_64BIT) 353 + emit_instr(ctx, sll, r0, r0, 0); 354 + } 350 355 351 356 if (ctx->flags & EBPF_SAVE_RA) { 352 357 emit_instr(ctx, ld, MIPS_R_RA, store_offset, MIPS_R_SP); ··· 693 692 if (dst < 0) 694 693 return dst; 695 694 td = get_reg_val_type(ctx, this_idx, insn->dst_reg); 696 - if (td == REG_64BIT || td == REG_32BIT_ZERO_EX) { 695 + if (td == REG_64BIT) { 697 696 /* sign extend */ 698 697 emit_instr(ctx, sll, dst, dst, 0); 699 698 } ··· 708 707 if (dst < 0) 709 708 return dst; 710 709 td = get_reg_val_type(ctx, this_idx, insn->dst_reg); 711 - if (td == REG_64BIT || td == REG_32BIT_ZERO_EX) { 710 + if (td == REG_64BIT) { 712 711 /* sign extend */ 713 712 emit_instr(ctx, sll, dst, dst, 0); 714 713 } ··· 722 721 if (dst < 0) 723 722 return dst; 724 723 td = get_reg_val_type(ctx, this_idx, insn->dst_reg); 725 - if (td == REG_64BIT || td == REG_32BIT_ZERO_EX) 724 + if (td == REG_64BIT) 726 725 /* sign extend */ 727 726 emit_instr(ctx, sll, dst, dst, 0); 728 727 if (insn->imm == 1) { ··· 861 860 if (src < 0 || dst < 0) 862 861 return -EINVAL; 863 862 td = get_reg_val_type(ctx, this_idx, insn->dst_reg); 864 - if (td == REG_64BIT || td == REG_32BIT_ZERO_EX) { 863 + if (td == REG_64BIT) { 865 864 /* sign extend */ 866 865 emit_instr(ctx, sll, dst, dst, 0); 867 866 } 868 867 did_move = false; 869 868 ts = get_reg_val_type(ctx, this_idx, insn->src_reg); 870 - if (ts == REG_64BIT || ts == REG_32BIT_ZERO_EX) { 869 + if (ts == REG_64BIT) { 871 870 int tmp_reg = MIPS_R_AT; 872 871 873 872 if (bpf_op == BPF_MOV) { ··· 1255 1254 if (insn->imm == 64 && td == REG_32BIT) 1256 1255 emit_instr(ctx, dinsu, dst, MIPS_R_ZERO, 32, 32); 1257 1256 1258 - if (insn->imm != 64 && 1259 - (td == REG_64BIT || td == REG_32BIT_ZERO_EX)) { 1257 + if (insn->imm != 64 && td == REG_64BIT) { 1260 1258 /* sign extend */ 1261 1259 emit_instr(ctx, sll, dst, dst, 0); 1262 1260 }
+2 -2
arch/powerpc/include/asm/book3s/64/pgtable.h
··· 904 904 905 905 static inline int pud_present(pud_t pud) 906 906 { 907 - return (pud_raw(pud) & cpu_to_be64(_PAGE_PRESENT)); 907 + return !!(pud_raw(pud) & cpu_to_be64(_PAGE_PRESENT)); 908 908 } 909 909 910 910 extern struct page *pud_page(pud_t pud); ··· 951 951 952 952 static inline int pgd_present(pgd_t pgd) 953 953 { 954 - return (pgd_raw(pgd) & cpu_to_be64(_PAGE_PRESENT)); 954 + return !!(pgd_raw(pgd) & cpu_to_be64(_PAGE_PRESENT)); 955 955 } 956 956 957 957 static inline pte_t pgd_pte(pgd_t pgd)
+14
arch/x86/events/core.c
··· 2278 2278 x86_pmu.check_microcode(); 2279 2279 } 2280 2280 2281 + static int x86_pmu_check_period(struct perf_event *event, u64 value) 2282 + { 2283 + if (x86_pmu.check_period && x86_pmu.check_period(event, value)) 2284 + return -EINVAL; 2285 + 2286 + if (value && x86_pmu.limit_period) { 2287 + if (x86_pmu.limit_period(event, value) > value) 2288 + return -EINVAL; 2289 + } 2290 + 2291 + return 0; 2292 + } 2293 + 2281 2294 static struct pmu pmu = { 2282 2295 .pmu_enable = x86_pmu_enable, 2283 2296 .pmu_disable = x86_pmu_disable, ··· 2315 2302 .event_idx = x86_pmu_event_idx, 2316 2303 .sched_task = x86_pmu_sched_task, 2317 2304 .task_ctx_size = sizeof(struct x86_perf_task_context), 2305 + .check_period = x86_pmu_check_period, 2318 2306 }; 2319 2307 2320 2308 void arch_perf_update_userpage(struct perf_event *event,
+9
arch/x86/events/intel/core.c
··· 3587 3587 intel_pmu_lbr_sched_task(ctx, sched_in); 3588 3588 } 3589 3589 3590 + static int intel_pmu_check_period(struct perf_event *event, u64 value) 3591 + { 3592 + return intel_pmu_has_bts_period(event, value) ? -EINVAL : 0; 3593 + } 3594 + 3590 3595 PMU_FORMAT_ATTR(offcore_rsp, "config1:0-63"); 3591 3596 3592 3597 PMU_FORMAT_ATTR(ldlat, "config1:0-15"); ··· 3672 3667 .cpu_starting = intel_pmu_cpu_starting, 3673 3668 .cpu_dying = intel_pmu_cpu_dying, 3674 3669 .cpu_dead = intel_pmu_cpu_dead, 3670 + 3671 + .check_period = intel_pmu_check_period, 3675 3672 }; 3676 3673 3677 3674 static struct attribute *intel_pmu_attrs[]; ··· 3718 3711 3719 3712 .guest_get_msrs = intel_guest_get_msrs, 3720 3713 .sched_task = intel_pmu_sched_task, 3714 + 3715 + .check_period = intel_pmu_check_period, 3721 3716 }; 3722 3717 3723 3718 static __init void intel_clovertown_quirk(void)
+14 -2
arch/x86/events/perf_event.h
··· 646 646 * Intel host/guest support (KVM) 647 647 */ 648 648 struct perf_guest_switch_msr *(*guest_get_msrs)(int *nr); 649 + 650 + /* 651 + * Check period value for PERF_EVENT_IOC_PERIOD ioctl. 652 + */ 653 + int (*check_period) (struct perf_event *event, u64 period); 649 654 }; 650 655 651 656 struct x86_perf_task_context { ··· 862 857 863 858 #ifdef CONFIG_CPU_SUP_INTEL 864 859 865 - static inline bool intel_pmu_has_bts(struct perf_event *event) 860 + static inline bool intel_pmu_has_bts_period(struct perf_event *event, u64 period) 866 861 { 867 862 struct hw_perf_event *hwc = &event->hw; 868 863 unsigned int hw_event, bts_event; ··· 873 868 hw_event = hwc->config & INTEL_ARCH_EVENT_MASK; 874 869 bts_event = x86_pmu.event_map(PERF_COUNT_HW_BRANCH_INSTRUCTIONS); 875 870 876 - return hw_event == bts_event && hwc->sample_period == 1; 871 + return hw_event == bts_event && period == 1; 872 + } 873 + 874 + static inline bool intel_pmu_has_bts(struct perf_event *event) 875 + { 876 + struct hw_perf_event *hwc = &event->hw; 877 + 878 + return intel_pmu_has_bts_period(event, hwc->sample_period); 877 879 } 878 880 879 881 int intel_pmu_save_and_restart(struct perf_event *event);
+4 -2
arch/x86/ia32/ia32_aout.c
··· 51 51 /* 52 52 * fill in the user structure for a core dump.. 53 53 */ 54 - static void dump_thread32(struct pt_regs *regs, struct user32 *dump) 54 + static void fill_dump(struct pt_regs *regs, struct user32 *dump) 55 55 { 56 56 u32 fs, gs; 57 57 memset(dump, 0, sizeof(*dump)); ··· 157 157 fs = get_fs(); 158 158 set_fs(KERNEL_DS); 159 159 has_dumped = 1; 160 + 161 + fill_dump(cprm->regs, &dump); 162 + 160 163 strncpy(dump.u_comm, current->comm, sizeof(current->comm)); 161 164 dump.u_ar0 = offsetof(struct user32, regs); 162 165 dump.signal = cprm->siginfo->si_signo; 163 - dump_thread32(cprm->regs, &dump); 164 166 165 167 /* 166 168 * If the size of the dump file exceeds the rlimit, then see
+2
arch/x86/include/asm/intel-family.h
··· 52 52 53 53 #define INTEL_FAM6_CANNONLAKE_MOBILE 0x66 54 54 55 + #define INTEL_FAM6_ICELAKE_MOBILE 0x7E 56 + 55 57 /* "Small Core" Processors (Atom) */ 56 58 57 59 #define INTEL_FAM6_ATOM_BONNELL 0x1C /* Diamondville, Pineview */
+7 -1
arch/x86/include/asm/uv/bios.h
··· 48 48 BIOS_STATUS_SUCCESS = 0, 49 49 BIOS_STATUS_UNIMPLEMENTED = -ENOSYS, 50 50 BIOS_STATUS_EINVAL = -EINVAL, 51 - BIOS_STATUS_UNAVAIL = -EBUSY 51 + BIOS_STATUS_UNAVAIL = -EBUSY, 52 + BIOS_STATUS_ABORT = -EINTR, 52 53 }; 53 54 54 55 /* Address map parameters */ ··· 167 166 #define uv_partition_coherence_id() (sn_coherency_id) 168 167 169 168 extern struct kobject *sgi_uv_kobj; /* /sys/firmware/sgi_uv */ 169 + 170 + /* 171 + * EFI runtime lock; cf. firmware/efi/runtime-wrappers.c for details 172 + */ 173 + extern struct semaphore __efi_uv_runtime_lock; 170 174 171 175 #endif /* _ASM_X86_UV_BIOS_H */
+9 -3
arch/x86/kvm/vmx/nested.c
··· 2473 2473 (nested_cpu_has_vpid(vmcs12) && !vmcs12->virtual_processor_id)) 2474 2474 return -EINVAL; 2475 2475 2476 + if (!nested_cpu_has_preemption_timer(vmcs12) && 2477 + nested_cpu_has_save_preemption_timer(vmcs12)) 2478 + return -EINVAL; 2479 + 2476 2480 if (nested_cpu_has_ept(vmcs12) && 2477 2481 !valid_ept_address(vcpu, vmcs12->ept_pointer)) 2478 2482 return -EINVAL; ··· 5561 5557 * secondary cpu-based controls. Do not include those that 5562 5558 * depend on CPUID bits, they are added later by vmx_cpuid_update. 5563 5559 */ 5564 - rdmsr(MSR_IA32_VMX_PROCBASED_CTLS2, 5565 - msrs->secondary_ctls_low, 5566 - msrs->secondary_ctls_high); 5560 + if (msrs->procbased_ctls_high & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS) 5561 + rdmsr(MSR_IA32_VMX_PROCBASED_CTLS2, 5562 + msrs->secondary_ctls_low, 5563 + msrs->secondary_ctls_high); 5564 + 5567 5565 msrs->secondary_ctls_low = 0; 5568 5566 msrs->secondary_ctls_high &= 5569 5567 SECONDARY_EXEC_DESC |
+13 -16
arch/x86/kvm/vmx/vmx.c
··· 863 863 if (!entry_only) 864 864 j = find_msr(&m->host, msr); 865 865 866 - if (i == NR_AUTOLOAD_MSRS || j == NR_AUTOLOAD_MSRS) { 866 + if ((i < 0 && m->guest.nr == NR_AUTOLOAD_MSRS) || 867 + (j < 0 && m->host.nr == NR_AUTOLOAD_MSRS)) { 867 868 printk_once(KERN_WARNING "Not enough msr switch entries. " 868 869 "Can't add msr %x\n", msr); 869 870 return; ··· 1194 1193 if (!pi_test_sn(pi_desc) && vcpu->cpu == cpu) 1195 1194 return; 1196 1195 1197 - /* 1198 - * First handle the simple case where no cmpxchg is necessary; just 1199 - * allow posting non-urgent interrupts. 1200 - * 1201 - * If the 'nv' field is POSTED_INTR_WAKEUP_VECTOR, do not change 1202 - * PI.NDST: pi_post_block will do it for us and the wakeup_handler 1203 - * expects the VCPU to be on the blocked_vcpu_list that matches 1204 - * PI.NDST. 1205 - */ 1206 - if (pi_desc->nv == POSTED_INTR_WAKEUP_VECTOR || 1207 - vcpu->cpu == cpu) { 1208 - pi_clear_sn(pi_desc); 1209 - return; 1210 - } 1211 - 1212 1196 /* The full case. */ 1213 1197 do { 1214 1198 old.control = new.control = pi_desc->control; ··· 1208 1222 new.sn = 0; 1209 1223 } while (cmpxchg64(&pi_desc->control, old.control, 1210 1224 new.control) != old.control); 1225 + 1226 + /* 1227 + * Clear SN before reading the bitmap. The VT-d firmware 1228 + * writes the bitmap and reads SN atomically (5.2.3 in the 1229 + * spec), so it doesn't really have a memory barrier that 1230 + * pairs with this, but we cannot do that and we need one. 1231 + */ 1232 + smp_mb__after_atomic(); 1233 + 1234 + if (!bitmap_empty((unsigned long *)pi_desc->pir, NR_VECTORS)) 1235 + pi_set_on(pi_desc); 1211 1236 } 1212 1237 1213 1238 /*
+6 -6
arch/x86/kvm/vmx/vmx.h
··· 337 337 return test_and_set_bit(vector, (unsigned long *)pi_desc->pir); 338 338 } 339 339 340 - static inline void pi_clear_sn(struct pi_desc *pi_desc) 341 - { 342 - return clear_bit(POSTED_INTR_SN, 343 - (unsigned long *)&pi_desc->control); 344 - } 345 - 346 340 static inline void pi_set_sn(struct pi_desc *pi_desc) 347 341 { 348 342 return set_bit(POSTED_INTR_SN, 349 343 (unsigned long *)&pi_desc->control); 344 + } 345 + 346 + static inline void pi_set_on(struct pi_desc *pi_desc) 347 + { 348 + set_bit(POSTED_INTR_ON, 349 + (unsigned long *)&pi_desc->control); 350 350 } 351 351 352 352 static inline void pi_clear_on(struct pi_desc *pi_desc)
+1 -1
arch/x86/kvm/x86.c
··· 7801 7801 * 1) We should set ->mode before checking ->requests. Please see 7802 7802 * the comment in kvm_vcpu_exiting_guest_mode(). 7803 7803 * 7804 - * 2) For APICv, we should set ->mode before checking PIR.ON. This 7804 + * 2) For APICv, we should set ->mode before checking PID.ON. This 7805 7805 * pairs with the memory barrier implicit in pi_test_and_set_on 7806 7806 * (see vmx_deliver_posted_interrupt). 7807 7807 *
+21 -2
arch/x86/platform/uv/bios_uv.c
··· 29 29 30 30 struct uv_systab *uv_systab; 31 31 32 - s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5) 32 + static s64 __uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, 33 + u64 a4, u64 a5) 33 34 { 34 35 struct uv_systab *tab = uv_systab; 35 36 s64 ret; ··· 52 51 53 52 return ret; 54 53 } 54 + 55 + s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5) 56 + { 57 + s64 ret; 58 + 59 + if (down_interruptible(&__efi_uv_runtime_lock)) 60 + return BIOS_STATUS_ABORT; 61 + 62 + ret = __uv_bios_call(which, a1, a2, a3, a4, a5); 63 + up(&__efi_uv_runtime_lock); 64 + 65 + return ret; 66 + } 55 67 EXPORT_SYMBOL_GPL(uv_bios_call); 56 68 57 69 s64 uv_bios_call_irqsave(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, ··· 73 59 unsigned long bios_flags; 74 60 s64 ret; 75 61 62 + if (down_interruptible(&__efi_uv_runtime_lock)) 63 + return BIOS_STATUS_ABORT; 64 + 76 65 local_irq_save(bios_flags); 77 - ret = uv_bios_call(which, a1, a2, a3, a4, a5); 66 + ret = __uv_bios_call(which, a1, a2, a3, a4, a5); 78 67 local_irq_restore(bios_flags); 68 + 69 + up(&__efi_uv_runtime_lock); 79 70 80 71 return ret; 81 72 }
+3 -1
crypto/af_alg.c
··· 122 122 123 123 int af_alg_release(struct socket *sock) 124 124 { 125 - if (sock->sk) 125 + if (sock->sk) { 126 126 sock_put(sock->sk); 127 + sock->sk = NULL; 128 + } 127 129 return 0; 128 130 } 129 131 EXPORT_SYMBOL_GPL(af_alg_release);
+1 -1
drivers/auxdisplay/ht16k33.c
··· 509 509 struct ht16k33_priv *priv = i2c_get_clientdata(client); 510 510 struct ht16k33_fbdev *fbdev = &priv->fbdev; 511 511 512 - cancel_delayed_work(&fbdev->work); 512 + cancel_delayed_work_sync(&fbdev->work); 513 513 unregister_framebuffer(fbdev->info); 514 514 framebuffer_release(fbdev->info); 515 515 free_page((unsigned long) fbdev->buffer);
+3 -3
drivers/bus/ti-sysc.c
··· 781 781 SYSC_QUIRK("smartreflex", 0, -1, 0x38, -1, 0x00000000, 0xffffffff, 782 782 SYSC_QUIRK_LEGACY_IDLE), 783 783 SYSC_QUIRK("timer", 0, 0, 0x10, 0x14, 0x00000015, 0xffffffff, 784 - SYSC_QUIRK_LEGACY_IDLE), 784 + 0), 785 785 /* Some timers on omap4 and later */ 786 786 SYSC_QUIRK("timer", 0, 0, 0x10, -1, 0x50002100, 0xffffffff, 787 - SYSC_QUIRK_LEGACY_IDLE), 787 + 0), 788 788 SYSC_QUIRK("timer", 0, 0, 0x10, -1, 0x4fff1301, 0xffff00ff, 789 - SYSC_QUIRK_LEGACY_IDLE), 789 + 0), 790 790 SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x00000052, 0xffffffff, 791 791 SYSC_QUIRK_LEGACY_IDLE), 792 792 /* Uarts on omap4 and later */
+4 -1
drivers/clocksource/timer-ti-dm.c
··· 154 154 if (IS_ERR(parent)) 155 155 return -ENODEV; 156 156 157 + /* Bail out if both clocks point to fck */ 158 + if (clk_is_match(parent, timer->fclk)) 159 + return 0; 160 + 157 161 ret = clk_set_parent(timer->fclk, parent); 158 162 if (ret < 0) 159 163 pr_err("%s: failed to set parent\n", __func__); ··· 868 864 timer->pdev = pdev; 869 865 870 866 pm_runtime_enable(dev); 871 - pm_runtime_irq_safe(dev); 872 867 873 868 if (!timer->reserved) { 874 869 ret = pm_runtime_get_sync(dev);
-4
drivers/firmware/efi/efi.c
··· 592 592 593 593 early_memunmap(tbl, sizeof(*tbl)); 594 594 } 595 - return 0; 596 - } 597 595 598 - int __init efi_apply_persistent_mem_reservations(void) 599 - { 600 596 if (efi.mem_reserve != EFI_INVALID_TABLE_ADDR) { 601 597 unsigned long prsv = efi.mem_reserve; 602 598
-3
drivers/firmware/efi/libstub/arm-stub.c
··· 75 75 efi_guid_t memreserve_table_guid = LINUX_EFI_MEMRESERVE_TABLE_GUID; 76 76 efi_status_t status; 77 77 78 - if (IS_ENABLED(CONFIG_ARM)) 79 - return; 80 - 81 78 status = efi_call_early(allocate_pool, EFI_LOADER_DATA, sizeof(*rsv), 82 79 (void **)&rsv); 83 80 if (status != EFI_SUCCESS) {
+7
drivers/firmware/efi/runtime-wrappers.c
··· 147 147 static DEFINE_SEMAPHORE(efi_runtime_lock); 148 148 149 149 /* 150 + * Expose the EFI runtime lock to the UV platform 151 + */ 152 + #ifdef CONFIG_X86_UV 153 + extern struct semaphore __efi_uv_runtime_lock __alias(efi_runtime_lock); 154 + #endif 155 + 156 + /* 150 157 * Calls the appropriate efi_runtime_service() with the appropriate 151 158 * arguments. 152 159 *
+12
drivers/i2c/busses/i2c-bcm2835.c
··· 183 183 bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, c); 184 184 } 185 185 186 + static void bcm2835_i2c_finish_transfer(struct bcm2835_i2c_dev *i2c_dev) 187 + { 188 + i2c_dev->curr_msg = NULL; 189 + i2c_dev->num_msgs = 0; 190 + 191 + i2c_dev->msg_buf = NULL; 192 + i2c_dev->msg_buf_remaining = 0; 193 + } 194 + 186 195 /* 187 196 * Note about I2C_C_CLEAR on error: 188 197 * The I2C_C_CLEAR on errors will take some time to resolve -- if you were in ··· 292 283 293 284 time_left = wait_for_completion_timeout(&i2c_dev->completion, 294 285 adap->timeout); 286 + 287 + bcm2835_i2c_finish_transfer(i2c_dev); 288 + 295 289 if (!time_left) { 296 290 bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, 297 291 BCM2835_I2C_C_CLEAR);
+7 -2
drivers/i2c/busses/i2c-cadence.c
··· 382 382 * Check for the message size against FIFO depth and set the 383 383 * 'hold bus' bit if it is greater than FIFO depth. 384 384 */ 385 - if (id->recv_count > CDNS_I2C_FIFO_DEPTH) 385 + if ((id->recv_count > CDNS_I2C_FIFO_DEPTH) || id->bus_hold_flag) 386 386 ctrl_reg |= CDNS_I2C_CR_HOLD; 387 + else 388 + ctrl_reg = ctrl_reg & ~CDNS_I2C_CR_HOLD; 387 389 388 390 cdns_i2c_writereg(ctrl_reg, CDNS_I2C_CR_OFFSET); 389 391 ··· 442 440 * Check for the message size against FIFO depth and set the 443 441 * 'hold bus' bit if it is greater than FIFO depth. 444 442 */ 445 - if (id->send_count > CDNS_I2C_FIFO_DEPTH) 443 + if ((id->send_count > CDNS_I2C_FIFO_DEPTH) || id->bus_hold_flag) 446 444 ctrl_reg |= CDNS_I2C_CR_HOLD; 445 + else 446 + ctrl_reg = ctrl_reg & ~CDNS_I2C_CR_HOLD; 447 + 447 448 cdns_i2c_writereg(ctrl_reg, CDNS_I2C_CR_OFFSET); 448 449 449 450 /* Clear the interrupts in interrupt status register. */
+1 -1
drivers/input/keyboard/Kconfig
··· 420 420 421 421 config KEYBOARD_SNVS_PWRKEY 422 422 tristate "IMX SNVS Power Key Driver" 423 - depends on SOC_IMX6SX 423 + depends on SOC_IMX6SX || SOC_IMX7D 424 424 depends on OF 425 425 help 426 426 This is the snvs powerkey driver for the Freescale i.MX application
+13 -26
drivers/input/keyboard/cap11xx.c
··· 75 75 struct cap11xx_led { 76 76 struct cap11xx_priv *priv; 77 77 struct led_classdev cdev; 78 - struct work_struct work; 79 78 u32 reg; 80 - enum led_brightness new_brightness; 81 79 }; 82 80 #endif 83 81 ··· 231 233 } 232 234 233 235 #ifdef CONFIG_LEDS_CLASS 234 - static void cap11xx_led_work(struct work_struct *work) 235 - { 236 - struct cap11xx_led *led = container_of(work, struct cap11xx_led, work); 237 - struct cap11xx_priv *priv = led->priv; 238 - int value = led->new_brightness; 239 - 240 - /* 241 - * All LEDs share the same duty cycle as this is a HW limitation. 242 - * Brightness levels per LED are either 0 (OFF) and 1 (ON). 243 - */ 244 - regmap_update_bits(priv->regmap, CAP11XX_REG_LED_OUTPUT_CONTROL, 245 - BIT(led->reg), value ? BIT(led->reg) : 0); 246 - } 247 - 248 - static void cap11xx_led_set(struct led_classdev *cdev, 249 - enum led_brightness value) 236 + static int cap11xx_led_set(struct led_classdev *cdev, 237 + enum led_brightness value) 250 238 { 251 239 struct cap11xx_led *led = container_of(cdev, struct cap11xx_led, cdev); 240 + struct cap11xx_priv *priv = led->priv; 252 241 253 - if (led->new_brightness == value) 254 - return; 255 - 256 - led->new_brightness = value; 257 - schedule_work(&led->work); 242 + /* 243 + * All LEDs share the same duty cycle as this is a HW 244 + * limitation. Brightness levels per LED are either 245 + * 0 (OFF) and 1 (ON). 246 + */ 247 + return regmap_update_bits(priv->regmap, 248 + CAP11XX_REG_LED_OUTPUT_CONTROL, 249 + BIT(led->reg), 250 + value ? BIT(led->reg) : 0); 258 251 } 259 252 260 253 static int cap11xx_init_leds(struct device *dev, ··· 288 299 led->cdev.default_trigger = 289 300 of_get_property(child, "linux,default-trigger", NULL); 290 301 led->cdev.flags = 0; 291 - led->cdev.brightness_set = cap11xx_led_set; 302 + led->cdev.brightness_set_blocking = cap11xx_led_set; 292 303 led->cdev.max_brightness = 1; 293 304 led->cdev.brightness = LED_OFF; 294 305 ··· 300 311 301 312 led->reg = reg; 302 313 led->priv = priv; 303 - 304 - INIT_WORK(&led->work, cap11xx_led_work); 305 314 306 315 error = devm_led_classdev_register(dev, &led->cdev); 307 316 if (error) {
+1 -1
drivers/input/keyboard/matrix_keypad.c
··· 222 222 keypad->stopped = true; 223 223 spin_unlock_irq(&keypad->lock); 224 224 225 - flush_work(&keypad->work.work); 225 + flush_delayed_work(&keypad->work); 226 226 /* 227 227 * matrix_keypad_scan() will leave IRQs enabled; 228 228 * we should disable them now.
+33 -48
drivers/input/keyboard/qt2160.c
··· 58 58 struct qt2160_led { 59 59 struct qt2160_data *qt2160; 60 60 struct led_classdev cdev; 61 - struct work_struct work; 62 61 char name[32]; 63 62 int id; 64 - enum led_brightness new_brightness; 63 + enum led_brightness brightness; 65 64 }; 66 65 #endif 67 66 ··· 73 74 u16 key_matrix; 74 75 #ifdef CONFIG_LEDS_CLASS 75 76 struct qt2160_led leds[QT2160_NUM_LEDS_X]; 76 - struct mutex led_lock; 77 77 #endif 78 78 }; 79 79 ··· 81 83 82 84 #ifdef CONFIG_LEDS_CLASS 83 85 84 - static void qt2160_led_work(struct work_struct *work) 85 - { 86 - struct qt2160_led *led = container_of(work, struct qt2160_led, work); 87 - struct qt2160_data *qt2160 = led->qt2160; 88 - struct i2c_client *client = qt2160->client; 89 - int value = led->new_brightness; 90 - u32 drive, pwmen; 91 - 92 - mutex_lock(&qt2160->led_lock); 93 - 94 - drive = qt2160_read(client, QT2160_CMD_DRIVE_X); 95 - pwmen = qt2160_read(client, QT2160_CMD_PWMEN_X); 96 - if (value != LED_OFF) { 97 - drive |= (1 << led->id); 98 - pwmen |= (1 << led->id); 99 - 100 - } else { 101 - drive &= ~(1 << led->id); 102 - pwmen &= ~(1 << led->id); 103 - } 104 - qt2160_write(client, QT2160_CMD_DRIVE_X, drive); 105 - qt2160_write(client, QT2160_CMD_PWMEN_X, pwmen); 106 - 107 - /* 108 - * Changing this register will change the brightness 109 - * of every LED in the qt2160. It's a HW limitation. 110 - */ 111 - if (value != LED_OFF) 112 - qt2160_write(client, QT2160_CMD_PWM_DUTY, value); 113 - 114 - mutex_unlock(&qt2160->led_lock); 115 - } 116 - 117 - static void qt2160_led_set(struct led_classdev *cdev, 118 - enum led_brightness value) 86 + static int qt2160_led_set(struct led_classdev *cdev, 87 + enum led_brightness value) 119 88 { 120 89 struct qt2160_led *led = container_of(cdev, struct qt2160_led, cdev); 90 + struct qt2160_data *qt2160 = led->qt2160; 91 + struct i2c_client *client = qt2160->client; 92 + u32 drive, pwmen; 121 93 122 - led->new_brightness = value; 123 - schedule_work(&led->work); 94 + if (value != led->brightness) { 95 + drive = qt2160_read(client, QT2160_CMD_DRIVE_X); 96 + pwmen = qt2160_read(client, QT2160_CMD_PWMEN_X); 97 + if (value != LED_OFF) { 98 + drive |= BIT(led->id); 99 + pwmen |= BIT(led->id); 100 + 101 + } else { 102 + drive &= ~BIT(led->id); 103 + pwmen &= ~BIT(led->id); 104 + } 105 + qt2160_write(client, QT2160_CMD_DRIVE_X, drive); 106 + qt2160_write(client, QT2160_CMD_PWMEN_X, pwmen); 107 + 108 + /* 109 + * Changing this register will change the brightness 110 + * of every LED in the qt2160. It's a HW limitation. 111 + */ 112 + if (value != LED_OFF) 113 + qt2160_write(client, QT2160_CMD_PWM_DUTY, value); 114 + 115 + led->brightness = value; 116 + } 117 + 118 + return 0; 124 119 } 125 120 126 121 #endif /* CONFIG_LEDS_CLASS */ ··· 284 293 int ret; 285 294 int i; 286 295 287 - mutex_init(&qt2160->led_lock); 288 - 289 296 for (i = 0; i < QT2160_NUM_LEDS_X; i++) { 290 297 struct qt2160_led *led = &qt2160->leds[i]; 291 298 292 299 snprintf(led->name, sizeof(led->name), "qt2160:x%d", i); 293 300 led->cdev.name = led->name; 294 - led->cdev.brightness_set = qt2160_led_set; 301 + led->cdev.brightness_set_blocking = qt2160_led_set; 295 302 led->cdev.brightness = LED_OFF; 296 303 led->id = i; 297 304 led->qt2160 = qt2160; 298 - 299 - INIT_WORK(&led->work, qt2160_led_work); 300 305 301 306 ret = led_classdev_register(&client->dev, &led->cdev); 302 307 if (ret < 0) ··· 311 324 { 312 325 int i; 313 326 314 - for (i = 0; i < QT2160_NUM_LEDS_X; i++) { 327 + for (i = 0; i < QT2160_NUM_LEDS_X; i++) 315 328 led_classdev_unregister(&qt2160->leds[i].cdev); 316 - cancel_work_sync(&qt2160->leds[i].work); 317 - } 318 329 } 319 330 320 331 #else
+2 -2
drivers/input/keyboard/st-keyscan.c
··· 153 153 154 154 input_dev->id.bustype = BUS_HOST; 155 155 156 + keypad_data->input_dev = input_dev; 157 + 156 158 error = keypad_matrix_key_parse_dt(keypad_data); 157 159 if (error) 158 160 return error; ··· 169 167 } 170 168 171 169 input_set_drvdata(input_dev, keypad_data); 172 - 173 - keypad_data->input_dev = input_dev; 174 170 175 171 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 176 172 keypad_data->base = devm_ioremap_resource(&pdev->dev, res);
+4 -20
drivers/input/misc/apanel.c
··· 22 22 #include <linux/io.h> 23 23 #include <linux/input-polldev.h> 24 24 #include <linux/i2c.h> 25 - #include <linux/workqueue.h> 26 25 #include <linux/leds.h> 27 26 28 27 #define APANEL_NAME "Fujitsu Application Panel" ··· 58 59 struct i2c_client *client; 59 60 unsigned short keymap[MAX_PANEL_KEYS]; 60 61 u16 nkeys; 61 - u16 led_bits; 62 - struct work_struct led_work; 63 62 struct led_classdev mail_led; 64 63 }; 65 64 ··· 106 109 report_key(idev, ap->keymap[i]); 107 110 } 108 111 109 - /* Track state changes of LED */ 110 - static void led_update(struct work_struct *work) 111 - { 112 - struct apanel *ap = container_of(work, struct apanel, led_work); 113 - 114 - i2c_smbus_write_word_data(ap->client, 0x10, ap->led_bits); 115 - } 116 - 117 - static void mail_led_set(struct led_classdev *led, 112 + static int mail_led_set(struct led_classdev *led, 118 113 enum led_brightness value) 119 114 { 120 115 struct apanel *ap = container_of(led, struct apanel, mail_led); 116 + u16 led_bits = value != LED_OFF ? 0x8000 : 0x0000; 121 117 122 - if (value != LED_OFF) 123 - ap->led_bits |= 0x8000; 124 - else 125 - ap->led_bits &= ~0x8000; 126 - 127 - schedule_work(&ap->led_work); 118 + return i2c_smbus_write_word_data(ap->client, 0x10, led_bits); 128 119 } 129 120 130 121 static int apanel_remove(struct i2c_client *client) ··· 164 179 }, 165 180 .mail_led = { 166 181 .name = "mail:blue", 167 - .brightness_set = mail_led_set, 182 + .brightness_set_blocking = mail_led_set, 168 183 }, 169 184 }; 170 185 ··· 220 235 if (err) 221 236 goto out3; 222 237 223 - INIT_WORK(&ap->led_work, led_update); 224 238 if (device_chip[APANEL_DEV_LED] != CHIP_NONE) { 225 239 err = led_classdev_register(&client->dev, &ap->mail_led); 226 240 if (err)
+5 -4
drivers/input/misc/bma150.c
··· 481 481 idev->close = bma150_irq_close; 482 482 input_set_drvdata(idev, bma150); 483 483 484 + bma150->input = idev; 485 + 484 486 error = input_register_device(idev); 485 487 if (error) { 486 488 input_free_device(idev); 487 489 return error; 488 490 } 489 491 490 - bma150->input = idev; 491 492 return 0; 492 493 } 493 494 ··· 511 510 512 511 bma150_init_input_device(bma150, ipoll_dev->input); 513 512 513 + bma150->input_polled = ipoll_dev; 514 + bma150->input = ipoll_dev->input; 515 + 514 516 error = input_register_polled_device(ipoll_dev); 515 517 if (error) { 516 518 input_free_polled_device(ipoll_dev); 517 519 return error; 518 520 } 519 - 520 - bma150->input_polled = ipoll_dev; 521 - bma150->input = ipoll_dev->input; 522 521 523 522 return 0; 524 523 }
+13 -6
drivers/input/misc/pwm-vibra.c
··· 34 34 struct work_struct play_work; 35 35 u16 level; 36 36 u32 direction_duty_cycle; 37 + bool vcc_on; 37 38 }; 38 39 39 40 static int pwm_vibrator_start(struct pwm_vibrator *vibrator) ··· 43 42 struct pwm_state state; 44 43 int err; 45 44 46 - err = regulator_enable(vibrator->vcc); 47 - if (err) { 48 - dev_err(pdev, "failed to enable regulator: %d", err); 49 - return err; 45 + if (!vibrator->vcc_on) { 46 + err = regulator_enable(vibrator->vcc); 47 + if (err) { 48 + dev_err(pdev, "failed to enable regulator: %d", err); 49 + return err; 50 + } 51 + vibrator->vcc_on = true; 50 52 } 51 53 52 54 pwm_get_state(vibrator->pwm, &state); ··· 80 76 81 77 static void pwm_vibrator_stop(struct pwm_vibrator *vibrator) 82 78 { 83 - regulator_disable(vibrator->vcc); 84 - 85 79 if (vibrator->pwm_dir) 86 80 pwm_disable(vibrator->pwm_dir); 87 81 pwm_disable(vibrator->pwm); 82 + 83 + if (vibrator->vcc_on) { 84 + regulator_disable(vibrator->vcc); 85 + vibrator->vcc_on = false; 86 + } 88 87 } 89 88 90 89 static void pwm_vibrator_play_work(struct work_struct *work)
+1 -1
drivers/input/mouse/elan_i2c_core.c
··· 1336 1336 static const struct acpi_device_id elan_acpi_id[] = { 1337 1337 { "ELAN0000", 0 }, 1338 1338 { "ELAN0100", 0 }, 1339 - { "ELAN0501", 0 }, 1340 1339 { "ELAN0600", 0 }, 1341 1340 { "ELAN0602", 0 }, 1342 1341 { "ELAN0605", 0 }, ··· 1345 1346 { "ELAN060C", 0 }, 1346 1347 { "ELAN0611", 0 }, 1347 1348 { "ELAN0612", 0 }, 1349 + { "ELAN0617", 0 }, 1348 1350 { "ELAN0618", 0 }, 1349 1351 { "ELAN061C", 0 }, 1350 1352 { "ELAN061D", 0 },
+9
drivers/input/mouse/elantech.c
··· 1119 1119 * Asus UX31 0x361f00 20, 15, 0e clickpad 1120 1120 * Asus UX32VD 0x361f02 00, 15, 0e clickpad 1121 1121 * Avatar AVIU-145A2 0x361f00 ? clickpad 1122 + * Fujitsu CELSIUS H760 0x570f02 40, 14, 0c 3 hw buttons (**) 1123 + * Fujitsu CELSIUS H780 0x5d0f02 41, 16, 0d 3 hw buttons (**) 1122 1124 * Fujitsu LIFEBOOK E544 0x470f00 d0, 12, 09 2 hw buttons 1123 1125 * Fujitsu LIFEBOOK E546 0x470f00 50, 12, 09 2 hw buttons 1124 1126 * Fujitsu LIFEBOOK E547 0x470f00 50, 12, 09 2 hw buttons ··· 1171 1169 .matches = { 1172 1170 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 1173 1171 DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS H760"), 1172 + }, 1173 + }, 1174 + { 1175 + /* Fujitsu H780 also has a middle button */ 1176 + .matches = { 1177 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 1178 + DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS H780"), 1174 1179 }, 1175 1180 }, 1176 1181 #endif
+1
drivers/input/serio/ps2-gpio.c
··· 76 76 { 77 77 struct ps2_gpio_data *drvdata = serio->port_data; 78 78 79 + flush_delayed_work(&drvdata->tx_work); 79 80 disable_irq(drvdata->irq); 80 81 } 81 82
+2 -2
drivers/mailbox/bcm-flexrm-mailbox.c
··· 1396 1396 1397 1397 /* Clear ring flush state */ 1398 1398 timeout = 1000; /* timeout of 1s */ 1399 - writel_relaxed(0x0, ring + RING_CONTROL); 1399 + writel_relaxed(0x0, ring->regs + RING_CONTROL); 1400 1400 do { 1401 - if (!(readl_relaxed(ring + RING_FLUSH_DONE) & 1401 + if (!(readl_relaxed(ring->regs + RING_FLUSH_DONE) & 1402 1402 FLUSH_DONE_MASK)) 1403 1403 break; 1404 1404 mdelay(1);
+1
drivers/mailbox/mailbox.c
··· 310 310 311 311 return ret; 312 312 } 313 + EXPORT_SYMBOL_GPL(mbox_flush); 313 314 314 315 /** 315 316 * mbox_request_channel - Request a mailbox channel.
+71 -19
drivers/net/dsa/b53/b53_common.c
··· 344 344 b53_write8(dev, B53_CTRL_PAGE, B53_SWITCH_CTRL, mgmt); 345 345 } 346 346 347 - static void b53_enable_vlan(struct b53_device *dev, bool enable) 347 + static void b53_enable_vlan(struct b53_device *dev, bool enable, 348 + bool enable_filtering) 348 349 { 349 350 u8 mgmt, vc0, vc1, vc4 = 0, vc5; 350 351 ··· 370 369 vc0 |= VC0_VLAN_EN | VC0_VID_CHK_EN | VC0_VID_HASH_VID; 371 370 vc1 |= VC1_RX_MCST_UNTAG_EN | VC1_RX_MCST_FWD_EN; 372 371 vc4 &= ~VC4_ING_VID_CHECK_MASK; 373 - vc4 |= VC4_ING_VID_VIO_DROP << VC4_ING_VID_CHECK_S; 374 - vc5 |= VC5_DROP_VTABLE_MISS; 372 + if (enable_filtering) { 373 + vc4 |= VC4_ING_VID_VIO_DROP << VC4_ING_VID_CHECK_S; 374 + vc5 |= VC5_DROP_VTABLE_MISS; 375 + } else { 376 + vc4 |= VC4_ING_VID_VIO_FWD << VC4_ING_VID_CHECK_S; 377 + vc5 &= ~VC5_DROP_VTABLE_MISS; 378 + } 375 379 376 380 if (is5325(dev)) 377 381 vc0 &= ~VC0_RESERVED_1; ··· 426 420 } 427 421 428 422 b53_write8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, mgmt); 423 + 424 + dev->vlan_enabled = enable; 425 + dev->vlan_filtering_enabled = enable_filtering; 429 426 } 430 427 431 428 static int b53_set_jumbo(struct b53_device *dev, bool enable, bool allow_10_100) ··· 641 632 b53_write8(dev, B53_MGMT_PAGE, B53_GLOBAL_CONFIG, gc); 642 633 } 643 634 635 + static u16 b53_default_pvid(struct b53_device *dev) 636 + { 637 + if (is5325(dev) || is5365(dev)) 638 + return 1; 639 + else 640 + return 0; 641 + } 642 + 644 643 int b53_configure_vlan(struct dsa_switch *ds) 645 644 { 646 645 struct b53_device *dev = ds->priv; 647 646 struct b53_vlan vl = { 0 }; 648 - int i; 647 + int i, def_vid; 648 + 649 + def_vid = b53_default_pvid(dev); 649 650 650 651 /* clear all vlan entries */ 651 652 if (is5325(dev) || is5365(dev)) { 652 - for (i = 1; i < dev->num_vlans; i++) 653 + for (i = def_vid; i < dev->num_vlans; i++) 653 654 b53_set_vlan_entry(dev, i, &vl); 654 655 } else { 655 656 b53_do_vlan_op(dev, VTA_CMD_CLEAR); 656 657 } 657 658 658 - b53_enable_vlan(dev, false); 659 + b53_enable_vlan(dev, false, dev->vlan_filtering_enabled); 659 660 660 661 b53_for_each_port(dev, i) 661 662 b53_write16(dev, B53_VLAN_PAGE, 662 - B53_VLAN_PORT_DEF_TAG(i), 1); 663 + B53_VLAN_PORT_DEF_TAG(i), def_vid); 663 664 664 665 if (!is5325(dev) && !is5365(dev)) 665 666 b53_set_jumbo(dev, dev->enable_jumbo, false); ··· 1274 1255 1275 1256 int b53_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering) 1276 1257 { 1258 + struct b53_device *dev = ds->priv; 1259 + struct net_device *bridge_dev; 1260 + unsigned int i; 1261 + u16 pvid, new_pvid; 1262 + 1263 + /* Handle the case were multiple bridges span the same switch device 1264 + * and one of them has a different setting than what is being requested 1265 + * which would be breaking filtering semantics for any of the other 1266 + * bridge devices. 1267 + */ 1268 + b53_for_each_port(dev, i) { 1269 + bridge_dev = dsa_to_port(ds, i)->bridge_dev; 1270 + if (bridge_dev && 1271 + bridge_dev != dsa_to_port(ds, port)->bridge_dev && 1272 + br_vlan_enabled(bridge_dev) != vlan_filtering) { 1273 + netdev_err(bridge_dev, 1274 + "VLAN filtering is global to the switch!\n"); 1275 + return -EINVAL; 1276 + } 1277 + } 1278 + 1279 + b53_read16(dev, B53_VLAN_PAGE, B53_VLAN_PORT_DEF_TAG(port), &pvid); 1280 + new_pvid = pvid; 1281 + if (dev->vlan_filtering_enabled && !vlan_filtering) { 1282 + /* Filtering is currently enabled, use the default PVID since 1283 + * the bridge does not expect tagging anymore 1284 + */ 1285 + dev->ports[port].pvid = pvid; 1286 + new_pvid = b53_default_pvid(dev); 1287 + } else if (!dev->vlan_filtering_enabled && vlan_filtering) { 1288 + /* Filtering is currently disabled, restore the previous PVID */ 1289 + new_pvid = dev->ports[port].pvid; 1290 + } 1291 + 1292 + if (pvid != new_pvid) 1293 + b53_write16(dev, B53_VLAN_PAGE, B53_VLAN_PORT_DEF_TAG(port), 1294 + new_pvid); 1295 + 1296 + b53_enable_vlan(dev, dev->vlan_enabled, vlan_filtering); 1297 + 1277 1298 return 0; 1278 1299 } 1279 1300 EXPORT_SYMBOL(b53_vlan_filtering); ··· 1329 1270 if (vlan->vid_end > dev->num_vlans) 1330 1271 return -ERANGE; 1331 1272 1332 - b53_enable_vlan(dev, true); 1273 + b53_enable_vlan(dev, true, dev->vlan_filtering_enabled); 1333 1274 1334 1275 return 0; 1335 1276 } ··· 1359 1300 b53_fast_age_vlan(dev, vid); 1360 1301 } 1361 1302 1362 - if (pvid) { 1303 + if (pvid && !dsa_is_cpu_port(ds, port)) { 1363 1304 b53_write16(dev, B53_VLAN_PAGE, B53_VLAN_PORT_DEF_TAG(port), 1364 1305 vlan->vid_end); 1365 1306 b53_fast_age_vlan(dev, vid); ··· 1385 1326 1386 1327 vl->members &= ~BIT(port); 1387 1328 1388 - if (pvid == vid) { 1389 - if (is5325(dev) || is5365(dev)) 1390 - pvid = 1; 1391 - else 1392 - pvid = 0; 1393 - } 1329 + if (pvid == vid) 1330 + pvid = b53_default_pvid(dev); 1394 1331 1395 1332 if (untagged && !dsa_is_cpu_port(ds, port)) 1396 1333 vl->untag &= ~(BIT(port)); ··· 1699 1644 b53_write16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(port), pvlan); 1700 1645 dev->ports[port].vlan_ctl_mask = pvlan; 1701 1646 1702 - if (is5325(dev) || is5365(dev)) 1703 - pvid = 1; 1704 - else 1705 - pvid = 0; 1647 + pvid = b53_default_pvid(dev); 1706 1648 1707 1649 /* Make this port join all VLANs without VLAN entries */ 1708 1650 if (is58xx(dev)) {
+3
drivers/net/dsa/b53/b53_priv.h
··· 91 91 struct b53_port { 92 92 u16 vlan_ctl_mask; 93 93 struct ethtool_eee eee; 94 + u16 pvid; 94 95 }; 95 96 96 97 struct b53_vlan { ··· 138 137 139 138 unsigned int num_vlans; 140 139 struct b53_vlan *vlans; 140 + bool vlan_enabled; 141 + bool vlan_filtering_enabled; 141 142 unsigned int num_ports; 142 143 struct b53_port *ports; 143 144 };
+6 -4
drivers/net/dsa/bcm_sf2.c
··· 726 726 { 727 727 struct net_device *p = ds->ports[port].cpu_dp->master; 728 728 struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds); 729 - struct ethtool_wolinfo pwol; 729 + struct ethtool_wolinfo pwol = { }; 730 730 731 731 /* Get the parent device WoL settings */ 732 - p->ethtool_ops->get_wol(p, &pwol); 732 + if (p->ethtool_ops->get_wol) 733 + p->ethtool_ops->get_wol(p, &pwol); 733 734 734 735 /* Advertise the parent device supported settings */ 735 736 wol->supported = pwol.supported; ··· 751 750 struct net_device *p = ds->ports[port].cpu_dp->master; 752 751 struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds); 753 752 s8 cpu_port = ds->ports[port].cpu_dp->index; 754 - struct ethtool_wolinfo pwol; 753 + struct ethtool_wolinfo pwol = { }; 755 754 756 - p->ethtool_ops->get_wol(p, &pwol); 755 + if (p->ethtool_ops->get_wol) 756 + p->ethtool_ops->get_wol(p, &pwol); 757 757 if (wol->wolopts & ~pwol.supported) 758 758 return -EINVAL; 759 759
+4
drivers/net/ethernet/broadcom/bcmsysport.c
··· 134 134 135 135 priv->rx_chk_en = !!(wanted & NETIF_F_RXCSUM); 136 136 reg = rxchk_readl(priv, RXCHK_CONTROL); 137 + /* Clear L2 header checks, which would prevent BPDUs 138 + * from being received. 139 + */ 140 + reg &= ~RXCHK_L2_HDR_DIS; 137 141 if (priv->rx_chk_en) 138 142 reg |= RXCHK_EN; 139 143 else
+3
drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
··· 3128 3128 dsaf_set_bit(credit, DSAF_SBM_ROCEE_CFG_CRD_EN_B, 1); 3129 3129 dsaf_write_dev(dsaf_dev, DSAF_SBM_ROCEE_CFG_REG_REG, credit); 3130 3130 } 3131 + 3132 + put_device(&pdev->dev); 3133 + 3131 3134 return 0; 3132 3135 } 3133 3136 EXPORT_SYMBOL(hns_dsaf_roce_reset);
+6 -1
drivers/net/ethernet/marvell/mv643xx_eth.c
··· 2879 2879 2880 2880 ret = mv643xx_eth_shared_of_probe(pdev); 2881 2881 if (ret) 2882 - return ret; 2882 + goto err_put_clk; 2883 2883 pd = dev_get_platdata(&pdev->dev); 2884 2884 2885 2885 msp->tx_csum_limit = (pd != NULL && pd->tx_csum_limit) ? ··· 2887 2887 infer_hw_params(msp); 2888 2888 2889 2889 return 0; 2890 + 2891 + err_put_clk: 2892 + if (!IS_ERR(msp->clk)) 2893 + clk_disable_unprepare(msp->clk); 2894 + return ret; 2890 2895 } 2891 2896 2892 2897 static int mv643xx_eth_shared_remove(struct platform_device *pdev)
+1 -1
drivers/net/ethernet/marvell/sky2.c
··· 5073 5073 INIT_WORK(&hw->restart_work, sky2_restart); 5074 5074 5075 5075 pci_set_drvdata(pdev, hw); 5076 - pdev->d3_delay = 200; 5076 + pdev->d3_delay = 300; 5077 5077 5078 5078 return 0; 5079 5079
+1 -1
drivers/net/ethernet/mellanox/mlx4/en_netdev.c
··· 3360 3360 dev->addr_len = ETH_ALEN; 3361 3361 mlx4_en_u64_to_mac(dev->dev_addr, mdev->dev->caps.def_mac[priv->port]); 3362 3362 if (!is_valid_ether_addr(dev->dev_addr)) { 3363 - en_err(priv, "Port: %d, invalid mac burned: %pM, quiting\n", 3363 + en_err(priv, "Port: %d, invalid mac burned: %pM, quitting\n", 3364 3364 priv->port, dev->dev_addr); 3365 3365 err = -EINVAL; 3366 3366 goto out;
+7 -5
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
··· 862 862 for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) { 863 863 bool configure = false; 864 864 bool pfc = false; 865 + u16 thres_cells; 866 + u16 delay_cells; 865 867 bool lossy; 866 - u16 thres; 867 868 868 869 for (j = 0; j < IEEE_8021QAZ_MAX_TCS; j++) { 869 870 if (prio_tc[j] == i) { ··· 878 877 continue; 879 878 880 879 lossy = !(pfc || pause_en); 881 - thres = mlxsw_sp_pg_buf_threshold_get(mlxsw_sp, mtu); 882 - delay = mlxsw_sp_pg_buf_delay_get(mlxsw_sp, mtu, delay, pfc, 883 - pause_en); 884 - mlxsw_sp_pg_buf_pack(pbmc_pl, i, thres + delay, thres, lossy); 880 + thres_cells = mlxsw_sp_pg_buf_threshold_get(mlxsw_sp, mtu); 881 + delay_cells = mlxsw_sp_pg_buf_delay_get(mlxsw_sp, mtu, delay, 882 + pfc, pause_en); 883 + mlxsw_sp_pg_buf_pack(pbmc_pl, i, thres_cells + delay_cells, 884 + thres_cells, lossy); 885 885 } 886 886 887 887 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(pbmc), pbmc_pl);
+15 -6
drivers/net/ethernet/qlogic/qed/qed_iwarp.c
··· 1688 1688 1689 1689 eth_hlen = ETH_HLEN + (vlan_valid ? sizeof(u32) : 0); 1690 1690 1691 + if (!ether_addr_equal(ethh->h_dest, 1692 + p_hwfn->p_rdma_info->iwarp.mac_addr)) { 1693 + DP_VERBOSE(p_hwfn, 1694 + QED_MSG_RDMA, 1695 + "Got unexpected mac %pM instead of %pM\n", 1696 + ethh->h_dest, p_hwfn->p_rdma_info->iwarp.mac_addr); 1697 + return -EINVAL; 1698 + } 1699 + 1691 1700 ether_addr_copy(remote_mac_addr, ethh->h_source); 1692 1701 ether_addr_copy(local_mac_addr, ethh->h_dest); 1693 1702 ··· 2614 2605 struct qed_iwarp_info *iwarp_info; 2615 2606 struct qed_ll2_acquire_data data; 2616 2607 struct qed_ll2_cbs cbs; 2617 - u32 mpa_buff_size; 2608 + u32 buff_size; 2618 2609 u16 n_ooo_bufs; 2619 2610 int rc = 0; 2620 2611 int i; ··· 2641 2632 2642 2633 memset(&data, 0, sizeof(data)); 2643 2634 data.input.conn_type = QED_LL2_TYPE_IWARP; 2644 - data.input.mtu = QED_IWARP_MAX_SYN_PKT_SIZE; 2635 + data.input.mtu = params->max_mtu; 2645 2636 data.input.rx_num_desc = QED_IWARP_LL2_SYN_RX_SIZE; 2646 2637 data.input.tx_num_desc = QED_IWARP_LL2_SYN_TX_SIZE; 2647 2638 data.input.tx_max_bds_per_packet = 1; /* will never be fragmented */ ··· 2663 2654 goto err; 2664 2655 } 2665 2656 2657 + buff_size = QED_IWARP_MAX_BUF_SIZE(params->max_mtu); 2666 2658 rc = qed_iwarp_ll2_alloc_buffers(p_hwfn, 2667 2659 QED_IWARP_LL2_SYN_RX_SIZE, 2668 - QED_IWARP_MAX_SYN_PKT_SIZE, 2660 + buff_size, 2669 2661 iwarp_info->ll2_syn_handle); 2670 2662 if (rc) 2671 2663 goto err; ··· 2720 2710 if (rc) 2721 2711 goto err; 2722 2712 2723 - mpa_buff_size = QED_IWARP_MAX_BUF_SIZE(params->max_mtu); 2724 2713 rc = qed_iwarp_ll2_alloc_buffers(p_hwfn, 2725 2714 data.input.rx_num_desc, 2726 - mpa_buff_size, 2715 + buff_size, 2727 2716 iwarp_info->ll2_mpa_handle); 2728 2717 if (rc) 2729 2718 goto err; ··· 2735 2726 2736 2727 iwarp_info->max_num_partial_fpdus = (u16)p_hwfn->p_rdma_info->num_qps; 2737 2728 2738 - iwarp_info->mpa_intermediate_buf = kzalloc(mpa_buff_size, GFP_KERNEL); 2729 + iwarp_info->mpa_intermediate_buf = kzalloc(buff_size, GFP_KERNEL); 2739 2730 if (!iwarp_info->mpa_intermediate_buf) 2740 2731 goto err; 2741 2732
-1
drivers/net/ethernet/qlogic/qed/qed_iwarp.h
··· 46 46 47 47 #define QED_IWARP_LL2_SYN_TX_SIZE (128) 48 48 #define QED_IWARP_LL2_SYN_RX_SIZE (256) 49 - #define QED_IWARP_MAX_SYN_PKT_SIZE (128) 50 49 51 50 #define QED_IWARP_LL2_OOO_DEF_TX_SIZE (256) 52 51 #define QED_IWARP_MAX_OOO (16)
+6 -3
drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
··· 241 241 static int dwmac4_rx_check_timestamp(void *desc) 242 242 { 243 243 struct dma_desc *p = (struct dma_desc *)desc; 244 + unsigned int rdes0 = le32_to_cpu(p->des0); 245 + unsigned int rdes1 = le32_to_cpu(p->des1); 246 + unsigned int rdes3 = le32_to_cpu(p->des3); 244 247 u32 own, ctxt; 245 248 int ret = 1; 246 249 247 - own = p->des3 & RDES3_OWN; 248 - ctxt = ((p->des3 & RDES3_CONTEXT_DESCRIPTOR) 250 + own = rdes3 & RDES3_OWN; 251 + ctxt = ((rdes3 & RDES3_CONTEXT_DESCRIPTOR) 249 252 >> RDES3_CONTEXT_DESCRIPTOR_SHIFT); 250 253 251 254 if (likely(!own && ctxt)) { 252 - if ((p->des0 == 0xffffffff) && (p->des1 == 0xffffffff)) 255 + if ((rdes0 == 0xffffffff) && (rdes1 == 0xffffffff)) 253 256 /* Corrupted value */ 254 257 ret = -EINVAL; 255 258 else
+12 -10
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
··· 696 696 struct ethtool_eee *edata) 697 697 { 698 698 struct stmmac_priv *priv = netdev_priv(dev); 699 + int ret; 699 700 700 - priv->eee_enabled = edata->eee_enabled; 701 - 702 - if (!priv->eee_enabled) 701 + if (!edata->eee_enabled) { 703 702 stmmac_disable_eee_mode(priv); 704 - else { 703 + } else { 705 704 /* We are asking for enabling the EEE but it is safe 706 705 * to verify all by invoking the eee_init function. 707 706 * In case of failure it will return an error. 708 707 */ 709 - priv->eee_enabled = stmmac_eee_init(priv); 710 - if (!priv->eee_enabled) 708 + edata->eee_enabled = stmmac_eee_init(priv); 709 + if (!edata->eee_enabled) 711 710 return -EOPNOTSUPP; 712 - 713 - /* Do not change tx_lpi_timer in case of failure */ 714 - priv->tx_lpi_timer = edata->tx_lpi_timer; 715 711 } 716 712 717 - return phy_ethtool_set_eee(dev->phydev, edata); 713 + ret = phy_ethtool_set_eee(dev->phydev, edata); 714 + if (ret) 715 + return ret; 716 + 717 + priv->eee_enabled = edata->eee_enabled; 718 + priv->tx_lpi_timer = edata->tx_lpi_timer; 719 + return 0; 718 720 } 719 721 720 722 static u32 stmmac_usec2riwt(u32 usec, struct stmmac_priv *priv)
+1 -1
drivers/net/ethernet/ti/netcp_core.c
··· 259 259 const char *name; 260 260 char node_name[32]; 261 261 262 - if (of_property_read_string(node, "label", &name) < 0) { 262 + if (of_property_read_string(child, "label", &name) < 0) { 263 263 snprintf(node_name, sizeof(node_name), "%pOFn", child); 264 264 name = node_name; 265 265 }
+4 -1
drivers/net/phy/xilinx_gmii2rgmii.c
··· 35 35 u16 val = 0; 36 36 int err; 37 37 38 - err = priv->phy_drv->read_status(phydev); 38 + if (priv->phy_drv->read_status) 39 + err = priv->phy_drv->read_status(phydev); 40 + else 41 + err = genphy_read_status(phydev); 39 42 if (err < 0) 40 43 return err; 41 44
+2 -2
drivers/net/usb/qmi_wwan.c
··· 1201 1201 {QMI_FIXED_INTF(0x114f, 0x68a2, 8)}, /* Sierra Wireless MC7750 */ 1202 1202 {QMI_FIXED_INTF(0x1199, 0x68a2, 8)}, /* Sierra Wireless MC7710 in QMI mode */ 1203 1203 {QMI_FIXED_INTF(0x1199, 0x68a2, 19)}, /* Sierra Wireless MC7710 in QMI mode */ 1204 - {QMI_FIXED_INTF(0x1199, 0x68c0, 8)}, /* Sierra Wireless MC7304/MC7354 */ 1205 - {QMI_FIXED_INTF(0x1199, 0x68c0, 10)}, /* Sierra Wireless MC7304/MC7354 */ 1204 + {QMI_QUIRK_SET_DTR(0x1199, 0x68c0, 8)}, /* Sierra Wireless MC7304/MC7354, WP76xx */ 1205 + {QMI_QUIRK_SET_DTR(0x1199, 0x68c0, 10)},/* Sierra Wireless MC7304/MC7354 */ 1206 1206 {QMI_FIXED_INTF(0x1199, 0x901c, 8)}, /* Sierra Wireless EM7700 */ 1207 1207 {QMI_FIXED_INTF(0x1199, 0x901f, 8)}, /* Sierra Wireless EM7355 */ 1208 1208 {QMI_FIXED_INTF(0x1199, 0x9041, 8)}, /* Sierra Wireless MC7305/MC7355 */
+3 -2
drivers/net/usb/r8152.c
··· 557 557 /* MAC PASSTHRU */ 558 558 #define AD_MASK 0xfee0 559 559 #define BND_MASK 0x0004 560 + #define BD_MASK 0x0001 560 561 #define EFUSE 0xcfdb 561 562 #define PASS_THRU_MASK 0x1 562 563 ··· 1177 1176 return -ENODEV; 1178 1177 } 1179 1178 } else { 1180 - /* test for RTL8153-BND */ 1179 + /* test for RTL8153-BND and RTL8153-BD */ 1181 1180 ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_MISC_1); 1182 - if ((ocp_data & BND_MASK) == 0) { 1181 + if ((ocp_data & BND_MASK) == 0 && (ocp_data & BD_MASK)) { 1183 1182 netif_dbg(tp, probe, tp->netdev, 1184 1183 "Invalid variant for MAC pass through\n"); 1185 1184 return -ENODEV;
+30 -18
drivers/net/wireless/mediatek/mt76/mt76x0/usb.c
··· 158 158 .get_txpower = mt76_get_txpower, 159 159 }; 160 160 161 + static int mt76x0u_init_hardware(struct mt76x02_dev *dev) 162 + { 163 + int err; 164 + 165 + mt76x0_chip_onoff(dev, true, true); 166 + 167 + if (!mt76x02_wait_for_mac(&dev->mt76)) 168 + return -ETIMEDOUT; 169 + 170 + err = mt76x0u_mcu_init(dev); 171 + if (err < 0) 172 + return err; 173 + 174 + mt76x0_init_usb_dma(dev); 175 + err = mt76x0_init_hardware(dev); 176 + if (err < 0) 177 + return err; 178 + 179 + mt76_rmw(dev, MT_US_CYC_CFG, MT_US_CYC_CNT, 0x1e); 180 + mt76_wr(dev, MT_TXOP_CTRL_CFG, 181 + FIELD_PREP(MT_TXOP_TRUN_EN, 0x3f) | 182 + FIELD_PREP(MT_TXOP_EXT_CCA_DLY, 0x58)); 183 + 184 + return 0; 185 + } 186 + 161 187 static int mt76x0u_register_device(struct mt76x02_dev *dev) 162 188 { 163 189 struct ieee80211_hw *hw = dev->mt76.hw; ··· 197 171 if (err < 0) 198 172 goto out_err; 199 173 200 - mt76x0_chip_onoff(dev, true, true); 201 - if (!mt76x02_wait_for_mac(&dev->mt76)) { 202 - err = -ETIMEDOUT; 203 - goto out_err; 204 - } 205 - 206 - err = mt76x0u_mcu_init(dev); 174 + err = mt76x0u_init_hardware(dev); 207 175 if (err < 0) 208 176 goto out_err; 209 - 210 - mt76x0_init_usb_dma(dev); 211 - err = mt76x0_init_hardware(dev); 212 - if (err < 0) 213 - goto out_err; 214 - 215 - mt76_rmw(dev, MT_US_CYC_CFG, MT_US_CYC_CNT, 0x1e); 216 - mt76_wr(dev, MT_TXOP_CTRL_CFG, 217 - FIELD_PREP(MT_TXOP_TRUN_EN, 0x3f) | 218 - FIELD_PREP(MT_TXOP_EXT_CCA_DLY, 0x58)); 219 177 220 178 err = mt76x0_register_device(dev); 221 179 if (err < 0) ··· 311 301 312 302 mt76u_stop_queues(&dev->mt76); 313 303 mt76x0u_mac_stop(dev); 304 + clear_bit(MT76_STATE_MCU_RUNNING, &dev->mt76.state); 305 + mt76x0_chip_onoff(dev, false, false); 314 306 usb_kill_urb(usb->mcu.res.urb); 315 307 316 308 return 0; ··· 340 328 tasklet_enable(&usb->rx_tasklet); 341 329 tasklet_enable(&usb->tx_tasklet); 342 330 343 - ret = mt76x0_init_hardware(dev); 331 + ret = mt76x0u_init_hardware(dev); 344 332 if (ret) 345 333 goto err; 346 334
+2 -2
drivers/scsi/qla2xxx/qla_init.c
··· 1785 1785 1786 1786 /* Issue Marker IOCB */ 1787 1787 qla2x00_marker(vha, vha->hw->req_q_map[0], 1788 - vha->hw->rsp_q_map[0], sp->fcport->loop_id, lun, 1788 + vha->hw->rsp_q_map[0], fcport->loop_id, lun, 1789 1789 flags == TCF_LUN_RESET ? MK_SYNC_ID_LUN : MK_SYNC_ID); 1790 1790 } 1791 1791 1792 1792 done_free_sp: 1793 1793 sp->free(sp); 1794 - sp->fcport->flags &= ~FCF_ASYNC_SENT; 1794 + fcport->flags &= ~FCF_ASYNC_SENT; 1795 1795 done: 1796 1796 return rval; 1797 1797 }
+9 -3
drivers/scsi/sd.c
··· 2951 2951 if (rot == 1) { 2952 2952 blk_queue_flag_set(QUEUE_FLAG_NONROT, q); 2953 2953 blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, q); 2954 - } else { 2955 - blk_queue_flag_clear(QUEUE_FLAG_NONROT, q); 2956 - blk_queue_flag_set(QUEUE_FLAG_ADD_RANDOM, q); 2957 2954 } 2958 2955 2959 2956 if (sdkp->device->type == TYPE_ZBC) { ··· 3086 3089 */ 3087 3090 if (sdkp->media_present) { 3088 3091 sd_read_capacity(sdkp, buffer); 3092 + 3093 + /* 3094 + * set the default to rotational. All non-rotational devices 3095 + * support the block characteristics VPD page, which will 3096 + * cause this to be updated correctly and any device which 3097 + * doesn't support it should be treated as rotational. 3098 + */ 3099 + blk_queue_flag_clear(QUEUE_FLAG_NONROT, q); 3100 + blk_queue_flag_set(QUEUE_FLAG_ADD_RANDOM, q); 3089 3101 3090 3102 if (scsi_device_supports_vpd(sdp)) { 3091 3103 sd_read_block_provisioning(sdkp);
+1 -1
drivers/vhost/vhost.c
··· 1788 1788 1789 1789 ret = translate_desc(vq, (uintptr_t)vq->used + used_offset, 1790 1790 len, iov, 64, VHOST_ACCESS_WO); 1791 - if (ret) 1791 + if (ret < 0) 1792 1792 return ret; 1793 1793 1794 1794 for (i = 0; i < ret; i++) {
+48 -9
fs/binfmt_script.c
··· 14 14 #include <linux/err.h> 15 15 #include <linux/fs.h> 16 16 17 + static inline bool spacetab(char c) { return c == ' ' || c == '\t'; } 18 + static inline char *next_non_spacetab(char *first, const char *last) 19 + { 20 + for (; first <= last; first++) 21 + if (!spacetab(*first)) 22 + return first; 23 + return NULL; 24 + } 25 + static inline char *next_terminator(char *first, const char *last) 26 + { 27 + for (; first <= last; first++) 28 + if (spacetab(*first) || !*first) 29 + return first; 30 + return NULL; 31 + } 32 + 17 33 static int load_script(struct linux_binprm *bprm) 18 34 { 19 35 const char *i_arg, *i_name; 20 - char *cp; 36 + char *cp, *buf_end; 21 37 struct file *file; 22 38 int retval; 23 39 40 + /* Not ours to exec if we don't start with "#!". */ 24 41 if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!')) 25 42 return -ENOEXEC; 26 43 ··· 50 33 if (bprm->interp_flags & BINPRM_FLAGS_PATH_INACCESSIBLE) 51 34 return -ENOENT; 52 35 53 - /* 54 - * This section does the #! interpretation. 55 - * Sorta complicated, but hopefully it will work. -TYT 56 - */ 57 - 36 + /* Release since we are not mapping a binary into memory. */ 58 37 allow_write_access(bprm->file); 59 38 fput(bprm->file); 60 39 bprm->file = NULL; 61 40 62 - bprm->buf[BINPRM_BUF_SIZE - 1] = '\0'; 63 - if ((cp = strchr(bprm->buf, '\n')) == NULL) 64 - cp = bprm->buf+BINPRM_BUF_SIZE-1; 41 + /* 42 + * This section handles parsing the #! line into separate 43 + * interpreter path and argument strings. We must be careful 44 + * because bprm->buf is not yet guaranteed to be NUL-terminated 45 + * (though the buffer will have trailing NUL padding when the 46 + * file size was smaller than the buffer size). 47 + * 48 + * We do not want to exec a truncated interpreter path, so either 49 + * we find a newline (which indicates nothing is truncated), or 50 + * we find a space/tab/NUL after the interpreter path (which 51 + * itself may be preceded by spaces/tabs). Truncating the 52 + * arguments is fine: the interpreter can re-read the script to 53 + * parse them on its own. 54 + */ 55 + buf_end = bprm->buf + sizeof(bprm->buf) - 1; 56 + cp = strnchr(bprm->buf, sizeof(bprm->buf), '\n'); 57 + if (!cp) { 58 + cp = next_non_spacetab(bprm->buf + 2, buf_end); 59 + if (!cp) 60 + return -ENOEXEC; /* Entire buf is spaces/tabs */ 61 + /* 62 + * If there is no later space/tab/NUL we must assume the 63 + * interpreter path is truncated. 64 + */ 65 + if (!next_terminator(cp, buf_end)) 66 + return -ENOEXEC; 67 + cp = buf_end; 68 + } 69 + /* NUL-terminate the buffer and any trailing spaces/tabs. */ 65 70 *cp = '\0'; 66 71 while (cp > bprm->buf) { 67 72 cp--;
+6 -5
fs/nfs/write.c
··· 238 238 } 239 239 240 240 /* A writeback failed: mark the page as bad, and invalidate the page cache */ 241 - static void nfs_set_pageerror(struct page *page) 241 + static void nfs_set_pageerror(struct address_space *mapping) 242 242 { 243 - nfs_zap_mapping(page_file_mapping(page)->host, page_file_mapping(page)); 243 + nfs_zap_mapping(mapping->host, mapping); 244 244 } 245 245 246 246 /* ··· 994 994 nfs_list_remove_request(req); 995 995 if (test_bit(NFS_IOHDR_ERROR, &hdr->flags) && 996 996 (hdr->good_bytes < bytes)) { 997 - nfs_set_pageerror(req->wb_page); 997 + nfs_set_pageerror(page_file_mapping(req->wb_page)); 998 998 nfs_context_set_write_error(req->wb_context, hdr->error); 999 999 goto remove_req; 1000 1000 } ··· 1348 1348 unsigned int offset, unsigned int count) 1349 1349 { 1350 1350 struct nfs_open_context *ctx = nfs_file_open_context(file); 1351 - struct inode *inode = page_file_mapping(page)->host; 1351 + struct address_space *mapping = page_file_mapping(page); 1352 + struct inode *inode = mapping->host; 1352 1353 int status = 0; 1353 1354 1354 1355 nfs_inc_stats(inode, NFSIOS_VFSUPDATEPAGE); ··· 1367 1366 1368 1367 status = nfs_writepage_setup(ctx, page, offset, count); 1369 1368 if (status < 0) 1370 - nfs_set_pageerror(page); 1369 + nfs_set_pageerror(mapping); 1371 1370 else 1372 1371 __set_page_dirty_nobuffers(page); 1373 1372 out:
+2 -2
fs/nfsd/nfsctl.c
··· 1239 1239 retval = nfsd_idmap_init(net); 1240 1240 if (retval) 1241 1241 goto out_idmap_error; 1242 - nn->nfsd4_lease = 45; /* default lease time */ 1243 - nn->nfsd4_grace = 45; 1242 + nn->nfsd4_lease = 90; /* default lease time */ 1243 + nn->nfsd4_grace = 90; 1244 1244 nn->somebody_reclaimed = false; 1245 1245 nn->clverifier_counter = prandom_u32(); 1246 1246 nn->clientid_counter = prandom_u32();
+3 -3
include/kvm/arm_vgic.h
··· 100 100 }; 101 101 102 102 struct vgic_irq { 103 - spinlock_t irq_lock; /* Protects the content of the struct */ 103 + raw_spinlock_t irq_lock; /* Protects the content of the struct */ 104 104 struct list_head lpi_list; /* Used to link all LPIs together */ 105 105 struct list_head ap_list; 106 106 ··· 256 256 u64 propbaser; 257 257 258 258 /* Protects the lpi_list and the count value below. */ 259 - spinlock_t lpi_list_lock; 259 + raw_spinlock_t lpi_list_lock; 260 260 struct list_head lpi_list_head; 261 261 int lpi_list_count; 262 262 ··· 307 307 unsigned int used_lrs; 308 308 struct vgic_irq private_irqs[VGIC_NR_PRIVATE_IRQS]; 309 309 310 - spinlock_t ap_list_lock; /* Protects the ap_list */ 310 + raw_spinlock_t ap_list_lock; /* Protects the ap_list */ 311 311 312 312 /* 313 313 * List of IRQs that this VCPU should consider because they are either
+14
include/linux/compiler_attributes.h
··· 34 34 #ifndef __has_attribute 35 35 # define __has_attribute(x) __GCC4_has_attribute_##x 36 36 # define __GCC4_has_attribute___assume_aligned__ (__GNUC_MINOR__ >= 9) 37 + # define __GCC4_has_attribute___copy__ 0 37 38 # define __GCC4_has_attribute___designated_init__ 0 38 39 # define __GCC4_has_attribute___externally_visible__ 1 39 40 # define __GCC4_has_attribute___noclone__ 1 ··· 100 99 * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-const-function-attribute 101 100 */ 102 101 #define __attribute_const__ __attribute__((__const__)) 102 + 103 + /* 104 + * Optional: only supported since gcc >= 9 105 + * Optional: not supported by clang 106 + * Optional: not supported by icc 107 + * 108 + * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-copy-function-attribute 109 + */ 110 + #if __has_attribute(__copy__) 111 + # define __copy(symbol) __attribute__((__copy__(symbol))) 112 + #else 113 + # define __copy(symbol) 114 + #endif 103 115 104 116 /* 105 117 * Don't. Just don't. See commit 771c035372a0 ("deprecate the '__deprecated'
-7
include/linux/efi.h
··· 1198 1198 extern void efi_reboot(enum reboot_mode reboot_mode, const char *__unused); 1199 1199 1200 1200 extern bool efi_is_table_address(unsigned long phys_addr); 1201 - 1202 - extern int efi_apply_persistent_mem_reservations(void); 1203 1201 #else 1204 1202 static inline bool efi_enabled(int feature) 1205 1203 { ··· 1215 1217 static inline bool efi_is_table_address(unsigned long phys_addr) 1216 1218 { 1217 1219 return false; 1218 - } 1219 - 1220 - static inline int efi_apply_persistent_mem_reservations(void) 1221 - { 1222 - return 0; 1223 1220 } 1224 1221 #endif 1225 1222
-3
include/linux/memblock.h
··· 29 29 */ 30 30 extern unsigned long long max_possible_pfn; 31 31 32 - #define INIT_MEMBLOCK_REGIONS 128 33 - #define INIT_PHYSMEM_REGIONS 4 34 - 35 32 /** 36 33 * enum memblock_flags - definition of memory region attributes 37 34 * @MEMBLOCK_NONE: no special request
+2 -2
include/linux/module.h
··· 129 129 #define module_init(initfn) \ 130 130 static inline initcall_t __maybe_unused __inittest(void) \ 131 131 { return initfn; } \ 132 - int init_module(void) __attribute__((alias(#initfn))); 132 + int init_module(void) __copy(initfn) __attribute__((alias(#initfn))); 133 133 134 134 /* This is only required if you want to be unloadable. */ 135 135 #define module_exit(exitfn) \ 136 136 static inline exitcall_t __maybe_unused __exittest(void) \ 137 137 { return exitfn; } \ 138 - void cleanup_module(void) __attribute__((alias(#exitfn))); 138 + void cleanup_module(void) __copy(exitfn) __attribute__((alias(#exitfn))); 139 139 140 140 #endif 141 141
+22 -2
include/linux/netdev_features.h
··· 11 11 #define _LINUX_NETDEV_FEATURES_H 12 12 13 13 #include <linux/types.h> 14 + #include <linux/bitops.h> 15 + #include <asm/byteorder.h> 14 16 15 17 typedef u64 netdev_features_t; 16 18 ··· 156 154 #define NETIF_F_HW_TLS_TX __NETIF_F(HW_TLS_TX) 157 155 #define NETIF_F_HW_TLS_RX __NETIF_F(HW_TLS_RX) 158 156 159 - #define for_each_netdev_feature(mask_addr, bit) \ 160 - for_each_set_bit(bit, (unsigned long *)mask_addr, NETDEV_FEATURE_COUNT) 157 + /* Finds the next feature with the highest number of the range of start till 0. 158 + */ 159 + static inline int find_next_netdev_feature(u64 feature, unsigned long start) 160 + { 161 + /* like BITMAP_LAST_WORD_MASK() for u64 162 + * this sets the most significant 64 - start to 0. 163 + */ 164 + feature &= ~0ULL >> (-start & ((sizeof(feature) * 8) - 1)); 165 + 166 + return fls64(feature) - 1; 167 + } 168 + 169 + /* This goes for the MSB to the LSB through the set feature bits, 170 + * mask_addr should be a u64 and bit an int 171 + */ 172 + #define for_each_netdev_feature(mask_addr, bit) \ 173 + for ((bit) = find_next_netdev_feature((mask_addr), \ 174 + NETDEV_FEATURE_COUNT); \ 175 + (bit) >= 0; \ 176 + (bit) = find_next_netdev_feature((mask_addr), (bit) - 1)) 161 177 162 178 /* Features valid for ethtool to change */ 163 179 /* = all defined minus driver/device-class-related */
+5
include/linux/perf_event.h
··· 447 447 * Filter events for PMU-specific reasons. 448 448 */ 449 449 int (*filter_match) (struct perf_event *event); /* optional */ 450 + 451 + /* 452 + * Check period value for PERF_EVENT_IOC_PERIOD ioctl. 453 + */ 454 + int (*check_period) (struct perf_event *event, u64 value); /* optional */ 450 455 }; 451 456 452 457 enum perf_addr_filter_action_t {
+7 -1
include/linux/skbuff.h
··· 2439 2439 2440 2440 if (skb_flow_dissect_flow_keys_basic(skb, &keys, NULL, 0, 0, 0, 0)) 2441 2441 skb_set_transport_header(skb, keys.control.thoff); 2442 - else 2442 + else if (offset_hint >= 0) 2443 2443 skb_set_transport_header(skb, offset_hint); 2444 2444 } 2445 2445 ··· 4233 4233 static inline bool skb_is_gso_sctp(const struct sk_buff *skb) 4234 4234 { 4235 4235 return skb_shinfo(skb)->gso_type & SKB_GSO_SCTP; 4236 + } 4237 + 4238 + static inline bool skb_is_gso_tcp(const struct sk_buff *skb) 4239 + { 4240 + return skb_is_gso(skb) && 4241 + skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6); 4236 4242 } 4237 4243 4238 4244 static inline void skb_gso_reset(struct sk_buff *skb)
+9
include/linux/virtio_net.h
··· 57 57 58 58 if (!skb_partial_csum_set(skb, start, off)) 59 59 return -EINVAL; 60 + } else { 61 + /* gso packets without NEEDS_CSUM do not set transport_offset. 62 + * probe and drop if does not match one of the above types. 63 + */ 64 + if (gso_type) { 65 + skb_probe_transport_header(skb, -1); 66 + if (!skb_transport_header_was_set(skb)) 67 + return -EINVAL; 68 + } 60 69 } 61 70 62 71 if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) {
+7 -1
kernel/bpf/stackmap.c
··· 44 44 struct stack_map_irq_work *work; 45 45 46 46 work = container_of(entry, struct stack_map_irq_work, irq_work); 47 - up_read(work->sem); 47 + up_read_non_owner(work->sem); 48 48 work->sem = NULL; 49 49 } 50 50 ··· 338 338 } else { 339 339 work->sem = &current->mm->mmap_sem; 340 340 irq_work_queue(&work->irq_work); 341 + /* 342 + * The irq_work will release the mmap_sem with 343 + * up_read_non_owner(). The rwsem_release() is called 344 + * here to release the lock from lockdep's perspective. 345 + */ 346 + rwsem_release(&current->mm->mmap_sem.dep_map, 1, _RET_IP_); 341 347 } 342 348 } 343 349
+16
kernel/events/core.c
··· 4963 4963 } 4964 4964 } 4965 4965 4966 + static int perf_event_check_period(struct perf_event *event, u64 value) 4967 + { 4968 + return event->pmu->check_period(event, value); 4969 + } 4970 + 4966 4971 static int perf_event_period(struct perf_event *event, u64 __user *arg) 4967 4972 { 4968 4973 u64 value; ··· 4982 4977 return -EINVAL; 4983 4978 4984 4979 if (event->attr.freq && value > sysctl_perf_event_sample_rate) 4980 + return -EINVAL; 4981 + 4982 + if (perf_event_check_period(event, value)) 4985 4983 return -EINVAL; 4986 4984 4987 4985 event_function_call(event, __perf_event_period, &value); ··· 9399 9391 return 0; 9400 9392 } 9401 9393 9394 + static int perf_event_nop_int(struct perf_event *event, u64 value) 9395 + { 9396 + return 0; 9397 + } 9398 + 9402 9399 static DEFINE_PER_CPU(unsigned int, nop_txn_flags); 9403 9400 9404 9401 static void perf_pmu_start_txn(struct pmu *pmu, unsigned int flags) ··· 9703 9690 pmu->pmu_enable = perf_pmu_nop_void; 9704 9691 pmu->pmu_disable = perf_pmu_nop_void; 9705 9692 } 9693 + 9694 + if (!pmu->check_period) 9695 + pmu->check_period = perf_event_nop_int; 9706 9696 9707 9697 if (!pmu->event_idx) 9708 9698 pmu->event_idx = perf_event_idx_default;
+1 -1
kernel/events/ring_buffer.c
··· 734 734 size = sizeof(struct ring_buffer); 735 735 size += nr_pages * sizeof(void *); 736 736 737 - if (order_base_2(size) >= MAX_ORDER) 737 + if (order_base_2(size) >= PAGE_SHIFT+MAX_ORDER) 738 738 goto fail; 739 739 740 740 rb = kzalloc(size, GFP_KERNEL);
+2
kernel/trace/trace.c
··· 3384 3384 const char tgid_space[] = " "; 3385 3385 const char space[] = " "; 3386 3386 3387 + print_event_info(buf, m); 3388 + 3387 3389 seq_printf(m, "# %s _-----=> irqs-off\n", 3388 3390 tgid ? tgid_space : space); 3389 3391 seq_printf(m, "# %s / _----=> need-resched\n",
+1 -9
kernel/trace/trace_kprobe.c
··· 861 861 static nokprobe_inline int 862 862 fetch_store_strlen(unsigned long addr) 863 863 { 864 - mm_segment_t old_fs; 865 864 int ret, len = 0; 866 865 u8 c; 867 866 868 - old_fs = get_fs(); 869 - set_fs(KERNEL_DS); 870 - pagefault_disable(); 871 - 872 867 do { 873 - ret = __copy_from_user_inatomic(&c, (u8 *)addr + len, 1); 868 + ret = probe_mem_read(&c, (u8 *)addr + len, 1); 874 869 len++; 875 870 } while (c && ret == 0 && len < MAX_STRING_SIZE); 876 - 877 - pagefault_enable(); 878 - set_fs(old_fs); 879 871 880 872 return (ret < 0) ? ret : len; 881 873 }
+2 -2
lib/crc32.c
··· 206 206 EXPORT_SYMBOL(crc32_le); 207 207 EXPORT_SYMBOL(__crc32c_le); 208 208 209 - u32 crc32_le_base(u32, unsigned char const *, size_t) __alias(crc32_le); 210 - u32 __crc32c_le_base(u32, unsigned char const *, size_t) __alias(__crc32c_le); 209 + u32 __pure crc32_le_base(u32, unsigned char const *, size_t) __alias(crc32_le); 210 + u32 __pure __crc32c_le_base(u32, unsigned char const *, size_t) __alias(__crc32c_le); 211 211 212 212 /* 213 213 * This multiplies the polynomials x and y modulo the given modulus.
+9 -2
mm/memblock.c
··· 26 26 27 27 #include "internal.h" 28 28 29 + #define INIT_MEMBLOCK_REGIONS 128 30 + #define INIT_PHYSMEM_REGIONS 4 31 + 32 + #ifndef INIT_MEMBLOCK_RESERVED_REGIONS 33 + # define INIT_MEMBLOCK_RESERVED_REGIONS INIT_MEMBLOCK_REGIONS 34 + #endif 35 + 29 36 /** 30 37 * DOC: memblock overview 31 38 * ··· 99 92 unsigned long long max_possible_pfn; 100 93 101 94 static struct memblock_region memblock_memory_init_regions[INIT_MEMBLOCK_REGIONS] __initdata_memblock; 102 - static struct memblock_region memblock_reserved_init_regions[INIT_MEMBLOCK_REGIONS] __initdata_memblock; 95 + static struct memblock_region memblock_reserved_init_regions[INIT_MEMBLOCK_RESERVED_REGIONS] __initdata_memblock; 103 96 #ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP 104 97 static struct memblock_region memblock_physmem_init_regions[INIT_PHYSMEM_REGIONS] __initdata_memblock; 105 98 #endif ··· 112 105 113 106 .reserved.regions = memblock_reserved_init_regions, 114 107 .reserved.cnt = 1, /* empty dummy entry */ 115 - .reserved.max = INIT_MEMBLOCK_REGIONS, 108 + .reserved.max = INIT_MEMBLOCK_RESERVED_REGIONS, 116 109 .reserved.name = "reserved", 117 110 118 111 #ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP
+4 -4
mm/page_alloc.c
··· 4675 4675 /* Even if we own the page, we do not use atomic_set(). 4676 4676 * This would break get_page_unless_zero() users. 4677 4677 */ 4678 - page_ref_add(page, size); 4678 + page_ref_add(page, PAGE_FRAG_CACHE_MAX_SIZE); 4679 4679 4680 4680 /* reset page count bias and offset to start of new frag */ 4681 4681 nc->pfmemalloc = page_is_pfmemalloc(page); 4682 - nc->pagecnt_bias = size + 1; 4682 + nc->pagecnt_bias = PAGE_FRAG_CACHE_MAX_SIZE + 1; 4683 4683 nc->offset = size; 4684 4684 } 4685 4685 ··· 4695 4695 size = nc->size; 4696 4696 #endif 4697 4697 /* OK, page count is 0, we can safely set it */ 4698 - set_page_count(page, size + 1); 4698 + set_page_count(page, PAGE_FRAG_CACHE_MAX_SIZE + 1); 4699 4699 4700 4700 /* reset page count bias and offset to start of new frag */ 4701 - nc->pagecnt_bias = size + 1; 4701 + nc->pagecnt_bias = PAGE_FRAG_CACHE_MAX_SIZE + 1; 4702 4702 offset = size - fragsz; 4703 4703 } 4704 4704
+2 -2
net/core/dev.c
··· 8215 8215 netdev_features_t feature; 8216 8216 int feature_bit; 8217 8217 8218 - for_each_netdev_feature(&upper_disables, feature_bit) { 8218 + for_each_netdev_feature(upper_disables, feature_bit) { 8219 8219 feature = __NETIF_F_BIT(feature_bit); 8220 8220 if (!(upper->wanted_features & feature) 8221 8221 && (features & feature)) { ··· 8235 8235 netdev_features_t feature; 8236 8236 int feature_bit; 8237 8237 8238 - for_each_netdev_feature(&upper_disables, feature_bit) { 8238 + for_each_netdev_feature(upper_disables, feature_bit) { 8239 8239 feature = __NETIF_F_BIT(feature_bit); 8240 8240 if (!(features & feature) && (lower->features & feature)) { 8241 8241 netdev_dbg(upper, "Disabling feature %pNF on lower dev %s.\n",
+4 -8
net/core/filter.c
··· 2804 2804 u32 off = skb_mac_header_len(skb); 2805 2805 int ret; 2806 2806 2807 - /* SCTP uses GSO_BY_FRAGS, thus cannot adjust it. */ 2808 - if (skb_is_gso(skb) && unlikely(skb_is_gso_sctp(skb))) 2807 + if (!skb_is_gso_tcp(skb)) 2809 2808 return -ENOTSUPP; 2810 2809 2811 2810 ret = skb_cow(skb, len_diff); ··· 2845 2846 u32 off = skb_mac_header_len(skb); 2846 2847 int ret; 2847 2848 2848 - /* SCTP uses GSO_BY_FRAGS, thus cannot adjust it. */ 2849 - if (skb_is_gso(skb) && unlikely(skb_is_gso_sctp(skb))) 2849 + if (!skb_is_gso_tcp(skb)) 2850 2850 return -ENOTSUPP; 2851 2851 2852 2852 ret = skb_unclone(skb, GFP_ATOMIC); ··· 2970 2972 u32 off = skb_mac_header_len(skb) + bpf_skb_net_base_len(skb); 2971 2973 int ret; 2972 2974 2973 - /* SCTP uses GSO_BY_FRAGS, thus cannot adjust it. */ 2974 - if (skb_is_gso(skb) && unlikely(skb_is_gso_sctp(skb))) 2975 + if (!skb_is_gso_tcp(skb)) 2975 2976 return -ENOTSUPP; 2976 2977 2977 2978 ret = skb_cow(skb, len_diff); ··· 2999 3002 u32 off = skb_mac_header_len(skb) + bpf_skb_net_base_len(skb); 3000 3003 int ret; 3001 3004 3002 - /* SCTP uses GSO_BY_FRAGS, thus cannot adjust it. */ 3003 - if (skb_is_gso(skb) && unlikely(skb_is_gso_sctp(skb))) 3005 + if (!skb_is_gso_tcp(skb)) 3004 3006 return -ENOTSUPP; 3005 3007 3006 3008 ret = skb_unclone(skb, GFP_ATOMIC);
+4
net/core/skbuff.c
··· 356 356 */ 357 357 void *netdev_alloc_frag(unsigned int fragsz) 358 358 { 359 + fragsz = SKB_DATA_ALIGN(fragsz); 360 + 359 361 return __netdev_alloc_frag(fragsz, GFP_ATOMIC); 360 362 } 361 363 EXPORT_SYMBOL(netdev_alloc_frag); ··· 371 369 372 370 void *napi_alloc_frag(unsigned int fragsz) 373 371 { 372 + fragsz = SKB_DATA_ALIGN(fragsz); 373 + 374 374 return __napi_alloc_frag(fragsz, GFP_ATOMIC); 375 375 } 376 376 EXPORT_SYMBOL(napi_alloc_frag);
+2
net/ipv4/tcp.c
··· 2546 2546 sk_mem_reclaim(sk); 2547 2547 tcp_clear_all_retrans_hints(tcp_sk(sk)); 2548 2548 tcp_sk(sk)->packets_out = 0; 2549 + inet_csk(sk)->icsk_backoff = 0; 2549 2550 } 2550 2551 2551 2552 int tcp_disconnect(struct sock *sk, int flags) ··· 2597 2596 if (tp->write_seq == 0) 2598 2597 tp->write_seq = 1; 2599 2598 icsk->icsk_backoff = 0; 2599 + tp->snd_cwnd = 2; 2600 2600 icsk->icsk_probes_out = 0; 2601 2601 icsk->icsk_rto = TCP_TIMEOUT_INIT; 2602 2602 tp->snd_ssthresh = TCP_INFINITE_SSTHRESH;
+4 -1
net/ipv4/tcp_ipv4.c
··· 536 536 if (sock_owned_by_user(sk)) 537 537 break; 538 538 539 + skb = tcp_rtx_queue_head(sk); 540 + if (WARN_ON_ONCE(!skb)) 541 + break; 542 + 539 543 icsk->icsk_backoff--; 540 544 icsk->icsk_rto = tp->srtt_us ? __tcp_set_rto(tp) : 541 545 TCP_TIMEOUT_INIT; 542 546 icsk->icsk_rto = inet_csk_rto_backoff(icsk, TCP_RTO_MAX); 543 547 544 - skb = tcp_rtx_queue_head(sk); 545 548 546 549 tcp_mstamp_refresh(tp); 547 550 delta_us = (u32)(tp->tcp_mstamp - tcp_skb_timestamp_us(skb));
+20 -14
net/ipv6/ip6_gre.c
··· 1719 1719 return 0; 1720 1720 } 1721 1721 1722 + static void ip6erspan_set_version(struct nlattr *data[], 1723 + struct __ip6_tnl_parm *parms) 1724 + { 1725 + parms->erspan_ver = 1; 1726 + if (data[IFLA_GRE_ERSPAN_VER]) 1727 + parms->erspan_ver = nla_get_u8(data[IFLA_GRE_ERSPAN_VER]); 1728 + 1729 + if (parms->erspan_ver == 1) { 1730 + if (data[IFLA_GRE_ERSPAN_INDEX]) 1731 + parms->index = nla_get_u32(data[IFLA_GRE_ERSPAN_INDEX]); 1732 + } else if (parms->erspan_ver == 2) { 1733 + if (data[IFLA_GRE_ERSPAN_DIR]) 1734 + parms->dir = nla_get_u8(data[IFLA_GRE_ERSPAN_DIR]); 1735 + if (data[IFLA_GRE_ERSPAN_HWID]) 1736 + parms->hwid = nla_get_u16(data[IFLA_GRE_ERSPAN_HWID]); 1737 + } 1738 + } 1739 + 1722 1740 static void ip6gre_netlink_parms(struct nlattr *data[], 1723 1741 struct __ip6_tnl_parm *parms) 1724 1742 { ··· 1785 1767 1786 1768 if (data[IFLA_GRE_COLLECT_METADATA]) 1787 1769 parms->collect_md = true; 1788 - 1789 - parms->erspan_ver = 1; 1790 - if (data[IFLA_GRE_ERSPAN_VER]) 1791 - parms->erspan_ver = nla_get_u8(data[IFLA_GRE_ERSPAN_VER]); 1792 - 1793 - if (parms->erspan_ver == 1) { 1794 - if (data[IFLA_GRE_ERSPAN_INDEX]) 1795 - parms->index = nla_get_u32(data[IFLA_GRE_ERSPAN_INDEX]); 1796 - } else if (parms->erspan_ver == 2) { 1797 - if (data[IFLA_GRE_ERSPAN_DIR]) 1798 - parms->dir = nla_get_u8(data[IFLA_GRE_ERSPAN_DIR]); 1799 - if (data[IFLA_GRE_ERSPAN_HWID]) 1800 - parms->hwid = nla_get_u16(data[IFLA_GRE_ERSPAN_HWID]); 1801 - } 1802 1770 } 1803 1771 1804 1772 static int ip6gre_tap_init(struct net_device *dev) ··· 2207 2203 int err; 2208 2204 2209 2205 ip6gre_netlink_parms(data, &nt->parms); 2206 + ip6erspan_set_version(data, &nt->parms); 2210 2207 ign = net_generic(net, ip6gre_net_id); 2211 2208 2212 2209 if (nt->parms.collect_md) { ··· 2253 2248 if (IS_ERR(t)) 2254 2249 return PTR_ERR(t); 2255 2250 2251 + ip6erspan_set_version(data, &p); 2256 2252 ip6gre_tunnel_unlink_md(ign, t); 2257 2253 ip6gre_tunnel_unlink(ign, t); 2258 2254 ip6erspan_tnl_change(t, &p, !tb[IFLA_MTU]);
+5 -1
net/mac80211/cfg.c
··· 941 941 BSS_CHANGED_P2P_PS | 942 942 BSS_CHANGED_TXPOWER; 943 943 int err; 944 + int prev_beacon_int; 944 945 945 946 old = sdata_dereference(sdata->u.ap.beacon, sdata); 946 947 if (old) ··· 964 963 965 964 sdata->needed_rx_chains = sdata->local->rx_chains; 966 965 966 + prev_beacon_int = sdata->vif.bss_conf.beacon_int; 967 967 sdata->vif.bss_conf.beacon_int = params->beacon_interval; 968 968 969 969 if (params->he_cap) ··· 976 974 if (!err) 977 975 ieee80211_vif_copy_chanctx_to_vlans(sdata, false); 978 976 mutex_unlock(&local->mtx); 979 - if (err) 977 + if (err) { 978 + sdata->vif.bss_conf.beacon_int = prev_beacon_int; 980 979 return err; 980 + } 981 981 982 982 /* 983 983 * Apply control port protocol, this allows us to
+6
net/mac80211/mesh.h
··· 70 70 * @dst: mesh path destination mac address 71 71 * @mpp: mesh proxy mac address 72 72 * @rhash: rhashtable list pointer 73 + * @walk_list: linked list containing all mesh_path objects. 73 74 * @gate_list: list pointer for known gates list 74 75 * @sdata: mesh subif 75 76 * @next_hop: mesh neighbor to which frames for this destination will be ··· 107 106 u8 dst[ETH_ALEN]; 108 107 u8 mpp[ETH_ALEN]; /* used for MPP or MAP */ 109 108 struct rhash_head rhash; 109 + struct hlist_node walk_list; 110 110 struct hlist_node gate_list; 111 111 struct ieee80211_sub_if_data *sdata; 112 112 struct sta_info __rcu *next_hop; ··· 137 135 * gate's mpath may or may not be resolved and active. 138 136 * @gates_lock: protects updates to known_gates 139 137 * @rhead: the rhashtable containing struct mesh_paths, keyed by dest addr 138 + * @walk_head: linked list containging all mesh_path objects 139 + * @walk_lock: lock protecting walk_head 140 140 * @entries: number of entries in the table 141 141 */ 142 142 struct mesh_table { 143 143 struct hlist_head known_gates; 144 144 spinlock_t gates_lock; 145 145 struct rhashtable rhead; 146 + struct hlist_head walk_head; 147 + spinlock_t walk_lock; 146 148 atomic_t entries; /* Up to MAX_MESH_NEIGHBOURS */ 147 149 }; 148 150
+47 -110
net/mac80211/mesh_pathtbl.c
··· 59 59 return NULL; 60 60 61 61 INIT_HLIST_HEAD(&newtbl->known_gates); 62 + INIT_HLIST_HEAD(&newtbl->walk_head); 62 63 atomic_set(&newtbl->entries, 0); 63 64 spin_lock_init(&newtbl->gates_lock); 65 + spin_lock_init(&newtbl->walk_lock); 64 66 65 67 return newtbl; 66 68 } ··· 251 249 static struct mesh_path * 252 250 __mesh_path_lookup_by_idx(struct mesh_table *tbl, int idx) 253 251 { 254 - int i = 0, ret; 255 - struct mesh_path *mpath = NULL; 256 - struct rhashtable_iter iter; 252 + int i = 0; 253 + struct mesh_path *mpath; 257 254 258 - ret = rhashtable_walk_init(&tbl->rhead, &iter, GFP_ATOMIC); 259 - if (ret) 260 - return NULL; 261 - 262 - rhashtable_walk_start(&iter); 263 - 264 - while ((mpath = rhashtable_walk_next(&iter))) { 265 - if (IS_ERR(mpath) && PTR_ERR(mpath) == -EAGAIN) 266 - continue; 267 - if (IS_ERR(mpath)) 268 - break; 255 + hlist_for_each_entry_rcu(mpath, &tbl->walk_head, walk_list) { 269 256 if (i++ == idx) 270 257 break; 271 258 } 272 - rhashtable_walk_stop(&iter); 273 - rhashtable_walk_exit(&iter); 274 259 275 - if (IS_ERR(mpath) || !mpath) 260 + if (!mpath) 276 261 return NULL; 277 262 278 263 if (mpath_expired(mpath)) { ··· 421 432 return ERR_PTR(-ENOMEM); 422 433 423 434 tbl = sdata->u.mesh.mesh_paths; 435 + spin_lock_bh(&tbl->walk_lock); 424 436 do { 425 437 ret = rhashtable_lookup_insert_fast(&tbl->rhead, 426 438 &new_mpath->rhash, ··· 431 441 mpath = rhashtable_lookup_fast(&tbl->rhead, 432 442 dst, 433 443 mesh_rht_params); 434 - 444 + else if (!ret) 445 + hlist_add_head(&new_mpath->walk_list, &tbl->walk_head); 435 446 } while (unlikely(ret == -EEXIST && !mpath)); 447 + spin_unlock_bh(&tbl->walk_lock); 436 448 437 - if (ret && ret != -EEXIST) 438 - return ERR_PTR(ret); 439 - 440 - /* At this point either new_mpath was added, or we found a 441 - * matching entry already in the table; in the latter case 442 - * free the unnecessary new entry. 443 - */ 444 - if (ret == -EEXIST) { 449 + if (ret) { 445 450 kfree(new_mpath); 451 + 452 + if (ret != -EEXIST) 453 + return ERR_PTR(ret); 454 + 446 455 new_mpath = mpath; 447 456 } 457 + 448 458 sdata->u.mesh.mesh_paths_generation++; 449 459 return new_mpath; 450 460 } ··· 470 480 471 481 memcpy(new_mpath->mpp, mpp, ETH_ALEN); 472 482 tbl = sdata->u.mesh.mpp_paths; 483 + 484 + spin_lock_bh(&tbl->walk_lock); 473 485 ret = rhashtable_lookup_insert_fast(&tbl->rhead, 474 486 &new_mpath->rhash, 475 487 mesh_rht_params); 488 + if (!ret) 489 + hlist_add_head_rcu(&new_mpath->walk_list, &tbl->walk_head); 490 + spin_unlock_bh(&tbl->walk_lock); 491 + 492 + if (ret) 493 + kfree(new_mpath); 476 494 477 495 sdata->u.mesh.mpp_paths_generation++; 478 496 return ret; ··· 501 503 struct mesh_table *tbl = sdata->u.mesh.mesh_paths; 502 504 static const u8 bcast[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; 503 505 struct mesh_path *mpath; 504 - struct rhashtable_iter iter; 505 - int ret; 506 506 507 - ret = rhashtable_walk_init(&tbl->rhead, &iter, GFP_ATOMIC); 508 - if (ret) 509 - return; 510 - 511 - rhashtable_walk_start(&iter); 512 - 513 - while ((mpath = rhashtable_walk_next(&iter))) { 514 - if (IS_ERR(mpath) && PTR_ERR(mpath) == -EAGAIN) 515 - continue; 516 - if (IS_ERR(mpath)) 517 - break; 507 + rcu_read_lock(); 508 + hlist_for_each_entry_rcu(mpath, &tbl->walk_head, walk_list) { 518 509 if (rcu_access_pointer(mpath->next_hop) == sta && 519 510 mpath->flags & MESH_PATH_ACTIVE && 520 511 !(mpath->flags & MESH_PATH_FIXED)) { ··· 517 530 WLAN_REASON_MESH_PATH_DEST_UNREACHABLE, bcast); 518 531 } 519 532 } 520 - rhashtable_walk_stop(&iter); 521 - rhashtable_walk_exit(&iter); 533 + rcu_read_unlock(); 522 534 } 523 535 524 536 static void mesh_path_free_rcu(struct mesh_table *tbl, ··· 537 551 538 552 static void __mesh_path_del(struct mesh_table *tbl, struct mesh_path *mpath) 539 553 { 554 + hlist_del_rcu(&mpath->walk_list); 540 555 rhashtable_remove_fast(&tbl->rhead, &mpath->rhash, mesh_rht_params); 541 556 mesh_path_free_rcu(tbl, mpath); 542 557 } ··· 558 571 struct ieee80211_sub_if_data *sdata = sta->sdata; 559 572 struct mesh_table *tbl = sdata->u.mesh.mesh_paths; 560 573 struct mesh_path *mpath; 561 - struct rhashtable_iter iter; 562 - int ret; 574 + struct hlist_node *n; 563 575 564 - ret = rhashtable_walk_init(&tbl->rhead, &iter, GFP_ATOMIC); 565 - if (ret) 566 - return; 567 - 568 - rhashtable_walk_start(&iter); 569 - 570 - while ((mpath = rhashtable_walk_next(&iter))) { 571 - if (IS_ERR(mpath) && PTR_ERR(mpath) == -EAGAIN) 572 - continue; 573 - if (IS_ERR(mpath)) 574 - break; 575 - 576 + spin_lock_bh(&tbl->walk_lock); 577 + hlist_for_each_entry_safe(mpath, n, &tbl->walk_head, walk_list) { 576 578 if (rcu_access_pointer(mpath->next_hop) == sta) 577 579 __mesh_path_del(tbl, mpath); 578 580 } 579 - 580 - rhashtable_walk_stop(&iter); 581 - rhashtable_walk_exit(&iter); 581 + spin_unlock_bh(&tbl->walk_lock); 582 582 } 583 583 584 584 static void mpp_flush_by_proxy(struct ieee80211_sub_if_data *sdata, ··· 573 599 { 574 600 struct mesh_table *tbl = sdata->u.mesh.mpp_paths; 575 601 struct mesh_path *mpath; 576 - struct rhashtable_iter iter; 577 - int ret; 602 + struct hlist_node *n; 578 603 579 - ret = rhashtable_walk_init(&tbl->rhead, &iter, GFP_ATOMIC); 580 - if (ret) 581 - return; 582 - 583 - rhashtable_walk_start(&iter); 584 - 585 - while ((mpath = rhashtable_walk_next(&iter))) { 586 - if (IS_ERR(mpath) && PTR_ERR(mpath) == -EAGAIN) 587 - continue; 588 - if (IS_ERR(mpath)) 589 - break; 590 - 604 + spin_lock_bh(&tbl->walk_lock); 605 + hlist_for_each_entry_safe(mpath, n, &tbl->walk_head, walk_list) { 591 606 if (ether_addr_equal(mpath->mpp, proxy)) 592 607 __mesh_path_del(tbl, mpath); 593 608 } 594 - 595 - rhashtable_walk_stop(&iter); 596 - rhashtable_walk_exit(&iter); 609 + spin_unlock_bh(&tbl->walk_lock); 597 610 } 598 611 599 612 static void table_flush_by_iface(struct mesh_table *tbl) 600 613 { 601 614 struct mesh_path *mpath; 602 - struct rhashtable_iter iter; 603 - int ret; 615 + struct hlist_node *n; 604 616 605 - ret = rhashtable_walk_init(&tbl->rhead, &iter, GFP_ATOMIC); 606 - if (ret) 607 - return; 608 - 609 - rhashtable_walk_start(&iter); 610 - 611 - while ((mpath = rhashtable_walk_next(&iter))) { 612 - if (IS_ERR(mpath) && PTR_ERR(mpath) == -EAGAIN) 613 - continue; 614 - if (IS_ERR(mpath)) 615 - break; 617 + spin_lock_bh(&tbl->walk_lock); 618 + hlist_for_each_entry_safe(mpath, n, &tbl->walk_head, walk_list) { 616 619 __mesh_path_del(tbl, mpath); 617 620 } 618 - 619 - rhashtable_walk_stop(&iter); 620 - rhashtable_walk_exit(&iter); 621 + spin_unlock_bh(&tbl->walk_lock); 621 622 } 622 623 623 624 /** ··· 624 675 { 625 676 struct mesh_path *mpath; 626 677 627 - rcu_read_lock(); 678 + spin_lock_bh(&tbl->walk_lock); 628 679 mpath = rhashtable_lookup_fast(&tbl->rhead, addr, mesh_rht_params); 629 680 if (!mpath) { 630 - rcu_read_unlock(); 681 + spin_unlock_bh(&tbl->walk_lock); 631 682 return -ENXIO; 632 683 } 633 684 634 685 __mesh_path_del(tbl, mpath); 635 - rcu_read_unlock(); 686 + spin_unlock_bh(&tbl->walk_lock); 636 687 return 0; 637 688 } 638 689 ··· 803 854 struct mesh_table *tbl) 804 855 { 805 856 struct mesh_path *mpath; 806 - struct rhashtable_iter iter; 807 - int ret; 857 + struct hlist_node *n; 808 858 809 - ret = rhashtable_walk_init(&tbl->rhead, &iter, GFP_KERNEL); 810 - if (ret) 811 - return; 812 - 813 - rhashtable_walk_start(&iter); 814 - 815 - while ((mpath = rhashtable_walk_next(&iter))) { 816 - if (IS_ERR(mpath) && PTR_ERR(mpath) == -EAGAIN) 817 - continue; 818 - if (IS_ERR(mpath)) 819 - break; 859 + spin_lock_bh(&tbl->walk_lock); 860 + hlist_for_each_entry_safe(mpath, n, &tbl->walk_head, walk_list) { 820 861 if ((!(mpath->flags & MESH_PATH_RESOLVING)) && 821 862 (!(mpath->flags & MESH_PATH_FIXED)) && 822 863 time_after(jiffies, mpath->exp_time + MESH_PATH_EXPIRE)) 823 864 __mesh_path_del(tbl, mpath); 824 865 } 825 - 826 - rhashtable_walk_stop(&iter); 827 - rhashtable_walk_exit(&iter); 866 + spin_unlock_bh(&tbl->walk_lock); 828 867 } 829 868 830 869 void mesh_path_expire(struct ieee80211_sub_if_data *sdata)
+2 -1
net/netfilter/ipvs/ip_vs_ctl.c
··· 896 896 { 897 897 struct ip_vs_dest *dest; 898 898 unsigned int atype, i; 899 - int ret = 0; 900 899 901 900 EnterFunction(2); 902 901 903 902 #ifdef CONFIG_IP_VS_IPV6 904 903 if (udest->af == AF_INET6) { 904 + int ret; 905 + 905 906 atype = ipv6_addr_type(&udest->addr.in6); 906 907 if ((!(atype & IPV6_ADDR_UNICAST) || 907 908 atype & IPV6_ADDR_LINKLOCAL) &&
+3
net/netfilter/nf_tables_api.c
··· 328 328 int err; 329 329 330 330 list_for_each_entry(rule, &ctx->chain->rules, list) { 331 + if (!nft_is_active_next(ctx->net, rule)) 332 + continue; 333 + 331 334 err = nft_delrule(ctx, rule); 332 335 if (err < 0) 333 336 return err;
+38 -11
net/sunrpc/auth_gss/gss_krb5_seqnum.c
··· 44 44 unsigned char *cksum, unsigned char *buf) 45 45 { 46 46 struct crypto_sync_skcipher *cipher; 47 - unsigned char plain[8]; 47 + unsigned char *plain; 48 48 s32 code; 49 49 50 50 dprintk("RPC: %s:\n", __func__); 51 51 cipher = crypto_alloc_sync_skcipher(kctx->gk5e->encrypt_name, 0, 0); 52 52 if (IS_ERR(cipher)) 53 53 return PTR_ERR(cipher); 54 + 55 + plain = kmalloc(8, GFP_NOFS); 56 + if (!plain) 57 + return -ENOMEM; 54 58 55 59 plain[0] = (unsigned char) ((seqnum >> 24) & 0xff); 56 60 plain[1] = (unsigned char) ((seqnum >> 16) & 0xff); ··· 71 67 72 68 code = krb5_encrypt(cipher, cksum, plain, buf, 8); 73 69 out: 70 + kfree(plain); 74 71 crypto_free_sync_skcipher(cipher); 75 72 return code; 76 73 } ··· 82 77 u32 seqnum, 83 78 unsigned char *cksum, unsigned char *buf) 84 79 { 85 - unsigned char plain[8]; 80 + unsigned char *plain; 81 + s32 code; 86 82 87 83 if (kctx->enctype == ENCTYPE_ARCFOUR_HMAC) 88 84 return krb5_make_rc4_seq_num(kctx, direction, seqnum, 89 85 cksum, buf); 86 + 87 + plain = kmalloc(8, GFP_NOFS); 88 + if (!plain) 89 + return -ENOMEM; 90 90 91 91 plain[0] = (unsigned char) (seqnum & 0xff); 92 92 plain[1] = (unsigned char) ((seqnum >> 8) & 0xff); ··· 103 93 plain[6] = direction; 104 94 plain[7] = direction; 105 95 106 - return krb5_encrypt(key, cksum, plain, buf, 8); 96 + code = krb5_encrypt(key, cksum, plain, buf, 8); 97 + kfree(plain); 98 + return code; 107 99 } 108 100 109 101 static s32 ··· 113 101 unsigned char *buf, int *direction, s32 *seqnum) 114 102 { 115 103 struct crypto_sync_skcipher *cipher; 116 - unsigned char plain[8]; 104 + unsigned char *plain; 117 105 s32 code; 118 106 119 107 dprintk("RPC: %s:\n", __func__); ··· 125 113 if (code) 126 114 goto out; 127 115 116 + plain = kmalloc(8, GFP_NOFS); 117 + if (!plain) { 118 + code = -ENOMEM; 119 + goto out; 120 + } 121 + 128 122 code = krb5_decrypt(cipher, cksum, buf, plain, 8); 129 123 if (code) 130 - goto out; 124 + goto out_plain; 131 125 132 126 if ((plain[4] != plain[5]) || (plain[4] != plain[6]) 133 127 || (plain[4] != plain[7])) { 134 128 code = (s32)KG_BAD_SEQ; 135 - goto out; 129 + goto out_plain; 136 130 } 137 131 138 132 *direction = plain[4]; 139 133 140 134 *seqnum = ((plain[0] << 24) | (plain[1] << 16) | 141 135 (plain[2] << 8) | (plain[3])); 136 + out_plain: 137 + kfree(plain); 142 138 out: 143 139 crypto_free_sync_skcipher(cipher); 144 140 return code; ··· 159 139 int *direction, u32 *seqnum) 160 140 { 161 141 s32 code; 162 - unsigned char plain[8]; 142 + unsigned char *plain; 163 143 struct crypto_sync_skcipher *key = kctx->seq; 164 144 165 145 dprintk("RPC: krb5_get_seq_num:\n"); ··· 167 147 if (kctx->enctype == ENCTYPE_ARCFOUR_HMAC) 168 148 return krb5_get_rc4_seq_num(kctx, cksum, buf, 169 149 direction, seqnum); 150 + plain = kmalloc(8, GFP_NOFS); 151 + if (!plain) 152 + return -ENOMEM; 170 153 171 154 if ((code = krb5_decrypt(key, cksum, buf, plain, 8))) 172 - return code; 155 + goto out; 173 156 174 157 if ((plain[4] != plain[5]) || (plain[4] != plain[6]) || 175 - (plain[4] != plain[7])) 176 - return (s32)KG_BAD_SEQ; 158 + (plain[4] != plain[7])) { 159 + code = (s32)KG_BAD_SEQ; 160 + goto out; 161 + } 177 162 178 163 *direction = plain[4]; 179 164 180 165 *seqnum = ((plain[0]) | 181 166 (plain[1] << 8) | (plain[2] << 16) | (plain[3] << 24)); 182 167 183 - return 0; 168 + out: 169 + kfree(plain); 170 + return code; 184 171 }
+1 -1
net/sunrpc/debugfs.c
··· 146 146 rcu_read_lock(); 147 147 xprt = rcu_dereference(clnt->cl_xprt); 148 148 /* no "debugfs" dentry? Don't bother with the symlink. */ 149 - if (!xprt->debugfs) { 149 + if (IS_ERR_OR_NULL(xprt->debugfs)) { 150 150 rcu_read_unlock(); 151 151 return; 152 152 }
+2 -1
net/sunrpc/xprtrdma/verbs.c
··· 527 527 528 528 sendcq = ib_alloc_cq(ia->ri_device, NULL, 529 529 ep->rep_attr.cap.max_send_wr + 1, 530 - 1, IB_POLL_WORKQUEUE); 530 + ia->ri_device->num_comp_vectors > 1 ? 1 : 0, 531 + IB_POLL_WORKQUEUE); 531 532 if (IS_ERR(sendcq)) { 532 533 rc = PTR_ERR(sendcq); 533 534 goto out1;
+6 -5
net/xdp/xdp_umem.c
··· 129 129 return 0; 130 130 131 131 err_unreg_umem: 132 - xdp_clear_umem_at_qid(dev, queue_id); 133 132 if (!force_zc) 134 133 err = 0; /* fallback to copy mode */ 134 + if (err) 135 + xdp_clear_umem_at_qid(dev, queue_id); 135 136 out_rtnl_unlock: 136 137 rtnl_unlock(); 137 138 return err; ··· 266 265 if (!umem->pgs) 267 266 return -ENOMEM; 268 267 269 - down_write(&current->mm->mmap_sem); 270 - npgs = get_user_pages(umem->address, umem->npgs, 271 - gup_flags, &umem->pgs[0], NULL); 272 - up_write(&current->mm->mmap_sem); 268 + down_read(&current->mm->mmap_sem); 269 + npgs = get_user_pages_longterm(umem->address, umem->npgs, 270 + gup_flags, &umem->pgs[0], NULL); 271 + up_read(&current->mm->mmap_sem); 273 272 274 273 if (npgs != umem->npgs) { 275 274 if (npgs >= 0) {
+4
net/xdp/xsk.c
··· 669 669 if (!umem) 670 670 return -EINVAL; 671 671 672 + /* Matches the smp_wmb() in XDP_UMEM_REG */ 673 + smp_rmb(); 672 674 if (offset == XDP_UMEM_PGOFF_FILL_RING) 673 675 q = READ_ONCE(umem->fq); 674 676 else if (offset == XDP_UMEM_PGOFF_COMPLETION_RING) ··· 680 678 if (!q) 681 679 return -EINVAL; 682 680 681 + /* Matches the smp_wmb() in xsk_init_queue */ 682 + smp_rmb(); 683 683 qpg = virt_to_head_page(q->ring); 684 684 if (size > (PAGE_SIZE << compound_order(qpg))) 685 685 return -EINVAL;
+10
virt/kvm/arm/arm.c
··· 626 626 /* Awaken to handle a signal, request we sleep again later. */ 627 627 kvm_make_request(KVM_REQ_SLEEP, vcpu); 628 628 } 629 + 630 + /* 631 + * Make sure we will observe a potential reset request if we've 632 + * observed a change to the power state. Pairs with the smp_wmb() in 633 + * kvm_psci_vcpu_on(). 634 + */ 635 + smp_rmb(); 629 636 } 630 637 631 638 static int kvm_vcpu_initialized(struct kvm_vcpu *vcpu) ··· 645 638 if (kvm_request_pending(vcpu)) { 646 639 if (kvm_check_request(KVM_REQ_SLEEP, vcpu)) 647 640 vcpu_req_sleep(vcpu); 641 + 642 + if (kvm_check_request(KVM_REQ_VCPU_RESET, vcpu)) 643 + kvm_reset_vcpu(vcpu); 648 644 649 645 /* 650 646 * Clear IRQ_PENDING requests that were made to guarantee
+6 -3
virt/kvm/arm/mmu.c
··· 1695 1695 1696 1696 vma_pagesize = vma_kernel_pagesize(vma); 1697 1697 /* 1698 - * PUD level may not exist for a VM but PMD is guaranteed to 1699 - * exist. 1698 + * The stage2 has a minimum of 2 level table (For arm64 see 1699 + * kvm_arm_setup_stage2()). Hence, we are guaranteed that we can 1700 + * use PMD_SIZE huge mappings (even when the PMD is folded into PGD). 1701 + * As for PUD huge maps, we must make sure that we have at least 1702 + * 3 levels, i.e, PMD is not folded. 1700 1703 */ 1701 1704 if ((vma_pagesize == PMD_SIZE || 1702 - (vma_pagesize == PUD_SIZE && kvm_stage2_has_pud(kvm))) && 1705 + (vma_pagesize == PUD_SIZE && kvm_stage2_has_pmd(kvm))) && 1703 1706 !force_pte) { 1704 1707 gfn = (fault_ipa & huge_page_mask(hstate_vma(vma))) >> PAGE_SHIFT; 1705 1708 }
+16 -20
virt/kvm/arm/psci.c
··· 104 104 105 105 static unsigned long kvm_psci_vcpu_on(struct kvm_vcpu *source_vcpu) 106 106 { 107 + struct vcpu_reset_state *reset_state; 107 108 struct kvm *kvm = source_vcpu->kvm; 108 109 struct kvm_vcpu *vcpu = NULL; 109 - struct swait_queue_head *wq; 110 110 unsigned long cpu_id; 111 - unsigned long context_id; 112 - phys_addr_t target_pc; 113 111 114 112 cpu_id = smccc_get_arg1(source_vcpu) & MPIDR_HWID_BITMASK; 115 113 if (vcpu_mode_is_32bit(source_vcpu)) ··· 128 130 return PSCI_RET_INVALID_PARAMS; 129 131 } 130 132 131 - target_pc = smccc_get_arg2(source_vcpu); 132 - context_id = smccc_get_arg3(source_vcpu); 133 + reset_state = &vcpu->arch.reset_state; 133 134 134 - kvm_reset_vcpu(vcpu); 135 - 136 - /* Gracefully handle Thumb2 entry point */ 137 - if (vcpu_mode_is_32bit(vcpu) && (target_pc & 1)) { 138 - target_pc &= ~((phys_addr_t) 1); 139 - vcpu_set_thumb(vcpu); 140 - } 135 + reset_state->pc = smccc_get_arg2(source_vcpu); 141 136 142 137 /* Propagate caller endianness */ 143 - if (kvm_vcpu_is_be(source_vcpu)) 144 - kvm_vcpu_set_be(vcpu); 138 + reset_state->be = kvm_vcpu_is_be(source_vcpu); 145 139 146 - *vcpu_pc(vcpu) = target_pc; 147 140 /* 148 141 * NOTE: We always update r0 (or x0) because for PSCI v0.1 149 142 * the general puspose registers are undefined upon CPU_ON. 150 143 */ 151 - smccc_set_retval(vcpu, context_id, 0, 0, 0); 152 - vcpu->arch.power_off = false; 153 - smp_mb(); /* Make sure the above is visible */ 144 + reset_state->r0 = smccc_get_arg3(source_vcpu); 154 145 155 - wq = kvm_arch_vcpu_wq(vcpu); 156 - swake_up_one(wq); 146 + WRITE_ONCE(reset_state->reset, true); 147 + kvm_make_request(KVM_REQ_VCPU_RESET, vcpu); 148 + 149 + /* 150 + * Make sure the reset request is observed if the change to 151 + * power_state is observed. 152 + */ 153 + smp_wmb(); 154 + 155 + vcpu->arch.power_off = false; 156 + kvm_vcpu_wake_up(vcpu); 157 157 158 158 return PSCI_RET_SUCCESS; 159 159 }
+2 -2
virt/kvm/arm/vgic/vgic-debug.c
··· 251 251 return 0; 252 252 } 253 253 254 - spin_lock_irqsave(&irq->irq_lock, flags); 254 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 255 255 print_irq_state(s, irq, vcpu); 256 - spin_unlock_irqrestore(&irq->irq_lock, flags); 256 + raw_spin_unlock_irqrestore(&irq->irq_lock, flags); 257 257 258 258 vgic_put_irq(kvm, irq); 259 259 return 0;
+18 -12
virt/kvm/arm/vgic/vgic-init.c
··· 64 64 struct vgic_dist *dist = &kvm->arch.vgic; 65 65 66 66 INIT_LIST_HEAD(&dist->lpi_list_head); 67 - spin_lock_init(&dist->lpi_list_lock); 67 + raw_spin_lock_init(&dist->lpi_list_lock); 68 68 } 69 69 70 70 /* CREATION */ ··· 171 171 172 172 irq->intid = i + VGIC_NR_PRIVATE_IRQS; 173 173 INIT_LIST_HEAD(&irq->ap_list); 174 - spin_lock_init(&irq->irq_lock); 174 + raw_spin_lock_init(&irq->irq_lock); 175 175 irq->vcpu = NULL; 176 176 irq->target_vcpu = vcpu0; 177 177 kref_init(&irq->refcount); ··· 206 206 vgic_cpu->sgi_iodev.base_addr = VGIC_ADDR_UNDEF; 207 207 208 208 INIT_LIST_HEAD(&vgic_cpu->ap_list_head); 209 - spin_lock_init(&vgic_cpu->ap_list_lock); 209 + raw_spin_lock_init(&vgic_cpu->ap_list_lock); 210 210 211 211 /* 212 212 * Enable and configure all SGIs to be edge-triggered and ··· 216 216 struct vgic_irq *irq = &vgic_cpu->private_irqs[i]; 217 217 218 218 INIT_LIST_HEAD(&irq->ap_list); 219 - spin_lock_init(&irq->irq_lock); 219 + raw_spin_lock_init(&irq->irq_lock); 220 220 irq->intid = i; 221 221 irq->vcpu = NULL; 222 222 irq->target_vcpu = vcpu; ··· 231 231 irq->config = VGIC_CONFIG_LEVEL; 232 232 } 233 233 234 - /* 235 - * GICv3 can only be created via the KVM_DEVICE_CREATE API and 236 - * so we always know the emulation type at this point as it's 237 - * either explicitly configured as GICv3, or explicitly 238 - * configured as GICv2, or not configured yet which also 239 - * implies GICv2. 240 - */ 241 234 if (dist->vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3) 242 235 irq->group = 1; 243 236 else ··· 274 281 { 275 282 struct vgic_dist *dist = &kvm->arch.vgic; 276 283 struct kvm_vcpu *vcpu; 277 - int ret = 0, i; 284 + int ret = 0, i, idx; 278 285 279 286 if (vgic_initialized(kvm)) 280 287 return 0; ··· 290 297 ret = kvm_vgic_dist_init(kvm, dist->nr_spis); 291 298 if (ret) 292 299 goto out; 300 + 301 + /* Initialize groups on CPUs created before the VGIC type was known */ 302 + kvm_for_each_vcpu(idx, vcpu, kvm) { 303 + struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu; 304 + 305 + for (i = 0; i < VGIC_NR_PRIVATE_IRQS; i++) { 306 + struct vgic_irq *irq = &vgic_cpu->private_irqs[i]; 307 + if (dist->vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3) 308 + irq->group = 1; 309 + else 310 + irq->group = 0; 311 + } 312 + } 293 313 294 314 if (vgic_has_its(kvm)) { 295 315 ret = vgic_v4_init(kvm);
+11 -11
virt/kvm/arm/vgic/vgic-its.c
··· 65 65 66 66 INIT_LIST_HEAD(&irq->lpi_list); 67 67 INIT_LIST_HEAD(&irq->ap_list); 68 - spin_lock_init(&irq->irq_lock); 68 + raw_spin_lock_init(&irq->irq_lock); 69 69 70 70 irq->config = VGIC_CONFIG_EDGE; 71 71 kref_init(&irq->refcount); ··· 73 73 irq->target_vcpu = vcpu; 74 74 irq->group = 1; 75 75 76 - spin_lock_irqsave(&dist->lpi_list_lock, flags); 76 + raw_spin_lock_irqsave(&dist->lpi_list_lock, flags); 77 77 78 78 /* 79 79 * There could be a race with another vgic_add_lpi(), so we need to ··· 101 101 dist->lpi_list_count++; 102 102 103 103 out_unlock: 104 - spin_unlock_irqrestore(&dist->lpi_list_lock, flags); 104 + raw_spin_unlock_irqrestore(&dist->lpi_list_lock, flags); 105 105 106 106 /* 107 107 * We "cache" the configuration table entries in our struct vgic_irq's. ··· 287 287 if (ret) 288 288 return ret; 289 289 290 - spin_lock_irqsave(&irq->irq_lock, flags); 290 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 291 291 292 292 if (!filter_vcpu || filter_vcpu == irq->target_vcpu) { 293 293 irq->priority = LPI_PROP_PRIORITY(prop); ··· 299 299 } 300 300 } 301 301 302 - spin_unlock_irqrestore(&irq->irq_lock, flags); 302 + raw_spin_unlock_irqrestore(&irq->irq_lock, flags); 303 303 304 304 if (irq->hw) 305 305 return its_prop_update_vlpi(irq->host_irq, prop, needs_inv); ··· 332 332 if (!intids) 333 333 return -ENOMEM; 334 334 335 - spin_lock_irqsave(&dist->lpi_list_lock, flags); 335 + raw_spin_lock_irqsave(&dist->lpi_list_lock, flags); 336 336 list_for_each_entry(irq, &dist->lpi_list_head, lpi_list) { 337 337 if (i == irq_count) 338 338 break; ··· 341 341 continue; 342 342 intids[i++] = irq->intid; 343 343 } 344 - spin_unlock_irqrestore(&dist->lpi_list_lock, flags); 344 + raw_spin_unlock_irqrestore(&dist->lpi_list_lock, flags); 345 345 346 346 *intid_ptr = intids; 347 347 return i; ··· 352 352 int ret = 0; 353 353 unsigned long flags; 354 354 355 - spin_lock_irqsave(&irq->irq_lock, flags); 355 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 356 356 irq->target_vcpu = vcpu; 357 - spin_unlock_irqrestore(&irq->irq_lock, flags); 357 + raw_spin_unlock_irqrestore(&irq->irq_lock, flags); 358 358 359 359 if (irq->hw) { 360 360 struct its_vlpi_map map; ··· 455 455 } 456 456 457 457 irq = vgic_get_irq(vcpu->kvm, NULL, intids[i]); 458 - spin_lock_irqsave(&irq->irq_lock, flags); 458 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 459 459 irq->pending_latch = pendmask & (1U << bit_nr); 460 460 vgic_queue_irq_unlock(vcpu->kvm, irq, flags); 461 461 vgic_put_irq(vcpu->kvm, irq); ··· 612 612 return irq_set_irqchip_state(irq->host_irq, 613 613 IRQCHIP_STATE_PENDING, true); 614 614 615 - spin_lock_irqsave(&irq->irq_lock, flags); 615 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 616 616 irq->pending_latch = true; 617 617 vgic_queue_irq_unlock(kvm, irq, flags); 618 618
+7 -7
virt/kvm/arm/vgic/vgic-mmio-v2.c
··· 147 147 148 148 irq = vgic_get_irq(source_vcpu->kvm, vcpu, intid); 149 149 150 - spin_lock_irqsave(&irq->irq_lock, flags); 150 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 151 151 irq->pending_latch = true; 152 152 irq->source |= 1U << source_vcpu->vcpu_id; 153 153 ··· 191 191 struct vgic_irq *irq = vgic_get_irq(vcpu->kvm, NULL, intid + i); 192 192 int target; 193 193 194 - spin_lock_irqsave(&irq->irq_lock, flags); 194 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 195 195 196 196 irq->targets = (val >> (i * 8)) & cpu_mask; 197 197 target = irq->targets ? __ffs(irq->targets) : 0; 198 198 irq->target_vcpu = kvm_get_vcpu(vcpu->kvm, target); 199 199 200 - spin_unlock_irqrestore(&irq->irq_lock, flags); 200 + raw_spin_unlock_irqrestore(&irq->irq_lock, flags); 201 201 vgic_put_irq(vcpu->kvm, irq); 202 202 } 203 203 } ··· 230 230 for (i = 0; i < len; i++) { 231 231 struct vgic_irq *irq = vgic_get_irq(vcpu->kvm, vcpu, intid + i); 232 232 233 - spin_lock_irqsave(&irq->irq_lock, flags); 233 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 234 234 235 235 irq->source &= ~((val >> (i * 8)) & 0xff); 236 236 if (!irq->source) 237 237 irq->pending_latch = false; 238 238 239 - spin_unlock_irqrestore(&irq->irq_lock, flags); 239 + raw_spin_unlock_irqrestore(&irq->irq_lock, flags); 240 240 vgic_put_irq(vcpu->kvm, irq); 241 241 } 242 242 } ··· 252 252 for (i = 0; i < len; i++) { 253 253 struct vgic_irq *irq = vgic_get_irq(vcpu->kvm, vcpu, intid + i); 254 254 255 - spin_lock_irqsave(&irq->irq_lock, flags); 255 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 256 256 257 257 irq->source |= (val >> (i * 8)) & 0xff; 258 258 ··· 260 260 irq->pending_latch = true; 261 261 vgic_queue_irq_unlock(vcpu->kvm, irq, flags); 262 262 } else { 263 - spin_unlock_irqrestore(&irq->irq_lock, flags); 263 + raw_spin_unlock_irqrestore(&irq->irq_lock, flags); 264 264 } 265 265 vgic_put_irq(vcpu->kvm, irq); 266 266 }
+6 -6
virt/kvm/arm/vgic/vgic-mmio-v3.c
··· 169 169 if (!irq) 170 170 return; 171 171 172 - spin_lock_irqsave(&irq->irq_lock, flags); 172 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 173 173 174 174 /* We only care about and preserve Aff0, Aff1 and Aff2. */ 175 175 irq->mpidr = val & GENMASK(23, 0); 176 176 irq->target_vcpu = kvm_mpidr_to_vcpu(vcpu->kvm, irq->mpidr); 177 177 178 - spin_unlock_irqrestore(&irq->irq_lock, flags); 178 + raw_spin_unlock_irqrestore(&irq->irq_lock, flags); 179 179 vgic_put_irq(vcpu->kvm, irq); 180 180 } 181 181 ··· 281 281 for (i = 0; i < len * 8; i++) { 282 282 struct vgic_irq *irq = vgic_get_irq(vcpu->kvm, vcpu, intid + i); 283 283 284 - spin_lock_irqsave(&irq->irq_lock, flags); 284 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 285 285 if (test_bit(i, &val)) { 286 286 /* 287 287 * pending_latch is set irrespective of irq type ··· 292 292 vgic_queue_irq_unlock(vcpu->kvm, irq, flags); 293 293 } else { 294 294 irq->pending_latch = false; 295 - spin_unlock_irqrestore(&irq->irq_lock, flags); 295 + raw_spin_unlock_irqrestore(&irq->irq_lock, flags); 296 296 } 297 297 298 298 vgic_put_irq(vcpu->kvm, irq); ··· 957 957 958 958 irq = vgic_get_irq(vcpu->kvm, c_vcpu, sgi); 959 959 960 - spin_lock_irqsave(&irq->irq_lock, flags); 960 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 961 961 962 962 /* 963 963 * An access targetting Group0 SGIs can only generate ··· 968 968 irq->pending_latch = true; 969 969 vgic_queue_irq_unlock(vcpu->kvm, irq, flags); 970 970 } else { 971 - spin_unlock_irqrestore(&irq->irq_lock, flags); 971 + raw_spin_unlock_irqrestore(&irq->irq_lock, flags); 972 972 } 973 973 974 974 vgic_put_irq(vcpu->kvm, irq);
+17 -17
virt/kvm/arm/vgic/vgic-mmio.c
··· 77 77 for (i = 0; i < len * 8; i++) { 78 78 struct vgic_irq *irq = vgic_get_irq(vcpu->kvm, vcpu, intid + i); 79 79 80 - spin_lock_irqsave(&irq->irq_lock, flags); 80 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 81 81 irq->group = !!(val & BIT(i)); 82 82 vgic_queue_irq_unlock(vcpu->kvm, irq, flags); 83 83 ··· 120 120 for_each_set_bit(i, &val, len * 8) { 121 121 struct vgic_irq *irq = vgic_get_irq(vcpu->kvm, vcpu, intid + i); 122 122 123 - spin_lock_irqsave(&irq->irq_lock, flags); 123 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 124 124 irq->enabled = true; 125 125 vgic_queue_irq_unlock(vcpu->kvm, irq, flags); 126 126 ··· 139 139 for_each_set_bit(i, &val, len * 8) { 140 140 struct vgic_irq *irq = vgic_get_irq(vcpu->kvm, vcpu, intid + i); 141 141 142 - spin_lock_irqsave(&irq->irq_lock, flags); 142 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 143 143 144 144 irq->enabled = false; 145 145 146 - spin_unlock_irqrestore(&irq->irq_lock, flags); 146 + raw_spin_unlock_irqrestore(&irq->irq_lock, flags); 147 147 vgic_put_irq(vcpu->kvm, irq); 148 148 } 149 149 } ··· 160 160 struct vgic_irq *irq = vgic_get_irq(vcpu->kvm, vcpu, intid + i); 161 161 unsigned long flags; 162 162 163 - spin_lock_irqsave(&irq->irq_lock, flags); 163 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 164 164 if (irq_is_pending(irq)) 165 165 value |= (1U << i); 166 - spin_unlock_irqrestore(&irq->irq_lock, flags); 166 + raw_spin_unlock_irqrestore(&irq->irq_lock, flags); 167 167 168 168 vgic_put_irq(vcpu->kvm, irq); 169 169 } ··· 215 215 for_each_set_bit(i, &val, len * 8) { 216 216 struct vgic_irq *irq = vgic_get_irq(vcpu->kvm, vcpu, intid + i); 217 217 218 - spin_lock_irqsave(&irq->irq_lock, flags); 218 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 219 219 if (irq->hw) 220 220 vgic_hw_irq_spending(vcpu, irq, is_uaccess); 221 221 else ··· 262 262 for_each_set_bit(i, &val, len * 8) { 263 263 struct vgic_irq *irq = vgic_get_irq(vcpu->kvm, vcpu, intid + i); 264 264 265 - spin_lock_irqsave(&irq->irq_lock, flags); 265 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 266 266 267 267 if (irq->hw) 268 268 vgic_hw_irq_cpending(vcpu, irq, is_uaccess); 269 269 else 270 270 irq->pending_latch = false; 271 271 272 - spin_unlock_irqrestore(&irq->irq_lock, flags); 272 + raw_spin_unlock_irqrestore(&irq->irq_lock, flags); 273 273 vgic_put_irq(vcpu->kvm, irq); 274 274 } 275 275 } ··· 311 311 unsigned long flags; 312 312 struct kvm_vcpu *requester_vcpu = vgic_get_mmio_requester_vcpu(); 313 313 314 - spin_lock_irqsave(&irq->irq_lock, flags); 314 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 315 315 316 316 if (irq->hw) { 317 317 vgic_hw_irq_change_active(vcpu, irq, active, !requester_vcpu); ··· 342 342 if (irq->active) 343 343 vgic_queue_irq_unlock(vcpu->kvm, irq, flags); 344 344 else 345 - spin_unlock_irqrestore(&irq->irq_lock, flags); 345 + raw_spin_unlock_irqrestore(&irq->irq_lock, flags); 346 346 } 347 347 348 348 /* ··· 485 485 for (i = 0; i < len; i++) { 486 486 struct vgic_irq *irq = vgic_get_irq(vcpu->kvm, vcpu, intid + i); 487 487 488 - spin_lock_irqsave(&irq->irq_lock, flags); 488 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 489 489 /* Narrow the priority range to what we actually support */ 490 490 irq->priority = (val >> (i * 8)) & GENMASK(7, 8 - VGIC_PRI_BITS); 491 - spin_unlock_irqrestore(&irq->irq_lock, flags); 491 + raw_spin_unlock_irqrestore(&irq->irq_lock, flags); 492 492 493 493 vgic_put_irq(vcpu->kvm, irq); 494 494 } ··· 534 534 continue; 535 535 536 536 irq = vgic_get_irq(vcpu->kvm, vcpu, intid + i); 537 - spin_lock_irqsave(&irq->irq_lock, flags); 537 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 538 538 539 539 if (test_bit(i * 2 + 1, &val)) 540 540 irq->config = VGIC_CONFIG_EDGE; 541 541 else 542 542 irq->config = VGIC_CONFIG_LEVEL; 543 543 544 - spin_unlock_irqrestore(&irq->irq_lock, flags); 544 + raw_spin_unlock_irqrestore(&irq->irq_lock, flags); 545 545 vgic_put_irq(vcpu->kvm, irq); 546 546 } 547 547 } ··· 590 590 * restore irq config before line level. 591 591 */ 592 592 new_level = !!(val & (1U << i)); 593 - spin_lock_irqsave(&irq->irq_lock, flags); 593 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 594 594 irq->line_level = new_level; 595 595 if (new_level) 596 596 vgic_queue_irq_unlock(vcpu->kvm, irq, flags); 597 597 else 598 - spin_unlock_irqrestore(&irq->irq_lock, flags); 598 + raw_spin_unlock_irqrestore(&irq->irq_lock, flags); 599 599 600 600 vgic_put_irq(vcpu->kvm, irq); 601 601 }
+2 -2
virt/kvm/arm/vgic/vgic-v2.c
··· 84 84 85 85 irq = vgic_get_irq(vcpu->kvm, vcpu, intid); 86 86 87 - spin_lock(&irq->irq_lock); 87 + raw_spin_lock(&irq->irq_lock); 88 88 89 89 /* Always preserve the active bit */ 90 90 irq->active = !!(val & GICH_LR_ACTIVE_BIT); ··· 127 127 vgic_irq_set_phys_active(irq, false); 128 128 } 129 129 130 - spin_unlock(&irq->irq_lock); 130 + raw_spin_unlock(&irq->irq_lock); 131 131 vgic_put_irq(vcpu->kvm, irq); 132 132 } 133 133
+4 -4
virt/kvm/arm/vgic/vgic-v3.c
··· 76 76 if (!irq) /* An LPI could have been unmapped. */ 77 77 continue; 78 78 79 - spin_lock(&irq->irq_lock); 79 + raw_spin_lock(&irq->irq_lock); 80 80 81 81 /* Always preserve the active bit */ 82 82 irq->active = !!(val & ICH_LR_ACTIVE_BIT); ··· 119 119 vgic_irq_set_phys_active(irq, false); 120 120 } 121 121 122 - spin_unlock(&irq->irq_lock); 122 + raw_spin_unlock(&irq->irq_lock); 123 123 vgic_put_irq(vcpu->kvm, irq); 124 124 } 125 125 ··· 347 347 348 348 status = val & (1 << bit_nr); 349 349 350 - spin_lock_irqsave(&irq->irq_lock, flags); 350 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 351 351 if (irq->target_vcpu != vcpu) { 352 - spin_unlock_irqrestore(&irq->irq_lock, flags); 352 + raw_spin_unlock_irqrestore(&irq->irq_lock, flags); 353 353 goto retry; 354 354 } 355 355 irq->pending_latch = status;
+59 -59
virt/kvm/arm/vgic/vgic.c
··· 54 54 * When taking more than one ap_list_lock at the same time, always take the 55 55 * lowest numbered VCPU's ap_list_lock first, so: 56 56 * vcpuX->vcpu_id < vcpuY->vcpu_id: 57 - * spin_lock(vcpuX->arch.vgic_cpu.ap_list_lock); 58 - * spin_lock(vcpuY->arch.vgic_cpu.ap_list_lock); 57 + * raw_spin_lock(vcpuX->arch.vgic_cpu.ap_list_lock); 58 + * raw_spin_lock(vcpuY->arch.vgic_cpu.ap_list_lock); 59 59 * 60 60 * Since the VGIC must support injecting virtual interrupts from ISRs, we have 61 - * to use the spin_lock_irqsave/spin_unlock_irqrestore versions of outer 61 + * to use the raw_spin_lock_irqsave/raw_spin_unlock_irqrestore versions of outer 62 62 * spinlocks for any lock that may be taken while injecting an interrupt. 63 63 */ 64 64 ··· 72 72 struct vgic_irq *irq = NULL; 73 73 unsigned long flags; 74 74 75 - spin_lock_irqsave(&dist->lpi_list_lock, flags); 75 + raw_spin_lock_irqsave(&dist->lpi_list_lock, flags); 76 76 77 77 list_for_each_entry(irq, &dist->lpi_list_head, lpi_list) { 78 78 if (irq->intid != intid) ··· 88 88 irq = NULL; 89 89 90 90 out_unlock: 91 - spin_unlock_irqrestore(&dist->lpi_list_lock, flags); 91 + raw_spin_unlock_irqrestore(&dist->lpi_list_lock, flags); 92 92 93 93 return irq; 94 94 } ··· 138 138 if (irq->intid < VGIC_MIN_LPI) 139 139 return; 140 140 141 - spin_lock_irqsave(&dist->lpi_list_lock, flags); 141 + raw_spin_lock_irqsave(&dist->lpi_list_lock, flags); 142 142 if (!kref_put(&irq->refcount, vgic_irq_release)) { 143 - spin_unlock_irqrestore(&dist->lpi_list_lock, flags); 143 + raw_spin_unlock_irqrestore(&dist->lpi_list_lock, flags); 144 144 return; 145 145 }; 146 146 147 147 list_del(&irq->lpi_list); 148 148 dist->lpi_list_count--; 149 - spin_unlock_irqrestore(&dist->lpi_list_lock, flags); 149 + raw_spin_unlock_irqrestore(&dist->lpi_list_lock, flags); 150 150 151 151 kfree(irq); 152 152 } ··· 244 244 bool penda, pendb; 245 245 int ret; 246 246 247 - spin_lock(&irqa->irq_lock); 248 - spin_lock_nested(&irqb->irq_lock, SINGLE_DEPTH_NESTING); 247 + raw_spin_lock(&irqa->irq_lock); 248 + raw_spin_lock_nested(&irqb->irq_lock, SINGLE_DEPTH_NESTING); 249 249 250 250 if (irqa->active || irqb->active) { 251 251 ret = (int)irqb->active - (int)irqa->active; ··· 263 263 /* Both pending and enabled, sort by priority */ 264 264 ret = irqa->priority - irqb->priority; 265 265 out: 266 - spin_unlock(&irqb->irq_lock); 267 - spin_unlock(&irqa->irq_lock); 266 + raw_spin_unlock(&irqb->irq_lock); 267 + raw_spin_unlock(&irqa->irq_lock); 268 268 return ret; 269 269 } 270 270 ··· 325 325 * not need to be inserted into an ap_list and there is also 326 326 * no more work for us to do. 327 327 */ 328 - spin_unlock_irqrestore(&irq->irq_lock, flags); 328 + raw_spin_unlock_irqrestore(&irq->irq_lock, flags); 329 329 330 330 /* 331 331 * We have to kick the VCPU here, because we could be ··· 347 347 * We must unlock the irq lock to take the ap_list_lock where 348 348 * we are going to insert this new pending interrupt. 349 349 */ 350 - spin_unlock_irqrestore(&irq->irq_lock, flags); 350 + raw_spin_unlock_irqrestore(&irq->irq_lock, flags); 351 351 352 352 /* someone can do stuff here, which we re-check below */ 353 353 354 - spin_lock_irqsave(&vcpu->arch.vgic_cpu.ap_list_lock, flags); 355 - spin_lock(&irq->irq_lock); 354 + raw_spin_lock_irqsave(&vcpu->arch.vgic_cpu.ap_list_lock, flags); 355 + raw_spin_lock(&irq->irq_lock); 356 356 357 357 /* 358 358 * Did something change behind our backs? ··· 367 367 */ 368 368 369 369 if (unlikely(irq->vcpu || vcpu != vgic_target_oracle(irq))) { 370 - spin_unlock(&irq->irq_lock); 371 - spin_unlock_irqrestore(&vcpu->arch.vgic_cpu.ap_list_lock, flags); 370 + raw_spin_unlock(&irq->irq_lock); 371 + raw_spin_unlock_irqrestore(&vcpu->arch.vgic_cpu.ap_list_lock, 372 + flags); 372 373 373 - spin_lock_irqsave(&irq->irq_lock, flags); 374 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 374 375 goto retry; 375 376 } 376 377 ··· 383 382 list_add_tail(&irq->ap_list, &vcpu->arch.vgic_cpu.ap_list_head); 384 383 irq->vcpu = vcpu; 385 384 386 - spin_unlock(&irq->irq_lock); 387 - spin_unlock_irqrestore(&vcpu->arch.vgic_cpu.ap_list_lock, flags); 385 + raw_spin_unlock(&irq->irq_lock); 386 + raw_spin_unlock_irqrestore(&vcpu->arch.vgic_cpu.ap_list_lock, flags); 388 387 389 388 kvm_make_request(KVM_REQ_IRQ_PENDING, vcpu); 390 389 kvm_vcpu_kick(vcpu); ··· 431 430 if (!irq) 432 431 return -EINVAL; 433 432 434 - spin_lock_irqsave(&irq->irq_lock, flags); 433 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 435 434 436 435 if (!vgic_validate_injection(irq, level, owner)) { 437 436 /* Nothing to see here, move along... */ 438 - spin_unlock_irqrestore(&irq->irq_lock, flags); 437 + raw_spin_unlock_irqrestore(&irq->irq_lock, flags); 439 438 vgic_put_irq(kvm, irq); 440 439 return 0; 441 440 } ··· 495 494 496 495 BUG_ON(!irq); 497 496 498 - spin_lock_irqsave(&irq->irq_lock, flags); 497 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 499 498 ret = kvm_vgic_map_irq(vcpu, irq, host_irq, get_input_level); 500 - spin_unlock_irqrestore(&irq->irq_lock, flags); 499 + raw_spin_unlock_irqrestore(&irq->irq_lock, flags); 501 500 vgic_put_irq(vcpu->kvm, irq); 502 501 503 502 return ret; ··· 520 519 if (!irq->hw) 521 520 goto out; 522 521 523 - spin_lock_irqsave(&irq->irq_lock, flags); 522 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 524 523 irq->active = false; 525 524 irq->pending_latch = false; 526 525 irq->line_level = false; 527 - spin_unlock_irqrestore(&irq->irq_lock, flags); 526 + raw_spin_unlock_irqrestore(&irq->irq_lock, flags); 528 527 out: 529 528 vgic_put_irq(vcpu->kvm, irq); 530 529 } ··· 540 539 irq = vgic_get_irq(vcpu->kvm, vcpu, vintid); 541 540 BUG_ON(!irq); 542 541 543 - spin_lock_irqsave(&irq->irq_lock, flags); 542 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 544 543 kvm_vgic_unmap_irq(irq); 545 - spin_unlock_irqrestore(&irq->irq_lock, flags); 544 + raw_spin_unlock_irqrestore(&irq->irq_lock, flags); 546 545 vgic_put_irq(vcpu->kvm, irq); 547 546 548 547 return 0; ··· 572 571 return -EINVAL; 573 572 574 573 irq = vgic_get_irq(vcpu->kvm, vcpu, intid); 575 - spin_lock_irqsave(&irq->irq_lock, flags); 574 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 576 575 if (irq->owner && irq->owner != owner) 577 576 ret = -EEXIST; 578 577 else 579 578 irq->owner = owner; 580 - spin_unlock_irqrestore(&irq->irq_lock, flags); 579 + raw_spin_unlock_irqrestore(&irq->irq_lock, flags); 581 580 582 581 return ret; 583 582 } ··· 598 597 DEBUG_SPINLOCK_BUG_ON(!irqs_disabled()); 599 598 600 599 retry: 601 - spin_lock(&vgic_cpu->ap_list_lock); 600 + raw_spin_lock(&vgic_cpu->ap_list_lock); 602 601 603 602 list_for_each_entry_safe(irq, tmp, &vgic_cpu->ap_list_head, ap_list) { 604 603 struct kvm_vcpu *target_vcpu, *vcpuA, *vcpuB; 605 604 bool target_vcpu_needs_kick = false; 606 605 607 - spin_lock(&irq->irq_lock); 606 + raw_spin_lock(&irq->irq_lock); 608 607 609 608 BUG_ON(vcpu != irq->vcpu); 610 609 ··· 617 616 */ 618 617 list_del(&irq->ap_list); 619 618 irq->vcpu = NULL; 620 - spin_unlock(&irq->irq_lock); 619 + raw_spin_unlock(&irq->irq_lock); 621 620 622 621 /* 623 622 * This vgic_put_irq call matches the ··· 632 631 633 632 if (target_vcpu == vcpu) { 634 633 /* We're on the right CPU */ 635 - spin_unlock(&irq->irq_lock); 634 + raw_spin_unlock(&irq->irq_lock); 636 635 continue; 637 636 } 638 637 639 638 /* This interrupt looks like it has to be migrated. */ 640 639 641 - spin_unlock(&irq->irq_lock); 642 - spin_unlock(&vgic_cpu->ap_list_lock); 640 + raw_spin_unlock(&irq->irq_lock); 641 + raw_spin_unlock(&vgic_cpu->ap_list_lock); 643 642 644 643 /* 645 644 * Ensure locking order by always locking the smallest ··· 653 652 vcpuB = vcpu; 654 653 } 655 654 656 - spin_lock(&vcpuA->arch.vgic_cpu.ap_list_lock); 657 - spin_lock_nested(&vcpuB->arch.vgic_cpu.ap_list_lock, 658 - SINGLE_DEPTH_NESTING); 659 - spin_lock(&irq->irq_lock); 655 + raw_spin_lock(&vcpuA->arch.vgic_cpu.ap_list_lock); 656 + raw_spin_lock_nested(&vcpuB->arch.vgic_cpu.ap_list_lock, 657 + SINGLE_DEPTH_NESTING); 658 + raw_spin_lock(&irq->irq_lock); 660 659 661 660 /* 662 661 * If the affinity has been preserved, move the ··· 676 675 target_vcpu_needs_kick = true; 677 676 } 678 677 679 - spin_unlock(&irq->irq_lock); 680 - spin_unlock(&vcpuB->arch.vgic_cpu.ap_list_lock); 681 - spin_unlock(&vcpuA->arch.vgic_cpu.ap_list_lock); 678 + raw_spin_unlock(&irq->irq_lock); 679 + raw_spin_unlock(&vcpuB->arch.vgic_cpu.ap_list_lock); 680 + raw_spin_unlock(&vcpuA->arch.vgic_cpu.ap_list_lock); 682 681 683 682 if (target_vcpu_needs_kick) { 684 683 kvm_make_request(KVM_REQ_IRQ_PENDING, target_vcpu); ··· 688 687 goto retry; 689 688 } 690 689 691 - spin_unlock(&vgic_cpu->ap_list_lock); 690 + raw_spin_unlock(&vgic_cpu->ap_list_lock); 692 691 } 693 692 694 693 static inline void vgic_fold_lr_state(struct kvm_vcpu *vcpu) ··· 742 741 list_for_each_entry(irq, &vgic_cpu->ap_list_head, ap_list) { 743 742 int w; 744 743 745 - spin_lock(&irq->irq_lock); 744 + raw_spin_lock(&irq->irq_lock); 746 745 /* GICv2 SGIs can count for more than one... */ 747 746 w = vgic_irq_get_lr_count(irq); 748 - spin_unlock(&irq->irq_lock); 747 + raw_spin_unlock(&irq->irq_lock); 749 748 750 749 count += w; 751 750 *multi_sgi |= (w > 1); ··· 771 770 count = 0; 772 771 773 772 list_for_each_entry(irq, &vgic_cpu->ap_list_head, ap_list) { 774 - spin_lock(&irq->irq_lock); 773 + raw_spin_lock(&irq->irq_lock); 775 774 776 775 /* 777 776 * If we have multi-SGIs in the pipeline, we need to ··· 781 780 * the AP list has been sorted already. 782 781 */ 783 782 if (multi_sgi && irq->priority > prio) { 784 - spin_unlock(&irq->irq_lock); 783 + _raw_spin_unlock(&irq->irq_lock); 785 784 break; 786 785 } 787 786 ··· 792 791 prio = irq->priority; 793 792 } 794 793 795 - spin_unlock(&irq->irq_lock); 794 + raw_spin_unlock(&irq->irq_lock); 796 795 797 796 if (count == kvm_vgic_global_state.nr_lr) { 798 797 if (!list_is_last(&irq->ap_list, ··· 873 872 874 873 DEBUG_SPINLOCK_BUG_ON(!irqs_disabled()); 875 874 876 - spin_lock(&vcpu->arch.vgic_cpu.ap_list_lock); 875 + raw_spin_lock(&vcpu->arch.vgic_cpu.ap_list_lock); 877 876 vgic_flush_lr_state(vcpu); 878 - spin_unlock(&vcpu->arch.vgic_cpu.ap_list_lock); 877 + raw_spin_unlock(&vcpu->arch.vgic_cpu.ap_list_lock); 879 878 880 879 if (can_access_vgic_from_kernel()) 881 880 vgic_restore_state(vcpu); ··· 919 918 920 919 vgic_get_vmcr(vcpu, &vmcr); 921 920 922 - spin_lock_irqsave(&vgic_cpu->ap_list_lock, flags); 921 + raw_spin_lock_irqsave(&vgic_cpu->ap_list_lock, flags); 923 922 924 923 list_for_each_entry(irq, &vgic_cpu->ap_list_head, ap_list) { 925 - spin_lock(&irq->irq_lock); 924 + raw_spin_lock(&irq->irq_lock); 926 925 pending = irq_is_pending(irq) && irq->enabled && 927 926 !irq->active && 928 927 irq->priority < vmcr.pmr; 929 - spin_unlock(&irq->irq_lock); 928 + raw_spin_unlock(&irq->irq_lock); 930 929 931 930 if (pending) 932 931 break; 933 932 } 934 933 935 - spin_unlock_irqrestore(&vgic_cpu->ap_list_lock, flags); 934 + raw_spin_unlock_irqrestore(&vgic_cpu->ap_list_lock, flags); 936 935 937 936 return pending; 938 937 } ··· 964 963 return false; 965 964 966 965 irq = vgic_get_irq(vcpu->kvm, vcpu, vintid); 967 - spin_lock_irqsave(&irq->irq_lock, flags); 966 + raw_spin_lock_irqsave(&irq->irq_lock, flags); 968 967 map_is_active = irq->hw && irq->active; 969 - spin_unlock_irqrestore(&irq->irq_lock, flags); 968 + raw_spin_unlock_irqrestore(&irq->irq_lock, flags); 970 969 vgic_put_irq(vcpu->kvm, irq); 971 970 972 971 return map_is_active; 973 972 } 974 -