···9898E: andersen@codepoet.org9999W: https://www.codepoet.org/100100P: 1024D/30D39057 1BC4 2742 E885 E4DE 9301 0C82 5F9B 643E 30D3 9057101101-D: Maintainer of ide-cd and Uniform CD-ROM driver, 101101+D: Maintainer of ide-cd and Uniform CD-ROM driver,102102D: ATAPI CD-Changer support, Major 2.1.x CD-ROM update.103103S: 352 North 525 East104104S: Springville, Utah 84663···263263E: pbd@op.net264264D: Driver for WaveFront soundcards (Turtle Beach Maui, Tropez, Tropez+)265265D: Various bugfixes and changes to sound drivers266266-S: USA 266266+S: USA267267268268N: Carlos Henrique Bauer269269E: chbauer@acm.org···849849D: AX25-HOWTO, HAM-HOWTO, IPX-HOWTO, NET-2-HOWTO850850D: ax25-utils maintainer.851851852852+N: Kamil Debski853853+E: kamil@wypas.org854854+D: Samsung S5P 2D graphics acceleration and Multi Format Codec drivers855855+D: Samsung USB2 phy drivers856856+D: PWM fan driver857857+852858N: Helge Deller853859E: deller@gmx.de854860W: http://www.parisc-linux.org/···12051199E: dfrasnel@alphalinux.org12061200W: http://www.alphalinux.org/12071201P: 1024/3EF87611 B9 F1 44 50 D3 E8 C2 80 DA E5 55 AA 56 7C 42 DA12081208-D: DEC Alpha hacker 12021202+D: DEC Alpha hacker12091203D: Miscellaneous bug squisher1210120412111205N: Jim Freeman···13051299S: New South Wales, 212113061300S: Australia1307130113081308-N: Carlos E. Gorges 13021302+N: Carlos E. Gorges13091303E: carlos@techlinux.com.br13101304D: fix smp support on cmpci driver13111305P: 2048G/EA3C4B19 FF31 33A6 0362 4915 B7EB E541 17D0 0379 EA3C 4B19···13461340E: wgreathouse@myfavoritei.com13471341D: Current Belkin USB Serial Adapter F5U103 hacker13481342D: Kernel hacker, embedded systems13491349-S: 7802 Fitzwater Road 13431343+S: 7802 Fitzwater Road13501344S: Brecksville, OH 44141-133413511345S: USA13521346···13871381E: grant@torque.net13881382W: http://www.torque.net/linux-pp.html13891383D: original author of ppa driver for parallel port ZIP drive13901390-D: original architect of the parallel-port sharing scheme 13841384+D: original architect of the parallel-port sharing scheme13911385D: PARIDE subsystem: drivers for parallel port IDE & ATAPI devices13921386S: 44 St. Joseph Street, Suite 50613931387S: Toronto, Ontario, M4Y 2W4···15291523E: benh@kernel.crashing.org15301524D: Various parts of PPC/PPC64 & PowerMac15311525S: 312/107 Canberra Avenue15321532-S: Griffith, ACT 2603 15261526+S: Griffith, ACT 260315331527S: Australia1534152815351529N: Andreas Herrmann···18311825N: Bernhard Kaindl18321826E: bkaindl@netway.at18331827E: edv@bartelt.via.at18341834-D: Author of a menu based configuration tool, kmenu, which 18281828+D: Author of a menu based configuration tool, kmenu, which18351829D: is the predecessor of 'make menuconfig' and 'make xconfig'.18361830D: digiboard driver update(modularisation work and 2.1.x upd)18371831S: Tallak 95···20222016D: IP transparent proxy support20232017S: X/OS Experts in Open Systems BV20242018S: Kruislaan 41920252025-S: 1098 VA Amsterdam 20192019+S: 1098 VA Amsterdam20262020S: The Netherlands2027202120282022N: Goran Koruga···2094208820952089N: Andrzej M. Krzysztofowicz20962090E: ankry@mif.pg.gda.pl20972097-D: Some 8-bit XT disk driver and devfs hacking 20912091+D: Some 8-bit XT disk driver and devfs hacking20982092D: Aladdin 1533/1543(C) chipset IDE20992093D: PIIX chipset IDE21002094S: ul. Matemblewska 1B/10···24692463D: Logical Volume Manager24702464S: Bartningstr. 1224712465S: 64289 Darmstadt24722472-S: Germany 24662466+S: Germany2473246724742468N: Mark W. McClelland24752469E: mmcclell@bigfoot.com···25442538P: 1024/04B6E8F5 6C 77 33 CA CC D6 22 03 AB AB 15 A3 AE AD 39 7D25452539D: Kernel hacker. PostgreSQL hacker. Software watchdog daemon.25462540D: Maintainer of several Debian packages25472547-S: Th.-Heuss-Str. 61 25412541+S: Th.-Heuss-Str. 6125482542S: D-41812 Erkelenz25492543S: Germany25502544···27822776W: http://www.i-Connect.Net/~mike/27832777D: Developer and maintainer of the EATA-DMA SCSI driver27842778D: Co-developer EATA-PIO SCSI driver27852785-D: /proc/scsi and assorted other snippets 27792779+D: /proc/scsi and assorted other snippets27862780S: Zum Schiersteiner Grund 227872781S: 55127 Mainz27882782S: Germany···2848284228492843N: Venkatesh Pallipadi (Venki)28502844D: x86/HPET28452845+28462846+N: Kyungmin Park28472847+E: kyungmin.park@samsung.com28482848+D: Samsung S5Pv210 and Exynos4210 mobile platforms2851284928522850N: David Parsons28532851E: orc@pell.chi.il.us···30203010S: Chandler, Arizona 8524930213011S: USA3022301230233023-N: Frederic Potter 30133013+N: Frederic Potter30243014E: fpotter@cirpack.com30253015D: Some PCI kernel support30263016···34533443S: 76131 Karlsruhe34543444S: Germany3455344534563456-N: James Simmons 34463446+N: James Simmons34573447E: jsimmons@infradead.org34583458-E: jsimmons@users.sf.net 34483448+E: jsimmons@users.sf.net34593449D: Frame buffer device maintainer34603450D: input layer development34613451D: tty/console layer34623462-D: various mipsel devices 34633463-S: 115 Carmel Avenue 34523452+D: various mipsel devices34533453+S: 115 Carmel Avenue34643454S: El Cerrito CA 9453034653465-S: USA 34553455+S: USA3466345634673457N: Jaspreet Singh34683458E: jaspreet@sangoma.com34693459W: www.sangoma.com34703470-D: WANPIPE drivers & API Support for Sangoma S508/FT1 cards 34603460+D: WANPIPE drivers & API Support for Sangoma S508/FT1 cards34713461S: Sangoma Technologies Inc.,34723462S: 1001 Denison Street34733463S: Suite 101···34913481E: csmall@triode.apana.org.au34923482E: vk2xlz@gonzo.vk2xlz.ampr.org (packet radio)34933483D: Gracilis PackeTwin device driver34943494-D: RSPF daemon 34843484+D: RSPF daemon34953485S: 10 Stockalls Place34963486S: Minto, NSW, 256634973487S: Australia···37013691E: tsusheng@scf.usc.edu37023692D: IGMP(Internet Group Management Protocol) version 237033693S: 2F 14 ALY 31 LN 166 SEC 1 SHIH-PEI RD37043704-S: Taipei 36943694+S: Taipei37053695S: Taiwan 11237063696S: Republic of China37073697S: 24335 Delta Drive···38623852D: patches for ghostscript, worked on color 'ls', etc.38633853S: 301 15th Street S.38643854S: Moorhead, Minnesota 5656038653865-S: USA 38553855+S: USA3866385638673857N: Jos Vos38683858E: jos@xos.nl···38703860D: Various IP firewall updates, ipfwadm38713861S: X/OS Experts in Open Systems BV38723862S: Kruislaan 41938733873-S: 1098 VA Amsterdam 38633863+S: 1098 VA Amsterdam38743864S: The Netherlands3875386538763866N: Jeroen Vreeken···41084098N: Victor Yodaiken41094099E: yodaiken@fsmlabs.com41104100D: RTLinux (RealTime Linux)41114111-S: POB 1822 41014101+S: POB 182241124102S: Socorro NM, 8780141134103S: USA41144104···42064196S: France4207419742084198# Don't add your name here, unless you really _are_ after Marc42094209-# alphabetically. Leonard used to be very proud of being the 41994199+# alphabetically. Leonard used to be very proud of being the42104200# last entry, and he'll get positively pissed if he can't even42114201# be second-to-last. (and this file really _is_ supposed to be42124202# in alphabetic order)
+7
Documentation/admin-guide/kernel-parameters.txt
···28582858 mds=off [X86]28592859 tsx_async_abort=off [X86]28602860 kvm.nx_huge_pages=off [X86]28612861+ no_entry_flush [PPC]28622862+ no_uaccess_flush [PPC]2861286328622864 Exceptions:28632865 This does not have any effect on···3188318631893187 noefi Disable EFI runtime services support.3190318831893189+ no_entry_flush [PPC] Don't flush the L1-D cache when entering the kernel.31903190+31913191 noexec [IA-64]3192319231933193 noexec [X86]···3238323432393235 nospec_store_bypass_disable32403236 [HW] Disable all mitigations for the Speculative Store Bypass vulnerability32373237+32383238+ no_uaccess_flush32393239+ [PPC] Don't flush the L1-D cache after accessing user data.3241324032423241 noxsave [BUGS=X86] Disables x86 extended register state save32433242 and restore using xsave. The kernel will fallback to
+1-1
Documentation/dev-tools/kunit/faq.rst
···9090 re-run kunit_tool.91915. Try to run ``make ARCH=um defconfig`` before running ``kunit.py run``. This9292 may help clean up any residual config items which could be causing problems.9393-6. Finally, try running KUnit outside UML. KUnit and KUnit tests can run be9393+6. Finally, try running KUnit outside UML. KUnit and KUnit tests can be9494 built into any kernel, or can be built as a module and loaded at runtime.9595 Doing so should allow you to determine if UML is causing the issue you're9696 seeing. When tests are built-in, they will execute when the kernel boots, and
+9-9
Documentation/dev-tools/kunit/style.rst
···175175176176.. code-block:: none177177178178- config FOO_KUNIT_TEST179179- tristate "KUnit test for foo" if !KUNIT_ALL_TESTS180180- depends on KUNIT181181- default KUNIT_ALL_TESTS182182- help183183- This builds unit tests for foo.178178+ config FOO_KUNIT_TEST179179+ tristate "KUnit test for foo" if !KUNIT_ALL_TESTS180180+ depends on KUNIT181181+ default KUNIT_ALL_TESTS182182+ help183183+ This builds unit tests for foo.184184185185- For more information on KUnit and unit tests in general, please refer186186- to the KUnit documentation in Documentation/dev-tools/kunit185185+ For more information on KUnit and unit tests in general, please refer186186+ to the KUnit documentation in Documentation/dev-tools/kunit/.187187188188- If unsure, say N188188+ If unsure, say N.189189190190191191Test File and Module Names
+5-5
Documentation/dev-tools/kunit/usage.rst
···9292the second parameter, in this case, is what the value is expected to be; the9393last value is what the value actually is. If ``add`` passes all of these9494expectations, the test case, ``add_test_basic`` will pass; if any one of these9595-expectations fail, the test case will fail.9595+expectations fails, the test case will fail.96969797It is important to understand that a test case *fails* when any expectation is9898violated; however, the test will continue running, potentially trying other···202202 kunit_test_suite(example_test_suite);203203204204In the above example the test suite, ``example_test_suite``, would run the test205205-cases ``example_test_foo``, ``example_test_bar``, and ``example_test_baz``,205205+cases ``example_test_foo``, ``example_test_bar``, and ``example_test_baz``;206206each would have ``example_test_init`` called immediately before it and would207207have ``example_test_exit`` called immediately after it.208208``kunit_test_suite(example_test_suite)`` registers the test suite with the···229229such that the definition of that function can be changed without affecting the230230rest of the code base. In the kernel this primarily comes from two constructs,231231classes, structs that contain function pointers that are provided by the232232-implementer, and architecture specific functions which have definitions selected232232+implementer, and architecture-specific functions which have definitions selected233233at compile time.234234235235Classes···459459By default KUnit uses UML as a way to provide dependencies for code under test.460460Under most circumstances KUnit's usage of UML should be treated as an461461implementation detail of how KUnit works under the hood. Nevertheless, there462462-are instances where being able to run architecture specific code or test462462+are instances where being able to run architecture-specific code or test463463against real hardware is desirable. For these reasons KUnit supports running on464464other architectures.465465···599599hardware state in between test cases; if this is not possible, you may only be600600able to run one test case per invocation.601601602602-.. TODO(brendanhiggins@google.com): Add an actual example of an architecture602602+.. TODO(brendanhiggins@google.com): Add an actual example of an architecture-603603 dependent KUnit test.604604605605KUnit debugfs representation
···2020 - fsl,imx8qm-flexcan2121 - fsl,imx8mp-flexcan2222 - fsl,imx6q-flexcan2323- - fsl,imx53-flexcan2424- - fsl,imx35-flexcan2523 - fsl,imx28-flexcan2624 - fsl,imx25-flexcan2725 - fsl,p1010-flexcan2826 - fsl,vf610-flexcan2927 - fsl,ls1021ar2-flexcan3028 - fsl,lx2160ar1-flexcan2929+ - items:3030+ - enum:3131+ - fsl,imx53-flexcan3232+ - fsl,imx35-flexcan3333+ - const: fsl,imx25-flexcan3134 - items:3235 - enum:3336 - fsl,imx7d-flexcan···8481 req_bit is the bit offset of CAN stop request.8582 $ref: /schemas/types.yaml#/definitions/phandle-array8683 items:8787- - description: The 'gpr' is the phandle to general purpose register node.8888- - description: The 'req_gpr' is the gpr register offset of CAN stop request.8989- maximum: 0xff9090- - description: The 'req_bit' is the bit offset of CAN stop request.9191- maximum: 0x1f8484+ items:8585+ - description: The 'gpr' is the phandle to general purpose register node.8686+ - description: The 'req_gpr' is the gpr register offset of CAN stop request.8787+ maximum: 0xff8888+ - description: The 'req_bit' is the bit offset of CAN stop request.8989+ maximum: 0x1f92909391 fsl,clk-source:9492 description: |
···5353 };5454};55555656-&emac {5757- /* LEDs changed to active high on the plus */5858- /delete-property/ allwinner,leds-active-low;5959-};6060-6156&mmc1 {6257 vmmc-supply = <®_vcc3v3>;6358 bus-width = <4>;
···8585 "optprobe_template_end:\n");86868787#define TMPL_VAL_IDX \8888- ((unsigned long *)&optprobe_template_val - (unsigned long *)&optprobe_template_entry)8888+ ((unsigned long *)optprobe_template_val - (unsigned long *)optprobe_template_entry)8989#define TMPL_CALL_IDX \9090- ((unsigned long *)&optprobe_template_call - (unsigned long *)&optprobe_template_entry)9090+ ((unsigned long *)optprobe_template_call - (unsigned long *)optprobe_template_entry)9191#define TMPL_END_IDX \9292- ((unsigned long *)&optprobe_template_end - (unsigned long *)&optprobe_template_entry)9292+ ((unsigned long *)optprobe_template_end - (unsigned long *)optprobe_template_entry)9393#define TMPL_ADD_SP \9494- ((unsigned long *)&optprobe_template_add_sp - (unsigned long *)&optprobe_template_entry)9494+ ((unsigned long *)optprobe_template_add_sp - (unsigned long *)optprobe_template_entry)9595#define TMPL_SUB_SP \9696- ((unsigned long *)&optprobe_template_sub_sp - (unsigned long *)&optprobe_template_entry)9696+ ((unsigned long *)optprobe_template_sub_sp - (unsigned long *)optprobe_template_entry)9797#define TMPL_RESTORE_BEGIN \9898- ((unsigned long *)&optprobe_template_restore_begin - (unsigned long *)&optprobe_template_entry)9898+ ((unsigned long *)optprobe_template_restore_begin - (unsigned long *)optprobe_template_entry)9999#define TMPL_RESTORE_ORIGN_INSN \100100- ((unsigned long *)&optprobe_template_restore_orig_insn - (unsigned long *)&optprobe_template_entry)100100+ ((unsigned long *)optprobe_template_restore_orig_insn - (unsigned long *)optprobe_template_entry)101101#define TMPL_RESTORE_END \102102- ((unsigned long *)&optprobe_template_restore_end - (unsigned long *)&optprobe_template_entry)102102+ ((unsigned long *)optprobe_template_restore_end - (unsigned long *)optprobe_template_entry)103103104104/*105105 * ARM can always optimize an instruction when using ARM ISA, except···234234 }235235236236 /* Copy arch-dep-instance from template. */237237- memcpy(code, (unsigned long *)&optprobe_template_entry,237237+ memcpy(code, (unsigned long *)optprobe_template_entry,238238 TMPL_END_IDX * sizeof(kprobe_opcode_t));239239240240 /* Adjust buffer according to instruction. */
···268268/*269269 * CPU feature detected at boot time based on feature of one or more CPUs.270270 * All possible conflicts for a late CPU are ignored.271271+ * NOTE: this means that a late CPU with the feature will *not* cause the272272+ * capability to be advertised by cpus_have_*cap()!271273 */272274#define ARM64_CPUCAP_WEAK_LOCAL_CPU_FEATURE \273275 (ARM64_CPUCAP_SCOPE_LOCAL_CPU | \
···66666767static void cpu_psci_cpu_die(unsigned int cpu)6868{6969- int ret;7069 /*7170 * There are no known implementations of PSCI actually using the7271 * power state field, pass a sensible default for now.···7374 u32 state = PSCI_POWER_STATE_TYPE_POWER_DOWN <<7475 PSCI_0_2_POWER_STATE_TYPE_SHIFT;75767676- ret = psci_ops.cpu_off(state);7777-7878- pr_crit("unable to power off CPU%u (%d)\n", cpu, ret);7777+ psci_ops.cpu_off(state);7978}80798180static int cpu_psci_cpu_kill(unsigned int cpu)
+1
arch/arm64/kernel/smp.c
···413413414414 /* Mark this CPU absent */415415 set_cpu_present(cpu, 0);416416+ rcu_report_dead(cpu);416417417418 if (IS_ENABLED(CONFIG_HOTPLUG_CPU)) {418419 update_cpu_boot_status(CPU_KILL_ME);
+16
arch/arm64/kvm/arm.c
···102102 return vgic_present ? kvm_vgic_get_max_vcpus() : KVM_MAX_VCPUS;103103}104104105105+static void set_default_csv2(struct kvm *kvm)106106+{107107+ /*108108+ * The default is to expose CSV2 == 1 if the HW isn't affected.109109+ * Although this is a per-CPU feature, we make it global because110110+ * asymmetric systems are just a nuisance.111111+ *112112+ * Userspace can override this as long as it doesn't promise113113+ * the impossible.114114+ */115115+ if (arm64_get_spectre_v2_state() == SPECTRE_UNAFFECTED)116116+ kvm->arch.pfr0_csv2 = 1;117117+}118118+105119/**106120 * kvm_arch_init_vm - initializes a VM data structure107121 * @kvm: pointer to the KVM struct···140126141127 /* The maximum number of VCPUs is limited by the host's GIC model */142128 kvm->arch.max_vcpus = kvm_arm_default_max_vcpus();129129+130130+ set_default_csv2(kvm);143131144132 return ret;145133out_free_stage2_pgd:
+67-44
arch/arm64/kvm/sys_regs.c
···10381038 { SYS_DESC(SYS_PMEVTYPERn_EL0(n)), \10391039 access_pmu_evtyper, reset_unknown, (PMEVTYPER0_EL0 + n), }1040104010411041-static bool access_amu(struct kvm_vcpu *vcpu, struct sys_reg_params *p,10421042- const struct sys_reg_desc *r)10411041+static bool undef_access(struct kvm_vcpu *vcpu, struct sys_reg_params *p,10421042+ const struct sys_reg_desc *r)10431043{10441044 kvm_inject_undefined(vcpu);10451045···10471047}1048104810491049/* Macro to expand the AMU counter and type registers*/10501050-#define AMU_AMEVCNTR0_EL0(n) { SYS_DESC(SYS_AMEVCNTR0_EL0(n)), access_amu }10511051-#define AMU_AMEVTYPER0_EL0(n) { SYS_DESC(SYS_AMEVTYPER0_EL0(n)), access_amu }10521052-#define AMU_AMEVCNTR1_EL0(n) { SYS_DESC(SYS_AMEVCNTR1_EL0(n)), access_amu }10531053-#define AMU_AMEVTYPER1_EL0(n) { SYS_DESC(SYS_AMEVTYPER1_EL0(n)), access_amu }10541054-10551055-static bool trap_ptrauth(struct kvm_vcpu *vcpu,10561056- struct sys_reg_params *p,10571057- const struct sys_reg_desc *rd)10581058-{10591059- /*10601060- * If we land here, that is because we didn't fixup the access on exit10611061- * by allowing the PtrAuth sysregs. The only way this happens is when10621062- * the guest does not have PtrAuth support enabled.10631063- */10641064- kvm_inject_undefined(vcpu);10651065-10661066- return false;10671067-}10501050+#define AMU_AMEVCNTR0_EL0(n) { SYS_DESC(SYS_AMEVCNTR0_EL0(n)), undef_access }10511051+#define AMU_AMEVTYPER0_EL0(n) { SYS_DESC(SYS_AMEVTYPER0_EL0(n)), undef_access }10521052+#define AMU_AMEVCNTR1_EL0(n) { SYS_DESC(SYS_AMEVCNTR1_EL0(n)), undef_access }10531053+#define AMU_AMEVTYPER1_EL0(n) { SYS_DESC(SYS_AMEVTYPER1_EL0(n)), undef_access }1068105410691055static unsigned int ptrauth_visibility(const struct kvm_vcpu *vcpu,10701056 const struct sys_reg_desc *rd)···10581072 return vcpu_has_ptrauth(vcpu) ? 0 : REG_HIDDEN;10591073}1060107410751075+/*10761076+ * If we land here on a PtrAuth access, that is because we didn't10771077+ * fixup the access on exit by allowing the PtrAuth sysregs. The only10781078+ * way this happens is when the guest does not have PtrAuth support10791079+ * enabled.10801080+ */10611081#define __PTRAUTH_KEY(k) \10621062- { SYS_DESC(SYS_## k), trap_ptrauth, reset_unknown, k, \10821082+ { SYS_DESC(SYS_## k), undef_access, reset_unknown, k, \10631083 .visibility = ptrauth_visibility}1064108410651085#define PTRAUTH_KEY(k) \···11201128 if (!vcpu_has_sve(vcpu))11211129 val &= ~(0xfUL << ID_AA64PFR0_SVE_SHIFT);11221130 val &= ~(0xfUL << ID_AA64PFR0_AMU_SHIFT);11231123- if (!(val & (0xfUL << ID_AA64PFR0_CSV2_SHIFT)) &&11241124- arm64_get_spectre_v2_state() == SPECTRE_UNAFFECTED)11251125- val |= (1UL << ID_AA64PFR0_CSV2_SHIFT);11311131+ val &= ~(0xfUL << ID_AA64PFR0_CSV2_SHIFT);11321132+ val |= ((u64)vcpu->kvm->arch.pfr0_csv2 << ID_AA64PFR0_CSV2_SHIFT);11261133 } else if (id == SYS_ID_AA64PFR1_EL1) {11271134 val &= ~(0xfUL << ID_AA64PFR1_MTE_SHIFT);11281135 } else if (id == SYS_ID_AA64ISAR1_EL1 && !vcpu_has_ptrauth(vcpu)) {···12021211 return 0;1203121212041213 return REG_HIDDEN;12141214+}12151215+12161216+static int set_id_aa64pfr0_el1(struct kvm_vcpu *vcpu,12171217+ const struct sys_reg_desc *rd,12181218+ const struct kvm_one_reg *reg, void __user *uaddr)12191219+{12201220+ const u64 id = sys_reg_to_index(rd);12211221+ int err;12221222+ u64 val;12231223+ u8 csv2;12241224+12251225+ err = reg_from_user(&val, uaddr, id);12261226+ if (err)12271227+ return err;12281228+12291229+ /*12301230+ * Allow AA64PFR0_EL1.CSV2 to be set from userspace as long as12311231+ * it doesn't promise more than what is actually provided (the12321232+ * guest could otherwise be covered in ectoplasmic residue).12331233+ */12341234+ csv2 = cpuid_feature_extract_unsigned_field(val, ID_AA64PFR0_CSV2_SHIFT);12351235+ if (csv2 > 1 ||12361236+ (csv2 && arm64_get_spectre_v2_state() != SPECTRE_UNAFFECTED))12371237+ return -EINVAL;12381238+12391239+ /* We can only differ with CSV2, and anything else is an error */12401240+ val ^= read_id_reg(vcpu, rd, false);12411241+ val &= ~(0xFUL << ID_AA64PFR0_CSV2_SHIFT);12421242+ if (val)12431243+ return -EINVAL;12441244+12451245+ vcpu->kvm->arch.pfr0_csv2 = csv2;12461246+12471247+ return 0;12051248}1206124912071250/*···13661341 return true;13671342}1368134313691369-static bool access_mte_regs(struct kvm_vcpu *vcpu, struct sys_reg_params *p,13701370- const struct sys_reg_desc *r)13711371-{13721372- kvm_inject_undefined(vcpu);13731373- return false;13741374-}13751375-13761344/* sys_reg_desc initialiser for known cpufeature ID registers */13771345#define ID_SANITISED(name) { \13781346 SYS_DESC(SYS_##name), \···1490147214911473 /* AArch64 ID registers */14921474 /* CRm=4 */14931493- ID_SANITISED(ID_AA64PFR0_EL1),14751475+ { SYS_DESC(SYS_ID_AA64PFR0_EL1), .access = access_id_reg,14761476+ .get_user = get_id_reg, .set_user = set_id_aa64pfr0_el1, },14941477 ID_SANITISED(ID_AA64PFR1_EL1),14951478 ID_UNALLOCATED(4,2),14961479 ID_UNALLOCATED(4,3),···15341515 { SYS_DESC(SYS_ACTLR_EL1), access_actlr, reset_actlr, ACTLR_EL1 },15351516 { SYS_DESC(SYS_CPACR_EL1), NULL, reset_val, CPACR_EL1, 0 },1536151715371537- { SYS_DESC(SYS_RGSR_EL1), access_mte_regs },15381538- { SYS_DESC(SYS_GCR_EL1), access_mte_regs },15181518+ { SYS_DESC(SYS_RGSR_EL1), undef_access },15191519+ { SYS_DESC(SYS_GCR_EL1), undef_access },1539152015401521 { SYS_DESC(SYS_ZCR_EL1), NULL, reset_val, ZCR_EL1, 0, .visibility = sve_visibility },15411522 { SYS_DESC(SYS_TTBR0_EL1), access_vm_reg, reset_unknown, TTBR0_EL1 },···15611542 { SYS_DESC(SYS_ERXMISC0_EL1), trap_raz_wi },15621543 { SYS_DESC(SYS_ERXMISC1_EL1), trap_raz_wi },1563154415641564- { SYS_DESC(SYS_TFSR_EL1), access_mte_regs },15651565- { SYS_DESC(SYS_TFSRE0_EL1), access_mte_regs },15451545+ { SYS_DESC(SYS_TFSR_EL1), undef_access },15461546+ { SYS_DESC(SYS_TFSRE0_EL1), undef_access },1566154715671548 { SYS_DESC(SYS_FAR_EL1), access_vm_reg, reset_unknown, FAR_EL1 },15681549 { SYS_DESC(SYS_PAR_EL1), NULL, reset_unknown, PAR_EL1 },···15981579 { SYS_DESC(SYS_CONTEXTIDR_EL1), access_vm_reg, reset_val, CONTEXTIDR_EL1, 0 },15991580 { SYS_DESC(SYS_TPIDR_EL1), NULL, reset_unknown, TPIDR_EL1 },1600158115821582+ { SYS_DESC(SYS_SCXTNUM_EL1), undef_access },15831583+16011584 { SYS_DESC(SYS_CNTKCTL_EL1), NULL, reset_val, CNTKCTL_EL1, 0},1602158516031586 { SYS_DESC(SYS_CCSIDR_EL1), access_ccsidr },···16281607 { SYS_DESC(SYS_TPIDR_EL0), NULL, reset_unknown, TPIDR_EL0 },16291608 { SYS_DESC(SYS_TPIDRRO_EL0), NULL, reset_unknown, TPIDRRO_EL0 },1630160916311631- { SYS_DESC(SYS_AMCR_EL0), access_amu },16321632- { SYS_DESC(SYS_AMCFGR_EL0), access_amu },16331633- { SYS_DESC(SYS_AMCGCR_EL0), access_amu },16341634- { SYS_DESC(SYS_AMUSERENR_EL0), access_amu },16351635- { SYS_DESC(SYS_AMCNTENCLR0_EL0), access_amu },16361636- { SYS_DESC(SYS_AMCNTENSET0_EL0), access_amu },16371637- { SYS_DESC(SYS_AMCNTENCLR1_EL0), access_amu },16381638- { SYS_DESC(SYS_AMCNTENSET1_EL0), access_amu },16101610+ { SYS_DESC(SYS_SCXTNUM_EL0), undef_access },16111611+16121612+ { SYS_DESC(SYS_AMCR_EL0), undef_access },16131613+ { SYS_DESC(SYS_AMCFGR_EL0), undef_access },16141614+ { SYS_DESC(SYS_AMCGCR_EL0), undef_access },16151615+ { SYS_DESC(SYS_AMUSERENR_EL0), undef_access },16161616+ { SYS_DESC(SYS_AMCNTENCLR0_EL0), undef_access },16171617+ { SYS_DESC(SYS_AMCNTENSET0_EL0), undef_access },16181618+ { SYS_DESC(SYS_AMCNTENCLR1_EL0), undef_access },16191619+ { SYS_DESC(SYS_AMCNTENSET1_EL0), undef_access },16391620 AMU_AMEVCNTR0_EL0(0),16401621 AMU_AMEVCNTR0_EL0(1),16411622 AMU_AMEVCNTR0_EL0(2),
+17
arch/arm64/mm/mmu.c
···14441444 free_empty_tables(start, end, PAGE_OFFSET, PAGE_END);14451445}1446144614471447+static bool inside_linear_region(u64 start, u64 size)14481448+{14491449+ /*14501450+ * Linear mapping region is the range [PAGE_OFFSET..(PAGE_END - 1)]14511451+ * accommodating both its ends but excluding PAGE_END. Max physical14521452+ * range which can be mapped inside this linear mapping range, must14531453+ * also be derived from its end points.14541454+ */14551455+ return start >= __pa(_PAGE_OFFSET(vabits_actual)) &&14561456+ (start + size - 1) <= __pa(PAGE_END - 1);14571457+}14581458+14471459int arch_add_memory(int nid, u64 start, u64 size,14481460 struct mhp_params *params)14491461{14501462 int ret, flags = 0;14631463+14641464+ if (!inside_linear_region(start, size)) {14651465+ pr_err("[%llx %llx] is outside linear mapping region\n", start, start + size);14661466+ return -EINVAL;14671467+ }1451146814521469 if (rodata_full || debug_pagealloc_enabled())14531470 flags = NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS;
···262262static void __init bootmem_init(void)263263{264264 phys_addr_t ramstart, ramend;265265- phys_addr_t start, end;266266- u64 i;265265+ unsigned long start, end;266266+ int i;267267268268 ramstart = memblock_start_of_DRAM();269269 ramend = memblock_end_of_DRAM();···300300301301 min_low_pfn = ARCH_PFN_OFFSET;302302 max_pfn = PFN_DOWN(ramend);303303- for_each_mem_range(i, &start, &end) {303303+ for_each_mem_pfn_range(i, MAX_NUMNODES, &start, &end, NULL) {304304 /*305305 * Skip highmem here so we get an accurate max_low_pfn if low306306 * memory stops short of high memory.
···2727#endif2828.endm29293030+#ifdef CONFIG_PPC_KUAP3031.macro kuap_check_amr gpr1, gpr23132#ifdef CONFIG_PPC_KUAP_DEBUG3233 BEGIN_MMU_FTR_SECTION_NESTED(67)···3938 END_MMU_FTR_SECTION_NESTED_IFSET(MMU_FTR_RADIX_KUAP, 67)4039#endif4140.endm4141+#endif42424343.macro kuap_save_amr_and_lock gpr1, gpr2, use_cr, msr_pr_cr4444#ifdef CONFIG_PPC_KUAP···6260.endm63616462#else /* !__ASSEMBLY__ */6363+6464+DECLARE_STATIC_KEY_FALSE(uaccess_flush_key);65656666#ifdef CONFIG_PPC_KUAP6767···107103108104static inline unsigned long get_kuap(void)109105{106106+ /*107107+ * We return AMR_KUAP_BLOCKED when we don't support KUAP because108108+ * prevent_user_access_return needs to return AMR_KUAP_BLOCKED to109109+ * cause restore_user_access to do a flush.110110+ *111111+ * This has no effect in terms of actually blocking things on hash,112112+ * so it doesn't break anything.113113+ */110114 if (!early_mmu_has_feature(MMU_FTR_RADIX_KUAP))111111- return 0;115115+ return AMR_KUAP_BLOCKED;112116113117 return mfspr(SPRN_AMR);114118}···134122 mtspr(SPRN_AMR, value);135123 isync();136124}125125+126126+static inline bool127127+bad_kuap_fault(struct pt_regs *regs, unsigned long address, bool is_write)128128+{129129+ return WARN(mmu_has_feature(MMU_FTR_RADIX_KUAP) &&130130+ (regs->kuap & (is_write ? AMR_KUAP_BLOCK_WRITE : AMR_KUAP_BLOCK_READ)),131131+ "Bug: %s fault blocked by AMR!", is_write ? "Write" : "Read");132132+}133133+#else /* CONFIG_PPC_KUAP */134134+static inline void kuap_restore_amr(struct pt_regs *regs, unsigned long amr) { }135135+136136+static inline unsigned long kuap_get_and_check_amr(void)137137+{138138+ return 0UL;139139+}140140+141141+static inline unsigned long get_kuap(void)142142+{143143+ return AMR_KUAP_BLOCKED;144144+}145145+146146+static inline void set_kuap(unsigned long value) { }147147+#endif /* !CONFIG_PPC_KUAP */137148138149static __always_inline void allow_user_access(void __user *to, const void __user *from,139150 unsigned long size, unsigned long dir)···177142 unsigned long size, unsigned long dir)178143{179144 set_kuap(AMR_KUAP_BLOCKED);145145+ if (static_branch_unlikely(&uaccess_flush_key))146146+ do_uaccess_flush();180147}181148182149static inline unsigned long prevent_user_access_return(void)···186149 unsigned long flags = get_kuap();187150188151 set_kuap(AMR_KUAP_BLOCKED);152152+ if (static_branch_unlikely(&uaccess_flush_key))153153+ do_uaccess_flush();189154190155 return flags;191156}···195156static inline void restore_user_access(unsigned long flags)196157{197158 set_kuap(flags);159159+ if (static_branch_unlikely(&uaccess_flush_key) && flags == AMR_KUAP_BLOCKED)160160+ do_uaccess_flush();198161}199199-200200-static inline bool201201-bad_kuap_fault(struct pt_regs *regs, unsigned long address, bool is_write)202202-{203203- return WARN(mmu_has_feature(MMU_FTR_RADIX_KUAP) &&204204- (regs->kuap & (is_write ? AMR_KUAP_BLOCK_WRITE : AMR_KUAP_BLOCK_READ)),205205- "Bug: %s fault blocked by AMR!", is_write ? "Write" : "Read");206206-}207207-#else /* CONFIG_PPC_KUAP */208208-static inline void kuap_restore_amr(struct pt_regs *regs, unsigned long amr)209209-{210210-}211211-212212-static inline void kuap_check_amr(void)213213-{214214-}215215-216216-static inline unsigned long kuap_get_and_check_amr(void)217217-{218218- return 0;219219-}220220-#endif /* CONFIG_PPC_KUAP */221221-222162#endif /* __ASSEMBLY__ */223163224164#endif /* _ASM_POWERPC_BOOK3S_64_KUP_RADIX_H */
+11-1
arch/powerpc/include/asm/exception-64s.h
···5757 nop; \5858 nop59596060+#define ENTRY_FLUSH_SLOT \6161+ ENTRY_FLUSH_FIXUP_SECTION; \6262+ nop; \6363+ nop; \6464+ nop;6565+6066/*6167 * r10 must be free to use, r13 must be paca6268 */6369#define INTERRUPT_TO_KERNEL \6464- STF_ENTRY_BARRIER_SLOT7070+ STF_ENTRY_BARRIER_SLOT; \7171+ ENTRY_FLUSH_SLOT65726673/*6774 * Macros for annotating the expected destination of (h)rfid···144137 RFSCV; \145138 b rfscv_flush_fallback146139140140+#else /* __ASSEMBLY__ */141141+/* Prototype for function defined in exceptions-64s.S */142142+void do_uaccess_flush(void);147143#endif /* __ASSEMBLY__ */148144149145#endif /* _ASM_POWERPC_EXCEPTION_H */
+19
arch/powerpc/include/asm/feature-fixups.h
···205205 FTR_ENTRY_OFFSET 955b-956b; \206206 .popsection;207207208208+#define UACCESS_FLUSH_FIXUP_SECTION \209209+959: \210210+ .pushsection __uaccess_flush_fixup,"a"; \211211+ .align 2; \212212+960: \213213+ FTR_ENTRY_OFFSET 959b-960b; \214214+ .popsection;215215+216216+#define ENTRY_FLUSH_FIXUP_SECTION \217217+957: \218218+ .pushsection __entry_flush_fixup,"a"; \219219+ .align 2; \220220+958: \221221+ FTR_ENTRY_OFFSET 957b-958b; \222222+ .popsection;223223+208224#define RFI_FLUSH_FIXUP_SECTION \209225951: \210226 .pushsection __rfi_flush_fixup,"a"; \···253237#include <linux/types.h>254238255239extern long stf_barrier_fallback;240240+extern long entry_flush_fallback;256241extern long __start___stf_entry_barrier_fixup, __stop___stf_entry_barrier_fixup;257242extern long __start___stf_exit_barrier_fixup, __stop___stf_exit_barrier_fixup;243243+extern long __start___uaccess_flush_fixup, __stop___uaccess_flush_fixup;244244+extern long __start___entry_flush_fixup, __stop___entry_flush_fixup;258245extern long __start___rfi_flush_fixup, __stop___rfi_flush_fixup;259246extern long __start___barrier_nospec_fixup, __stop___barrier_nospec_fixup;260247extern long __start__btb_flush_fixup, __stop__btb_flush_fixup;
+20-6
arch/powerpc/include/asm/kup.h
···1414#define KUAP_CURRENT_WRITE 81515#define KUAP_CURRENT (KUAP_CURRENT_READ | KUAP_CURRENT_WRITE)16161717-#ifdef CONFIG_PPC641717+#ifdef CONFIG_PPC_BOOK3S_641818#include <asm/book3s/64/kup-radix.h>1919#endif2020#ifdef CONFIG_PPC_8xx···3535.macro kuap_check current, gpr3636.endm37373838+.macro kuap_check_amr gpr1, gpr23939+.endm4040+3841#endif39424043#else /* !__ASSEMBLY__ */···5653void setup_kuap(bool disabled);5754#else5855static inline void setup_kuap(bool disabled) { }5656+5757+static inline bool5858+bad_kuap_fault(struct pt_regs *regs, unsigned long address, bool is_write)5959+{6060+ return false;6161+}6262+6363+static inline void kuap_check_amr(void) { }6464+6565+/*6666+ * book3s/64/kup-radix.h defines these functions for the !KUAP case to flush6767+ * the L1D cache after user accesses. Only include the empty stubs for other6868+ * platforms.6969+ */7070+#ifndef CONFIG_PPC_BOOK3S_645971static inline void allow_user_access(void __user *to, const void __user *from,6072 unsigned long size, unsigned long dir) { }6173static inline void prevent_user_access(void __user *to, const void __user *from,6274 unsigned long size, unsigned long dir) { }6375static inline unsigned long prevent_user_access_return(void) { return 0UL; }6476static inline void restore_user_access(unsigned long flags) { }6565-static inline bool6666-bad_kuap_fault(struct pt_regs *regs, unsigned long address, bool is_write)6767-{6868- return false;6969-}7777+#endif /* CONFIG_PPC_BOOK3S_64 */7078#endif /* CONFIG_PPC_KUAP */71797280static inline void allow_read_from_user(const void __user *from, unsigned long size)
+7
arch/powerpc/include/asm/security_features.h
···8686// Software required to flush link stack on context switch8787#define SEC_FTR_FLUSH_LINK_STACK 0x0000000000001000ull88888989+// The L1-D cache should be flushed when entering the kernel9090+#define SEC_FTR_L1D_FLUSH_ENTRY 0x0000000000004000ull9191+9292+// The L1-D cache should be flushed after user accesses from the kernel9393+#define SEC_FTR_L1D_FLUSH_UACCESS 0x0000000000008000ull89949095// Features enabled by default9196#define SEC_FTR_DEFAULT \9297 (SEC_FTR_L1D_FLUSH_HV | \9398 SEC_FTR_L1D_FLUSH_PR | \9499 SEC_FTR_BNDS_CHK_SPEC_BAR | \100100+ SEC_FTR_L1D_FLUSH_ENTRY | \101101+ SEC_FTR_L1D_FLUSH_UACCESS | \95102 SEC_FTR_FAVOUR_SECURITY)9610397104#endif /* _ASM_POWERPC_SECURITY_FEATURES_H */
···13361336 /* If this is a valid record, create the sample */13371337 struct perf_output_handle handle;1338133813391339- if (perf_output_begin(&handle, event, header.size))13391339+ if (perf_output_begin(&handle, &data, event, header.size))13401340 return;1341134113421342 perf_output_sample(&handle, &header, &data, event);
···9898 security_ftr_clear(SEC_FTR_BNDS_CHK_SPEC_BAR);9999}100100101101-static void pnv_setup_rfi_flush(void)101101+static void pnv_setup_security_mitigations(void)102102{103103 struct device_node *np, *fw_features;104104 enum l1d_flush_type type;···122122 type = L1D_FLUSH_ORI;123123 }124124125125+ /*126126+ * If we are non-Power9 bare metal, we don't need to flush on kernel127127+ * entry or after user access: they fix a P9 specific vulnerability.128128+ */129129+ if (!pvr_version_is(PVR_POWER9)) {130130+ security_ftr_clear(SEC_FTR_L1D_FLUSH_ENTRY);131131+ security_ftr_clear(SEC_FTR_L1D_FLUSH_UACCESS);132132+ }133133+125134 enable = security_ftr_enabled(SEC_FTR_FAVOUR_SECURITY) && \126135 (security_ftr_enabled(SEC_FTR_L1D_FLUSH_PR) || \127136 security_ftr_enabled(SEC_FTR_L1D_FLUSH_HV));128137129138 setup_rfi_flush(type, enable);130139 setup_count_cache_flush();140140+141141+ enable = security_ftr_enabled(SEC_FTR_FAVOUR_SECURITY) &&142142+ security_ftr_enabled(SEC_FTR_L1D_FLUSH_ENTRY);143143+ setup_entry_flush(enable);144144+145145+ enable = security_ftr_enabled(SEC_FTR_FAVOUR_SECURITY) &&146146+ security_ftr_enabled(SEC_FTR_L1D_FLUSH_UACCESS);147147+ setup_uaccess_flush(enable);148148+149149+ setup_stf_barrier();131150}132151133152static void __init pnv_check_guarded_cores(void)···175156{176157 set_arch_panic_timeout(10, ARCH_PANIC_TIMEOUT);177158178178- pnv_setup_rfi_flush();179179- setup_stf_barrier();159159+ pnv_setup_security_mitigations();180160181161 /* Initialize SMP */182162 pnv_smp_init();
+2-2
arch/powerpc/platforms/pseries/mobility.c
···349349350350 cpus_read_unlock();351351352352- /* Possibly switch to a new RFI flush type */353353- pseries_setup_rfi_flush();352352+ /* Possibly switch to a new L1 flush type */353353+ pseries_setup_security_mitigations();354354355355 /* Reinitialise system information for hv-24x7 */356356 read_24x7_sys_info();
···422422#endif423423 LOCKDEP_SYS_EXIT424424.Lsysc_tif:425425+ DISABLE_INTS425426 TSTMSK __PT_FLAGS(%r11),_PIF_WORK426427 jnz .Lsysc_work427428 TSTMSK __TI_flags(%r12),_TIF_WORK···445444# One of the work bits is on. Find out which one.446445#447446.Lsysc_work:447447+ ENABLE_INTS448448 TSTMSK __TI_flags(%r12),_TIF_NEED_RESCHED449449 jo .Lsysc_reschedule450450 TSTMSK __PT_FLAGS(%r11),_PIF_SYSCALL_RESTART
+2-2
arch/s390/kernel/perf_cpum_sf.c
···672672 rcu_read_lock();673673674674 perf_prepare_sample(&header, data, event, regs);675675- if (perf_output_begin(&handle, event, header.size))675675+ if (perf_output_begin(&handle, data, event, header.size))676676 goto out;677677678678 /* Update the process ID (see also kernel/events/core.c) */···22282228}2229222922302230arch_initcall(init_cpum_sampling_pmu);22312231-core_param(cpum_sfb_size, CPUM_SF_MAX_SDB, sfb_size, 0640);22312231+core_param(cpum_sfb_size, CPUM_SF_MAX_SDB, sfb_size, 0644);
+1-2
arch/s390/kernel/perf_regs.c
···5353}54545555void perf_get_regs_user(struct perf_regs *regs_user,5656- struct pt_regs *regs,5757- struct pt_regs *regs_user_copy)5656+ struct pt_regs *regs)5857{5958 /*6059 * Use the regs from the first interruption and let
+7-1
arch/um/include/asm/pgalloc.h
···3333} while (0)34343535#ifdef CONFIG_3_LEVEL_PGTABLES3636-#define __pmd_free_tlb(tlb,x, address) tlb_remove_page((tlb),virt_to_page(x))3636+3737+#define __pmd_free_tlb(tlb, pmd, address) \3838+do { \3939+ pgtable_pmd_page_dtor(virt_to_page(pmd)); \4040+ tlb_remove_page((tlb),virt_to_page(pmd)); \4141+} while (0) \4242+3743#endif38443945#endif
+11-1
arch/x86/events/intel/core.c
···26302630 u64 pebs_enabled = cpuc->pebs_enabled;2631263126322632 handled++;26332633- x86_pmu.drain_pebs(regs);26332633+ x86_pmu.drain_pebs(regs, &data);26342634 status &= x86_pmu.intel_ctrl | GLOBAL_STATUS_TRACE_TOPAPMI;2635263526362636 /*···4987498749884988 x86_add_quirk(intel_arch_events_quirk); /* Install first, so it runs last */4989498949904990+ if (version >= 5) {49914991+ x86_pmu.intel_cap.anythread_deprecated = edx.split.anythread_deprecated;49924992+ if (x86_pmu.intel_cap.anythread_deprecated)49934993+ pr_cont(" AnyThread deprecated, ");49944994+ }49954995+49904996 /*49914997 * Install the hw-cache-events table:49924998 */···5517551155185512 x86_pmu.intel_ctrl |=55195513 ((1LL << x86_pmu.num_counters_fixed)-1) << INTEL_PMC_IDX_FIXED;55145514+55155515+ /* AnyThread may be deprecated on arch perfmon v5 or later */55165516+ if (x86_pmu.intel_cap.anythread_deprecated)55175517+ x86_pmu.format_attrs = intel_arch_formats_attr;5520551855215519 if (x86_pmu.event_constraints) {55225520 /*
+28-25
arch/x86/events/intel/ds.c
···642642 rcu_read_lock();643643 perf_prepare_sample(&header, &data, event, ®s);644644645645- if (perf_output_begin(&handle, event, header.size *646646- (top - base - skip)))645645+ if (perf_output_begin(&handle, &data, event,646646+ header.size * (top - base - skip)))647647 goto unlock;648648649649 for (at = base; at < top; at++) {···670670671671static inline void intel_pmu_drain_pebs_buffer(void)672672{673673- x86_pmu.drain_pebs(NULL);673673+ struct perf_sample_data data;674674+675675+ x86_pmu.drain_pebs(NULL, &data);674676}675677676678/*···17211719 return 0;17221720}1723172117241724-static void __intel_pmu_pebs_event(struct perf_event *event,17251725- struct pt_regs *iregs,17261726- void *base, void *top,17271727- int bit, int count,17281728- void (*setup_sample)(struct perf_event *,17291729- struct pt_regs *,17301730- void *,17311731- struct perf_sample_data *,17321732- struct pt_regs *))17221722+static __always_inline void17231723+__intel_pmu_pebs_event(struct perf_event *event,17241724+ struct pt_regs *iregs,17251725+ struct perf_sample_data *data,17261726+ void *base, void *top,17271727+ int bit, int count,17281728+ void (*setup_sample)(struct perf_event *,17291729+ struct pt_regs *,17301730+ void *,17311731+ struct perf_sample_data *,17321732+ struct pt_regs *))17331733{17341734 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);17351735 struct hw_perf_event *hwc = &event->hw;17361736- struct perf_sample_data data;17371736 struct x86_perf_regs perf_regs;17381737 struct pt_regs *regs = &perf_regs.regs;17391738 void *at = get_next_pebs_record_by_bit(base, top, bit);17401740- struct pt_regs dummy_iregs;17391739+ static struct pt_regs dummy_iregs;1741174017421741 if (hwc->flags & PERF_X86_EVENT_AUTO_RELOAD) {17431742 /*···17551752 iregs = &dummy_iregs;1756175317571754 while (count > 1) {17581758- setup_sample(event, iregs, at, &data, regs);17591759- perf_event_output(event, &data, regs);17551755+ setup_sample(event, iregs, at, data, regs);17561756+ perf_event_output(event, data, regs);17601757 at += cpuc->pebs_record_size;17611758 at = get_next_pebs_record_by_bit(at, top, bit);17621759 count--;17631760 }1764176117651765- setup_sample(event, iregs, at, &data, regs);17621762+ setup_sample(event, iregs, at, data, regs);17661763 if (iregs == &dummy_iregs) {17671764 /*17681765 * The PEBS records may be drained in the non-overflow context,···17701767 * last record the same as other PEBS records, and doesn't17711768 * invoke the generic overflow handler.17721769 */17731773- perf_event_output(event, &data, regs);17701770+ perf_event_output(event, data, regs);17741771 } else {17751772 /*17761773 * All but the last records are processed.17771774 * The last one is left to be able to call the overflow handler.17781775 */17791779- if (perf_event_overflow(event, &data, regs))17761776+ if (perf_event_overflow(event, data, regs))17801777 x86_pmu_stop(event, 0);17811778 }17821779}1783178017841784-static void intel_pmu_drain_pebs_core(struct pt_regs *iregs)17811781+static void intel_pmu_drain_pebs_core(struct pt_regs *iregs, struct perf_sample_data *data)17851782{17861783 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);17871784 struct debug_store *ds = cpuc->ds;···18151812 return;18161813 }1817181418181818- __intel_pmu_pebs_event(event, iregs, at, top, 0, n,18151815+ __intel_pmu_pebs_event(event, iregs, data, at, top, 0, n,18191816 setup_pebs_fixed_sample_data);18201817}18211818···18381835 }18391836}1840183718411841-static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs)18381838+static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs, struct perf_sample_data *data)18421839{18431840 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);18441841 struct debug_store *ds = cpuc->ds;···19451942 }1946194319471944 if (counts[bit]) {19481948- __intel_pmu_pebs_event(event, iregs, base,19451945+ __intel_pmu_pebs_event(event, iregs, data, base,19491946 top, bit, counts[bit],19501947 setup_pebs_fixed_sample_data);19511948 }19521949 }19531950}1954195119551955-static void intel_pmu_drain_pebs_icl(struct pt_regs *iregs)19521952+static void intel_pmu_drain_pebs_icl(struct pt_regs *iregs, struct perf_sample_data *data)19561953{19571954 short counts[INTEL_PMC_IDX_FIXED + MAX_FIXED_PEBS_EVENTS] = {};19581955 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);···20001997 if (WARN_ON_ONCE(!event->attr.precise_ip))20011998 continue;2002199920032003- __intel_pmu_pebs_event(event, iregs, base,20002000+ __intel_pmu_pebs_event(event, iregs, data, base,20042001 top, bit, counts[bit],20052002 setup_pebs_adaptive_sample_data);20062003 }
···585585 u64 pebs_baseline:1;586586 u64 perf_metrics:1;587587 u64 pebs_output_pt_available:1;588588+ u64 anythread_deprecated:1;588589 };589590 u64 capabilities;590591};···728727 int pebs_record_size;729728 int pebs_buffer_size;730729 int max_pebs_events;731731- void (*drain_pebs)(struct pt_regs *regs);730730+ void (*drain_pebs)(struct pt_regs *regs, struct perf_sample_data *data);732731 struct event_constraint *pebs_constraints;733732 void (*pebs_aliases)(struct perf_event *event);734733 unsigned long large_pebs_flags;
+1
arch/x86/include/asm/kvm_host.h
···639639 int cpuid_nent;640640 struct kvm_cpuid_entry2 *cpuid_entries;641641642642+ unsigned long cr3_lm_rsvd_bits;642643 int maxphyaddr;643644 int max_tdp_level;644645
+3-1
arch/x86/include/asm/perf_event.h
···137137 struct {138138 unsigned int num_counters_fixed:5;139139 unsigned int bit_width_fixed:8;140140- unsigned int reserved:19;140140+ unsigned int reserved1:2;141141+ unsigned int anythread_deprecated:1;142142+ unsigned int reserved2:16;141143 } split;142144 unsigned int full;143145};
···178178 vcpu->arch.cr4_guest_rsvd_bits =179179 __cr4_reserved_bits(guest_cpuid_has, vcpu);180180181181+ vcpu->arch.cr3_lm_rsvd_bits = rsvd_bits(cpuid_maxphyaddr(vcpu), 63);182182+181183 /* Invoke the vendor callback only after the above state is updated. */182184 kvm_x86_ops.vcpu_after_set_cpuid(vcpu);183185}···683681684682 edx.split.num_counters_fixed = min(cap.num_counters_fixed, MAX_FIXED_COUNTERS);685683 edx.split.bit_width_fixed = cap.bit_width_fixed;686686- edx.split.reserved = 0;684684+ edx.split.anythread_deprecated = 1;685685+ edx.split.reserved1 = 0;686686+ edx.split.reserved2 = 0;687687688688 entry->eax = eax.full;689689 entry->ebx = cap.events_mask;
+7-1
arch/x86/kvm/emulate.c
···40464046 return X86EMUL_CONTINUE;40474047}4048404840494049+static int em_clflushopt(struct x86_emulate_ctxt *ctxt)40504050+{40514051+ /* emulating clflushopt regardless of cpuid */40524052+ return X86EMUL_CONTINUE;40534053+}40544054+40494055static int em_movsxd(struct x86_emulate_ctxt *ctxt)40504056{40514057 ctxt->dst.val = (s32) ctxt->src.val;···45914585};4592458645934587static const struct gprefix pfx_0f_ae_7 = {45944594- I(SrcMem | ByteOp, em_clflush), N, N, N,45884588+ I(SrcMem | ByteOp, em_clflush), I(SrcMem | ByteOp, em_clflushopt), N, N,45954589};4596459045974591static const struct group_dual group15 = { {
+7
arch/x86/kvm/mmu/tdp_mmu.c
···4949{5050 struct kvm_mmu_page *sp;51515252+ if (!kvm->arch.tdp_mmu_enabled)5353+ return false;5454+ if (WARN_ON(!VALID_PAGE(hpa)))5555+ return false;5656+5257 sp = to_shadow_page(hpa);5858+ if (WARN_ON(!sp))5959+ return false;53605461 return sp->tdp_mmu_page && sp->root_count;5562}
+8
arch/x86/kvm/svm/svm.c
···37413741static void svm_vcpu_after_set_cpuid(struct kvm_vcpu *vcpu)37423742{37433743 struct vcpu_svm *svm = to_svm(vcpu);37443744+ struct kvm_cpuid_entry2 *best;3744374537453746 vcpu->arch.xsaves_enabled = guest_cpuid_has(vcpu, X86_FEATURE_XSAVE) &&37463747 boot_cpu_has(X86_FEATURE_XSAVE) &&···3753375237543753 /* Check again if INVPCID interception if required */37553754 svm_check_invpcid(svm);37553755+37563756+ /* For sev guests, the memory encryption bit is not reserved in CR3. */37573757+ if (sev_guest(vcpu->kvm)) {37583758+ best = kvm_find_cpuid_entry(vcpu, 0x8000001F, 0);37593759+ if (best)37603760+ vcpu->arch.cr3_lm_rsvd_bits &= ~(1UL << (best->ebx & 0x3f));37613761+ }3756376237573763 if (!kvm_vcpu_apicv_active(vcpu))37583764 return;
···302302 return -EFAULT;303303}304304#else305305-long strncpy_from_user(char *dst, const char *src, long count);305305+long strncpy_from_user(char *dst, const char __user *src, long count);306306#endif307307308308/*
+14
arch/xtensa/mm/cache.c
···7070 kvaddr = TLBTEMP_BASE_1 +7171 (page_to_phys(page) & DCACHE_ALIAS_MASK);72727373+ preempt_disable();7374 __invalidate_dcache_page_alias(kvaddr,7475 page_to_phys(page));7676+ preempt_enable();7577 }7678 }7779}···158156 if (!alias && !mapping)159157 return;160158159159+ preempt_disable();161160 virt = TLBTEMP_BASE_1 + (phys & DCACHE_ALIAS_MASK);162161 __flush_invalidate_dcache_page_alias(virt, phys);163162···169166170167 if (mapping)171168 __invalidate_icache_page_alias(virt, phys);169169+ preempt_enable();172170 }173171174172 /* There shouldn't be an entry in the cache for this page anymore. */···203199 unsigned long phys = page_to_phys(pfn_to_page(pfn));204200 unsigned long virt = TLBTEMP_BASE_1 + (address & DCACHE_ALIAS_MASK);205201202202+ preempt_disable();206203 __flush_invalidate_dcache_page_alias(virt, phys);207204 __invalidate_icache_page_alias(virt, phys);205205+ preempt_enable();208206}209207EXPORT_SYMBOL(local_flush_cache_page);210208···233227 unsigned long phys = page_to_phys(page);234228 unsigned long tmp;235229230230+ preempt_disable();236231 tmp = TLBTEMP_BASE_1 + (phys & DCACHE_ALIAS_MASK);237232 __flush_invalidate_dcache_page_alias(tmp, phys);238233 tmp = TLBTEMP_BASE_1 + (addr & DCACHE_ALIAS_MASK);239234 __flush_invalidate_dcache_page_alias(tmp, phys);240235 __invalidate_icache_page_alias(tmp, phys);236236+ preempt_enable();241237242238 clear_bit(PG_arch_1, &page->flags);243239 }···273265274266 if (alias) {275267 unsigned long t = TLBTEMP_BASE_1 + (vaddr & DCACHE_ALIAS_MASK);268268+ preempt_disable();276269 __flush_invalidate_dcache_page_alias(t, phys);270270+ preempt_enable();277271 }278272279273 /* Copy data */···290280 if (alias) {291281 unsigned long t = TLBTEMP_BASE_1 + (vaddr & DCACHE_ALIAS_MASK);292282283283+ preempt_disable();293284 __flush_invalidate_dcache_range((unsigned long) dst, len);294285 if ((vma->vm_flags & VM_EXEC) != 0)295286 __invalidate_icache_page_alias(t, phys);287287+ preempt_enable();296288297289 } else if ((vma->vm_flags & VM_EXEC) != 0) {298290 __flush_dcache_range((unsigned long)dst,len);···316304317305 if (alias) {318306 unsigned long t = TLBTEMP_BASE_1 + (vaddr & DCACHE_ALIAS_MASK);307307+ preempt_disable();319308 __flush_invalidate_dcache_page_alias(t, phys);309309+ preempt_enable();320310 }321311322312 memcpy(dst, src, len);
+4-1
block/genhd.c
···4949 * Set disk capacity and notify if the size is not currently5050 * zero and will not be set to zero5151 */5252-void set_capacity_revalidate_and_notify(struct gendisk *disk, sector_t size,5252+bool set_capacity_revalidate_and_notify(struct gendisk *disk, sector_t size,5353 bool update_bdev)5454{5555 sector_t capacity = get_capacity(disk);···6262 char *envp[] = { "RESIZE=1", NULL };63636464 kobject_uevent_env(&disk_to_dev(disk)->kobj, KOBJ_CHANGE, envp);6565+ return true;6566 }6767+6868+ return false;6669}67706871EXPORT_SYMBOL_GPL(set_capacity_revalidate_and_notify);
···298298 struct spk_ldisc_data *ldisc_data = speakup_tty->disc_data;299299 char rv;300300301301- if (wait_for_completion_timeout(&ldisc_data->completion,301301+ if (!timeout) {302302+ if (!try_wait_for_completion(&ldisc_data->completion))303303+ return 0xff;304304+ } else if (wait_for_completion_timeout(&ldisc_data->completion,302305 usecs_to_jiffies(timeout)) == 0) {303303- if (timeout)304304- pr_warn("spk_ttyio: timeout (%d) while waiting for input\n",305305- timeout);306306+ pr_warn("spk_ttyio: timeout (%d) while waiting for input\n",307307+ timeout);306308 return 0xff;307309 }308310
+6-2
drivers/accessibility/speakup/spk_types.h
···3232 E_NEW_DEFAULT,3333};34343535+/*3636+ * Note: add new members at the end, speakupmap.h depends on the values of the3737+ * enum starting from SPELL_DELAY (see inc_dec_var)3838+ */3539enum var_id_t {3640 VERSION = 0, SYNTH, SILENT, SYNTH_DIRECT,3741 KEYMAP, CHARS,···4642 SAY_CONTROL, SAY_WORD_CTL, NO_INTERRUPT, KEY_ECHO,4743 SPELL_DELAY, PUNC_LEVEL, READING_PUNC,4844 ATTRIB_BLEEP, BLEEPS,4949- RATE, PITCH, INFLECTION, VOL, TONE, PUNCT, VOICE, FREQUENCY, LANG,4545+ RATE, PITCH, VOL, TONE, PUNCT, VOICE, FREQUENCY, LANG,5046 DIRECT, PAUSE,5151- CAPS_START, CAPS_STOP, CHARTAB,4747+ CAPS_START, CAPS_STOP, CHARTAB, INFLECTION,5248 MAXVARS5349};5450
+4
drivers/acpi/apei/apei-base.c
···633633 if (rc)634634 return rc;635635636636+ /* IO space doesn't need mapping */637637+ if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_IO)638638+ return 0;639639+636640 if (!acpi_os_map_generic_address(reg))637641 return -ENXIO;638642
···435435 /*436436 * Allocate DMA memory from ancestor. When a virtio437437 * device is created by remoteproc, the DMA memory is438438- * associated with the grandparent device:439439- * vdev => rproc => platform-dev.438438+ * associated with the parent device:439439+ * virtioY => remoteprocX#vdevYbuffer.440440 */441441- if (!vdev->dev.parent || !vdev->dev.parent->parent)441441+ buf->dev = vdev->dev.parent;442442+ if (!buf->dev)442443 goto free_buf;443443- buf->dev = vdev->dev.parent->parent;444444445445 /* Increase device refcnt to avoid freeing it */446446 get_device(buf->dev);
+5-5
drivers/clk/imx/clk-imx8mm.c
···443443 hws[IMX8MM_CLK_A53_CORE] = imx_clk_hw_mux2("arm_a53_core", base + 0x9880, 24, 1, imx8mm_a53_core_sels, ARRAY_SIZE(imx8mm_a53_core_sels));444444445445 /* BUS */446446- hws[IMX8MM_CLK_MAIN_AXI] = imx8m_clk_hw_composite_critical("main_axi", imx8mm_main_axi_sels, base + 0x8800);446446+ hws[IMX8MM_CLK_MAIN_AXI] = imx8m_clk_hw_composite_bus_critical("main_axi", imx8mm_main_axi_sels, base + 0x8800);447447 hws[IMX8MM_CLK_ENET_AXI] = imx8m_clk_hw_composite_bus("enet_axi", imx8mm_enet_axi_sels, base + 0x8880);448448- hws[IMX8MM_CLK_NAND_USDHC_BUS] = imx8m_clk_hw_composite_critical("nand_usdhc_bus", imx8mm_nand_usdhc_sels, base + 0x8900);448448+ hws[IMX8MM_CLK_NAND_USDHC_BUS] = imx8m_clk_hw_composite_bus_critical("nand_usdhc_bus", imx8mm_nand_usdhc_sels, base + 0x8900);449449 hws[IMX8MM_CLK_VPU_BUS] = imx8m_clk_hw_composite_bus("vpu_bus", imx8mm_vpu_bus_sels, base + 0x8980);450450 hws[IMX8MM_CLK_DISP_AXI] = imx8m_clk_hw_composite_bus("disp_axi", imx8mm_disp_axi_sels, base + 0x8a00);451451 hws[IMX8MM_CLK_DISP_APB] = imx8m_clk_hw_composite_bus("disp_apb", imx8mm_disp_apb_sels, base + 0x8a80);···453453 hws[IMX8MM_CLK_USB_BUS] = imx8m_clk_hw_composite_bus("usb_bus", imx8mm_usb_bus_sels, base + 0x8b80);454454 hws[IMX8MM_CLK_GPU_AXI] = imx8m_clk_hw_composite_bus("gpu_axi", imx8mm_gpu_axi_sels, base + 0x8c00);455455 hws[IMX8MM_CLK_GPU_AHB] = imx8m_clk_hw_composite_bus("gpu_ahb", imx8mm_gpu_ahb_sels, base + 0x8c80);456456- hws[IMX8MM_CLK_NOC] = imx8m_clk_hw_composite_critical("noc", imx8mm_noc_sels, base + 0x8d00);457457- hws[IMX8MM_CLK_NOC_APB] = imx8m_clk_hw_composite_critical("noc_apb", imx8mm_noc_apb_sels, base + 0x8d80);456456+ hws[IMX8MM_CLK_NOC] = imx8m_clk_hw_composite_bus_critical("noc", imx8mm_noc_sels, base + 0x8d00);457457+ hws[IMX8MM_CLK_NOC_APB] = imx8m_clk_hw_composite_bus_critical("noc_apb", imx8mm_noc_apb_sels, base + 0x8d80);458458459459 /* AHB */460460- hws[IMX8MM_CLK_AHB] = imx8m_clk_hw_composite_critical("ahb", imx8mm_ahb_sels, base + 0x9000);460460+ hws[IMX8MM_CLK_AHB] = imx8m_clk_hw_composite_bus_critical("ahb", imx8mm_ahb_sels, base + 0x9000);461461 hws[IMX8MM_CLK_AUDIO_AHB] = imx8m_clk_hw_composite_bus("audio_ahb", imx8mm_audio_ahb_sels, base + 0x9100);462462463463 /* IPG */
+3-3
drivers/clk/imx/clk-imx8mn.c
···431431 hws[IMX8MN_CLK_A53_CORE] = imx_clk_hw_mux2("arm_a53_core", base + 0x9880, 24, 1, imx8mn_a53_core_sels, ARRAY_SIZE(imx8mn_a53_core_sels));432432433433 /* BUS */434434- hws[IMX8MN_CLK_MAIN_AXI] = imx8m_clk_hw_composite_critical("main_axi", imx8mn_main_axi_sels, base + 0x8800);434434+ hws[IMX8MN_CLK_MAIN_AXI] = imx8m_clk_hw_composite_bus_critical("main_axi", imx8mn_main_axi_sels, base + 0x8800);435435 hws[IMX8MN_CLK_ENET_AXI] = imx8m_clk_hw_composite_bus("enet_axi", imx8mn_enet_axi_sels, base + 0x8880);436436 hws[IMX8MN_CLK_NAND_USDHC_BUS] = imx8m_clk_hw_composite_bus("nand_usdhc_bus", imx8mn_nand_usdhc_sels, base + 0x8900);437437 hws[IMX8MN_CLK_DISP_AXI] = imx8m_clk_hw_composite_bus("disp_axi", imx8mn_disp_axi_sels, base + 0x8a00);···439439 hws[IMX8MN_CLK_USB_BUS] = imx8m_clk_hw_composite_bus("usb_bus", imx8mn_usb_bus_sels, base + 0x8b80);440440 hws[IMX8MN_CLK_GPU_AXI] = imx8m_clk_hw_composite_bus("gpu_axi", imx8mn_gpu_axi_sels, base + 0x8c00);441441 hws[IMX8MN_CLK_GPU_AHB] = imx8m_clk_hw_composite_bus("gpu_ahb", imx8mn_gpu_ahb_sels, base + 0x8c80);442442- hws[IMX8MN_CLK_NOC] = imx8m_clk_hw_composite_critical("noc", imx8mn_noc_sels, base + 0x8d00);442442+ hws[IMX8MN_CLK_NOC] = imx8m_clk_hw_composite_bus_critical("noc", imx8mn_noc_sels, base + 0x8d00);443443444444- hws[IMX8MN_CLK_AHB] = imx8m_clk_hw_composite_critical("ahb", imx8mn_ahb_sels, base + 0x9000);444444+ hws[IMX8MN_CLK_AHB] = imx8m_clk_hw_composite_bus_critical("ahb", imx8mn_ahb_sels, base + 0x9000);445445 hws[IMX8MN_CLK_AUDIO_AHB] = imx8m_clk_hw_composite_bus("audio_ahb", imx8mn_audio_ahb_sels, base + 0x9100);446446 hws[IMX8MN_CLK_IPG_ROOT] = imx_clk_hw_divider2("ipg_root", "ahb", base + 0x9080, 0, 1);447447 hws[IMX8MN_CLK_IPG_AUDIO_ROOT] = imx_clk_hw_divider2("ipg_audio_root", "audio_ahb", base + 0x9180, 0, 1);
···8899#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt10101111+#include <linux/clk-provider.h>1112#include <linux/cpu.h>1213#include <linux/cpufreq.h>1314#include <linux/cpumask.h>···229228static int scmi_cpufreq_probe(struct scmi_device *sdev)230229{231230 int ret;231231+ struct device *dev = &sdev->dev;232232233233 handle = sdev->handle;234234235235 if (!handle || !handle->perf_ops)236236 return -ENODEV;237237+238238+ /* dummy clock provider as needed by OPP if clocks property is used */239239+ if (of_find_property(dev->of_node, "#clock-cells", NULL))240240+ devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, NULL);237241238242 ret = cpufreq_register_driver(&scmi_cpufreq_driver);239243 if (ret) {
···147147 return 0;148148149149 /* Return value if feature is already checked */150150+ if (api_id > ARRAY_SIZE(zynqmp_pm_features))151151+ return PM_FEATURE_INVALID;152152+150153 if (zynqmp_pm_features[api_id] != PM_FEATURE_UNCHECKED)151154 return zynqmp_pm_features[api_id];152155
···480480 kfree(gdev);481481}482482483483+#ifdef CONFIG_GPIO_CDEV484484+#define gcdev_register(gdev, devt) gpiolib_cdev_register((gdev), (devt))485485+#define gcdev_unregister(gdev) gpiolib_cdev_unregister((gdev))486486+#else487487+/*488488+ * gpiolib_cdev_register() indirectly calls device_add(), which is still489489+ * required even when cdev is not selected.490490+ */491491+#define gcdev_register(gdev, devt) device_add(&(gdev)->dev)492492+#define gcdev_unregister(gdev) device_del(&(gdev)->dev)493493+#endif494494+483495static int gpiochip_setup_dev(struct gpio_device *gdev)484496{485497 int ret;486498487487- ret = gpiolib_cdev_register(gdev, gpio_devt);499499+ ret = gcdev_register(gdev, gpio_devt);488500 if (ret)489501 return ret;490502···512500 return 0;513501514502err_remove_device:515515- gpiolib_cdev_unregister(gdev);503503+ gcdev_unregister(gdev);516504 return ret;517505}518506···837825 * be removed, else it will be dangling until the last user is838826 * gone.839827 */840840- gpiolib_cdev_unregister(gdev);828828+ gcdev_unregister(gdev);841829 put_device(&gdev->dev);842830}843831EXPORT_SYMBOL_GPL(gpiochip_remove);
+1-2
drivers/gpu/drm/amd/amdgpu/nv.c
···492492 if (adev->enable_virtual_display || amdgpu_sriov_vf(adev))493493 amdgpu_device_ip_block_add(adev, &dce_virtual_ip_block);494494#if defined(CONFIG_DRM_AMD_DC)495495- else if (amdgpu_device_has_dc_support(adev) &&496496- !nv_is_headless_sku(adev->pdev))495495+ else if (amdgpu_device_has_dc_support(adev))497496 amdgpu_device_ip_block_add(adev, &dm_ip_block);498497#endif499498 amdgpu_device_ip_block_add(adev, &gfx_v10_0_ip_block);
···180180}181181182182static int183183-i915_gem_phys_pwrite(struct drm_i915_gem_object *obj,184184- struct drm_i915_gem_pwrite *args,185185- struct drm_file *file)186186-{187187- void *vaddr = sg_page(obj->mm.pages->sgl) + args->offset;188188- char __user *user_data = u64_to_user_ptr(args->data_ptr);189189-190190- /*191191- * We manually control the domain here and pretend that it192192- * remains coherent i.e. in the GTT domain, like shmem_pwrite.193193- */194194- i915_gem_object_invalidate_frontbuffer(obj, ORIGIN_CPU);195195-196196- if (copy_from_user(vaddr, user_data, args->size))197197- return -EFAULT;198198-199199- drm_clflush_virt_range(vaddr, args->size);200200- intel_gt_chipset_flush(&to_i915(obj->base.dev)->gt);201201-202202- i915_gem_object_flush_frontbuffer(obj, ORIGIN_CPU);203203- return 0;204204-}205205-206206-static int207183i915_gem_create(struct drm_file *file,208184 struct intel_memory_region *mr,209185 u64 *size_p,···502526 }503527504528 trace_i915_gem_object_pread(obj, args->offset, args->size);529529+530530+ ret = -ENODEV;531531+ if (obj->ops->pread)532532+ ret = obj->ops->pread(obj, args);533533+ if (ret != -ENODEV)534534+ goto out;505535506536 ret = i915_gem_object_wait(obj,507537 I915_WAIT_INTERRUPTIBLE,···848866 if (ret == -EFAULT || ret == -ENOSPC) {849867 if (i915_gem_object_has_struct_page(obj))850868 ret = i915_gem_shmem_pwrite(obj, args);851851- else852852- ret = i915_gem_phys_pwrite(obj, args, file);853869 }854870855871 i915_gem_object_unpin_pages(obj);
+7-1
drivers/gpu/drm/mcde/mcde_drv.c
···413413 match);414414 if (ret) {415415 dev_err(dev, "failed to add component master\n");416416- goto clk_disable;416416+ /*417417+ * The EPOD regulator is already disabled at this point so some418418+ * special errorpath code is needed419419+ */420420+ clk_disable_unprepare(mcde->mcde_clk);421421+ regulator_disable(mcde->vana);422422+ return ret;417423 }418424419425 return 0;
···350350351351 if (domain & NOUVEAU_GEM_DOMAIN_VRAM) {352352 struct nvif_mmu *mmu = &drm->client.mmu;353353- const u8 type = mmu->type[drm->ttm.type_vram].type;354353355354 pl[*n].mem_type = TTM_PL_VRAM;356355 pl[*n].flags = flags & ~TTM_PL_FLAG_CACHED;357356358357 /* Some BARs do not support being ioremapped WC */359358 if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_TESLA &&360360- type & NVIF_MEM_UNCACHED)359359+ mmu->type[drm->ttm.type_vram].type & NVIF_MEM_UNCACHED)361360 pl[*n].flags &= ~TTM_PL_FLAG_WC;362361363362 (*n)++;
+9-5
drivers/gpu/drm/nouveau/nouveau_connector.c
···532532nouveau_connector_set_edid(struct nouveau_connector *nv_connector,533533 struct edid *edid)534534{535535- struct edid *old_edid = nv_connector->edid;535535+ if (nv_connector->edid != edid) {536536+ struct edid *old_edid = nv_connector->edid;536537537537- drm_connector_update_edid_property(&nv_connector->base, edid);538538- kfree(old_edid);539539- nv_connector->edid = edid;538538+ drm_connector_update_edid_property(&nv_connector->base, edid);539539+ kfree(old_edid);540540+ nv_connector->edid = edid;541541+ }540542}541543542544static enum drm_connector_status···671669 /* Try retrieving EDID via DDC */672670 if (!drm->vbios.fp_no_ddc) {673671 status = nouveau_connector_detect(connector, force);674674- if (status == connector_status_connected)672672+ if (status == connector_status_connected) {673673+ edid = nv_connector->edid;675674 goto out;675675+ }676676 }677677678678 /* On some laptops (Sony, i'm looking at you) there appears to
+6-2
drivers/hv/hv.c
···244244245245 /*246246 * Hyper-V does not provide a way to change the connect CPU once247247- * it is set; we must prevent the connect CPU from going offline.247247+ * it is set; we must prevent the connect CPU from going offline248248+ * while the VM is running normally. But in the panic or kexec()249249+ * path where the vmbus is already disconnected, the CPU must be250250+ * allowed to shut down.248251 */249249- if (cpu == VMBUS_CONNECT_CPU)252252+ if (cpu == VMBUS_CONNECT_CPU &&253253+ vmbus_connection.conn_state == CONNECTED)250254 return -EBUSY;251255252256 /*
+1-1
drivers/hwmon/amd_energy.c
···171171 enum hwmon_sensor_types type,172172 u32 attr, int channel)173173{174174- return 0444;174174+ return 0440;175175}176176177177static int energy_accumulator(void *p)
+82-48
drivers/hwmon/applesmc.c
···3232#include <linux/hwmon.h>3333#include <linux/workqueue.h>3434#include <linux/err.h>3535+#include <linux/bits.h>35363637/* data port used by Apple SMC */3738#define APPLESMC_DATA_PORT 0x300···43424443#define APPLESMC_MAX_DATA_LENGTH 3245444646-/* wait up to 128 ms for a status change. */4747-#define APPLESMC_MIN_WAIT 0x00104848-#define APPLESMC_RETRY_WAIT 0x01004949-#define APPLESMC_MAX_WAIT 0x200004545+/* Apple SMC status bits */4646+#define SMC_STATUS_AWAITING_DATA BIT(0) /* SMC has data waiting to be read */4747+#define SMC_STATUS_IB_CLOSED BIT(1) /* Will ignore any input */4848+#define SMC_STATUS_BUSY BIT(2) /* Command in progress */4949+5050+/* Initial wait is 8us */5151+#define APPLESMC_MIN_WAIT 0x000850525153#define APPLESMC_READ_CMD 0x105254#define APPLESMC_WRITE_CMD 0x11···155151static struct workqueue_struct *applesmc_led_wq;156152157153/*158158- * wait_read - Wait for a byte to appear on SMC port. Callers must159159- * hold applesmc_lock.154154+ * Wait for specific status bits with a mask on the SMC.155155+ * Used before all transactions.156156+ * This does 10 fast loops of 8us then exponentially backs off for a157157+ * minimum total wait of 262ms. Depending on usleep_range this could158158+ * run out past 500ms.160159 */161161-static int wait_read(void)160160+161161+static int wait_status(u8 val, u8 mask)162162{163163- unsigned long end = jiffies + (APPLESMC_MAX_WAIT * HZ) / USEC_PER_SEC;164163 u8 status;165164 int us;165165+ int i;166166167167- for (us = APPLESMC_MIN_WAIT; us < APPLESMC_MAX_WAIT; us <<= 1) {168168- usleep_range(us, us * 16);167167+ us = APPLESMC_MIN_WAIT;168168+ for (i = 0; i < 24 ; i++) {169169 status = inb(APPLESMC_CMD_PORT);170170- /* read: wait for smc to settle */171171- if (status & 0x01)170170+ if ((status & mask) == val)172171 return 0;173173- /* timeout: give up */174174- if (time_after(jiffies, end))175175- break;172172+ usleep_range(us, us * 2);173173+ if (i > 9)174174+ us <<= 1;176175 }177177-178178- pr_warn("wait_read() fail: 0x%02x\n", status);179176 return -EIO;180177}181178182182-/*183183- * send_byte - Write to SMC port, retrying when necessary. Callers184184- * must hold applesmc_lock.185185- */179179+/* send_byte - Write to SMC data port. Callers must hold applesmc_lock. */180180+186181static int send_byte(u8 cmd, u16 port)187182{188188- u8 status;189189- int us;190190- unsigned long end = jiffies + (APPLESMC_MAX_WAIT * HZ) / USEC_PER_SEC;183183+ int status;184184+185185+ status = wait_status(0, SMC_STATUS_IB_CLOSED);186186+ if (status)187187+ return status;188188+ /*189189+ * This needs to be a separate read looking for bit 0x04190190+ * after bit 0x02 falls. If consolidated with the wait above191191+ * this extra read may not happen if status returns both192192+ * simultaneously and this would appear to be required.193193+ */194194+ status = wait_status(SMC_STATUS_BUSY, SMC_STATUS_BUSY);195195+ if (status)196196+ return status;191197192198 outb(cmd, port);193193- for (us = APPLESMC_MIN_WAIT; us < APPLESMC_MAX_WAIT; us <<= 1) {194194- usleep_range(us, us * 16);195195- status = inb(APPLESMC_CMD_PORT);196196- /* write: wait for smc to settle */197197- if (status & 0x02)198198- continue;199199- /* ready: cmd accepted, return */200200- if (status & 0x04)201201- return 0;202202- /* timeout: give up */203203- if (time_after(jiffies, end))204204- break;205205- /* busy: long wait and resend */206206- udelay(APPLESMC_RETRY_WAIT);207207- outb(cmd, port);208208- }209209-210210- pr_warn("send_byte(0x%02x, 0x%04x) fail: 0x%02x\n", cmd, port, status);211211- return -EIO;199199+ return 0;212200}201201+202202+/* send_command - Write a command to the SMC. Callers must hold applesmc_lock. */213203214204static int send_command(u8 cmd)215205{216216- return send_byte(cmd, APPLESMC_CMD_PORT);206206+ int ret;207207+208208+ ret = wait_status(0, SMC_STATUS_IB_CLOSED);209209+ if (ret)210210+ return ret;211211+ outb(cmd, APPLESMC_CMD_PORT);212212+ return 0;213213+}214214+215215+/*216216+ * Based on logic from the Apple driver. This is issued before any interaction217217+ * If busy is stuck high, issue a read command to reset the SMC state machine.218218+ * If busy is stuck high after the command then the SMC is jammed.219219+ */220220+221221+static int smc_sane(void)222222+{223223+ int ret;224224+225225+ ret = wait_status(0, SMC_STATUS_BUSY);226226+ if (!ret)227227+ return ret;228228+ ret = send_command(APPLESMC_READ_CMD);229229+ if (ret)230230+ return ret;231231+ return wait_status(0, SMC_STATUS_BUSY);217232}218233219234static int send_argument(const char *key)···249226{250227 u8 status, data = 0;251228 int i;229229+ int ret;230230+231231+ ret = smc_sane();232232+ if (ret)233233+ return ret;252234253235 if (send_command(cmd) || send_argument(key)) {254236 pr_warn("%.4s: read arg fail\n", key);···267239 }268240269241 for (i = 0; i < len; i++) {270270- if (wait_read()) {242242+ if (wait_status(SMC_STATUS_AWAITING_DATA | SMC_STATUS_BUSY,243243+ SMC_STATUS_AWAITING_DATA | SMC_STATUS_BUSY)) {271244 pr_warn("%.4s: read data[%d] fail\n", key, i);272245 return -EIO;273246 }···279250 for (i = 0; i < 16; i++) {280251 udelay(APPLESMC_MIN_WAIT);281252 status = inb(APPLESMC_CMD_PORT);282282- if (!(status & 0x01))253253+ if (!(status & SMC_STATUS_AWAITING_DATA))283254 break;284255 data = inb(APPLESMC_DATA_PORT);285256 }286257 if (i)287258 pr_warn("flushed %d bytes, last value is: %d\n", i, data);288259289289- return 0;260260+ return wait_status(0, SMC_STATUS_BUSY);290261}291262292263static int write_smc(u8 cmd, const char *key, const u8 *buffer, u8 len)293264{294265 int i;266266+ int ret;267267+268268+ ret = smc_sane();269269+ if (ret)270270+ return ret;295271296272 if (send_command(cmd) || send_argument(key)) {297273 pr_warn("%s: write arg fail\n", key);···315281 }316282 }317283318318- return 0;284284+ return wait_status(0, SMC_STATUS_BUSY);319285}320286321287static int read_register_count(unsigned int *count)
+13-13
drivers/hwmon/pmbus/max20730.c
···122122 switch (idx) {123123 case MAX20730_DEBUGFS_VOUT_MIN:124124 ret = VOLT_FROM_REG(data->mfr_voutmin * 10000);125125- len = snprintf(tbuf, DEBUG_FS_DATA_MAX, "%d.%d\n",126126- ret / 10000, ret % 10000);125125+ len = scnprintf(tbuf, DEBUG_FS_DATA_MAX, "%d.%d\n",126126+ ret / 10000, ret % 10000);127127 break;128128 case MAX20730_DEBUGFS_FREQUENCY:129129 val = (data->mfr_devset1 & MAX20730_MFR_DEVSET1_FSW_MASK)···141141 ret = 800;142142 else143143 ret = 900;144144- len = snprintf(tbuf, DEBUG_FS_DATA_MAX, "%d\n", ret);144144+ len = scnprintf(tbuf, DEBUG_FS_DATA_MAX, "%d\n", ret);145145 break;146146 case MAX20730_DEBUGFS_PG_DELAY:147147 val = (data->mfr_devset1 & MAX20730_MFR_DEVSET1_TSTAT_MASK)···223223 case MAX20730_DEBUGFS_OC_PROTECT_MODE:224224 ret = (data->mfr_devset2 & MAX20730_MFR_DEVSET2_OCPM_MASK)225225 >> MAX20730_MFR_DEVSET2_OCPM_BIT_POS;226226- len = snprintf(tbuf, DEBUG_FS_DATA_MAX, "%d\n", ret);226226+ len = scnprintf(tbuf, DEBUG_FS_DATA_MAX, "%d\n", ret);227227 break;228228 case MAX20730_DEBUGFS_SS_TIMING:229229 val = (data->mfr_devset2 & MAX20730_MFR_DEVSET2_SS_MASK)···241241 case MAX20730_DEBUGFS_IMAX:242242 ret = (data->mfr_devset2 & MAX20730_MFR_DEVSET2_IMAX_MASK)243243 >> MAX20730_MFR_DEVSET2_IMAX_BIT_POS;244244- len = snprintf(tbuf, DEBUG_FS_DATA_MAX, "%d\n", ret);244244+ len = scnprintf(tbuf, DEBUG_FS_DATA_MAX, "%d\n", ret);245245 break;246246 case MAX20730_DEBUGFS_OPERATION:247247 ret = i2c_smbus_read_byte_data(psu->client, PMBUS_OPERATION);248248 if (ret < 0)249249 return ret;250250- len = snprintf(tbuf, DEBUG_FS_DATA_MAX, "%d\n", ret);250250+ len = scnprintf(tbuf, DEBUG_FS_DATA_MAX, "%d\n", ret);251251 break;252252 case MAX20730_DEBUGFS_ON_OFF_CONFIG:253253 ret = i2c_smbus_read_byte_data(psu->client, PMBUS_ON_OFF_CONFIG);254254 if (ret < 0)255255 return ret;256256- len = snprintf(tbuf, DEBUG_FS_DATA_MAX, "%d\n", ret);256256+ len = scnprintf(tbuf, DEBUG_FS_DATA_MAX, "%d\n", ret);257257 break;258258 case MAX20730_DEBUGFS_SMBALERT_MASK:259259 ret = i2c_smbus_read_word_data(psu->client,260260 PMBUS_SMB_ALERT_MASK);261261 if (ret < 0)262262 return ret;263263- len = snprintf(tbuf, DEBUG_FS_DATA_MAX, "%d\n", ret);263263+ len = scnprintf(tbuf, DEBUG_FS_DATA_MAX, "%d\n", ret);264264 break;265265 case MAX20730_DEBUGFS_VOUT_MODE:266266 ret = i2c_smbus_read_byte_data(psu->client, PMBUS_VOUT_MODE);267267 if (ret < 0)268268 return ret;269269- len = snprintf(tbuf, DEBUG_FS_DATA_MAX, "%d\n", ret);269269+ len = scnprintf(tbuf, DEBUG_FS_DATA_MAX, "%d\n", ret);270270 break;271271 case MAX20730_DEBUGFS_VOUT_COMMAND:272272 ret = i2c_smbus_read_word_data(psu->client, PMBUS_VOUT_COMMAND);···274274 return ret;275275276276 ret = VOLT_FROM_REG(ret * 10000);277277- len = snprintf(tbuf, DEBUG_FS_DATA_MAX,278278- "%d.%d\n", ret / 10000, ret % 10000);277277+ len = scnprintf(tbuf, DEBUG_FS_DATA_MAX,278278+ "%d.%d\n", ret / 10000, ret % 10000);279279 break;280280 case MAX20730_DEBUGFS_VOUT_MAX:281281 ret = i2c_smbus_read_word_data(psu->client, PMBUS_VOUT_MAX);···283283 return ret;284284285285 ret = VOLT_FROM_REG(ret * 10000);286286- len = snprintf(tbuf, DEBUG_FS_DATA_MAX,287287- "%d.%d\n", ret / 10000, ret % 10000);286286+ len = scnprintf(tbuf, DEBUG_FS_DATA_MAX,287287+ "%d.%d\n", ret / 10000, ret % 10000);288288 break;289289 default:290290 len = strlcpy(tbuf, "Invalid\n", DEBUG_FS_DATA_MAX);
···7373 This allows the user to config the default GID type that the CM7474 uses for each device, when initiaing new connections.75757676+config INFINIBAND_VIRT_DMA7777+ def_bool !HIGHMEM7878+7679if INFINIBAND_USER_ACCESS || !INFINIBAND_USER_ACCESS7780source "drivers/infiniband/hw/mthca/Kconfig"7881source "drivers/infiniband/hw/qib/Kconfig"
···266266 }267267 ret = ib_device_set_netdev(&dev->ib_dev, dev->netdev, 1);268268 if (ret)269269- return ret;269269+ goto err_srq_free;270270 spin_lock_init(&dev->srq_tbl_lock);271271 rdma_set_device_sysfs_group(&dev->ib_dev, &pvrdma_attr_group);272272
+2-1
drivers/infiniband/sw/rdmavt/Kconfig
···11# SPDX-License-Identifier: GPL-2.0-only22config INFINIBAND_RDMAVT33 tristate "RDMA verbs transport library"44- depends on X86_64 && ARCH_DMA_ADDR_T_64BIT44+ depends on INFINIBAND_VIRT_DMA55+ depends on X86_6456 depends on PCI67 select DMA_VIRT_OPS78 help
+1-1
drivers/infiniband/sw/rxe/Kconfig
···22config RDMA_RXE33 tristate "Software RDMA over Ethernet (RoCE) driver"44 depends on INET && PCI && INFINIBAND55- depends on !64BIT || ARCH_DMA_ADDR_T_64BIT55+ depends on INFINIBAND_VIRT_DMA66 select NET_UDP_TUNNEL77 select CRYPTO_CRC3288 select DMA_VIRT_OPS
+1
drivers/infiniband/sw/siw/Kconfig
···11config RDMA_SIW22 tristate "Software RDMA over TCP/IP (iWARP) driver"33 depends on INET && INFINIBAND && LIBCRC32C44+ depends on INFINIBAND_VIRT_DMA45 select DMA_VIRT_OPS56 help67 This driver implements the iWARP RDMA transport over
+33-8
drivers/input/keyboard/sunkbd.c
···9999 switch (data) {100100101101 case SUNKBD_RET_RESET:102102- schedule_work(&sunkbd->tq);102102+ if (sunkbd->enabled)103103+ schedule_work(&sunkbd->tq);103104 sunkbd->reset = -1;104105 break;105106···201200}202201203202/*204204- * sunkbd_reinit() sets leds and beeps to a state the computer remembers they205205- * were in.203203+ * sunkbd_set_leds_beeps() sets leds and beeps to a state the computer remembers204204+ * they were in.206205 */207206208208-static void sunkbd_reinit(struct work_struct *work)207207+static void sunkbd_set_leds_beeps(struct sunkbd *sunkbd)209208{210210- struct sunkbd *sunkbd = container_of(work, struct sunkbd, tq);211211-212212- wait_event_interruptible_timeout(sunkbd->wait, sunkbd->reset >= 0, HZ);213213-214209 serio_write(sunkbd->serio, SUNKBD_CMD_SETLED);215210 serio_write(sunkbd->serio,216211 (!!test_bit(LED_CAPSL, sunkbd->dev->led) << 3) |···219222 SUNKBD_CMD_BELLOFF - !!test_bit(SND_BELL, sunkbd->dev->snd));220223}221224225225+226226+/*227227+ * sunkbd_reinit() wait for the keyboard reset to complete and restores state228228+ * of leds and beeps.229229+ */230230+231231+static void sunkbd_reinit(struct work_struct *work)232232+{233233+ struct sunkbd *sunkbd = container_of(work, struct sunkbd, tq);234234+235235+ /*236236+ * It is OK that we check sunkbd->enabled without pausing serio,237237+ * as we only want to catch true->false transition that will238238+ * happen once and we will be woken up for it.239239+ */240240+ wait_event_interruptible_timeout(sunkbd->wait,241241+ sunkbd->reset >= 0 || !sunkbd->enabled,242242+ HZ);243243+244244+ if (sunkbd->reset >= 0 && sunkbd->enabled)245245+ sunkbd_set_leds_beeps(sunkbd);246246+}247247+222248static void sunkbd_enable(struct sunkbd *sunkbd, bool enable)223249{224250 serio_pause_rx(sunkbd->serio);225251 sunkbd->enabled = enable;226252 serio_continue_rx(sunkbd->serio);253253+254254+ if (!enable) {255255+ wake_up_interruptible(&sunkbd->wait);256256+ cancel_work_sync(&sunkbd->tq);257257+ }227258}228259229260/*
+1-1
drivers/input/misc/adxl34x.c
···696696 struct input_dev *input_dev;697697 const struct adxl34x_platform_data *pdata;698698 int err, range, i;699699- unsigned char revid;699699+ int revid;700700701701 if (!irq) {702702 dev_err(dev, "no IRQ?\n");
+1-1
drivers/input/mouse/elan_i2c.h
···7878 int (*iap_reset)(struct i2c_client *client);79798080 int (*prepare_fw_update)(struct i2c_client *client, u16 ic_type,8181- u8 iap_version);8181+ u8 iap_version, u16 fw_page_size);8282 int (*write_fw_block)(struct i2c_client *client, u16 fw_page_size,8383 const u8 *page, u16 checksum, int idx);8484 int (*finish_fw_update)(struct i2c_client *client,
···517517 return 0;518518}519519520520-static int elan_read_write_iap_type(struct i2c_client *client)520520+static int elan_read_write_iap_type(struct i2c_client *client, u16 fw_page_size)521521{522522 int error;523523 u16 constant;···526526527527 do {528528 error = elan_i2c_write_cmd(client, ETP_I2C_IAP_TYPE_CMD,529529- ETP_I2C_IAP_TYPE_REG);529529+ fw_page_size / 2);530530 if (error) {531531 dev_err(&client->dev,532532 "cannot write iap type: %d\n", error);···543543 constant = le16_to_cpup((__le16 *)val);544544 dev_dbg(&client->dev, "iap type reg: 0x%04x\n", constant);545545546546- if (constant == ETP_I2C_IAP_TYPE_REG)546546+ if (constant == fw_page_size / 2)547547 return 0;548548549549 } while (--retry > 0);···553553}554554555555static int elan_i2c_prepare_fw_update(struct i2c_client *client, u16 ic_type,556556- u8 iap_version)556556+ u8 iap_version, u16 fw_page_size)557557{558558 struct device *dev = &client->dev;559559 int error;···594594 }595595596596 if (ic_type >= 0x0D && iap_version >= 1) {597597- error = elan_read_write_iap_type(client);597597+ error = elan_read_write_iap_type(client, fw_page_size);598598 if (error)599599 return error;600600 }
+1-1
drivers/input/mouse/elan_i2c_smbus.c
···340340}341341342342static int elan_smbus_prepare_fw_update(struct i2c_client *client, u16 ic_type,343343- u8 iap_version)343343+ u8 iap_version, u16 fw_page_size)344344{345345 struct device *dev = &client->dev;346346 int len;
+11-1
drivers/input/serio/i8042.c
···122122MODULE_PARM_DESC(unmask_kbd_data, "Unconditional enable (may reveal sensitive data) of normally sanitize-filtered kbd data traffic debug log [pre-condition: i8042.debug=1 enabled]");123123#endif124124125125+static bool i8042_present;125126static bool i8042_bypass_aux_irq_test;126127static char i8042_kbd_firmware_id[128];127128static char i8042_aux_firmware_id[128];···343342{344343 unsigned long flags;345344 int retval;345345+346346+ if (!i8042_present)347347+ return -1;346348347349 spin_lock_irqsave(&i8042_lock, flags);348350 retval = __i8042_command(param, command);···1616161216171613 err = i8042_platform_init();16181614 if (err)16191619- return err;16151615+ return (err == -ENODEV) ? 0 : err;1620161616211617 err = i8042_controller_check();16221618 if (err)16231619 goto err_platform_exit;16201620+16211621+ /* Set this before creating the dev to allow i8042_command to work right away */16221622+ i8042_present = true;1624162316251624 pdev = platform_create_bundle(&i8042_driver, i8042_probe, NULL, 0, NULL, 0);16261625 if (IS_ERR(pdev)) {···1643163616441637static void __exit i8042_exit(void)16451638{16391639+ if (!i8042_present)16401640+ return;16411641+16461642 platform_device_unregister(i8042_platform_device);16471643 platform_driver_unregister(&i8042_driver);16481644 i8042_platform_exit();
+1
drivers/input/touchscreen/Kconfig
···9696config TOUCHSCREEN_ADC9797 tristate "Generic ADC based resistive touchscreen"9898 depends on IIO9999+ select IIO_BUFFER99100 select IIO_BUFFER_CB100101 help101102 Say Y here if you want to use the generic ADC
+18-1
drivers/iommu/intel/dmar.c
···333333 dmar_iommu_notify_scope_dev(info);334334}335335336336+static inline void vf_inherit_msi_domain(struct pci_dev *pdev)337337+{338338+ dev_set_msi_domain(&pdev->dev, dev_get_msi_domain(&pdev->physfn->dev));339339+}340340+336341static int dmar_pci_bus_notifier(struct notifier_block *nb,337342 unsigned long action, void *data)338343{···347342 /* Only care about add/remove events for physical functions.348343 * For VFs we actually do the lookup based on the corresponding349344 * PF in device_to_iommu() anyway. */350350- if (pdev->is_virtfn)345345+ if (pdev->is_virtfn) {346346+ /*347347+ * Ensure that the VF device inherits the irq domain of the348348+ * PF device. Ideally the device would inherit the domain349349+ * from the bus, but DMAR can have multiple units per bus350350+ * which makes this impossible. The VF 'bus' could inherit351351+ * from the PF device, but that's yet another x86'sism to352352+ * inflict on everybody else.353353+ */354354+ if (action == BUS_NOTIFY_ADD_DEVICE)355355+ vf_inherit_msi_domain(pdev);351356 return NOTIFY_DONE;357357+ }358358+352359 if (action != BUS_NOTIFY_ADD_DEVICE &&353360 action != BUS_NOTIFY_REMOVED_DEVICE)354361 return NOTIFY_DONE;
···182182 *183183 * @cl: host client184184 *185185- * Return: mtu185185+ * Return: mtu or 0 if client is not connected186186 */187187static inline size_t mei_cl_mtu(const struct mei_cl *cl)188188{189189- return cl->me_cl->props.max_msg_length;189189+ return cl->me_cl ? cl->me_cl->props.max_msg_length : 0;190190}191191192192/**
+1-13
drivers/mmc/host/renesas_sdhi_core.c
···572572 TMIO_MASK_INIT_RCAR2);573573}574574575575-/*576576- * This is a temporary workaround! This driver used 'hw_reset' wrongly and the577577- * fix for that showed a regression. So, we mimic the old behaviour until the578578- * proper solution is found.579579- */580580-static void renesas_sdhi_hw_reset(struct mmc_host *mmc)581581-{582582- struct tmio_mmc_host *host = mmc_priv(mmc);583583- renesas_sdhi_reset(host);584584-}585585-586575#define SH_MOBILE_SDHI_MIN_TAP_ROW 3587576588577static int renesas_sdhi_select_tuning(struct tmio_mmc_host *host)···10091020 if (of_data && of_data->scc_offset) {10101021 priv->scc_ctl = host->ctl + of_data->scc_offset;10111022 host->reset = renesas_sdhi_reset;10121012- host->ops.hw_reset = renesas_sdhi_hw_reset;10131013- host->mmc->caps |= MMC_CAP_HW_RESET;10141023 }10151024 }10161025···1147116011481161 tmio_mmc_host_remove(host);11491162 renesas_sdhi_clk_disable(host);11631163+ tmio_mmc_host_free(host);1150116411511165 return 0;11521166}
···16161717config CAN_M_CAN_TCAN4X5X1818 depends on CAN_M_CAN1919- depends on REGMAP_SPI1919+ depends on SPI2020+ select REGMAP_SPI2021 tristate "TCAN4X5X M_CAN device"2122 help2223 Say Y here if you want support for Texas Instruments TCAN4x5x
+13-5
drivers/net/can/m_can/m_can.c
···665665 unsigned int ecr;666666667667 switch (new_state) {668668- case CAN_STATE_ERROR_ACTIVE:668668+ case CAN_STATE_ERROR_WARNING:669669 /* error warning state */670670 cdev->can.can_stats.error_warning++;671671 cdev->can.state = CAN_STATE_ERROR_WARNING;···694694 __m_can_get_berr_counter(dev, &bec);695695696696 switch (new_state) {697697- case CAN_STATE_ERROR_ACTIVE:697697+ case CAN_STATE_ERROR_WARNING:698698 /* error warning state */699699 cf->can_id |= CAN_ERR_CRTL;700700 cf->data[1] = (bec.txerr > bec.rxerr) ?···956956 struct net_device_stats *stats = &dev->stats;957957 u32 ir;958958959959+ if (pm_runtime_suspended(cdev->dev))960960+ return IRQ_NONE;959961 ir = m_can_read(cdev, M_CAN_IR);960962 if (!ir)961963 return IRQ_NONE;···14161414 /* disable all interrupts */14171415 m_can_disable_all_interrupts(cdev);1418141614171417+ /* Set init mode to disengage from the network */14181418+ m_can_config_endisable(cdev, true);14191419+14191420 /* set the state as STOPPED */14201421 cdev->can.state = CAN_STATE_STOPPED;14211422}···18171812}18181813EXPORT_SYMBOL_GPL(m_can_class_allocate_dev);1819181418151815+void m_can_class_free_dev(struct net_device *net)18161816+{18171817+ free_candev(net);18181818+}18191819+EXPORT_SYMBOL_GPL(m_can_class_free_dev);18201820+18201821int m_can_class_register(struct m_can_classdev *m_can_dev)18211822{18221823 int ret;···18611850 if (ret) {18621851 if (m_can_dev->pm_clock_support)18631852 pm_runtime_disable(m_can_dev->dev);18641864- free_candev(m_can_dev->net);18651853 }1866185418671855 return ret;···19181908 unregister_candev(m_can_dev->net);1919190919201910 m_can_clk_stop(m_can_dev);19211921-19221922- free_candev(m_can_dev->net);19231911}19241912EXPORT_SYMBOL_GPL(m_can_class_unregister);19251913
···326326 if (!ctx)327327 return NETDEV_TX_BUSY;328328329329- can_put_echo_skb(skb, priv->netdev, ctx->ndx);330330-331329 if (cf->can_id & CAN_EFF_FLAG) {332330 /* SIDH | SIDL | EIDH | EIDL333331 * 28 - 21 | 20 19 18 x x x 17 16 | 15 - 8 | 7 - 0···354356355357 if (cf->can_id & CAN_RTR_FLAG)356358 usb_msg.dlc |= MCBA_DLC_RTR_MASK;359359+360360+ can_put_echo_skb(skb, priv->netdev, ctx->ndx);357361358362 err = mcba_usb_xmit(priv, (struct mcba_usb_msg *)&usb_msg, ctx);359363 if (err)
+2-2
drivers/net/can/usb/peak_usb/pcan_usb_core.c
···156156 if (time_ref->ts_dev_1 < time_ref->ts_dev_2) {157157 /* case when event time (tsw) wraps */158158 if (ts < time_ref->ts_dev_1)159159- delta_ts = 1 << time_ref->adapter->ts_used_bits;159159+ delta_ts = BIT_ULL(time_ref->adapter->ts_used_bits);160160161161 /* Otherwise, sync time counter (ts_dev_2) has wrapped:162162 * handle case when event time (tsn) hasn't.···168168 * tsn ts169169 */170170 } else if (time_ref->ts_dev_1 < ts) {171171- delta_ts = -(1 << time_ref->adapter->ts_used_bits);171171+ delta_ts = -BIT_ULL(time_ref->adapter->ts_used_bits);172172 }173173174174 /* add delay between last sync and event timestamps */
+11
drivers/net/dsa/lantiq_gswip.c
···2626 */27272828#include <linux/clk.h>2929+#include <linux/delay.h>2930#include <linux/etherdevice.h>3031#include <linux/firmware.h>3132#include <linux/if_bridge.h>···18371836 goto remove_gphy;18381837 i++;18391838 }18391839+18401840+ /* The standalone PHY11G requires 300ms to be fully18411841+ * initialized and ready for any MDIO communication after being18421842+ * taken out of reset. For the SoC-internal GPHY variant there18431843+ * is no (known) documentation for the minimum time after a18441844+ * reset. Use the same value as for the standalone variant as18451845+ * some users have reported internal PHYs not being detected18461846+ * without any delay.18471847+ */18481848+ msleep(300);1840184918411850 return 0;18421851
···7575 return mv88e6xxx_g1_wait_bit(chip, MV88E6XXX_G1_STS, bit, 1);7676}77777878+void mv88e6xxx_g1_wait_eeprom_done(struct mv88e6xxx_chip *chip)7979+{8080+ const unsigned long timeout = jiffies + 1 * HZ;8181+ u16 val;8282+ int err;8383+8484+ /* Wait up to 1 second for the switch to finish reading the8585+ * EEPROM.8686+ */8787+ while (time_before(jiffies, timeout)) {8888+ err = mv88e6xxx_g1_read(chip, MV88E6XXX_G1_STS, &val);8989+ if (err) {9090+ dev_err(chip->dev, "Error reading status");9191+ return;9292+ }9393+9494+ /* If the switch is still resetting, it may not9595+ * respond on the bus, and so MDIO read returns9696+ * 0xffff. Differentiate between that, and waiting for9797+ * the EEPROM to be done by bit 0 being set.9898+ */9999+ if (val != 0xffff &&100100+ val & BIT(MV88E6XXX_G1_STS_IRQ_EEPROM_DONE))101101+ return;102102+103103+ usleep_range(1000, 2000);104104+ }105105+106106+ dev_err(chip->dev, "Timeout waiting for EEPROM done");107107+}108108+78109/* Offset 0x01: Switch MAC Address Register Bytes 0 & 179110 * Offset 0x02: Switch MAC Address Register Bytes 2 & 380111 * Offset 0x03: Switch MAC Address Register Bytes 4 & 5
···676676 if (err)677677 return err;678678679679- if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(30))) {679679+ err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(30));680680+ if (err) {680681 dev_err(&pdev->dev, "fail to set DMA mask\n");681682 goto err_dma_mask;682683 }···703702 dev_info(fw->dev.dev, "Prestera FW is ready\n");704703705704 fw->wq = alloc_workqueue("prestera_fw_wq", WQ_HIGHPRI, 1);706706- if (!fw->wq)705705+ if (!fw->wq) {706706+ err = -ENOMEM;707707 goto err_wq_alloc;708708+ }708709709710 INIT_WORK(&fw->evt_work, prestera_fw_evt_work_fn);710711
+2-1
drivers/net/ethernet/mediatek/mtk_star_emac.c
···966966 mtk_star_adjust_link, 0, priv->phy_intf);967967 if (!priv->phydev) {968968 netdev_err(ndev, "failed to connect to PHY\n");969969+ ret = -ENODEV;969970 goto err_free_irq;970971 }971972···10541053err_drop_packet:10551054 dev_kfree_skb(skb);10561055 ndev->stats.tx_dropped++;10571057- return NETDEV_TX_BUSY;10561056+ return NETDEV_TX_OK;10581057}1059105810601059/* Returns the number of bytes sent or a negative number on the first
···187187 struct mlx5e_priv *priv;188188189189 /* A given netdev is not a representor or not a slave of LAG configuration */190190- if (!mlx5e_eswitch_rep(netdev) || !bond_slave_get_rtnl(netdev))190190+ if (!mlx5e_eswitch_rep(netdev) || !netif_is_lag_port(netdev))191191 return false;192192193193 priv = netdev_priv(netdev);
···326326327327 /* SRC T2 */328328 struct qed_src_t2 src_t2;329329- u32 t2_num_pages;330330- u64 first_free;331331- u64 last_free;332329333330 /* total number of SRQ's for this hwfn */334331 u32 srq_count;
+9-3
drivers/net/ethernet/qlogic/qed/qed_iwarp.c
···27542754 iwarp_info->partial_fpdus = kcalloc((u16)p_hwfn->p_rdma_info->num_qps,27552755 sizeof(*iwarp_info->partial_fpdus),27562756 GFP_KERNEL);27572757- if (!iwarp_info->partial_fpdus)27572757+ if (!iwarp_info->partial_fpdus) {27582758+ rc = -ENOMEM;27582759 goto err;27602760+ }2759276127602762 iwarp_info->max_num_partial_fpdus = (u16)p_hwfn->p_rdma_info->num_qps;2761276327622764 iwarp_info->mpa_intermediate_buf = kzalloc(buff_size, GFP_KERNEL);27632763- if (!iwarp_info->mpa_intermediate_buf)27652765+ if (!iwarp_info->mpa_intermediate_buf) {27662766+ rc = -ENOMEM;27642767 goto err;27682768+ }2765276927662770 /* The mpa_bufs array serves for pending RX packets received on the27672771 * mpa ll2 that don't have place on the tx ring and require later···27752771 iwarp_info->mpa_bufs = kcalloc(data.input.rx_num_desc,27762772 sizeof(*iwarp_info->mpa_bufs),27772773 GFP_KERNEL);27782778- if (!iwarp_info->mpa_bufs)27742774+ if (!iwarp_info->mpa_bufs) {27752775+ rc = -ENOMEM;27792776 goto err;27772777+ }2780277827812779 INIT_LIST_HEAD(&iwarp_info->mpa_buf_pending_list);27822780 INIT_LIST_HEAD(&iwarp_info->mpa_buf_list);
···2231223122322232 /* Boot either flash image or firmware image from host file system */22332233 if (qlcnic_load_fw_file == 1) {22342234- if (qlcnic_83xx_load_fw_image_from_host(adapter))22342234+ err = qlcnic_83xx_load_fw_image_from_host(adapter);22352235+ if (err)22352236 return err;22362237 } else {22372238 QLC_SHARED_REG_WR32(adapter, QLCNIC_FW_IMG_VALID,
···188188189189 dev = skb->dev;190190 port = rmnet_get_port_rcu(dev);191191+ if (unlikely(!port)) {192192+ atomic_long_inc(&skb->dev->rx_nohandler);193193+ kfree_skb(skb);194194+ goto done;195195+ }191196192197 switch (port->rmnet_mode) {193198 case RMNET_EPMODE_VND:
···362362 return trans;363363}364364365365-/* Free a previously-allocated transaction (used only in case of error) */365365+/* Free a previously-allocated transaction */366366void gsi_trans_free(struct gsi_trans *trans)367367{368368+ refcount_t *refcount = &trans->refcount;368369 struct gsi_trans_info *trans_info;370370+ bool last;369371370370- if (!refcount_dec_and_test(&trans->refcount))372372+ /* We must hold the lock to release the last reference */373373+ if (refcount_dec_not_one(refcount))371374 return;372375373376 trans_info = &trans->gsi->channel[trans->channel_id].trans_info;374377375378 spin_lock_bh(&trans_info->spinlock);376379377377- list_del(&trans->links);380380+ /* Reference might have been added before we got the lock */381381+ last = refcount_dec_and_test(refcount);382382+ if (last)383383+ list_del(&trans->links);378384379385 spin_unlock_bh(&trans_info->spinlock);386386+387387+ if (!last)388388+ return;380389381390 ipa_gsi_trans_release(trans);382391
···981981982982 switch (phydev->phy_id & phydev->drv->phy_id_mask) {983983 case PHY_ID_VSC856X:984984- case PHY_ID_VSC8575:985984 case PHY_ID_VSC8582:986985 case PHY_ID_VSC8584:987986 INIT_LIST_HEAD(&vsc8531->macsec_flows);
+3-1
drivers/net/phy/smsc.c
···324324 return ret;325325326326 ret = clk_set_rate(priv->refclk, 50 * 1000 * 1000);327327- if (ret)327327+ if (ret) {328328+ clk_disable_unprepare(priv->refclk);328329 return ret;330330+ }329331330332 return 0;331333}
+2-1
drivers/net/usb/cx82310_eth.c
···197197 }198198199199 /* enable ethernet mode (?) */200200- if (cx82310_enable_ethernet(dev))200200+ ret = cx82310_enable_ethernet(dev);201201+ if (ret)201202 goto err;202203203204 /* get the MAC address */
···10341034 */10351035bool of_dma_is_coherent(struct device_node *np)10361036{10371037- struct device_node *node = of_node_get(np);10371037+ struct device_node *node;1038103810391039 if (IS_ENABLED(CONFIG_OF_DMA_DEFAULT_COHERENT))10401040 return true;10411041+10421042+ node = of_node_get(np);1041104310421044 while (node) {10431045 if (of_property_read_bool(node, "dma-coherent")) {
+4-3
drivers/pinctrl/aspeed/pinctrl-aspeed.c
···286286static bool aspeed_expr_is_gpio(const struct aspeed_sig_expr *expr)287287{288288 /*289289- * The signal type is GPIO if the signal name has "GPIO" as a prefix.289289+ * The signal type is GPIO if the signal name has "GPI" as a prefix.290290 * strncmp (rather than strcmp) is used to implement the prefix291291 * requirement.292292 *293293- * expr->signal might look like "GPIOT3" in the GPIO case.293293+ * expr->signal might look like "GPIOB1" in the GPIO case.294294+ * expr->signal might look like "GPIT0" in the GPI case.294295 */295295- return strncmp(expr->signal, "GPIO", 4) == 0;296296+ return strncmp(expr->signal, "GPI", 3) == 0;296297}297298298299static bool aspeed_gpio_in_exprs(const struct aspeed_sig_expr **exprs)
+30-10
drivers/pinctrl/intel/pinctrl-intel.c
···6262#define PADCFG1_TERM_UP BIT(13)6363#define PADCFG1_TERM_SHIFT 106464#define PADCFG1_TERM_MASK GENMASK(12, 10)6565-#define PADCFG1_TERM_20K 46666-#define PADCFG1_TERM_2K 36767-#define PADCFG1_TERM_5K 26868-#define PADCFG1_TERM_1K 16565+#define PADCFG1_TERM_20K BIT(2)6666+#define PADCFG1_TERM_5K BIT(1)6767+#define PADCFG1_TERM_1K BIT(0)6868+#define PADCFG1_TERM_833 (BIT(1) | BIT(0))69697070#define PADCFG2 0x0087171#define PADCFG2_DEBEN BIT(0)···549549 return -EINVAL;550550551551 switch (term) {552552+ case PADCFG1_TERM_833:553553+ *arg = 833;554554+ break;552555 case PADCFG1_TERM_1K:553556 *arg = 1000;554554- break;555555- case PADCFG1_TERM_2K:556556- *arg = 2000;557557 break;558558 case PADCFG1_TERM_5K:559559 *arg = 5000;···570570 return -EINVAL;571571572572 switch (term) {573573+ case PADCFG1_TERM_833:574574+ if (!(community->features & PINCTRL_FEATURE_1K_PD))575575+ return -EINVAL;576576+ *arg = 833;577577+ break;573578 case PADCFG1_TERM_1K:574579 if (!(community->features & PINCTRL_FEATURE_1K_PD))575580 return -EINVAL;···683678684679 value |= PADCFG1_TERM_UP;685680681681+ /* Set default strength value in case none is given */682682+ if (arg == 1)683683+ arg = 5000;684684+686685 switch (arg) {687686 case 20000:688687 value |= PADCFG1_TERM_20K << PADCFG1_TERM_SHIFT;···694685 case 5000:695686 value |= PADCFG1_TERM_5K << PADCFG1_TERM_SHIFT;696687 break;697697- case 2000:698698- value |= PADCFG1_TERM_2K << PADCFG1_TERM_SHIFT;699699- break;700688 case 1000:701689 value |= PADCFG1_TERM_1K << PADCFG1_TERM_SHIFT;690690+ break;691691+ case 833:692692+ value |= PADCFG1_TERM_833 << PADCFG1_TERM_SHIFT;702693 break;703694 default:704695 ret = -EINVAL;···708699709700 case PIN_CONFIG_BIAS_PULL_DOWN:710701 value &= ~(PADCFG1_TERM_UP | PADCFG1_TERM_MASK);702702+703703+ /* Set default strength value in case none is given */704704+ if (arg == 1)705705+ arg = 5000;711706712707 switch (arg) {713708 case 20000:···726713 break;727714 }728715 value |= PADCFG1_TERM_1K << PADCFG1_TERM_SHIFT;716716+ break;717717+ case 833:718718+ if (!(community->features & PINCTRL_FEATURE_1K_PD)) {719719+ ret = -EINVAL;720720+ break;721721+ }722722+ value |= PADCFG1_TERM_833 << PADCFG1_TERM_SHIFT;729723 break;730724 default:731725 ret = -EINVAL;
···31553155 if (!bank->domain)31563156 return -ENXIO;3157315731583158+ clk_enable(bank->clk);31583159 virq = irq_create_mapping(bank->domain, offset);31603160+ clk_disable(bank->clk);3159316131603162 return (virq) ? : -ENXIO;31613163}···3196319431973195 irq = __ffs(pend);31983196 pend &= ~BIT(irq);31993199- virq = irq_linear_revmap(bank->domain, irq);31973197+ virq = irq_find_mapping(bank->domain, irq);3200319832013199 if (!virq) {32023200 dev_err(bank->drvdata->dev, "unmapped irq %d\n", irq);···33753373 unsigned int clr = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;33763374 struct irq_chip_generic *gc;33773375 int ret;33783378- int i, j;33763376+ int i;3379337733803378 for (i = 0; i < ctrl->nr_banks; ++i, ++bank) {33813379 if (!bank->valid) {···3402340034033401 ret = irq_alloc_domain_generic_chips(bank->domain, 32, 1,34043402 "rockchip_gpio_irq", handle_level_irq,34053405- clr, 0, IRQ_GC_INIT_MASK_CACHE);34033403+ clr, 0, 0);34063404 if (ret) {34073405 dev_err(&pdev->dev, "could not alloc generic chips for bank %s\n",34083406 bank->name);···34103408 clk_disable(bank->clk);34113409 continue;34123410 }34133413-34143414- /*34153415- * Linux assumes that all interrupts start out disabled/masked.34163416- * Our driver only uses the concept of masked and always keeps34173417- * things enabled, so for us that's all masked and all enabled.34183418- */34193419- writel_relaxed(0xffffffff, bank->reg_base + GPIO_INTMASK);34203420- writel_relaxed(0xffffffff, bank->reg_base + GPIO_INTEN);3421341134223412 gc = irq_get_domain_generic_chip(bank->domain, 0);34233413 gc->reg_base = bank->reg_base;···34273433 gc->chip_types[0].chip.irq_set_type = rockchip_irq_set_type;34283434 gc->wake_enabled = IRQ_MSK(bank->nr_pins);3429343534363436+ /*34373437+ * Linux assumes that all interrupts start out disabled/masked.34383438+ * Our driver only uses the concept of masked and always keeps34393439+ * things enabled, so for us that's all masked and all enabled.34403440+ */34413441+ writel_relaxed(0xffffffff, bank->reg_base + GPIO_INTMASK);34423442+ writel_relaxed(0xffffffff, bank->reg_base + GPIO_INTEN);34433443+ gc->mask_cache = 0xffffffff;34443444+34303445 irq_set_chained_handler_and_data(bank->irq,34313446 rockchip_irq_demux, bank);34323432-34333433- /* map the gpio irqs here, when the clock is still running */34343434- for (j = 0 ; j < 32 ; j++)34353435- irq_create_mapping(bank->domain, j);34363436-34373447 clk_disable(bank->clk);34383448 }34393449
+20-14
drivers/pinctrl/qcom/pinctrl-msm.c
···815815816816static void msm_gpio_irq_enable(struct irq_data *d)817817{818818- /*819819- * Clear the interrupt that may be pending before we enable820820- * the line.821821- * This is especially a problem with the GPIOs routed to the822822- * PDC. These GPIOs are direct-connect interrupts to the GIC.823823- * Disabling the interrupt line at the PDC does not prevent824824- * the interrupt from being latched at the GIC. The state at825825- * GIC needs to be cleared before enabling.826826- */827827- if (d->parent_data) {828828- irq_chip_set_parent_state(d, IRQCHIP_STATE_PENDING, 0);829829- irq_chip_enable_parent(d);830830- }818818+ struct gpio_chip *gc = irq_data_get_irq_chip_data(d);819819+ struct msm_pinctrl *pctrl = gpiochip_get_data(gc);831820832832- msm_gpio_irq_clear_unmask(d, true);821821+ if (d->parent_data)822822+ irq_chip_enable_parent(d);823823+824824+ if (!test_bit(d->hwirq, pctrl->skip_wake_irqs))825825+ msm_gpio_irq_clear_unmask(d, true);833826}834827835828static void msm_gpio_irq_disable(struct irq_data *d)···10971104 ret = -EINVAL;10981105 goto out;10991106 }11071107+11081108+ /*11091109+ * Clear the interrupt that may be pending before we enable11101110+ * the line.11111111+ * This is especially a problem with the GPIOs routed to the11121112+ * PDC. These GPIOs are direct-connect interrupts to the GIC.11131113+ * Disabling the interrupt line at the PDC does not prevent11141114+ * the interrupt from being latched at the GIC. The state at11151115+ * GIC needs to be cleared before enabling.11161116+ */11171117+ if (d->parent_data && test_bit(d->hwirq, pctrl->skip_wake_irqs))11181118+ irq_chip_set_parent_state(d, IRQCHIP_STATE_PENDING, 0);11191119+11001120 return 0;11011121out:11021122 module_put(gc->owner);
···13151315/**13161316 * set_machine_constraints - sets regulator constraints13171317 * @rdev: regulator source13181318- * @constraints: constraints to apply13191318 *13201319 * Allows platform initialisation code to define and constrain13211320 * regulator circuits e.g. valid voltage/current ranges, etc. NOTE:···13221323 * regulator operations to proceed i.e. set_voltage, set_current_limit,13231324 * set_mode.13241325 */13251325-static int set_machine_constraints(struct regulator_dev *rdev,13261326- const struct regulation_constraints *constraints)13261326+static int set_machine_constraints(struct regulator_dev *rdev)13271327{13281328 int ret = 0;13291329 const struct regulator_ops *ops = rdev->desc->ops;13301330-13311331- if (constraints)13321332- rdev->constraints = kmemdup(constraints, sizeof(*constraints),13331333- GFP_KERNEL);13341334- else13351335- rdev->constraints = kzalloc(sizeof(*constraints),13361336- GFP_KERNEL);13371337- if (!rdev->constraints)13381338- return -ENOMEM;1339133013401331 ret = machine_constraints_voltage(rdev, rdev->constraints);13411332 if (ret != 0)···18391850 rdev->supply_name, rdev->desc->name);18401851 return -EPROBE_DEFER;18411852 }18531853+ }18541854+18551855+ if (r == rdev) {18561856+ dev_err(dev, "Supply for %s (%s) resolved to itself\n",18571857+ rdev->desc->name, rdev->supply_name);18581858+ if (!have_full_constraints())18591859+ return -EINVAL;18601860+ r = dummy_regulator_rdev;18611861+ get_device(&r->dev);18421862 }1843186318441864 /*···51445146regulator_register(const struct regulator_desc *regulator_desc,51455147 const struct regulator_config *cfg)51465148{51475147- const struct regulation_constraints *constraints = NULL;51485149 const struct regulator_init_data *init_data;51495150 struct regulator_config *config = NULL;51505151 static atomic_t regulator_no = ATOMIC_INIT(-1);···5282528552835286 /* set regulator constraints */52845287 if (init_data)52855285- constraints = &init_data->constraints;52885288+ rdev->constraints = kmemdup(&init_data->constraints,52895289+ sizeof(*rdev->constraints),52905290+ GFP_KERNEL);52915291+ else52925292+ rdev->constraints = kzalloc(sizeof(*rdev->constraints),52935293+ GFP_KERNEL);52945294+ if (!rdev->constraints) {52955295+ ret = -ENOMEM;52965296+ goto wash;52975297+ }5286529852875299 if (init_data && init_data->supply_regulator)52885300 rdev->supply_name = init_data->supply_regulator;52895301 else if (regulator_desc->supply_name)52905302 rdev->supply_name = regulator_desc->supply_name;5291530352925292- ret = set_machine_constraints(rdev, constraints);53045304+ ret = set_machine_constraints(rdev);52935305 if (ret == -EPROBE_DEFER) {52945306 /* Regulator might be in bypass mode and so needs its supply52955307 * to set the constraints */···53075301 * that is just being created */53085302 ret = regulator_resolve_supply(rdev);53095303 if (!ret)53105310- ret = set_machine_constraints(rdev, constraints);53045304+ ret = set_machine_constraints(rdev);53115305 else53125306 rdev_dbg(rdev, "unable to resolve supply early: %pe\n",53135307 ERR_PTR(ret));···58495843 if (rdev->use_count)58505844 goto unlock;5851584558525852- /* If we can't read the status assume it's on. */58465846+ /* If we can't read the status assume it's always on. */58535847 if (ops->is_enabled)58545848 enabled = ops->is_enabled(rdev);58555849 else58565850 enabled = 1;5857585158585858- if (!enabled)58525852+ /* But if reading the status failed, assume that it's off. */58535853+ if (enabled <= 0)58595854 goto unlock;5860585558615856 if (have_full_constraints()) {
+8-5
drivers/regulator/pfuze100-regulator.c
···836836 * the switched regulator till yet.837837 */838838 if (pfuze_chip->flags & PFUZE_FLAG_DISABLE_SW) {839839- if (pfuze_chip->regulator_descs[i].sw_reg) {840840- desc->ops = &pfuze100_sw_disable_regulator_ops;841841- desc->enable_val = 0x8;842842- desc->disable_val = 0x0;843843- desc->enable_time = 500;839839+ if (pfuze_chip->chip_id == PFUZE100 ||840840+ pfuze_chip->chip_id == PFUZE200) {841841+ if (pfuze_chip->regulator_descs[i].sw_reg) {842842+ desc->ops = &pfuze100_sw_disable_regulator_ops;843843+ desc->enable_val = 0x8;844844+ desc->disable_val = 0x0;845845+ desc->enable_time = 500;846846+ }844847 }845848 }846849
+11-1
drivers/regulator/ti-abb-regulator.c
···342342 return ret;343343 }344344345345- /* If data is exactly the same, then just update index, no change */346345 info = &abb->info[sel];346346+ /*347347+ * When Linux kernel is starting up, we are'nt sure of the348348+ * Bias configuration that bootloader has configured.349349+ * So, we get to know the actual setting the first time350350+ * we are asked to transition.351351+ */352352+ if (abb->current_info_idx == -EINVAL)353353+ goto just_set_abb;354354+355355+ /* If data is exactly the same, then just update index, no change */347356 oinfo = &abb->info[abb->current_info_idx];348357 if (!memcmp(info, oinfo, sizeof(*info))) {349358 dev_dbg(dev, "%s: Same data new idx=%d, old idx=%d\n", __func__,···360351 goto out;361352 }362353354354+just_set_abb:363355 ret = ti_abb_set_opp(rdev, abb, info);364356365357out:
+29-5
drivers/scsi/ufs/ufshcd.c
···16271627 */16281628 fallthrough;16291629 case CLKS_OFF:16301630- ufshcd_scsi_block_requests(hba);16311630 hba->clk_gating.state = REQ_CLKS_ON;16321631 trace_ufshcd_clk_gating(dev_name(hba->dev),16331632 hba->clk_gating.state);16341634- queue_work(hba->clk_gating.clk_gating_workq,16351635- &hba->clk_gating.ungate_work);16331633+ if (queue_work(hba->clk_gating.clk_gating_workq,16341634+ &hba->clk_gating.ungate_work))16351635+ ufshcd_scsi_block_requests(hba);16361636 /*16371637 * fall through to check if we should wait for this16381638 * work to be done or not.···21152115 unsigned long flags;2116211621172117 if (wait_for_completion_timeout(&uic_cmd->done,21182118- msecs_to_jiffies(UIC_CMD_TIMEOUT)))21182118+ msecs_to_jiffies(UIC_CMD_TIMEOUT))) {21192119 ret = uic_cmd->argument2 & MASK_UIC_COMMAND_RESULT;21202120- else21202120+ } else {21212121 ret = -ETIMEDOUT;21222122+ dev_err(hba->dev,21232123+ "uic cmd 0x%x with arg3 0x%x completion timeout\n",21242124+ uic_cmd->command, uic_cmd->argument3);21252125+21262126+ if (!uic_cmd->cmd_active) {21272127+ dev_err(hba->dev, "%s: UIC cmd has been completed, return the result\n",21282128+ __func__);21292129+ ret = uic_cmd->argument2 & MASK_UIC_COMMAND_RESULT;21302130+ }21312131+ }2122213221232133 spin_lock_irqsave(hba->host->host_lock, flags);21242134 hba->active_uic_cmd = NULL;···21602150 if (completion)21612151 init_completion(&uic_cmd->done);2162215221532153+ uic_cmd->cmd_active = 1;21632154 ufshcd_dispatch_uic_cmd(hba, uic_cmd);2164215521652156 return 0;···38183807 dev_err(hba->dev,38193808 "pwr ctrl cmd 0x%x with mode 0x%x completion timeout\n",38203809 cmd->command, cmd->argument3);38103810+38113811+ if (!cmd->cmd_active) {38123812+ dev_err(hba->dev, "%s: Power Mode Change operation has been completed, go check UPMCRS\n",38133813+ __func__);38143814+ goto check_upmcrs;38153815+ }38163816+38213817 ret = -ETIMEDOUT;38223818 goto out;38233819 }3824382038213821+check_upmcrs:38253822 status = ufshcd_get_upmcrs(hba);38263823 if (status != PWR_LOCAL) {38273824 dev_err(hba->dev,···49214902 ufshcd_get_uic_cmd_result(hba);49224903 hba->active_uic_cmd->argument3 =49234904 ufshcd_get_dme_attr_val(hba);49054905+ if (!hba->uic_async_done)49064906+ hba->active_uic_cmd->cmd_active = 0;49244907 complete(&hba->active_uic_cmd->done);49254908 retval = IRQ_HANDLED;49264909 }4927491049284911 if ((intr_status & UFSHCD_UIC_PWR_MASK) && hba->uic_async_done) {49124912+ hba->active_uic_cmd->cmd_active = 0;49294913 complete(hba->uic_async_done);49304914 retval = IRQ_HANDLED;49314915 }···89288906 blk_mq_free_tag_set(&hba->tmf_tag_set);89298907 blk_cleanup_queue(hba->cmd_queue);89308908 scsi_remove_host(hba->host);89098909+ destroy_workqueue(hba->eh_wq);89318910 /* disable interrupts */89328911 ufshcd_disable_intr(hba, hba->intr_mask);89338912 ufshcd_hba_stop(hba);···92299206exit_gating:92309207 ufshcd_exit_clk_scaling(hba);92319208 ufshcd_exit_clk_gating(hba);92099209+ destroy_workqueue(hba->eh_wq);92329210out_disable:92339211 hba->is_irq_enabled = false;92349212 ufshcd_hba_exit(hba);
···679679 struct resource *res;680680 int id;681681682682- ctrl = spi_alloc_master(dev, sizeof(*fiu));682682+ ctrl = devm_spi_alloc_master(dev, sizeof(*fiu));683683 if (!ctrl)684684 return -ENOMEM;685685
+63-18
drivers/spi/spi.c
···812812 enable = !enable;813813814814 if (spi->cs_gpiod || gpio_is_valid(spi->cs_gpio)) {815815- /*816816- * Honour the SPI_NO_CS flag and invert the enable line, as817817- * active low is default for SPI. Execution paths that handle818818- * polarity inversion in gpiolib (such as device tree) will819819- * enforce active high using the SPI_CS_HIGH resulting in a820820- * double inversion through the code above.821821- */822815 if (!(spi->mode & SPI_NO_CS)) {823816 if (spi->cs_gpiod)817817+ /* polarity handled by gpiolib */824818 gpiod_set_value_cansleep(spi->cs_gpiod,825825- !enable);819819+ enable1);826820 else821821+ /*822822+ * invert the enable line, as active low is823823+ * default for SPI.824824+ */827825 gpio_set_value_cansleep(spi->cs_gpio, !enable);828826 }829827 /* Some SPI masters need both GPIO CS & slave_select */···19901992 }19911993 spi->chip_select = value;1992199419931993- /*19941994- * For descriptors associated with the device, polarity inversion is19951995- * handled in the gpiolib, so all gpio chip selects are "active high"19961996- * in the logical sense, the gpiolib will invert the line if need be.19971997- */19981998- if ((ctlr->use_gpio_descriptors) && ctlr->cs_gpiods &&19991999- ctlr->cs_gpiods[spi->chip_select])20002000- spi->mode |= SPI_CS_HIGH;20012001-20021995 /* Device speed */20031996 if (!of_property_read_u32(nc, "spi-max-frequency", &value))20041997 spi->max_speed_hz = value;···24422453}24432454EXPORT_SYMBOL_GPL(__spi_alloc_controller);2444245524562456+static void devm_spi_release_controller(struct device *dev, void *ctlr)24572457+{24582458+ spi_controller_put(*(struct spi_controller **)ctlr);24592459+}24602460+24612461+/**24622462+ * __devm_spi_alloc_controller - resource-managed __spi_alloc_controller()24632463+ * @dev: physical device of SPI controller24642464+ * @size: how much zeroed driver-private data to allocate24652465+ * @slave: whether to allocate an SPI master (false) or SPI slave (true)24662466+ * Context: can sleep24672467+ *24682468+ * Allocate an SPI controller and automatically release a reference on it24692469+ * when @dev is unbound from its driver. Drivers are thus relieved from24702470+ * having to call spi_controller_put().24712471+ *24722472+ * The arguments to this function are identical to __spi_alloc_controller().24732473+ *24742474+ * Return: the SPI controller structure on success, else NULL.24752475+ */24762476+struct spi_controller *__devm_spi_alloc_controller(struct device *dev,24772477+ unsigned int size,24782478+ bool slave)24792479+{24802480+ struct spi_controller **ptr, *ctlr;24812481+24822482+ ptr = devres_alloc(devm_spi_release_controller, sizeof(*ptr),24832483+ GFP_KERNEL);24842484+ if (!ptr)24852485+ return NULL;24862486+24872487+ ctlr = __spi_alloc_controller(dev, size, slave);24882488+ if (ctlr) {24892489+ *ptr = ctlr;24902490+ devres_add(dev, ptr);24912491+ } else {24922492+ devres_free(ptr);24932493+ }24942494+24952495+ return ctlr;24962496+}24972497+EXPORT_SYMBOL_GPL(__devm_spi_alloc_controller);24982498+24452499#ifdef CONFIG_OF24462500static int of_spi_get_gpio_numbers(struct spi_controller *ctlr)24472501{···28212789}28222790EXPORT_SYMBOL_GPL(devm_spi_register_controller);2823279127922792+static int devm_spi_match_controller(struct device *dev, void *res, void *ctlr)27932793+{27942794+ return *(struct spi_controller **)res == ctlr;27952795+}27962796+28242797static int __unregister(struct device *dev, void *null)28252798{28262799 spi_unregister_device(to_spi_device(dev));···28672830 list_del(&ctlr->list);28682831 mutex_unlock(&board_lock);2869283228702870- device_unregister(&ctlr->dev);28332833+ device_del(&ctlr->dev);28342834+28352835+ /* Release the last reference on the controller if its driver28362836+ * has not yet been converted to devm_spi_alloc_master/slave().28372837+ */28382838+ if (!devres_find(ctlr->dev.parent, devm_spi_release_controller,28392839+ devm_spi_match_controller, ctlr))28402840+ put_device(&ctlr->dev);28412841+28712842 /* free bus id */28722843 mutex_lock(&board_lock);28732844 if (found == ctlr)
+4-4
drivers/tee/amdtee/amdtee_private.h
···6464/**6565 * struct amdtee_context_data - AMD-TEE driver context data6666 * @sess_list: Keeps track of sessions opened in current TEE context6767+ * @shm_list: Keeps track of buffers allocated and mapped in current TEE6868+ * context6769 */6870struct amdtee_context_data {6971 struct list_head sess_list;7272+ struct list_head shm_list;7373+ struct mutex shm_mutex; /* synchronizes access to @shm_list */7074};71757276struct amdtee_driver_data {···9187 struct list_head shm_node;9288 void *kaddr;9389 u32 buf_id;9494-};9595-9696-struct amdtee_shm_context {9797- struct list_head shmdata_list;9890};999110092#define LOWER_TWO_BYTE_MASK 0x0000FFFF
···2020#include <linux/err.h>2121#include <linux/types.h>2222#include <linux/spinlock.h>2323+#include <linux/sys_soc.h>2324#include <linux/reboot.h>2425#include <linux/of_device.h>2526#include <linux/of_platform.h>···865864 return bgp;866865}867866867867+/*868868+ * List of SoCs on which the CPU PM notifier can cause erros on the DTEMP869869+ * readout.870870+ * Enabled notifier on these machines results in erroneous, random values which871871+ * could trigger unexpected thermal shutdown.872872+ */873873+static const struct soc_device_attribute soc_no_cpu_notifier[] = {874874+ { .machine = "OMAP4430" },875875+ { /* sentinel */ },876876+};877877+868878/*** Device driver call backs ***/869879870880static···1032102010331021#ifdef CONFIG_PM_SLEEP10341022 bgp->nb.notifier_call = bandgap_omap_cpu_notifier;10351035- cpu_pm_register_notifier(&bgp->nb);10231023+ if (!soc_device_match(soc_no_cpu_notifier))10241024+ cpu_pm_register_notifier(&bgp->nb);10361025#endif1037102610381027 return 0;···10691056 struct ti_bandgap *bgp = platform_get_drvdata(pdev);10701057 int i;1071105810721072- cpu_pm_unregister_notifier(&bgp->nb);10591059+ if (!soc_device_match(soc_no_cpu_notifier))10601060+ cpu_pm_unregister_notifier(&bgp->nb);1073106110741062 /* Remove sensor interfaces */10751063 for (i = 0; i < bgp->conf->sensor_count; i++) {
···2284228422852285 case PCI_DEVICE_ID_INTEL_TGL_NHI0:22862286 case PCI_DEVICE_ID_INTEL_TGL_NHI1:22872287+ case PCI_DEVICE_ID_INTEL_TGL_H_NHI0:22882288+ case PCI_DEVICE_ID_INTEL_TGL_H_NHI1:22872289 icm->is_supported = icm_tgl_is_supported;22882290 icm->driver_ready = icm_icl_driver_ready;22892291 icm->set_uuid = icm_icl_set_uuid;
···784784 switch (sw->config.device_id) {785785 case PCI_DEVICE_ID_INTEL_TGL_NHI0:786786 case PCI_DEVICE_ID_INTEL_TGL_NHI1:787787+ case PCI_DEVICE_ID_INTEL_TGL_H_NHI0:788788+ case PCI_DEVICE_ID_INTEL_TGL_H_NHI1:787789 return true;788790 }789791 }
+4
drivers/thunderbolt/usb4.c
···421421 * upstream USB4 port.422422 */423423 tb_switch_for_each_port(sw, port) {424424+ if (!tb_port_is_null(port))425425+ continue;424426 if (!route && tb_is_upstream_port(port))427427+ continue;428428+ if (!port->cap_usb4)425429 continue;426430427431 ret = tb_port_read(port, &val, TB_CFG_PORT,
···169169 unsigned int f, from = pos & (PAGE_SIZE - 1);170170 unsigned int t, to = from + copied;171171 loff_t i_size, maybe_i_size;172172- int ret;172172+ int ret = 0;173173174174 _enter("{%llx:%llu},{%lx}",175175 vnode->fid.vid, vnode->fid.vnode, page->index);176176+177177+ if (copied == 0)178178+ goto out;176179177180 maybe_i_size = pos + copied;178181
+1-1
fs/aio.c
···15721572 * we return to userspace.15731573 */15741574 if (S_ISREG(file_inode(file)->i_mode)) {15751575- __sb_start_write(file_inode(file)->i_sb, SB_FREEZE_WRITE, true);15751575+ sb_start_write(file_inode(file)->i_sb);15761576 __sb_writers_release(file_inode(file)->i_sb, SB_FREEZE_WRITE);15771577 }15781578 req->ki_flags |= IOCB_WRITE;
+1-1
fs/crypto/inline_crypt.c
···7474 int i;75757676 /* The file must need contents encryption, not filenames encryption */7777- if (!fscrypt_needs_contents_encryption(inode))7777+ if (!S_ISREG(inode->i_mode))7878 return 0;79798080 /* The crypto mode must have a blk-crypto counterpart */
+3-3
fs/ext4/ext4.h
···12311231 blocks */12321232#define EXT4_MOUNT2_HURD_COMPAT 0x00000004 /* Support HURD-castrated12331233 file systems */12341234-#define EXT4_MOUNT2_DAX_NEVER 0x00000008 /* Do not allow Direct Access */12351235-#define EXT4_MOUNT2_DAX_INODE 0x00000010 /* For printing options only */12361236-12371234#define EXT4_MOUNT2_EXPLICIT_JOURNAL_CHECKSUM 0x00000008 /* User explicitly12381235 specified journal checksum */1239123612401237#define EXT4_MOUNT2_JOURNAL_FAST_COMMIT 0x00000010 /* Journal fast commit */12381238+#define EXT4_MOUNT2_DAX_NEVER 0x00000020 /* Do not allow Direct Access */12391239+#define EXT4_MOUNT2_DAX_INODE 0x00000040 /* For printing options only */12401240+1241124112421242#define clear_opt(sb, opt) EXT4_SB(sb)->s_mount_opt &= \12431243 ~EXT4_MOUNT_##opt
-11
fs/ext4/super.c
···289289 if (!ext4_has_metadata_csum(sb))290290 return;291291292292- /*293293- * Locking the superblock prevents the scenario294294- * where:295295- * 1) a first thread pauses during checksum calculation.296296- * 2) a second thread updates the superblock, recalculates297297- * the checksum, and updates s_checksum298298- * 3) the first thread resumes and finishes its checksum calculation299299- * and updates s_checksum with a potentially stale or torn value.300300- */301301- lock_buffer(EXT4_SB(sb)->s_sbh);302292 es->s_checksum = ext4_superblock_csum(sb, es);303303- unlock_buffer(EXT4_SB(sb)->s_sbh);304293}305294306295ext4_fsblk_t ext4_block_bitmap(struct super_block *sb,
+1-1
fs/gfs2/aops.c
···7777 if (error)7878 return error;7979 if (!buffer_mapped(bh_result))8080- return -EIO;8080+ return -ENODATA;8181 return 0;8282}8383
+2-6
fs/gfs2/bmap.c
···13011301 trace_gfs2_bmap(ip, bh_map, lblock, create, 1);1302130213031303 ret = gfs2_iomap_get(inode, pos, length, flags, &iomap, &mp);13041304- if (!ret && iomap.type == IOMAP_HOLE) {13051305- if (create)13061306- ret = gfs2_iomap_alloc(inode, &iomap, &mp);13071307- else13081308- ret = -ENODATA;13091309- }13041304+ if (create && !ret && iomap.type == IOMAP_HOLE)13051305+ ret = gfs2_iomap_alloc(inode, &iomap, &mp);13101306 release_metapath(&mp);13111307 if (ret)13121308 goto out;
+12-1
fs/gfs2/glops.c
···571571 int error = 0;572572 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;573573574574- if (gl->gl_req == LM_ST_EXCLUSIVE && !gfs2_withdrawn(sdp)) {574574+ /*575575+ * We need to check gl_state == LM_ST_SHARED here and not gl_req ==576576+ * LM_ST_EXCLUSIVE. That's because when any node does a freeze,577577+ * all the nodes should have the freeze glock in SH mode and they all578578+ * call do_xmote: One for EX and the others for UN. They ALL must579579+ * freeze locally, and they ALL must queue freeze work. The freeze_work580580+ * calls freeze_func, which tries to reacquire the freeze glock in SH,581581+ * effectively waiting for the thaw on the node who holds it in EX.582582+ * Once thawed, the work func acquires the freeze glock in583583+ * SH and everybody goes back to thawed.584584+ */585585+ if (gl->gl_state == LM_ST_SHARED && !gfs2_withdrawn(sdp)) {575586 atomic_set(&sdp->sd_freeze_state, SFS_STARTING_FREEZE);576587 error = freeze_super(sdp->sd_vfs);577588 if (error) {
+2
fs/gfs2/log.c
···132132 spin_unlock(&sdp->sd_ail_lock);133133 ret = generic_writepages(mapping, wbc);134134 spin_lock(&sdp->sd_ail_lock);135135+ if (ret == -ENODATA) /* if a jdata write into a new hole */136136+ ret = 0; /* ignore it */135137 if (ret || wbc->nr_to_write <= 0)136138 break;137139 return -EBUSY;
+5-5
fs/gfs2/rgrp.c
···2529252925302530 rbm.rgd = rgd;25312531 error = gfs2_rbm_from_block(&rbm, no_addr);25322532- if (WARN_ON_ONCE(error))25332533- goto fail;25342534-25352535- if (gfs2_testbit(&rbm, false) != type)25362536- error = -ESTALE;25322532+ if (!WARN_ON_ONCE(error)) {25332533+ if (gfs2_testbit(&rbm, false) != type)25342534+ error = -ESTALE;25352535+ }2537253625382537 gfs2_glock_dq_uninit(&rgd_gh);25382538+25392539fail:25402540 return error;25412541}
+2-3
fs/io_uring.c
···35473547 * we return to userspace.35483548 */35493549 if (req->flags & REQ_F_ISREG) {35503550- __sb_start_write(file_inode(req->file)->i_sb,35513551- SB_FREEZE_WRITE, true);35503550+ sb_start_write(file_inode(req->file)->i_sb);35523551 __sb_writers_release(file_inode(req->file)->i_sb,35533552 SB_FREEZE_WRITE);35543553 }···92259226 * to a power-of-two, if it isn't already. We do NOT impose92269227 * any cq vs sq ring sizing.92279228 */92299229+ p->cq_entries = roundup_pow_of_two(p->cq_entries);92289230 if (p->cq_entries < p->sq_entries)92299231 return -EINVAL;92309232 if (p->cq_entries > IORING_MAX_CQ_ENTRIES) {···92339233 return -EINVAL;92349234 p->cq_entries = IORING_MAX_CQ_ENTRIES;92359235 }92369236- p->cq_entries = roundup_pow_of_two(p->cq_entries);92379236 } else {92389237 p->cq_entries = 2 * p->sq_entries;92399238 }
···16311631}16321632EXPORT_SYMBOL(super_setup_bdi);1633163316341634-/*16351635- * This is an internal function, please use sb_end_{write,pagefault,intwrite}16361636- * instead.16371637- */16381638-void __sb_end_write(struct super_block *sb, int level)16391639-{16401640- percpu_up_read(sb->s_writers.rw_sem + level-1);16411641-}16421642-EXPORT_SYMBOL(__sb_end_write);16431643-16441644-/*16451645- * This is an internal function, please use sb_start_{write,pagefault,intwrite}16461646- * instead.16471647- */16481648-int __sb_start_write(struct super_block *sb, int level, bool wait)16491649-{16501650- bool force_trylock = false;16511651- int ret = 1;16521652-16531653-#ifdef CONFIG_LOCKDEP16541654- /*16551655- * We want lockdep to tell us about possible deadlocks with freezing16561656- * but it's it bit tricky to properly instrument it. Getting a freeze16571657- * protection works as getting a read lock but there are subtle16581658- * problems. XFS for example gets freeze protection on internal level16591659- * twice in some cases, which is OK only because we already hold a16601660- * freeze protection also on higher level. Due to these cases we have16611661- * to use wait == F (trylock mode) which must not fail.16621662- */16631663- if (wait) {16641664- int i;16651665-16661666- for (i = 0; i < level - 1; i++)16671667- if (percpu_rwsem_is_held(sb->s_writers.rw_sem + i)) {16681668- force_trylock = true;16691669- break;16701670- }16711671- }16721672-#endif16731673- if (wait && !force_trylock)16741674- percpu_down_read(sb->s_writers.rw_sem + level-1);16751675- else16761676- ret = percpu_down_read_trylock(sb->s_writers.rw_sem + level-1);16771677-16781678- WARN_ON(force_trylock && !ret);16791679- return ret;16801680-}16811681-EXPORT_SYMBOL(__sb_start_write);16821682-16831634/**16841635 * sb_wait_write - wait until all writers to given file system finish16851636 * @sb: the super for which we wait
+1-1
fs/xfs/libxfs/xfs_rmap.c
···15141514 * record for our insertion point. This will also give us the record for15151515 * start block contiguity tests.15161516 */15171517- error = xfs_rmap_lookup_le_range(cur, bno, owner, offset, flags,15171517+ error = xfs_rmap_lookup_le_range(cur, bno, owner, offset, oldext,15181518 &PREV, &i);15191519 if (error)15201520 goto done;
+8-8
fs/xfs/libxfs/xfs_rmap_btree.c
···243243 else if (y > x)244244 return -1;245245246246- x = XFS_RMAP_OFF(be64_to_cpu(kp->rm_offset));247247- y = rec->rm_offset;246246+ x = be64_to_cpu(kp->rm_offset);247247+ y = xfs_rmap_irec_offset_pack(rec);248248 if (x > y)249249 return 1;250250 else if (y > x)···275275 else if (y > x)276276 return -1;277277278278- x = XFS_RMAP_OFF(be64_to_cpu(kp1->rm_offset));279279- y = XFS_RMAP_OFF(be64_to_cpu(kp2->rm_offset));278278+ x = be64_to_cpu(kp1->rm_offset);279279+ y = be64_to_cpu(kp2->rm_offset);280280 if (x > y)281281 return 1;282282 else if (y > x)···390390 return 1;391391 else if (a > b)392392 return 0;393393- a = XFS_RMAP_OFF(be64_to_cpu(k1->rmap.rm_offset));394394- b = XFS_RMAP_OFF(be64_to_cpu(k2->rmap.rm_offset));393393+ a = be64_to_cpu(k1->rmap.rm_offset);394394+ b = be64_to_cpu(k2->rmap.rm_offset);395395 if (a <= b)396396 return 1;397397 return 0;···420420 return 1;421421 else if (a > b)422422 return 0;423423- a = XFS_RMAP_OFF(be64_to_cpu(r1->rmap.rm_offset));424424- b = XFS_RMAP_OFF(be64_to_cpu(r2->rmap.rm_offset));423423+ a = be64_to_cpu(r1->rmap.rm_offset);424424+ b = be64_to_cpu(r2->rmap.rm_offset);425425 if (a <= b)426426 return 1;427427 return 0;
+2
fs/xfs/scrub/bmap.c
···113113114114 if (info->whichfork == XFS_ATTR_FORK)115115 rflags |= XFS_RMAP_ATTR_FORK;116116+ if (irec->br_state == XFS_EXT_UNWRITTEN)117117+ rflags |= XFS_RMAP_UNWRITTEN;116118117119 /*118120 * CoW staging extents are owned (on disk) by the refcountbt, so
+3-5
fs/xfs/scrub/refcount.c
···170170 */171171 INIT_LIST_HEAD(&worklist);172172 rbno = NULLAGBLOCK;173173- nr = 1;174173175174 /* Make sure the fragments actually /are/ in agbno order. */176175 bno = 0;···183184 * Find all the rmaps that start at or before the refc extent,184185 * and put them on the worklist.185186 */187187+ nr = 0;186188 list_for_each_entry_safe(frag, n, &refchk->fragments, list) {187187- if (frag->rm.rm_startblock > refchk->bno)188188- goto done;189189+ if (frag->rm.rm_startblock > refchk->bno || nr > target_nr)190190+ break;189191 bno = frag->rm.rm_startblock + frag->rm.rm_blockcount;190192 if (bno < rbno)191193 rbno = bno;192194 list_move_tail(&frag->list, &worklist);193193- if (nr == target_nr)194194- break;195195 nr++;196196 }197197
···6060#define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 16161#endif62626363-/* The following are for compatibility with GCC, from compiler-gcc.h,6464- * and may be redefined here because they should not be shared with other6565- * compilers, like ICC.6666- */6767-#define barrier() __asm__ __volatile__("" : : : "memory")6868-6963#if __has_feature(shadow_call_stack)7064# define __noscs __attribute__((__no_sanitize__("shadow-call-stack")))7165#endif
-19
include/linux/compiler-gcc.h
···1515# error Sorry, your version of GCC is too old - please use 4.9 or newer.1616#endif17171818-/* Optimization barrier */1919-2020-/* The "volatile" is due to gcc bugs */2121-#define barrier() __asm__ __volatile__("": : :"memory")2222-/*2323- * This version is i.e. to prevent dead stores elimination on @ptr2424- * where gcc and llvm may behave differently when otherwise using2525- * normal barrier(): while gcc behavior gets along with a normal2626- * barrier(), llvm needs an explicit input variable to be assumed2727- * clobbered. The issue is as follows: while the inline asm might2828- * access any memory it wants, the compiler could have fit all of2929- * @ptr into memory registers instead, and since @ptr never escaped3030- * from that, it proved that the inline asm wasn't touching any of3131- * it. This version works well with both compilers, i.e. we're telling3232- * the compiler that the inline asm absolutely may see the contents3333- * of @ptr. See also: https://llvm.org/bugs/show_bug.cgi?id=154953434- */3535-#define barrier_data(ptr) __asm__ __volatile__("": :"r"(ptr) :"memory")3636-3718/*3819 * This macro obfuscates arithmetic on a variable address so that gcc3920 * shouldn't recognize the original var, and make assumptions about it.
+16-2
include/linux/compiler.h
···80808181/* Optimization barrier */8282#ifndef barrier8383-# define barrier() __memory_barrier()8383+/* The "volatile" is due to gcc bugs */8484+# define barrier() __asm__ __volatile__("": : :"memory")8485#endif85868687#ifndef barrier_data8787-# define barrier_data(ptr) barrier()8888+/*8989+ * This version is i.e. to prevent dead stores elimination on @ptr9090+ * where gcc and llvm may behave differently when otherwise using9191+ * normal barrier(): while gcc behavior gets along with a normal9292+ * barrier(), llvm needs an explicit input variable to be assumed9393+ * clobbered. The issue is as follows: while the inline asm might9494+ * access any memory it wants, the compiler could have fit all of9595+ * @ptr into memory registers instead, and since @ptr never escaped9696+ * from that, it proved that the inline asm wasn't touching any of9797+ * it. This version works well with both compilers, i.e. we're telling9898+ * the compiler that the inline asm absolutely may see the contents9999+ * of @ptr. See also: https://llvm.org/bugs/show_bug.cgi?id=15495100100+ */101101+# define barrier_data(ptr) __asm__ __volatile__("": :"r"(ptr) :"memory")88102#endif8910390104/* workaround for GCC PR82365 if needed */
···387387}388388389389/**390390+ * pm_runtime_resume_and_get - Bump up usage counter of a device and resume it.391391+ * @dev: Target device.392392+ *393393+ * Resume @dev synchronously and if that is successful, increment its runtime394394+ * PM usage counter. Return 0 if the runtime PM usage counter of @dev has been395395+ * incremented or a negative error code otherwise.396396+ */397397+static inline int pm_runtime_resume_and_get(struct device *dev)398398+{399399+ int ret;400400+401401+ ret = __pm_runtime_resume(dev, RPM_GET_PUT);402402+ if (ret < 0) {403403+ pm_runtime_put_noidle(dev);404404+ return ret;405405+ }406406+407407+ return 0;408408+}409409+410410+/**390411 * pm_runtime_put - Drop device usage counter and queue up "idle check" if 0.391412 * @dev: Target device.392413 *
+19
include/linux/spi/spi.h
···734734 return __spi_alloc_controller(host, size, true);735735}736736737737+struct spi_controller *__devm_spi_alloc_controller(struct device *dev,738738+ unsigned int size,739739+ bool slave);740740+741741+static inline struct spi_controller *devm_spi_alloc_master(struct device *dev,742742+ unsigned int size)743743+{744744+ return __devm_spi_alloc_controller(dev, size, false);745745+}746746+747747+static inline struct spi_controller *devm_spi_alloc_slave(struct device *dev,748748+ unsigned int size)749749+{750750+ if (!IS_ENABLED(CONFIG_SPI_SLAVE))751751+ return NULL;752752+753753+ return __devm_spi_alloc_controller(dev, size, true);754754+}755755+737756extern int spi_register_controller(struct spi_controller *ctlr);738757extern int devm_spi_register_controller(struct device *dev,739758 struct spi_controller *ctlr);
···2626 * struct gpiochip_info - Information about a certain GPIO chip2727 * @name: the Linux kernel name of this GPIO chip2828 * @label: a functional name for this GPIO chip, such as a product2929- * number, may be empty2929+ * number, may be empty (i.e. label[0] == '\0')3030 * @lines: number of GPIO lines on this chip3131 */3232struct gpiochip_info {···9898 * identifying which field of the attribute union is in use.9999 * @GPIO_V2_LINE_ATTR_ID_FLAGS: flags field is in use100100 * @GPIO_V2_LINE_ATTR_ID_OUTPUT_VALUES: values field is in use101101- * @GPIO_V2_LINE_ATTR_ID_DEBOUNCE: debounce_period_us is in use101101+ * @GPIO_V2_LINE_ATTR_ID_DEBOUNCE: debounce_period_us field is in use102102 */103103enum gpio_v2_line_attr_id {104104 GPIO_V2_LINE_ATTR_ID_FLAGS = 1,···110110 * struct gpio_v2_line_attribute - a configurable attribute of a line111111 * @id: attribute identifier with value from &enum gpio_v2_line_attr_id112112 * @padding: reserved for future use and must be zero filled113113- * @flags: if id is GPIO_V2_LINE_ATTR_ID_FLAGS, the flags for the GPIO114114- * line, with values from enum gpio_v2_line_flag, such as115115- * GPIO_V2_LINE_FLAG_ACTIVE_LOW, GPIO_V2_LINE_FLAG_OUTPUT etc, OR:ed113113+ * @flags: if id is %GPIO_V2_LINE_ATTR_ID_FLAGS, the flags for the GPIO114114+ * line, with values from &enum gpio_v2_line_flag, such as115115+ * %GPIO_V2_LINE_FLAG_ACTIVE_LOW, %GPIO_V2_LINE_FLAG_OUTPUT etc, added116116 * together. This overrides the default flags contained in the &struct117117 * gpio_v2_line_config for the associated line.118118- * @values: if id is GPIO_V2_LINE_ATTR_ID_OUTPUT_VALUES, a bitmap118118+ * @values: if id is %GPIO_V2_LINE_ATTR_ID_OUTPUT_VALUES, a bitmap119119 * containing the values to which the lines will be set, with each bit120120 * number corresponding to the index into &struct121121 * gpio_v2_line_request.offsets.122122- * @debounce_period_us: if id is GPIO_V2_LINE_ATTR_ID_DEBOUNCE, the desired123123- * debounce period, in microseconds122122+ * @debounce_period_us: if id is %GPIO_V2_LINE_ATTR_ID_DEBOUNCE, the123123+ * desired debounce period, in microseconds124124 */125125struct gpio_v2_line_attribute {126126 __u32 id;···147147148148/**149149 * struct gpio_v2_line_config - Configuration for GPIO lines150150- * @flags: flags for the GPIO lines, with values from enum151151- * gpio_v2_line_flag, such as GPIO_V2_LINE_FLAG_ACTIVE_LOW,152152- * GPIO_V2_LINE_FLAG_OUTPUT etc, OR:ed together. This is the default for150150+ * @flags: flags for the GPIO lines, with values from &enum151151+ * gpio_v2_line_flag, such as %GPIO_V2_LINE_FLAG_ACTIVE_LOW,152152+ * %GPIO_V2_LINE_FLAG_OUTPUT etc, added together. This is the default for153153 * all requested lines but may be overridden for particular lines using154154- * attrs.155155- * @num_attrs: the number of attributes in attrs154154+ * @attrs.155155+ * @num_attrs: the number of attributes in @attrs156156 * @padding: reserved for future use and must be zero filled157157 * @attrs: the configuration attributes associated with the requested158158 * lines. Any attribute should only be associated with a particular line···175175 * "my-bitbanged-relay"176176 * @config: requested configuration for the lines.177177 * @num_lines: number of lines requested in this request, i.e. the number178178- * of valid fields in the GPIO_V2_LINES_MAX sized arrays, set to 1 to178178+ * of valid fields in the %GPIO_V2_LINES_MAX sized arrays, set to 1 to179179 * request a single line180180 * @event_buffer_size: a suggested minimum number of line events that the181181 * kernel should buffer. This is only relevant if edge detection is182182 * enabled in the configuration. Note that this is only a suggested value183183 * and the kernel may allocate a larger buffer or cap the size of the184184 * buffer. If this field is zero then the buffer size defaults to a minimum185185- * of num_lines*16.185185+ * of @num_lines * 16.186186 * @padding: reserved for future use and must be zero filled187187 * @fd: if successful this field will contain a valid anonymous file handle188188- * after a GPIO_GET_LINE_IOCTL operation, zero or negative value means188188+ * after a %GPIO_GET_LINE_IOCTL operation, zero or negative value means189189 * error190190 */191191struct gpio_v2_line_request {···203203 * struct gpio_v2_line_info - Information about a certain GPIO line204204 * @name: the name of this GPIO line, such as the output pin of the line on205205 * the chip, a rail or a pin header name on a board, as specified by the206206- * GPIO chip, may be empty206206+ * GPIO chip, may be empty (i.e. name[0] == '\0')207207 * @consumer: a functional name for the consumer of this GPIO line as set208208 * by whatever is using it, will be empty if there is no current user but209209 * may also be empty if the consumer doesn't set this up210210- * @flags: flags for the GPIO line, such as GPIO_V2_LINE_FLAG_ACTIVE_LOW,211211- * GPIO_V2_LINE_FLAG_OUTPUT etc, OR:ed together212210 * @offset: the local offset on this GPIO chip, fill this in when213211 * requesting the line information from the kernel214214- * @num_attrs: the number of attributes in attrs212212+ * @num_attrs: the number of attributes in @attrs213213+ * @flags: flags for the GPIO lines, with values from &enum214214+ * gpio_v2_line_flag, such as %GPIO_V2_LINE_FLAG_ACTIVE_LOW,215215+ * %GPIO_V2_LINE_FLAG_OUTPUT etc, added together.215216 * @attrs: the configuration attributes associated with the line216217 * @padding: reserved for future use217218 */···245244 * of a GPIO line246245 * @info: updated line information247246 * @timestamp_ns: estimate of time of status change occurrence, in nanoseconds248248- * @event_type: the type of change with a value from enum247247+ * @event_type: the type of change with a value from &enum249248 * gpio_v2_line_changed_type250249 * @padding: reserved for future use251250 */···270269/**271270 * struct gpio_v2_line_event - The actual event being pushed to userspace272271 * @timestamp_ns: best estimate of time of event occurrence, in nanoseconds.273273- * The timestamp_ns is read from CLOCK_MONOTONIC and is intended to allow the274274- * accurate measurement of the time between events. It does not provide272272+ * The @timestamp_ns is read from %CLOCK_MONOTONIC and is intended to allow273273+ * the accurate measurement of the time between events. It does not provide275274 * the wall-clock time.276276- * @id: event identifier with value from enum gpio_v2_line_event_id275275+ * @id: event identifier with value from &enum gpio_v2_line_event_id277276 * @offset: the offset of the line that triggered the event278277 * @seqno: the sequence number for this event in the sequence of events for279278 * all the lines in this line request···292291};293292294293/*295295- * ABI v1294294+ * ABI v1296295 *297296 * This version of the ABI is deprecated.298297 * Use the latest version of the ABI, defined above, instead.···315314 * @flags: various flags for this line316315 * @name: the name of this GPIO line, such as the output pin of the line on the317316 * chip, a rail or a pin header name on a board, as specified by the gpio318318- * chip, may be empty317317+ * chip, may be empty (i.e. name[0] == '\0')319318 * @consumer: a functional name for the consumer of this GPIO line as set by320319 * whatever is using it, will be empty if there is no current user but may321320 * also be empty if the consumer doesn't set this up322321 *323323- * This struct is part of ABI v1 and is deprecated.324324- * Use struct gpio_v2_line_info instead.322322+ * Note: This struct is part of ABI v1 and is deprecated.323323+ * Use &struct gpio_v2_line_info instead.325324 */326325struct gpioline_info {327326 __u32 line_offset;···345344 * of a GPIO line346345 * @info: updated line information347346 * @timestamp: estimate of time of status change occurrence, in nanoseconds348348- * @event_type: one of GPIOLINE_CHANGED_REQUESTED, GPIOLINE_CHANGED_RELEASED349349- * and GPIOLINE_CHANGED_CONFIG347347+ * @event_type: one of %GPIOLINE_CHANGED_REQUESTED,348348+ * %GPIOLINE_CHANGED_RELEASED and %GPIOLINE_CHANGED_CONFIG349349+ * @padding: reserved for future use350350 *351351- * Note: struct gpioline_info embedded here has 32-bit alignment on its own,351351+ * The &struct gpioline_info embedded here has 32-bit alignment on its own,352352 * but it works fine with 64-bit alignment too. With its 72 byte size, we can353353 * guarantee there are no implicit holes between it and subsequent members.354354 * The 20-byte padding at the end makes sure we don't add any implicit padding355355 * at the end of the structure on 64-bit architectures.356356 *357357- * This struct is part of ABI v1 and is deprecated.358358- * Use struct gpio_v2_line_info_changed instead.357357+ * Note: This struct is part of ABI v1 and is deprecated.358358+ * Use &struct gpio_v2_line_info_changed instead.359359 */360360struct gpioline_info_changed {361361 struct gpioline_info info;···380378 * @lineoffsets: an array of desired lines, specified by offset index for the381379 * associated GPIO device382380 * @flags: desired flags for the desired GPIO lines, such as383383- * GPIOHANDLE_REQUEST_OUTPUT, GPIOHANDLE_REQUEST_ACTIVE_LOW etc, OR:ed381381+ * %GPIOHANDLE_REQUEST_OUTPUT, %GPIOHANDLE_REQUEST_ACTIVE_LOW etc, added384382 * together. Note that even if multiple lines are requested, the same flags385383 * must be applicable to all of them, if you want lines with individual386384 * flags set, request them one by one. It is possible to select387385 * a batch of input or output lines, but they must all have the same388386 * characteristics, i.e. all inputs or all outputs, all active low etc389389- * @default_values: if the GPIOHANDLE_REQUEST_OUTPUT is set for a requested387387+ * @default_values: if the %GPIOHANDLE_REQUEST_OUTPUT is set for a requested390388 * line, this specifies the default output value, should be 0 (low) or391389 * 1 (high), anything else than 0 or 1 will be interpreted as 1 (high)392390 * @consumer_label: a desired consumer label for the selected GPIO line(s)···394392 * @lines: number of lines requested in this request, i.e. the number of395393 * valid fields in the above arrays, set to 1 to request a single line396394 * @fd: if successful this field will contain a valid anonymous file handle397397- * after a GPIO_GET_LINEHANDLE_IOCTL operation, zero or negative value395395+ * after a %GPIO_GET_LINEHANDLE_IOCTL operation, zero or negative value398396 * means error399397 *400400- * This struct is part of ABI v1 and is deprecated.401401- * Use struct gpio_v2_line_request instead.398398+ * Note: This struct is part of ABI v1 and is deprecated.399399+ * Use &struct gpio_v2_line_request instead.402400 */403401struct gpiohandle_request {404402 __u32 lineoffsets[GPIOHANDLES_MAX];···412410/**413411 * struct gpiohandle_config - Configuration for a GPIO handle request414412 * @flags: updated flags for the requested GPIO lines, such as415415- * GPIOHANDLE_REQUEST_OUTPUT, GPIOHANDLE_REQUEST_ACTIVE_LOW etc, OR:ed413413+ * %GPIOHANDLE_REQUEST_OUTPUT, %GPIOHANDLE_REQUEST_ACTIVE_LOW etc, added416414 * together417417- * @default_values: if the GPIOHANDLE_REQUEST_OUTPUT is set in flags,415415+ * @default_values: if the %GPIOHANDLE_REQUEST_OUTPUT is set in flags,418416 * this specifies the default output value, should be 0 (low) or419417 * 1 (high), anything else than 0 or 1 will be interpreted as 1 (high)420418 * @padding: reserved for future use and should be zero filled421419 *422422- * This struct is part of ABI v1 and is deprecated.423423- * Use struct gpio_v2_line_config instead.420420+ * Note: This struct is part of ABI v1 and is deprecated.421421+ * Use &struct gpio_v2_line_config instead.424422 */425423struct gpiohandle_config {426424 __u32 flags;···434432 * state of a line, when setting the state of lines these should contain435433 * the desired target state436434 *437437- * This struct is part of ABI v1 and is deprecated.438438- * Use struct gpio_v2_line_values instead.435435+ * Note: This struct is part of ABI v1 and is deprecated.436436+ * Use &struct gpio_v2_line_values instead.439437 */440438struct gpiohandle_data {441439 __u8 values[GPIOHANDLES_MAX];···451449 * @lineoffset: the desired line to subscribe to events from, specified by452450 * offset index for the associated GPIO device453451 * @handleflags: desired handle flags for the desired GPIO line, such as454454- * GPIOHANDLE_REQUEST_ACTIVE_LOW or GPIOHANDLE_REQUEST_OPEN_DRAIN452452+ * %GPIOHANDLE_REQUEST_ACTIVE_LOW or %GPIOHANDLE_REQUEST_OPEN_DRAIN455453 * @eventflags: desired flags for the desired GPIO event line, such as456456- * GPIOEVENT_REQUEST_RISING_EDGE or GPIOEVENT_REQUEST_FALLING_EDGE454454+ * %GPIOEVENT_REQUEST_RISING_EDGE or %GPIOEVENT_REQUEST_FALLING_EDGE457455 * @consumer_label: a desired consumer label for the selected GPIO line(s)458456 * such as "my-listener"459457 * @fd: if successful this field will contain a valid anonymous file handle460460- * after a GPIO_GET_LINEEVENT_IOCTL operation, zero or negative value458458+ * after a %GPIO_GET_LINEEVENT_IOCTL operation, zero or negative value461459 * means error462460 *463463- * This struct is part of ABI v1 and is deprecated.464464- * Use struct gpio_v2_line_request instead.461461+ * Note: This struct is part of ABI v1 and is deprecated.462462+ * Use &struct gpio_v2_line_request instead.465463 */466464struct gpioevent_request {467465 __u32 lineoffset;···471469 int fd;472470};473471474474-/**472472+/*475473 * GPIO event types476474 */477475#define GPIOEVENT_EVENT_RISING_EDGE 0x01···482480 * @timestamp: best estimate of time of event occurrence, in nanoseconds483481 * @id: event identifier484482 *485485- * This struct is part of ABI v1 and is deprecated.486486- * Use struct gpio_v2_line_event instead.483483+ * Note: This struct is part of ABI v1 and is deprecated.484484+ * Use &struct gpio_v2_line_event instead.487485 */488486struct gpioevent_data {489487 __u64 timestamp;
+12-2
init/main.c
···269269 u32 size, csum;270270 char *data;271271 u32 *hdr;272272+ int i;272273273274 if (!initrd_end)274275 return NULL;275276276277 data = (char *)initrd_end - BOOTCONFIG_MAGIC_LEN;277277- if (memcmp(data, BOOTCONFIG_MAGIC, BOOTCONFIG_MAGIC_LEN))278278- return NULL;278278+ /*279279+ * Since Grub may align the size of initrd to 4, we must280280+ * check the preceding 3 bytes as well.281281+ */282282+ for (i = 0; i < 4; i++) {283283+ if (!memcmp(data, BOOTCONFIG_MAGIC, BOOTCONFIG_MAGIC_LEN))284284+ goto found;285285+ data--;286286+ }287287+ return NULL;279288289289+found:280290 hdr = (u32 *)(data - 8);281291 size = hdr[0];282292 csum = hdr[1];
+15-3
kernel/bpf/verifier.c
···78847884 struct tnum range = tnum_range(0, 1);78857885 enum bpf_prog_type prog_type = resolve_prog_type(env->prog);78867886 int err;78877887+ const bool is_subprog = env->cur_state->frame[0]->subprogno;7887788878887889 /* LSM and struct_ops func-ptr's return type could be "void" */78897889- if ((prog_type == BPF_PROG_TYPE_STRUCT_OPS ||78907890+ if (!is_subprog &&78917891+ (prog_type == BPF_PROG_TYPE_STRUCT_OPS ||78907892 prog_type == BPF_PROG_TYPE_LSM) &&78917893 !prog->aux->attach_func_proto->type)78927894 return 0;···79067904 if (is_pointer_value(env, BPF_REG_0)) {79077905 verbose(env, "R0 leaks addr as return value\n");79087906 return -EACCES;79077907+ }79087908+79097909+ reg = cur_regs(env) + BPF_REG_0;79107910+ if (is_subprog) {79117911+ if (reg->type != SCALAR_VALUE) {79127912+ verbose(env, "At subprogram exit the register R0 is not a scalar value (%s)\n",79137913+ reg_type_str[reg->type]);79147914+ return -EINVAL;79157915+ }79167916+ return 0;79097917 }7910791879117919 switch (prog_type) {···79717959 return 0;79727960 }7973796179747974- reg = cur_regs(env) + BPF_REG_0;79757962 if (reg->type != SCALAR_VALUE) {79767963 verbose(env, "At program exit the register R0 is not a known value (%s)\n",79777964 reg_type_str[reg->type]);···96819670 struct bpf_insn *insn,96829671 struct bpf_insn_aux_data *aux)96839672{96849684- u32 datasec_id, type, id = insn->imm;96859673 const struct btf_var_secinfo *vsi;96869674 const struct btf_type *datasec;96879675 const struct btf_type *t;96889676 const char *sym_name;96899677 bool percpu = false;96789678+ u32 type, id = insn->imm;96799679+ s32 datasec_id;96909680 u64 addr;96919681 int i;96929682
+25-32
kernel/events/core.c
···23122312 event_sched_out(event, cpuctx, ctx);2313231323142314 perf_pmu_enable(ctx->pmu);23152315-23162316- if (group_event->attr.exclusive)23172317- cpuctx->exclusive = 0;23182315}2319231623202317#define DETACH_GROUP 0x01UL···2580258325812584 pmu->start_txn(pmu, PERF_PMU_TXN_ADD);2582258525832583- if (event_sched_in(group_event, cpuctx, ctx)) {25842584- pmu->cancel_txn(pmu);25852585- perf_mux_hrtimer_restart(cpuctx);25862586- return -EAGAIN;25872587- }25862586+ if (event_sched_in(group_event, cpuctx, ctx))25872587+ goto error;2588258825892589 /*25902590 * Schedule in siblings as one group (if any):···26102616 }26112617 event_sched_out(group_event, cpuctx, ctx);2612261826192619+error:26132620 pmu->cancel_txn(pmu);26142614-26152615- perf_mux_hrtimer_restart(cpuctx);26162616-26172621 return -EAGAIN;26182622}26192623···26372645 * If this group is exclusive and there are already26382646 * events on the CPU, it can't go on.26392647 */26402640- if (event->attr.exclusive && cpuctx->active_oncpu)26482648+ if (event->attr.exclusive && !list_empty(get_event_list(event)))26412649 return 0;26422650 /*26432651 * Otherwise, try to add it if all previous groups were able···3671367936723680 *can_add_hw = 0;36733681 ctx->rotate_necessary = 1;36823682+ perf_mux_hrtimer_restart(cpuctx);36743683 }3675368436763685 return 0;···63676374}6368637563696376static void perf_sample_regs_user(struct perf_regs *regs_user,63706370- struct pt_regs *regs,63716371- struct pt_regs *regs_user_copy)63776377+ struct pt_regs *regs)63726378{63736379 if (user_mode(regs)) {63746380 regs_user->abi = perf_reg_abi(current);63756381 regs_user->regs = regs;63766382 } else if (!(current->flags & PF_KTHREAD)) {63776377- perf_get_regs_user(regs_user, regs, regs_user_copy);63836383+ perf_get_regs_user(regs_user, regs);63786384 } else {63796385 regs_user->abi = PERF_SAMPLE_REGS_ABI_NONE;63806386 regs_user->regs = NULL;···70757083 }7076708470777085 if (sample_type & (PERF_SAMPLE_REGS_USER | PERF_SAMPLE_STACK_USER))70787078- perf_sample_regs_user(&data->regs_user, regs,70797079- &data->regs_user_copy);70867086+ perf_sample_regs_user(&data->regs_user, regs);7080708770817088 if (sample_type & PERF_SAMPLE_REGS_USER) {70827089 /* regs dump ABI info */···71777186 struct perf_sample_data *data,71787187 struct pt_regs *regs,71797188 int (*output_begin)(struct perf_output_handle *,71897189+ struct perf_sample_data *,71807190 struct perf_event *,71817191 unsigned int))71827192{···7190719871917199 perf_prepare_sample(&header, data, event, regs);7192720071937193- err = output_begin(&handle, event, header.size);72017201+ err = output_begin(&handle, data, event, header.size);71947202 if (err)71957203 goto exit;71967204···72567264 int ret;7257726572587266 perf_event_header__init_id(&read_event.header, &sample, event);72597259- ret = perf_output_begin(&handle, event, read_event.header.size);72677267+ ret = perf_output_begin(&handle, &sample, event, read_event.header.size);72607268 if (ret)72617269 return;72627270···7525753375267534 perf_event_header__init_id(&task_event->event_id.header, &sample, event);7527753575287528- ret = perf_output_begin(&handle, event,75367536+ ret = perf_output_begin(&handle, &sample, event,75297537 task_event->event_id.header.size);75307538 if (ret)75317539 goto out;···76287636 return;7629763776307638 perf_event_header__init_id(&comm_event->event_id.header, &sample, event);76317631- ret = perf_output_begin(&handle, event,76397639+ ret = perf_output_begin(&handle, &sample, event,76327640 comm_event->event_id.header.size);7633764176347642 if (ret)···7728773677297737 perf_event_header__init_id(&namespaces_event->event_id.header,77307738 &sample, event);77317731- ret = perf_output_begin(&handle, event,77397739+ ret = perf_output_begin(&handle, &sample, event,77327740 namespaces_event->event_id.header.size);77337741 if (ret)77347742 goto out;···7855786378567864 perf_event_header__init_id(&cgroup_event->event_id.header,78577865 &sample, event);78587858- ret = perf_output_begin(&handle, event,78667866+ ret = perf_output_begin(&handle, &sample, event,78597867 cgroup_event->event_id.header.size);78607868 if (ret)78617869 goto out;···79817989 }7982799079837991 perf_event_header__init_id(&mmap_event->event_id.header, &sample, event);79847984- ret = perf_output_begin(&handle, event,79927992+ ret = perf_output_begin(&handle, &sample, event,79857993 mmap_event->event_id.header.size);79867994 if (ret)79877995 goto out;···82918299 int ret;8292830082938301 perf_event_header__init_id(&rec.header, &sample, event);82948294- ret = perf_output_begin(&handle, event, rec.header.size);83028302+ ret = perf_output_begin(&handle, &sample, event, rec.header.size);8295830382968304 if (ret)82978305 return;···8325833383268334 perf_event_header__init_id(&lost_samples_event.header, &sample, event);8327833583288328- ret = perf_output_begin(&handle, event,83368336+ ret = perf_output_begin(&handle, &sample, event,83298337 lost_samples_event.header.size);83308338 if (ret)83318339 return;···8380838883818389 perf_event_header__init_id(&se->event_id.header, &sample, event);8382839083838383- ret = perf_output_begin(&handle, event, se->event_id.header.size);83918391+ ret = perf_output_begin(&handle, &sample, event, se->event_id.header.size);83848392 if (ret)83858393 return;83868394···8455846384568464 perf_event_header__init_id(&throttle_event.header, &sample, event);8457846584588458- ret = perf_output_begin(&handle, event,84668466+ ret = perf_output_begin(&handle, &sample, event,84598467 throttle_event.header.size);84608468 if (ret)84618469 return;···8498850684998507 perf_event_header__init_id(&ksymbol_event->event_id.header,85008508 &sample, event);85018501- ret = perf_output_begin(&handle, event,85098509+ ret = perf_output_begin(&handle, &sample, event,85028510 ksymbol_event->event_id.header.size);85038511 if (ret)85048512 return;···8588859685898597 perf_event_header__init_id(&bpf_event->event_id.header,85908598 &sample, event);85918591- ret = perf_output_begin(&handle, event,85998599+ ret = perf_output_begin(&handle, data, event,85928600 bpf_event->event_id.header.size);85938601 if (ret)85948602 return;···8697870586988706 perf_event_header__init_id(&text_poke_event->event_id.header, &sample, event);8699870787008700- ret = perf_output_begin(&handle, event, text_poke_event->event_id.header.size);87088708+ ret = perf_output_begin(&handle, &sample, event,87098709+ text_poke_event->event_id.header.size);87018710 if (ret)87028711 return;87038712···87798786 rec.tid = perf_event_tid(event, current);8780878787818788 perf_event_header__init_id(&rec.header, &sample, event);87828782- ret = perf_output_begin(&handle, event, rec.header.size);87898789+ ret = perf_output_begin(&handle, &sample, event, rec.header.size);8783879087848791 if (ret)87858792 return;
+5-9
kernel/events/internal.h
···205205206206static inline int get_recursion_context(int *recursion)207207{208208- int rctx;208208+ unsigned int pc = preempt_count();209209+ unsigned char rctx = 0;209210210210- if (unlikely(in_nmi()))211211- rctx = 3;212212- else if (in_irq())213213- rctx = 2;214214- else if (in_softirq())215215- rctx = 1;216216- else217217- rctx = 0;211211+ rctx += !!(pc & (NMI_MASK));212212+ rctx += !!(pc & (NMI_MASK | HARDIRQ_MASK));213213+ rctx += !!(pc & (NMI_MASK | HARDIRQ_MASK | SOFTIRQ_OFFSET));218214219215 if (recursion[rctx])220216 return -1;
···788788 */789789 if (pi_state->owner) {790790 struct task_struct *owner;791791+ unsigned long flags;791792792792- raw_spin_lock_irq(&pi_state->pi_mutex.wait_lock);793793+ raw_spin_lock_irqsave(&pi_state->pi_mutex.wait_lock, flags);793794 owner = pi_state->owner;794795 if (owner) {795796 raw_spin_lock(&owner->pi_lock);···798797 raw_spin_unlock(&owner->pi_lock);799798 }800799 rt_mutex_proxy_unlock(&pi_state->pi_mutex, owner);801801- raw_spin_unlock_irq(&pi_state->pi_mutex.wait_lock);800800+ raw_spin_unlock_irqrestore(&pi_state->pi_mutex.wait_lock, flags);802801 }803802804803 if (current->pi_state_cache) {
+9-10
kernel/locking/lockdep.c
···27652765 * (Note that this has to be done separately, because the graph cannot27662766 * detect such classes of deadlocks.)27672767 *27682768- * Returns: 0 on deadlock detected, 1 on OK, 2 on recursive read27682768+ * Returns: 0 on deadlock detected, 1 on OK, 2 if another lock with the same27692769+ * lock class is held but nest_lock is also held, i.e. we rely on the27702770+ * nest_lock to avoid the deadlock.27692771 */27702772static int27712773check_deadlock(struct task_struct *curr, struct held_lock *next)···27902788 * lock class (i.e. read_lock(lock)+read_lock(lock)):27912789 */27922790 if ((next->read == 2) && prev->read)27932793- return 2;27912791+ continue;2794279227952793 /*27962794 * We're holding the nest_lock, which serializes this lock's···35953593 if (!ret)35963594 return 0;35973595 /*35983598- * Mark recursive read, as we jump over it when35993599- * building dependencies (just like we jump over36003600- * trylock entries):36013601- */36023602- if (ret == 2)36033603- hlock->read = 2;36043604- /*36053596 * Add dependency only if this lock is not the head36063606- * of the chain, and if it's not a secondary read-lock:35973597+ * of the chain, and if the new lock introduces no more35983598+ * lock dependency (because we already hold a lock with the35993599+ * same lock class) nor deadlock (because the nest_lock36003600+ * serializes nesting locks), see the comments for36013601+ * check_deadlock().36073602 */36083603 if (!chain_head && ret != 2) {36093604 if (!check_prevs_add(curr, hlock))
···40774077 smp_mb(); /* Ensure RCU read-side usage follows above initialization. */40784078}4079407940804080-#ifdef CONFIG_HOTPLUG_CPU40814080/*40824081 * The outgoing function has no further need of RCU, so remove it from40834082 * the rcu_node tree's ->qsmaskinitnext bit masks.···41164117 rdp->cpu_started = false;41174118}4118411941204120+#ifdef CONFIG_HOTPLUG_CPU41194121/*41204122 * The outgoing CPU has just passed through the dying-idle state, and we41214123 * are being invoked from the CPU that was IPIed to continue the offline
+17-5
kernel/rcu/tree_stall.h
···249249250250/*251251 * Scan the current list of tasks blocked within RCU read-side critical252252- * sections, printing out the tid of each.252252+ * sections, printing out the tid of each of the first few of them.253253 */254254-static int rcu_print_task_stall(struct rcu_node *rnp)254254+static int rcu_print_task_stall(struct rcu_node *rnp, unsigned long flags)255255+ __releases(rnp->lock)255256{257257+ int i = 0;256258 int ndetected = 0;257259 struct rcu_stall_chk_rdr rscr;258260 struct task_struct *t;261261+ struct task_struct *ts[8];259262260263 if (!rcu_preempt_blocked_readers_cgp(rnp))261264 return 0;···267264 t = list_entry(rnp->gp_tasks->prev,268265 struct task_struct, rcu_node_entry);269266 list_for_each_entry_continue(t, &rnp->blkd_tasks, rcu_node_entry) {267267+ get_task_struct(t);268268+ ts[i++] = t;269269+ if (i >= ARRAY_SIZE(ts))270270+ break;271271+ }272272+ raw_spin_unlock_irqrestore_rcu_node(rnp, flags);273273+ for (i--; i; i--) {274274+ t = ts[i];270275 if (!try_invoke_on_locked_down_task(t, check_slow_task, &rscr))271276 pr_cont(" P%d", t->pid);272277 else···284273 ".q"[rscr.rs.b.need_qs],285274 ".e"[rscr.rs.b.exp_hint],286275 ".l"[rscr.on_blkd_list]);276276+ put_task_struct(t);287277 ndetected++;288278 }289279 pr_cont("\n");···305293 * Because preemptible RCU does not exist, we never have to check for306294 * tasks blocked within RCU read-side critical sections.307295 */308308-static int rcu_print_task_stall(struct rcu_node *rnp)296296+static int rcu_print_task_stall(struct rcu_node *rnp, unsigned long flags)309297{298298+ raw_spin_unlock_irqrestore_rcu_node(rnp, flags);310299 return 0;311300}312301#endif /* #else #ifdef CONFIG_PREEMPT_RCU */···485472 pr_err("INFO: %s detected stalls on CPUs/tasks:\n", rcu_state.name);486473 rcu_for_each_leaf_node(rnp) {487474 raw_spin_lock_irqsave_rcu_node(rnp, flags);488488- ndetected += rcu_print_task_stall(rnp);489475 if (rnp->qsmask != 0) {490476 for_each_leaf_node_possible_cpu(rnp, cpu)491477 if (rnp->qsmask & leaf_node_cpu_bit(rnp, cpu)) {···492480 ndetected++;493481 }494482 }495495- raw_spin_unlock_irqrestore_rcu_node(rnp, flags);483483+ ndetected += rcu_print_task_stall(rnp, flags); // Releases rnp->lock.496484 }497485498486 for_each_possible_cpu(cpu)
+14-14
kernel/reboot.c
···551551 break;552552553553 case 's':554554- {555555- int rc;556556-557557- if (isdigit(*(str+1))) {558558- rc = kstrtoint(str+1, 0, &reboot_cpu);559559- if (rc)560560- return rc;561561- } else if (str[1] == 'm' && str[2] == 'p' &&562562- isdigit(*(str+3))) {563563- rc = kstrtoint(str+3, 0, &reboot_cpu);564564- if (rc)565565- return rc;566566- } else554554+ if (isdigit(*(str+1)))555555+ reboot_cpu = simple_strtoul(str+1, NULL, 0);556556+ else if (str[1] == 'm' && str[2] == 'p' &&557557+ isdigit(*(str+3)))558558+ reboot_cpu = simple_strtoul(str+3, NULL, 0);559559+ else567560 *mode = REBOOT_SOFT;561561+ if (reboot_cpu >= num_possible_cpus()) {562562+ pr_err("Ignoring the CPU number in reboot= option. "563563+ "CPU %d exceeds possible cpu number %d\n",564564+ reboot_cpu, num_possible_cpus());565565+ reboot_cpu = 0;566566+ break;567567+ }568568 break;569569- }569569+570570 case 'g':571571 *mode = REBOOT_GPIO;572572 break;
+6-6
kernel/sched/debug.c
···251251 unsigned long flags = *(unsigned long *)table->data;252252 size_t data_size = 0;253253 size_t len = 0;254254- char *tmp;254254+ char *tmp, *buf;255255 int idx;256256257257 if (write)···269269 return 0;270270 }271271272272- tmp = kcalloc(data_size + 1, sizeof(*tmp), GFP_KERNEL);273273- if (!tmp)272272+ buf = kcalloc(data_size + 1, sizeof(*buf), GFP_KERNEL);273273+ if (!buf)274274 return -ENOMEM;275275276276 for_each_set_bit(idx, &flags, __SD_FLAG_CNT) {277277 char *name = sd_flag_debug[idx].name;278278279279- len += snprintf(tmp + len, strlen(name) + 2, "%s ", name);279279+ len += snprintf(buf + len, strlen(name) + 2, "%s ", name);280280 }281281282282- tmp += *ppos;282282+ tmp = buf + *ppos;283283 len -= *ppos;284284285285 if (len > *lenp)···294294 *lenp = len;295295 *ppos += len;296296297297- kfree(tmp);297297+ kfree(buf);298298299299 return 0;300300}
+45-25
kernel/sched/fair.c
···61726172static int61736173select_idle_capacity(struct task_struct *p, struct sched_domain *sd, int target)61746174{61756175- unsigned long best_cap = 0;61756175+ unsigned long task_util, best_cap = 0;61766176 int cpu, best_cpu = -1;61776177 struct cpumask *cpus;6178617861796179- sync_entity_load_avg(&p->se);61806180-61816179 cpus = this_cpu_cpumask_var_ptr(select_idle_mask);61826180 cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr);61816181+61826182+ task_util = uclamp_task_util(p);6183618361846184 for_each_cpu_wrap(cpu, cpus, target) {61856185 unsigned long cpu_cap = capacity_of(cpu);6186618661876187 if (!available_idle_cpu(cpu) && !sched_idle_cpu(cpu))61886188 continue;61896189- if (task_fits_capacity(p, cpu_cap))61896189+ if (fits_capacity(task_util, cpu_cap))61906190 return cpu;6191619161926192 if (cpu_cap > best_cap) {···61986198 return best_cpu;61996199}6200620062016201+static inline bool asym_fits_capacity(int task_util, int cpu)62026202+{62036203+ if (static_branch_unlikely(&sched_asym_cpucapacity))62046204+ return fits_capacity(task_util, capacity_of(cpu));62056205+62066206+ return true;62076207+}62086208+62016209/*62026210 * Try and locate an idle core/thread in the LLC cache domain.62036211 */62046212static int select_idle_sibling(struct task_struct *p, int prev, int target)62056213{62066214 struct sched_domain *sd;62156215+ unsigned long task_util;62076216 int i, recent_used_cpu;6208621762096218 /*62106210- * For asymmetric CPU capacity systems, our domain of interest is62116211- * sd_asym_cpucapacity rather than sd_llc.62196219+ * On asymmetric system, update task utilization because we will check62206220+ * that the task fits with cpu's capacity.62126221 */62136222 if (static_branch_unlikely(&sched_asym_cpucapacity)) {62146214- sd = rcu_dereference(per_cpu(sd_asym_cpucapacity, target));62156215- /*62166216- * On an asymmetric CPU capacity system where an exclusive62176217- * cpuset defines a symmetric island (i.e. one unique62186218- * capacity_orig value through the cpuset), the key will be set62196219- * but the CPUs within that cpuset will not have a domain with62206220- * SD_ASYM_CPUCAPACITY. These should follow the usual symmetric62216221- * capacity path.62226222- */62236223- if (!sd)62246224- goto symmetric;62256225-62266226- i = select_idle_capacity(p, sd, target);62276227- return ((unsigned)i < nr_cpumask_bits) ? i : target;62236223+ sync_entity_load_avg(&p->se);62246224+ task_util = uclamp_task_util(p);62286225 }6229622662306230-symmetric:62316231- if (available_idle_cpu(target) || sched_idle_cpu(target))62276227+ if ((available_idle_cpu(target) || sched_idle_cpu(target)) &&62286228+ asym_fits_capacity(task_util, target))62326229 return target;6233623062346231 /*62356232 * If the previous CPU is cache affine and idle, don't be stupid:62366233 */62376234 if (prev != target && cpus_share_cache(prev, target) &&62386238- (available_idle_cpu(prev) || sched_idle_cpu(prev)))62356235+ (available_idle_cpu(prev) || sched_idle_cpu(prev)) &&62366236+ asym_fits_capacity(task_util, prev))62396237 return prev;6240623862416239 /*···62566258 recent_used_cpu != target &&62576259 cpus_share_cache(recent_used_cpu, target) &&62586260 (available_idle_cpu(recent_used_cpu) || sched_idle_cpu(recent_used_cpu)) &&62596259- cpumask_test_cpu(p->recent_used_cpu, p->cpus_ptr)) {62616261+ cpumask_test_cpu(p->recent_used_cpu, p->cpus_ptr) &&62626262+ asym_fits_capacity(task_util, recent_used_cpu)) {62606263 /*62616264 * Replace recent_used_cpu with prev as it is a potential62626265 * candidate for the next wake:62636266 */62646267 p->recent_used_cpu = prev;62656268 return recent_used_cpu;62696269+ }62706270+62716271+ /*62726272+ * For asymmetric CPU capacity systems, our domain of interest is62736273+ * sd_asym_cpucapacity rather than sd_llc.62746274+ */62756275+ if (static_branch_unlikely(&sched_asym_cpucapacity)) {62766276+ sd = rcu_dereference(per_cpu(sd_asym_cpucapacity, target));62776277+ /*62786278+ * On an asymmetric CPU capacity system where an exclusive62796279+ * cpuset defines a symmetric island (i.e. one unique62806280+ * capacity_orig value through the cpuset), the key will be set62816281+ * but the CPUs within that cpuset will not have a domain with62826282+ * SD_ASYM_CPUCAPACITY. These should follow the usual symmetric62836283+ * capacity path.62846284+ */62856285+ if (sd) {62866286+ i = select_idle_capacity(p, sd, target);62876287+ return ((unsigned)i < nr_cpumask_bits) ? i : target;62886288+ }62666289 }6267629062686291 sd = rcu_dereference(per_cpu(sd_llc, target));···90509031 * emptying busiest.90519032 */90529033 if (local->group_type == group_has_spare) {90539053- if (busiest->group_type > group_fully_busy) {90349034+ if ((busiest->group_type > group_fully_busy) &&90359035+ !(env->sd->flags & SD_SHARE_PKG_RESOURCES)) {90549036 /*90559037 * If busiest is overloaded, try to fill spare90569038 * capacity. This might end up creating spare capacity
+11-1
kernel/trace/bpf_trace.c
···184184{185185 int ret;186186187187+ /*188188+ * NB: We rely on strncpy_from_user() not copying junk past the NUL189189+ * terminator into `dst`.190190+ *191191+ * strncpy_from_user() does long-sized strides in the fast path. If the192192+ * strncpy does not mask out the bytes after the NUL in `unsafe_ptr`,193193+ * then there could be junk after the NUL in `dst`. If user takes `dst`194194+ * and keys a hash map with it, then semantically identical strings can195195+ * occupy multiple entries in the map.196196+ */187197 ret = strncpy_from_user_nofault(dst, unsafe_ptr, size);188198 if (unlikely(ret < 0))189199 memset(dst, 0, size);···12291219 *btf = bpf_get_btf_vmlinux();1230122012311221 if (IS_ERR_OR_NULL(*btf))12321232- return PTR_ERR(*btf);12221222+ return IS_ERR(*btf) ? PTR_ERR(*btf) : -EINVAL;1233122312341224 if (ptr->type_id > 0)12351225 *btf_id = ptr->type_id;
+2-2
kernel/watchdog.c
···4444int __read_mostly watchdog_thresh = 10;4545static int __read_mostly nmi_watchdog_available;46464747-static struct cpumask watchdog_allowed_mask __read_mostly;4848-4947struct cpumask watchdog_cpumask __read_mostly;5048unsigned long *watchdog_cpumask_bits = cpumask_bits(&watchdog_cpumask);5149···159161#ifdef CONFIG_SMP160162int __read_mostly sysctl_softlockup_all_cpu_backtrace;161163#endif164164+165165+static struct cpumask watchdog_allowed_mask __read_mostly;162166163167/* Global variables, exported for sysctl */164168unsigned int __read_mostly softlockup_panic =
+17-2
lib/strncpy_from_user.c
···3535 goto byte_at_a_time;36363737 while (max >= sizeof(unsigned long)) {3838- unsigned long c, data;3838+ unsigned long c, data, mask;39394040 /* Fall back to byte-at-a-time if we get a page fault */4141 unsafe_get_user(c, (unsigned long __user *)(src+res), byte_at_a_time);42424343- *(unsigned long *)(dst+res) = c;4343+ /*4444+ * Note that we mask out the bytes following the NUL. This is4545+ * important to do because string oblivious code may read past4646+ * the NUL. For those routines, we don't want to give them4747+ * potentially random bytes after the NUL in `src`.4848+ *4949+ * One example of such code is BPF map keys. BPF treats map keys5050+ * as an opaque set of bytes. Without the post-NUL mask, any BPF5151+ * maps keyed by strings returned from strncpy_from_user() may5252+ * have multiple entries for semantically identical strings.5353+ */4454 if (has_zero(c, &data, &constants)) {4555 data = prep_zero_mask(c, data, &constants);4656 data = create_zero_mask(data);5757+ mask = zero_bytemask(data);5858+ *(unsigned long *)(dst+res) = c & mask;4759 return res + find_zero(data);4860 }6161+6262+ *(unsigned long *)(dst+res) = c;6363+4964 res += sizeof(unsigned long);5065 max -= sizeof(unsigned long);5166 }
+8-4
mm/compaction.c
···817817 * delay for some time until fewer pages are isolated818818 */819819 while (unlikely(too_many_isolated(pgdat))) {820820+ /* stop isolation if there are still pages not migrated */821821+ if (cc->nr_migratepages)822822+ return 0;823823+820824 /* async migration should just abort */821825 if (cc->mode == MIGRATE_ASYNC)822826 return 0;···1016101210171013isolate_success:10181014 list_add(&page->lru, &cc->migratepages);10191019- cc->nr_migratepages++;10201020- nr_isolated++;10151015+ cc->nr_migratepages += compound_nr(page);10161016+ nr_isolated += compound_nr(page);1021101710221018 /*10231019 * Avoid isolating too much unless this block is being···10251021 * or a lock is contended. For contention, isolate quickly to10261022 * potentially remove one source of contention.10271023 */10281028- if (cc->nr_migratepages == COMPACT_CLUSTER_MAX &&10241024+ if (cc->nr_migratepages >= COMPACT_CLUSTER_MAX &&10291025 !cc->rescan && !cc->contended) {10301026 ++low_pfn;10311027 break;···11361132 if (!pfn)11371133 break;1138113411391139- if (cc->nr_migratepages == COMPACT_CLUSTER_MAX)11351135+ if (cc->nr_migratepages >= COMPACT_CLUSTER_MAX)11401136 break;11411137 }11421138
+10-4
mm/gup.c
···16471647 /*16481648 * drop the above get_user_pages reference.16491649 */16501650- for (i = 0; i < nr_pages; i++)16511651- put_page(pages[i]);16501650+ if (gup_flags & FOLL_PIN)16511651+ unpin_user_pages(pages, nr_pages);16521652+ else16531653+ for (i = 0; i < nr_pages; i++)16541654+ put_page(pages[i]);1652165516531656 if (migrate_pages(&cma_page_list, alloc_migration_target, NULL,16541657 (unsigned long)&mtc, MIGRATE_SYNC, MR_CONTIG_RANGE)) {···17311728 goto out;1732172917331730 if (check_dax_vmas(vmas_tmp, rc)) {17341734- for (i = 0; i < rc; i++)17351735- put_page(pages[i]);17311731+ if (gup_flags & FOLL_PIN)17321732+ unpin_user_pages(pages, rc);17331733+ else17341734+ for (i = 0; i < rc; i++)17351735+ put_page(pages[i]);17361736 rc = -EOPNOTSUPP;17371737 goto out;17381738 }
+5-85
mm/hugetlb.c
···15681568}1569156915701570/*15711571- * Find address_space associated with hugetlbfs page.15721572- * Upon entry page is locked and page 'was' mapped although mapped state15731573- * could change. If necessary, use anon_vma to find vma and associated15741574- * address space. The returned mapping may be stale, but it can not be15751575- * invalid as page lock (which is held) is required to destroy mapping.15761576- */15771577-static struct address_space *_get_hugetlb_page_mapping(struct page *hpage)15781578-{15791579- struct anon_vma *anon_vma;15801580- pgoff_t pgoff_start, pgoff_end;15811581- struct anon_vma_chain *avc;15821582- struct address_space *mapping = page_mapping(hpage);15831583-15841584- /* Simple file based mapping */15851585- if (mapping)15861586- return mapping;15871587-15881588- /*15891589- * Even anonymous hugetlbfs mappings are associated with an15901590- * underlying hugetlbfs file (see hugetlb_file_setup in mmap15911591- * code). Find a vma associated with the anonymous vma, and15921592- * use the file pointer to get address_space.15931593- */15941594- anon_vma = page_lock_anon_vma_read(hpage);15951595- if (!anon_vma)15961596- return mapping; /* NULL */15971597-15981598- /* Use first found vma */15991599- pgoff_start = page_to_pgoff(hpage);16001600- pgoff_end = pgoff_start + pages_per_huge_page(page_hstate(hpage)) - 1;16011601- anon_vma_interval_tree_foreach(avc, &anon_vma->rb_root,16021602- pgoff_start, pgoff_end) {16031603- struct vm_area_struct *vma = avc->vma;16041604-16051605- mapping = vma->vm_file->f_mapping;16061606- break;16071607- }16081608-16091609- anon_vma_unlock_read(anon_vma);16101610- return mapping;16111611-}16121612-16131613-/*16141571 * Find and lock address space (mapping) in write mode.16151572 *16161616- * Upon entry, the page is locked which allows us to find the mapping16171617- * even in the case of an anon page. However, locking order dictates16181618- * the i_mmap_rwsem be acquired BEFORE the page lock. This is hugetlbfs16191619- * specific. So, we first try to lock the sema while still holding the16201620- * page lock. If this works, great! If not, then we need to drop the16211621- * page lock and then acquire i_mmap_rwsem and reacquire page lock. Of16221622- * course, need to revalidate state along the way.15731573+ * Upon entry, the page is locked which means that page_mapping() is15741574+ * stable. Due to locking order, we can only trylock_write. If we can15751575+ * not get the lock, simply return NULL to caller.16231576 */16241577struct address_space *hugetlb_page_mapping_lock_write(struct page *hpage)16251578{16261626- struct address_space *mapping, *mapping2;15791579+ struct address_space *mapping = page_mapping(hpage);1627158016281628- mapping = _get_hugetlb_page_mapping(hpage);16291629-retry:16301581 if (!mapping)16311582 return mapping;1632158316331633- /*16341634- * If no contention, take lock and return16351635- */16361584 if (i_mmap_trylock_write(mapping))16371585 return mapping;1638158616391639- /*16401640- * Must drop page lock and wait on mapping sema.16411641- * Note: Once page lock is dropped, mapping could become invalid.16421642- * As a hack, increase map count until we lock page again.16431643- */16441644- atomic_inc(&hpage->_mapcount);16451645- unlock_page(hpage);16461646- i_mmap_lock_write(mapping);16471647- lock_page(hpage);16481648- atomic_add_negative(-1, &hpage->_mapcount);16491649-16501650- /* verify page is still mapped */16511651- if (!page_mapped(hpage)) {16521652- i_mmap_unlock_write(mapping);16531653- return NULL;16541654- }16551655-16561656- /*16571657- * Get address space again and verify it is the same one16581658- * we locked. If not, drop lock and retry.16591659- */16601660- mapping2 = _get_hugetlb_page_mapping(hpage);16611661- if (mapping2 != mapping) {16621662- i_mmap_unlock_write(mapping);16631663- mapping = mapping2;16641664- goto retry;16651665- }16661666-16671667- return mapping;15871587+ return NULL;16681588}1669158916701590pgoff_t __basepage_index(struct page *page)
+17-19
mm/memory-failure.c
···10571057 if (!PageHuge(hpage)) {10581058 unmap_success = try_to_unmap(hpage, ttu);10591059 } else {10601060- /*10611061- * For hugetlb pages, try_to_unmap could potentially call10621062- * huge_pmd_unshare. Because of this, take semaphore in10631063- * write mode here and set TTU_RMAP_LOCKED to indicate we10641064- * have taken the lock at this higer level.10651065- *10661066- * Note that the call to hugetlb_page_mapping_lock_write10671067- * is necessary even if mapping is already set. It handles10681068- * ugliness of potentially having to drop page lock to obtain10691069- * i_mmap_rwsem.10701070- */10711071- mapping = hugetlb_page_mapping_lock_write(hpage);10721072-10731073- if (mapping) {10741074- unmap_success = try_to_unmap(hpage,10601060+ if (!PageAnon(hpage)) {10611061+ /*10621062+ * For hugetlb pages in shared mappings, try_to_unmap10631063+ * could potentially call huge_pmd_unshare. Because of10641064+ * this, take semaphore in write mode here and set10651065+ * TTU_RMAP_LOCKED to indicate we have taken the lock10661066+ * at this higer level.10671067+ */10681068+ mapping = hugetlb_page_mapping_lock_write(hpage);10691069+ if (mapping) {10701070+ unmap_success = try_to_unmap(hpage,10751071 ttu|TTU_RMAP_LOCKED);10761076- i_mmap_unlock_write(mapping);10721072+ i_mmap_unlock_write(mapping);10731073+ } else {10741074+ pr_info("Memory failure: %#lx: could not lock mapping for mapped huge page\n", pfn);10751075+ unmap_success = false;10761076+ }10771077 } else {10781078- pr_info("Memory failure: %#lx: could not find mapping for mapped huge page\n",10791079- pfn);10801080- unmap_success = false;10781078+ unmap_success = try_to_unmap(hpage, ttu);10811079 }10821080 }10831081 if (!unmap_success)
+24-20
mm/migrate.c
···13281328 goto put_anon;1329132913301330 if (page_mapped(hpage)) {13311331- /*13321332- * try_to_unmap could potentially call huge_pmd_unshare.13331333- * Because of this, take semaphore in write mode here and13341334- * set TTU_RMAP_LOCKED to let lower levels know we have13351335- * taken the lock.13361336- */13371337- mapping = hugetlb_page_mapping_lock_write(hpage);13381338- if (unlikely(!mapping))13391339- goto unlock_put_anon;13311331+ bool mapping_locked = false;13321332+ enum ttu_flags ttu = TTU_MIGRATION|TTU_IGNORE_MLOCK|13331333+ TTU_IGNORE_ACCESS;1340133413411341- try_to_unmap(hpage,13421342- TTU_MIGRATION|TTU_IGNORE_MLOCK|TTU_IGNORE_ACCESS|13431343- TTU_RMAP_LOCKED);13351335+ if (!PageAnon(hpage)) {13361336+ /*13371337+ * In shared mappings, try_to_unmap could potentially13381338+ * call huge_pmd_unshare. Because of this, take13391339+ * semaphore in write mode here and set TTU_RMAP_LOCKED13401340+ * to let lower levels know we have taken the lock.13411341+ */13421342+ mapping = hugetlb_page_mapping_lock_write(hpage);13431343+ if (unlikely(!mapping))13441344+ goto unlock_put_anon;13451345+13461346+ mapping_locked = true;13471347+ ttu |= TTU_RMAP_LOCKED;13481348+ }13491349+13501350+ try_to_unmap(hpage, ttu);13441351 page_was_mapped = 1;13451345- /*13461346- * Leave mapping locked until after subsequent call to13471347- * remove_migration_ptes()13481348- */13521352+13531353+ if (mapping_locked)13541354+ i_mmap_unlock_write(mapping);13491355 }1350135613511357 if (!page_mapped(hpage))13521358 rc = move_to_new_page(new_hpage, hpage, mode);1353135913541354- if (page_was_mapped) {13601360+ if (page_was_mapped)13551361 remove_migration_ptes(hpage,13561356- rc == MIGRATEPAGE_SUCCESS ? new_hpage : hpage, true);13571357- i_mmap_unlock_write(mapping);13581358- }13621362+ rc == MIGRATEPAGE_SUCCESS ? new_hpage : hpage, false);1359136313601364unlock_put_anon:13611365 unlock_page(new_hpage);
+5
mm/page_alloc.c
···51035103 if (!page_ref_sub_and_test(page, nc->pagecnt_bias))51045104 goto refill;5105510551065106+ if (unlikely(nc->pfmemalloc)) {51075107+ free_the_page(page, compound_order(page));51085108+ goto refill;51095109+ }51105110+51065111#if (PAGE_SIZE < PAGE_FRAG_CACHE_MAX_SIZE)51075112 /* if size can vary use size else just use PAGE_SIZE */51085113 size = nc->size;
···14131413 /*14141414 * If sharing is possible, start and end will be adjusted14151415 * accordingly.14161416- *14171417- * If called for a huge page, caller must hold i_mmap_rwsem14181418- * in write mode as it is possible to call huge_pmd_unshare.14191416 */14201417 adjust_range_if_pmd_sharing_possible(vma, &range.start,14211418 &range.end);···14591462 subpage = page - page_to_pfn(page) + pte_pfn(*pvmw.pte);14601463 address = pvmw.address;1461146414621462- if (PageHuge(page)) {14651465+ if (PageHuge(page) && !PageAnon(page)) {14631466 /*14641467 * To call huge_pmd_unshare, i_mmap_rwsem must be14651468 * held in write mode. Caller needs to explicitly
···15161516 nr_reclaimed = shrink_page_list(&clean_pages, zone->zone_pgdat, &sc,15171517 TTU_IGNORE_ACCESS, &stat, true);15181518 list_splice(&clean_pages, page_list);15191519- mod_node_page_state(zone->zone_pgdat, NR_ISOLATED_FILE, -nr_reclaimed);15191519+ mod_node_page_state(zone->zone_pgdat, NR_ISOLATED_FILE,15201520+ -(long)nr_reclaimed);15201521 /*15211522 * Since lazyfree pages are isolated from file LRU from the beginning,15221523 * they will rotate back to anonymous LRU in the end if it failed to···15271526 mod_node_page_state(zone->zone_pgdat, NR_ISOLATED_ANON,15281527 stat.nr_lazyfree_fail);15291528 mod_node_page_state(zone->zone_pgdat, NR_ISOLATED_FILE,15301530- -stat.nr_lazyfree_fail);15291529+ -(long)stat.nr_lazyfree_fail);15311530 return nr_reclaimed;15321531}15331532
···677677{678678 struct canfd_frame *cfd = (struct canfd_frame *)skb->data;679679680680- if (unlikely(dev->type != ARPHRD_CAN || skb->len != CAN_MTU ||681681- cfd->len > CAN_MAX_DLEN)) {682682- pr_warn_once("PF_CAN: dropped non conform CAN skbuf: dev type %d, len %d, datalen %d\n",680680+ if (unlikely(dev->type != ARPHRD_CAN || skb->len != CAN_MTU)) {681681+ pr_warn_once("PF_CAN: dropped non conform CAN skbuff: dev type %d, len %d\n",682682+ dev->type, skb->len);683683+ goto free_skb;684684+ }685685+686686+ /* This check is made separately since cfd->len would be uninitialized if skb->len = 0. */687687+ if (unlikely(cfd->len > CAN_MAX_DLEN)) {688688+ pr_warn_once("PF_CAN: dropped non conform CAN skbuff: dev type %d, len %d, datalen %d\n",683689 dev->type, skb->len, cfd->len);684684- kfree_skb(skb);685685- return NET_RX_DROP;690690+ goto free_skb;686691 }687692688693 can_receive(skb, dev);689694 return NET_RX_SUCCESS;695695+696696+free_skb:697697+ kfree_skb(skb);698698+ return NET_RX_DROP;690699}691700692701static int canfd_rcv(struct sk_buff *skb, struct net_device *dev,···703694{704695 struct canfd_frame *cfd = (struct canfd_frame *)skb->data;705696706706- if (unlikely(dev->type != ARPHRD_CAN || skb->len != CANFD_MTU ||707707- cfd->len > CANFD_MAX_DLEN)) {708708- pr_warn_once("PF_CAN: dropped non conform CAN FD skbuf: dev type %d, len %d, datalen %d\n",697697+ if (unlikely(dev->type != ARPHRD_CAN || skb->len != CANFD_MTU)) {698698+ pr_warn_once("PF_CAN: dropped non conform CAN FD skbuff: dev type %d, len %d\n",699699+ dev->type, skb->len);700700+ goto free_skb;701701+ }702702+703703+ /* This check is made separately since cfd->len would be uninitialized if skb->len = 0. */704704+ if (unlikely(cfd->len > CANFD_MAX_DLEN)) {705705+ pr_warn_once("PF_CAN: dropped non conform CAN FD skbuff: dev type %d, len %d, datalen %d\n",709706 dev->type, skb->len, cfd->len);710710- kfree_skb(skb);711711- return NET_RX_DROP;707707+ goto free_skb;712708 }713709714710 can_receive(skb, dev);715711 return NET_RX_SUCCESS;712712+713713+free_skb:714714+ kfree_skb(skb);715715+ return NET_RX_DROP;716716}717717718718/* af_can protocol functions */
···2929#include <linux/slab.h>3030#include <linux/export.h>3131#include <linux/if_vlan.h>3232+#include <net/dsa.h>3233#include <net/tcp.h>3334#include <net/udp.h>3435#include <net/addrconf.h>···658657659658int netpoll_setup(struct netpoll *np)660659{661661- struct net_device *ndev = NULL;660660+ struct net_device *ndev = NULL, *dev = NULL;661661+ struct net *net = current->nsproxy->net_ns;662662 struct in_device *in_dev;663663 int err;664664665665 rtnl_lock();666666- if (np->dev_name[0]) {667667- struct net *net = current->nsproxy->net_ns;666666+ if (np->dev_name[0])668667 ndev = __dev_get_by_name(net, np->dev_name);669669- }668668+670669 if (!ndev) {671670 np_err(np, "%s doesn't exist, aborting\n", np->dev_name);672671 err = -ENODEV;673672 goto unlock;674673 }675674 dev_hold(ndev);675675+676676+ /* bring up DSA management network devices up first */677677+ for_each_netdev(net, dev) {678678+ if (!netdev_uses_dsa(dev))679679+ continue;680680+681681+ err = dev_change_flags(dev, dev->flags | IFF_UP, NULL);682682+ if (err < 0) {683683+ np_err(np, "%s failed to open %s\n",684684+ np->dev_name, dev->name);685685+ goto put;686686+ }687687+ }676688677689 if (netdev_master_upper_dev_get(ndev)) {678690 np_err(np, "%s is a slave device, aborting\n", np->dev_name);
+74-13
net/core/skmsg.c
···170170 struct scatterlist *sge = sk_msg_elem(msg, i);171171 u32 len = sge->length;172172173173- if (charge)174174- sk_mem_uncharge(sk, len);175175- if (!msg->skb)173173+ /* When the skb owns the memory we free it from consume_skb path. */174174+ if (!msg->skb) {175175+ if (charge)176176+ sk_mem_uncharge(sk, len);176177 put_page(sg_page(sge));178178+ }177179 memset(sge, 0, sizeof(*sge));178180 return len;179181}···399397}400398EXPORT_SYMBOL_GPL(sk_msg_memcopy_from_iter);401399402402-static int sk_psock_skb_ingress(struct sk_psock *psock, struct sk_buff *skb)400400+static struct sk_msg *sk_psock_create_ingress_msg(struct sock *sk,401401+ struct sk_buff *skb)403402{404404- struct sock *sk = psock->sk;405405- int copied = 0, num_sge;406403 struct sk_msg *msg;404404+405405+ if (atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf)406406+ return NULL;407407+408408+ if (!sk_rmem_schedule(sk, skb, skb->truesize))409409+ return NULL;407410408411 msg = kzalloc(sizeof(*msg), __GFP_NOWARN | GFP_ATOMIC);409412 if (unlikely(!msg))410410- return -EAGAIN;411411- if (!sk_rmem_schedule(sk, skb, skb->len)) {412412- kfree(msg);413413- return -EAGAIN;414414- }413413+ return NULL;415414416415 sk_msg_init(msg);416416+ return msg;417417+}418418+419419+static int sk_psock_skb_ingress_enqueue(struct sk_buff *skb,420420+ struct sk_psock *psock,421421+ struct sock *sk,422422+ struct sk_msg *msg)423423+{424424+ int num_sge, copied;425425+426426+ /* skb linearize may fail with ENOMEM, but lets simply try again427427+ * later if this happens. Under memory pressure we don't want to428428+ * drop the skb. We need to linearize the skb so that the mapping429429+ * in skb_to_sgvec can not error.430430+ */431431+ if (skb_linearize(skb))432432+ return -EAGAIN;417433 num_sge = skb_to_sgvec(skb, msg->sg.data, 0, skb->len);418434 if (unlikely(num_sge < 0)) {419435 kfree(msg);420436 return num_sge;421437 }422438423423- sk_mem_charge(sk, skb->len);424439 copied = skb->len;425440 msg->sg.start = 0;426441 msg->sg.size = copied;···447428 sk_psock_queue_msg(psock, msg);448429 sk_psock_data_ready(sk, psock);449430 return copied;431431+}432432+433433+static int sk_psock_skb_ingress_self(struct sk_psock *psock, struct sk_buff *skb);434434+435435+static int sk_psock_skb_ingress(struct sk_psock *psock, struct sk_buff *skb)436436+{437437+ struct sock *sk = psock->sk;438438+ struct sk_msg *msg;439439+440440+ /* If we are receiving on the same sock skb->sk is already assigned,441441+ * skip memory accounting and owner transition seeing it already set442442+ * correctly.443443+ */444444+ if (unlikely(skb->sk == sk))445445+ return sk_psock_skb_ingress_self(psock, skb);446446+ msg = sk_psock_create_ingress_msg(sk, skb);447447+ if (!msg)448448+ return -EAGAIN;449449+450450+ /* This will transition ownership of the data from the socket where451451+ * the BPF program was run initiating the redirect to the socket452452+ * we will eventually receive this data on. The data will be released453453+ * from skb_consume found in __tcp_bpf_recvmsg() after its been copied454454+ * into user buffers.455455+ */456456+ skb_set_owner_r(skb, sk);457457+ return sk_psock_skb_ingress_enqueue(skb, psock, sk, msg);458458+}459459+460460+/* Puts an skb on the ingress queue of the socket already assigned to the461461+ * skb. In this case we do not need to check memory limits or skb_set_owner_r462462+ * because the skb is already accounted for here.463463+ */464464+static int sk_psock_skb_ingress_self(struct sk_psock *psock, struct sk_buff *skb)465465+{466466+ struct sk_msg *msg = kzalloc(sizeof(*msg), __GFP_NOWARN | GFP_ATOMIC);467467+ struct sock *sk = psock->sk;468468+469469+ if (unlikely(!msg))470470+ return -EAGAIN;471471+ sk_msg_init(msg);472472+ return sk_psock_skb_ingress_enqueue(skb, psock, sk, msg);450473}451474452475static int sk_psock_handle_skb(struct sk_psock *psock, struct sk_buff *skb,···850789 * retrying later from workqueue.851790 */852791 if (skb_queue_empty(&psock->ingress_skb)) {853853- err = sk_psock_skb_ingress(psock, skb);792792+ err = sk_psock_skb_ingress_self(psock, skb);854793 }855794 if (err < 0) {856795 skb_queue_tail(&psock->ingress_skb, skb);
···440440int nf_ct_frag6_gather(struct net *net, struct sk_buff *skb, u32 user)441441{442442 u16 savethdr = skb->transport_header;443443+ u8 nexthdr = NEXTHDR_FRAGMENT;443444 int fhoff, nhoff, ret;444445 struct frag_hdr *fhdr;445446 struct frag_queue *fq;···455454456455 if (find_prev_fhdr(skb, &prevhdr, &nhoff, &fhoff) < 0)457456 return 0;457457+458458+ /* Discard the first fragment if it does not include all headers459459+ * RFC 8200, Section 4.5460460+ */461461+ if (ipv6frag_thdr_truncated(skb, fhoff, &nexthdr)) {462462+ pr_debug("Drop incomplete fragment\n");463463+ return 0;464464+ }458465459466 if (!pskb_may_pull(skb, fhoff + sizeof(*fhdr)))460467 return -ENOMEM;
+6-20
net/ipv6/reassembly.c
···324324 struct frag_queue *fq;325325 const struct ipv6hdr *hdr = ipv6_hdr(skb);326326 struct net *net = dev_net(skb_dst(skb)->dev);327327- __be16 frag_off;328328- int iif, offset;329327 u8 nexthdr;328328+ int iif;330329331330 if (IP6CB(skb)->flags & IP6SKB_FRAGMENTED)332331 goto fail_hdr;···361362 * the source of the fragment, with the Pointer field set to zero.362363 */363364 nexthdr = hdr->nexthdr;364364- offset = ipv6_skip_exthdr(skb, skb_transport_offset(skb), &nexthdr, &frag_off);365365- if (offset >= 0) {366366- /* Check some common protocols' header */367367- if (nexthdr == IPPROTO_TCP)368368- offset += sizeof(struct tcphdr);369369- else if (nexthdr == IPPROTO_UDP)370370- offset += sizeof(struct udphdr);371371- else if (nexthdr == IPPROTO_ICMPV6)372372- offset += sizeof(struct icmp6hdr);373373- else374374- offset += 1;375375-376376- if (!(frag_off & htons(IP6_OFFSET)) && offset > skb->len) {377377- __IP6_INC_STATS(net, __in6_dev_get_safely(skb->dev),378378- IPSTATS_MIB_INHDRERRORS);379379- icmpv6_param_prob(skb, ICMPV6_HDR_INCOMP, 0);380380- return -1;381381- }365365+ if (ipv6frag_thdr_truncated(skb, skb_transport_offset(skb), &nexthdr)) {366366+ __IP6_INC_STATS(net, __in6_dev_get_safely(skb->dev),367367+ IPSTATS_MIB_INHDRERRORS);368368+ icmpv6_param_prob(skb, ICMPV6_HDR_INCOMP, 0);369369+ return -1;382370 }383371384372 iif = skb->dev ? skb->dev->ifindex : 0;
+5-22
net/mac80211/rc80211_minstrel.c
···274274 success = !!(info->flags & IEEE80211_TX_STAT_ACK);275275276276 for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) {277277- if (ar[i].idx < 0)277277+ if (ar[i].idx < 0 || !ar[i].count)278278 break;279279280280 ndx = rix_to_ndx(mi, ar[i].idx);···286286 if ((i != IEEE80211_TX_MAX_RATES - 1) && (ar[i + 1].idx < 0))287287 mi->r[ndx].stats.success += success;288288 }289289-290290- if ((info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE) && (i >= 0))291291- mi->sample_packets++;292292-293293- if (mi->sample_deferred > 0)294294- mi->sample_deferred--;295289296290 if (time_after(jiffies, mi->last_stats_update +297291 mp->update_interval / (mp->new_avg ? 2 : 1)))···361367 return;362368363369 delta = (mi->total_packets * sampling_ratio / 100) -364364- (mi->sample_packets + mi->sample_deferred / 2);370370+ mi->sample_packets;365371366372 /* delta < 0: no sampling required */367373 prev_sample = mi->prev_sample;···370376 return;371377372378 if (mi->total_packets >= 10000) {373373- mi->sample_deferred = 0;374379 mi->sample_packets = 0;375380 mi->total_packets = 0;376381 } else if (delta > mi->n_rates * 2) {···394401 * rate sampling method should be used.395402 * Respect such rates that are not sampled for 20 interations.396403 */397397- if (mrr_capable &&398398- msr->perfect_tx_time > mr->perfect_tx_time &&399399- msr->stats.sample_skipped < 20) {400400- /* Only use IEEE80211_TX_CTL_RATE_CTRL_PROBE to mark401401- * packets that have the sampling rate deferred to the402402- * second MRR stage. Increase the sample counter only403403- * if the deferred sample rate was actually used.404404- * Use the sample_deferred counter to make sure that405405- * the sampling is not done in large bursts */406406- info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE;407407- rate++;408408- mi->sample_deferred++;409409- } else {404404+ if (msr->perfect_tx_time < mr->perfect_tx_time ||405405+ msr->stats.sample_skipped >= 20) {410406 if (!msr->sample_limit)411407 return;412408···415433416434 rate->idx = mi->r[ndx].rix;417435 rate->count = minstrel_get_retry_count(&mi->r[ndx], info);436436+ info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE;418437}419438420439
-1
net/mac80211/rc80211_minstrel.h
···126126 u8 max_prob_rate;127127 unsigned int total_packets;128128 unsigned int sample_packets;129129- int sample_deferred;130129131130 unsigned int sample_row;132131 unsigned int sample_column;
···4949 int ac;50505151 if (info->flags & (IEEE80211_TX_CTL_NO_PS_BUFFER |5252- IEEE80211_TX_CTL_AMPDU)) {5252+ IEEE80211_TX_CTL_AMPDU |5353+ IEEE80211_TX_CTL_HW_80211_ENCAP)) {5354 ieee80211_free_txskb(&local->hw, skb);5455 return;5556 }···916915 ieee80211_mpsp_trigger_process(917916 ieee80211_get_qos_ctl(hdr), sta, true, acked);918917919919- if (!acked && test_sta_flag(sta, WLAN_STA_PS_STA)) {920920- /*921921- * The STA is in power save mode, so assume922922- * that this TX packet failed because of that.923923- */924924- ieee80211_handle_filtered_frame(local, sta, skb);925925- return;926926- }927927-928918 if (ieee80211_hw_check(&local->hw, HAS_RATE_CONTROL) &&929919 (ieee80211_is_data(hdr->frame_control)) &&930920 (rates_idx != -1))···11421150 -info->status.ack_signal);11431151 }11441152 } else if (test_sta_flag(sta, WLAN_STA_PS_STA)) {11531153+ /*11541154+ * The STA is in power save mode, so assume11551155+ * that this TX packet failed because of that.11561156+ */11571157+ if (skb)11581158+ ieee80211_handle_filtered_frame(local, sta, skb);11451159 return;11461160 } else if (noack_success) {11471161 /* nothing to do here, do not account as lost */
-5
net/ncsi/ncsi-manage.c
···17261726 ndp->ptype.dev = dev;17271727 dev_add_pack(&ndp->ptype);1728172817291729- /* Set up generic netlink interface */17301730- ncsi_init_netlink(dev);17311731-17321729 pdev = to_platform_device(dev->dev.parent);17331730 if (pdev) {17341731 np = pdev->dev.of_node;···18881891 spin_lock_irqsave(&ncsi_dev_lock, flags);18891892 list_del_rcu(&ndp->node);18901893 spin_unlock_irqrestore(&ncsi_dev_lock, flags);18911891-18921892- ncsi_unregister_netlink(nd->dev);1893189418941895 kfree(ndp);18951896}
+3-19
net/ncsi/ncsi-netlink.c
···766766 .n_small_ops = ARRAY_SIZE(ncsi_ops),767767};768768769769-int ncsi_init_netlink(struct net_device *dev)769769+static int __init ncsi_init_netlink(void)770770{771771- int rc;772772-773773- rc = genl_register_family(&ncsi_genl_family);774774- if (rc)775775- netdev_err(dev, "ncsi: failed to register netlink family\n");776776-777777- return rc;771771+ return genl_register_family(&ncsi_genl_family);778772}779779-780780-int ncsi_unregister_netlink(struct net_device *dev)781781-{782782- int rc;783783-784784- rc = genl_unregister_family(&ncsi_genl_family);785785- if (rc)786786- netdev_err(dev, "ncsi: failed to unregister netlink family\n");787787-788788- return rc;789789-}773773+subsys_initcall(ncsi_init_netlink);
···876876877877 rfkill->suspended = false;878878879879+ if (!rfkill->registered)880880+ return 0;881881+879882 if (!rfkill->persistent) {880883 cur = !!(rfkill->state & RFKILL_BLOCK_SW);881884 rfkill_set_block(rfkill, cur);
+2-2
net/sctp/input.c
···449449 else {450450 if (!mod_timer(&t->proto_unreach_timer,451451 jiffies + (HZ/20)))452452- sctp_association_hold(asoc);452452+ sctp_transport_hold(t);453453 }454454 } else {455455 struct net *net = sock_net(sk);···458458 "encountered!\n", __func__);459459460460 if (del_timer(&t->proto_unreach_timer))461461- sctp_association_put(asoc);461461+ sctp_transport_put(t);462462463463 sctp_do_sm(net, SCTP_EVENT_T_OTHER,464464 SCTP_ST_OTHER(SCTP_EVENT_ICMP_PROTO_UNREACH),
+2-2
net/sctp/sm_sideeffect.c
···419419 /* Try again later. */420420 if (!mod_timer(&transport->proto_unreach_timer,421421 jiffies + (HZ/20)))422422- sctp_association_hold(asoc);422422+ sctp_transport_hold(transport);423423 goto out_unlock;424424 }425425···435435436436out_unlock:437437 bh_unlock_sock(sk);438438- sctp_association_put(asoc);438438+ sctp_transport_put(transport);439439}440440441441 /* Handle the timeout of the RE-CONFIG timer. */
+1-1
net/sctp/transport.c
···133133134134 /* Delete the ICMP proto unreachable timer if it's active. */135135 if (del_timer(&transport->proto_unreach_timer))136136- sctp_association_put(transport->asoc);136136+ sctp_transport_put(transport);137137138138 sctp_transport_put(transport);139139}
+2-1
net/smc/af_smc.c
···979979980980 /* check if smc modes and versions of CLC proposal and accept match */981981 rc = smc_connect_check_aclc(ini, aclc);982982- version = aclc->hdr.version == SMC_V1 ? SMC_V1 : version;982982+ version = aclc->hdr.version == SMC_V1 ? SMC_V1 : SMC_V2;983983+ ini->smcd_version = version;983984 if (rc)984985 goto vlan_cleanup;985986
···151151 * is valid, it just won't be added to the cache.152152 */153153 new = kzalloc(sizeof(*new), GFP_ATOMIC);154154- if (!new)154154+ if (!new) {155155+ ret = -ENOMEM;155156 goto out;157157+ }156158157159 new->psec.subnet_prefix = subnet_prefix;158160 new->psec.pkey = pkey_num;
+3-5
tools/arch/x86/lib/memcpy_64.S
···1616 * to a jmp to memcpy_erms which does the REP; MOVSB mem copy.1717 */18181919-.weak memcpy2020-2119/*2220 * memcpy - Copy a memory block.2321 *···2830 * rax original destination2931 */3032SYM_FUNC_START_ALIAS(__memcpy)3131-SYM_FUNC_START_LOCAL(memcpy)3333+SYM_FUNC_START_WEAK(memcpy)3234 ALTERNATIVE_2 "jmp memcpy_orig", "", X86_FEATURE_REP_GOOD, \3335 "jmp memcpy_erms", X86_FEATURE_ERMS3436···4951 * memcpy_erms() - enhanced fast string memcpy. This is faster and5052 * simpler than memcpy. Use memcpy_erms when possible.5153 */5252-SYM_FUNC_START(memcpy_erms)5454+SYM_FUNC_START_LOCAL(memcpy_erms)5355 movq %rdi, %rax5456 movq %rdx, %rcx5557 rep movsb5658 ret5759SYM_FUNC_END(memcpy_erms)58605959-SYM_FUNC_START(memcpy_orig)6161+SYM_FUNC_START_LOCAL(memcpy_orig)6062 movq %rdi, %rax61636264 cmpq $0x20, %rdx
+6-5
tools/arch/x86/lib/memset_64.S
···44#include <linux/linkage.h>55#include <asm/cpufeatures.h>66#include <asm/alternative-asm.h>77-88-.weak memset77+#include <asm/export.h>98109/*1110 * ISO C memset - set a memory block to a byte value. This function uses fast···1718 *1819 * rax original destination1920 */2020-SYM_FUNC_START_ALIAS(memset)2121+SYM_FUNC_START_WEAK(memset)2122SYM_FUNC_START(__memset)2223 /*2324 * Some CPUs support enhanced REP MOVSB/STOSB feature. It is recommended···4344 ret4445SYM_FUNC_END(__memset)4546SYM_FUNC_END_ALIAS(memset)4747+EXPORT_SYMBOL(memset)4848+EXPORT_SYMBOL(__memset)46494750/*4851 * ISO C memset - set a memory block to a byte value. This function uses···5756 *5857 * rax original destination5958 */6060-SYM_FUNC_START(memset_erms)5959+SYM_FUNC_START_LOCAL(memset_erms)6160 movq %rdi,%r96261 movb %sil,%al6362 movq %rdx,%rcx···6665 ret6766SYM_FUNC_END(memset_erms)68676969-SYM_FUNC_START(memset_orig)6868+SYM_FUNC_START_LOCAL(memset_orig)7069 movq %rdi,%r1071707271 /* expand byte value */
···560560 const char *name, size_t sec_idx, const char *sec_name,561561 size_t sec_off, void *insn_data, size_t insn_data_sz)562562{563563- int i;564564-565563 if (insn_data_sz == 0 || insn_data_sz % BPF_INSN_SZ || sec_off % BPF_INSN_SZ) {566564 pr_warn("sec '%s': corrupted program '%s', offset %zu, size %zu\n",567565 sec_name, name, sec_off, insn_data_sz);···597599 if (!prog->insns)598600 goto errout;599601 memcpy(prog->insns, insn_data, insn_data_sz);600600-601601- for (i = 0; i < prog->insns_cnt; i++) {602602- if (insn_is_subprog_call(&prog->insns[i])) {603603- obj->has_subcalls = true;604604- break;605605- }606606- }607602608603 return 0;609604errout:···32713280static bool prog_is_subprog(const struct bpf_object *obj,32723281 const struct bpf_program *prog)32733282{32743274- return prog->sec_idx == obj->efile.text_shndx && obj->has_subcalls;32833283+ /* For legacy reasons, libbpf supports an entry-point BPF programs32843284+ * without SEC() attribute, i.e., those in the .text section. But if32853285+ * there are 2 or more such programs in the .text section, they all32863286+ * must be subprograms called from entry-point BPF programs in32873287+ * designated SEC()'tions, otherwise there is no way to distinguish32883288+ * which of those programs should be loaded vs which are a subprogram.32893289+ * Similarly, if there is a function/program in .text and at least one32903290+ * other BPF program with custom SEC() attribute, then we just assume32913291+ * .text programs are subprograms (even if they are not called from32923292+ * other programs), because libbpf never explicitly supported mixing32933293+ * SEC()-designated BPF programs and .text entry-point BPF programs.32943294+ */32953295+ return prog->sec_idx == obj->efile.text_shndx && obj->nr_programs > 1;32753296}3276329732773298struct bpf_program *
+7
tools/perf/arch/x86/tests/dwarf-unwind.c
···3838 stack_size = stack_size > STACK_SIZE ? STACK_SIZE : stack_size;39394040 memcpy(buf, (void *) sp, stack_size);4141+#ifdef MEMORY_SANITIZER4242+ /*4343+ * Copying the stack may copy msan poison, avoid false positives in the4444+ * unwinder by removing the poison here.4545+ */4646+ __msan_unpoison(buf, stack_size);4747+#endif4148 stack->data = (char *) buf;4249 stack->size = stack_size;4350 return 0;
+3
tools/perf/bench/mem-memcpy-x86-64-asm.S
···2233/* Various wrappers to make the kernel .S file build in user-space: */4455+// memcpy_orig and memcpy_erms are being defined as SYM_L_LOCAL but we need it66+#define SYM_FUNC_START_LOCAL(name) \77+ SYM_START(name, SYM_L_GLOBAL, SYM_A_ALIGN)58#define memcpy MEMCPY /* don't hide glibc's memcpy() */69#define altinstr_replacement text710#define globl p2align 4; .globl
+3
tools/perf/bench/mem-memset-x86-64-asm.S
···11/* SPDX-License-Identifier: GPL-2.0 */22+// memset_orig and memset_erms are being defined as SYM_L_LOCAL but we need it33+#define SYM_FUNC_START_LOCAL(name) \44+ SYM_START(name, SYM_L_GLOBAL, SYM_A_ALIGN)25#define memset MEMSET /* don't hide glibc's memset() */36#define altinstr_replacement text47#define globl p2align 4; .globl
+1-11
tools/perf/builtin-inject.c
···779779 dsos__hit_all(session);780780 /*781781 * The AUX areas have been removed and replaced with782782- * synthesized hardware events, so clear the feature flag and783783- * remove the evsel.782782+ * synthesized hardware events, so clear the feature flag.784783 */785784 if (inject->itrace_synth_opts.set) {786786- struct evsel *evsel;787787-788785 perf_header__clear_feat(&session->header,789786 HEADER_AUXTRACE);790787 if (inject->itrace_synth_opts.last_branch ||791788 inject->itrace_synth_opts.add_last_branch)792789 perf_header__set_feat(&session->header,793790 HEADER_BRANCH_STACK);794794- evsel = perf_evlist__id2evsel_strict(session->evlist,795795- inject->aux_id);796796- if (evsel) {797797- pr_debug("Deleting %s\n", evsel__name(evsel));798798- evlist__remove(session->evlist, evsel);799799- evsel__delete(evsel);800800- }801791 }802792 session->header.data_offset = output_data_offset;803793 session->header.data_size = inject->bytes_written;
+2-2
tools/perf/builtin-lock.c
···406406 struct lock_seq_stat *seq;407407 const char *name = evsel__strval(evsel, sample, "name");408408 u64 tmp = evsel__intval(evsel, sample, "lockdep_addr");409409- int flag = evsel__intval(evsel, sample, "flag");409409+ int flag = evsel__intval(evsel, sample, "flags");410410411411 memcpy(&addr, &tmp, sizeof(void *));412412···621621 case SEQ_STATE_READ_ACQUIRED:622622 seq->read_count--;623623 BUG_ON(seq->read_count < 0);624624- if (!seq->read_count) {624624+ if (seq->read_count) {625625 ls->nr_release++;626626 goto end;627627 }
···1111import sys1212import os1313import time1414-import shutil15141615from collections import namedtuple1716from enum import Enum, auto···4344 BUILD_FAILURE = auto()4445 TEST_FAILURE = auto()45464646-def create_default_kunitconfig():4747- if not os.path.exists(kunit_kernel.kunitconfig_path):4848- shutil.copyfile('arch/um/configs/kunit_defconfig',4949- kunit_kernel.kunitconfig_path)5050-5147def get_kernel_root_path():5248 parts = sys.argv[0] if not __file__ else __file__5349 parts = os.path.realpath(parts).split('tools/testing/kunit')···5561 kunit_parser.print_with_timestamp('Configuring KUnit Kernel ...')56625763 config_start = time.time()5858- create_default_kunitconfig()5964 success = linux.build_reconfig(request.build_dir, request.make_options)6065 config_end = time.time()6166 if not success:···255262 if not os.path.exists(cli_args.build_dir):256263 os.mkdir(cli_args.build_dir)257264258258- if not os.path.exists(kunit_kernel.kunitconfig_path):259259- create_default_kunitconfig()260260-261265 if not linux:262266 linux = kunit_kernel.LinuxSourceTree()267267+268268+ linux.create_kunitconfig(cli_args.build_dir)269269+ linux.read_kunitconfig(cli_args.build_dir)263270264271 request = KunitRequest(cli_args.raw_output,265272 cli_args.timeout,···276283 not os.path.exists(cli_args.build_dir)):277284 os.mkdir(cli_args.build_dir)278285279279- if not os.path.exists(kunit_kernel.kunitconfig_path):280280- create_default_kunitconfig()281281-282286 if not linux:283287 linux = kunit_kernel.LinuxSourceTree()288288+289289+ linux.create_kunitconfig(cli_args.build_dir)290290+ linux.read_kunitconfig(cli_args.build_dir)284291285292 request = KunitConfigRequest(cli_args.build_dir,286293 cli_args.make_options)···293300 elif cli_args.subcommand == 'build':294301 if not linux:295302 linux = kunit_kernel.LinuxSourceTree()303303+304304+ linux.create_kunitconfig(cli_args.build_dir)305305+ linux.read_kunitconfig(cli_args.build_dir)296306297307 request = KunitBuildRequest(cli_args.jobs,298308 cli_args.build_dir,···310314 elif cli_args.subcommand == 'exec':311315 if not linux:312316 linux = kunit_kernel.LinuxSourceTree()317317+318318+ linux.create_kunitconfig(cli_args.build_dir)319319+ linux.read_kunitconfig(cli_args.build_dir)313320314321 exec_request = KunitExecRequest(cli_args.timeout,315322 cli_args.build_dir,···336337 kunit_output = f.read().splitlines()337338 request = KunitParseRequest(cli_args.raw_output,338339 kunit_output,339339- cli_args.build_dir,340340+ None,340341 cli_args.json)341342 result = parse_tests(request)342343 if result.status != KunitStatus.SUCCESS:
+39-12
tools/testing/kunit/kunit_kernel.py
···66# Author: Felix Guo <felixguoxiuping@gmail.com>77# Author: Brendan Higgins <brendanhiggins@google.com>8899-109import logging1110import subprocess1211import os1212+import shutil1313import signal14141515from contextlib import ExitStack···1818import kunit_parser19192020KCONFIG_PATH = '.config'2121-kunitconfig_path = '.kunitconfig'2121+KUNITCONFIG_PATH = '.kunitconfig'2222+DEFAULT_KUNITCONFIG_PATH = 'arch/um/configs/kunit_defconfig'2223BROKEN_ALLCONFIG_PATH = 'tools/testing/kunit/configs/broken_on_uml.config'2424+OUTFILE_PATH = 'test.log'23252426class ConfigError(Exception):2527 """Represents an error trying to configure the Linux kernel."""···8482 if build_dir:8583 command += ['O=' + build_dir]8684 try:8787- subprocess.check_output(command, stderr=subprocess.STDOUT)8585+ proc = subprocess.Popen(command,8686+ stderr=subprocess.PIPE,8787+ stdout=subprocess.DEVNULL)8888 except OSError as e:8989- raise BuildError('Could not call execute make: ' + str(e))9090- except subprocess.CalledProcessError as e:9191- raise BuildError(e.output.decode())8989+ raise BuildError('Could not call make command: ' + str(e))9090+ _, stderr = proc.communicate()9191+ if proc.returncode != 0:9292+ raise BuildError(stderr.decode())9393+ if stderr: # likely only due to build warnings9494+ print(stderr.decode())92959393- def linux_bin(self, params, timeout, build_dir, outfile):9696+ def linux_bin(self, params, timeout, build_dir):9497 """Runs the Linux UML binary. Must be named 'linux'."""9598 linux_bin = './linux'9699 if build_dir:97100 linux_bin = os.path.join(build_dir, 'linux')101101+ outfile = get_outfile_path(build_dir)98102 with open(outfile, 'w') as output:99103 process = subprocess.Popen([linux_bin] + params,100104 stdout=output,101105 stderr=subprocess.STDOUT)102106 process.wait(timeout)103103-104107105108def get_kconfig_path(build_dir):106109 kconfig_path = KCONFIG_PATH···113106 kconfig_path = os.path.join(build_dir, KCONFIG_PATH)114107 return kconfig_path115108109109+def get_kunitconfig_path(build_dir):110110+ kunitconfig_path = KUNITCONFIG_PATH111111+ if build_dir:112112+ kunitconfig_path = os.path.join(build_dir, KUNITCONFIG_PATH)113113+ return kunitconfig_path114114+115115+def get_outfile_path(build_dir):116116+ outfile_path = OUTFILE_PATH117117+ if build_dir:118118+ outfile_path = os.path.join(build_dir, OUTFILE_PATH)119119+ return outfile_path120120+116121class LinuxSourceTree(object):117122 """Represents a Linux kernel source tree with KUnit tests."""118123119124 def __init__(self):120120- self._kconfig = kunit_config.Kconfig()121121- self._kconfig.read_from_file(kunitconfig_path)122125 self._ops = LinuxSourceTreeOperations()123126 signal.signal(signal.SIGINT, self.signal_handler)124127···139122 logging.error(e)140123 return False141124 return True125125+126126+ def create_kunitconfig(self, build_dir, defconfig=DEFAULT_KUNITCONFIG_PATH):127127+ kunitconfig_path = get_kunitconfig_path(build_dir)128128+ if not os.path.exists(kunitconfig_path):129129+ shutil.copyfile(defconfig, kunitconfig_path)130130+131131+ def read_kunitconfig(self, build_dir):132132+ kunitconfig_path = get_kunitconfig_path(build_dir)133133+ self._kconfig = kunit_config.Kconfig()134134+ self._kconfig.read_from_file(kunitconfig_path)142135143136 def validate_config(self, build_dir):144137 kconfig_path = get_kconfig_path(build_dir)···205178206179 def run_kernel(self, args=[], build_dir='', timeout=None):207180 args.extend(['mem=1G'])208208- outfile = 'test.log'209209- self._ops.linux_bin(args, timeout, build_dir, outfile)181181+ self._ops.linux_bin(args, timeout, build_dir)182182+ outfile = get_outfile_path(build_dir)210183 subprocess.call(['stty', 'sane'])211184 with open(outfile, 'r') as file:212185 for line in file:
+9-8
tools/testing/kunit/kunit_parser.py
···1212from datetime import datetime1313from enum import Enum, auto1414from functools import reduce1515-from typing import List1515+from typing import List, Optional, Tuple16161717TestResult = namedtuple('TestResult', ['status','suites','log'])1818···5454def isolate_kunit_output(kernel_output):5555 started = False5656 for line in kernel_output:5757+ line = line.rstrip() # line always has a trailing \n5758 if kunit_start_re.search(line):5859 prefix_len = len(line.split('TAP version')[0])5960 started = True···66656766def raw_output(kernel_output):6867 for line in kernel_output:6969- print(line)6868+ print(line.rstrip())70697170DIVIDER = '=' * 607271···152151 else:153152 return False154153155155-def parse_test_case(lines: List[str]) -> TestCase:154154+def parse_test_case(lines: List[str]) -> Optional[TestCase]:156155 test_case = TestCase()157156 save_non_diagnositic(lines, test_case)158157 while parse_diagnostic(lines, test_case):···164163165164SUBTEST_HEADER = re.compile(r'^[\s]+# Subtest: (.*)$')166165167167-def parse_subtest_header(lines: List[str]) -> str:166166+def parse_subtest_header(lines: List[str]) -> Optional[str]:168167 consume_non_diagnositic(lines)169168 if not lines:170169 return None···177176178177SUBTEST_PLAN = re.compile(r'[\s]+[0-9]+\.\.([0-9]+)')179178180180-def parse_subtest_plan(lines: List[str]) -> int:179179+def parse_subtest_plan(lines: List[str]) -> Optional[int]:181180 consume_non_diagnositic(lines)182181 match = SUBTEST_PLAN.match(lines[0])183182 if match:···231230 max_test_case_status = bubble_up_errors(lambda x: x.status, test_suite.cases)232231 return max_status(max_test_case_status, test_suite.status)233232234234-def parse_test_suite(lines: List[str], expected_suite_index: int) -> TestSuite:233233+def parse_test_suite(lines: List[str], expected_suite_index: int) -> Optional[TestSuite]:235234 if not lines:236235 return None237236 consume_non_diagnositic(lines)···272271273272TEST_PLAN = re.compile(r'[0-9]+\.\.([0-9]+)')274273275275-def parse_test_plan(lines: List[str]) -> int:274274+def parse_test_plan(lines: List[str]) -> Optional[int]:276275 consume_non_diagnositic(lines)277276 match = TEST_PLAN.match(lines[0])278277 if match:···311310 else:312311 return TestResult(TestStatus.NO_TESTS, [], lines)313312314314-def print_and_count_results(test_result: TestResult) -> None:313313+def print_and_count_results(test_result: TestResult) -> Tuple[int, int, int]:315314 total_tests = 0316315 failed_tests = 0317316 crashed_tests = 0
+2-2
tools/testing/kunit/kunit_tool_test.py
···102102 'test_data/test_output_isolated_correctly.log')103103 file = open(log_path)104104 result = kunit_parser.isolate_kunit_output(file.readlines())105105- self.assertContains('TAP version 14\n', result)105105+ self.assertContains('TAP version 14', result)106106 self.assertContains(' # Subtest: example', result)107107 self.assertContains(' 1..2', result)108108 self.assertContains(' ok 1 - example_simple_test', result)···115115 'test_data/test_pound_sign.log')116116 with open(log_path) as file:117117 result = kunit_parser.isolate_kunit_output(file.readlines())118118- self.assertContains('TAP version 14\n', result)118118+ self.assertContains('TAP version 14', result)119119 self.assertContains(' # Subtest: kunit-resource-test', result)120120 self.assertContains(' 1..5', result)121121 self.assertContains(' ok 1 - kunit_resource_test_init_resources', result)
+1
tools/testing/scatterlist/linux/mm.h
···3333#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1)3434#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))3535#define ALIGN(x, a) __ALIGN_KERNEL((x), (a))3636+#define ALIGN_DOWN(x, a) __ALIGN_KERNEL((x) - ((a) - 1), (a))36373738#define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE)3839