···77=====8899The MSG_ZEROCOPY flag enables copy avoidance for socket send calls.1010-The feature is currently implemented for TCP sockets.1010+The feature is currently implemented for TCP and UDP sockets.111112121313Opportunity and Caveats
···14001400config HOTPLUG_CPU14011401 bool "Support for hot-pluggable CPUs"14021402 depends on SMP14031403+ select GENERIC_IRQ_MIGRATION14031404 help14041405 Say Y here to experiment with turning CPUs off and on. CPUs14051406 can be controlled through /sys/devices/system/cpu.
+11
arch/arm/boot/dts/omap4-droid4-xt894.dts
···644644 };645645};646646647647+/* Configure pwm clock source for timers 8 & 9 */648648+&timer8 {649649+ assigned-clocks = <&abe_clkctrl OMAP4_TIMER8_CLKCTRL 24>;650650+ assigned-clock-parents = <&sys_clkin_ck>;651651+};652652+653653+&timer9 {654654+ assigned-clocks = <&l4_per_clkctrl OMAP4_TIMER9_CLKCTRL 24>;655655+ assigned-clock-parents = <&sys_clkin_ck>;656656+};657657+647658/*648659 * As uart1 is wired to mdm6600 with rts and cts, we can use the cts pin for649660 * uart1 wakeirq.
+6-3
arch/arm/boot/dts/omap5-board-common.dtsi
···317317318318 palmas_sys_nirq_pins: pinmux_palmas_sys_nirq_pins {319319 pinctrl-single,pins = <320320- OMAP5_IOPAD(0x068, PIN_INPUT_PULLUP | MUX_MODE0) /* sys_nirq1 */320320+ /* sys_nirq1 is pulled down as the SoC is inverting it for GIC */321321+ OMAP5_IOPAD(0x068, PIN_INPUT_PULLUP | MUX_MODE0)321322 >;322323 };323324···386385387386 palmas: palmas@48 {388387 compatible = "ti,palmas";389389- interrupts = <GIC_SPI 7 IRQ_TYPE_NONE>; /* IRQ_SYS_1N */388388+ /* sys_nirq/ext_sys_irq pins get inverted at mpuss wakeupgen */389389+ interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_LOW>;390390 reg = <0x48>;391391 interrupt-controller;392392 #interrupt-cells = <2>;···653651 pinctrl-names = "default";654652 pinctrl-0 = <&twl6040_pins>;655653656656- interrupts = <GIC_SPI 119 IRQ_TYPE_NONE>; /* IRQ_SYS_2N cascaded to gic */654654+ /* sys_nirq/ext_sys_irq pins get inverted at mpuss wakeupgen */655655+ interrupts = <GIC_SPI 119 IRQ_TYPE_LEVEL_LOW>;657656658657 /* audpwron gpio defined in the board specific dts */659658
+11-1
arch/arm/boot/dts/omap5-cm-t54.dts
···181181 OMAP5_IOPAD(0x0042, PIN_INPUT_PULLDOWN | MUX_MODE6) /* llib_wakereqin.gpio1_wk15 */182182 >;183183 };184184+185185+ palmas_sys_nirq_pins: pinmux_palmas_sys_nirq_pins {186186+ pinctrl-single,pins = <187187+ /* sys_nirq1 is pulled down as the SoC is inverting it for GIC */188188+ OMAP5_IOPAD(0x068, PIN_INPUT_PULLUP | MUX_MODE0)189189+ >;190190+ };184191};185192186193&omap5_pmx_core {···421414422415 palmas: palmas@48 {423416 compatible = "ti,palmas";424424- interrupts = <GIC_SPI 7 IRQ_TYPE_NONE>; /* IRQ_SYS_1N */425417 reg = <0x48>;418418+ pinctrl-0 = <&palmas_sys_nirq_pins>;419419+ pinctrl-names = "default";420420+ /* sys_nirq/ext_sys_irq pins get inverted at mpuss wakeupgen */421421+ interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_LOW>;426422 interrupt-controller;427423 #interrupt-cells = <2>;428424 ti,system-power-controller;
···3131#include <linux/smp.h>3232#include <linux/init.h>3333#include <linux/seq_file.h>3434-#include <linux/ratelimit.h>3534#include <linux/errno.h>3635#include <linux/list.h>3736#include <linux/kallsyms.h>···108109 return nr_irqs;109110}110111#endif111111-112112-#ifdef CONFIG_HOTPLUG_CPU113113-static bool migrate_one_irq(struct irq_desc *desc)114114-{115115- struct irq_data *d = irq_desc_get_irq_data(desc);116116- const struct cpumask *affinity = irq_data_get_affinity_mask(d);117117- struct irq_chip *c;118118- bool ret = false;119119-120120- /*121121- * If this is a per-CPU interrupt, or the affinity does not122122- * include this CPU, then we have nothing to do.123123- */124124- if (irqd_is_per_cpu(d) || !cpumask_test_cpu(smp_processor_id(), affinity))125125- return false;126126-127127- if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {128128- affinity = cpu_online_mask;129129- ret = true;130130- }131131-132132- c = irq_data_get_irq_chip(d);133133- if (!c->irq_set_affinity)134134- pr_debug("IRQ%u: unable to set affinity\n", d->irq);135135- else if (c->irq_set_affinity(d, affinity, false) == IRQ_SET_MASK_OK && ret)136136- cpumask_copy(irq_data_get_affinity_mask(d), affinity);137137-138138- return ret;139139-}140140-141141-/*142142- * The current CPU has been marked offline. Migrate IRQs off this CPU.143143- * If the affinity settings do not allow other CPUs, force them onto any144144- * available CPU.145145- *146146- * Note: we must iterate over all IRQs, whether they have an attached147147- * action structure or not, as we need to get chained interrupts too.148148- */149149-void migrate_irqs(void)150150-{151151- unsigned int i;152152- struct irq_desc *desc;153153- unsigned long flags;154154-155155- local_irq_save(flags);156156-157157- for_each_irq_desc(i, desc) {158158- bool affinity_broken;159159-160160- raw_spin_lock(&desc->lock);161161- affinity_broken = migrate_one_irq(desc);162162- raw_spin_unlock(&desc->lock);163163-164164- if (affinity_broken)165165- pr_warn_ratelimited("IRQ%u no longer affine to CPU%u\n",166166- i, smp_processor_id());167167- }168168-169169- local_irq_restore(flags);170170-}171171-#endif /* CONFIG_HOTPLUG_CPU */
+1-1
arch/arm/kernel/smp.c
···254254 /*255255 * OK - migrate IRQs away from this CPU256256 */257257- migrate_irqs();257257+ irq_migrate_all_off_this_cpu();258258259259 /*260260 * Flush user cache and TLB mappings, and then remove this CPU
···2626#include <asm/cputype.h>2727#include <asm/kvm_arm.h>2828#include <asm/kvm_coproc.h>2929+#include <asm/kvm_emulate.h>29303031#include <kvm/arm_arch_timer.h>3132···69687069 /* Reset CP15 registers */7170 kvm_reset_coprocs(vcpu);7171+7272+ /*7373+ * Additional reset state handling that PSCI may have imposed on us.7474+ * Must be done after all the sys_reg reset.7575+ */7676+ if (READ_ONCE(vcpu->arch.reset_state.reset)) {7777+ unsigned long target_pc = vcpu->arch.reset_state.pc;7878+7979+ /* Gracefully handle Thumb2 entry point */8080+ if (target_pc & 1) {8181+ target_pc &= ~1UL;8282+ vcpu_set_thumb(vcpu);8383+ }8484+8585+ /* Propagate caller endianness */8686+ if (vcpu->arch.reset_state.be)8787+ kvm_vcpu_set_be(vcpu);8888+8989+ *vcpu_pc(vcpu) = target_pc;9090+ vcpu_set_reg(vcpu, 0, vcpu->arch.reset_state.r0);9191+9292+ vcpu->arch.reset_state.reset = false;9393+ }72947395 /* Reset arch_timer context */7496 return kvm_timer_vcpu_reset(vcpu);
+4-12
arch/arm/mach-omap2/cpuidle44xx.c
···152152 mpuss_can_lose_context = (cx->mpu_state == PWRDM_POWER_RET) &&153153 (cx->mpu_logic_state == PWRDM_POWER_OFF);154154155155+ /* Enter broadcast mode for periodic timers */156156+ tick_broadcast_enable();157157+158158+ /* Enter broadcast mode for one-shot timers */155159 tick_broadcast_enter();156160157161 /*···220216 cpu_done[dev->cpu] = false;221217222218 return index;223223-}224224-225225-/*226226- * For each cpu, setup the broadcast timer because local timers227227- * stops for the states above C1.228228- */229229-static void omap_setup_broadcast_timer(void *arg)230230-{231231- tick_broadcast_enable();232219}233220234221static struct cpuidle_driver omap4_idle_driver = {···313318 cpu_clkdm[1] = clkdm_lookup("mpu1_clkdm");314319 if (!cpu_clkdm[0] || !cpu_clkdm[1])315320 return -ENODEV;316316-317317- /* Configure the broadcast timer on each cpu */318318- on_each_cpu(omap_setup_broadcast_timer, NULL, 1);319321320322 return cpuidle_register(idle_driver, cpu_online_mask);321323}
+6-1
arch/arm/mach-omap2/display.c
···8383 u32 enable_mask, enable_shift;8484 u32 pipd_mask, pipd_shift;8585 u32 reg;8686+ int ret;86878788 if (dsi_id == 0) {8889 enable_mask = OMAP4_DSI1_LANEENABLE_MASK;···9998 return -ENODEV;10099 }101100102102- regmap_read(omap4_dsi_mux_syscon, OMAP4_DSIPHY_SYSCON_OFFSET, ®);101101+ ret = regmap_read(omap4_dsi_mux_syscon,102102+ OMAP4_DSIPHY_SYSCON_OFFSET,103103+ ®);104104+ if (ret)105105+ return ret;103106104107 reg &= ~enable_mask;105108 reg &= ~pipd_mask;
+35-1
arch/arm/mach-omap2/omap-wakeupgen.c
···5050#define OMAP4_NR_BANKS 45151#define OMAP4_NR_IRQS 12852525353+#define SYS_NIRQ1_EXT_SYS_IRQ_1 75454+#define SYS_NIRQ2_EXT_SYS_IRQ_2 1195555+5356static void __iomem *wakeupgen_base;5457static void __iomem *sar_base;5558static DEFINE_RAW_SPINLOCK(wakeupgen_lock);···154151 _wakeupgen_set(d->hwirq, irq_target_cpu[d->hwirq]);155152 raw_spin_unlock_irqrestore(&wakeupgen_lock, flags);156153 irq_chip_unmask_parent(d);154154+}155155+156156+/*157157+ * The sys_nirq pins bypass peripheral modules and are wired directly158158+ * to MPUSS wakeupgen. They get automatically inverted for GIC.159159+ */160160+static int wakeupgen_irq_set_type(struct irq_data *d, unsigned int type)161161+{162162+ bool inverted = false;163163+164164+ switch (type) {165165+ case IRQ_TYPE_LEVEL_LOW:166166+ type &= ~IRQ_TYPE_LEVEL_MASK;167167+ type |= IRQ_TYPE_LEVEL_HIGH;168168+ inverted = true;169169+ break;170170+ case IRQ_TYPE_EDGE_FALLING:171171+ type &= ~IRQ_TYPE_EDGE_BOTH;172172+ type |= IRQ_TYPE_EDGE_RISING;173173+ inverted = true;174174+ break;175175+ default:176176+ break;177177+ }178178+179179+ if (inverted && d->hwirq != SYS_NIRQ1_EXT_SYS_IRQ_1 &&180180+ d->hwirq != SYS_NIRQ2_EXT_SYS_IRQ_2)181181+ pr_warn("wakeupgen: irq%li polarity inverted in dts\n",182182+ d->hwirq);183183+184184+ return irq_chip_set_type_parent(d, type);157185}158186159187#ifdef CONFIG_HOTPLUG_CPU···480446 .irq_mask = wakeupgen_mask,481447 .irq_unmask = wakeupgen_unmask,482448 .irq_retrigger = irq_chip_retrigger_hierarchy,483483- .irq_set_type = irq_chip_set_type_parent,449449+ .irq_set_type = wakeupgen_irq_set_type,484450 .flags = IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MASK_ON_SUSPEND,485451#ifdef CONFIG_SMP486452 .irq_set_affinity = irq_chip_set_affinity_parent,
+2
arch/arm/mm/dma-mapping.c
···23902390 return;2391239123922392 arm_teardown_iommu_dma_ops(dev);23932393+ /* Let arch_setup_dma_ops() start again from scratch upon re-probe */23942394+ set_dma_ops(dev, NULL);23932395}
+1-1
arch/arm/probes/kprobes/opt-arm.c
···247247 }248248249249 /* Copy arch-dep-instance from template. */250250- memcpy(code, (unsigned char *)optprobe_template_entry,250250+ memcpy(code, (unsigned long *)&optprobe_template_entry,251251 TMPL_END_IDX * sizeof(kprobe_opcode_t));252252253253 /* Adjust buffer according to instruction. */
···4848#define KVM_REQ_SLEEP \4949 KVM_ARCH_REQ_FLAGS(0, KVM_REQUEST_WAIT | KVM_REQUEST_NO_WAKEUP)5050#define KVM_REQ_IRQ_PENDING KVM_ARCH_REQ(1)5151+#define KVM_REQ_VCPU_RESET KVM_ARCH_REQ(2)51525253DECLARE_STATIC_KEY_FALSE(userspace_irqchip_in_use);5354···209208210209typedef struct kvm_cpu_context kvm_cpu_context_t;211210211211+struct vcpu_reset_state {212212+ unsigned long pc;213213+ unsigned long r0;214214+ bool be;215215+ bool reset;216216+};217217+212218struct kvm_vcpu_arch {213219 struct kvm_cpu_context ctxt;214220···304296305297 /* Virtual SError ESR to restore when HCR_EL2.VSE is set */306298 u64 vsesr_el2;299299+300300+ /* Additional reset state */301301+ struct vcpu_reset_state reset_state;307302308303 /* True when deferrable sysregs are loaded on the physical CPU,309304 * see kvm_vcpu_load_sysregs and kvm_vcpu_put_sysregs. */
+11
arch/arm64/include/asm/memory.h
···332332#define virt_addr_valid(kaddr) \333333 (_virt_addr_is_linear(kaddr) && _virt_addr_valid(kaddr))334334335335+/*336336+ * Given that the GIC architecture permits ITS implementations that can only be337337+ * configured with a LPI table address once, GICv3 systems with many CPUs may338338+ * end up reserving a lot of different regions after a kexec for their LPI339339+ * tables (one per CPU), as we are forced to reuse the same memory after kexec340340+ * (and thus reserve it persistently with EFI beforehand)341341+ */342342+#if defined(CONFIG_EFI) && defined(CONFIG_ARM_GIC_V3_ITS)343343+# define INIT_MEMBLOCK_RESERVED_REGIONS (INIT_MEMBLOCK_REGIONS + NR_CPUS + 1)344344+#endif345345+335346#include <asm-generic/memory_model.h>336347337348#endif
···3232#include <asm/kvm_arm.h>3333#include <asm/kvm_asm.h>3434#include <asm/kvm_coproc.h>3535+#include <asm/kvm_emulate.h>3536#include <asm/kvm_mmu.h>36373738/* Maximum phys_shift supported for any VM on this host */···106105 * This function finds the right table above and sets the registers on107106 * the virtual CPU struct to their architecturally defined reset108107 * values.108108+ *109109+ * Note: This function can be called from two paths: The KVM_ARM_VCPU_INIT110110+ * ioctl or as part of handling a request issued by another VCPU in the PSCI111111+ * handling code. In the first case, the VCPU will not be loaded, and in the112112+ * second case the VCPU will be loaded. Because this function operates purely113113+ * on the memory-backed valus of system registers, we want to do a full put if114114+ * we were loaded (handling a request) and load the values back at the end of115115+ * the function. Otherwise we leave the state alone. In both cases, we116116+ * disable preemption around the vcpu reset as we would otherwise race with117117+ * preempt notifiers which also call put/load.109118 */110119int kvm_reset_vcpu(struct kvm_vcpu *vcpu)111120{112121 const struct kvm_regs *cpu_reset;122122+ int ret = -EINVAL;123123+ bool loaded;124124+125125+ preempt_disable();126126+ loaded = (vcpu->cpu != -1);127127+ if (loaded)128128+ kvm_arch_vcpu_put(vcpu);113129114130 switch (vcpu->arch.target) {115131 default:116132 if (test_bit(KVM_ARM_VCPU_EL1_32BIT, vcpu->arch.features)) {117133 if (!cpu_has_32bit_el1())118118- return -EINVAL;134134+ goto out;119135 cpu_reset = &default_regs_reset32;120136 } else {121137 cpu_reset = &default_regs_reset;···147129 /* Reset system registers */148130 kvm_reset_sys_regs(vcpu);149131132132+ /*133133+ * Additional reset state handling that PSCI may have imposed on us.134134+ * Must be done after all the sys_reg reset.135135+ */136136+ if (vcpu->arch.reset_state.reset) {137137+ unsigned long target_pc = vcpu->arch.reset_state.pc;138138+139139+ /* Gracefully handle Thumb2 entry point */140140+ if (vcpu_mode_is_32bit(vcpu) && (target_pc & 1)) {141141+ target_pc &= ~1UL;142142+ vcpu_set_thumb(vcpu);143143+ }144144+145145+ /* Propagate caller endianness */146146+ if (vcpu->arch.reset_state.be)147147+ kvm_vcpu_set_be(vcpu);148148+149149+ *vcpu_pc(vcpu) = target_pc;150150+ vcpu_set_reg(vcpu, 0, vcpu->arch.reset_state.r0);151151+152152+ vcpu->arch.reset_state.reset = false;153153+ }154154+150155 /* Reset PMU */151156 kvm_pmu_vcpu_reset(vcpu);152157···178137 vcpu->arch.workaround_flags |= VCPU_WORKAROUND_2_FLAG;179138180139 /* Reset timer */181181- return kvm_timer_vcpu_reset(vcpu);140140+ ret = kvm_timer_vcpu_reset(vcpu);141141+out:142142+ if (loaded)143143+ kvm_arch_vcpu_load(vcpu, smp_processor_id());144144+ preempt_enable();145145+ return ret;182146}183147184148void kvm_set_ipa_limit(void)
+32-18
arch/arm64/kvm/sys_regs.c
···314314 return read_zero(vcpu, p);315315}316316317317-static bool trap_undef(struct kvm_vcpu *vcpu,318318- struct sys_reg_params *p,319319- const struct sys_reg_desc *r)317317+/*318318+ * ARMv8.1 mandates at least a trivial LORegion implementation, where all the319319+ * RW registers are RES0 (which we can implement as RAZ/WI). On an ARMv8.0320320+ * system, these registers should UNDEF. LORID_EL1 being a RO register, we321321+ * treat it separately.322322+ */323323+static bool trap_loregion(struct kvm_vcpu *vcpu,324324+ struct sys_reg_params *p,325325+ const struct sys_reg_desc *r)320326{321321- kvm_inject_undefined(vcpu);322322- return false;327327+ u64 val = read_sanitised_ftr_reg(SYS_ID_AA64MMFR1_EL1);328328+ u32 sr = sys_reg((u32)r->Op0, (u32)r->Op1,329329+ (u32)r->CRn, (u32)r->CRm, (u32)r->Op2);330330+331331+ if (!(val & (0xfUL << ID_AA64MMFR1_LOR_SHIFT))) {332332+ kvm_inject_undefined(vcpu);333333+ return false;334334+ }335335+336336+ if (p->is_write && sr == SYS_LORID_EL1)337337+ return write_to_read_only(vcpu, p, r);338338+339339+ return trap_raz_wi(vcpu, p, r);323340}324341325342static bool trap_oslsr_el1(struct kvm_vcpu *vcpu,···10651048 if (val & ptrauth_mask)10661049 kvm_debug("ptrauth unsupported for guests, suppressing\n");10671050 val &= ~ptrauth_mask;10681068- } else if (id == SYS_ID_AA64MMFR1_EL1) {10691069- if (val & (0xfUL << ID_AA64MMFR1_LOR_SHIFT))10701070- kvm_debug("LORegions unsupported for guests, suppressing\n");10711071-10721072- val &= ~(0xfUL << ID_AA64MMFR1_LOR_SHIFT);10731051 }1074105210751053 return val;···13501338 { SYS_DESC(SYS_MAIR_EL1), access_vm_reg, reset_unknown, MAIR_EL1 },13511339 { SYS_DESC(SYS_AMAIR_EL1), access_vm_reg, reset_amair_el1, AMAIR_EL1 },1352134013531353- { SYS_DESC(SYS_LORSA_EL1), trap_undef },13541354- { SYS_DESC(SYS_LOREA_EL1), trap_undef },13551355- { SYS_DESC(SYS_LORN_EL1), trap_undef },13561356- { SYS_DESC(SYS_LORC_EL1), trap_undef },13571357- { SYS_DESC(SYS_LORID_EL1), trap_undef },13411341+ { SYS_DESC(SYS_LORSA_EL1), trap_loregion },13421342+ { SYS_DESC(SYS_LOREA_EL1), trap_loregion },13431343+ { SYS_DESC(SYS_LORN_EL1), trap_loregion },13441344+ { SYS_DESC(SYS_LORC_EL1), trap_loregion },13451345+ { SYS_DESC(SYS_LORID_EL1), trap_loregion },1358134613591347 { SYS_DESC(SYS_VBAR_EL1), NULL, reset_val, VBAR_EL1, 0 },13601348 { SYS_DESC(SYS_DISR_EL1), NULL, reset_val, DISR_EL1, 0 },···26082596 table = get_target_table(vcpu->arch.target, true, &num);26092597 reset_sys_reg_descs(vcpu, table, num);2610259826112611- for (num = 1; num < NR_SYS_REGS; num++)26122612- if (__vcpu_sys_reg(vcpu, num) == 0x4242424242424242)26132613- panic("Didn't reset __vcpu_sys_reg(%zi)", num);25992599+ for (num = 1; num < NR_SYS_REGS; num++) {26002600+ if (WARN(__vcpu_sys_reg(vcpu, num) == 0x4242424242424242,26012601+ "Didn't reset __vcpu_sys_reg(%zi)\n", num))26022602+ break;26032603+ }26142604}
+7-2
arch/csky/include/asm/pgtable.h
···4545 ((pte_t *)page_address(pmd_page(*(dir))) + __pte_offset_t(address))4646#define pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT))4747#define pte_clear(mm, addr, ptep) set_pte((ptep), \4848- (((unsigned int)addr&0x80000000)?__pte(1):__pte(0)))4949-#define pte_none(pte) (!(pte_val(pte)&0xfffffffe))4848+ (((unsigned int) addr & PAGE_OFFSET) ? __pte(_PAGE_GLOBAL) : __pte(0)))4949+#define pte_none(pte) (!(pte_val(pte) & ~_PAGE_GLOBAL))5050#define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT)5151#define pte_pfn(x) ((unsigned long)((x).pte_low >> PAGE_SHIFT))5252#define pfn_pte(pfn, prot) __pte(((unsigned long long)(pfn) << PAGE_SHIFT) \···240240#define pgd_offset_k(address) pgd_offset(&init_mm, address)241241242242#define pgd_index(address) ((address) >> PGDIR_SHIFT)243243+244244+#define __HAVE_PHYS_MEM_ACCESS_PROT245245+struct file;246246+extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,247247+ unsigned long size, pgprot_t vma_prot);243248244249/*245250 * Macro to make mark a page protection value as "uncacheable". Note
···24732473 (nested_cpu_has_vpid(vmcs12) && !vmcs12->virtual_processor_id))24742474 return -EINVAL;2475247524762476+ if (!nested_cpu_has_preemption_timer(vmcs12) &&24772477+ nested_cpu_has_save_preemption_timer(vmcs12))24782478+ return -EINVAL;24792479+24762480 if (nested_cpu_has_ept(vmcs12) &&24772481 !valid_ept_address(vcpu, vmcs12->ept_pointer))24782482 return -EINVAL;···55615557 * secondary cpu-based controls. Do not include those that55625558 * depend on CPUID bits, they are added later by vmx_cpuid_update.55635559 */55645564- rdmsr(MSR_IA32_VMX_PROCBASED_CTLS2,55655565- msrs->secondary_ctls_low,55665566- msrs->secondary_ctls_high);55605560+ if (msrs->procbased_ctls_high & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS)55615561+ rdmsr(MSR_IA32_VMX_PROCBASED_CTLS2,55625562+ msrs->secondary_ctls_low,55635563+ msrs->secondary_ctls_high);55645564+55675565 msrs->secondary_ctls_low = 0;55685566 msrs->secondary_ctls_high &=55695567 SECONDARY_EXEC_DESC |
+13-16
arch/x86/kvm/vmx/vmx.c
···863863 if (!entry_only)864864 j = find_msr(&m->host, msr);865865866866- if (i == NR_AUTOLOAD_MSRS || j == NR_AUTOLOAD_MSRS) {866866+ if ((i < 0 && m->guest.nr == NR_AUTOLOAD_MSRS) ||867867+ (j < 0 && m->host.nr == NR_AUTOLOAD_MSRS)) {867868 printk_once(KERN_WARNING "Not enough msr switch entries. "868869 "Can't add msr %x\n", msr);869870 return;···11941193 if (!pi_test_sn(pi_desc) && vcpu->cpu == cpu)11951194 return;1196119511971197- /*11981198- * First handle the simple case where no cmpxchg is necessary; just11991199- * allow posting non-urgent interrupts.12001200- *12011201- * If the 'nv' field is POSTED_INTR_WAKEUP_VECTOR, do not change12021202- * PI.NDST: pi_post_block will do it for us and the wakeup_handler12031203- * expects the VCPU to be on the blocked_vcpu_list that matches12041204- * PI.NDST.12051205- */12061206- if (pi_desc->nv == POSTED_INTR_WAKEUP_VECTOR ||12071207- vcpu->cpu == cpu) {12081208- pi_clear_sn(pi_desc);12091209- return;12101210- }12111211-12121196 /* The full case. */12131197 do {12141198 old.control = new.control = pi_desc->control;···12081222 new.sn = 0;12091223 } while (cmpxchg64(&pi_desc->control, old.control,12101224 new.control) != old.control);12251225+12261226+ /*12271227+ * Clear SN before reading the bitmap. The VT-d firmware12281228+ * writes the bitmap and reads SN atomically (5.2.3 in the12291229+ * spec), so it doesn't really have a memory barrier that12301230+ * pairs with this, but we cannot do that and we need one.12311231+ */12321232+ smp_mb__after_atomic();12331233+12341234+ if (!bitmap_empty((unsigned long *)pi_desc->pir, NR_VECTORS))12351235+ pi_set_on(pi_desc);12111236}1212123712131238/*
+6-6
arch/x86/kvm/vmx/vmx.h
···337337 return test_and_set_bit(vector, (unsigned long *)pi_desc->pir);338338}339339340340-static inline void pi_clear_sn(struct pi_desc *pi_desc)341341-{342342- return clear_bit(POSTED_INTR_SN,343343- (unsigned long *)&pi_desc->control);344344-}345345-346340static inline void pi_set_sn(struct pi_desc *pi_desc)347341{348342 return set_bit(POSTED_INTR_SN,349343 (unsigned long *)&pi_desc->control);344344+}345345+346346+static inline void pi_set_on(struct pi_desc *pi_desc)347347+{348348+ set_bit(POSTED_INTR_ON,349349+ (unsigned long *)&pi_desc->control);350350}351351352352static inline void pi_clear_on(struct pi_desc *pi_desc)
+1-1
arch/x86/kvm/x86.c
···78017801 * 1) We should set ->mode before checking ->requests. Please see78027802 * the comment in kvm_vcpu_exiting_guest_mode().78037803 *78047804- * 2) For APICv, we should set ->mode before checking PIR.ON. This78047804+ * 2) For APICv, we should set ->mode before checking PID.ON. This78057805 * pairs with the memory barrier implicit in pi_test_and_set_on78067806 * (see vmx_deliver_posted_interrupt).78077807 *
···781781 SYSC_QUIRK("smartreflex", 0, -1, 0x38, -1, 0x00000000, 0xffffffff,782782 SYSC_QUIRK_LEGACY_IDLE),783783 SYSC_QUIRK("timer", 0, 0, 0x10, 0x14, 0x00000015, 0xffffffff,784784- SYSC_QUIRK_LEGACY_IDLE),784784+ 0),785785 /* Some timers on omap4 and later */786786 SYSC_QUIRK("timer", 0, 0, 0x10, -1, 0x50002100, 0xffffffff,787787- SYSC_QUIRK_LEGACY_IDLE),787787+ 0),788788 SYSC_QUIRK("timer", 0, 0, 0x10, -1, 0x4fff1301, 0xffff00ff,789789- SYSC_QUIRK_LEGACY_IDLE),789789+ 0),790790 SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x00000052, 0xffffffff,791791 SYSC_QUIRK_LEGACY_IDLE),792792 /* Uarts on omap4 and later */
+4-1
drivers/clocksource/timer-ti-dm.c
···154154 if (IS_ERR(parent))155155 return -ENODEV;156156157157+ /* Bail out if both clocks point to fck */158158+ if (clk_is_match(parent, timer->fclk))159159+ return 0;160160+157161 ret = clk_set_parent(timer->fclk, parent);158162 if (ret < 0)159163 pr_err("%s: failed to set parent\n", __func__);···868864 timer->pdev = pdev;869865870866 pm_runtime_enable(dev);871871- pm_runtime_irq_safe(dev);872867873868 if (!timer->reserved) {874869 ret = pm_runtime_get_sync(dev);
-4
drivers/firmware/efi/efi.c
···592592593593 early_memunmap(tbl, sizeof(*tbl));594594 }595595- return 0;596596-}597595598598-int __init efi_apply_persistent_mem_reservations(void)599599-{600596 if (efi.mem_reserve != EFI_INVALID_TABLE_ADDR) {601597 unsigned long prsv = efi.mem_reserve;602598
-3
drivers/firmware/efi/libstub/arm-stub.c
···7575 efi_guid_t memreserve_table_guid = LINUX_EFI_MEMRESERVE_TABLE_GUID;7676 efi_status_t status;77777878- if (IS_ENABLED(CONFIG_ARM))7979- return;8080-8178 status = efi_call_early(allocate_pool, EFI_LOADER_DATA, sizeof(*rsv),8279 (void **)&rsv);8380 if (status != EFI_SUCCESS) {
+7
drivers/firmware/efi/runtime-wrappers.c
···147147static DEFINE_SEMAPHORE(efi_runtime_lock);148148149149/*150150+ * Expose the EFI runtime lock to the UV platform151151+ */152152+#ifdef CONFIG_X86_UV153153+extern struct semaphore __efi_uv_runtime_lock __alias(efi_runtime_lock);154154+#endif155155+156156+/*150157 * Calls the appropriate efi_runtime_service() with the appropriate151158 * arguments.152159 *
+12
drivers/i2c/busses/i2c-bcm2835.c
···183183 bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, c);184184}185185186186+static void bcm2835_i2c_finish_transfer(struct bcm2835_i2c_dev *i2c_dev)187187+{188188+ i2c_dev->curr_msg = NULL;189189+ i2c_dev->num_msgs = 0;190190+191191+ i2c_dev->msg_buf = NULL;192192+ i2c_dev->msg_buf_remaining = 0;193193+}194194+186195/*187196 * Note about I2C_C_CLEAR on error:188197 * The I2C_C_CLEAR on errors will take some time to resolve -- if you were in···292283293284 time_left = wait_for_completion_timeout(&i2c_dev->completion,294285 adap->timeout);286286+287287+ bcm2835_i2c_finish_transfer(i2c_dev);288288+295289 if (!time_left) {296290 bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C,297291 BCM2835_I2C_C_CLEAR);
+7-2
drivers/i2c/busses/i2c-cadence.c
···382382 * Check for the message size against FIFO depth and set the383383 * 'hold bus' bit if it is greater than FIFO depth.384384 */385385- if (id->recv_count > CDNS_I2C_FIFO_DEPTH)385385+ if ((id->recv_count > CDNS_I2C_FIFO_DEPTH) || id->bus_hold_flag)386386 ctrl_reg |= CDNS_I2C_CR_HOLD;387387+ else388388+ ctrl_reg = ctrl_reg & ~CDNS_I2C_CR_HOLD;387389388390 cdns_i2c_writereg(ctrl_reg, CDNS_I2C_CR_OFFSET);389391···442440 * Check for the message size against FIFO depth and set the443441 * 'hold bus' bit if it is greater than FIFO depth.444442 */445445- if (id->send_count > CDNS_I2C_FIFO_DEPTH)443443+ if ((id->send_count > CDNS_I2C_FIFO_DEPTH) || id->bus_hold_flag)446444 ctrl_reg |= CDNS_I2C_CR_HOLD;445445+ else446446+ ctrl_reg = ctrl_reg & ~CDNS_I2C_CR_HOLD;447447+447448 cdns_i2c_writereg(ctrl_reg, CDNS_I2C_CR_OFFSET);448449449450 /* Clear the interrupts in interrupt status register. */
+1-1
drivers/input/keyboard/Kconfig
···420420421421config KEYBOARD_SNVS_PWRKEY422422 tristate "IMX SNVS Power Key Driver"423423- depends on SOC_IMX6SX423423+ depends on SOC_IMX6SX || SOC_IMX7D424424 depends on OF425425 help426426 This is the snvs powerkey driver for the Freescale i.MX application
+13-26
drivers/input/keyboard/cap11xx.c
···7575struct cap11xx_led {7676 struct cap11xx_priv *priv;7777 struct led_classdev cdev;7878- struct work_struct work;7978 u32 reg;8080- enum led_brightness new_brightness;8179};8280#endif8381···231233}232234233235#ifdef CONFIG_LEDS_CLASS234234-static void cap11xx_led_work(struct work_struct *work)235235-{236236- struct cap11xx_led *led = container_of(work, struct cap11xx_led, work);237237- struct cap11xx_priv *priv = led->priv;238238- int value = led->new_brightness;239239-240240- /*241241- * All LEDs share the same duty cycle as this is a HW limitation.242242- * Brightness levels per LED are either 0 (OFF) and 1 (ON).243243- */244244- regmap_update_bits(priv->regmap, CAP11XX_REG_LED_OUTPUT_CONTROL,245245- BIT(led->reg), value ? BIT(led->reg) : 0);246246-}247247-248248-static void cap11xx_led_set(struct led_classdev *cdev,249249- enum led_brightness value)236236+static int cap11xx_led_set(struct led_classdev *cdev,237237+ enum led_brightness value)250238{251239 struct cap11xx_led *led = container_of(cdev, struct cap11xx_led, cdev);240240+ struct cap11xx_priv *priv = led->priv;252241253253- if (led->new_brightness == value)254254- return;255255-256256- led->new_brightness = value;257257- schedule_work(&led->work);242242+ /*243243+ * All LEDs share the same duty cycle as this is a HW244244+ * limitation. Brightness levels per LED are either245245+ * 0 (OFF) and 1 (ON).246246+ */247247+ return regmap_update_bits(priv->regmap,248248+ CAP11XX_REG_LED_OUTPUT_CONTROL,249249+ BIT(led->reg),250250+ value ? BIT(led->reg) : 0);258251}259252260253static int cap11xx_init_leds(struct device *dev,···288299 led->cdev.default_trigger =289300 of_get_property(child, "linux,default-trigger", NULL);290301 led->cdev.flags = 0;291291- led->cdev.brightness_set = cap11xx_led_set;302302+ led->cdev.brightness_set_blocking = cap11xx_led_set;292303 led->cdev.max_brightness = 1;293304 led->cdev.brightness = LED_OFF;294305···300311301312 led->reg = reg;302313 led->priv = priv;303303-304304- INIT_WORK(&led->work, cap11xx_led_work);305314306315 error = devm_led_classdev_register(dev, &led->cdev);307316 if (error) {
+1-1
drivers/input/keyboard/matrix_keypad.c
···222222 keypad->stopped = true;223223 spin_unlock_irq(&keypad->lock);224224225225- flush_work(&keypad->work.work);225225+ flush_delayed_work(&keypad->work);226226 /*227227 * matrix_keypad_scan() will leave IRQs enabled;228228 * we should disable them now.
+33-48
drivers/input/keyboard/qt2160.c
···5858struct qt2160_led {5959 struct qt2160_data *qt2160;6060 struct led_classdev cdev;6161- struct work_struct work;6261 char name[32];6362 int id;6464- enum led_brightness new_brightness;6363+ enum led_brightness brightness;6564};6665#endif6766···7374 u16 key_matrix;7475#ifdef CONFIG_LEDS_CLASS7576 struct qt2160_led leds[QT2160_NUM_LEDS_X];7676- struct mutex led_lock;7777#endif7878};7979···81838284#ifdef CONFIG_LEDS_CLASS83858484-static void qt2160_led_work(struct work_struct *work)8585-{8686- struct qt2160_led *led = container_of(work, struct qt2160_led, work);8787- struct qt2160_data *qt2160 = led->qt2160;8888- struct i2c_client *client = qt2160->client;8989- int value = led->new_brightness;9090- u32 drive, pwmen;9191-9292- mutex_lock(&qt2160->led_lock);9393-9494- drive = qt2160_read(client, QT2160_CMD_DRIVE_X);9595- pwmen = qt2160_read(client, QT2160_CMD_PWMEN_X);9696- if (value != LED_OFF) {9797- drive |= (1 << led->id);9898- pwmen |= (1 << led->id);9999-100100- } else {101101- drive &= ~(1 << led->id);102102- pwmen &= ~(1 << led->id);103103- }104104- qt2160_write(client, QT2160_CMD_DRIVE_X, drive);105105- qt2160_write(client, QT2160_CMD_PWMEN_X, pwmen);106106-107107- /*108108- * Changing this register will change the brightness109109- * of every LED in the qt2160. It's a HW limitation.110110- */111111- if (value != LED_OFF)112112- qt2160_write(client, QT2160_CMD_PWM_DUTY, value);113113-114114- mutex_unlock(&qt2160->led_lock);115115-}116116-117117-static void qt2160_led_set(struct led_classdev *cdev,118118- enum led_brightness value)8686+static int qt2160_led_set(struct led_classdev *cdev,8787+ enum led_brightness value)11988{12089 struct qt2160_led *led = container_of(cdev, struct qt2160_led, cdev);9090+ struct qt2160_data *qt2160 = led->qt2160;9191+ struct i2c_client *client = qt2160->client;9292+ u32 drive, pwmen;12193122122- led->new_brightness = value;123123- schedule_work(&led->work);9494+ if (value != led->brightness) {9595+ drive = qt2160_read(client, QT2160_CMD_DRIVE_X);9696+ pwmen = qt2160_read(client, QT2160_CMD_PWMEN_X);9797+ if (value != LED_OFF) {9898+ drive |= BIT(led->id);9999+ pwmen |= BIT(led->id);100100+101101+ } else {102102+ drive &= ~BIT(led->id);103103+ pwmen &= ~BIT(led->id);104104+ }105105+ qt2160_write(client, QT2160_CMD_DRIVE_X, drive);106106+ qt2160_write(client, QT2160_CMD_PWMEN_X, pwmen);107107+108108+ /*109109+ * Changing this register will change the brightness110110+ * of every LED in the qt2160. It's a HW limitation.111111+ */112112+ if (value != LED_OFF)113113+ qt2160_write(client, QT2160_CMD_PWM_DUTY, value);114114+115115+ led->brightness = value;116116+ }117117+118118+ return 0;124119}125120126121#endif /* CONFIG_LEDS_CLASS */···284293 int ret;285294 int i;286295287287- mutex_init(&qt2160->led_lock);288288-289296 for (i = 0; i < QT2160_NUM_LEDS_X; i++) {290297 struct qt2160_led *led = &qt2160->leds[i];291298292299 snprintf(led->name, sizeof(led->name), "qt2160:x%d", i);293300 led->cdev.name = led->name;294294- led->cdev.brightness_set = qt2160_led_set;301301+ led->cdev.brightness_set_blocking = qt2160_led_set;295302 led->cdev.brightness = LED_OFF;296303 led->id = i;297304 led->qt2160 = qt2160;298298-299299- INIT_WORK(&led->work, qt2160_led_work);300305301306 ret = led_classdev_register(&client->dev, &led->cdev);302307 if (ret < 0)···311324{312325 int i;313326314314- for (i = 0; i < QT2160_NUM_LEDS_X; i++) {327327+ for (i = 0; i < QT2160_NUM_LEDS_X; i++)315328 led_classdev_unregister(&qt2160->leds[i].cdev);316316- cancel_work_sync(&qt2160->leds[i].work);317317- }318329}319330320331#else
···696696 struct ethtool_eee *edata)697697{698698 struct stmmac_priv *priv = netdev_priv(dev);699699+ int ret;699700700700- priv->eee_enabled = edata->eee_enabled;701701-702702- if (!priv->eee_enabled)701701+ if (!edata->eee_enabled) {703702 stmmac_disable_eee_mode(priv);704704- else {703703+ } else {705704 /* We are asking for enabling the EEE but it is safe706705 * to verify all by invoking the eee_init function.707706 * In case of failure it will return an error.708707 */709709- priv->eee_enabled = stmmac_eee_init(priv);710710- if (!priv->eee_enabled)708708+ edata->eee_enabled = stmmac_eee_init(priv);709709+ if (!edata->eee_enabled)711710 return -EOPNOTSUPP;712712-713713- /* Do not change tx_lpi_timer in case of failure */714714- priv->tx_lpi_timer = edata->tx_lpi_timer;715711 }716712717717- return phy_ethtool_set_eee(dev->phydev, edata);713713+ ret = phy_ethtool_set_eee(dev->phydev, edata);714714+ if (ret)715715+ return ret;716716+717717+ priv->eee_enabled = edata->eee_enabled;718718+ priv->tx_lpi_timer = edata->tx_lpi_timer;719719+ return 0;718720}719721720722static u32 stmmac_usec2riwt(u32 usec, struct stmmac_priv *priv)
+1-1
drivers/net/ethernet/ti/netcp_core.c
···259259 const char *name;260260 char node_name[32];261261262262- if (of_property_read_string(node, "label", &name) < 0) {262262+ if (of_property_read_string(child, "label", &name) < 0) {263263 snprintf(node_name, sizeof(node_name), "%pOFn", child);264264 name = node_name;265265 }
+4-1
drivers/net/phy/xilinx_gmii2rgmii.c
···3535 u16 val = 0;3636 int err;37373838- err = priv->phy_drv->read_status(phydev);3838+ if (priv->phy_drv->read_status)3939+ err = priv->phy_drv->read_status(phydev);4040+ else4141+ err = genphy_read_status(phydev);3942 if (err < 0)4043 return err;4144
+2-2
drivers/net/usb/qmi_wwan.c
···12011201 {QMI_FIXED_INTF(0x114f, 0x68a2, 8)}, /* Sierra Wireless MC7750 */12021202 {QMI_FIXED_INTF(0x1199, 0x68a2, 8)}, /* Sierra Wireless MC7710 in QMI mode */12031203 {QMI_FIXED_INTF(0x1199, 0x68a2, 19)}, /* Sierra Wireless MC7710 in QMI mode */12041204- {QMI_FIXED_INTF(0x1199, 0x68c0, 8)}, /* Sierra Wireless MC7304/MC7354 */12051205- {QMI_FIXED_INTF(0x1199, 0x68c0, 10)}, /* Sierra Wireless MC7304/MC7354 */12041204+ {QMI_QUIRK_SET_DTR(0x1199, 0x68c0, 8)}, /* Sierra Wireless MC7304/MC7354, WP76xx */12051205+ {QMI_QUIRK_SET_DTR(0x1199, 0x68c0, 10)},/* Sierra Wireless MC7304/MC7354 */12061206 {QMI_FIXED_INTF(0x1199, 0x901c, 8)}, /* Sierra Wireless EM7700 */12071207 {QMI_FIXED_INTF(0x1199, 0x901f, 8)}, /* Sierra Wireless EM7355 */12081208 {QMI_FIXED_INTF(0x1199, 0x9041, 8)}, /* Sierra Wireless MC7305/MC7355 */
+3-2
drivers/net/usb/r8152.c
···557557/* MAC PASSTHRU */558558#define AD_MASK 0xfee0559559#define BND_MASK 0x0004560560+#define BD_MASK 0x0001560561#define EFUSE 0xcfdb561562#define PASS_THRU_MASK 0x1562563···11771176 return -ENODEV;11781177 }11791178 } else {11801180- /* test for RTL8153-BND */11791179+ /* test for RTL8153-BND and RTL8153-BD */11811180 ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_MISC_1);11821182- if ((ocp_data & BND_MASK) == 0) {11811181+ if ((ocp_data & BND_MASK) == 0 && (ocp_data & BD_MASK)) {11831182 netif_dbg(tp, probe, tp->netdev,11841183 "Invalid variant for MAC pass through\n");11851184 return -ENODEV;
+30-18
drivers/net/wireless/mediatek/mt76/mt76x0/usb.c
···158158 .get_txpower = mt76_get_txpower,159159};160160161161+static int mt76x0u_init_hardware(struct mt76x02_dev *dev)162162+{163163+ int err;164164+165165+ mt76x0_chip_onoff(dev, true, true);166166+167167+ if (!mt76x02_wait_for_mac(&dev->mt76))168168+ return -ETIMEDOUT;169169+170170+ err = mt76x0u_mcu_init(dev);171171+ if (err < 0)172172+ return err;173173+174174+ mt76x0_init_usb_dma(dev);175175+ err = mt76x0_init_hardware(dev);176176+ if (err < 0)177177+ return err;178178+179179+ mt76_rmw(dev, MT_US_CYC_CFG, MT_US_CYC_CNT, 0x1e);180180+ mt76_wr(dev, MT_TXOP_CTRL_CFG,181181+ FIELD_PREP(MT_TXOP_TRUN_EN, 0x3f) |182182+ FIELD_PREP(MT_TXOP_EXT_CCA_DLY, 0x58));183183+184184+ return 0;185185+}186186+161187static int mt76x0u_register_device(struct mt76x02_dev *dev)162188{163189 struct ieee80211_hw *hw = dev->mt76.hw;···197171 if (err < 0)198172 goto out_err;199173200200- mt76x0_chip_onoff(dev, true, true);201201- if (!mt76x02_wait_for_mac(&dev->mt76)) {202202- err = -ETIMEDOUT;203203- goto out_err;204204- }205205-206206- err = mt76x0u_mcu_init(dev);174174+ err = mt76x0u_init_hardware(dev);207175 if (err < 0)208176 goto out_err;209209-210210- mt76x0_init_usb_dma(dev);211211- err = mt76x0_init_hardware(dev);212212- if (err < 0)213213- goto out_err;214214-215215- mt76_rmw(dev, MT_US_CYC_CFG, MT_US_CYC_CNT, 0x1e);216216- mt76_wr(dev, MT_TXOP_CTRL_CFG,217217- FIELD_PREP(MT_TXOP_TRUN_EN, 0x3f) |218218- FIELD_PREP(MT_TXOP_EXT_CCA_DLY, 0x58));219177220178 err = mt76x0_register_device(dev);221179 if (err < 0)···311301312302 mt76u_stop_queues(&dev->mt76);313303 mt76x0u_mac_stop(dev);304304+ clear_bit(MT76_STATE_MCU_RUNNING, &dev->mt76.state);305305+ mt76x0_chip_onoff(dev, false, false);314306 usb_kill_urb(usb->mcu.res.urb);315307316308 return 0;···340328 tasklet_enable(&usb->rx_tasklet);341329 tasklet_enable(&usb->tx_tasklet);342330343343- ret = mt76x0_init_hardware(dev);331331+ ret = mt76x0u_init_hardware(dev);344332 if (ret)345333 goto err;346334
···29512951 if (rot == 1) {29522952 blk_queue_flag_set(QUEUE_FLAG_NONROT, q);29532953 blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, q);29542954- } else {29552955- blk_queue_flag_clear(QUEUE_FLAG_NONROT, q);29562956- blk_queue_flag_set(QUEUE_FLAG_ADD_RANDOM, q);29572954 }2958295529592956 if (sdkp->device->type == TYPE_ZBC) {···30863089 */30873090 if (sdkp->media_present) {30883091 sd_read_capacity(sdkp, buffer);30923092+30933093+ /*30943094+ * set the default to rotational. All non-rotational devices30953095+ * support the block characteristics VPD page, which will30963096+ * cause this to be updated correctly and any device which30973097+ * doesn't support it should be treated as rotational.30983098+ */30993099+ blk_queue_flag_clear(QUEUE_FLAG_NONROT, q);31003100+ blk_queue_flag_set(QUEUE_FLAG_ADD_RANDOM, q);3089310130903102 if (scsi_device_supports_vpd(sdp)) {30913103 sd_read_block_provisioning(sdkp);
···1414#include <linux/err.h>1515#include <linux/fs.h>16161717+static inline bool spacetab(char c) { return c == ' ' || c == '\t'; }1818+static inline char *next_non_spacetab(char *first, const char *last)1919+{2020+ for (; first <= last; first++)2121+ if (!spacetab(*first))2222+ return first;2323+ return NULL;2424+}2525+static inline char *next_terminator(char *first, const char *last)2626+{2727+ for (; first <= last; first++)2828+ if (spacetab(*first) || !*first)2929+ return first;3030+ return NULL;3131+}3232+1733static int load_script(struct linux_binprm *bprm)1834{1935 const char *i_arg, *i_name;2020- char *cp;3636+ char *cp, *buf_end;2137 struct file *file;2238 int retval;23394040+ /* Not ours to exec if we don't start with "#!". */2441 if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!'))2542 return -ENOEXEC;2643···5033 if (bprm->interp_flags & BINPRM_FLAGS_PATH_INACCESSIBLE)5134 return -ENOENT;52355353- /*5454- * This section does the #! interpretation.5555- * Sorta complicated, but hopefully it will work. -TYT5656- */5757-3636+ /* Release since we are not mapping a binary into memory. */5837 allow_write_access(bprm->file);5938 fput(bprm->file);6039 bprm->file = NULL;61406262- bprm->buf[BINPRM_BUF_SIZE - 1] = '\0';6363- if ((cp = strchr(bprm->buf, '\n')) == NULL)6464- cp = bprm->buf+BINPRM_BUF_SIZE-1;4141+ /*4242+ * This section handles parsing the #! line into separate4343+ * interpreter path and argument strings. We must be careful4444+ * because bprm->buf is not yet guaranteed to be NUL-terminated4545+ * (though the buffer will have trailing NUL padding when the4646+ * file size was smaller than the buffer size).4747+ *4848+ * We do not want to exec a truncated interpreter path, so either4949+ * we find a newline (which indicates nothing is truncated), or5050+ * we find a space/tab/NUL after the interpreter path (which5151+ * itself may be preceded by spaces/tabs). Truncating the5252+ * arguments is fine: the interpreter can re-read the script to5353+ * parse them on its own.5454+ */5555+ buf_end = bprm->buf + sizeof(bprm->buf) - 1;5656+ cp = strnchr(bprm->buf, sizeof(bprm->buf), '\n');5757+ if (!cp) {5858+ cp = next_non_spacetab(bprm->buf + 2, buf_end);5959+ if (!cp)6060+ return -ENOEXEC; /* Entire buf is spaces/tabs */6161+ /*6262+ * If there is no later space/tab/NUL we must assume the6363+ * interpreter path is truncated.6464+ */6565+ if (!next_terminator(cp, buf_end))6666+ return -ENOEXEC;6767+ cp = buf_end;6868+ }6969+ /* NUL-terminate the buffer and any trailing spaces/tabs. */6570 *cp = '\0';6671 while (cp > bprm->buf) {6772 cp--;
+6-5
fs/nfs/write.c
···238238}239239240240/* A writeback failed: mark the page as bad, and invalidate the page cache */241241-static void nfs_set_pageerror(struct page *page)241241+static void nfs_set_pageerror(struct address_space *mapping)242242{243243- nfs_zap_mapping(page_file_mapping(page)->host, page_file_mapping(page));243243+ nfs_zap_mapping(mapping->host, mapping);244244}245245246246/*···994994 nfs_list_remove_request(req);995995 if (test_bit(NFS_IOHDR_ERROR, &hdr->flags) &&996996 (hdr->good_bytes < bytes)) {997997- nfs_set_pageerror(req->wb_page);997997+ nfs_set_pageerror(page_file_mapping(req->wb_page));998998 nfs_context_set_write_error(req->wb_context, hdr->error);999999 goto remove_req;10001000 }···13481348 unsigned int offset, unsigned int count)13491349{13501350 struct nfs_open_context *ctx = nfs_file_open_context(file);13511351- struct inode *inode = page_file_mapping(page)->host;13511351+ struct address_space *mapping = page_file_mapping(page);13521352+ struct inode *inode = mapping->host;13521353 int status = 0;1353135413541355 nfs_inc_stats(inode, NFSIOS_VFSUPDATEPAGE);···1367136613681367 status = nfs_writepage_setup(ctx, page, offset, count);13691368 if (status < 0)13701370- nfs_set_pageerror(page);13691369+ nfs_set_pageerror(mapping);13711370 else13721371 __set_page_dirty_nobuffers(page);13731372out:
···100100};101101102102struct vgic_irq {103103- spinlock_t irq_lock; /* Protects the content of the struct */103103+ raw_spinlock_t irq_lock; /* Protects the content of the struct */104104 struct list_head lpi_list; /* Used to link all LPIs together */105105 struct list_head ap_list;106106···256256 u64 propbaser;257257258258 /* Protects the lpi_list and the count value below. */259259- spinlock_t lpi_list_lock;259259+ raw_spinlock_t lpi_list_lock;260260 struct list_head lpi_list_head;261261 int lpi_list_count;262262···307307 unsigned int used_lrs;308308 struct vgic_irq private_irqs[VGIC_NR_PRIVATE_IRQS];309309310310- spinlock_t ap_list_lock; /* Protects the ap_list */310310+ raw_spinlock_t ap_list_lock; /* Protects the ap_list */311311312312 /*313313 * List of IRQs that this VCPU should consider because they are either
+14
include/linux/compiler_attributes.h
···3434#ifndef __has_attribute3535# define __has_attribute(x) __GCC4_has_attribute_##x3636# define __GCC4_has_attribute___assume_aligned__ (__GNUC_MINOR__ >= 9)3737+# define __GCC4_has_attribute___copy__ 03738# define __GCC4_has_attribute___designated_init__ 03839# define __GCC4_has_attribute___externally_visible__ 13940# define __GCC4_has_attribute___noclone__ 1···10099 * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-const-function-attribute101100 */102101#define __attribute_const__ __attribute__((__const__))102102+103103+/*104104+ * Optional: only supported since gcc >= 9105105+ * Optional: not supported by clang106106+ * Optional: not supported by icc107107+ *108108+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-copy-function-attribute109109+ */110110+#if __has_attribute(__copy__)111111+# define __copy(symbol) __attribute__((__copy__(symbol)))112112+#else113113+# define __copy(symbol)114114+#endif103115104116/*105117 * Don't. Just don't. See commit 771c035372a0 ("deprecate the '__deprecated'
-7
include/linux/efi.h
···11981198extern void efi_reboot(enum reboot_mode reboot_mode, const char *__unused);1199119912001200extern bool efi_is_table_address(unsigned long phys_addr);12011201-12021202-extern int efi_apply_persistent_mem_reservations(void);12031201#else12041202static inline bool efi_enabled(int feature)12051203{···12151217static inline bool efi_is_table_address(unsigned long phys_addr)12161218{12171219 return false;12181218-}12191219-12201220-static inline int efi_apply_persistent_mem_reservations(void)12211221-{12221222- return 0;12231220}12241221#endif12251222
-3
include/linux/memblock.h
···2929 */3030extern unsigned long long max_possible_pfn;31313232-#define INIT_MEMBLOCK_REGIONS 1283333-#define INIT_PHYSMEM_REGIONS 43434-3532/**3633 * enum memblock_flags - definition of memory region attributes3734 * @MEMBLOCK_NONE: no special request
+2-2
include/linux/module.h
···129129#define module_init(initfn) \130130 static inline initcall_t __maybe_unused __inittest(void) \131131 { return initfn; } \132132- int init_module(void) __attribute__((alias(#initfn)));132132+ int init_module(void) __copy(initfn) __attribute__((alias(#initfn)));133133134134/* This is only required if you want to be unloadable. */135135#define module_exit(exitfn) \136136 static inline exitcall_t __maybe_unused __exittest(void) \137137 { return exitfn; } \138138- void cleanup_module(void) __attribute__((alias(#exitfn)));138138+ void cleanup_module(void) __copy(exitfn) __attribute__((alias(#exitfn)));139139140140#endif141141
+22-2
include/linux/netdev_features.h
···1111#define _LINUX_NETDEV_FEATURES_H12121313#include <linux/types.h>1414+#include <linux/bitops.h>1515+#include <asm/byteorder.h>14161517typedef u64 netdev_features_t;1618···156154#define NETIF_F_HW_TLS_TX __NETIF_F(HW_TLS_TX)157155#define NETIF_F_HW_TLS_RX __NETIF_F(HW_TLS_RX)158156159159-#define for_each_netdev_feature(mask_addr, bit) \160160- for_each_set_bit(bit, (unsigned long *)mask_addr, NETDEV_FEATURE_COUNT)157157+/* Finds the next feature with the highest number of the range of start till 0.158158+ */159159+static inline int find_next_netdev_feature(u64 feature, unsigned long start)160160+{161161+ /* like BITMAP_LAST_WORD_MASK() for u64162162+ * this sets the most significant 64 - start to 0.163163+ */164164+ feature &= ~0ULL >> (-start & ((sizeof(feature) * 8) - 1));165165+166166+ return fls64(feature) - 1;167167+}168168+169169+/* This goes for the MSB to the LSB through the set feature bits,170170+ * mask_addr should be a u64 and bit an int171171+ */172172+#define for_each_netdev_feature(mask_addr, bit) \173173+ for ((bit) = find_next_netdev_feature((mask_addr), \174174+ NETDEV_FEATURE_COUNT); \175175+ (bit) >= 0; \176176+ (bit) = find_next_netdev_feature((mask_addr), (bit) - 1))161177162178/* Features valid for ethtool to change */163179/* = all defined minus driver/device-class-related */
+5
include/linux/perf_event.h
···447447 * Filter events for PMU-specific reasons.448448 */449449 int (*filter_match) (struct perf_event *event); /* optional */450450+451451+ /*452452+ * Check period value for PERF_EVENT_IOC_PERIOD ioctl.453453+ */454454+ int (*check_period) (struct perf_event *event, u64 value); /* optional */450455};451456452457enum perf_addr_filter_action_t {
···57575858 if (!skb_partial_csum_set(skb, start, off))5959 return -EINVAL;6060+ } else {6161+ /* gso packets without NEEDS_CSUM do not set transport_offset.6262+ * probe and drop if does not match one of the above types.6363+ */6464+ if (gso_type) {6565+ skb_probe_transport_header(skb, -1);6666+ if (!skb_transport_header_was_set(skb))6767+ return -EINVAL;6868+ }6069 }61706271 if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) {
+7-1
kernel/bpf/stackmap.c
···4444 struct stack_map_irq_work *work;45454646 work = container_of(entry, struct stack_map_irq_work, irq_work);4747- up_read(work->sem);4747+ up_read_non_owner(work->sem);4848 work->sem = NULL;4949}5050···338338 } else {339339 work->sem = ¤t->mm->mmap_sem;340340 irq_work_queue(&work->irq_work);341341+ /*342342+ * The irq_work will release the mmap_sem with343343+ * up_read_non_owner(). The rwsem_release() is called344344+ * here to release the lock from lockdep's perspective.345345+ */346346+ rwsem_release(¤t->mm->mmap_sem.dep_map, 1, _RET_IP_);341347 }342348}343349
+16
kernel/events/core.c
···49634963 }49644964}4965496549664966+static int perf_event_check_period(struct perf_event *event, u64 value)49674967+{49684968+ return event->pmu->check_period(event, value);49694969+}49704970+49664971static int perf_event_period(struct perf_event *event, u64 __user *arg)49674972{49684973 u64 value;···49824977 return -EINVAL;4983497849844979 if (event->attr.freq && value > sysctl_perf_event_sample_rate)49804980+ return -EINVAL;49814981+49824982+ if (perf_event_check_period(event, value))49854983 return -EINVAL;4986498449874985 event_function_call(event, __perf_event_period, &value);···93999391 return 0;94009392}9401939393949394+static int perf_event_nop_int(struct perf_event *event, u64 value)93959395+{93969396+ return 0;93979397+}93989398+94029399static DEFINE_PER_CPU(unsigned int, nop_txn_flags);9403940094049401static void perf_pmu_start_txn(struct pmu *pmu, unsigned int flags)···97039690 pmu->pmu_enable = perf_pmu_nop_void;97049691 pmu->pmu_disable = perf_pmu_nop_void;97059692 }96939693+96949694+ if (!pmu->check_period)96959695+ pmu->check_period = perf_event_nop_int;9706969697079697 if (!pmu->event_idx)97089698 pmu->event_idx = perf_event_idx_default;
···46754675 /* Even if we own the page, we do not use atomic_set().46764676 * This would break get_page_unless_zero() users.46774677 */46784678- page_ref_add(page, size);46784678+ page_ref_add(page, PAGE_FRAG_CACHE_MAX_SIZE);4679467946804680 /* reset page count bias and offset to start of new frag */46814681 nc->pfmemalloc = page_is_pfmemalloc(page);46824682- nc->pagecnt_bias = size + 1;46824682+ nc->pagecnt_bias = PAGE_FRAG_CACHE_MAX_SIZE + 1;46834683 nc->offset = size;46844684 }46854685···46954695 size = nc->size;46964696#endif46974697 /* OK, page count is 0, we can safely set it */46984698- set_page_count(page, size + 1);46984698+ set_page_count(page, PAGE_FRAG_CACHE_MAX_SIZE + 1);4699469947004700 /* reset page count bias and offset to start of new frag */47014701- nc->pagecnt_bias = size + 1;47014701+ nc->pagecnt_bias = PAGE_FRAG_CACHE_MAX_SIZE + 1;47024702 offset = size - fragsz;47034703 }47044704
+2-2
net/core/dev.c
···82158215 netdev_features_t feature;82168216 int feature_bit;8217821782188218- for_each_netdev_feature(&upper_disables, feature_bit) {82188218+ for_each_netdev_feature(upper_disables, feature_bit) {82198219 feature = __NETIF_F_BIT(feature_bit);82208220 if (!(upper->wanted_features & feature)82218221 && (features & feature)) {···82358235 netdev_features_t feature;82368236 int feature_bit;8237823782388238- for_each_netdev_feature(&upper_disables, feature_bit) {82388238+ for_each_netdev_feature(upper_disables, feature_bit) {82398239 feature = __NETIF_F_BIT(feature_bit);82408240 if (!(features & feature) && (lower->features & feature)) {82418241 netdev_dbg(upper, "Disabling feature %pNF on lower dev %s.\n",
+4-8
net/core/filter.c
···28042804 u32 off = skb_mac_header_len(skb);28052805 int ret;2806280628072807- /* SCTP uses GSO_BY_FRAGS, thus cannot adjust it. */28082808- if (skb_is_gso(skb) && unlikely(skb_is_gso_sctp(skb)))28072807+ if (!skb_is_gso_tcp(skb))28092808 return -ENOTSUPP;2810280928112810 ret = skb_cow(skb, len_diff);···28452846 u32 off = skb_mac_header_len(skb);28462847 int ret;2847284828482848- /* SCTP uses GSO_BY_FRAGS, thus cannot adjust it. */28492849- if (skb_is_gso(skb) && unlikely(skb_is_gso_sctp(skb)))28492849+ if (!skb_is_gso_tcp(skb))28502850 return -ENOTSUPP;2851285128522852 ret = skb_unclone(skb, GFP_ATOMIC);···29702972 u32 off = skb_mac_header_len(skb) + bpf_skb_net_base_len(skb);29712973 int ret;2972297429732973- /* SCTP uses GSO_BY_FRAGS, thus cannot adjust it. */29742974- if (skb_is_gso(skb) && unlikely(skb_is_gso_sctp(skb)))29752975+ if (!skb_is_gso_tcp(skb))29752976 return -ENOTSUPP;2976297729772978 ret = skb_cow(skb, len_diff);···29993002 u32 off = skb_mac_header_len(skb) + bpf_skb_net_base_len(skb);30003003 int ret;3001300430023002- /* SCTP uses GSO_BY_FRAGS, thus cannot adjust it. */30033003- if (skb_is_gso(skb) && unlikely(skb_is_gso_sctp(skb)))30053005+ if (!skb_is_gso_tcp(skb))30043006 return -ENOTSUPP;3005300730063008 ret = skb_unclone(skb, GFP_ATOMIC);
+4
net/core/skbuff.c
···356356 */357357void *netdev_alloc_frag(unsigned int fragsz)358358{359359+ fragsz = SKB_DATA_ALIGN(fragsz);360360+359361 return __netdev_alloc_frag(fragsz, GFP_ATOMIC);360362}361363EXPORT_SYMBOL(netdev_alloc_frag);···371369372370void *napi_alloc_frag(unsigned int fragsz)373371{372372+ fragsz = SKB_DATA_ALIGN(fragsz);373373+374374 return __napi_alloc_frag(fragsz, GFP_ATOMIC);375375}376376EXPORT_SYMBOL(napi_alloc_frag);
···17191719 return 0;17201720}1721172117221722+static void ip6erspan_set_version(struct nlattr *data[],17231723+ struct __ip6_tnl_parm *parms)17241724+{17251725+ parms->erspan_ver = 1;17261726+ if (data[IFLA_GRE_ERSPAN_VER])17271727+ parms->erspan_ver = nla_get_u8(data[IFLA_GRE_ERSPAN_VER]);17281728+17291729+ if (parms->erspan_ver == 1) {17301730+ if (data[IFLA_GRE_ERSPAN_INDEX])17311731+ parms->index = nla_get_u32(data[IFLA_GRE_ERSPAN_INDEX]);17321732+ } else if (parms->erspan_ver == 2) {17331733+ if (data[IFLA_GRE_ERSPAN_DIR])17341734+ parms->dir = nla_get_u8(data[IFLA_GRE_ERSPAN_DIR]);17351735+ if (data[IFLA_GRE_ERSPAN_HWID])17361736+ parms->hwid = nla_get_u16(data[IFLA_GRE_ERSPAN_HWID]);17371737+ }17381738+}17391739+17221740static void ip6gre_netlink_parms(struct nlattr *data[],17231741 struct __ip6_tnl_parm *parms)17241742{···1785176717861768 if (data[IFLA_GRE_COLLECT_METADATA])17871769 parms->collect_md = true;17881788-17891789- parms->erspan_ver = 1;17901790- if (data[IFLA_GRE_ERSPAN_VER])17911791- parms->erspan_ver = nla_get_u8(data[IFLA_GRE_ERSPAN_VER]);17921792-17931793- if (parms->erspan_ver == 1) {17941794- if (data[IFLA_GRE_ERSPAN_INDEX])17951795- parms->index = nla_get_u32(data[IFLA_GRE_ERSPAN_INDEX]);17961796- } else if (parms->erspan_ver == 2) {17971797- if (data[IFLA_GRE_ERSPAN_DIR])17981798- parms->dir = nla_get_u8(data[IFLA_GRE_ERSPAN_DIR]);17991799- if (data[IFLA_GRE_ERSPAN_HWID])18001800- parms->hwid = nla_get_u16(data[IFLA_GRE_ERSPAN_HWID]);18011801- }18021770}1803177118041772static int ip6gre_tap_init(struct net_device *dev)···22072203 int err;2208220422092205 ip6gre_netlink_parms(data, &nt->parms);22062206+ ip6erspan_set_version(data, &nt->parms);22102207 ign = net_generic(net, ip6gre_net_id);2211220822122209 if (nt->parms.collect_md) {···22532248 if (IS_ERR(t))22542249 return PTR_ERR(t);2255225022512251+ ip6erspan_set_version(data, &p);22562252 ip6gre_tunnel_unlink_md(ign, t);22572253 ip6gre_tunnel_unlink(ign, t);22582254 ip6erspan_tnl_change(t, &p, !tb[IFLA_MTU]);
+5-1
net/mac80211/cfg.c
···941941 BSS_CHANGED_P2P_PS |942942 BSS_CHANGED_TXPOWER;943943 int err;944944+ int prev_beacon_int;944945945946 old = sdata_dereference(sdata->u.ap.beacon, sdata);946947 if (old)···964963965964 sdata->needed_rx_chains = sdata->local->rx_chains;966965966966+ prev_beacon_int = sdata->vif.bss_conf.beacon_int;967967 sdata->vif.bss_conf.beacon_int = params->beacon_interval;968968969969 if (params->he_cap)···976974 if (!err)977975 ieee80211_vif_copy_chanctx_to_vlans(sdata, false);978976 mutex_unlock(&local->mtx);979979- if (err)977977+ if (err) {978978+ sdata->vif.bss_conf.beacon_int = prev_beacon_int;980979 return err;980980+ }981981982982 /*983983 * Apply control port protocol, this allows us to
+6
net/mac80211/mesh.h
···7070 * @dst: mesh path destination mac address7171 * @mpp: mesh proxy mac address7272 * @rhash: rhashtable list pointer7373+ * @walk_list: linked list containing all mesh_path objects.7374 * @gate_list: list pointer for known gates list7475 * @sdata: mesh subif7576 * @next_hop: mesh neighbor to which frames for this destination will be···107106 u8 dst[ETH_ALEN];108107 u8 mpp[ETH_ALEN]; /* used for MPP or MAP */109108 struct rhash_head rhash;109109+ struct hlist_node walk_list;110110 struct hlist_node gate_list;111111 struct ieee80211_sub_if_data *sdata;112112 struct sta_info __rcu *next_hop;···137135 * gate's mpath may or may not be resolved and active.138136 * @gates_lock: protects updates to known_gates139137 * @rhead: the rhashtable containing struct mesh_paths, keyed by dest addr138138+ * @walk_head: linked list containging all mesh_path objects139139+ * @walk_lock: lock protecting walk_head140140 * @entries: number of entries in the table141141 */142142struct mesh_table {143143 struct hlist_head known_gates;144144 spinlock_t gates_lock;145145 struct rhashtable rhead;146146+ struct hlist_head walk_head;147147+ spinlock_t walk_lock;146148 atomic_t entries; /* Up to MAX_MESH_NEIGHBOURS */147149};148150
+47-110
net/mac80211/mesh_pathtbl.c
···5959 return NULL;60606161 INIT_HLIST_HEAD(&newtbl->known_gates);6262+ INIT_HLIST_HEAD(&newtbl->walk_head);6263 atomic_set(&newtbl->entries, 0);6364 spin_lock_init(&newtbl->gates_lock);6565+ spin_lock_init(&newtbl->walk_lock);64666567 return newtbl;6668}···251249static struct mesh_path *252250__mesh_path_lookup_by_idx(struct mesh_table *tbl, int idx)253251{254254- int i = 0, ret;255255- struct mesh_path *mpath = NULL;256256- struct rhashtable_iter iter;252252+ int i = 0;253253+ struct mesh_path *mpath;257254258258- ret = rhashtable_walk_init(&tbl->rhead, &iter, GFP_ATOMIC);259259- if (ret)260260- return NULL;261261-262262- rhashtable_walk_start(&iter);263263-264264- while ((mpath = rhashtable_walk_next(&iter))) {265265- if (IS_ERR(mpath) && PTR_ERR(mpath) == -EAGAIN)266266- continue;267267- if (IS_ERR(mpath))268268- break;255255+ hlist_for_each_entry_rcu(mpath, &tbl->walk_head, walk_list) {269256 if (i++ == idx)270257 break;271258 }272272- rhashtable_walk_stop(&iter);273273- rhashtable_walk_exit(&iter);274259275275- if (IS_ERR(mpath) || !mpath)260260+ if (!mpath)276261 return NULL;277262278263 if (mpath_expired(mpath)) {···421432 return ERR_PTR(-ENOMEM);422433423434 tbl = sdata->u.mesh.mesh_paths;435435+ spin_lock_bh(&tbl->walk_lock);424436 do {425437 ret = rhashtable_lookup_insert_fast(&tbl->rhead,426438 &new_mpath->rhash,···431441 mpath = rhashtable_lookup_fast(&tbl->rhead,432442 dst,433443 mesh_rht_params);434434-444444+ else if (!ret)445445+ hlist_add_head(&new_mpath->walk_list, &tbl->walk_head);435446 } while (unlikely(ret == -EEXIST && !mpath));447447+ spin_unlock_bh(&tbl->walk_lock);436448437437- if (ret && ret != -EEXIST)438438- return ERR_PTR(ret);439439-440440- /* At this point either new_mpath was added, or we found a441441- * matching entry already in the table; in the latter case442442- * free the unnecessary new entry.443443- */444444- if (ret == -EEXIST) {449449+ if (ret) {445450 kfree(new_mpath);451451+452452+ if (ret != -EEXIST)453453+ return ERR_PTR(ret);454454+446455 new_mpath = mpath;447456 }457457+448458 sdata->u.mesh.mesh_paths_generation++;449459 return new_mpath;450460}···470480471481 memcpy(new_mpath->mpp, mpp, ETH_ALEN);472482 tbl = sdata->u.mesh.mpp_paths;483483+484484+ spin_lock_bh(&tbl->walk_lock);473485 ret = rhashtable_lookup_insert_fast(&tbl->rhead,474486 &new_mpath->rhash,475487 mesh_rht_params);488488+ if (!ret)489489+ hlist_add_head_rcu(&new_mpath->walk_list, &tbl->walk_head);490490+ spin_unlock_bh(&tbl->walk_lock);491491+492492+ if (ret)493493+ kfree(new_mpath);476494477495 sdata->u.mesh.mpp_paths_generation++;478496 return ret;···501503 struct mesh_table *tbl = sdata->u.mesh.mesh_paths;502504 static const u8 bcast[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};503505 struct mesh_path *mpath;504504- struct rhashtable_iter iter;505505- int ret;506506507507- ret = rhashtable_walk_init(&tbl->rhead, &iter, GFP_ATOMIC);508508- if (ret)509509- return;510510-511511- rhashtable_walk_start(&iter);512512-513513- while ((mpath = rhashtable_walk_next(&iter))) {514514- if (IS_ERR(mpath) && PTR_ERR(mpath) == -EAGAIN)515515- continue;516516- if (IS_ERR(mpath))517517- break;507507+ rcu_read_lock();508508+ hlist_for_each_entry_rcu(mpath, &tbl->walk_head, walk_list) {518509 if (rcu_access_pointer(mpath->next_hop) == sta &&519510 mpath->flags & MESH_PATH_ACTIVE &&520511 !(mpath->flags & MESH_PATH_FIXED)) {···517530 WLAN_REASON_MESH_PATH_DEST_UNREACHABLE, bcast);518531 }519532 }520520- rhashtable_walk_stop(&iter);521521- rhashtable_walk_exit(&iter);533533+ rcu_read_unlock();522534}523535524536static void mesh_path_free_rcu(struct mesh_table *tbl,···537551538552static void __mesh_path_del(struct mesh_table *tbl, struct mesh_path *mpath)539553{554554+ hlist_del_rcu(&mpath->walk_list);540555 rhashtable_remove_fast(&tbl->rhead, &mpath->rhash, mesh_rht_params);541556 mesh_path_free_rcu(tbl, mpath);542557}···558571 struct ieee80211_sub_if_data *sdata = sta->sdata;559572 struct mesh_table *tbl = sdata->u.mesh.mesh_paths;560573 struct mesh_path *mpath;561561- struct rhashtable_iter iter;562562- int ret;574574+ struct hlist_node *n;563575564564- ret = rhashtable_walk_init(&tbl->rhead, &iter, GFP_ATOMIC);565565- if (ret)566566- return;567567-568568- rhashtable_walk_start(&iter);569569-570570- while ((mpath = rhashtable_walk_next(&iter))) {571571- if (IS_ERR(mpath) && PTR_ERR(mpath) == -EAGAIN)572572- continue;573573- if (IS_ERR(mpath))574574- break;575575-576576+ spin_lock_bh(&tbl->walk_lock);577577+ hlist_for_each_entry_safe(mpath, n, &tbl->walk_head, walk_list) {576578 if (rcu_access_pointer(mpath->next_hop) == sta)577579 __mesh_path_del(tbl, mpath);578580 }579579-580580- rhashtable_walk_stop(&iter);581581- rhashtable_walk_exit(&iter);581581+ spin_unlock_bh(&tbl->walk_lock);582582}583583584584static void mpp_flush_by_proxy(struct ieee80211_sub_if_data *sdata,···573599{574600 struct mesh_table *tbl = sdata->u.mesh.mpp_paths;575601 struct mesh_path *mpath;576576- struct rhashtable_iter iter;577577- int ret;602602+ struct hlist_node *n;578603579579- ret = rhashtable_walk_init(&tbl->rhead, &iter, GFP_ATOMIC);580580- if (ret)581581- return;582582-583583- rhashtable_walk_start(&iter);584584-585585- while ((mpath = rhashtable_walk_next(&iter))) {586586- if (IS_ERR(mpath) && PTR_ERR(mpath) == -EAGAIN)587587- continue;588588- if (IS_ERR(mpath))589589- break;590590-604604+ spin_lock_bh(&tbl->walk_lock);605605+ hlist_for_each_entry_safe(mpath, n, &tbl->walk_head, walk_list) {591606 if (ether_addr_equal(mpath->mpp, proxy))592607 __mesh_path_del(tbl, mpath);593608 }594594-595595- rhashtable_walk_stop(&iter);596596- rhashtable_walk_exit(&iter);609609+ spin_unlock_bh(&tbl->walk_lock);597610}598611599612static void table_flush_by_iface(struct mesh_table *tbl)600613{601614 struct mesh_path *mpath;602602- struct rhashtable_iter iter;603603- int ret;615615+ struct hlist_node *n;604616605605- ret = rhashtable_walk_init(&tbl->rhead, &iter, GFP_ATOMIC);606606- if (ret)607607- return;608608-609609- rhashtable_walk_start(&iter);610610-611611- while ((mpath = rhashtable_walk_next(&iter))) {612612- if (IS_ERR(mpath) && PTR_ERR(mpath) == -EAGAIN)613613- continue;614614- if (IS_ERR(mpath))615615- break;617617+ spin_lock_bh(&tbl->walk_lock);618618+ hlist_for_each_entry_safe(mpath, n, &tbl->walk_head, walk_list) {616619 __mesh_path_del(tbl, mpath);617620 }618618-619619- rhashtable_walk_stop(&iter);620620- rhashtable_walk_exit(&iter);621621+ spin_unlock_bh(&tbl->walk_lock);621622}622623623624/**···624675{625676 struct mesh_path *mpath;626677627627- rcu_read_lock();678678+ spin_lock_bh(&tbl->walk_lock);628679 mpath = rhashtable_lookup_fast(&tbl->rhead, addr, mesh_rht_params);629680 if (!mpath) {630630- rcu_read_unlock();681681+ spin_unlock_bh(&tbl->walk_lock);631682 return -ENXIO;632683 }633684634685 __mesh_path_del(tbl, mpath);635635- rcu_read_unlock();686686+ spin_unlock_bh(&tbl->walk_lock);636687 return 0;637688}638689···803854 struct mesh_table *tbl)804855{805856 struct mesh_path *mpath;806806- struct rhashtable_iter iter;807807- int ret;857857+ struct hlist_node *n;808858809809- ret = rhashtable_walk_init(&tbl->rhead, &iter, GFP_KERNEL);810810- if (ret)811811- return;812812-813813- rhashtable_walk_start(&iter);814814-815815- while ((mpath = rhashtable_walk_next(&iter))) {816816- if (IS_ERR(mpath) && PTR_ERR(mpath) == -EAGAIN)817817- continue;818818- if (IS_ERR(mpath))819819- break;859859+ spin_lock_bh(&tbl->walk_lock);860860+ hlist_for_each_entry_safe(mpath, n, &tbl->walk_head, walk_list) {820861 if ((!(mpath->flags & MESH_PATH_RESOLVING)) &&821862 (!(mpath->flags & MESH_PATH_FIXED)) &&822863 time_after(jiffies, mpath->exp_time + MESH_PATH_EXPIRE))823864 __mesh_path_del(tbl, mpath);824865 }825825-826826- rhashtable_walk_stop(&iter);827827- rhashtable_walk_exit(&iter);866866+ spin_unlock_bh(&tbl->walk_lock);828867}829868830869void mesh_path_expire(struct ieee80211_sub_if_data *sdata)
+2-1
net/netfilter/ipvs/ip_vs_ctl.c
···896896{897897 struct ip_vs_dest *dest;898898 unsigned int atype, i;899899- int ret = 0;900899901900 EnterFunction(2);902901903902#ifdef CONFIG_IP_VS_IPV6904903 if (udest->af == AF_INET6) {904904+ int ret;905905+905906 atype = ipv6_addr_type(&udest->addr.in6);906907 if ((!(atype & IPV6_ADDR_UNICAST) ||907908 atype & IPV6_ADDR_LINKLOCAL) &&
+3
net/netfilter/nf_tables_api.c
···328328 int err;329329330330 list_for_each_entry(rule, &ctx->chain->rules, list) {331331+ if (!nft_is_active_next(ctx->net, rule))332332+ continue;333333+331334 err = nft_delrule(ctx, rule);332335 if (err < 0)333336 return err;
···146146 rcu_read_lock();147147 xprt = rcu_dereference(clnt->cl_xprt);148148 /* no "debugfs" dentry? Don't bother with the symlink. */149149- if (!xprt->debugfs) {149149+ if (IS_ERR_OR_NULL(xprt->debugfs)) {150150 rcu_read_unlock();151151 return;152152 }
···129129 return 0;130130131131err_unreg_umem:132132- xdp_clear_umem_at_qid(dev, queue_id);133132 if (!force_zc)134133 err = 0; /* fallback to copy mode */134134+ if (err)135135+ xdp_clear_umem_at_qid(dev, queue_id);135136out_rtnl_unlock:136137 rtnl_unlock();137138 return err;···266265 if (!umem->pgs)267266 return -ENOMEM;268267269269- down_write(¤t->mm->mmap_sem);270270- npgs = get_user_pages(umem->address, umem->npgs,271271- gup_flags, &umem->pgs[0], NULL);272272- up_write(¤t->mm->mmap_sem);268268+ down_read(¤t->mm->mmap_sem);269269+ npgs = get_user_pages_longterm(umem->address, umem->npgs,270270+ gup_flags, &umem->pgs[0], NULL);271271+ up_read(¤t->mm->mmap_sem);273272274273 if (npgs != umem->npgs) {275274 if (npgs >= 0) {
+4
net/xdp/xsk.c
···669669 if (!umem)670670 return -EINVAL;671671672672+ /* Matches the smp_wmb() in XDP_UMEM_REG */673673+ smp_rmb();672674 if (offset == XDP_UMEM_PGOFF_FILL_RING)673675 q = READ_ONCE(umem->fq);674676 else if (offset == XDP_UMEM_PGOFF_COMPLETION_RING)···680678 if (!q)681679 return -EINVAL;682680681681+ /* Matches the smp_wmb() in xsk_init_queue */682682+ smp_rmb();683683 qpg = virt_to_head_page(q->ring);684684 if (size > (PAGE_SIZE << compound_order(qpg)))685685 return -EINVAL;
+10
virt/kvm/arm/arm.c
···626626 /* Awaken to handle a signal, request we sleep again later. */627627 kvm_make_request(KVM_REQ_SLEEP, vcpu);628628 }629629+630630+ /*631631+ * Make sure we will observe a potential reset request if we've632632+ * observed a change to the power state. Pairs with the smp_wmb() in633633+ * kvm_psci_vcpu_on().634634+ */635635+ smp_rmb();629636}630637631638static int kvm_vcpu_initialized(struct kvm_vcpu *vcpu)···645638 if (kvm_request_pending(vcpu)) {646639 if (kvm_check_request(KVM_REQ_SLEEP, vcpu))647640 vcpu_req_sleep(vcpu);641641+642642+ if (kvm_check_request(KVM_REQ_VCPU_RESET, vcpu))643643+ kvm_reset_vcpu(vcpu);648644649645 /*650646 * Clear IRQ_PENDING requests that were made to guarantee
+6-3
virt/kvm/arm/mmu.c
···1695169516961696 vma_pagesize = vma_kernel_pagesize(vma);16971697 /*16981698- * PUD level may not exist for a VM but PMD is guaranteed to16991699- * exist.16981698+ * The stage2 has a minimum of 2 level table (For arm64 see16991699+ * kvm_arm_setup_stage2()). Hence, we are guaranteed that we can17001700+ * use PMD_SIZE huge mappings (even when the PMD is folded into PGD).17011701+ * As for PUD huge maps, we must make sure that we have at least17021702+ * 3 levels, i.e, PMD is not folded.17001703 */17011704 if ((vma_pagesize == PMD_SIZE ||17021702- (vma_pagesize == PUD_SIZE && kvm_stage2_has_pud(kvm))) &&17051705+ (vma_pagesize == PUD_SIZE && kvm_stage2_has_pmd(kvm))) &&17031706 !force_pte) {17041707 gfn = (fault_ipa & huge_page_mask(hstate_vma(vma))) >> PAGE_SHIFT;17051708 }
+16-20
virt/kvm/arm/psci.c
···104104105105static unsigned long kvm_psci_vcpu_on(struct kvm_vcpu *source_vcpu)106106{107107+ struct vcpu_reset_state *reset_state;107108 struct kvm *kvm = source_vcpu->kvm;108109 struct kvm_vcpu *vcpu = NULL;109109- struct swait_queue_head *wq;110110 unsigned long cpu_id;111111- unsigned long context_id;112112- phys_addr_t target_pc;113111114112 cpu_id = smccc_get_arg1(source_vcpu) & MPIDR_HWID_BITMASK;115113 if (vcpu_mode_is_32bit(source_vcpu))···128130 return PSCI_RET_INVALID_PARAMS;129131 }130132131131- target_pc = smccc_get_arg2(source_vcpu);132132- context_id = smccc_get_arg3(source_vcpu);133133+ reset_state = &vcpu->arch.reset_state;133134134134- kvm_reset_vcpu(vcpu);135135-136136- /* Gracefully handle Thumb2 entry point */137137- if (vcpu_mode_is_32bit(vcpu) && (target_pc & 1)) {138138- target_pc &= ~((phys_addr_t) 1);139139- vcpu_set_thumb(vcpu);140140- }135135+ reset_state->pc = smccc_get_arg2(source_vcpu);141136142137 /* Propagate caller endianness */143143- if (kvm_vcpu_is_be(source_vcpu))144144- kvm_vcpu_set_be(vcpu);138138+ reset_state->be = kvm_vcpu_is_be(source_vcpu);145139146146- *vcpu_pc(vcpu) = target_pc;147140 /*148141 * NOTE: We always update r0 (or x0) because for PSCI v0.1149142 * the general puspose registers are undefined upon CPU_ON.150143 */151151- smccc_set_retval(vcpu, context_id, 0, 0, 0);152152- vcpu->arch.power_off = false;153153- smp_mb(); /* Make sure the above is visible */144144+ reset_state->r0 = smccc_get_arg3(source_vcpu);154145155155- wq = kvm_arch_vcpu_wq(vcpu);156156- swake_up_one(wq);146146+ WRITE_ONCE(reset_state->reset, true);147147+ kvm_make_request(KVM_REQ_VCPU_RESET, vcpu);148148+149149+ /*150150+ * Make sure the reset request is observed if the change to151151+ * power_state is observed.152152+ */153153+ smp_wmb();154154+155155+ vcpu->arch.power_off = false;156156+ kvm_vcpu_wake_up(vcpu);157157158158 return PSCI_RET_SUCCESS;159159}
···6464 struct vgic_dist *dist = &kvm->arch.vgic;65656666 INIT_LIST_HEAD(&dist->lpi_list_head);6767- spin_lock_init(&dist->lpi_list_lock);6767+ raw_spin_lock_init(&dist->lpi_list_lock);6868}69697070/* CREATION */···171171172172 irq->intid = i + VGIC_NR_PRIVATE_IRQS;173173 INIT_LIST_HEAD(&irq->ap_list);174174- spin_lock_init(&irq->irq_lock);174174+ raw_spin_lock_init(&irq->irq_lock);175175 irq->vcpu = NULL;176176 irq->target_vcpu = vcpu0;177177 kref_init(&irq->refcount);···206206 vgic_cpu->sgi_iodev.base_addr = VGIC_ADDR_UNDEF;207207208208 INIT_LIST_HEAD(&vgic_cpu->ap_list_head);209209- spin_lock_init(&vgic_cpu->ap_list_lock);209209+ raw_spin_lock_init(&vgic_cpu->ap_list_lock);210210211211 /*212212 * Enable and configure all SGIs to be edge-triggered and···216216 struct vgic_irq *irq = &vgic_cpu->private_irqs[i];217217218218 INIT_LIST_HEAD(&irq->ap_list);219219- spin_lock_init(&irq->irq_lock);219219+ raw_spin_lock_init(&irq->irq_lock);220220 irq->intid = i;221221 irq->vcpu = NULL;222222 irq->target_vcpu = vcpu;···231231 irq->config = VGIC_CONFIG_LEVEL;232232 }233233234234- /*235235- * GICv3 can only be created via the KVM_DEVICE_CREATE API and236236- * so we always know the emulation type at this point as it's237237- * either explicitly configured as GICv3, or explicitly238238- * configured as GICv2, or not configured yet which also239239- * implies GICv2.240240- */241234 if (dist->vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3)242235 irq->group = 1;243236 else···274281{275282 struct vgic_dist *dist = &kvm->arch.vgic;276283 struct kvm_vcpu *vcpu;277277- int ret = 0, i;284284+ int ret = 0, i, idx;278285279286 if (vgic_initialized(kvm))280287 return 0;···290297 ret = kvm_vgic_dist_init(kvm, dist->nr_spis);291298 if (ret)292299 goto out;300300+301301+ /* Initialize groups on CPUs created before the VGIC type was known */302302+ kvm_for_each_vcpu(idx, vcpu, kvm) {303303+ struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu;304304+305305+ for (i = 0; i < VGIC_NR_PRIVATE_IRQS; i++) {306306+ struct vgic_irq *irq = &vgic_cpu->private_irqs[i];307307+ if (dist->vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3)308308+ irq->group = 1;309309+ else310310+ irq->group = 0;311311+ }312312+ }293313294314 if (vgic_has_its(kvm)) {295315 ret = vgic_v4_init(kvm);
+11-11
virt/kvm/arm/vgic/vgic-its.c
···65656666 INIT_LIST_HEAD(&irq->lpi_list);6767 INIT_LIST_HEAD(&irq->ap_list);6868- spin_lock_init(&irq->irq_lock);6868+ raw_spin_lock_init(&irq->irq_lock);69697070 irq->config = VGIC_CONFIG_EDGE;7171 kref_init(&irq->refcount);···7373 irq->target_vcpu = vcpu;7474 irq->group = 1;75757676- spin_lock_irqsave(&dist->lpi_list_lock, flags);7676+ raw_spin_lock_irqsave(&dist->lpi_list_lock, flags);77777878 /*7979 * There could be a race with another vgic_add_lpi(), so we need to···101101 dist->lpi_list_count++;102102103103out_unlock:104104- spin_unlock_irqrestore(&dist->lpi_list_lock, flags);104104+ raw_spin_unlock_irqrestore(&dist->lpi_list_lock, flags);105105106106 /*107107 * We "cache" the configuration table entries in our struct vgic_irq's.···287287 if (ret)288288 return ret;289289290290- spin_lock_irqsave(&irq->irq_lock, flags);290290+ raw_spin_lock_irqsave(&irq->irq_lock, flags);291291292292 if (!filter_vcpu || filter_vcpu == irq->target_vcpu) {293293 irq->priority = LPI_PROP_PRIORITY(prop);···299299 }300300 }301301302302- spin_unlock_irqrestore(&irq->irq_lock, flags);302302+ raw_spin_unlock_irqrestore(&irq->irq_lock, flags);303303304304 if (irq->hw)305305 return its_prop_update_vlpi(irq->host_irq, prop, needs_inv);···332332 if (!intids)333333 return -ENOMEM;334334335335- spin_lock_irqsave(&dist->lpi_list_lock, flags);335335+ raw_spin_lock_irqsave(&dist->lpi_list_lock, flags);336336 list_for_each_entry(irq, &dist->lpi_list_head, lpi_list) {337337 if (i == irq_count)338338 break;···341341 continue;342342 intids[i++] = irq->intid;343343 }344344- spin_unlock_irqrestore(&dist->lpi_list_lock, flags);344344+ raw_spin_unlock_irqrestore(&dist->lpi_list_lock, flags);345345346346 *intid_ptr = intids;347347 return i;···352352 int ret = 0;353353 unsigned long flags;354354355355- spin_lock_irqsave(&irq->irq_lock, flags);355355+ raw_spin_lock_irqsave(&irq->irq_lock, flags);356356 irq->target_vcpu = vcpu;357357- spin_unlock_irqrestore(&irq->irq_lock, flags);357357+ raw_spin_unlock_irqrestore(&irq->irq_lock, flags);358358359359 if (irq->hw) {360360 struct its_vlpi_map map;···455455 }456456457457 irq = vgic_get_irq(vcpu->kvm, NULL, intids[i]);458458- spin_lock_irqsave(&irq->irq_lock, flags);458458+ raw_spin_lock_irqsave(&irq->irq_lock, flags);459459 irq->pending_latch = pendmask & (1U << bit_nr);460460 vgic_queue_irq_unlock(vcpu->kvm, irq, flags);461461 vgic_put_irq(vcpu->kvm, irq);···612612 return irq_set_irqchip_state(irq->host_irq,613613 IRQCHIP_STATE_PENDING, true);614614615615- spin_lock_irqsave(&irq->irq_lock, flags);615615+ raw_spin_lock_irqsave(&irq->irq_lock, flags);616616 irq->pending_latch = true;617617 vgic_queue_irq_unlock(kvm, irq, flags);618618