6.3.13-rc1 review
Subsystems (9)
Greg Kroah-Hartman
maintainercover 6.3.13-rc1 review
------------------
Note, this is the LAST release for the 6.3.y kernel series. After this is released, it will be end-of-life. Please move to the 6.4.y kernel series at this point in time, OR let us know what is preventing that from happening for you.
------------------
This is the start of the stable review cycle for the 6.3.13 release. There are 431 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Tue, 11 Jul 2023 11:14:03 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.3.13-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.3.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 6.3.13-rc1
Yu Kuai <[email protected]>
md/raid1-10: fix casting from randomized structure in raid1_submit_write()
Thomas Gleixner <[email protected]>
x86/efi: Make efi_set_virtual_address_map IBT safe
Will Deacon <[email protected]>
arm64: sme: Use STR P to clear FFR context field in streaming SVE mode
Arnd Bergmann <[email protected]>
ksmbd: avoid field overflow warning
Paulo Alcantara <[email protected]>
smb: client: fix shared DFS root mounts with different prefixes
Paulo Alcantara <[email protected]>
smb: client: fix broken file attrs with nodfs mounts
Shyam Prasad N <[email protected]>
cifs: do all necessary checks for credits within or before locking
Shyam Prasad N <[email protected]>
cifs: prevent use-after-free by freeing the cfile later
Ard Biesheuvel <[email protected]>
efi/libstub: Disable PCI DMA before grabbing the EFI memory map
Masahiro Yamada <[email protected]>
kbuild: deb-pkg: remove the CONFIG_MODULES check in buildeb
Josh Triplett <[email protected]>
kbuild: builddeb: always make modules_install, to install modules.builtin*
Dan Williams <[email protected]>
cxl/region: Fix state transitions after reset failure
Dan Williams <[email protected]>
cxl/region: Flag partially torn down regions as unusable
Dan Williams <[email protected]>
cxl/region: Move cache invalidation before region teardown, and before setup
Sami Tolvanen <[email protected]>
kbuild: Disable GCOV for *.mod.o
Sami Tolvanen <[email protected]>
kbuild: Fix CFI failures with GCOV
Martin Kaiser <[email protected]>
hwrng: st - keep clock enabled while hwrng is registered
Tarun Sahu <[email protected]>
dax/kmem: Pass valid argument to memory_group_register_static
Dan Williams <[email protected]>
dax: Introduce alloc_dev_dax_id()
Dan Williams <[email protected]>
dax: Fix dax_mapping_release() use after free
Bharath SM <[email protected]>
SMB3: Do not send lease break acknowledgment if all file handles have been closed
Olga Kornievskaia <[email protected]>
NFSv4.1: freeze the session table upon receiving NFS4ERR_BADSESSION
Qi Zheng <[email protected]>
NFSv4.2: fix wrong shrinker_id
Hareshx Sankar Raj <[email protected]>
crypto: qat - unmap buffers before free for RSA
Hareshx Sankar Raj <[email protected]>
crypto: qat - unmap buffer before free for DH
Masahiro Yamada <[email protected]>
ARC: define ASM_NL and __ALIGN(_STR) outside #ifdef __ASSEMBLY__ guard
Dan Carpenter <[email protected]>
modpost: fix off by one in is_executable_section()
Stephan Müller <[email protected]>
crypto: jitter - correct health test during initialization
Arnd Bergmann <[email protected]>
crypto: marvell/cesa - Fix type mismatch warning
Masahiro Yamada <[email protected]>
modpost: fix section mismatch message for R_ARM_{PC24,CALL,JUMP24}Masahiro Yamada <[email protected]>
modpost: fix section mismatch message for R_ARM_ABS32
Randy Dunlap <[email protected]>
crypto: nx - fix build warnings when DEBUG_FS is not enabled
Masahiro Yamada <[email protected]>
modpost: remove broken calculation of exception_table_entry size
Herbert Xu <[email protected]>
hwrng: virtio - Fix race on data_avail and actual data
Eric Farman <[email protected]>
vfio/mdev: Move the compat_class initialization to module init
Xinghui Li <[email protected]>
PCI: vmd: Fix uninitialized variable usage in vmd_enable_domain()
Yoshihiro Shimoda <[email protected]>
PCI: endpoint: functions/pci-epf-test: Fix dma_chan direction
Shunsuke Mie <[email protected]>
PCI: endpoint: Fix a Kconfig prompt of vNTB driver
Namhyung Kim <[email protected]>
perf test: Set PERF_EXEC_PATH for script execution
Aneesh Kumar K.V <[email protected]>
powerpc/mm/dax: Fix the condition when checking if altmap vmemap can cross-boundary
Aneesh Kumar K.V <[email protected]>
powerpc/book3s64/mm: Fix DirectMap stats in /proc/meminfo
Tiezhu Yang <[email protected]>
riscv: uprobes: Restore thread.bad_cause
Xi Pardee <[email protected]>
platform/x86:intel/pmc: Update maps for Meteor Lake P/M platforms
Aditya Gupta <[email protected]>
powerpc: update ppc_save_regs to save current r1 in pt_regs
Colin Ian King <[email protected]>
powerpc/powernv/sriov: perform null check on iov before dereferencing iov
Stanley Chu <[email protected]>
scsi: ufs: core: mcq: Fix the incorrect OCS value for the device command
Bart Van Assche <[email protected]>
scsi: ufs: core: Remove a ufshcd_add_command_trace() call
Namhyung Kim <[email protected]>
perf stat: Reset aggr stats for each run
Claudiu Beznea <[email protected]>
pinctrl: at91-pio4: check return value of devm_kasprintf()
Claudiu Beznea <[email protected]>
pinctrl: microchip-sgpio: check return value of devm_kasprintf()
Xiaolei Wang <[email protected]>
pinctrl: freescale: Fix a memory out of bounds when num_configs is 1
Nicholas Piggin <[email protected]>
powerpc/64s: Fix VAS mm use after free
Ian Rogers <[email protected]>
perf tool x86: Fix perf_env memory leak
Ravi Bangoria <[email protected]>
perf tool x86: Consolidate is_amd check into single function
Michal Wilczynski <[email protected]>
platform/x86/dell/dell-rbtn: Fix resources leaking on error path
Aditya Gupta <[email protected]>
perf tests task_analyzer: Skip tests if no libtraceevent support
Aditya Gupta <[email protected]>
perf tests task_analyzer: Fix bad substitution ${$1}Namhyung Kim <[email protected]>
perf dwarf-aux: Fix off-by-one in die_get_varname()
Mark Pearson <[email protected]>
platform/x86: thinkpad_acpi: Fix lkp-tests warnings for platform profiles
Arnaldo Carvalho de Melo <[email protected]>
perf script: Fix allocation of evsel->priv related to per-event dump files
Christophe Leroy <[email protected]>
powerpc/signal32: Force inlining of __unsafe_save_user_regs() and save_tm_user_regs_unsafe()
Christophe Leroy <[email protected]>
powerpc/interrupt: Don't read MSR from interrupt_exit_kernel_prepare()
Christophe Leroy <[email protected]>
kcsan: Don't expect 64 bits atomic builtins from 32 bits architectures
Jiasheng Jiang <[email protected]>
pinctrl: npcm7xx: Add missing check for ioremap
Wells Lu <[email protected]>
pinctrl:sunplus: Add check for kmalloc
Mark Pearson <[email protected]>
platform/x86: think-lmi: Correct NVME password handling
Mark Pearson <[email protected]>
platform/x86: think-lmi: Correct System password interface
Mark Pearson <[email protected]>
platform/x86: think-lmi: mutex protection around multiple WMI calls
Xi Pardee <[email protected]>
platform/x86:intel/pmc: Remove Meteor Lake S platform support
Andy Shevchenko <[email protected]>
pinctrl: cherryview: Return correct value if pin in push-pull mode
Arnaldo Carvalho de Melo <[email protected]>
perf bench: Add missing setlocale() call to allow usage of %'d style formatting
Thierry Reding <[email protected]>
pinctrl: tegra: Duplicate pinmux functions table
Bart Van Assche <[email protected]>
scsi: ufs: core: Fix handling of lrbp->cmd
Bart Van Assche <[email protected]>
scsi: ufs: core: Increase the START STOP UNIT timeout from one to ten seconds
Justin Tee <[email protected]>
scsi: lpfc: Revise NPIV ELS unsol rcv cmpl logic to drop ndlp based on nlp_state
Sui Jingfeng <[email protected]>
PCI: Add pci_clear_master() stub for non-CONFIG_PCI
Bart Van Assche <[email protected]>
scsi: ufs: Declare ufshcd_{hold,release}() once
Wells Lu <[email protected]>
pinctrl: sunplus: Add check for kmalloc
Junyan Ye <[email protected]>
PCI: ftpci100: Release the clock resources
Ian Rogers <[email protected]>
perf evsel: Don't let for_each_group() treat the head of the list as one of its nodes
Rongguang Wei <[email protected]>
PCI: pciehp: Cancel bringup sequence if card is not present
Dan Carpenter <[email protected]>
pinctrl: at91: fix a couple NULL vs IS_ERR() checks
Andy Shevchenko <[email protected]>
pinctrl: at91: Use dev_err_probe() instead of custom messaging
Andy Shevchenko <[email protected]>
pinctrl: at91: Don't mix non-devm calls with devm ones
Yuchen Yang <[email protected]>
scsi: 3w-xxxx: Add error handling for initialization failure in tw_probe()
Ding Hui <[email protected]>
PCI/ASPM: Disable ASPM on MFD function removal to avoid use-after-free
Hans de Goede <[email protected]>
platform/x86: lenovo-yogabook: Set default keyboard backligh brightness on probe()
Hans de Goede <[email protected]>
platform/x86: lenovo-yogabook: Reprobe devices on remove()
Hans de Goede <[email protected]>
platform/x86: lenovo-yogabook: Fix work race on remove()
Christophe JAILLET <[email protected]>
pinctrl: bcm2835: Handle gpiochip_add_pin_range() errors
Jinhong Zhu <[email protected]>
scsi: qedf: Fix NULL dereference in error handling
Nirmal Patel <[email protected]>
PCI: vmd: Reset VMD config register between soft reboots
Siddharth Vadapalli <[email protected]>
PCI: cadence: Fix Gen2 Link Retraining process
Jason Gunthorpe <[email protected]>
iommufd: Call iopt_area_contig_done() under the lock
Jason Gunthorpe <[email protected]>
iommufd: Do not access the area pointer after unlocking
Paul Cercueil <[email protected]>
MIPS: DTS: CI20: Raise VDDCORE voltage to 1.125 volts
Paul Cercueil <[email protected]>
MIPS: DTS: CI20: Add parent supplies to ACT8600 regulators
Syed Saba Kareem <[email protected]>
ASoC: amd: acp: clear pdm dma interrupt mask
Michael Walle <[email protected]>
ARM: dts: lan966x: kontron-d10: fix SPI CS
Michael Walle <[email protected]>
ARM: dts: lan966x: kontron-d10: fix board reset
Fei Shao <[email protected]>
clk: Fix memory leak in devm_clk_notifier_register()
Claudiu Beznea <[email protected]>
ASoC: imx-audmix: check return value of devm_kasprintf()
Amir Goldstein <[email protected]>
ovl: update of dentry revalidate flags after copy up
Alexey Romanov <[email protected]>
drivers: meson: secure-pwrc: always enable DMA domain
Claudiu Beznea <[email protected]>
clk: ti: clkctrl: check return value of kasprintf()
Claudiu Beznea <[email protected]>
clk: keystone: sci-clk: check return value of kasprintf()
Claudiu Beznea <[email protected]>
clk: si5341: free unused memory on probe failure
Claudiu Beznea <[email protected]>
clk: si5341: check return value of {devm_}kasprintf()
Claudiu Beznea <[email protected]>
clk: si5341: return error if one synth clock registration fails
Claudiu Beznea <[email protected]>
clk: cdce925: check return value of kasprintf()
Claudiu Beznea <[email protected]>
clk: vc5: check memory returned by kasprintf()
AngeloGioacchino Del Regno <[email protected]>
clk: mediatek: clk-mt8173-apmixedsys: Fix iomap not released issue
AngeloGioacchino Del Regno <[email protected]>
clk: mediatek: clk-mt8173-apmixedsys: Fix return value for of_iomap() error
Dmitry Baryshkov <[email protected]>
drm/msm/dpu: correct MERGE_3D length
Luben Tuikov <[email protected]>
drm/amdgpu: Fix usage of UMC fill record in RAS
Srinivasan Shanmugam <[email protected]>
drm/amdgpu: Fix memcpy() in sienna_cichlid_append_powerplay_table function.
Daniel Golle <[email protected]>
arm64: dts: mt7986: increase bl2 partition on NAND of Bananapi R3
Nícolas F. R. A. Prado <[email protected]>
arm64: dts: mediatek: mt8192: Fix CPUs capacity-dmips-mhz
Allen-KH Cheng <[email protected]>
arm64: dts: mediatek: Add cpufreq nodes for MT8192
Bjorn Andersson <[email protected]>
drm/msm/dp: Free resources after unregistering them
Bjorn Andersson <[email protected]>
drm/msm/dp: Drop aux devices together with DP controller
Jessica Zhang <[email protected]>
drm/msm/dsi: Remove incorrect references to slice_count
Jessica Zhang <[email protected]>
drm/msm/dpu: Fix slice_last_group_size calculation
Dmitry Baryshkov <[email protected]>
drm/msm/dpu: do not enable color-management if DSPPs are not available
Su Hui <[email protected]>
ALSA: ac97: Fix possible NULL dereference in snd_ac97_mixer
Nishanth Menon <[email protected]>
arm64: dts: ti: k3-am69-sk: Fix main_i2c0 alias
Thejasvi Konduru <[email protected]>
arm64: dts: ti: k3-j784s4: Fix wakeup pinmux range and pinctrl node offsets
Siddharth Vadapalli <[email protected]>
arm64: dts: ti: k3-j784s4-evm: Enable MCU CPSW2G
Nishanth Menon <[email protected]>
arm64: dts: ti: k3-j784s4-evm: Fix main_i2c0 alias
Andrew Davis <[email protected]>
arm64: dts: ti: k3-j721e-beagleboneai64: Fix mailbox node status
Yuan Can <[email protected]>
clk: tegra: tegra124-emc: Fix potential memory leak
Dan Carpenter <[email protected]>
clk: clocking-wizard: Fix Oops in clk_wzrd_register_divider()
Dan Carpenter <[email protected]>
clk: bcm: rpi: Fix off by one in raspberrypi_discover_clocks()
Abel Vesa <[email protected]>
arm64: dts: qcom: sm8550: Add missing interconnect path to USB HC
Marijn Suijten <[email protected]>
arm64: dts: qcom: sm8250-edo: Panel framebuffer is 2.5k instead of 4k
Konrad Dybcio <[email protected]>
arm64: dts: qcom: sm8550: Flush RSC sleep & wake votes
Konrad Dybcio <[email protected]>
arm64: dts: qcom: sdm845: Flush RSC sleep & wake votes
Konrad Dybcio <[email protected]>
arm64: dts: qcom: sdm670: Flush RSC sleep & wake votes
Konrad Dybcio <[email protected]>
arm64: dts: qcom: qdu1000: Flush RSC sleep & wake votes
Bosi Zhang <[email protected]>
clk: mediatek: fix of_iomap memory leak
Yuxing Liu <[email protected]>
clk: imx: clk-imx8mp: improve error handling in imx8mp_clocks_probe()
Zhanhao Hu <[email protected]>
clk: imx93: fix memory leak and missing unwind goto in imx93_clocks_probe
Hao Luo <[email protected]>
clk: imx: clk-imx8mn: fix memory leak in imx8mn_clocks_probe
Kai Ma <[email protected]>
clk: imx: clk-imxrt1050: fix memory leak in imxrt1050_clocks_probe
Kashyap Desai <[email protected]>
RDMA/bnxt_re: Avoid calling wake_up threads from spin_lock context
Kashyap Desai <[email protected]>
RDMA/bnxt_re: wraparound mbox producer index
Dmitry Baryshkov <[email protected]>
drm/msm/a5xx: really check for A510 in a5xx_gpu_init
Dmitry Baryshkov <[email protected]>
drm/msm/a6xx: don't set IO_PGTABLE_QUIRK_ARM_OUTER_WBWA with coherent SMMU
Chia-I Wu <[email protected]>
amdgpu: validate offset_in_bo of drm_amdgpu_gem_va
Bob Pearson <[email protected]>
RDMA/rxe: Fix access checks in rxe_check_bind_mw
Geert Uytterhoeven <[email protected]>
HID: uclogic: Modular KUnit tests should not depend on KUNIT=y
Nikita Zhandarovich <[email protected]>
drm/radeon: fix possible division-by-zero errors
Aurabindo Pillai <[email protected]>
drm/amd/display: Fix artifacting on eDP panels when engaging freesync video mode
Chen-Yu Tsai <[email protected]>
soc: mediatek: SVS: Fix MT8192 GPU node name
Daniil Dulov <[email protected]>
drm/amdkfd: Fix potential deallocation of previously deallocated memory.
Christophe JAILLET <[email protected]>
drm/amd/display: Fix a test dml32_rq_dlg_get_rq_reg()
Christophe JAILLET <[email protected]>
drm/amd/display: Fix a test CalculatePrefetchSchedule()
Paul Cercueil <[email protected]>
MIPS: DTS: CI20: Fix ACT8600 regulator node names
Maxime Ripard <[email protected]>
clk: Export clk_hw_forward_rate_request()
Christian Lamparter <[email protected]>
ARM: dts: BCM5301X: fix duplex-full => full-duplex
Guenter Roeck <[email protected]>
hwmon: (pmbus/adm1275) Fix problems with temperature monitoring on ADM1272
Tim Harvey <[email protected]>
hwmon: (gsc-hwmon) fix fan pwm temperature scaling
Olivier Moysan <[email protected]>
ARM: dts: stm32: fix i2s endpoint format property for stm32mp15xx-dkx
Marek Vasut <[email protected]>
ARM: dts: stm32: Fix audio routing on STM32MP15xx DHCOM PDK2
Caleb Connolly <[email protected]>
Input: pm8941-powerkey - fix debounce on gen2+ PMICs
Keerthy <[email protected]>
arm64: dts: ti: k3-j7200: Fix physical address of pin
Christophe JAILLET <[email protected]>
fbdev: omapfb: lcd_mipid: Fix an error handling path in mipid_spi_probe()
Kuogee Hsieh <[email protected]>
drm/msm/dpu: always clear every individual pending flush mask
Kuogee Hsieh <[email protected]>
drm/msm/dpu: set DSC flush bit correctly at MDP CTL flush register
Wolfram Sang <[email protected]>
arm64: dts: renesas: ulcb-kf: Remove flow control for SCIF1
Geert Uytterhoeven <[email protected]>
ARM: dts: iwg20d-q7-common: Fix backlight pwm specifier
Chengchang Tang <[email protected]>
RDMA/hns: Fix hns_roce_table_get return value
Brendan Cunningham <[email protected]>
IB/hfi1: Fix wrong mmu_node used for user SDMA packet after invalidate
Arnd Bergmann <[email protected]>
RDMA/irdma: avoid fortify-string warning in irdma_clr_wqes
Randy Dunlap <[email protected]>
soc/fsl/qe: fix usb.c build errors
Martin Blumenstingl <[email protected]>
ARM: dts: meson8: correct uart_B and uart_C clock references
Cristian Ciocaltea <[email protected]>
ASoC: es8316: Do not set rate constraints for unsupported MCLKs
Cristian Ciocaltea <[email protected]>
ASoC: es8316: Increment max value for ALC Capture Target Volume control
Dmitry Baryshkov <[email protected]>
ARM: dts: qcom: apq8074-dragonboard: Set DMA as remotely controlled
Krzysztof Kozlowski <[email protected]>
memory: brcmstb_dpfe: fix testing array offset after use
Marek Vasut <[email protected]>
ARM: dts: stm32: Shorten the AV96 HDMI sound card name
Douglas Anderson <[email protected]>
arm64: dts: mediatek: mt8183: Add mediatek,broken-save-restore-fw to kukui
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: apq8096: fix fixed regulator name property
Luca Weiss <[email protected]>
arm64: dts: qcom: pm7250b: add missing spmi-vadc include
Arnd Bergmann <[email protected]>
ARM: omap2: fix missing tick_broadcast() prototype
Arnd Bergmann <[email protected]>
ARM: ep93xx: fix missing-prototype warnings
Dario Binacchi <[email protected]>
drm/panel: simple: fix active size for Ampire AM-480272H3TMQW-T01H
Frieder Schrempf <[email protected]>
drm/bridge: ti-sn65dsi83: Fix enable/disable flow to meet spec
Stephan Gerhold <[email protected]>
arm64: dts: qcom: apq8016-sbc: Fix 1.8V power rail on LS expansion
Stephan Gerhold <[email protected]>
arm64: dts: qcom: apq8016-sbc: Fix regulator constraints
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sdm845-polaris: add missing touchscreen child node reg
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm8550: correct pinctrl unit address
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm8550: correct crypto unit address
Vladimir Zapolskiy <[email protected]>
arm64: dts: qcom: sm8550: add QCE IP family compatible values
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm8350: correct PCI phy unit address
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm8350: correct DMA controller unit address
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm6115: correct thermal-sensor unit address
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sdm845: correct camss unit address
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sdm630: correct camss unit address
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: msm8996: correct camss unit address
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: msm8994: correct SPMI unit address
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: msm8976: correct MMC unit address
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: msm8953: correct IOMMU unit address
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: msm8916: correct WCNSS unit address
Stephan Gerhold <[email protected]>
arm64: dts: qcom: msm8916: Move WCN compatible to boards
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: msm8916: correct MMC unit address
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: msm8916: correct camss unit address
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: ipq6018: correct qrng unit address
Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: pm8998: don't use GIC_SPI for SPMI interrupts
Krzysztof Kozlowski <[email protected]>
ARM: dts: qcom: msm8974: do not use underscore in node name (again)
Linus Walleij <[email protected]>
ARM/musb: omap2: Remove global GPIO numbers from TUSB6010
Linus Walleij <[email protected]>
ARM: omap1: Exorcise the legacy GPIO header
Linus Walleij <[email protected]>
ARM/mmc: Convert old mmci-omap to GPIO descriptors
Linus Walleij <[email protected]>
ARM: omap1: Remove reliance on GPIO numbers from SX1
Linus Walleij <[email protected]>
ARM: omap1: Remove reliance on GPIO numbers from PalmTE
Linus Walleij <[email protected]>
ARM: omap1: Drop header on AMS Delta
Linus Walleij <[email protected]>
ARM/mfd/gpio: Fixup TPS65010 regression on OMAP1 OSK1
Nícolas F. R. A. Prado <[email protected]>
drm/bridge: anx7625: Prevent endless probe loop
Tony Lindgren <[email protected]>
ARM: dts: gta04: Move model property out of pinctrl node
Biju Das <[email protected]>
clk: renesas: rzg2l: Fix CPG_SIPLL5_CLK1 register write
Jean-Philippe Brucker <[email protected]>
iommu/virtio: Return size mapped for a detached domain
Jean-Philippe Brucker <[email protected]>
iommu/virtio: Detach domain on endpoint release
Arnd Bergmann <[email protected]>
drm/nouveau: dispnv50: fix missing-prototypes warning
Konrad Dybcio <[email protected]>
drm/msm/dpu: Set DPU_DATA_HCTL_EN for in INTF_SC7180_MASK
Vinod Polimera <[email protected]>
drm/msm/disp/dpu: get timing engine status from intf status register
Dmitry Baryshkov <[email protected]>
drm/msm/dsi: don't allow enabling 14nm VCO with unprogrammed rate
Kalesh AP <[email protected]>
RDMA/bnxt_re: Fix to remove an unnecessary log
Kalesh AP <[email protected]>
RDMA/bnxt_re: Remove a redundant check inside bnxt_re_update_gid
Kalesh AP <[email protected]>
RDMA/bnxt_re: Use unique names while registering interrupts
Kalesh AP <[email protected]>
RDMA/bnxt_re: Fix to remove unnecessary return labels
Selvin Xavier <[email protected]>
RDMA/bnxt_re: Disable/kill tasklet only if it is enabled
Nikita Zhandarovich <[email protected]>
hwmon: (f71882fg) prevent possible division by zero
Dan Carpenter <[email protected]>
clk: imx: scu: use _safe list iterator to avoid a use after free
Alexander Stein <[email protected]>
drm/bridge: tc358767: Switch to devm MIPI-DSI helpers
Robert Marko <[email protected]>
arm64: dts: microchip: sparx5: do not use PSCI on reference boards
Tony Lindgren <[email protected]>
bus: ti-sysc: Fix dispc quirk masking bool variables
Marek Vasut <[email protected]>
ARM: dts: stm32: Move ethernet MAC EEPROM from SoM to carrier boards
Maíra Canal <[email protected]>
drm/vkms: Fix RGB565 pixel conversion
Maíra Canal <[email protected]>
drm: Add fixed-point helper to get rounded integer values
Maíra Canal <[email protected]>
drm/vkms: isolate pixel conversion functionality
Bard Liao <[email protected]>
ASoC: Intel: sof_sdw: remove SOF_SDW_TGL_HDMI for MeteorLake devices
Trevor Wu <[email protected]>
ASoC: dt-bindings: mediatek,mt8188-afe: correct clock name
Dan Carpenter <[email protected]>
driver: soc: xilinx: use _safe loop iterator to avoid a use after free
Dmitry Baryshkov <[email protected]>
drm/panel: sharp-ls043t1le01: adjust mode settings
XuDong Liu <[email protected]>
drm: sun4i_tcon: use devm_clk_get_enabled in sun4i_tcon_init_clocks
Marek Vasut <[email protected]>
Input: adxl34x - do not hardcode interrupt trigger type
Marek Vasut <[email protected]>
clk: rs9: Fix .driver_data content in i2c_device_id
Alexander Stein <[email protected]>
clk: rs9: Add support for 9FGV0441
Alexander Stein <[email protected]>
clk: rs9: Support device specific dif bit calculation
Alexander Stein <[email protected]>
clk: rs9: Check for vendor/device ID
Marek Vasut <[email protected]>
clk: vc7: Fix .driver_data content in i2c_device_id
Marek Vasut <[email protected]>
clk: vc5: Fix .driver_data content in i2c_device_id
[email protected] <[email protected]>
ARM: dts: meson8b: correct uart_B and uart_C clock references
Rafał Miłecki <[email protected]>
ARM: dts: BCM5301X: Drop "clock-names" from the SPI node
Luc Ma <[email protected]>
drm/vram-helper: fix function names in vram helper doc
Francesco Dolcini <[email protected]>
drm/bridge: tc358768: fix THS_TRAILCNT computation
Francesco Dolcini <[email protected]>
drm/bridge: tc358768: fix TXTAGOCNT computation
Francesco Dolcini <[email protected]>
drm/bridge: tc358768: fix THS_ZEROCNT computation
Francesco Dolcini <[email protected]>
drm/bridge: tc358768: fix TCLK_TRAILCNT computation
Francesco Dolcini <[email protected]>
drm/bridge: tc358768: Add atomic_get_input_bus_fmts() implementation
Francesco Dolcini <[email protected]>
drm/bridge: tc358768: fix TCLK_ZEROCNT computation
Francesco Dolcini <[email protected]>
drm/bridge: tc358768: fix PLL target frequency
Francesco Dolcini <[email protected]>
drm/bridge: tc358768: fix PLL parameters computation
Francesco Dolcini <[email protected]>
drm/bridge: tc358768: always enable HS video mode
Alexander Stein <[email protected]>
drm/bridge: ti-sn65dsi83: Fix enable error path
Duoming Zhou <[email protected]>
Input: cyttsp4_core - change del_timer_sync() to timer_shutdown_sync()
Luca Weiss <[email protected]>
Input: drv260x - sleep between polling GO bit
Markus Elfring <[email protected]>
drm/bridge: it6505: Move a variable assignment behind a null pointer check in receive_timing_debugfs_show()
Vinay Belgaumkar <[email protected]>
drm/i915/guc/slpc: Provide sysfs for efficient freq
John Harrison <[email protected]>
drm/i915/guc: More debug print updates - GuC SLPC
Liu Shixin <[email protected]>
bootmem: remove the vmemmap pages from kmemleak in free_bootmem_page
Nicholas Kazlauskas <[email protected]>
drm/amd/display: Explicitly specify update type per plane info change
Nikita Zhandarovich <[email protected]>
radeon: avoid double free in ci_dpm_init()
Arnd Bergmann <[email protected]>
drm/amd/display: fix is_timing_changed() prototype
Wesley Chalmers <[email protected]>
drm/amd/display: Add logging for display MALL refresh setting
Kuniyuki Iwashima <[email protected]>
netlink: Add __sock_i_ino() for __netlink_diag_dump().
Vladimir Oltean <[email protected]>
net: dsa: avoid suspicious RCU usage for synced VLAN-aware MAC addresses
Cambda Zhu <[email protected]>
ipvlan: Fix return value of ipvlan_queue_xmit()
Ilia.Gavrilov <[email protected]>
netfilter: nf_conntrack_sip: fix the ct_sip_parse_numerical_param() return value.
Florian Westphal <[email protected]>
netfilter: conntrack: dccp: copy entire header to stack buffer, not just basic one
Jeremy Sowden <[email protected]>
lib/ts_bm: reset initial match offset for every block of text
Lin Ma <[email protected]>
net: nfc: Fix use-after-free caused by nfc_llcp_find_local
Edward Cree <[email protected]>
sfc: fix crash when reading stats while NIC is resetting
David Howells <[email protected]>
ocfs2: Fix use of slab data with sendpage
Maxim Kochetkov <[email protected]>
net: axienet: Move reset before 64-bit DMA detection
Kuniyuki Iwashima <[email protected]>
gtp: Fix use-after-free in __gtp_encap_destroy().
Sabrina Dubroca <[email protected]>
selftests: rtnetlink: remove netdevsim device after ipsec offload test
Eric Dumazet <[email protected]>
bonding: do not assume skb mac_header is set
Eric Dumazet <[email protected]>
netlink: do not hard code device address lenth in fdb dumps
Eric Dumazet <[email protected]>
netlink: fix potential deadlock in netlink_set_err()
Bartosz Golaszewski <[email protected]>
net: stmmac: fix double serdes powerdown
Jimmy Assarsson <[email protected]>
can: kvaser_pciefd: Set hardware timestamp on transmitted packets
Jimmy Assarsson <[email protected]>
can: kvaser_pciefd: Add function to set skb hwtstamps
Vincent Mailhol <[email protected]>
can: length: fix bitstuffing count
Gilad Sever <[email protected]>
bpf: Fix bpf socket lookup from tc/xdp to respect socket VRF bindings
Gilad Sever <[email protected]>
bpf: Call __bpf_sk_lookup()/__bpf_skc_lookup() directly via TC hookpoint
Gilad Sever <[email protected]>
bpf: Factor out socket lookup functions for the TC hookpoint.
Dmitry Antipov <[email protected]>
wifi: ath9k: convert msecs to jiffies where needed
Johannes Berg <[email protected]>
wifi: iwlwifi: mvm: indicate HW decrypt for beacon protection
Marek Vasut <[email protected]>
mmc: Add MMC_QUIRK_BROKEN_SD_CACHE for Kingston Canvas Go Plus from 11/2019
Ilan Peer <[email protected]>
wifi: ieee80211: Fix the common size calculation for reconfiguration ML
Johannes Berg <[email protected]>
wifi: cfg80211: fix regulatory disconnect with OCB/NAN
Benjamin Berg <[email protected]>
wifi: cfg80211: drop incorrect nontransmitted BSS update code
Benjamin Berg <[email protected]>
wifi: cfg80211: rewrite merging of inherited elements
Nicolas Cavallari <[email protected]>
wifi: mac80211: Remove "Missing iftype sband data/EHT cap" spam
Anjaneyulu <[email protected]>
wifi: iwlwifi: pcie: fix NULL pointer dereference in iwl_pcie_irq_rx_msix_handler()
Johannes Berg <[email protected]>
wifi: iwlwifi: pull from TXQs with softirqs disabled
Ziyang Huang <[email protected]>
wifi: ath11k: Add missing hw_ops->get_ring_selector() for IPQ5018
Ziyang Huang <[email protected]>
wifi: ath11k: Restart firmware after cold boot calibration for IPQ5018
Ziyang Huang <[email protected]>
wifi: ath11k: Add missing ops config for IPQ5018 in ath11k_ahb_probe()
Jiasheng Jiang <[email protected]>
wifi: ath11k: Add missing check for ioremap
Edwin Peer <[email protected]>
rtnetlink: extend RTEXT_FILTER_SKIP_STATS to IFLA_VF_INFO
Ilan Peer <[email protected]>
wifi: mac80211: Fix permissions for valid_links debugfs entry
Remi Pommarel <[email protected]>
wifi: ath9k: Fix possible stall on ath9k_txq_list_has_key()
Eduard Zingerman <[email protected]>
selftests/bpf: Fix invalid pointer check in get_xlated_program()
Arnd Bergmann <[email protected]>
memstick r592: make memstick_debug_get_tpc_name() static
Douglas Anderson <[email protected]>
mmc: mediatek: Avoid ugly error message when SDIO wakeup IRQ isn't used
Zhen Lei <[email protected]>
kexec: fix a memory leak in crash_shrink_memory()
Douglas Anderson <[email protected]>
watchdog/perf: more properly prevent false positives with turbo modes
Douglas Anderson <[email protected]>
watchdog/perf: define dummy watchdog_update_hrtimer_threshold() on correct config
Haifeng Xu <[email protected]>
selftests: cgroup: fix unexpected failure on test_memcg_low
Karol Kolacinski <[email protected]>
ice: handle extts in the miscellaneous interrupt thread
Marek Vasut <[email protected]>
wifi: rsi: Do not set MMC_PM_KEEP_POWER in shutdown
Marek Vasut <[email protected]>
wifi: rsi: Do not configure WoWlan in shutdown hook if not enabled
Jesper Dangaard Brouer <[email protected]>
selftests/bpf: Fix check_mtu using wrong variable type
Johannes Berg <[email protected]>
wifi: mac80211: recalc min chandef for new STA links
Viktor Malik <[email protected]>
tools/resolve_btfids: Fix setting HOSTCFLAGS
Youghandhar Chintala <[email protected]>
wifi: ath10k: Trigger STA disconnect after reconfig complete on hardware restart
Jesper Dangaard Brouer <[email protected]>
samples/bpf: xdp1 and xdp2 reduce XDPBUFSIZE to 60
Sascha Hauer <[email protected]>
wifi: rtw88: usb: silence log flooding error message
Fedor Pchelkin <[email protected]>
wifi: ath9k: don't allow to overwrite ENDPOINT0 attributes
Christophe JAILLET <[email protected]>
wifi: ray_cs: Fix an error handling path in ray_probe()
Christophe JAILLET <[email protected]>
wifi: wl3501_cs: Fix an error handling path in wl3501_probe()
Christophe JAILLET <[email protected]>
wifi: atmel: Fix an error handling path in atmel_probe()
Christophe JAILLET <[email protected]>
wifi: orinoco: Fix an error handling path in orinoco_cs_probe()
Christophe JAILLET <[email protected]>
wifi: orinoco: Fix an error handling path in spectrum_cs_probe()
Geert Uytterhoeven <[email protected]>
regulator: core: Streamline debugfs operations
Geert Uytterhoeven <[email protected]>
regulator: core: Fix more error checking for debugfs_create_dir()
Alexey Gladkov <[email protected]>
selftests/bpf: Do not use sign-file as testcase
Yafang Shao <[email protected]>
bpf: Fix memleak due to fentry attach failure
Yafang Shao <[email protected]>
bpf: Remove bpf trampoline selector
Alan Maguire <[email protected]>
bpftool: JIT limited misreported as negative value on aarch64
Krzysztof Kozlowski <[email protected]>
nfc: llcp: fix possible use of uninitialized variable in nfc_llcp_send_connect()
Joy Chakraborty <[email protected]>
spi: dw: Round of n_bytes to power of 2
Stanislav Fomichev <[email protected]>
bpf: Don't EFAULT for {g,s}setsockopt with wrong optlen
Andrii Nakryiko <[email protected]>
libbpf: fix offsetof() and container_of() to work with CO-RE
Alexander Mikhalitsyn <[email protected]>
sctp: add bpf_bypass_getsockopt proto callback
Christophe JAILLET <[email protected]>
wifi: mwifiex: Fix the size of a memory allocation in mwifiex_ret_802_11_scan()
Amisha Patel <[email protected]>
wifi: wilc1000: fix for absent RSN capabilities WFA testcase
Vijaya Krishna Nivarthi <[email protected]>
spi: spi-geni-qcom: Correct CS_TOGGLE bit in SPI_TRANS_CFG
Pengcheng Yang <[email protected]>
samples/bpf: Fix buffer overflow in tcp_basertt
Martin KaFai Lau <[email protected]>
libbpf: btf_dump_type_data_check_overflow needs to consider BTF_MEMBER_BITFIELD_SIZE
Fedor Pchelkin <[email protected]>
wifi: ath9k: avoid referencing uninit memory in ath9k_wmi_ctrl_rx
Peter Seiderer <[email protected]>
wifi: ath9k: fix AR9003 mac hardware hang check register offset calculation
Jesper Dangaard Brouer <[email protected]>
igc: Enable and fix RX hash usage by netstack
Hao Jia <[email protected]>
sched/core: Avoid multiple calling update_rq_clock() in __cfsb_csd_unthrottle()
Jiasheng Jiang <[email protected]>
pstore/ram: Add check for kstrdup
Roberto Sassu <[email protected]>
ima: Fix build warnings
Roberto Sassu <[email protected]>
evm: Fix build warnings
Roberto Sassu <[email protected]>
evm: Complete description of evm_inode_setattr()
Mark Rutland <[email protected]>
locking/atomic: arm: fix sync ops
Juergen Gross <[email protected]>
x86/mm: Fix __swp_entry_to_pte() for Xen PV guests
Ravi Bangoria <[email protected]>
perf/ibs: Fix interface via core pmu events
Colin Ian King <[email protected]>
kselftest: vDSO: Fix accumulation of uninitialized ret when CLOCK_REALTIME is undefined
Juergen Gross <[email protected]>
x86/xen: Set MTRR state when running as Xen PV initial domain
Juergen Gross <[email protected]>
x86/mtrr: Support setting MTRR state for software defined MTRRs
Juergen Gross <[email protected]>
x86/mtrr: Replace size_or_mask and size_and_mask with a much easier concept
Juergen Gross <[email protected]>
x86/mtrr: Remove physical address size calculation
Qiuxu Zhuo <[email protected]>
rcu/rcuscale: Stop kfree_scale_thread thread(s) after unloading rcuscale
Qiuxu Zhuo <[email protected]>
rcu/rcuscale: Move rcu_scale_*() after kfree_scale_cleanup()
Paul E. McKenney <[email protected]>
rcuscale: Move shutdown from wait_event() to wait_event_idle()
Paul E. McKenney <[email protected]>
rcutorture: Correct name of use_softirq module parameter
Paul E. McKenney <[email protected]>
rcu-tasks: Stop rcu_tasks_invoke_cbs() from using never-onlined CPUs
Paul E. McKenney <[email protected]>
rcu: Make rcu_cpu_starting() rely on interrupts being disabled
Peng Fan <[email protected]>
thermal/drivers/qoriq: Only enable supported sensors
Daniel Lezcano <[email protected]>
thermal/hwmon: Use the right device for devm_thermal_add_hwmon_sysfs()
Christophe JAILLET <[email protected]>
thermal/drivers/sun8i: Fix some error handling paths in sun8i_ths_probe()
Stephan Gerhold <[email protected]>
thermal/drivers/qcom/tsens-v0_1: Add mdm9607 correction offsets
Stephan Gerhold <[email protected]>
thermal/drivers/qcom/tsens-v0_1: Fix mdm9607 slope values
Matti Lehtimäki <[email protected]>
thermal/drivers/qcom/tsens-v0_1: Add support for MSM8226
Tero Kristo <[email protected]>
cpufreq: intel_pstate: Fix energy_performance_preference for passive
Arnd Bergmann <[email protected]>
ARM: 9303/1: kprobes: avoid missing-declaration warnings
Ulf Hansson <[email protected]>
PM: domains: Move the verification of in-params from genpd_add_device()
Zhang Rui <[email protected]>
powercap: RAPL: Fix CONFIG_IOSF_MBI dependency
Sumeet Pawnikar <[email protected]>
powercap: RAPL: fix invalid initialization for pl4_supported field
Li Yang <[email protected]>
APEI: GHES: correctly return NULL for ghes_get_devices()
Robin Murphy <[email protected]>
perf/arm_cspmu: Fix event attribute type
Ilkka Koskinen <[email protected]>
perf: arm_cspmu: Set irq affinitiy only if overflow interrupt is used
Junhao He <[email protected]>
drivers/perf: hisi: Don't migrate perf to the CPU going to teardown
Kirill A. Shutemov <[email protected]>
x86/tdx: Fix race between set_memory_encrypted() and load_unaligned_zeropad()
Kirill A. Shutemov <[email protected]>
x86/mm: Allow guest.enc_status_change_prepare() to fail
Robin Murphy <[email protected]>
perf/arm-cmn: Fix DTC reset
Nikita Zhandarovich <[email protected]>
PM: domains: fix integer overflow issues in genpd_parse_state()
Feng Mingxi <[email protected]>
clocksource/drivers/cadence-ttc: Fix memory leak in ttc_timer_probe
Christoph Hellwig <[email protected]>
btrfs: fix file_offset for REQ_BTRFS_ONE_ORDERED bios that get split
Christoph Hellwig <[email protected]>
btrfs: make btrfs_split_bio work on struct btrfs_bio
Sebastian Andrzej Siewior <[email protected]>
tracing/timer: Add missing hrtimer modes to decode_hrtimer_mode().
Wen Yang <[email protected]>
tick/rcu: Fix bogus ratelimit condition
Thomas Gleixner <[email protected]>
posix-timers: Prevent RT livelock in itimer_delete()
Gao Xiang <[email protected]>
erofs: fix compact 4B support for 16k block size
Chuck Lever <[email protected]>
svcrdma: Prevent page release when nothing was received
John Paul Adrian Glaubitz <[email protected]>
irqchip/jcore-aic: Fix missing allocation of IRQ descriptors
Antonio Borneo <[email protected]>
irqchip/stm32-exti: Fix warning on initialized field overwritten
Christoph Hellwig <[email protected]>
splice: don't call file_accessed in copy_splice_read
Jianmin Lv <[email protected]>
irqchip/loongson-eiointc: Fix irq affinity setting during resume
Yu Kuai <[email protected]>
block: fix blktrace debugfs entries leakage
Yu Kuai <[email protected]>
md/raid1-10: submit write io directly if bitmap is not enabled
Yu Kuai <[email protected]>
md/raid1-10: factor out a helper to submit normal write
Yu Kuai <[email protected]>
md/raid1-10: factor out a helper to add bio to plug
Li Nan <[email protected]>
md/raid10: fix io loss while replacement replace rdev
Li Nan <[email protected]>
md/raid10: fix null-ptr-deref of mreplace in raid10_sync_request
Li Nan <[email protected]>
md/raid10: fix wrong setting of max_corr_read_errors
Li Nan <[email protected]>
md/raid10: fix overflow of md/safe_mode_delay
Li Nan <[email protected]>
md/raid10: check slab-out-of-bounds in md_bitmap_get_counter
Chaitanya Kulkarni <[email protected]>
nvme-core: fix dev_pm_qos memleak
Chaitanya Kulkarni <[email protected]>
nvme-core: add missing fault-injection cleanup
Chaitanya Kulkarni <[email protected]>
nvme-core: fix memory leak in dhchap_ctrl_secret
Chaitanya Kulkarni <[email protected]>
nvme-core: fix memory leak in dhchap_secret_store
NeilBrown <[email protected]>
lockd: drop inappropriate svc_get() from locked_get()
Yu Kuai <[email protected]>
blk-mq: fix potential io hang by wrong 'wake_batch'
Arnd Bergmann <[email protected]>
virt: sevguest: Add CONFIG_CRYPTO dependency
Waiman Long <[email protected]>
blk-cgroup: Reinit blkg_iostat_set after clearing in blkcg_reset_stats()
Tom Lendacky <[email protected]>
x86/sev: Fix calculation of end address based on number of pages
Li Nan <[email protected]>
blk-iocost: use spin_lock_irqsave in adjust_inuse_and_calc_cost
Shawn Wang <[email protected]>
x86/resctrl: Only show tasks' pid in current pid namespace
Gao Xiang <[email protected]>
erofs: kill hooked chains to avoid loops on deduplicated compressed images
David Howells <[email protected]>
splice: Fix filemap_splice_read() to use the correct inode
Bart Van Assche <[email protected]>
block: Fix the type of the second bdev_op_is_zoned_write() argument
Arnd Bergmann <[email protected]>
fs: pipe: reveal missing function protoypes
Jeff Layton <[email protected]>
drm: use mgr->dev in drm_dbg_kms in drm_dp_add_payload_part2
Peter Collingbourne <[email protected]>
mm: call arch_swap_restore() from do_swap_page()
-------------
Diffstat:
.../bindings/sound/mediatek,mt8188-afe.yaml | 36 +- Makefile | 4 +- arch/arc/include/asm/linkage.h | 8 +- arch/arm/boot/dts/bcm53015-meraki-mr26.dts | 2 +- arch/arm/boot/dts/bcm53016-meraki-mr32.dts | 2 +- arch/arm/boot/dts/bcm5301x.dtsi | 1 - arch/arm/boot/dts/iwg20d-q7-common.dtsi | 2 +- .../boot/dts/lan966x-kontron-kswitch-d10-mmt.dtsi | 16 +- arch/arm/boot/dts/meson8.dtsi | 4 +- arch/arm/boot/dts/meson8b.dtsi | 4 +- arch/arm/boot/dts/omap3-gta04a5one.dts | 4 +- arch/arm/boot/dts/qcom-apq8074-dragonboard.dts | 4 + arch/arm/boot/dts/qcom-msm8974.dtsi | 2 +- arch/arm/boot/dts/stm32mp15xx-dhcom-pdk2.dtsi | 11 +- arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi | 8 +- .../boot/dts/stm32mp15xx-dhcor-drc-compact.dtsi | 6 + arch/arm/boot/dts/stm32mp15xx-dhcor-som.dtsi | 6 - arch/arm/boot/dts/stm32mp15xx-dhcor-testbench.dtsi | 8 + arch/arm/boot/dts/stm32mp15xx-dkx.dtsi | 2 +- arch/arm/include/asm/assembler.h | 17 + arch/arm/include/asm/sync_bitops.h | 29 +- arch/arm/lib/bitops.h | 14 +- arch/arm/lib/testchangebit.S | 4 + arch/arm/lib/testclearbit.S | 4 + arch/arm/lib/testsetbit.S | 4 + arch/arm/mach-ep93xx/timer-ep93xx.c | 3 +- arch/arm/mach-omap1/board-ams-delta.c | 1 - arch/arm/mach-omap1/board-nokia770.c | 43 +- arch/arm/mach-omap1/board-osk.c | 139 +++++-- arch/arm/mach-omap1/board-palmte.c | 51 ++- arch/arm/mach-omap1/board-sx1-mmc.c | 1 - arch/arm/mach-omap1/board-sx1.c | 40 +- arch/arm/mach-omap1/devices.c | 1 - arch/arm/mach-omap1/gpio15xx.c | 1 - arch/arm/mach-omap1/gpio16xx.c | 1 - arch/arm/mach-omap1/irq.c | 1 - arch/arm/mach-omap2/board-generic.c | 1 + arch/arm/mach-omap2/board-n8x0.c | 156 ++----- arch/arm/mach-omap2/usb-tusb6010.c | 20 +- arch/arm/mach-omap2/usb-tusb6010.h | 12 + arch/arm/probes/kprobes/checkers-common.c | 2 +- arch/arm/probes/kprobes/core.c | 2 +- arch/arm/probes/kprobes/opt-arm.c | 2 - arch/arm/probes/kprobes/test-core.c | 2 +- arch/arm/probes/kprobes/test-core.h | 4 + .../dts/mediatek/mt7986a-bananapi-bpi-r3-nand.dtso | 6 +- arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 4 + arch/arm64/boot/dts/mediatek/mt8192.dtsi | 22 +- arch/arm64/boot/dts/microchip/sparx5.dtsi | 2 +- .../boot/dts/microchip/sparx5_pcb_common.dtsi | 12 + arch/arm64/boot/dts/qcom/apq8016-sbc.dts | 93 +++-- arch/arm64/boot/dts/qcom/apq8096-ifc6640.dts | 4 +- arch/arm64/boot/dts/qcom/ipq6018.dtsi | 2 +- arch/arm64/boot/dts/qcom/msm8916-acer-a1-724.dts | 12 +- .../boot/dts/qcom/msm8916-alcatel-idol347.dts | 12 +- arch/arm64/boot/dts/qcom/msm8916-asus-z00l.dts | 12 +- arch/arm64/boot/dts/qcom/msm8916-gplus-fl8005a.dts | 12 +- arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts | 12 +- .../boot/dts/qcom/msm8916-longcheer-l8150.dts | 12 +- .../boot/dts/qcom/msm8916-longcheer-l8910.dts | 12 +- arch/arm64/boot/dts/qcom/msm8916-pm8916.dtsi | 22 +- .../dts/qcom/msm8916-samsung-a2015-common.dtsi | 4 - .../boot/dts/qcom/msm8916-samsung-a3u-eur.dts | 8 + .../boot/dts/qcom/msm8916-samsung-a5u-eur.dts | 14 +- .../dts/qcom/msm8916-samsung-e2015-common.dtsi | 8 + .../boot/dts/qcom/msm8916-samsung-gt5-common.dtsi | 16 +- .../boot/dts/qcom/msm8916-samsung-j5-common.dtsi | 12 +- .../boot/dts/qcom/msm8916-samsung-serranove.dts | 16 +- arch/arm64/boot/dts/qcom/msm8916-ufi.dtsi | 12 +- .../boot/dts/qcom/msm8916-wingtech-wt88047.dts | 12 +- arch/arm64/boot/dts/qcom/msm8916.dtsi | 19 +- arch/arm64/boot/dts/qcom/msm8953.dtsi | 2 +- arch/arm64/boot/dts/qcom/msm8976.dtsi | 6 +- arch/arm64/boot/dts/qcom/msm8994.dtsi | 2 +- arch/arm64/boot/dts/qcom/msm8996.dtsi | 2 +- arch/arm64/boot/dts/qcom/pm7250b.dtsi | 1 + arch/arm64/boot/dts/qcom/pm8998.dtsi | 2 +- arch/arm64/boot/dts/qcom/qdu1000.dtsi | 1 + arch/arm64/boot/dts/qcom/sdm630.dtsi | 2 +- arch/arm64/boot/dts/qcom/sdm670.dtsi | 1 + arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts | 1 + arch/arm64/boot/dts/qcom/sdm845.dtsi | 3 +- arch/arm64/boot/dts/qcom/sm6115.dtsi | 2 +- .../boot/dts/qcom/sm8250-sony-xperia-edo.dtsi | 7 +- arch/arm64/boot/dts/qcom/sm8350.dtsi | 4 +- arch/arm64/boot/dts/qcom/sm8550.dtsi | 11 +- arch/arm64/boot/dts/renesas/ulcb-kf.dtsi | 3 +- arch/arm64/boot/dts/ti/k3-am69-sk.dts | 2 +- .../boot/dts/ti/k3-j7200-common-proc-board.dts | 28 +- arch/arm64/boot/dts/ti/k3-j721e-beagleboneai64.dts | 5 + arch/arm64/boot/dts/ti/k3-j784s4-evm.dts | 52 ++- arch/arm64/boot/dts/ti/k3-j784s4-mcu-wakeup.dtsi | 29 +- arch/arm64/include/asm/fpsimdmacros.h | 6 +- arch/mips/boot/dts/ingenic/ci20.dts | 38 +- arch/powerpc/kernel/interrupt.c | 3 +- arch/powerpc/kernel/ppc_save_regs.S | 6 +- arch/powerpc/kernel/signal_32.c | 15 +- arch/powerpc/mm/book3s64/radix_pgtable.c | 34 +- arch/powerpc/mm/init_64.c | 2 +- arch/powerpc/platforms/powernv/pci-sriov.c | 6 +- arch/powerpc/platforms/powernv/vas-window.c | 2 +- arch/powerpc/platforms/pseries/vas.c | 2 +- arch/riscv/kernel/probes/uprobes.c | 2 + arch/x86/coco/tdx/tdx.c | 51 ++- arch/x86/events/amd/core.c | 2 +- arch/x86/events/amd/ibs.c | 53 ++- arch/x86/include/asm/mtrr.h | 40 +- arch/x86/include/asm/perf_event.h | 2 + arch/x86/include/asm/pgtable_64.h | 4 +- arch/x86/include/asm/sev.h | 16 +- arch/x86/include/asm/x86_init.h | 2 +- arch/x86/include/uapi/asm/mtrr.h | 8 - arch/x86/kernel/cpu/mtrr/cleanup.c | 18 +- arch/x86/kernel/cpu/mtrr/generic.c | 124 ++++-- arch/x86/kernel/cpu/mtrr/mtrr.c | 73 +--- arch/x86/kernel/cpu/mtrr/mtrr.h | 4 +- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 8 +- arch/x86/kernel/setup.c | 2 + arch/x86/kernel/sev.c | 14 +- arch/x86/kernel/x86_init.c | 2 +- arch/x86/mm/mem_encrypt_amd.c | 4 +- arch/x86/mm/pat/set_memory.c | 3 +- arch/x86/platform/efi/efi_64.c | 6 +- arch/x86/xen/enlighten_pv.c | 52 +++ block/blk-cgroup.c | 5 + block/blk-iocost.c | 7 +- block/blk-mq-debugfs.c | 2 +- block/blk-mq-tag.c | 15 +- block/blk-mq.h | 3 +- block/genhd.c | 5 +- crypto/jitterentropy.c | 9 +- drivers/acpi/apei/ghes.c | 2 + drivers/base/power/domain.c | 15 +- drivers/bus/ti-sysc.c | 4 +- drivers/char/hw_random/st-rng.c | 21 +- drivers/char/hw_random/virtio-rng.c | 10 +- drivers/clk/bcm/clk-raspberrypi.c | 4 +- drivers/clk/clk-cdce925.c | 12 + drivers/clk/clk-renesas-pcie.c | 72 +++- drivers/clk/clk-si5341.c | 38 +- drivers/clk/clk-versaclock5.c | 45 ++- drivers/clk/clk-versaclock7.c | 2 +- drivers/clk/clk.c | 2 + drivers/clk/imx/clk-imx8mn.c | 8 +- drivers/clk/imx/clk-imx8mp.c | 24 +- drivers/clk/imx/clk-imx93.c | 15 +- drivers/clk/imx/clk-imxrt1050.c | 22 +- drivers/clk/imx/clk-scu.c | 4 +- drivers/clk/keystone/sci-clk.c | 2 + drivers/clk/mediatek/clk-mt8173-apmixedsys.c | 7 +- drivers/clk/mediatek/clk-mtk.c | 7 +- drivers/clk/renesas/rzg2l-cpg.c | 6 +- drivers/clk/renesas/rzg2l-cpg.h | 3 - drivers/clk/tegra/clk-tegra124-emc.c | 2 + drivers/clk/ti/clkctrl.c | 7 + drivers/clk/xilinx/clk-xlnx-clock-wizard.c | 2 +- drivers/clocksource/timer-cadence-ttc.c | 19 +- drivers/cpufreq/intel_pstate.c | 2 + drivers/crypto/marvell/cesa/cipher.c | 2 +- drivers/crypto/nx/Makefile | 2 +- drivers/crypto/nx/nx.h | 4 +- drivers/crypto/qat/qat_common/qat_asym_algs.c | 14 +- drivers/cxl/core/region.c | 102 +++-- drivers/cxl/cxl.h | 16 +- drivers/dax/bus.c | 61 +-- drivers/dax/dax-private.h | 4 +- drivers/dax/kmem.c | 2 +- drivers/firmware/efi/libstub/efi-stub-helper.c | 6 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 16 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c | 13 +- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 + .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 5 +- .../dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.c | 3 + drivers/gpu/drm/amd/display/dc/core/dc.c | 3 - drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 6 +- drivers/gpu/drm/amd/display/dc/dc.h | 3 + .../amd/display/dc/dml/dcn21/display_mode_vba_21.c | 2 +- .../display/dc/dml/dcn32/display_rq_dlg_calc_32.c | 2 +- .../drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 18 +- drivers/gpu/drm/bridge/analogix/anx7625.c | 128 ++++-- drivers/gpu/drm/bridge/ite-it6505.c | 3 +- drivers/gpu/drm/bridge/tc358767.c | 4 +- drivers/gpu/drm/bridge/tc358768.c | 93 ++++- drivers/gpu/drm/bridge/ti-sn65dsi83.c | 20 +- drivers/gpu/drm/display/drm_dp_mst_topology.c | 2 +- drivers/gpu/drm/drm_gem_vram_helper.c | 6 +- drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c | 35 ++ drivers/gpu/drm/i915/gt/uc/intel_guc_rc.c | 8 +- drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c | 95 +++-- drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.h | 1 + drivers/gpu/drm/i915/gt/uc/intel_guc_slpc_types.h | 1 + drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 3 +- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 3 +- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 5 +- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 10 +- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h | 12 +- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c | 5 +- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c | 5 +- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c | 8 +- drivers/gpu/drm/msm/dp/dp_display.c | 16 +- drivers/gpu/drm/msm/dsi/dsi_host.c | 26 +- drivers/gpu/drm/msm/dsi/phy/dsi_phy_14nm.c | 3 + drivers/gpu/drm/nouveau/dispnv50/disp.c | 1 + drivers/gpu/drm/nouveau/nv50_display.h | 4 +- drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c | 11 +- drivers/gpu/drm/panel/panel-simple.c | 4 +- drivers/gpu/drm/radeon/ci_dpm.c | 28 +- drivers/gpu/drm/radeon/cypress_dpm.c | 8 +- drivers/gpu/drm/radeon/ni_dpm.c | 8 +- drivers/gpu/drm/radeon/rv740_dpm.c | 8 +- drivers/gpu/drm/sun4i/sun4i_tcon.c | 19 +- drivers/gpu/drm/vkms/vkms_composer.c | 4 +- drivers/gpu/drm/vkms/vkms_drv.h | 4 +- drivers/gpu/drm/vkms/vkms_formats.c | 131 +++--- drivers/gpu/drm/vkms/vkms_formats.h | 2 +- drivers/gpu/drm/vkms/vkms_plane.c | 2 +- drivers/hid/Kconfig | 2 +- drivers/hwmon/f71882fg.c | 7 +- drivers/hwmon/gsc-hwmon.c | 6 +- drivers/hwmon/pmbus/adm1275.c | 52 +-- drivers/infiniband/hw/bnxt_re/main.c | 20 +- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 40 +- drivers/infiniband/hw/bnxt_re/qplib_fp.h | 2 +- drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 46 ++- drivers/infiniband/hw/bnxt_re/qplib_rcfw.h | 1 + drivers/infiniband/hw/hfi1/ipoib_tx.c | 4 +- drivers/infiniband/hw/hfi1/mmu_rb.c | 101 +++-- drivers/infiniband/hw/hfi1/mmu_rb.h | 3 + drivers/infiniband/hw/hfi1/sdma.c | 23 +- drivers/infiniband/hw/hfi1/sdma.h | 47 ++- drivers/infiniband/hw/hfi1/sdma_txreq.h | 2 + drivers/infiniband/hw/hfi1/user_sdma.c | 137 +++---- drivers/infiniband/hw/hfi1/user_sdma.h | 1 - drivers/infiniband/hw/hfi1/vnic_sdma.c | 4 +- drivers/infiniband/hw/hns/hns_roce_hem.c | 7 +- drivers/infiniband/hw/irdma/uk.c | 10 +- drivers/infiniband/sw/rxe/rxe_mw.c | 17 +- drivers/input/misc/adxl34x.c | 3 +- drivers/input/misc/drv260x.c | 1 + drivers/input/misc/pm8941-pwrkey.c | 19 +- drivers/input/touchscreen/cyttsp4_core.c | 3 +- drivers/iommu/iommufd/device.c | 2 +- drivers/iommu/iommufd/io_pagetable.c | 14 +- drivers/iommu/virtio-iommu.c | 57 ++- drivers/irqchip/irq-jcore-aic.c | 7 + drivers/irqchip/irq-loongson-eiointc.c | 2 +- drivers/irqchip/irq-stm32-exti.c | 12 + drivers/md/md-bitmap.c | 21 +- drivers/md/md-bitmap.h | 7 + drivers/md/md.c | 9 +- drivers/md/raid1-10.c | 42 ++ drivers/md/raid1.c | 25 +- drivers/md/raid10.c | 73 ++-- drivers/memory/brcmstb_dpfe.c | 4 +- drivers/memstick/host/r592.c | 4 +- drivers/mfd/tps65010.c | 14 +- drivers/mmc/core/card.h | 30 +- drivers/mmc/core/quirks.h | 13 + drivers/mmc/core/sd.c | 2 +- drivers/mmc/host/mtk-sd.c | 2 +- drivers/mmc/host/omap.c | 46 ++- drivers/net/bonding/bond_main.c | 2 +- drivers/net/can/kvaser_pciefd.c | 39 +- drivers/net/ethernet/intel/ice/ice.h | 7 + drivers/net/ethernet/intel/ice/ice_main.c | 29 +- drivers/net/ethernet/intel/ice/ice_ptp.c | 12 +- drivers/net/ethernet/intel/ice/ice_ptp.h | 4 +- drivers/net/ethernet/intel/igc/igc.h | 28 ++ drivers/net/ethernet/intel/igc/igc_main.c | 31 +- drivers/net/ethernet/sfc/ef10.c | 13 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 - drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 10 +- drivers/net/gtp.c | 2 + drivers/net/ipvlan/ipvlan_core.c | 9 +- drivers/net/wireless/ath/ath10k/core.c | 9 - drivers/net/wireless/ath/ath10k/mac.c | 7 + drivers/net/wireless/ath/ath11k/ahb.c | 1 + drivers/net/wireless/ath/ath11k/core.c | 1 + drivers/net/wireless/ath/ath11k/hw.c | 2 +- drivers/net/wireless/ath/ath11k/qmi.c | 5 + drivers/net/wireless/ath/ath9k/ar9003_hw.c | 27 +- drivers/net/wireless/ath/ath9k/htc_hst.c | 8 +- drivers/net/wireless/ath/ath9k/main.c | 11 +- drivers/net/wireless/ath/ath9k/wmi.c | 4 + drivers/net/wireless/atmel/atmel_cs.c | 13 +- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 5 +- drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 9 +- drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 5 +- drivers/net/wireless/intersil/orinoco/orinoco_cs.c | 13 +- .../net/wireless/intersil/orinoco/spectrum_cs.c | 13 +- drivers/net/wireless/marvell/mwifiex/scan.c | 6 +- drivers/net/wireless/microchip/wilc1000/hif.c | 8 +- drivers/net/wireless/ray_cs.c | 16 +- drivers/net/wireless/realtek/rtw88/usb.c | 2 +- drivers/net/wireless/rsi/rsi_91x_sdio.c | 9 +- drivers/net/wireless/wl3501_cs.c | 16 +- drivers/nvme/host/core.c | 16 +- drivers/pci/controller/cadence/pcie-cadence-host.c | 27 ++ drivers/pci/controller/pci-ftpci100.c | 14 +- drivers/pci/controller/vmd.c | 11 +- drivers/pci/endpoint/functions/Kconfig | 2 +- drivers/pci/endpoint/functions/pci-epf-test.c | 2 +- drivers/pci/hotplug/pciehp_ctrl.c | 8 + drivers/pci/pcie/aspm.c | 21 +- drivers/perf/arm-cmn.c | 7 +- drivers/perf/arm_cspmu/arm_cspmu.c | 11 +- drivers/perf/hisilicon/hisi_pcie_pmu.c | 2 +- drivers/pinctrl/bcm/pinctrl-bcm2835.c | 6 +- drivers/pinctrl/freescale/pinctrl-scu.c | 3 +- drivers/pinctrl/intel/pinctrl-cherryview.c | 15 +- drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c | 2 + drivers/pinctrl/pinctrl-at91-pio4.c | 2 + drivers/pinctrl/pinctrl-at91.c | 78 ++-- drivers/pinctrl/pinctrl-microchip-sgpio.c | 3 + drivers/pinctrl/sunplus/sppctl.c | 23 +- drivers/pinctrl/tegra/pinctrl-tegra.c | 15 +- drivers/pinctrl/tegra/pinctrl-tegra.h | 3 +- drivers/pinctrl/tegra/pinctrl-tegra114.c | 7 +- drivers/pinctrl/tegra/pinctrl-tegra124.c | 7 +- drivers/pinctrl/tegra/pinctrl-tegra194.c | 7 +- drivers/pinctrl/tegra/pinctrl-tegra20.c | 7 +- drivers/pinctrl/tegra/pinctrl-tegra210.c | 7 +- drivers/pinctrl/tegra/pinctrl-tegra30.c | 7 +- drivers/platform/x86/dell/dell-rbtn.c | 13 +- drivers/platform/x86/intel/pmc/core.c | 1 - drivers/platform/x86/intel/pmc/core.h | 28 +- drivers/platform/x86/intel/pmc/mtl.c | 448 ++++++++++++++++++++- drivers/platform/x86/lenovo-yogabook-wmi.c | 34 +- drivers/platform/x86/think-lmi.c | 20 +- drivers/platform/x86/thinkpad_acpi.c | 6 +- drivers/powercap/Kconfig | 4 +- drivers/powercap/intel_rapl_msr.c | 17 +- drivers/regulator/core.c | 30 +- drivers/scsi/3w-xxxx.c | 4 +- drivers/scsi/lpfc/lpfc_els.c | 14 +- drivers/scsi/qedf/qedf_main.c | 3 +- drivers/soc/amlogic/meson-secure-pwrc.c | 2 +- drivers/soc/fsl/qe/Kconfig | 1 + drivers/soc/mediatek/mtk-svs.c | 4 +- drivers/soc/xilinx/xlnx_event_manager.c | 6 +- drivers/spi/spi-dw-core.c | 5 +- drivers/spi/spi-geni-qcom.c | 2 +- drivers/thermal/amlogic_thermal.c | 2 +- drivers/thermal/imx8mm_thermal.c | 2 +- drivers/thermal/imx_sc_thermal.c | 2 +- drivers/thermal/k3_bandgap.c | 2 +- drivers/thermal/mediatek/auxadc_thermal.c | 2 +- drivers/thermal/qcom/qcom-spmi-adc-tm5.c | 2 +- drivers/thermal/qcom/qcom-spmi-temp-alarm.c | 2 +- drivers/thermal/qcom/tsens-v0_1.c | 56 ++- drivers/thermal/qcom/tsens.c | 21 +- drivers/thermal/qcom/tsens.h | 6 +- drivers/thermal/qoriq_thermal.c | 32 +- drivers/thermal/sun8i_thermal.c | 57 +-- drivers/thermal/tegra/tegra30-tsensor.c | 2 +- drivers/thermal/thermal_hwmon.c | 4 +- drivers/thermal/thermal_hwmon.h | 4 +- drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 2 +- drivers/ufs/core/ufshcd-priv.h | 3 - drivers/ufs/core/ufshcd.c | 21 +- drivers/usb/musb/musb_core.c | 1 - drivers/usb/musb/musb_core.h | 2 - drivers/usb/musb/tusb6010.c | 53 ++- drivers/vfio/mdev/mdev_core.c | 23 +- drivers/video/fbdev/omap/lcd_mipid.c | 6 +- drivers/virt/coco/sev-guest/Kconfig | 1 + fs/btrfs/bio.c | 28 +- fs/cifs/cifs_debug.c | 16 +- fs/cifs/cifsglob.h | 10 +- fs/cifs/cifsproto.h | 2 +- fs/cifs/connect.c | 70 ++-- fs/cifs/dfs.c | 55 +-- fs/cifs/dfs.h | 19 +- fs/cifs/dfs_cache.c | 8 +- fs/cifs/file.c | 25 +- fs/cifs/misc.c | 38 +- fs/cifs/smb2inode.c | 9 +- fs/cifs/smb2ops.c | 19 +- fs/cifs/transport.c | 20 +- fs/erofs/zdata.c | 72 +--- fs/erofs/zmap.c | 6 +- fs/ksmbd/smb_common.c | 2 +- fs/lockd/svc.c | 1 - fs/nfs/nfs42xattr.c | 79 ++-- fs/nfs/nfs4proc.c | 1 + fs/ocfs2/cluster/tcp.c | 23 +- fs/overlayfs/copy_up.c | 2 + fs/overlayfs/dir.c | 3 +- fs/overlayfs/export.c | 3 +- fs/overlayfs/namei.c | 3 +- fs/overlayfs/overlayfs.h | 6 +- fs/overlayfs/super.c | 2 +- fs/overlayfs/util.c | 24 +- fs/pstore/ram_core.c | 2 + fs/splice.c | 1 - include/drm/drm_fixed.h | 6 + include/linux/blk-mq.h | 3 +- include/linux/blkdev.h | 2 +- include/linux/bootmem_info.h | 2 + include/linux/bpf.h | 1 - include/linux/can/length.h | 14 +- include/linux/ieee80211.h | 5 +- include/linux/mfd/tps65010.h | 11 +- include/linux/mmc/card.h | 1 + include/linux/netdevice.h | 9 + include/linux/nmi.h | 2 +- include/linux/pci.h | 1 + include/linux/pipe_fs_i.h | 4 - include/linux/platform_data/mmc-omap.h | 2 - include/linux/usb/musb.h | 13 - include/net/dsa.h | 12 +- include/net/regulatory.h | 13 +- include/net/sock.h | 1 + include/trace/events/timer.h | 6 +- include/ufs/ufshcd.h | 1 - init/Makefile | 1 + kernel/bpf/cgroup.c | 15 + kernel/bpf/trampoline.c | 32 +- kernel/kcsan/core.c | 2 + kernel/kexec_core.c | 5 +- kernel/rcu/rcu.h | 6 + kernel/rcu/rcuscale.c | 204 +++++----- kernel/rcu/tasks.h | 7 +- kernel/rcu/tree.c | 23 +- kernel/sched/fair.c | 18 + kernel/sched/sched.h | 22 + kernel/time/posix-timers.c | 43 +- kernel/time/tick-sched.c | 2 +- kernel/watchdog_hld.c | 6 +- lib/ts_bm.c | 4 +- mm/filemap.c | 4 +- mm/memory.c | 7 + net/core/filter.c | 126 ++++-- net/core/rtnetlink.c | 104 ++--- net/core/sock.c | 17 +- net/dsa/dsa.c | 2 +- net/dsa/slave.c | 84 ++-- net/dsa/switch.c | 4 +- net/dsa/switch.h | 3 + net/mac80211/debugfs_netdev.c | 2 +- net/mac80211/sta_info.c | 2 + net/mac80211/util.c | 4 +- net/netfilter/nf_conntrack_proto_dccp.c | 52 ++- net/netfilter/nf_conntrack_sip.c | 2 +- net/netlink/af_netlink.c | 5 +- net/netlink/diag.c | 7 +- net/nfc/llcp.h | 1 - net/nfc/llcp_commands.c | 15 +- net/nfc/llcp_core.c | 49 ++- net/nfc/llcp_sock.c | 18 +- net/nfc/netlink.c | 20 +- net/nfc/nfc.h | 1 + net/sctp/socket.c | 18 + net/sunrpc/xprtrdma/svc_rdma_recvfrom.c | 12 +- net/wireless/core.c | 16 - net/wireless/reg.c | 14 +- net/wireless/scan.c | 367 +++++++---------- samples/bpf/tcp_basertt_kern.c | 2 +- samples/bpf/xdp1_kern.c | 2 +- samples/bpf/xdp2_kern.c | 2 +- scripts/Makefile.modfinal | 2 +- scripts/Makefile.vmlinux | 1 + scripts/mod/modpost.c | 86 ++-- scripts/package/builddeb | 14 +- security/integrity/evm/evm_crypto.c | 2 +- security/integrity/evm/evm_main.c | 4 +- security/integrity/ima/ima_modsig.c | 3 + security/integrity/ima/ima_policy.c | 3 +- sound/pci/ac97/ac97_codec.c | 4 +- sound/soc/amd/acp/acp-pdm.c | 2 +- sound/soc/codecs/es8316.c | 23 +- sound/soc/fsl/imx-audmix.c | 9 + sound/soc/intel/boards/sof_sdw.c | 2 +- tools/bpf/bpftool/feature.c | 24 +- tools/bpf/resolve_btfids/Makefile | 4 +- tools/lib/bpf/bpf_helpers.h | 15 +- tools/lib/bpf/btf_dump.c | 22 +- tools/perf/arch/x86/util/Build | 1 + tools/perf/arch/x86/util/env.c | 19 + tools/perf/arch/x86/util/env.h | 7 + tools/perf/arch/x86/util/evsel.c | 16 +- tools/perf/arch/x86/util/mem-events.c | 19 +- tools/perf/builtin-bench.c | 2 + tools/perf/builtin-script.c | 16 +- tools/perf/builtin-stat.c | 2 + tools/perf/tests/shell/test_task_analyzer.sh | 26 +- tools/perf/util/dwarf-aux.c | 2 +- tools/perf/util/evsel.h | 24 +- tools/perf/util/evsel_fprintf.c | 1 + tools/testing/selftests/bpf/Makefile | 3 +- tools/testing/selftests/bpf/prog_tests/check_mtu.c | 2 +- tools/testing/selftests/bpf/test_verifier.c | 24 +- tools/testing/selftests/cgroup/test_memcontrol.c | 4 +- tools/testing/selftests/net/rtnetlink.sh | 1 + .../rcutorture/configs/rcu/BUSTED-BOOST.boot | 2 +- .../selftests/rcutorture/configs/rcu/TREE03.boot | 2 +- .../selftests/vDSO/vdso_test_clock_getres.c | 4 +- 498 files changed, 5144 insertions(+), 3097 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/431 mm: call arch_swap_restore() from do_swap_page()
From: Peter Collingbourne <[email protected]>
commit 6dca4ac6fc91fd41ea4d6c4511838d37f4e0eab2 upstream.
Commit c145e0b47c77 ("mm: streamline COW logic in do_swap_page()") moved the call to swap_free() before the call to set_pte_at(), which meant that the MTE tags could end up being freed before set_pte_at() had a chance to restore them. Fix it by adding a call to the arch_swap_restore() hook before the call to swap_free().
--- mm/memory.c | 7 +++++++ 1 file changed, 7 insertions(+)
mm/memory.c +7 -0
@@ -3915,6 +3915,13 @@ vm_fault_t do_swap_page(struct vm_fault }/* +* Some architectures may have to restore extra metadata to the page +* when reading from swap. This metadata may be indexed by swap entry +* so this must be called before swap_free(). +*/ +arch_swap_restore (entry, folio); + +/* * Remove the swap entry and conditionally try to free up the swapcache. * We're already holding a reference on the page but haven't mapped it * yet.
Greg Kroah-Hartman
maintainerPATCH 2/431 drm: use mgr->dev in drm_dbg_kms in drm_dp_add_payload_part2
In reply to Greg Kroah-HartmanFrom: Jeff Layton <[email protected]>
commit 54d217406afe250d7a768783baaa79a035f21d38 upstream.
I've been experiencing some intermittent crashes down in the display driver code. The symptoms are ususally a line like this in dmesg:
amdgpu 0000:30:00.0: [drm] Failed to create MST payload for port 000000006d3a3885: -5
...followed by an Oops due to a NULL pointer dereference.
Switch to using mgr->dev instead of state->dev since "state" can be NULL in some cases.
--- drivers/gpu/drm/display/drm_dp_mst_topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/display/drm_dp_mst_topology.c +1 -1
@@ -3404,7 +3404,7 @@ int drm_dp_add_payload_part2(struct drm_/* Skip failed payloads */ if (payload->vc_start_slot ==-1 ) { -drm_dbg_kms (state->dev,"Part 1 of payload creation for %s failed, skipping part 2\n" , +drm_dbg_kms (mgr->dev,"Part 1 of payload creation for %s failed, skipping part 2\n" , payload->port->connector->name);return -EIO ; }
Greg Kroah-Hartman
maintainerPATCH 3/431 fs: pipe: reveal missing function protoypes
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 247c8d2f9837a3e29e3b6b7a4aa9c36c37659dd4 ]
A couple of functions from fs/pipe.c are used both internally and for the watch queue code, but the declaration is only visible when the latter is enabled:
fs/pipe.c:1254:5: error: no previous prototype for 'pipe_resize_ring' fs/pipe.c:758:15: error: no previous prototype for 'account_pipe_buffers' fs/pipe.c:764:6: error: no previous prototype for 'too_many_pipe_buffers_soft' fs/pipe.c:771:6: error: no previous prototype for 'too_many_pipe_buffers_hard' fs/pipe.c:777:6: error: no previous prototype for 'pipe_is_unprivileged_user'
Make the visible unconditionally to avoid these warnings.
Message-Id: <[email protected]>
--- include/linux/pipe_fs_i.h | 4 ---- 1 file changed, 4 deletions(-)
include/linux/pipe_fs_i.h +0 -4
@@ -261,18 +261,14 @@ void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *);extern const struct pipe_buf_operations nosteal_pipe_buf_ops; -#ifdef CONFIG_WATCH_QUEUE unsigned long account_pipe_buffers (struct user_struct *user,unsigned long old,unsigned long new);bool too_many_pipe_buffers_soft (unsigned long user_bufs);bool too_many_pipe_buffers_hard (unsigned long user_bufs);bool pipe_is_unprivileged_user (void ); -#endif /* for F_SETPIPE_SZ and F_GETPIPE_SZ */ -#ifdef CONFIG_WATCH_QUEUE int pipe_resize_ring (struct pipe_inode_info *pipe,unsigned int nr_slots); -#endif long pipe_fcntl (struct file *,unsigned int ,unsigned long arg);struct pipe_inode_info *get_pipe_info (struct file *file,bool for_splice);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 4/431 block: Fix the type of the second bdev_op_is_zoned_write() argument
In reply to Greg Kroah-HartmanFrom: Bart Van Assche <[email protected]>
[ Upstream commit 3ddbe2a7e0d4a155a805f69c906c9beed30d4cc4 ]
Change the type of the second argument of bdev_op_is_zoned_write() from blk_opf_t into enum req_op because this function expects an operation without flags as second argument.
--- include/linux/blkdev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/blkdev.h +1 -1
@@ -1297,7 +1297,7 @@ static inline unsigned int bdev_zone_no(struct block_device *bdev, sector_t sec) }static inline bool bdev_op_is_zoned_write (struct block_device *bdev, -blk_opf_t op) +enum req_op op) {if (!bdev_is_zoned (bdev))return false;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 5/431 splice: Fix filemap_splice_read() to use the correct inode
In reply to Greg Kroah-HartmanFrom: David Howells <[email protected]>
[ Upstream commit c37222082f23c456664d1c3182a714670ab8f9a4 ]
Fix filemap_splice_read() to use file->f_mapping->host, not file->f_inode, as the source of the file size because in the case of a block device, file->f_inode points to the block-special file (which is typically 0 length) and not the backing store.
--- mm/filemap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
mm/filemap.c +2 -2
@@ -2903,7 +2903,7 @@ ssize_t filemap_splice_read(struct file *in, loff_t *ppos, do { cond_resched(); - if (*ppos >= i_size_read(file_inode(in))) + if (*ppos >= i_size_read(in->f_mapping->host)) break; iocb.ki_pos = *ppos;
@@ -2919,7 +2919,7 @@ ssize_t filemap_splice_read(struct file *in, loff_t *ppos,* part of the page is not copied back to userspace (unless * another truncate extends the file - this is desired though). */ - isize =i_size_read (file_inode (in)); + isize =i_size_read (in->f_mapping->host);if (unlikely (*ppos >= isize))break ; end_offset =min_t (loff_t, isize, *ppos + len);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 6/431 erofs: kill hooked chains to avoid loops on deduplicated compressed images
In reply to Greg Kroah-HartmanFrom: Gao Xiang <[email protected]>
[ Upstream commit 967c28b23f6c89bb8eef6a046ea88afe0d7c1029 ]
After heavily stressing EROFS with several images which include a hand-crafted image of repeated patterns for more than 46 days, I found two chains could be linked with each other almost simultaneously and form a loop so that the entire loop won't be submitted. As a consequence, the corresponding file pages will remain locked forever.
It can be _only_ observed on data-deduplicated compressed images. For example, consider two chains with five pclusters in total:
Chain 1: 2->3->4->5 -- The tail pcluster is 5;
Chain 2: 5->1->2 -- The tail pcluster is 2.Chain 2 could link to Chain 1 with pcluster 5; and Chain 1 could link to Chain 2 at the same time with pcluster 2.
Since hooked chains are all linked locklessly now, I have no idea how to simply avoid the race. Instead, let's avoid hooked chains completely until I could work out a proper way to fix this and end users finally tell us that it's needed to add it back.
Actually, this optimization can be found with multi-threaded workloads (especially even more often on deduplicated compressed images), yet I'm not sure about the overall system impacts of not having this compared with implementation complexity.
--- fs/erofs/zdata.c | 72 ++++++++---------------------------------------- 1 file changed, 11 insertions(+), 61 deletions(-)
fs/erofs/zdata.c +11 -61
@@ -94,11 +94,8 @@ struct z_erofs_pcluster {/* let's avoid the valid 32-bit kernel addresses */ -/* the chained workgroup has't submitted io (still open) */ +/* the end of a chain of pclusters */ #define Z_EROFS_PCLUSTER_TAIL ((void *)0x5F0ECAFE) -/* the chained workgroup has already submitted io */ -#define Z_EROFS_PCLUSTER_TAIL_CLOSED ((void *)0x5F0EDEAD) -#define Z_EROFS_PCLUSTER_NIL (NULL)struct z_erofs_decompressqueue {
@@ -499,20 +496,6 @@ int __init z_erofs_init_zip_subsystem(void)enum z_erofs_pclustermode {Z_EROFS_PCLUSTER_INFLIGHT , -/* -* The current pclusters was the tail of an exist chain, in addition -* that the previous processed chained pclusters are all decided to -* be hooked up to it. -* A new chain will be created for the remaining pclusters which are -* not processed yet, so different from Z_EROFS_PCLUSTER_FOLLOWED, -* the next pcluster cannot reuse the whole page safely for inplace I/O -* in the following scenario: -* ________________________________________________________________ -* | tail (partial) page | head (partial) page | -* | (belongs to the next pcl) | (belongs to the current pcl) | -* |_______PCLUSTER_FOLLOWED______|________PCLUSTER_HOOKED__________| -*/ -Z_EROFS_PCLUSTER_HOOKED ,/* * a weak form of Z_EROFS_PCLUSTER_FOLLOWED, the difference is that it * could be dispatched into bypass queue later due to uptodated managed
@@ -530,8 +513,8 @@ enum z_erofs_pclustermode {* ________________________________________________________________ * | tail (partial) page | head (partial) page | * | (of the current cl) | (of the previous collection) | -* | PCLUSTER_FOLLOWED or | | -* |_____PCLUSTER_HOOKED__|___________PCLUSTER_FOLLOWED____________| +* | | | +* |__PCLUSTER_FOLLOWED___|___________PCLUSTER_FOLLOWED____________| * * [ (*) the above page can be used as inplace I/O. ] */
@@ -544,7 +527,7 @@ struct z_erofs_decompress_frontend {struct z_erofs_bvec_iter biter;struct page *candidate_bvpage; -struct z_erofs_pcluster *pcl, *tailpcl; +struct z_erofs_pcluster *pcl;z_erofs_next_pcluster_t owned_head;enum z_erofs_pclustermode mode;
@@ -750,19 +733,7 @@ static void z_erofs_try_to_claim_pcluster(struct z_erofs_decompress_frontend *f)return ; } -/* -* type 2, link to the end of an existing open chain, be careful -* that its submission is controlled by the original attached chain. -*/ -if (*owned_head != &pcl->next && pcl != f->tailpcl && -cmpxchg (&pcl->next,Z_EROFS_PCLUSTER_TAIL , - *owned_head) ==Z_EROFS_PCLUSTER_TAIL ) { - *owned_head =Z_EROFS_PCLUSTER_TAIL ; - f->mode =Z_EROFS_PCLUSTER_HOOKED ; - f->tailpcl =NULL ; -return ; - } -/* type 3, it belongs to a chain, but it isn't the end of the chain */ +/* type 2, it belongs to an ongoing chain */ f->mode =Z_EROFS_PCLUSTER_INFLIGHT ; }
@@ -823,9 +794,6 @@ static int z_erofs_register_pcluster(struct z_erofs_decompress_frontend *fe) goto err_out; } } -/* used to check tail merging loop due to corrupted images */ -if (fe->owned_head ==Z_EROFS_PCLUSTER_TAIL ) - fe->tailpcl = pcl; fe->owned_head = &pcl->next; fe->pcl = pcl;return 0 ;
@@ -846,7 +814,6 @@ static int z_erofs_collector_begin(struct z_erofs_decompress_frontend *fe)/* must be Z_EROFS_PCLUSTER_TAIL or pointed to previous pcluster */ DBG_BUGON (fe->owned_head ==Z_EROFS_PCLUSTER_NIL ); -DBG_BUGON (fe->owned_head ==Z_EROFS_PCLUSTER_TAIL_CLOSED );if (!(map->m_flags &EROFS_MAP_META )) { grp = erofs_find_workgroup(fe->inode->i_sb,
@@ -865,10 +832,6 @@ static int z_erofs_collector_begin(struct z_erofs_decompress_frontend *fe)if (ret == -EEXIST ) {mutex_lock (&fe->pcl->lock); -/* used to check tail merging loop due to corrupted images */ -if (fe->owned_head ==Z_EROFS_PCLUSTER_TAIL ) - fe->tailpcl = fe->pcl; -z_erofs_try_to_claim_pcluster (fe); }else if (ret) {return ret;
@@ -1025,8 +988,7 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,* those chains are handled asynchronously thus the page cannot be used * for inplace I/O or bvpage (should be processed in a strict order.) */ - tight &= (fe->mode >=Z_EROFS_PCLUSTER_HOOKED && - fe->mode !=Z_EROFS_PCLUSTER_FOLLOWED_NOINPLACE ); + tight &= (fe->mode >Z_EROFS_PCLUSTER_FOLLOWED_NOINPLACE ); cur = end - min_t(unsigned int, offset + end - map->m_la, end);if (!(map->m_flags &EROFS_MAP_MAPPED )) {
@@ -1407,10 +1369,7 @@ static void z_erofs_decompress_queue(const struct z_erofs_decompressqueue *io, };z_erofs_next_pcluster_t owned = io->head; -while (owned !=Z_EROFS_PCLUSTER_TAIL_CLOSED ) { -/* impossible that 'owned' equals Z_EROFS_WORK_TPTR_TAIL */ -DBG_BUGON (owned ==Z_EROFS_PCLUSTER_TAIL ); -/* impossible that 'owned' equals Z_EROFS_PCLUSTER_NIL */ +while (owned !=Z_EROFS_PCLUSTER_TAIL ) {DBG_BUGON (owned ==Z_EROFS_PCLUSTER_NIL ); be.pcl = container_of(owned, struct z_erofs_pcluster, next);
@@ -1427,7 +1386,7 @@ static void z_erofs_decompressqueue_work(struct work_struct *work) container_of(work, struct z_erofs_decompressqueue, u.work);struct page *pagepool =NULL ; -DBG_BUGON (bgq->head ==Z_EROFS_PCLUSTER_TAIL_CLOSED ); +DBG_BUGON (bgq->head ==Z_EROFS_PCLUSTER_TAIL );z_erofs_decompress_queue (bgq, &pagepool);erofs_release_pages (&pagepool);kvfree (bgq);
@@ -1615,7 +1574,7 @@ static struct z_erofs_decompressqueue *jobqueue_init(struct super_block *sb, q->sync = true; } q->sb = sb; - q->head =Z_EROFS_PCLUSTER_TAIL_CLOSED ; + q->head =Z_EROFS_PCLUSTER_TAIL ;return q; }
@@ -1633,11 +1592,7 @@ static void move_to_bypass_jobqueue(struct z_erofs_pcluster *pcl,z_erofs_next_pcluster_t *const submit_qtail = qtail[JQ_SUBMIT ];z_erofs_next_pcluster_t *const bypass_qtail = qtail[JQ_BYPASS ]; -DBG_BUGON (owned_head ==Z_EROFS_PCLUSTER_TAIL_CLOSED ); -if (owned_head ==Z_EROFS_PCLUSTER_TAIL ) - owned_head =Z_EROFS_PCLUSTER_TAIL_CLOSED ; - -WRITE_ONCE (pcl->next,Z_EROFS_PCLUSTER_TAIL_CLOSED ); +WRITE_ONCE (pcl->next,Z_EROFS_PCLUSTER_TAIL );WRITE_ONCE (*submit_qtail, owned_head);WRITE_ONCE (*bypass_qtail, &pcl->next);
@@ -1708,15 +1663,10 @@ static void z_erofs_submit_queue(struct z_erofs_decompress_frontend *f,unsigned int i =0 ;bool bypass = true; -/* no possible 'owned_head' equals the following */ -DBG_BUGON (owned_head ==Z_EROFS_PCLUSTER_TAIL_CLOSED );DBG_BUGON (owned_head ==Z_EROFS_PCLUSTER_NIL ); - pcl = container_of(owned_head, struct z_erofs_pcluster, next); + owned_head =READ_ONCE (pcl->next); -/* close the main owned chain at first */ - owned_head =cmpxchg (&pcl->next,Z_EROFS_PCLUSTER_TAIL , -Z_EROFS_PCLUSTER_TAIL_CLOSED );if (z_erofs_is_inline_pcluster (pcl)) {move_to_bypass_jobqueue (pcl, qtail, owned_head);continue ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 7/431 x86/resctrl: Only show tasks pid in current pid namespace
In reply to Greg Kroah-HartmanFrom: Shawn Wang <[email protected]>
[ Upstream commit 2997d94b5dd0e8b10076f5e0b6f18410c73e28bd ]
When writing a task id to the "tasks" file in an rdtgroup, rdtgroup_tasks_write() treats the pid as a number in the current pid namespace. But when reading the "tasks" file, rdtgroup_tasks_show() shows the list of global pids from the init namespace, which is confusing and incorrect.
To be more robust, let the "tasks" file only show pids in the current pid namespace.
--- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
arch/x86/kernel/cpu/resctrl/rdtgroup.c +6 -2
@@ -726,11 +726,15 @@ static ssize_t rdtgroup_tasks_write(struct kernfs_open_file *of,static void show_rdt_tasks (struct rdtgroup *r,struct seq_file *s) {struct task_struct *p, *t; +pid_t pid;rcu_read_lock ();for_each_process_thread (p, t) { -if (is_closid_match (t, r) ||is_rmid_match (t, r)) -seq_printf (s,"%d\n" , t->pid); +if (is_closid_match (t, r) ||is_rmid_match (t, r)) { + pid =task_pid_vnr (t); +if (pid) +seq_printf (s,"%d\n" , pid); + } }rcu_read_unlock (); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 8/431 blk-iocost: use spin_lock_irqsave in adjust_inuse_and_calc_cost
In reply to Greg Kroah-HartmanFrom: Li Nan <[email protected]>
[ Upstream commit 8d211554679d0b23702bd32ba04aeac0c1c4f660 ]
adjust_inuse_and_calc_cost() use spin_lock_irq() and IRQ will be enabled when unlock. DEADLOCK might happen if we have held other locks and disabled IRQ before invoking it.
Fix it by using spin_lock_irqsave() instead, which can keep IRQ state consistent with before when unlock.
================================
WARNING: inconsistent lock state
5.10.0-02758-g8e5f91fd772f #26 Not tainted
--------------------------------
inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage. kworker/2:3/388 [HC0[0]:SC0[0]:HE0:SE1] takes:
ffff888118c00c28 (&bfqd->lock){?.-.}-{2:2}, at: spin_lock_irq ffff888118c00c28 (&bfqd->lock){?.-.}-{2:2}, at: bfq_bio_merge+0x141/0x390 {IN-HARDIRQ-W} state was registered at:
__lock_acquire+0x3d7/0x1070
lock_acquire+0x197/0x4a0
__raw_spin_lock_irqsave
_raw_spin_lock_irqsave+0x3b/0x60
bfq_idle_slice_timer_body
bfq_idle_slice_timer+0x53/0x1d0
__run_hrtimer+0x477/0xa70
__hrtimer_run_queues+0x1c6/0x2d0
hrtimer_interrupt+0x302/0x9e0
local_apic_timer_interrupt
__sysvec_apic_timer_interrupt+0xfd/0x420
run_sysvec_on_irqstack_cond
sysvec_apic_timer_interrupt+0x46/0xa0
asm_sysvec_apic_timer_interrupt+0x12/0x20
irq event stamp: 837522
hardirqs last enabled at (837521): [<ffffffff84b9419d>] __raw_spin_unlock_irqrestore
hardirqs last enabled at (837521): [<ffffffff84b9419d>] _raw_spin_unlock_irqrestore+0x3d/0x40
hardirqs last disabled at (837522): [<ffffffff84b93fa3>] __raw_spin_lock_irq
hardirqs last disabled at (837522): [<ffffffff84b93fa3>] _raw_spin_lock_irq+0x43/0x50
softirqs last enabled at (835852): [<ffffffff84e00558>] __do_softirq+0x558/0x8ec
softirqs last disabled at (835845): [<ffffffff84c010ff>] asm_call_irq_on_stack+0xf/0x20other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(&bfqd->lock);
<Interrupt>
lock(&bfqd->lock);*** DEADLOCK ***
3 locks held by kworker/2:3/388:
#0: ffff888107af0f38 ((wq_completion)kthrotld){+.+.}-{0:0}, at: process_one_work+0x742/0x13f0 #1: ffff8881176bfdd8 ((work_completion)(&td->dispatch_work)){+.+.}-{0:0}, at: process_one_work+0x777/0x13f0 #2: ffff888118c00c28 (&bfqd->lock){?.-.}-{2:2}, at: spin_lock_irq
#2: ffff888118c00c28 (&bfqd->lock){?.-.}-{2:2}, at: bfq_bio_merge+0x141/0x390
stack backtrace: CPU: 2 PID: 388 Comm: kworker/2:3 Not tainted 5.10.0-02758-g8e5f91fd772f #26 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Workqueue: kthrotld blk_throtl_dispatch_work_fn Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x107/0x167 print_usage_bug valid_state mark_lock_irq.cold+0x32/0x3a mark_lock+0x693/0xbc0 mark_held_locks+0x9e/0xe0 __trace_hardirqs_on_caller lockdep_hardirqs_on_prepare.part.0+0x151/0x360 trace_hardirqs_on+0x5b/0x180 __raw_spin_unlock_irq _raw_spin_unlock_irq+0x24/0x40 spin_unlock_irq adjust_inuse_and_calc_cost+0x4fb/0x970 ioc_rqos_merge+0x277/0x740 __rq_qos_merge+0x62/0xb0 rq_qos_merge bio_attempt_back_merge+0x12c/0x4a0 blk_mq_sched_try_merge+0x1b6/0x4d0 bfq_bio_merge+0x24a/0x390 __blk_mq_sched_bio_merge+0xa6/0x460 blk_mq_sched_bio_merge blk_mq_submit_bio+0x2e7/0x1ee0 __submit_bio_noacct_mq+0x175/0x3b0 submit_bio_noacct+0x1fb/0x270 blk_throtl_dispatch_work_fn+0x1ef/0x2b0 process_one_work+0x83e/0x13f0 process_scheduled_works worker_thread+0x7e3/0xd80 kthread+0x353/0x470 ret_from_fork+0x1f/0x30
--- block/blk-iocost.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
block/blk-iocost.c +4 -3
@@ -2455,6 +2455,7 @@ static u64 adjust_inuse_and_calc_cost(struct ioc_gq *iocg, u64 vtime,u32 hwi, adj_step;s64 margin;u64 cost, new_inuse; +unsigned long flags;current_hweight (iocg,NULL , &hwi); old_hwi = hwi;
@@ -2473,11 +2474,11 @@ static u64 adjust_inuse_and_calc_cost(struct ioc_gq *iocg, u64 vtime, iocg->inuse == iocg->active)return cost; -spin_lock_irq (&ioc->lock); +spin_lock_irqsave (&ioc->lock, flags);/* we own inuse only when @iocg is in the normal active state */ if (iocg->abs_vdebt ||list_empty (&iocg->active_list)) { -spin_unlock_irq (&ioc->lock); +spin_unlock_irqrestore (&ioc->lock, flags);return cost; }
@@ -2498,7 +2499,7 @@ static u64 adjust_inuse_and_calc_cost(struct ioc_gq *iocg, u64 vtime, }while (time_after64 (vtime + cost, now->vnow) && iocg->inuse != iocg->active); -spin_unlock_irq (&ioc->lock); +spin_unlock_irqrestore (&ioc->lock, flags);TRACE_IOCG_PATH (inuse_adjust, iocg, now, old_inuse, iocg->inuse, old_hwi, hwi);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 9/431 x86/sev: Fix calculation of end address based on number of pages
In reply to Greg Kroah-HartmanFrom: Tom Lendacky <[email protected]>
[ Upstream commit 5dee19b6b2b194216919b99a1f5af2949a754016 ]
When calculating an end address based on an unsigned int number of pages, any value greater than or equal to 0x100000 that is shift PAGE_SHIFT bits results in a 0 value, resulting in an invalid end address. Change the number of pages variable in various routines from an unsigned int to an unsigned long to calculate the end address correctly.
--- arch/x86/include/asm/sev.h | 16 ++++++++-------- arch/x86/kernel/sev.c | 14 +++++++------- 2 files changed, 15 insertions(+), 15 deletions(-)
arch/x86/include/asm/sev.h +8 -8
@@ -187,12 +187,12 @@ static inline int pvalidate(unsigned long vaddr, bool rmp_psize, bool validate) }void setup_ghcb (void );void __init early_snp_set_memory_private (unsigned long vaddr,unsigned long paddr, -unsigned int npages); +unsigned long npages);void __init early_snp_set_memory_shared (unsigned long vaddr,unsigned long paddr, -unsigned int npages); +unsigned long npages);void __init snp_prep_memory (unsigned long paddr,unsigned int sz,enum psc_op op); -void snp_set_memory_shared (unsigned long vaddr,unsigned int npages); -void snp_set_memory_private (unsigned long vaddr,unsigned int npages); +void snp_set_memory_shared (unsigned long vaddr,unsigned long npages); +void snp_set_memory_private (unsigned long vaddr,unsigned long npages);void snp_set_wakeup_secondary_cpu (void );bool snp_init (struct boot_params *bp);void __init __noreturn snp_abort (void );
@@ -207,12 +207,12 @@ static inline int pvalidate(unsigned long vaddr, bool rmp_psize, bool validate)static inline int rmpadjust (unsigned long vaddr,bool rmp_psize,unsigned long attrs) {return 0 ; }static inline void setup_ghcb (void ) { }static inline void __init -early_snp_set_memory_private (unsigned long vaddr,unsigned long paddr,unsigned int npages) { } +early_snp_set_memory_private (unsigned long vaddr,unsigned long paddr,unsigned long npages) { }static inline void __init -early_snp_set_memory_shared (unsigned long vaddr,unsigned long paddr,unsigned int npages) { } +early_snp_set_memory_shared (unsigned long vaddr,unsigned long paddr,unsigned long npages) { }static inline void __init snp_prep_memory (unsigned long paddr,unsigned int sz,enum psc_op op) { } -static inline void snp_set_memory_shared (unsigned long vaddr,unsigned int npages) { } -static inline void snp_set_memory_private (unsigned long vaddr,unsigned int npages) { } +static inline void snp_set_memory_shared (unsigned long vaddr,unsigned long npages) { } +static inline void snp_set_memory_private (unsigned long vaddr,unsigned long npages) { }static inline void snp_set_wakeup_secondary_cpu (void ) { }static inline bool snp_init (struct boot_params *bp) {return false; }static inline void snp_abort (void ) { }
arch/x86/kernel/sev.c +7 -7
@@ -643,7 +643,7 @@ static u64 __init get_jump_table_addr(void)return ret; } -static void pvalidate_pages (unsigned long vaddr,unsigned int npages,bool validate) +static void pvalidate_pages (unsigned long vaddr,unsigned long npages,bool validate) {unsigned long vaddr_end;int rc;
@@ -660,7 +660,7 @@ static void pvalidate_pages(unsigned long vaddr, unsigned int npages, bool valid } } -static void __init early_set_pages_state (unsigned long paddr,unsigned int npages,enum psc_op op) +static void __init early_set_pages_state (unsigned long paddr,unsigned long npages,enum psc_op op) {unsigned long paddr_end;u64 val;
@@ -699,7 +699,7 @@ static void __init early_set_pages_state(unsigned long paddr, unsigned int npage }void __init early_snp_set_memory_private (unsigned long vaddr,unsigned long paddr, -unsigned int npages) +unsigned long npages) {/* * This can be invoked in early boot while running identity mapped, so
@@ -721,7 +721,7 @@ void __init early_snp_set_memory_private(unsigned long vaddr, unsigned long padd }void __init early_snp_set_memory_shared (unsigned long vaddr,unsigned long paddr, -unsigned int npages) +unsigned long npages) {/* * This can be invoked in early boot while running identity mapped, so
@@ -877,7 +877,7 @@ static void __set_pages_state(struct snp_psc_desc *data, unsigned long vaddr,sev_es_terminate (SEV_TERM_SET_LINUX ,GHCB_TERM_PSC ); } -static void set_pages_state (unsigned long vaddr,unsigned int npages,int op) +static void set_pages_state (unsigned long vaddr,unsigned long npages,int op) {unsigned long vaddr_end, next_vaddr;struct snp_psc_desc *desc;
@@ -902,7 +902,7 @@ static void set_pages_state(unsigned long vaddr, unsigned int npages, int op)kfree (desc); } -void snp_set_memory_shared (unsigned long vaddr,unsigned int npages) +void snp_set_memory_shared (unsigned long vaddr,unsigned long npages) {if (!cc_platform_has (CC_ATTR_GUEST_SEV_SNP ))return ;
@@ -912,7 +912,7 @@ void snp_set_memory_shared(unsigned long vaddr, unsigned int npages)set_pages_state (vaddr, npages,SNP_PAGE_STATE_SHARED ); } -void snp_set_memory_private (unsigned long vaddr,unsigned int npages) +void snp_set_memory_private (unsigned long vaddr,unsigned long npages) {if (!cc_platform_has (CC_ATTR_GUEST_SEV_SNP ))return ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 10/431 blk-cgroup: Reinit blkg_iostat_set after clearing in blkcg_reset_stats()
In reply to Greg Kroah-HartmanFrom: Waiman Long <[email protected]>
[ Upstream commit 3d2af77e31ade05ff7ccc3658c3635ec1bea0979 ]
When blkg_alloc() is called to allocate a blkcg_gq structure with the associated blkg_iostat_set's, there are 2 fields within blkg_iostat_set that requires proper initialization - blkg & sync. The former field was introduced by commit 3b8cc6298724 ("blk-cgroup:
Optimize blkcg_rstat_flush()") while the later one was introduced by commit f73316482977 ("blk-cgroup: reimplement basic IO stats using cgroup rstat").
Unfortunately those fields in the blkg_iostat_set's are not properly re-initialized when they are cleared in v1's blkcg_reset_stats(). This can lead to a kernel panic due to NULL pointer access of the blkg pointer. The missing initialization of sync is less problematic and can be a problem in a debug kernel due to missing lockdep initialization.
Fix these problems by re-initializing them after memory clearing.
--- block/blk-cgroup.c | 5 +++++ 1 file changed, 5 insertions(+)
block/blk-cgroup.c +5 -0
@@ -585,8 +585,13 @@ static int blkcg_reset_stats(struct cgroup_subsys_state *css,struct blkg_iostat_set *bis =per_cpu_ptr (blkg->iostat_cpu, cpu);memset (bis,0 ,sizeof (*bis)); + +/* Re-initialize the cleared blkg_iostat_set */ +u64_stats_init (&bis->sync); + bis->blkg = blkg; }memset (&blkg->iostat,0 ,sizeof (blkg->iostat)); +u64_stats_init (&blkg->iostat.sync);for (i =0 ; i <BLKCG_MAX_POLS ; i++) {struct blkcg_policy *pol = blkcg_policy[i];
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 11/431 virt: sevguest: Add CONFIG_CRYPTO dependency
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 84b9b44b99780d35fe72ac63c4724f158771e898 ]
This driver fails to link when CRYPTO is disabled, or in a loadable module:
WARNING: unmet direct dependencies detected for CRYPTO_GCM
WARNING: unmet direct dependencies detected for CRYPTO_AEAD2
Depends on [m]: CRYPTO [=m]
Selected by [y]:
- SEV_GUEST [=y] && VIRT_DRIVERS [=y] && AMD_MEM_ENCRYPT [=y]
x86_64-linux-ld: crypto/aead.o: in function `crypto_register_aeads':
--- drivers/virt/coco/sev-guest/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/virt/coco/sev-guest/Kconfig +1 -0
@@ -2,6 +2,7 @@ config SEV_GUEST tristate "AMD SEV Guest driver" default m depends on AMD_MEM_ENCRYPT + select CRYPTO select CRYPTO_AEAD2 select CRYPTO_GCM help
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 12/431 blk-mq: fix potential io hang by wrong wake_batch
In reply to Greg Kroah-HartmanFrom: Yu Kuai <[email protected]>
[ Upstream commit 4f1731df60f9033669f024d06ae26a6301260b55 ]
In __blk_mq_tag_busy/idle(), updating 'active_queues' and calculating 'wake_batch' is not atomic:
t1: t2:_blk_mq_tag_busy blk_mq_tag_busy
inc active_queues
// assume 1->2
inc active_queues // 2 -> 3 blk_mq_update_wake_batch // calculate based on 3
blk_mq_update_wake_batch
/* calculate based on 2, while active_queues is actually 3. */
Fix this problem by protecting them wih 'tags->lock', this is not a hot path, so performance should not be concerned. And now that all writers are inside the lock, switch 'actives_queues' from atomic to unsigned int.
--- block/blk-mq-debugfs.c | 2 +- block/blk-mq-tag.c | 15 ++++++++++----- block/blk-mq.h | 3 +-- include/linux/blk-mq.h | 3 +-- 4 files changed, 13 insertions(+), 10 deletions(-)
block/blk-mq-debugfs.c +1 -1
@@ -427,7 +427,7 @@ static void blk_mq_debugfs_tags_show(struct seq_file *m,seq_printf (m,"nr_tags=%u\n" , tags->nr_tags);seq_printf (m,"nr_reserved_tags=%u\n" , tags->nr_reserved_tags);seq_printf (m,"active_queues=%d\n" , -atomic_read (&tags->active_queues)); +READ_ONCE (tags->active_queues));seq_puts (m,"\nbitmap_tags:\n" );sbitmap_queue_show (&tags->bitmap_tags, m);
block/blk-mq-tag.c +10 -5
@@ -40,6 +40,7 @@ static void blk_mq_update_wake_batch(struct blk_mq_tags *tags,void __blk_mq_tag_busy (struct blk_mq_hw_ctx *hctx) {unsigned int users; +struct blk_mq_tags *tags = hctx->tags;/* * calling test_bit() prior to test_and_set_bit() is intentional,
@@ -57,9 +58,11 @@ void __blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx)return ; } - users =atomic_inc_return (&hctx->tags->active_queues); - -blk_mq_update_wake_batch (hctx->tags, users); +spin_lock_irq (&tags->lock); + users = tags->active_queues +1 ; +WRITE_ONCE (tags->active_queues, users); +blk_mq_update_wake_batch (tags, users); +spin_unlock_irq (&tags->lock); }/*
@@ -92,9 +95,11 @@ void __blk_mq_tag_idle(struct blk_mq_hw_ctx *hctx)return ; } - users =atomic_dec_return (&tags->active_queues); - +spin_lock_irq (&tags->lock); + users = tags->active_queues -1 ; +WRITE_ONCE (tags->active_queues, users);blk_mq_update_wake_batch (tags, users); +spin_unlock_irq (&tags->lock);blk_mq_tag_wakeup_all (tags, false); }
block/blk-mq.h +1 -2
@@ -362,8 +362,7 @@ static inline bool hctx_may_queue(struct blk_mq_hw_ctx *hctx,return true; } - users =atomic_read (&hctx->tags->active_queues); - + users =READ_ONCE (hctx->tags->active_queues);if (!users)return true;
include/linux/blk-mq.h +1 -2
@@ -748,8 +748,7 @@ struct request *blk_mq_alloc_request_hctx(struct request_queue *q,struct blk_mq_tags {unsigned int nr_tags;unsigned int nr_reserved_tags; - -atomic_t active_queues; +unsigned int active_queues;struct sbitmap_queue bitmap_tags;struct sbitmap_queue breserved_tags;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 13/431 lockd: drop inappropriate svc_get() from locked_get()
In reply to Greg Kroah-HartmanFrom: NeilBrown <[email protected]>
[ Upstream commit 665e89ab7c5af1f2d260834c861a74b01a30f95f ]
The below-mentioned patch was intended to simplify refcounting on the svc_serv used by locked. The goal was to only ever have a single reference from the single thread. To that end we dropped a call to lockd_start_svc() (except when creating thread) which would take a reference, and dropped the svc_put(serv) that would drop that reference.
Unfortunately we didn't also remove the svc_get() from lockd_create_svc() in the case where the svc_serv already existed. So after the patch:
- on the first call the svc_serv was allocated and the one reference was given to the thread, so there are no extra references
- on subsequent calls svc_get() was called so there is now an extra reference.
This is clearly not consistent.
The inconsistency is also clear in the current code in lockd_get() takes *two* references, one on nlmsvc_serv and one by incrementingnlmsvc_users. This clearly does not match lockd_put().
So: drop that svc_get() from lockd_get() (which used to be in lockd_create_svc().
--- fs/lockd/svc.c | 1 - 1 file changed, 1 deletion(-)
fs/lockd/svc.c +0 -1
@@ -355,7 +355,6 @@ static int lockd_get(void)int error;if (nlmsvc_serv) { -svc_get (nlmsvc_serv); nlmsvc_users++;return 0 ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 14/431 nvme-core: fix memory leak in dhchap_secret_store
In reply to Greg Kroah-HartmanFrom: Chaitanya Kulkarni <[email protected]>
[ Upstream commit a836ca33c5b07d34dd5347af9f64d25651d12674 ]
Free dhchap_secret in nvme_ctrl_dhchap_secret_store() before we return fix following kmemleack:-
unreferenced object 0xffff8886376ea800 (size 64):
comm "check", pid 22048, jiffies 4344316705 (age 92.199s) hex dump (first 32 bytes):
44 48 48 43 2d 31 3a 30 30 3a 6e 78 72 35 4b 67 DHHC-1:00:nxr5Kg
75 58 34 75 6f 41 78 73 4a 61 34 63 2f 68 75 4c uX4uoAxsJa4c/huL
backtrace:
[<0000000030ce5d4b>] __kmalloc+0x4b/0x130
[<000000009be1cdc1>] nvme_ctrl_dhchap_secret_store+0x8f/0x160 [nvme_core]
[<00000000ac06c96a>] kernfs_fop_write_iter+0x12b/0x1c0
[<00000000437e7ced>] vfs_write+0x2ba/0x3c0
[<00000000f9491baf>] ksys_write+0x5f/0xe0
[<000000001c46513d>] do_syscall_64+0x3b/0x90
[<00000000ecf348fe>] entry_SYSCALL_64_after_hwframe+0x72/0xdc
unreferenced object 0xffff8886376eaf00 (size 64):
comm "check", pid 22048, jiffies 4344316736 (age 92.168s)
hex dump (first 32 bytes):
44 48 48 43 2d 31 3a 30 30 3a 6e 78 72 35 4b 67 DHHC-1:00:nxr5Kg
75 58 34 75 6f 41 78 73 4a 61 34 63 2f 68 75 4c uX4uoAxsJa4c/huL
backtrace:
[<0000000030ce5d4b>] __kmalloc+0x4b/0x130
[<000000009be1cdc1>] nvme_ctrl_dhchap_secret_store+0x8f/0x160 [nvme_core]
[<00000000ac06c96a>] kernfs_fop_write_iter+0x12b/0x1c0
[<00000000437e7ced>] vfs_write+0x2ba/0x3c0
[<00000000f9491baf>] ksys_write+0x5f/0xe0
[<000000001c46513d>] do_syscall_64+0x3b/0x90
[<00000000ecf348fe>] entry_SYSCALL_64_after_hwframe+0x72/0xdc--- drivers/nvme/host/core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/nvme/host/core.c +5 -2
@@ -3872,8 +3872,10 @@ static ssize_t nvme_ctrl_dhchap_secret_store(struct device *dev,int ret; ret =nvme_auth_generate_key (dhchap_secret, &key); -if (ret) +if (ret) { +kfree (dhchap_secret);return ret; + }kfree (opts->dhchap_secret); opts->dhchap_secret = dhchap_secret; host_key = ctrl->host_key;
@@ -3881,7 +3883,8 @@ static ssize_t nvme_ctrl_dhchap_secret_store(struct device *dev, ctrl->host_key = key;mutex_unlock (&ctrl->dhchap_auth_mutex);nvme_auth_free_key (host_key); - } + }else +kfree (dhchap_secret);/* Start re-authentication */ dev_info (ctrl->device,"re-authenticating controller\n" );queue_work (nvme_wq, &ctrl->dhchap_auth_work);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 15/431 nvme-core: fix memory leak in dhchap_ctrl_secret
In reply to Greg Kroah-HartmanFrom: Chaitanya Kulkarni <[email protected]>
[ Upstream commit 99c2dcc8ffc24e210a3aa05c204d92f3ef460b05 ]
Free dhchap_secret in nvme_ctrl_dhchap_ctrl_secret_store() before we return when nvme_auth_generate_key() returns error.
--- drivers/nvme/host/core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/nvme/host/core.c +5 -2
@@ -3929,8 +3929,10 @@ static ssize_t nvme_ctrl_dhchap_ctrl_secret_store(struct device *dev,int ret; ret =nvme_auth_generate_key (dhchap_secret, &key); -if (ret) +if (ret) { +kfree (dhchap_secret);return ret; + }kfree (opts->dhchap_ctrl_secret); opts->dhchap_ctrl_secret = dhchap_secret; ctrl_key = ctrl->ctrl_key;
@@ -3938,7 +3940,8 @@ static ssize_t nvme_ctrl_dhchap_ctrl_secret_store(struct device *dev, ctrl->ctrl_key = key;mutex_unlock (&ctrl->dhchap_auth_mutex);nvme_auth_free_key (ctrl_key); - } + }else +kfree (dhchap_secret);/* Start re-authentication */ dev_info (ctrl->device,"re-authenticating controller\n" );queue_work (nvme_wq, &ctrl->dhchap_auth_work);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 16/431 nvme-core: add missing fault-injection cleanup
In reply to Greg Kroah-HartmanFrom: Chaitanya Kulkarni <[email protected]>
[ Upstream commit 3a12a0b868a512fcada564699d00f5e652c0998c ]
Add missing fault-injection cleanup in nvme_init_ctrl() in the error unwind path that also fixes following message for blktests:-
linux-block (for-next) # grep debugfs debugfs-err.log
[ 147.853464] debugfs: Directory 'nvme1' with parent '/' already present! [ 147.853973] nvme1: failed to create debugfs attr [ 148.802490] debugfs: Directory 'nvme1' with parent '/' already present! [ 148.803244] nvme1: failed to create debugfs attr [ 148.877304] debugfs: Directory 'nvme1' with parent '/' already present! [ 148.877775] nvme1: failed to create debugfs attr [ 149.816652] debugfs: Directory 'nvme1' with parent '/' already present! [ 149.818011] nvme1: failed to create debugfs attr
Stable-dep-of: 7ed5cf8e6d9b ("nvme-core: fix dev_pm_qos memleak")
--- drivers/nvme/host/core.c | 1 + 1 file changed, 1 insertion(+)
drivers/nvme/host/core.c +1 -0
@@ -5249,6 +5249,7 @@ int nvme_init_ctrl(struct nvme_ctrl *ctrl, struct device *dev,return 0 ; out_free_cdev: +nvme_fault_inject_fini (&ctrl->fault_inject);cdev_device_del (&ctrl->cdev, ctrl->device); out_free_name:nvme_put_ctrl (ctrl);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 17/431 nvme-core: fix dev_pm_qos memleak
In reply to Greg Kroah-HartmanFrom: Chaitanya Kulkarni <[email protected]>
[ Upstream commit 7ed5cf8e6d9bfb6a78d0471317edff14f0f2b4dd ]
Call dev_pm_qos_hide_latency_tolerance() in the error unwind patch to avoid following kmemleak:-
blktests (master) # kmemleak-clear; ./check nvme/044; blktests (master) # kmemleak-scan ; kmemleak-show
nvme/044 (Test bi-directional authentication) [passed]
runtime 2.111s ... 2.124s
unreferenced object 0xffff888110c46240 (size 96):
comm "nvme", pid 33461, jiffies 4345365353 (age 75.586s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<0000000069ac2cec>] kmalloc_trace+0x25/0x90
[<000000006acc66d5>] dev_pm_qos_update_user_latency_tolerance+0x6f/0x100
[<00000000cc376ea7>] nvme_init_ctrl+0x38e/0x410 [nvme_core]
[<000000007df61b4b>] 0xffffffffc05e88b3
[<00000000d152b985>] 0xffffffffc05744cb
[<00000000f04a4041>] vfs_write+0xc5/0x3c0
[<00000000f9491baf>] ksys_write+0x5f/0xe0
[<000000001c46513d>] do_syscall_64+0x3b/0x90
[<00000000ecf348fe>] entry_SYSCALL_64_after_hwframe+0x72/0xdc--- drivers/nvme/host/core.c | 1 + 1 file changed, 1 insertion(+)
drivers/nvme/host/core.c +1 -0
@@ -5250,6 +5250,7 @@ int nvme_init_ctrl(struct nvme_ctrl *ctrl, struct device *dev,return 0 ; out_free_cdev:nvme_fault_inject_fini (&ctrl->fault_inject); +dev_pm_qos_hide_latency_tolerance (ctrl->device);cdev_device_del (&ctrl->cdev, ctrl->device); out_free_name:nvme_put_ctrl (ctrl);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 18/431 md/raid10: check slab-out-of-bounds in md_bitmap_get_counter
In reply to Greg Kroah-HartmanFrom: Li Nan <[email protected]>
[ Upstream commit 301867b1c16805aebbc306aafa6ecdc68b73c7e5 ]
If we write a large number to md/bitmap_set_bits, md_bitmap_checkpage() will return -EINVAL because 'page >= bitmap->pages', but the return value was not checked immediately in md_bitmap_get_counter() in order to set *blocks value and slab-out-of-bounds occurs.
Move check of 'page >= bitmap->pages' to md_bitmap_get_counter() and return directly if true.
--- drivers/md/md-bitmap.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/md/md-bitmap.c +9 -8
@@ -54,14 +54,7 @@ __acquires(bitmap->lock) {unsigned char *mappage; -if (page >= bitmap->pages) { -/* This can happen if bitmap_start_sync goes beyond -* End-of-device while looking for a whole page. -* It is harmless. -*/ -return -EINVAL ; - } - +WARN_ON_ONCE (page >= bitmap->pages);if (bitmap->bp[page].hijacked)/* it's hijacked, don't try to alloc */ return 0 ;
@@ -1364,6 +1357,14 @@ __acquires(bitmap->lock)sector_t csize;int err; +if (page >= bitmap->pages) { +/* +* This can happen if bitmap_start_sync goes beyond +* End-of-device while looking for a whole page or +* user set a huge number to sysfs bitmap_set_bits. +*/ +return NULL ; + } err =md_bitmap_checkpage (bitmap, page, create,0 ); if (bitmap->bp[page].hijacked ||
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 19/431 md/raid10: fix overflow of md/safe_mode_delay
In reply to Greg Kroah-HartmanFrom: Li Nan <[email protected]>
[ Upstream commit 6beb489b2eed25978523f379a605073f99240c50 ]
There is no input check when echo md/safe_mode_delay in safe_delay_store(). And msec might also overflow when HZ < 1000 in safe_delay_show(), Fix it by checking overflow in safe_delay_store() and use unsigned long conversion in safe_delay_show().
--- drivers/md/md.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/md/md.c +4 -3
@@ -3814,8 +3814,9 @@ int strict_strtoul_scaled(const char *cp, unsigned long *res, int scale)static ssize_t safe_delay_show (struct mddev *mddev,char *page) { -int msec = (mddev->safemode_delay*1000 )/HZ ; -return sprintf (page,"%d.%03d\n" , msec/1000 , msec%1000 ); +unsigned int msec = ((unsigned long )mddev->safemode_delay*1000 )/HZ ; + +return sprintf (page,"%u.%03u\n" , msec/1000 , msec%1000 ); }static ssize_t safe_delay_store (struct mddev *mddev,const char *cbuf,size_t len)
@@ -3827,7 +3828,7 @@ safe_delay_store(struct mddev *mddev, const char *cbuf, size_t len)return -EINVAL ; } -if (strict_strtoul_scaled (cbuf, &msec,3 ) <0 ) +if (strict_strtoul_scaled (cbuf, &msec,3 ) <0 || msec >UINT_MAX /HZ )return -EINVAL ;if (msec ==0 ) mddev->safemode_delay =0 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 20/431 md/raid10: fix wrong setting of max_corr_read_errors
In reply to Greg Kroah-HartmanFrom: Li Nan <[email protected]>
[ Upstream commit f8b20a405428803bd9881881d8242c9d72c6b2b2 ]
There is no input check when echo md/max_read_errors and overflow might occur. Add check of input number.
--- drivers/md/md.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/md/md.c +2 -0
@@ -4498,6 +4498,8 @@ max_corrected_read_errors_store(struct mddev *mddev, const char *buf, size_t len rv =kstrtouint (buf,10 , &n);if (rv <0 )return rv; +if (n >INT_MAX ) +return -EINVAL ;atomic_set (&mddev->max_corr_read_errors, n);return len; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 21/431 md/raid10: fix null-ptr-deref of mreplace in raid10_sync_request
In reply to Greg Kroah-HartmanFrom: Li Nan <[email protected]>
[ Upstream commit 34817a2441747b48e444cb0e05d84e14bc9443da ]
There are two check of 'mreplace' in raid10_sync_request(). In the first check, 'need_replace' will be set and 'mreplace' will be used later if no-Faulty 'mreplace' exists, In the second check, 'mreplace' will be set to NULL if it is Faulty, but 'need_replace' will not be changed accordingly. null-ptr-deref occurs if Faulty is set between two check.
Fix it by merging two checks into one. And replace 'need_replace' with 'mreplace' because their values are always the same.
--- drivers/md/raid10.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
drivers/md/raid10.c +5 -9
@@ -3436,7 +3436,6 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr,int must_sync;int any_working;int need_recover =0 ; -int need_replace =0 ;struct raid10_info *mirror = &conf->mirrors[i];struct md_rdev *mrdev, *mreplace;
@@ -3448,11 +3447,10 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr, !test_bit(Faulty, &mrdev->flags) && !test_bit(In_sync, &mrdev->flags)) need_recover =1 ; -if (mreplace !=NULL && - !test_bit (Faulty, &mreplace->flags)) - need_replace =1 ; +if (mreplace &&test_bit (Faulty, &mreplace->flags)) + mreplace =NULL ; -if (!need_recover && !need_replace) { +if (!need_recover && !mreplace) {rcu_read_unlock ();continue ; }
@@ -3468,8 +3466,6 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr,rcu_read_unlock ();continue ; } -if (mreplace &&test_bit (Faulty, &mreplace->flags)) - mreplace =NULL ;/* Unless we are doing a full sync, or a replacement * we only need to recover the block if it is set in * the bitmap
@@ -3592,11 +3588,11 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr, bio = r10_bio->devs[1 ].repl_bio;if (bio) bio->bi_end_io =NULL ; -/* Note: if need_replace, then bio +/* Note: if replace is not NULL, then bio * cannot be NULL as r10buf_pool_alloc will * have allocated it. */ -if (!need_replace) +if (!mreplace)break ; bio->bi_next = biolist; biolist = bio;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 22/431 md/raid10: fix io loss while replacement replace rdev
In reply to Greg Kroah-HartmanFrom: Li Nan <[email protected]>
[ Upstream commit 2ae6aaf76912bae53c74b191569d2ab484f24bf3 ]
When removing a disk with replacement, the replacement will be used to replace rdev. During this process, there is a brief window in which both rdev and replacement are read as NULL in raid10_write_request(). This will result in io not being submitted but it should be.
//remove //write
raid10_remove_disk raid10_write_request
mirror->rdev = NULL
read rdev -> NULL mirror->rdev = mirror->replacement mirror->replacement = NULL read replacement -> NULL
Fix it by reading replacement first and rdev later, meanwhile, use smp_mb() to prevent memory reordering.
--- drivers/md/raid10.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-)
drivers/md/raid10.c +18 -4
@@ -779,8 +779,16 @@ static struct md_rdev *read_balance(struct r10conf *conf, disk = r10_bio->devs[slot].devnum; rdev =rcu_dereference (conf->mirrors[disk].replacement);if (rdev ==NULL ||test_bit (Faulty, &rdev->flags) || - r10_bio->devs[slot].addr + sectors > rdev->recovery_offset) + r10_bio->devs[slot].addr + sectors > + rdev->recovery_offset) { +/* +* Read replacement first to prevent reading both rdev +* and replacement as NULL during replacement replace +* rdev. +*/ +smp_mb (); rdev =rcu_dereference (conf->mirrors[disk].rdev); + }if (rdev ==NULL ||test_bit (Faulty, &rdev->flags))continue ;
@@ -1477,9 +1485,15 @@ static void raid10_write_request(struct mddev *mddev, struct bio *bio,for (i =0 ; i < conf->copies; i++) {int d = r10_bio->devs[i].devnum; -struct md_rdev *rdev =rcu_dereference (conf->mirrors[d].rdev); -struct md_rdev *rrdev =rcu_dereference ( - conf->mirrors[d].replacement); +struct md_rdev *rdev, *rrdev; + + rrdev =rcu_dereference (conf->mirrors[d].replacement); +/* +* Read replacement first to prevent reading both rdev and +* replacement as NULL during replacement replace rdev. +*/ +smp_mb (); + rdev =rcu_dereference (conf->mirrors[d].rdev);if (rdev == rrdev) rrdev =NULL ;if (rdev && (test_bit (Faulty, &rdev->flags)))
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 23/431 md/raid1-10: factor out a helper to add bio to plug
In reply to Greg Kroah-HartmanFrom: Yu Kuai <[email protected]>
[ Upstream commit 5ec6ca140a034682e421e2e808ef5ddfdfd65242 ]
The code in raid1 and raid10 is identical, prepare to limit the number of plugged bios.
Stable-dep-of: 7db922bae3ab ("md/raid1-10: submit write io directly if bitmap is not enabled")
--- drivers/md/raid1-10.c | 16 ++++++++++++++++ drivers/md/raid1.c | 12 +----------- drivers/md/raid10.c | 11 +---------- 3 files changed, 18 insertions(+), 21 deletions(-)
drivers/md/raid1-10.c +16 -0
@@ -109,3 +109,19 @@ static void md_bio_reset_resync_pages(struct bio *bio, struct resync_pages *rp, size -= len; }while (idx++ <RESYNC_PAGES && size >0 ); } + +static inline bool raid1_add_bio_to_plug (struct mddev *mddev,struct bio *bio, +blk_plug_cb_fn unplug) +{ +struct raid1_plug_cb *plug =NULL ; +struct blk_plug_cb *cb =blk_check_plugged (unplug, mddev, +sizeof (*plug)); + +if (!cb) +return false; + + plug = container_of(cb, struct raid1_plug_cb, cb); +bio_list_add (&plug->pending, bio); + +return true; +}
drivers/md/raid1.c +1 -11
@@ -1343,8 +1343,6 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,struct bitmap *bitmap = mddev->bitmap;unsigned long flags;struct md_rdev *blocked_rdev; -struct blk_plug_cb *cb; -struct raid1_plug_cb *plug =NULL ;int first_clone;int max_sectors;bool write_behind = false;
@@ -1573,15 +1571,7 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio, r1_bio->sector);/* flush_pending_writes() needs access to the rdev so...*/ mbio->bi_bdev = (void *)rdev; - - cb =blk_check_plugged (raid1_unplug, mddev,sizeof (*plug)); -if (cb) - plug = container_of(cb, struct raid1_plug_cb, cb); -else - plug =NULL ; -if (plug) { -bio_list_add (&plug->pending, mbio); - }else { +if (!raid1_add_bio_to_plug (mddev, mbio, raid1_unplug)) {spin_lock_irqsave (&conf->device_lock, flags);bio_list_add (&conf->pending_bio_list, mbio);spin_unlock_irqrestore (&conf->device_lock, flags);
drivers/md/raid10.c +1 -10
@@ -1288,8 +1288,6 @@ static void raid10_write_one_disk(struct mddev *mddev, struct r10bio *r10_bio,const blk_opf_t do_sync = bio->bi_opf &REQ_SYNC ;const blk_opf_t do_fua = bio->bi_opf &REQ_FUA ;unsigned long flags; -struct blk_plug_cb *cb; -struct raid1_plug_cb *plug =NULL ;struct r10conf *conf = mddev->private;struct md_rdev *rdev;int devnum = r10_bio->devs[n_copy].devnum;
@@ -1329,14 +1327,7 @@ static void raid10_write_one_disk(struct mddev *mddev, struct r10bio *r10_bio,atomic_inc (&r10_bio->remaining); - cb =blk_check_plugged (raid10_unplug, mddev,sizeof (*plug)); -if (cb) - plug = container_of(cb, struct raid1_plug_cb, cb); -else - plug =NULL ; -if (plug) { -bio_list_add (&plug->pending, mbio); - }else { +if (!raid1_add_bio_to_plug (mddev, mbio, raid10_unplug)) {spin_lock_irqsave (&conf->device_lock, flags);bio_list_add (&conf->pending_bio_list, mbio);spin_unlock_irqrestore (&conf->device_lock, flags);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 24/431 md/raid1-10: factor out a helper to submit normal write
In reply to Greg Kroah-HartmanFrom: Yu Kuai <[email protected]>
[ Upstream commit 8295efbe68c080047e98d9c0eb5cb933b238a8cb ]
There are multiple places to do the same thing, factor out a helper to prevent redundant code, and the helper will be used in following patch as well.
Stable-dep-of: 7db922bae3ab ("md/raid1-10: submit write io directly if bitmap is not enabled")
--- drivers/md/raid1-10.c | 17 +++++++++++++++++ drivers/md/raid1.c | 13 ++----------- drivers/md/raid10.c | 26 ++++---------------------- 3 files changed, 23 insertions(+), 33 deletions(-)
drivers/md/raid1-10.c +17 -0
@@ -110,6 +110,23 @@ static void md_bio_reset_resync_pages(struct bio *bio, struct resync_pages *rp, }while (idx++ <RESYNC_PAGES && size >0 ); } + +static inline void raid1_submit_write (struct bio *bio) +{ +struct md_rdev *rdev = (struct md_rdev *)bio->bi_bdev; + + bio->bi_next =NULL ; +bio_set_dev (bio, rdev->bdev); +if (test_bit (Faulty, &rdev->flags)) +bio_io_error (bio); +else if (unlikely (bio_op (bio) ==REQ_OP_DISCARD && + !bdev_max_discard_sectors (bio->bi_bdev))) +/* Just ignore it */ +bio_endio (bio); +else +submit_bio_noacct (bio); +} +static inline bool raid1_add_bio_to_plug (struct mddev *mddev,struct bio *bio,blk_plug_cb_fn unplug) {
drivers/md/raid1.c +2 -11
@@ -799,17 +799,8 @@ static void flush_bio_list(struct r1conf *conf, struct bio *bio)while (bio) {/* submit pending writes */ struct bio *next = bio->bi_next; -struct md_rdev *rdev = (void *)bio->bi_bdev; - bio->bi_next =NULL ; -bio_set_dev (bio, rdev->bdev); -if (test_bit (Faulty, &rdev->flags)) { -bio_io_error (bio); - }else if (unlikely ((bio_op (bio) ==REQ_OP_DISCARD ) && - !bdev_max_discard_sectors (bio->bi_bdev))) -/* Just ignore it */ -bio_endio (bio); -else -submit_bio_noacct (bio); + +raid1_submit_write (bio); bio = next;cond_resched (); }
drivers/md/raid10.c +4 -22
@@ -917,17 +917,8 @@ static void flush_pending_writes(struct r10conf *conf)while (bio) {/* submit pending writes */ struct bio *next = bio->bi_next; -struct md_rdev *rdev = (void *)bio->bi_bdev; - bio->bi_next =NULL ; -bio_set_dev (bio, rdev->bdev); -if (test_bit (Faulty, &rdev->flags)) { -bio_io_error (bio); - }else if (unlikely ((bio_op (bio) ==REQ_OP_DISCARD ) && - !bdev_max_discard_sectors (bio->bi_bdev))) -/* Just ignore it */ -bio_endio (bio); -else -submit_bio_noacct (bio); + +raid1_submit_write (bio); bio = next; }blk_finish_plug (&plug);
@@ -1136,17 +1127,8 @@ static void raid10_unplug(struct blk_plug_cb *cb, bool from_schedule)while (bio) {/* submit pending writes */ struct bio *next = bio->bi_next; -struct md_rdev *rdev = (void *)bio->bi_bdev; - bio->bi_next =NULL ; -bio_set_dev (bio, rdev->bdev); -if (test_bit (Faulty, &rdev->flags)) { -bio_io_error (bio); - }else if (unlikely ((bio_op (bio) ==REQ_OP_DISCARD ) && - !bdev_max_discard_sectors (bio->bi_bdev))) -/* Just ignore it */ -bio_endio (bio); -else -submit_bio_noacct (bio); + +raid1_submit_write (bio); bio = next; }kfree (plug);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 25/431 md/raid1-10: submit write io directly if bitmap is not enabled
In reply to Greg Kroah-HartmanFrom: Yu Kuai <[email protected]>
[ Upstream commit 7db922bae3abdf0a1db81ef7228cc0b996a0c1e3 ]
Commit 6cce3b23f6f8 ("[PATCH] md: write intent bitmap support for raid10") add bitmap support, and it changed that write io is submitted through daemon thread because bitmap need to be updated before write io. And later, plug is used to fix performance regression because all the write io will go to demon thread, which means io can't be issued concurrently.
However, if bitmap is not enabled, the write io should not go to daemon thread in the first place, and plug is not needed as well.
--- drivers/md/md-bitmap.c | 4 +--- drivers/md/md-bitmap.h | 7 +++++++ drivers/md/raid1-10.c | 13 +++++++++++-- 3 files changed, 19 insertions(+), 5 deletions(-)
drivers/md/md-bitmap.c +1 -3
@@ -993,7 +993,6 @@ static int md_bitmap_file_test_bit(struct bitmap *bitmap, sector_t block)return set; } -/* this gets called when the md device is ready to unplug its underlying * (slave) device queues -- before we let any writes go down, we need to * sync the dirty pages of the bitmap file to disk */
@@ -1003,8 +1002,7 @@ void md_bitmap_unplug(struct bitmap *bitmap)int dirty, need_write;int writing =0 ; -if (!bitmap || !bitmap->storage.filemap || -test_bit (BITMAP_STALE , &bitmap->flags)) +if (!md_bitmap_enabled (bitmap))return ;/* look at each page to see if there are any set bits that need to be
drivers/md/md-bitmap.h +7 -0
@@ -273,6 +273,13 @@ int md_bitmap_copy_from_slot(struct mddev *mddev, int slot, sector_t *lo, sector_t *hi, bool clear_bits);void md_bitmap_free (struct bitmap *bitmap);void md_bitmap_wait_behind_writes (struct mddev *mddev); + +static inline bool md_bitmap_enabled (struct bitmap *bitmap) +{ +return bitmap && bitmap->storage.filemap && + !test_bit (BITMAP_STALE , &bitmap->flags); +} +#endif #endif
drivers/md/raid1-10.c +11 -2
@@ -131,9 +131,18 @@ static inline bool raid1_add_bio_to_plug(struct mddev *mddev, struct bio *bio, blk_plug_cb_fn unplug) {struct raid1_plug_cb *plug =NULL ; -struct blk_plug_cb *cb =blk_check_plugged (unplug, mddev, -sizeof (*plug)); +struct blk_plug_cb *cb; + +/* +* If bitmap is not enabled, it's safe to submit the io directly, and +* this can get optimal performance. +*/ +if (!md_bitmap_enabled (mddev->bitmap)) { +raid1_submit_write (bio); +return true; + } + cb =blk_check_plugged (unplug, mddev,sizeof (*plug));if (!cb)return false;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 26/431 block: fix blktrace debugfs entries leakage
In reply to Greg Kroah-HartmanFrom: Yu Kuai <[email protected]>
[ Upstream commit dd7de3704af9989b780693d51eaea49a665bd9c2 ]
Commit 99d055b4fd4b ("block: remove per-disk debugfs files in blk_unregister_queue") moves blk_trace_shutdown() from blk_release_queue() to blk_unregister_queue(), this is safe if blktrace is created through sysfs, however, there is a regression in corner case.
blktrace can still be enabled after del_gendisk() through ioctl if the disk is opened before del_gendisk(), and if blktrace is not shutdown through ioctl before closing the disk, debugfs entries will be leaked.
Fix this problem by shutdown blktrace in disk_release(), this is safe because blk_trace_remove() is reentrant.
--- block/genhd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
block/genhd.c +4 -1
@@ -25,8 +25,9 @@#include <linux/pm_runtime.h> #include <linux/badblocks.h> #include <linux/part_stat.h> -#include "blk-throttle.h" +#include <linux/blktrace_api.h> +#include "blk-throttle.h" #include "blk.h" #include "blk-mq-sched.h" #include "blk-rq-qos.h"
@@ -1183,6 +1184,8 @@ static void disk_release(struct device *dev)might_sleep ();WARN_ON_ONCE (disk_live (disk)); +blk_trace_remove (disk->queue); +/* * To undo the all initialization from blk_mq_init_allocated_queue in * case of a probe failure where add_disk is never called we have to
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 27/431 irqchip/loongson-eiointc: Fix irq affinity setting during resume
In reply to Greg Kroah-HartmanFrom: Jianmin Lv <[email protected]>
[ Upstream commit fb07b8f83441febeb0daf199b5f18c6de9bbab03 ]
The hierarchy of PCH PIC, PCH PCI MSI and EIONTC is as following:
PCH PIC ------->|
|---->EIOINTC
PCH PCI MSI --->|so the irq_data list of irq_desc for IRQs on PCH PIC and PCH PCI MSI is like this:
irq_desc->irq_data(domain: PCH PIC)->parent_data(domain: EIOINTC) irq_desc->irq_data(domain: PCH PCI MSI)->parent_data(domain: EIOINTC)
In eiointc_resume(), the irq_data passed into eiointc_set_irq_affinity() should be matched to EIOINTC domain instead of PCH PIC or PCH PCI MSI domain, so fix it.
--- drivers/irqchip/irq-loongson-eiointc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-loongson-eiointc.c +1 -1
@@ -317,7 +317,7 @@ static void eiointc_resume(void) desc =irq_resolve_mapping (eiointc_priv[i]->eiointc_domain, j);if (desc && desc->handle_irq && desc->handle_irq != handle_bad_irq) {raw_spin_lock (&desc->lock); - irq_data = &desc->irq_data; + irq_data =irq_domain_get_irq_data (eiointc_priv[i]->eiointc_domain,irq_desc_get_irq (desc));eiointc_set_irq_affinity (irq_data, irq_data->common->affinity,0 );raw_spin_unlock (&desc->lock); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 28/431 splice: dont call file_accessed in copy_splice_read
In reply to Greg Kroah-HartmanFrom: Christoph Hellwig <[email protected]>
[ Upstream commit 0b24be4691c9e6ea13ca70050d42a9f9032fa788 ]
copy_splice_read calls into ->read_iter to read the data, which already calls file_accessed.
--- fs/splice.c | 1 - 1 file changed, 1 deletion(-)
fs/splice.c +0 -1
@@ -338,7 +338,6 @@ ssize_t direct_splice_read(struct file *in, loff_t *ppos, reclaim -= ret; remain = ret; *ppos = kiocb.ki_pos; -file_accessed (in); }else if (ret <0 ) {/* * callers of ->splice_read() expect -EAGAIN on
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 29/431 irqchip/stm32-exti: Fix warning on initialized field overwritten
In reply to Greg Kroah-HartmanFrom: Antonio Borneo <[email protected]>
[ Upstream commit 48f31e496488a25f443c0df52464da446fb1d10c ]
While compiling with W=1, both gcc and clang complain about a tricky way to initialize an array by filling it with a non-zero value and then overrride some of the array elements. In this case the override is intentional, so just disable the specific warning for only this part of the code.
Note: the flag "-Woverride-init" is recognized by both compilers, but the warning msg from clang reports "-Winitializer-overrides". The doc of clang clarifies that the two flags are synonyms, so use here only the flag name common on both compilers.
--- drivers/irqchip/irq-stm32-exti.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/irqchip/irq-stm32-exti.c +12 -0
@@ -173,6 +173,16 @@ static struct irq_chip stm32_exti_h_chip_direct;#define EXTI_INVALID_IRQ U8_MAX#define STM32MP1_DESC_IRQ_SIZE (ARRAY_SIZE(stm32mp1_exti_banks) * IRQS_PER_BANK) +/* +* Use some intentionally tricky logic here to initialize the whole array to +* EXTI_INVALID_IRQ, but then override certain fields, requiring us to indicate +* that we "know" that there are overrides in this structure, and we'll need to +* disable that warning from W=1 builds. +*/ +__diag_push (); +__diag_ignore_all ("-Woverride-init" , +"logic to initialize all and then override some is OK" ); +static const u8 stm32mp1_desc_irq[] = {/* default value */ [0 ... (STM32MP1_DESC_IRQ_SIZE -1 )] =EXTI_INVALID_IRQ ,
@@ -266,6 +276,8 @@ static const u8 stm32mp13_desc_irq[] = { [70 ] =98 , }; +__diag_pop (); +static const struct stm32_exti_drv_data stm32mp1_drv_data = { .exti_banks = stm32mp1_exti_banks, .bank_nr =ARRAY_SIZE (stm32mp1_exti_banks),
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 30/431 irqchip/jcore-aic: Fix missing allocation of IRQ descriptors
In reply to Greg Kroah-HartmanFrom: John Paul Adrian Glaubitz <[email protected]>
[ Upstream commit 4848229494a323eeaab62eee5574ef9f7de80374 ]
The initialization function for the J-Core AIC aic_irq_of_init() is currently missing the call to irq_alloc_descs() which allocates and initializes all the IRQ descriptors. Add missing function call and return the error code from irq_alloc_descs() in case the allocation fails.
--- drivers/irqchip/irq-jcore-aic.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/irqchip/irq-jcore-aic.c +7 -0
@@ -68,6 +68,7 @@ static int __init aic_irq_of_init(struct device_node *node,unsigned min_irq =JCORE_AIC2_MIN_HWIRQ ;unsigned dom_sz =JCORE_AIC_MAX_HWIRQ +1 ;struct irq_domain *domain; +int ret;pr_info ("Initializing J-Core AIC\n" );
@@ -100,6 +101,12 @@ static int __init aic_irq_of_init(struct device_node *node, jcore_aic.irq_unmask = noop; jcore_aic.name ="AIC" ; + ret =irq_alloc_descs (-1 , min_irq, dom_sz - min_irq, +of_node_to_nid (node)); + +if (ret <0 ) +return ret; + domain =irq_domain_add_legacy (node, dom_sz - min_irq, min_irq, min_irq, &jcore_aic_irqdomain_ops, &jcore_aic);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 31/431 svcrdma: Prevent page release when nothing was received
In reply to Greg Kroah-HartmanFrom: Chuck Lever <[email protected]>
[ Upstream commit baf6d18b116b7dc84ed5e212c3a89f17cdc3f28c ]
I noticed that svc_rqst_release_pages() was still unnecessarily releasing a page when svc_rdma_recvfrom() returns zero.
--- net/sunrpc/xprtrdma/svc_rdma_recvfrom.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +6 -6
@@ -796,6 +796,12 @@ int svc_rdma_recvfrom(struct svc_rqst *rqstp)struct svc_rdma_recv_ctxt *ctxt;int ret; +/* Prevent svc_xprt_release() from releasing pages in rq_pages +* when returning 0 or an error. +*/ + rqstp->rq_respages = rqstp->rq_pages; + rqstp->rq_next_page = rqstp->rq_respages; + rqstp->rq_xprt_ctxt =NULL ; ctxt =NULL ;
@@ -819,12 +825,6 @@ int svc_rdma_recvfrom(struct svc_rqst *rqstp) DMA_FROM_DEVICE);svc_rdma_build_arg_xdr (rqstp, ctxt); -/* Prevent svc_xprt_release from releasing pages in rq_pages -* if we return 0 or an error. -*/ - rqstp->rq_respages = rqstp->rq_pages; - rqstp->rq_next_page = rqstp->rq_respages; - ret =svc_rdma_xdr_decode_req (&rqstp->rq_arg, ctxt);if (ret <0 ) goto out_err;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 32/431 erofs: fix compact 4B support for 16k block size
In reply to Greg Kroah-HartmanFrom: Gao Xiang <[email protected]>
[ Upstream commit 001b8ccd0650727e54ec16ef72bf1b8eeab7168e ]
In compact 4B, two adjacent lclusters are packed together as a unit to form on-disk indexes for effective random access, as below:
(amortized = 4, vcnt = 2)
_____________________________________________
|___@_____ encoded bits __________|_ blkaddr _|
0 . amortized * vcnt = 8
. .
. . amortized * vcnt - 4 = 4
. .
.____________________________.
|_type (2 bits)_|_clusterofs_|Therefore, encoded bits for each pack are 32 bits (4 bytes). IOWs, since each lcluster can get 16 bits for its type and clusterofs, the maximum supported lclustersize for compact 4B format is 16k (14 bits).
Fix this to enable compact 4B format for 16k lclusters (blocks), which is tested on an arm64 server with 16k page size.
--- fs/erofs/zmap.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
fs/erofs/zmap.c +1 -5
@@ -148,7 +148,7 @@ static int unpack_compacted_index(struct z_erofs_maprecorder *m,u8 *in, type;bool big_pcluster; -if (1 << amortizedshift ==4 ) +if (1 << amortizedshift ==4 && lclusterbits <=14 ) vcnt =2 ;else if (1 << amortizedshift ==2 && lclusterbits ==12 ) vcnt =16 ;
@@ -250,7 +250,6 @@ static int compacted_load_cluster_from_disk(struct z_erofs_maprecorder *m, {struct inode *const inode = m->inode;struct erofs_inode *const vi =EROFS_I (inode); -const unsigned int lclusterbits = vi->z_logical_clusterbits;const erofs_off_t ebase =sizeof (struct z_erofs_map_header ) +ALIGN (erofs_iloc (inode) + vi->inode_isize + vi->xattr_isize,8 );const unsigned int totalidx =DIV_ROUND_UP (inode->i_size,EROFS_BLKSIZ );
@@ -258,9 +257,6 @@ static int compacted_load_cluster_from_disk(struct z_erofs_maprecorder *m,unsigned int amortizedshift;erofs_off_t pos; -if (lclusterbits !=12 ) -return -EOPNOTSUPP ; -if (lcn >= totalidx)return -EINVAL ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 33/431 posix-timers: Prevent RT livelock in itimer_delete()
In reply to Greg Kroah-HartmanFrom: Thomas Gleixner <[email protected]>
[ Upstream commit 9d9e522010eb5685d8b53e8a24320653d9d4cbbf ]
itimer_delete() has a retry loop when the timer is concurrently expired. On non-RT kernels this just spin-waits until the timer callback has completed, except for posix CPU timers which have HAVE_POSIX_CPU_TIMERS_TASK_WORK enabled.
In that case and on RT kernels the existing task could live lock when preempting the task which does the timer delivery.
Replace spin_unlock() with an invocation of timer_wait_running() to handle it the same way as the other retry loops in the posix timer code.
--- kernel/time/posix-timers.c | 43 +++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 8 deletions(-)
kernel/time/posix-timers.c +35 -8
@@ -1037,27 +1037,52 @@ SYSCALL_DEFINE1(timer_delete, timer_t, timer_id) }/* -* return timer owned by the process, used by exit_itimers +* Delete a timer if it is armed, remove it from the hash and schedule it +* for RCU freeing. */ static void itimer_delete (struct k_itimer *timer) { -retry_delete: -spin_lock_irq (&timer->it_lock); +unsigned long flags; + +/* +* irqsave is required to make timer_wait_running() work. +*/ +spin_lock_irqsave (&timer->it_lock, flags); +retry_delete: +/* +* Even if the timer is not longer accessible from other tasks +* it still might be armed and queued in the underlying timer +* mechanism. Worse, that timer mechanism might run the expiry +* function concurrently. +*/ if (timer_delete_hook (timer) ==TIMER_RETRY ) { -spin_unlock_irq (&timer->it_lock); +/* +* Timer is expired concurrently, prevent livelocks +* and pointless spinning on RT. +* +* timer_wait_running() drops timer::it_lock, which opens +* the possibility for another task to delete the timer. +* +* That's not possible here because this is invoked from +* do_exit() only for the last thread of the thread group. +* So no other task can access and delete that timer. +*/ +if (WARN_ON_ONCE (timer_wait_running (timer, &flags) != timer)) +return ; + goto retry_delete; }list_del (&timer->list); -spin_unlock_irq (&timer->it_lock); +spin_unlock_irqrestore (&timer->it_lock, flags);release_posix_timer (timer,IT_ID_SET ); }/* -* This is called by do_exit or de_thread, only when nobody else can -* modify the signal->posix_timers list. Yet we need sighand->siglock -* to prevent the race with /proc/pid/timers. +* Invoked from do_exit() when the last thread of a thread group exits. +* At that point no other task can access the timers of the dying +* task anymore. */ void exit_itimers (struct task_struct *tsk) {
@@ -1067,10 +1092,12 @@ void exit_itimers(struct task_struct *tsk)if (list_empty (&tsk->signal->posix_timers))return ; +/* Protect against concurrent read via /proc/$PID/timers */ spin_lock_irq (&tsk->sighand->siglock);list_replace_init (&tsk->signal->posix_timers, &timers);spin_unlock_irq (&tsk->sighand->siglock); +/* The timers are not longer accessible via tsk::signal */ while (!list_empty (&timers)) { tmr = list_first_entry(&timers, struct k_itimer, list);itimer_delete (tmr);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 34/431 tick/rcu: Fix bogus ratelimit condition
In reply to Greg Kroah-HartmanFrom: Wen Yang <[email protected]>
[ Upstream commit a7e282c77785c7eabf98836431b1f029481085ad ]
The ratelimit logic in report_idle_softirq() is broken because the exit condition is always true:
static int ratelimit; if (ratelimit < 10) return false; ---> always returns here ratelimit++; ---> no chance to run
Make it check for >= 10 instead.
--- kernel/time/tick-sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/time/tick-sched.c +1 -1
@@ -1046,7 +1046,7 @@ static bool report_idle_softirq(void)return false; } -if (ratelimit <10 ) +if (ratelimit >=10 )return false;/* On RT, softirqs handling may be waiting on some lock */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 35/431 tracing/timer: Add missing hrtimer modes to decode_hrtimer_mode().
In reply to Greg Kroah-HartmanFrom: Sebastian Andrzej Siewior <[email protected]>
[ Upstream commit 2951580ba6adb082bb6b7154a5ecb24e7c1f7569 ]
The trace output for the HRTIMER_MODE_.*_HARD modes is seen as a number since these modes are not decoded. The author was not aware of the fancy decoding function which makes the life easier.
Extend decode_hrtimer_mode() with the additional HRTIMER_MODE_.*_HARD modes.
--- include/trace/events/timer.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
include/trace/events/timer.h +5 -1
@@ -158,7 +158,11 @@ DEFINE_EVENT(timer_class, timer_cancel, { HRTIMER_MODE_ABS_SOFT, "ABS|SOFT" }, \ { HRTIMER_MODE_REL_SOFT, "REL|SOFT" }, \ { HRTIMER_MODE_ABS_PINNED_SOFT, "ABS|PINNED|SOFT" }, \ - { HRTIMER_MODE_REL_PINNED_SOFT, "REL|PINNED|SOFT" }) + { HRTIMER_MODE_REL_PINNED_SOFT, "REL|PINNED|SOFT" }, \ + { HRTIMER_MODE_ABS_HARD, "ABS|HARD" }, \ + { HRTIMER_MODE_REL_HARD, "REL|HARD" }, \ + { HRTIMER_MODE_ABS_PINNED_HARD, "ABS|PINNED|HARD" }, \ + { HRTIMER_MODE_REL_PINNED_HARD, "REL|PINNED|HARD" })/** * hrtimer_init - called when the hrtimer is initialized
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 36/431 btrfs: make btrfs_split_bio work on struct btrfs_bio
In reply to Greg Kroah-HartmanFrom: Christoph Hellwig <[email protected]>
[ Upstream commit 2cef0c79bb81d8bae1dbc45195771a824ca45e76 ]
btrfs_split_bio expects a btrfs_bio as argument and always allocates one. Type both the orig_bio argument and the return value as struct btrfs_bio to improve type safety.
Stable-dep-of: c731cd0b6d25 ("btrfs: fix file_offset for REQ_BTRFS_ONE_ORDERED bios that get split")
--- fs/btrfs/bio.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-)
fs/btrfs/bio.c +14 -13
@@ -59,30 +59,31 @@ struct bio *btrfs_bio_alloc(unsigned int nr_vecs, blk_opf_t opf,return bio; } -static struct bio *btrfs_split_bio (struct btrfs_fs_info *fs_info, -struct bio *orig,u64 map_length, -bool use_append) +static struct btrfs_bio *btrfs_split_bio (struct btrfs_fs_info *fs_info, +struct btrfs_bio *orig_bbio, +u64 map_length,bool use_append) { -struct btrfs_bio *orig_bbio =btrfs_bio (orig); +struct btrfs_bio *bbio;struct bio *bio;if (use_append) {unsigned int nr_segs; - bio =bio_split_rw (orig, &fs_info->limits, &nr_segs, + bio =bio_split_rw (&orig_bbio->bio, &fs_info->limits, &nr_segs, &btrfs_clone_bioset, map_length); }else { - bio =bio_split (orig, map_length >>SECTOR_SHIFT ,GFP_NOFS , - &btrfs_clone_bioset); + bio =bio_split (&orig_bbio->bio, map_length >>SECTOR_SHIFT , +GFP_NOFS , &btrfs_clone_bioset); } -btrfs_bio_init (btrfs_bio (bio), orig_bbio->inode,NULL , orig_bbio); + bbio =btrfs_bio (bio); +btrfs_bio_init (bbio, orig_bbio->inode,NULL , orig_bbio); -btrfs_bio (bio)->file_offset = orig_bbio->file_offset; -if (!(orig->bi_opf &REQ_BTRFS_ONE_ORDERED )) + bbio->file_offset = orig_bbio->file_offset; +if (!(orig_bbio->bio.bi_opf &REQ_BTRFS_ONE_ORDERED )) orig_bbio->file_offset += map_length;atomic_inc (&orig_bbio->pending_ios); -return bio; +return bbio; }static void btrfs_orig_write_end_io (struct bio *bio);
@@ -631,8 +632,8 @@ static bool btrfs_submit_chunk(struct bio *bio, int mirror_num) map_length =min (map_length, fs_info->max_zone_append_size);if (map_length < length) { - bio =btrfs_split_bio (fs_info, bio, map_length, use_append); - bbio =btrfs_bio (bio); + bbio =btrfs_split_bio (fs_info, bbio, map_length, use_append); + bio = &bbio->bio; }/*
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 37/431 btrfs: fix file_offset for REQ_BTRFS_ONE_ORDERED bios that get split
In reply to Greg Kroah-HartmanFrom: Christoph Hellwig <[email protected]>
[ Upstream commit c731cd0b6d255e4855a7cac9f276864032ab2387 ]
If a bio gets split, it needs to have a proper file_offset for checksum validation and repair to work properly.
Based on feedback from Josef, commit 852eee62d31a ("btrfs: allow btrfs_submit_bio to split bios") skipped this adjustment for ONE_ORDERED bios. But if we actually ever need to split a ONE_ORDERED read bio, this will lead to a wrong file offset in the repair code. Right now the only user of the file_offset is logging of an error message so this is mostly harmless, but the wrong offset might be more problematic for additional users in the future.
--- fs/btrfs/bio.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/btrfs/bio.c +1 -2
@@ -79,8 +79,7 @@ static struct btrfs_bio *btrfs_split_bio(struct btrfs_fs_info *fs_info,btrfs_bio_init (bbio, orig_bbio->inode,NULL , orig_bbio); bbio->file_offset = orig_bbio->file_offset; -if (!(orig_bbio->bio.bi_opf &REQ_BTRFS_ONE_ORDERED )) - orig_bbio->file_offset += map_length; + orig_bbio->file_offset += map_length;atomic_inc (&orig_bbio->pending_ios);return bbio;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 38/431 clocksource/drivers/cadence-ttc: Fix memory leak in ttc_timer_probe
In reply to Greg Kroah-HartmanFrom: Feng Mingxi <[email protected]>
[ Upstream commit 8b5bf64c89c7100c921bd807ba39b2eb003061ab ]
Smatch reports:drivers/clocksource/timer-cadence-ttc.c:529 ttc_timer_probe()
warn: 'timer_baseaddr' from of_iomap() not released on lines: 498,508,516.
timer_baseaddr may have the problem of not being released after use, I replaced it with the devm_of_iomap() function and added the clk_put() function to cleanup the "clk_ce" and "clk_cs".
--- drivers/clocksource/timer-cadence-ttc.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)
drivers/clocksource/timer-cadence-ttc.c +13 -6
@@ -486,10 +486,10 @@ static int __init ttc_timer_probe(struct platform_device *pdev)* and use it. Note that the event timer uses the interrupt and it's the * 2nd TTC hence the irq_of_parse_and_map(,1) */ - timer_baseaddr =of_iomap (timer,0 ); -if (!timer_baseaddr) { + timer_baseaddr =devm_of_iomap (&pdev->dev, timer,0 ,NULL ); +if (IS_ERR (timer_baseaddr)) {pr_err ("ERROR: invalid timer base address\n" ); -return -ENXIO ; +return PTR_ERR (timer_baseaddr); } irq =irq_of_parse_and_map (timer,1 );
@@ -513,20 +513,27 @@ static int __init ttc_timer_probe(struct platform_device *pdev) clk_ce =of_clk_get (timer, clksel);if (IS_ERR (clk_ce)) {pr_err ("ERROR: timer input clock not found\n" ); -return PTR_ERR (clk_ce); + ret =PTR_ERR (clk_ce); + goto put_clk_cs; } ret =ttc_setup_clocksource (clk_cs, timer_baseaddr, timer_width);if (ret) -return ret; + goto put_clk_ce; ret =ttc_setup_clockevent (clk_ce, timer_baseaddr +4 , irq);if (ret) -return ret; + goto put_clk_ce;pr_info ("%pOFn #0 at %p, irq=%d\n" , timer, timer_baseaddr, irq);return 0 ; + +put_clk_ce: +clk_put (clk_ce); +put_clk_cs: +clk_put (clk_cs); +return ret; }static const struct of_device_id ttc_timer_of_match[] = {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 39/431 PM: domains: fix integer overflow issues in genpd_parse_state()
In reply to Greg Kroah-HartmanFrom: Nikita Zhandarovich <[email protected]>
[ Upstream commit e5d1c8722083f0332dcd3c85fa1273d85fb6bed8 ]
Currently, while calculating residency and latency values, right operands may overflow if resulting values are big enough.
To prevent this, albeit unlikely case, play it safe and convert right operands to left ones' type s64.
Found by Linux Verification Center (linuxtesting.org) with static analysis tool SVACE.
--- drivers/base/power/domain.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/base/power/domain.c +3 -3
@@ -2939,10 +2939,10 @@ static int genpd_parse_state(struct genpd_power_state *genpd_state, err =of_property_read_u32 (state_node,"min-residency-us" , &residency);if (!err) - genpd_state->residency_ns =1000 * residency; + genpd_state->residency_ns =1000LL * residency; - genpd_state->power_on_latency_ns =1000 * exit_latency; - genpd_state->power_off_latency_ns =1000 * entry_latency; + genpd_state->power_on_latency_ns =1000LL * exit_latency; + genpd_state->power_off_latency_ns =1000LL * entry_latency; genpd_state->fwnode = &state_node->fwnode;return 0 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 40/431 perf/arm-cmn: Fix DTC reset
In reply to Greg Kroah-HartmanFrom: Robin Murphy <[email protected]>
[ Upstream commit 71746c995cac92fcf6a65661b51211cf2009d7f0 ]
It turns out that my naive DTC reset logic fails to work as intended, since, after checking with the hardware designers, the PMU actually needs to be fully enabled in order to correctly clear any pending overflows. Therefore, invert the sequence to start with turning on both enables so that we can reliably get the DTCs into a known state, then moving to our normal counters-stopped state from there. Since all the DTM counters have already been unpaired during the initial discovery pass, we just need to additionally reset the cycle counters to ensure that no other unexpected overflows occur during this period.
--- drivers/perf/arm-cmn.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/perf/arm-cmn.c +4 -3
@@ -1899,9 +1899,10 @@ static int arm_cmn_init_dtc(struct arm_cmn *cmn, struct arm_cmn_node *dn, int idif (dtc->irq <0 )return dtc->irq; -writel_relaxed (0 , dtc->base +CMN_DT_PMCR ); +writel_relaxed (CMN_DT_DTC_CTL_DT_EN , dtc->base +CMN_DT_DTC_CTL ); +writel_relaxed (CMN_DT_PMCR_PMU_EN |CMN_DT_PMCR_OVFL_INTR_EN , dtc->base +CMN_DT_PMCR ); +writeq_relaxed (0 , dtc->base +CMN_DT_PMCCNTR );writel_relaxed (0x1ff , dtc->base +CMN_DT_PMOVSR_CLR ); -writel_relaxed (CMN_DT_PMCR_OVFL_INTR_EN , dtc->base +CMN_DT_PMCR );return 0 ; }
@@ -1961,7 +1962,7 @@ static int arm_cmn_init_dtcs(struct arm_cmn *cmn) dn->type =CMN_TYPE_CCLA ; } -writel_relaxed (CMN_DT_DTC_CTL_DT_EN , cmn->dtc[0 ].base +CMN_DT_DTC_CTL ); +arm_cmn_set_state (cmn,CMN_STATE_DISABLED );return 0 ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 41/431 x86/mm: Allow guest.enc_status_change_prepare() to fail
In reply to Greg Kroah-HartmanFrom: Kirill A. Shutemov <[email protected]>
[ Upstream commit 3f6819dd192ef4f0c568ec3e9d6d408b3fa1ad3d ]
TDX code is going to provide guest.enc_status_change_prepare() that is able to fail. TDX will use the call to convert the GPA range from shared to private. This operation can fail.
Add a way to return an error from the callback.
Stable-dep-of: 195edce08b63 ("x86/tdx: Fix race between set_memory_encrypted() and load_unaligned_zeropad()")
--- arch/x86/include/asm/x86_init.h | 2 +- arch/x86/kernel/x86_init.c | 2 +- arch/x86/mm/mem_encrypt_amd.c | 4 +++- arch/x86/mm/pat/set_memory.c | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-)
arch/x86/include/asm/x86_init.h +1 -1
@@ -150,7 +150,7 @@ struct x86_init_acpi {* @enc_cache_flush_required Returns true if a cache flush is needed before changing page encryption status */ struct x86_guest { -void (*enc_status_change_prepare)(unsigned long vaddr,int npages,bool enc); +bool (*enc_status_change_prepare)(unsigned long vaddr,int npages,bool enc);bool (*enc_status_change_finish)(unsigned long vaddr,int npages,bool enc);bool (*enc_tlb_flush_required)(bool enc);bool (*enc_cache_flush_required)(void );
arch/x86/kernel/x86_init.c +1 -1
@@ -130,7 +130,7 @@ struct x86_cpuinit_ops x86_cpuinit = {static void default_nmi_init (void ) { }; -static void enc_status_change_prepare_noop (unsigned long vaddr,int npages,bool enc) { } +static bool enc_status_change_prepare_noop (unsigned long vaddr,int npages,bool enc) {return true; }static bool enc_status_change_finish_noop (unsigned long vaddr,int npages,bool enc) {return false; }static bool enc_tlb_flush_required_noop (bool enc) {return false; }static bool enc_cache_flush_required_noop (void ) {return false; }
arch/x86/mm/mem_encrypt_amd.c +3 -1
@@ -319,7 +319,7 @@ static void enc_dec_hypercall(unsigned long vaddr, int npages, bool enc)#endif } -static void amd_enc_status_change_prepare (unsigned long vaddr,int npages,bool enc) +static bool amd_enc_status_change_prepare (unsigned long vaddr,int npages,bool enc) {/* * To maintain the security guarantees of SEV-SNP guests, make sure
@@ -327,6 +327,8 @@ static void amd_enc_status_change_prepare(unsigned long vaddr, int npages, bool*/ if (cc_platform_has (CC_ATTR_GUEST_SEV_SNP ) && !enc)snp_set_memory_shared (vaddr, npages); + +return true; }/* Return true unconditionally: return value doesn't matter for the SEV side */
arch/x86/mm/pat/set_memory.c +2 -1
@@ -2151,7 +2151,8 @@ static int __set_memory_enc_pgtable(unsigned long addr, int numpages, bool enc)cpa_flush (&cpa, x86_platform.guest.enc_cache_flush_required ());/* Notify hypervisor that we are about to set/clr encryption attribute. */ - x86_platform.guest.enc_status_change_prepare (addr, numpages, enc); +if (!x86_platform.guest.enc_status_change_prepare (addr, numpages, enc)) +return -EIO ; ret =__change_page_attr_set_clr (&cpa,1 );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 42/431 x86/tdx: Fix race between set_memory_encrypted() and load_unaligned_zeropad()
In reply to Greg Kroah-HartmanFrom: Kirill A. Shutemov <[email protected]>
[ Upstream commit 195edce08b63d293377f615f4f7f086715d2d212 ]
tl;dr: There is a race in the TDX private<=>shared conversion code
which could kill the TDX guest. Fix it by changing conversion ordering to eliminate the window.
TDX hardware maintains metadata to track which pages are private and shared. Additionally, TDX guests use the guest x86 page tables to specify whether a given mapping is intended to be private or shared. Bad things happen when the intent and metadata do not match.
So there are two thing in play:
1. "the page" -- the physical TDX page metadata
2. "the mapping" -- the guest-controlled x86 page table intent
For instance, an unrecoverable exit to VMM occurs if a guest touches a private mapping that points to a shared physical page.
In summary:
* Private mapping => Private Page == OK (obviously)
* Shared mapping => Shared Page == OK (obviously)
* Private mapping => Shared Page == BIG BOOM!
* Shared mapping => Private Page == OK-ish
(It will read generate a recoverable #VE via handle_mmio())
Enter load_unaligned_zeropad(). It can touch memory that is adjacent but otherwise unrelated to the memory it needs to touch. It will cause one of those unrecoverable exits (aka. BIG BOOM) if it blunders into a shared mapping pointing to a private page.
This is a problem when __set_memory_enc_pgtable() converts pages from shared to private. It first changes the mapping and second modifies the TDX page metadata. It's moving from:
* Shared mapping => Shared Page == OK
to:
* Private mapping => Shared Page == BIG BOOM!
This means that there is a window with a shared mapping pointing to a private page where load_unaligned_zeropad() can strike.
Add a TDX handler for guest.enc_status_change_prepare(). This converts the page from shared to private *before* the page becomes private. This ensures that there is never a private mapping to a shared page.
Leave a guest.enc_status_change_finish() in place but only use it for private=>shared conversions. This will delay updating the TDX metadata marking the page private until *after* the mapping matches the metadata. This also ensures that there is never a private mapping to a shared page.
[ dhansen: rewrite changelog ]
--- arch/x86/coco/tdx/tdx.c | 51 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-)
arch/x86/coco/tdx/tdx.c +48 -3
@@ -840,6 +840,30 @@ static bool tdx_enc_status_changed(unsigned long vaddr, int numpages, bool enc)return true; } +static bool tdx_enc_status_change_prepare (unsigned long vaddr,int numpages, +bool enc) +{ +/* +* Only handle shared->private conversion here. +* See the comment in tdx_early_init(). +*/ +if (enc) +return tdx_enc_status_changed (vaddr, numpages, enc); +return true; +} + +static bool tdx_enc_status_change_finish (unsigned long vaddr,int numpages, +bool enc) +{ +/* +* Only handle private->shared conversion here. +* See the comment in tdx_early_init(). +*/ +if (!enc) +return tdx_enc_status_changed (vaddr, numpages, enc); +return true; +} +void __init tdx_early_init (void ) {u64 cc_mask;
@@ -867,9 +891,30 @@ void __init tdx_early_init(void)*/ physical_mask &= cc_mask -1 ; - x86_platform.guest.enc_cache_flush_required = tdx_cache_flush_required; - x86_platform.guest.enc_tlb_flush_required = tdx_tlb_flush_required; - x86_platform.guest.enc_status_change_finish = tdx_enc_status_changed; +/* +* The kernel mapping should match the TDX metadata for the page. +* load_unaligned_zeropad() can touch memory *adjacent* to that which is +* owned by the caller and can catch even _momentary_ mismatches. Bad +* things happen on mismatch: +* +* - Private mapping => Shared Page == Guest shutdown +* - Shared mapping => Private Page == Recoverable #VE +* +* guest.enc_status_change_prepare() converts the page from +* shared=>private before the mapping becomes private. +* +* guest.enc_status_change_finish() converts the page from +* private=>shared after the mapping becomes private. +* +* In both cases there is a temporary shared mapping to a private page, +* which can result in a #VE. But, there is never a private mapping to +* a shared page. +*/ + x86_platform.guest.enc_status_change_prepare = tdx_enc_status_change_prepare; + x86_platform.guest.enc_status_change_finish = tdx_enc_status_change_finish; + + x86_platform.guest.enc_cache_flush_required = tdx_cache_flush_required; + x86_platform.guest.enc_tlb_flush_required = tdx_tlb_flush_required;pr_info ("Guest detected\n" ); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 43/431 drivers/perf: hisi: Dont migrate perf to the CPU going to teardown
In reply to Greg Kroah-HartmanFrom: Junhao He <[email protected]>
[ Upstream commit 7a6a9f1c5a0a875a421db798d4b2ee022dc1ee1a ]
The driver needs to migrate the perf context if the current using CPU going to teardown. By the time calling the cpuhp::teardown() callback the cpu_online_mask() hasn't updated yet and still includes the CPU going to teardown. In current driver's implementation we may migrate the context to the teardown CPU and leads to the below calltrace:
...
[ 368.104662][ T932] task:cpuhp/0 state:D stack: 0 pid: 15 ppid: 2 flags:0x00000008 [ 368.113699][ T932] Call trace: [ 368.116834][ T932] __switch_to+0x7c/0xbc [ 368.120924][ T932] __schedule+0x338/0x6f0 [ 368.125098][ T932] schedule+0x50/0xe0 [ 368.128926][ T932] schedule_preempt_disabled+0x18/0x24 [ 368.134229][ T932] __mutex_lock.constprop.0+0x1d4/0x5dc [ 368.139617][ T932] __mutex_lock_slowpath+0x1c/0x30 [ 368.144573][ T932] mutex_lock+0x50/0x60 [ 368.148579][ T932] perf_pmu_migrate_context+0x84/0x2b0 [ 368.153884][ T932] hisi_pcie_pmu_offline_cpu+0x90/0xe0 [hisi_pcie_pmu] [ 368.160579][ T932] cpuhp_invoke_callback+0x2a0/0x650 [ 368.165707][ T932] cpuhp_thread_fun+0xe4/0x190 [ 368.170316][ T932] smpboot_thread_fn+0x15c/0x1a0 [ 368.175099][ T932] kthread+0x108/0x13c [ 368.179012][ T932] ret_from_fork+0x10/0x18
...
Use function cpumask_any_but() to find one correct active cpu to fixes this issue.
--- drivers/perf/hisilicon/hisi_pcie_pmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/perf/hisilicon/hisi_pcie_pmu.c +1 -1
@@ -683,7 +683,7 @@ static int hisi_pcie_pmu_offline_cpu(unsigned int cpu, struct hlist_node *node) pcie_pmu->on_cpu =-1 ;/* Choose a new CPU from all online cpus. */ - target =cpumask_first (cpu_online_mask); + target =cpumask_any_but (cpu_online_mask, cpu);if (target >= nr_cpu_ids) {pci_err (pcie_pmu->pdev,"There is no CPU to set\n" );return 0 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 44/431 perf: arm_cspmu: Set irq affinitiy only if overflow interrupt is used
In reply to Greg Kroah-HartmanFrom: Ilkka Koskinen <[email protected]>
[ Upstream commit 225d757012e0afa673d8c862e6fb39ed2f429b4d ]
Don't try to set irq affinity if PMU doesn't have an overflow interrupt.
--- drivers/perf/arm_cspmu/arm_cspmu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/perf/arm_cspmu/arm_cspmu.c +2 -1
@@ -1230,7 +1230,8 @@ static struct platform_driver arm_cspmu_driver = {static void arm_cspmu_set_active_cpu (int cpu,struct arm_cspmu *cspmu) {cpumask_set_cpu (cpu, &cspmu->active_cpu); -WARN_ON (irq_set_affinity (cspmu->irq, &cspmu->active_cpu)); +if (cspmu->irq) +WARN_ON (irq_set_affinity (cspmu->irq, &cspmu->active_cpu)); }static int arm_cspmu_cpu_online (unsigned int cpu,struct hlist_node *node)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 45/431 perf/arm_cspmu: Fix event attribute type
In reply to Greg Kroah-HartmanFrom: Robin Murphy <[email protected]>
[ Upstream commit 71e0cb32d5fc61468e83ed962379af71bba8237e ]
ARM_CSPMU_EVENT_ATTR() defines a struct perf_pmu_events_attr, so arm_cspmu_sysfs_event_show() should not be interpreting it as struct dev_ext_attribute.
--- drivers/perf/arm_cspmu/arm_cspmu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/perf/arm_cspmu/arm_cspmu.c +4 -4
@@ -189,10 +189,10 @@ static inline bool use_64b_counter_reg(const struct arm_cspmu *cspmu)ssize_t arm_cspmu_sysfs_event_show (struct device *dev,struct device_attribute *attr,char *buf) { -struct dev_ext_attribute *eattr = - container_of(attr, struct dev_ext_attribute, attr); -return sysfs_emit (buf,"event=0x%llx\n" , - (unsigned long long )eattr->var); +struct perf_pmu_events_attr *pmu_attr; + + pmu_attr =container_of (attr,typeof (*pmu_attr), attr); +return sysfs_emit (buf,"event=0x%llx\n" , pmu_attr->id); }EXPORT_SYMBOL_GPL (arm_cspmu_sysfs_event_show);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 46/431 APEI: GHES: correctly return NULL for ghes_get_devices()
In reply to Greg Kroah-HartmanFrom: Li Yang <[email protected]>
[ Upstream commit 9368aa1882ac7178adcd936cee5f0899dbf76dc4 ]
Since 315bada690e0 ("EDAC: Check for GHES preference in the chipset-specific EDAC drivers"), vendor specific EDAC driver will not probe correctly when CONFIG_ACPI_APEI_GHES is enabled but no GHES device is present. Make ghes_get_devices() return NULL when the GHES device list is empty to fix the problem.
--- drivers/acpi/apei/ghes.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/acpi/apei/ghes.c +2 -0
@@ -1544,6 +1544,8 @@ struct list_head *ghes_get_devices(void)pr_warn_once ("Force-loading ghes_edac on an unsupported platform. You're on your own!\n" ); } + }else if (list_empty (&ghes_devs)) { +return NULL ; }return &ghes_devs;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 47/431 powercap: RAPL: fix invalid initialization for pl4_supported field
In reply to Greg Kroah-HartmanFrom: Sumeet Pawnikar <[email protected]>
[ Upstream commit d05b5e0baf424c8c4b4709ac11f66ab726c8deaf ]
The current initialization of the struct x86_cpu_id via pl4_support_ids[] is partial and wrong. It is initializing "stepping" field with "X86_FEATURE_ANY" instead of "feature" field.
Use X86_MATCH_INTEL_FAM6_MODEL macro instead of initializing each field of the struct x86_cpu_id for pl4_supported list of CPUs. This X86_MATCH_INTEL_FAM6_MODEL macro internally uses another macro X86_MATCH_VENDOR_FAM_MODEL_FEATURE for X86 based CPU matching with appropriate initialized values.
--- drivers/powercap/intel_rapl_msr.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/powercap/intel_rapl_msr.c +8 -8
@@ -137,14 +137,14 @@ static int rapl_msr_write_raw(int cpu, struct reg_action *ra)/* List of verified CPUs. */ static const struct x86_cpu_id pl4_support_ids[] = { - {X86_VENDOR_INTEL ,6 ,INTEL_FAM6_TIGERLAKE_L ,X86_FEATURE_ANY }, - {X86_VENDOR_INTEL ,6 ,INTEL_FAM6_ALDERLAKE ,X86_FEATURE_ANY }, - {X86_VENDOR_INTEL ,6 ,INTEL_FAM6_ALDERLAKE_L ,X86_FEATURE_ANY }, - {X86_VENDOR_INTEL ,6 ,INTEL_FAM6_ALDERLAKE_N ,X86_FEATURE_ANY }, - {X86_VENDOR_INTEL ,6 ,INTEL_FAM6_RAPTORLAKE ,X86_FEATURE_ANY }, - {X86_VENDOR_INTEL ,6 ,INTEL_FAM6_RAPTORLAKE_P ,X86_FEATURE_ANY }, - {X86_VENDOR_INTEL ,6 ,INTEL_FAM6_METEORLAKE ,X86_FEATURE_ANY }, - {X86_VENDOR_INTEL ,6 ,INTEL_FAM6_METEORLAKE_L ,X86_FEATURE_ANY }, +X86_MATCH_INTEL_FAM6_MODEL (TIGERLAKE_L ,NULL ), +X86_MATCH_INTEL_FAM6_MODEL (ALDERLAKE ,NULL ), +X86_MATCH_INTEL_FAM6_MODEL (ALDERLAKE_L ,NULL ), +X86_MATCH_INTEL_FAM6_MODEL (ALDERLAKE_N ,NULL ), +X86_MATCH_INTEL_FAM6_MODEL (RAPTORLAKE ,NULL ), +X86_MATCH_INTEL_FAM6_MODEL (RAPTORLAKE_P ,NULL ), +X86_MATCH_INTEL_FAM6_MODEL (METEORLAKE ,NULL ), +X86_MATCH_INTEL_FAM6_MODEL (METEORLAKE_L ,NULL ), {} };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 48/431 powercap: RAPL: Fix CONFIG_IOSF_MBI dependency
In reply to Greg Kroah-HartmanFrom: Zhang Rui <[email protected]>
[ Upstream commit 4658fe81b3f8afe8adf37734ec5fe595d90415c6 ]
After commit 3382388d7148 ("intel_rapl: abstract RAPL common code"), accessing to IOSF_MBI interface is done in the RAPL common code.
Thus it is the CONFIG_INTEL_RAPL_CORE that has dependency of CONFIG_IOSF_MBI, while CONFIG_INTEL_RAPL_MSR does not.
This problem was not exposed previously because all the previous RAPL common code users, aka, the RAPL MSR and MMIO I/F drivers, have CONFIG_IOSF_MBI selected.
Fix the CONFIG_IOSF_MBI dependency in RAPL code. This also fixes a build time failure when the RAPL TPMI I/F driver is introduced without selecting CONFIG_IOSF_MBI.
x86_64-linux-ld: vmlinux.o: in function `set_floor_freq_atom':
intel_rapl_common.c:(.text+0x2dac9b8): undefined reference to `iosf_mbi_write'
x86_64-linux-ld: intel_rapl_common.c:(.text+0x2daca66): undefined reference to `iosf_mbi_read'
Reference to iosf_mbi.h is also removed from the RAPL MSR I/F driver.
--- drivers/powercap/Kconfig | 4 +++- drivers/powercap/intel_rapl_msr.c | 1 - 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/powercap/Kconfig +3 -1
@@ -18,10 +18,12 @@ if POWERCAP # Client driver configurations go here. config INTEL_RAPL_CORE tristate + depends on PCI + select IOSF_MBI config INTEL_RAPL tristate "Intel RAPL Support via MSR Interface" - depends on X86 && IOSF_MBI + depends on X86 && PCI select INTEL_RAPL_CORE help This enables support for the Intel Running Average Power Limit (RAPL)
drivers/powercap/intel_rapl_msr.c +0 -1
@@ -22,7 +22,6 @@#include <linux/processor.h> #include <linux/platform_device.h> -#include <asm/iosf_mbi.h> #include <asm/cpu_device_id.h> #include <asm/intel-family.h>
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 49/431 PM: domains: Move the verification of in-params from genpd_add_device()
In reply to Greg Kroah-HartmanFrom: Ulf Hansson <[email protected]>
[ Upstream commit 4384a70c8813e8573d1841fd94eee873f80a7e1a ]
Commit f38d1a6d0025 ("PM: domains: Allocate governor data dynamically based on a genpd governor") started to use the in-parameters in genpd_add_device(), without first doing a verification of them.
This isn't really a big problem, as most callers do a verification already.
Therefore, let's drop the verification from genpd_add_device() and make sure all the callers take care of it instead.
--- drivers/base/power/domain.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/base/power/domain.c +6 -3
@@ -1632,9 +1632,6 @@ static int genpd_add_device(struct generic_pm_domain *genpd, struct device *dev,dev_dbg (dev,"%s()\n" , __func__); -if (IS_ERR_OR_NULL (genpd) ||IS_ERR_OR_NULL (dev)) -return -EINVAL ; - gpd_data =genpd_alloc_dev_data (dev, gd);if (IS_ERR (gpd_data))return PTR_ERR (gpd_data);
@@ -1676,6 +1673,9 @@ int pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev) {int ret; +if (!genpd || !dev) +return -EINVAL ; +mutex_lock (&gpd_list_lock); ret =genpd_add_device (genpd, dev, dev);mutex_unlock (&gpd_list_lock);
@@ -2523,6 +2523,9 @@ int of_genpd_add_device(struct of_phandle_args *genpdspec, struct device *dev)struct generic_pm_domain *genpd;int ret; +if (!dev) +return -EINVAL ; +mutex_lock (&gpd_list_lock); genpd =genpd_get_from_provider (genpdspec);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 50/431 ARM: 9303/1: kprobes: avoid missing-declaration warnings
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 1b9c3ddcec6a55e15d3e38e7405e2d078db02020 ]
checker_stack_use_t32strd() and kprobe_handler() can be made static since they are not used from other files, while coverage_start_registers() and __kprobes_test_case() are used from assembler code, and just need a declaration to avoid a warning with the global definition.
arch/arm/probes/kprobes/checkers-common.c:43:18: error: no previous prototype for 'checker_stack_use_t32strd' arch/arm/probes/kprobes/core.c:236:16: error: no previous prototype for 'kprobe_handler' arch/arm/probes/kprobes/test-core.c:723:10: error: no previous prototype for 'coverage_start_registers' arch/arm/probes/kprobes/test-core.c:918:14: error: no previous prototype for '__kprobes_test_case_start' arch/arm/probes/kprobes/test-core.c:952:14: error: no previous prototype for '__kprobes_test_case_end_16' arch/arm/probes/kprobes/test-core.c:967:14: error: no previous prototype for '__kprobes_test_case_end_32'
--- arch/arm/probes/kprobes/checkers-common.c | 2 +- arch/arm/probes/kprobes/core.c | 2 +- arch/arm/probes/kprobes/opt-arm.c | 2 -- arch/arm/probes/kprobes/test-core.c | 2 +- arch/arm/probes/kprobes/test-core.h | 4 ++++ 5 files changed, 7 insertions(+), 5 deletions(-)
arch/arm/probes/kprobes/checkers-common.c +1 -1
@@ -40,7 +40,7 @@ enum probes_insn checker_stack_use_imm_0xx(probes_opcode_t insn,* Different from other insn uses imm8, the real addressing offset of * STRD in T32 encoding should be imm8 * 4. See ARMARM description. */ -enum probes_insn checker_stack_use_t32strd (probes_opcode_t insn, +static enum probes_insn checker_stack_use_t32strd (probes_opcode_t insn,struct arch_probes_insn *asi,const struct decode_header *h) {
arch/arm/probes/kprobes/core.c +1 -1
@@ -233,7 +233,7 @@ singlestep(struct kprobe *p, struct pt_regs *regs, struct kprobe_ctlblk *kcb)* kprobe, and that level is reserved for user kprobe handlers, so we can't * risk encountering a new kprobe in an interrupt handler. */ -void __kprobes kprobe_handler (struct pt_regs *regs) +static void __kprobes kprobe_handler (struct pt_regs *regs) {struct kprobe *p, *cur;struct kprobe_ctlblk *kcb;
arch/arm/probes/kprobes/opt-arm.c +0 -2
@@ -145,8 +145,6 @@ __arch_remove_optimized_kprobe(struct optimized_kprobe *op, int dirty) } } -extern void kprobe_handler (struct pt_regs *regs); -static void optimized_callback (struct optimized_kprobe *op,struct pt_regs *regs) {
arch/arm/probes/kprobes/test-core.c +1 -1
@@ -720,7 +720,7 @@ static const char coverage_register_lookup[16] = { [REG_TYPE_NOSPPCX] = COVERAGE_ANY_REG | COVERAGE_SP, }; -unsigned coverage_start_registers (const struct decode_header *h) +static unsigned coverage_start_registers (const struct decode_header *h) {unsigned regs =0 ;int i;
arch/arm/probes/kprobes/test-core.h +4 -0
@@ -454,3 +454,7 @@ void kprobe_thumb32_test_cases(void);#else void kprobe_arm_test_cases (void );#endif + +void __kprobes_test_case_start (void ); +void __kprobes_test_case_end_16 (void ); +void __kprobes_test_case_end_32 (void );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 51/431 cpufreq: intel_pstate: Fix energy_performance_preference for passive
In reply to Greg Kroah-HartmanFrom: Tero Kristo <[email protected]>
[ Upstream commit 03f44ffb3d5be2fceda375d92c70ab6de4df7081 ]
If the intel_pstate driver is set to passive mode, then writing the same value to the energy_performance_preference sysfs twice will fail. This is caused by the wrong return value used (index of the matched energy_perf_string), instead of the length of the passed in parameter. Fix by forcing the internal return value to zero when the same preference is passed in by user. This same issue is not present when active mode is used for the driver.
--- drivers/cpufreq/intel_pstate.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/cpufreq/intel_pstate.c +2 -0
@@ -824,6 +824,8 @@ static ssize_t store_energy_performance_preference( err =cpufreq_start_governor (policy);if (!ret) ret = err; + }else { + ret =0 ; } }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 52/431 thermal/drivers/qcom/tsens-v0_1: Add support for MSM8226
In reply to Greg Kroah-HartmanFrom: Matti Lehtimäki <[email protected]>
[ Upstream commit 598e1afca47fdbb302ce8d288b06bcc8728efc6c ]
The MSM8226 TSENS IP has 6 thermal sensors in a TSENS v0.1 block. The thermal sensors use non-standard slope values.
Stable-dep-of: 6812d1dfbca9 ("thermal/drivers/qcom/tsens-v0_1: Fix mdm9607 slope values")
--- drivers/thermal/qcom/tsens-v0_1.c | 27 ++++++++++++++++++++++++++- drivers/thermal/qcom/tsens.c | 3 +++ drivers/thermal/qcom/tsens.h | 2 +- 3 files changed, 30 insertions(+), 2 deletions(-)
drivers/thermal/qcom/tsens-v0_1.c +26 -1
@@ -243,6 +243,18 @@ static int calibrate_8974(struct tsens_priv *priv)return 0 ; } +static int __init init_8226 (struct tsens_priv *priv) +{ + priv->sensor[0 ].slope =2901 ; + priv->sensor[1 ].slope =2846 ; + priv->sensor[2 ].slope =3038 ; + priv->sensor[3 ].slope =2955 ; + priv->sensor[4 ].slope =2901 ; + priv->sensor[5 ].slope =2846 ; + +return init_common (priv); +} +static int __init init_8939 (struct tsens_priv *priv) { priv->sensor[0 ].slope =2911 ; priv->sensor[1 ].slope =2789 ;
@@ -258,7 +270,7 @@ static int __init init_8939(struct tsens_priv *priv) {return init_common (priv); } -/* v0.1: 8916, 8939, 8974, 9607 */ +/* v0.1: 8226, 8916, 8939, 8974, 9607 */ static struct tsens_features tsens_v0_1_feat = { .ver_major =VER_0_1 ,
@@ -313,6 +325,19 @@ static const struct tsens_ops ops_v0_1 = { .get_temp = get_temp_common, }; +static const struct tsens_ops ops_8226 = { + .init = init_8226, + .calibrate = tsens_calibrate_common, + .get_temp = get_temp_common, +}; + +struct tsens_plat_data data_8226 = { + .num_sensors =6 , + .ops = &ops_8226, + .feat = &tsens_v0_1_feat, + .fields = tsens_v0_1_regfields, +}; +static const struct tsens_ops ops_8916 = { .init = init_common, .calibrate = calibrate_8916,
drivers/thermal/qcom/tsens.c +3 -0
@@ -1095,6 +1095,9 @@ static const struct of_device_id tsens_table[] = { }, { .compatible = "qcom,mdm9607-tsens", .data = &data_9607, + }, { + .compatible = "qcom,msm8226-tsens", + .data = &data_8226, }, { .compatible = "qcom,msm8916-tsens", .data = &data_8916,
drivers/thermal/qcom/tsens.h +1 -1
@@ -635,7 +635,7 @@ int get_temp_common(const struct tsens_sensor *s, int *temp);extern struct tsens_plat_data data_8960;/* TSENS v0.1 targets */ -extern struct tsens_plat_data data_8916, data_8939, data_8974, data_9607; +extern struct tsens_plat_data data_8226, data_8916, data_8939, data_8974, data_9607;/* TSENS v1 targets */ extern struct tsens_plat_data data_tsens_v1, data_8976, data_8956;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 53/431 thermal/drivers/qcom/tsens-v0_1: Fix mdm9607 slope values
In reply to Greg Kroah-HartmanFrom: Stephan Gerhold <[email protected]>
[ Upstream commit 6812d1dfbca99cd5032683354bf50e0002b2aa02 ]
According to the msm-3.18 vendor kernel from Qualcomm [1], mdm9607 uses a non-standard slope value of 3000 (instead of 3200) for all sensors. Fill it properly similar to the 8939 code added recently.
--- drivers/thermal/qcom/tsens-v0_1.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
drivers/thermal/qcom/tsens-v0_1.c +17 -1
@@ -270,6 +270,16 @@ static int __init init_8939(struct tsens_priv *priv) {return init_common (priv); } +static int __init init_9607 (struct tsens_priv *priv) +{ +int i; + +for (i =0 ; i < priv->num_sensors; ++i) + priv->sensor[i].slope =3000 ; + +return init_common (priv); +} +/* v0.1: 8226, 8916, 8939, 8974, 9607 */ static struct tsens_features tsens_v0_1_feat = {
@@ -381,9 +391,15 @@ struct tsens_plat_data data_8974 = { .fields = tsens_v0_1_regfields, }; +static const struct tsens_ops ops_9607 = { + .init = init_9607, + .calibrate = tsens_calibrate_common, + .get_temp = get_temp_common, +}; +struct tsens_plat_data data_9607 = { .num_sensors =5 , - .ops = &ops_v0_1, + .ops = &ops_9607, .feat = &tsens_v0_1_feat, .fields = tsens_v0_1_regfields, };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 54/431 thermal/drivers/qcom/tsens-v0_1: Add mdm9607 correction offsets
In reply to Greg Kroah-HartmanFrom: Stephan Gerhold <[email protected]>
[ Upstream commit b6f739da0070c36655118618a173a59fa14c7adc ]
According to the msm-3.18 vendor kernel from Qualcomm, mdm9607 needs "correction factors" to adjust for additional offsets observed after the factory calibration values in the fuses [1, 2].
The fixed offsets should be applied unless there is a special calibration mode value that indicates that no offsets are needed [3].
Note that the new calibration mode values are called differently in this patch compared to the vendor kernel:
- TSENS_TWO_POINT_CALIB_N_WA -> ONE_PT_CALIB2_NO_OFFSET
- TSENS_TWO_POINT_CALIB_N_OFFSET_WA -> TWO_PT_CALIB_NO_OFFSET
This is because close inspection of the calibration function [3] reveals that TSENS_TWO_POINT_CALIB_N_WA is actually a "one point" calibration because the if statements skip all "point2" related code for it.
[1]: https://git.codelinaro.org/clo/la/kernel/msm-3.18/-/commit/d9d2db1b82bf3f72f5de0803d55e6849eb5b671e
[2]: https://git.codelinaro.org/clo/la/kernel/msm-3.18/-/commit/d75aef53a760e8ff7bac54049d00c8b2ee1b193e
[3]: https://git.codelinaro.org/clo/la/kernel/msm-3.18/-/blob/LE.UM.4.3.2.r1-04200-9x07/drivers/thermal/msm-tsens.c#L2987-3136
--- drivers/thermal/qcom/tsens-v0_1.c | 11 +++++++++++ drivers/thermal/qcom/tsens.c | 16 +++++++++++++++- drivers/thermal/qcom/tsens.h | 4 ++++ 3 files changed, 30 insertions(+), 1 deletion(-)
drivers/thermal/qcom/tsens-v0_1.c +11 -0
@@ -277,6 +277,17 @@ static int __init init_9607(struct tsens_priv *priv)for (i =0 ; i < priv->num_sensors; ++i) priv->sensor[i].slope =3000 ; + priv->sensor[0 ].p1_calib_offset =1 ; + priv->sensor[0 ].p2_calib_offset =1 ; + priv->sensor[1 ].p1_calib_offset =-4 ; + priv->sensor[1 ].p2_calib_offset =-2 ; + priv->sensor[2 ].p1_calib_offset =4 ; + priv->sensor[2 ].p2_calib_offset =8 ; + priv->sensor[3 ].p1_calib_offset =-3 ; + priv->sensor[3 ].p2_calib_offset =-5 ; + priv->sensor[4 ].p1_calib_offset =-4 ; + priv->sensor[4 ].p2_calib_offset =-4 ; +return init_common (priv); }
drivers/thermal/qcom/tsens.c +15 -1
@@ -134,10 +134,12 @@ int tsens_read_calibration(struct tsens_priv *priv, int shift, u32 *p1, u32 *p2, p1[i] = p1[i] + (base1 << shift);break ;case TWO_PT_CALIB : +case TWO_PT_CALIB_NO_OFFSET :for (i =0 ; i < priv->num_sensors; i++) p2[i] = (p2[i] + base2) << shift; fallthrough;case ONE_PT_CALIB2 : +case ONE_PT_CALIB2_NO_OFFSET :for (i =0 ; i < priv->num_sensors; i++) p1[i] = (p1[i] + base1) << shift;break ;
@@ -149,6 +151,18 @@ int tsens_read_calibration(struct tsens_priv *priv, int shift, u32 *p1, u32 *p2, } } +/* Apply calibration offset workaround except for _NO_OFFSET modes */ +switch (mode) { +case TWO_PT_CALIB : +for (i =0 ; i < priv->num_sensors; i++) + p2[i] += priv->sensor[i].p2_calib_offset; + fallthrough; +case ONE_PT_CALIB2 : +for (i =0 ; i < priv->num_sensors; i++) + p1[i] += priv->sensor[i].p1_calib_offset; +break ; + } +return mode; }
@@ -254,7 +268,7 @@ void compute_intercept_slope(struct tsens_priv *priv, u32 *p1,if (!priv->sensor[i].slope) priv->sensor[i].slope =SLOPE_DEFAULT ; -if (mode ==TWO_PT_CALIB ) { +if (mode ==TWO_PT_CALIB || mode ==TWO_PT_CALIB_NO_OFFSET ) {/* * slope (m) = adc_code2 - adc_code1 (y2 - y1)/ * temp_120_degc - temp_30_degc (x2 - x1)
drivers/thermal/qcom/tsens.h +4 -0
@@ -10,6 +10,8 @@#define ONE_PT_CALIB 0x1#define ONE_PT_CALIB2 0x2#define TWO_PT_CALIB 0x3 +#define ONE_PT_CALIB2_NO_OFFSET 0x6 +#define TWO_PT_CALIB_NO_OFFSET 0x7#define CAL_DEGC_PT1 30#define CAL_DEGC_PT2 120#define SLOPE_FACTOR 1000
@@ -57,6 +59,8 @@ struct tsens_sensor {unsigned int hw_id;int slope;u32 status; +int p1_calib_offset; +int p2_calib_offset; };/**
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 55/431 thermal/drivers/sun8i: Fix some error handling paths in sun8i_ths_probe()
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit 89382022b370dfd34eaae9c863baa123fcd4d132 ]
Should an error occur after calling sun8i_ths_resource_init() in the probe function, some resources need to be released, as already done in the .remove() function.
Switch to the devm_clk_get_enabled() helper and add a new devm_action to turn sun8i_ths_resource_init() into a fully managed function.
Move the place where reset_control_deassert() is called so that the recommended order of reset release/clock enable steps is kept. A64 manual states that:
3.3.6.4. Gating and reset Make sure that the reset signal has been released before the release of module clock gating;
This fixes the issue and removes some LoC at the same time.
--- drivers/thermal/sun8i_thermal.c | 55 +++++++++++---------------------- 1 file changed, 18 insertions(+), 37 deletions(-)
drivers/thermal/sun8i_thermal.c +18 -37
@@ -319,6 +319,11 @@ static int sun8i_ths_calibrate(struct ths_device *tmdev)return ret; } +static void sun8i_ths_reset_control_assert (void *data) +{ +reset_control_assert (data); +} +static int sun8i_ths_resource_init (struct ths_device *tmdev) {struct device *dev = tmdev->dev;
@@ -339,47 +344,35 @@ static int sun8i_ths_resource_init(struct ths_device *tmdev)if (IS_ERR (tmdev->reset))return PTR_ERR (tmdev->reset); - tmdev->bus_clk =devm_clk_get (&pdev->dev,"bus" ); + ret =reset_control_deassert (tmdev->reset); +if (ret) +return ret; + + ret =devm_add_action_or_reset (dev, sun8i_ths_reset_control_assert, + tmdev->reset); +if (ret) +return ret; + + tmdev->bus_clk =devm_clk_get_enabled (&pdev->dev,"bus" );if (IS_ERR (tmdev->bus_clk))return PTR_ERR (tmdev->bus_clk); }if (tmdev->chip->has_mod_clk) { - tmdev->mod_clk =devm_clk_get (&pdev->dev,"mod" ); + tmdev->mod_clk =devm_clk_get_enabled (&pdev->dev,"mod" );if (IS_ERR (tmdev->mod_clk))return PTR_ERR (tmdev->mod_clk); } - ret =reset_control_deassert (tmdev->reset); -if (ret) -return ret; - - ret =clk_prepare_enable (tmdev->bus_clk); -if (ret) - goto assert_reset; - ret =clk_set_rate (tmdev->mod_clk,24000000 );if (ret) - goto bus_disable; - - ret =clk_prepare_enable (tmdev->mod_clk); -if (ret) - goto bus_disable; +return ret; ret =sun8i_ths_calibrate (tmdev);if (ret) - goto mod_disable; +return ret;return 0 ; - -mod_disable: -clk_disable_unprepare (tmdev->mod_clk); -bus_disable: -clk_disable_unprepare (tmdev->bus_clk); -assert_reset: -reset_control_assert (tmdev->reset); - -return ret; }static int sun8i_h3_thermal_init (struct ths_device *tmdev)
@@ -530,17 +523,6 @@ static int sun8i_ths_probe(struct platform_device *pdev)return 0 ; } -static int sun8i_ths_remove (struct platform_device *pdev) -{ -struct ths_device *tmdev =platform_get_drvdata (pdev); - -clk_disable_unprepare (tmdev->mod_clk); -clk_disable_unprepare (tmdev->bus_clk); -reset_control_assert (tmdev->reset); - -return 0 ; -} -static const struct ths_thermal_chip sun8i_a83t_ths = { .sensor_num =3 , .scale =705 ,
@@ -642,7 +624,6 @@ MODULE_DEVICE_TABLE(of, of_ths_match);static struct platform_driver ths_driver = { .probe = sun8i_ths_probe, - .remove = sun8i_ths_remove, .driver = { .name ="sun8i-thermal" , .of_match_table = of_ths_match,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 56/431 thermal/hwmon: Use the right device for devm_thermal_add_hwmon_sysfs()
In reply to Greg Kroah-HartmanFrom: Daniel Lezcano <[email protected]>
[ Upstream commit 4a16c190f761cb3a87dcbbf355f91c71ce1f8c0b ]
The devres variant of thermal_add_hwmon_sysfs() only takes the thermal zone structure pointer as parameter.
Actually, it uses the tz->device to add it in the devres list.
It is preferable to use the device registering the thermal zone instead of the thermal zone device itself. That prevents the driver accessing the thermal zone structure internals and it is from my POV more correct regarding how devm_ is used.
Stable-dep-of: 9301575df250 ("thermal/drivers/qoriq: Only enable supported sensors")
--- drivers/thermal/amlogic_thermal.c | 2 +- drivers/thermal/imx8mm_thermal.c | 2 +- drivers/thermal/imx_sc_thermal.c | 2 +- drivers/thermal/k3_bandgap.c | 2 +- drivers/thermal/mediatek/auxadc_thermal.c | 2 +- drivers/thermal/qcom/qcom-spmi-adc-tm5.c | 2 +- drivers/thermal/qcom/qcom-spmi-temp-alarm.c | 2 +- drivers/thermal/qcom/tsens.c | 2 +- drivers/thermal/qoriq_thermal.c | 2 +- drivers/thermal/sun8i_thermal.c | 2 +- drivers/thermal/tegra/tegra30-tsensor.c | 2 +- drivers/thermal/thermal_hwmon.c | 4 ++-- drivers/thermal/thermal_hwmon.h | 4 ++-- drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 2 +- 14 files changed, 16 insertions(+), 16 deletions(-)
drivers/thermal/amlogic_thermal.c +1 -1
@@ -285,7 +285,7 @@ static int amlogic_thermal_probe(struct platform_device *pdev)return ret; } -if (devm_thermal_add_hwmon_sysfs (pdata->tzd)) +if (devm_thermal_add_hwmon_sysfs (&pdev->dev, pdata->tzd))dev_warn (&pdev->dev,"Failed to add hwmon sysfs attributes\n" ); ret =amlogic_thermal_initialize (pdata);
drivers/thermal/imx8mm_thermal.c +1 -1
@@ -343,7 +343,7 @@ static int imx8mm_tmu_probe(struct platform_device *pdev) } tmu->sensors[i].hw_id = i; -if (devm_thermal_add_hwmon_sysfs (tmu->sensors[i].tzd)) +if (devm_thermal_add_hwmon_sysfs (&pdev->dev, tmu->sensors[i].tzd))dev_warn (&pdev->dev,"failed to add hwmon sysfs attributes\n" ); }
drivers/thermal/imx_sc_thermal.c +1 -1
@@ -119,7 +119,7 @@ static int imx_sc_thermal_probe(struct platform_device *pdev)return ret; } -if (devm_thermal_add_hwmon_sysfs (sensor->tzd)) +if (devm_thermal_add_hwmon_sysfs (&pdev->dev, sensor->tzd))dev_warn (&pdev->dev,"failed to add hwmon sysfs attributes\n" ); }
drivers/thermal/k3_bandgap.c +1 -1
@@ -222,7 +222,7 @@ static int k3_bandgap_probe(struct platform_device *pdev) goto err_alloc; } -if (devm_thermal_add_hwmon_sysfs (data[id].tzd)) +if (devm_thermal_add_hwmon_sysfs (dev, data[id].tzd))dev_warn (dev,"Failed to add hwmon sysfs attributes\n" ); }
drivers/thermal/mediatek/auxadc_thermal.c +1 -1
@@ -1210,7 +1210,7 @@ static int mtk_thermal_probe(struct platform_device *pdev) goto err_disable_clk_peri_therm; } - ret =devm_thermal_add_hwmon_sysfs (tzdev); + ret =devm_thermal_add_hwmon_sysfs (&pdev->dev, tzdev);if (ret)dev_warn (&pdev->dev,"error in thermal_add_hwmon_sysfs" );
drivers/thermal/qcom/qcom-spmi-adc-tm5.c +1 -1
@@ -689,7 +689,7 @@ static int adc_tm5_register_tzd(struct adc_tm5_chip *adc_tm)return PTR_ERR (tzd); } adc_tm->channels[i].tzd = tzd; -if (devm_thermal_add_hwmon_sysfs (tzd)) +if (devm_thermal_add_hwmon_sysfs (adc_tm->dev, tzd))dev_warn (adc_tm->dev,"Failed to add hwmon sysfs attributes\n" ); }
drivers/thermal/qcom/qcom-spmi-temp-alarm.c +1 -1
@@ -459,7 +459,7 @@ static int qpnp_tm_probe(struct platform_device *pdev)return ret; } -if (devm_thermal_add_hwmon_sysfs (chip->tz_dev)) +if (devm_thermal_add_hwmon_sysfs (&pdev->dev, chip->tz_dev))dev_warn (&pdev->dev,"Failed to add hwmon sysfs attributes\n" );
drivers/thermal/qcom/tsens.c +1 -1
@@ -1206,7 +1206,7 @@ static int tsens_register(struct tsens_priv *priv)if (priv->ops->enable) priv->ops->enable (priv, i); -if (devm_thermal_add_hwmon_sysfs (tzd)) +if (devm_thermal_add_hwmon_sysfs (priv->dev, tzd))dev_warn (priv->dev,"Failed to add hwmon sysfs attributes\n" ); }
drivers/thermal/qoriq_thermal.c +1 -1
@@ -157,7 +157,7 @@ static int qoriq_tmu_register_tmu_zone(struct device *dev,return ret; } -if (devm_thermal_add_hwmon_sysfs (tzd)) +if (devm_thermal_add_hwmon_sysfs (dev, tzd))dev_warn (dev,"Failed to add hwmon sysfs attributes\n" );
drivers/thermal/sun8i_thermal.c +1 -1
@@ -468,7 +468,7 @@ static int sun8i_ths_register(struct ths_device *tmdev)if (IS_ERR (tmdev->sensor[i].tzd))return PTR_ERR (tmdev->sensor[i].tzd); -if (devm_thermal_add_hwmon_sysfs (tmdev->sensor[i].tzd)) +if (devm_thermal_add_hwmon_sysfs (tmdev->dev, tmdev->sensor[i].tzd))dev_warn (tmdev->dev,"Failed to add hwmon sysfs attributes\n" ); }
drivers/thermal/tegra/tegra30-tsensor.c +1 -1
@@ -528,7 +528,7 @@ static int tegra_tsensor_register_channel(struct tegra_tsensor *ts,return 0 ; } -if (devm_thermal_add_hwmon_sysfs (tsc->tzd)) +if (devm_thermal_add_hwmon_sysfs (ts->dev, tsc->tzd))dev_warn (ts->dev,"failed to add hwmon sysfs attributes\n" );return 0 ;
drivers/thermal/thermal_hwmon.c +2 -2
@@ -263,7 +263,7 @@ static void devm_thermal_hwmon_release(struct device *dev, void *res)thermal_remove_hwmon_sysfs (*(struct thermal_zone_device **)res); } -int devm_thermal_add_hwmon_sysfs (struct thermal_zone_device *tz) +int devm_thermal_add_hwmon_sysfs (struct device *dev,struct thermal_zone_device *tz) {struct thermal_zone_device **ptr;int ret;
@@ -280,7 +280,7 @@ int devm_thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) } *ptr = tz; -devres_add (&tz->device, ptr); +devres_add (dev, ptr);return ret; }
drivers/thermal/thermal_hwmon.h +2 -2
@@ -17,7 +17,7 @@#ifdef CONFIG_THERMAL_HWMON int thermal_add_hwmon_sysfs (struct thermal_zone_device *tz); -int devm_thermal_add_hwmon_sysfs (struct thermal_zone_device *tz); +int devm_thermal_add_hwmon_sysfs (struct device *dev,struct thermal_zone_device *tz);void thermal_remove_hwmon_sysfs (struct thermal_zone_device *tz);#else static inline int
@@ -27,7 +27,7 @@ thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) }static inline int -devm_thermal_add_hwmon_sysfs (struct thermal_zone_device *tz) +devm_thermal_add_hwmon_sysfs (struct device *dev,struct thermal_zone_device *tz) {return 0 ; }
drivers/thermal/ti-soc-thermal/ti-thermal-common.c +1 -1
@@ -182,7 +182,7 @@ int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id,ti_bandgap_set_sensor_data (bgp, id, data);ti_bandgap_write_update_interval (bgp, data->sensor_id, interval); -if (devm_thermal_add_hwmon_sysfs (data->ti_thermal)) +if (devm_thermal_add_hwmon_sysfs (bgp->dev, data->ti_thermal))dev_warn (bgp->dev,"failed to add hwmon sysfs attributes\n" );return 0 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 57/431 thermal/drivers/qoriq: Only enable supported sensors
In reply to Greg Kroah-HartmanFrom: Peng Fan <[email protected]>
[ Upstream commit 9301575df2509ecf8bd66f601046afaff606b1d5 ]
There are MAX 16 sensors, but not all of them supported. Such as i.MX8MQ, there are only 3 sensors. Enabling all 16 sensors will touch reserved bits from i.MX8MQ reference mannual, and TMU will stuck, temperature will not update anymore.
--- drivers/thermal/qoriq_thermal.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-)
drivers/thermal/qoriq_thermal.c +19 -11
@@ -31,7 +31,6 @@#define TMR_DISABLE 0x0#define TMR_ME 0x80000000#define TMR_ALPF 0x0c000000 -#define TMR_MSITE_ALL GENMASK(15, 0)#define REGS_TMTMIR 0x008/* Temperature measurement interval Register */ #define TMTMIR_DEFAULT 0x0000000f
@@ -105,6 +104,11 @@ static int tmu_get_temp(struct thermal_zone_device *tz, int *temp)* within sensor range. TEMP is an 9 bit value representing * temperature in KelVin. */ + +regmap_read (qdata->regmap,REGS_TMR , &val); +if (!(val &TMR_ME )) +return -EAGAIN ; + if (regmap_read_poll_timeout(qdata->regmap, REGS_TRITSR(qsensor->id), val,
@@ -128,15 +132,7 @@ static const struct thermal_zone_device_ops tmu_tz_ops = {static int qoriq_tmu_register_tmu_zone (struct device *dev,struct qoriq_tmu_data *qdata) { -int id; - -if (qdata->ver ==TMU_VER1 ) { -regmap_write (qdata->regmap,REGS_TMR , -TMR_MSITE_ALL |TMR_ME |TMR_ALPF ); - }else { -regmap_write (qdata->regmap,REGS_V2_TMSR ,TMR_MSITE_ALL ); -regmap_write (qdata->regmap,REGS_TMR ,TMR_ME |TMR_ALPF_V2 ); - } +int id, sites =0 ;for (id =0 ; id <SITES_MAX ; id++) {struct thermal_zone_device *tzd;
@@ -153,14 +149,26 @@ static int qoriq_tmu_register_tmu_zone(struct device *dev,if (ret == -ENODEV )continue ; -regmap_write (qdata->regmap,REGS_TMR ,TMR_DISABLE );return ret; } +if (qdata->ver ==TMU_VER1 ) + sites |=0x1 << (15 - id); +else + sites |=0x1 << id; +if (devm_thermal_add_hwmon_sysfs (dev, tzd))dev_warn (dev,"Failed to add hwmon sysfs attributes\n" ); + } +if (sites) { +if (qdata->ver ==TMU_VER1 ) { +regmap_write (qdata->regmap,REGS_TMR ,TMR_ME |TMR_ALPF | sites); + }else { +regmap_write (qdata->regmap,REGS_V2_TMSR , sites); +regmap_write (qdata->regmap,REGS_TMR ,TMR_ME |TMR_ALPF_V2 ); + } }return 0 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 58/431 rcu: Make rcu_cpu_starting() rely on interrupts being disabled
In reply to Greg Kroah-HartmanFrom: Paul E. McKenney <[email protected]>
[ Upstream commit 15d44dfa40305da1648de4bf001e91cc63148725 ]
Currently, rcu_cpu_starting() is written so that it might be invoked with interrupts enabled. However, it is always called when interrupts are disabled, either by rcu_init(), notify_cpu_starting(), or from a call point prior to the call to notify_cpu_starting().
But why bother requiring that interrupts be disabled? The purpose is to allow the rcu_data structure's ->beenonline flag to be set after all early processing has completed for the incoming CPU, thus allowing this flag to be used to determine when workqueues have been set up for the incoming CPU, while still allowing this flag to be used as a diagnostic within rcu_core().
This commit therefore makes rcu_cpu_starting() rely on interrupts being disabled.
Stable-dep-of: 401b0de3ae4f ("rcu-tasks: Stop rcu_tasks_invoke_cbs() from using never-onlined CPUs")
--- kernel/rcu/tree.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
kernel/rcu/tree.c +5 -6
@@ -4364,15 +4364,16 @@ int rcutree_offline_cpu(unsigned int cpu)* Note that this function is special in that it is invoked directly * from the incoming CPU rather than from the cpuhp_step mechanism. * This is because this function must be invoked at a precise location. +* This incoming CPU must not have enabled interrupts yet. */ void rcu_cpu_starting (unsigned int cpu) { -unsigned long flags;unsigned long mask;struct rcu_data *rdp;struct rcu_node *rnp;bool newcpu; +lockdep_assert_irqs_disabled (); rdp =per_cpu_ptr (&rcu_data, cpu);if (rdp->cpu_started)return ;
@@ -4380,7 +4381,6 @@ void rcu_cpu_starting(unsigned int cpu) rnp = rdp->mynode; mask = rdp->grpmask; -local_irq_save (flags);arch_spin_lock (&rcu_state.ofl_lock);rcu_dynticks_eqs_online ();raw_spin_lock (&rcu_state.barrier_lock);
@@ -4399,17 +4399,16 @@ void rcu_cpu_starting(unsigned int cpu)/* An incoming CPU should never be blocking a grace period. */ if (WARN_ON_ONCE (rnp->qsmask & mask)) {/* RCU waiting on incoming CPU? */ /* rcu_report_qs_rnp() *really* wants some flags to restore */ -unsigned long flags2; +unsigned long flags; -local_irq_save (flags2); +local_irq_save (flags);rcu_disable_urgency_upon_qs (rdp);/* Report QS -after- changing ->qsmaskinitnext! */ -rcu_report_qs_rnp (mask, rnp, rnp->gp_seq, flags2); +rcu_report_qs_rnp (mask, rnp, rnp->gp_seq, flags); }else {raw_spin_unlock_rcu_node (rnp); }arch_spin_unlock (&rcu_state.ofl_lock); -local_irq_restore (flags);smp_mb ();/* Ensure RCU read-side usage follows above initialization. */ }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 59/431 rcu-tasks: Stop rcu_tasks_invoke_cbs() from using never-onlined CPUs
In reply to Greg Kroah-HartmanFrom: Paul E. McKenney <[email protected]>
[ Upstream commit 401b0de3ae4fa49d1014c8941e26d9a25f37e7cf ]
The rcu_tasks_invoke_cbs() function relies on queue_work_on() to silently fall back to WORK_CPU_UNBOUND when the specified CPU is offline. However, the queue_work_on() function's silent fallback mechanism relies on that CPU having been online at some time in the past. When queue_work_on() is passed a CPU that has never been online, workqueue lockups ensue, which can be bad for your kernel's general health and well-being.
This commit therefore checks whether a given CPU has ever been online, and, if not substitutes WORK_CPU_UNBOUND in the subsequent call to queue_work_on(). Why not simply omit the queue_work_on() call entirely? Because this function is flooding callback-invocation notifications to all CPUs, and must deal with possibilities that include a sparse cpu_possible_mask.
This commit also moves the setting of the rcu_data structure's ->beenonline field to rcu_cpu_starting(), which executes on the incoming CPU before that CPU has ever enabled interrupts. This ensures that the required workqueues are present. In addition, because the incoming CPU has not yet enabled its interrupts, there cannot yet have been any softirq handlers running on this CPU, which means that the WARN_ON_ONCE(!rdp->beenonline) within the RCU_SOFTIRQ handler cannot have triggered yet.
--- kernel/rcu/rcu.h | 6 ++++++ kernel/rcu/tasks.h | 7 +++++-- kernel/rcu/tree.c | 12 +++++++++++- 3 files changed, 22 insertions(+), 3 deletions(-)
kernel/rcu/rcu.h +6 -0
@@ -603,4 +603,10 @@ void show_rcu_tasks_trace_gp_kthread(void);static inline void show_rcu_tasks_trace_gp_kthread (void ) {}#endif +#ifdef CONFIG_TINY_RCU +static inline bool rcu_cpu_beenfullyonline (int cpu) {return true; } +#else +bool rcu_cpu_beenfullyonline (int cpu); +#endif +#endif /* __LINUX_RCU_H */
kernel/rcu/tasks.h +5 -2
@@ -455,6 +455,7 @@ static void rcu_tasks_invoke_cbs(struct rcu_tasks *rtp, struct rcu_tasks_percpu {int cpu;int cpunext; +int cpuwq;unsigned long flags;int len;struct rcu_head *rhp;
@@ -465,11 +466,13 @@ static void rcu_tasks_invoke_cbs(struct rcu_tasks *rtp, struct rcu_tasks_percpu cpunext = cpu *2 +1 ;if (cpunext <smp_load_acquire (&rtp->percpu_dequeue_lim)) { rtpcp_next =per_cpu_ptr (rtp->rtpcpu, cpunext); -queue_work_on (cpunext, system_wq, &rtpcp_next->rtp_work); + cpuwq =rcu_cpu_beenfullyonline (cpunext) ? cpunext :WORK_CPU_UNBOUND ; +queue_work_on (cpuwq, system_wq, &rtpcp_next->rtp_work); cpunext++;if (cpunext <smp_load_acquire (&rtp->percpu_dequeue_lim)) { rtpcp_next =per_cpu_ptr (rtp->rtpcpu, cpunext); -queue_work_on (cpunext, system_wq, &rtpcp_next->rtp_work); + cpuwq =rcu_cpu_beenfullyonline (cpunext) ? cpunext :WORK_CPU_UNBOUND ; +queue_work_on (cpuwq, system_wq, &rtpcp_next->rtp_work); } }
kernel/rcu/tree.c +11 -1
@@ -4279,7 +4279,6 @@ int rcutree_prepare_cpu(unsigned int cpu)*/ rnp = rdp->mynode;raw_spin_lock_rcu_node (rnp);/* irqs already disabled. */ - rdp->beenonline = true;/* We have now been online. */ rdp->gp_seq =READ_ONCE (rnp->gp_seq); rdp->gp_seq_needed = rdp->gp_seq; rdp->cpu_no_qs.b.norm = true;
@@ -4306,6 +4305,16 @@ static void rcutree_affinity_setting(unsigned int cpu, int outgoing)rcu_boost_kthread_setaffinity (rdp->mynode, outgoing); } +/* +* Has the specified (known valid) CPU ever been fully online? +*/ +bool rcu_cpu_beenfullyonline (int cpu) +{ +struct rcu_data *rdp =per_cpu_ptr (&rcu_data, cpu); + +return smp_load_acquire (&rdp->beenonline); +} +/* * Near the end of the CPU-online process. Pretty much all services * enabled, and the CPU is now very much alive.
@@ -4409,6 +4418,7 @@ void rcu_cpu_starting(unsigned int cpu)raw_spin_unlock_rcu_node (rnp); }arch_spin_unlock (&rcu_state.ofl_lock); +smp_store_release (&rdp->beenonline, true);smp_mb ();/* Ensure RCU read-side usage follows above initialization. */ }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 60/431 rcutorture: Correct name of use_softirq module parameter
In reply to Greg Kroah-HartmanFrom: Paul E. McKenney <[email protected]>
[ Upstream commit b409afe0268faeb77267f028ea85f2d93438fced ]
The BUSTED-BOOST and TREE03 scenarios specify a mythical tree.use_softirq module parameter, which means a failure to get full test coverage. This commit therefore corrects the name to rcutree.use_softirq.
--- .../testing/selftests/rcutorture/configs/rcu/BUSTED-BOOST.boot | 2 +- tools/testing/selftests/rcutorture/configs/rcu/TREE03.boot | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/rcutorture/configs/rcu/BUSTED-BOOST.boot +1 -1
@@ -5,4 +5,4 @@ rcutree.gp_init_delay=3 rcutree.gp_cleanup_delay=3 rcutree.kthread_prio=2 threadirqs -tree.use_softirq=0 +rcutree.use_softirq=0
tools/testing/selftests/rcutorture/configs/rcu/TREE03.boot +1 -1
@@ -4,4 +4,4 @@ rcutree.gp_init_delay=3 rcutree.gp_cleanup_delay=3 rcutree.kthread_prio=2 threadirqs -tree.use_softirq=0 +rcutree.use_softirq=0
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 61/431 rcuscale: Move shutdown from wait_event() to wait_event_idle()
In reply to Greg Kroah-HartmanFrom: Paul E. McKenney <[email protected]>
[ Upstream commit ef1ef3d47677dc191b88650a9f7f91413452cc1b ]
The rcu_scale_shutdown() and kfree_scale_shutdown() kthreads/functions use wait_event() to wait for the rcuscale test to complete. However, each updater thread in such a test waits for at least 100 grace periods. If each grace period takes more than 1.2 seconds, which is long, but not insanely so, this can trigger the hung-task timeout.
This commit therefore replaces those wait_event() calls with calls to wait_event_idle(), which do not trigger the hung-task timeout.
Stable-dep-of: 23fc8df26dea ("rcu/rcuscale: Stop kfree_scale_thread thread(s) after unloading rcuscale")
--- kernel/rcu/rcuscale.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
kernel/rcu/rcuscale.c +3 -4
@@ -631,8 +631,7 @@ static int compute_real(int n)static int rcu_scale_shutdown (void *arg) { -wait_event (shutdown_wq, -atomic_read (&n_rcu_scale_writer_finished) >= nrealwriters); +wait_event_idle (shutdown_wq,atomic_read (&n_rcu_scale_writer_finished) >= nrealwriters);smp_mb ();/* Wake before output. */ rcu_scale_cleanup ();kernel_power_off ();
@@ -771,8 +770,8 @@ kfree_scale_cleanup(void)static int kfree_scale_shutdown (void *arg) { -wait_event (shutdown_wq, -atomic_read (&n_kfree_scale_thread_ended) >= kfree_nrealthreads); +wait_event_idle (shutdown_wq, +atomic_read (&n_kfree_scale_thread_ended) >= kfree_nrealthreads);smp_mb ();/* Wake before output. */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 62/431 rcu/rcuscale: Move rcu_scale_*() after kfree_scale_cleanup()
In reply to Greg Kroah-HartmanFrom: Qiuxu Zhuo <[email protected]>
[ Upstream commit bf5ddd736509a7d9077c0b6793e6f0852214dbea ]
This code-movement-only commit moves the rcu_scale_cleanup() and rcu_scale_shutdown() functions to follow kfree_scale_cleanup(). This is code movement is in preparation for a bug-fix patch that invokes kfree_scale_cleanup() from rcu_scale_cleanup().
Stable-dep-of: 23fc8df26dea ("rcu/rcuscale: Stop kfree_scale_thread thread(s) after unloading rcuscale")
--- kernel/rcu/rcuscale.c | 194 +++++++++++++++++++++--------------------- 1 file changed, 97 insertions(+), 97 deletions(-)
kernel/rcu/rcuscale.c +97 -97
@@ -522,89 +522,6 @@ rcu_scale_print_module_parms(struct rcu_scale_ops *cur_ops, const char *tag) scale_type, tag, nrealreaders, nrealwriters, verbose, shutdown); } -static void -rcu_scale_cleanup (void ) -{ -int i; -int j; -int ngps =0 ; -u64 *wdp; -u64 *wdpp; - -/* -* Would like warning at start, but everything is expedited -* during the mid-boot phase, so have to wait till the end. -*/ -if (rcu_gp_is_expedited () && !rcu_gp_is_normal () && !gp_exp) -SCALEOUT_ERRSTRING ("All grace periods expedited, no normal ones to measure!" ); -if (rcu_gp_is_normal () && gp_exp) -SCALEOUT_ERRSTRING ("All grace periods normal, no expedited ones to measure!" ); -if (gp_exp && gp_async) -SCALEOUT_ERRSTRING ("No expedited async GPs, so went with async!" ); - -if (torture_cleanup_begin ()) -return ; -if (!cur_ops) { -torture_cleanup_end (); -return ; - } - -if (reader_tasks) { -for (i =0 ; i < nrealreaders; i++) -torture_stop_kthread (rcu_scale_reader, - reader_tasks[i]); -kfree (reader_tasks); - } - -if (writer_tasks) { -for (i =0 ; i < nrealwriters; i++) { -torture_stop_kthread (rcu_scale_writer, - writer_tasks[i]); -if (!writer_n_durations) -continue ; - j = writer_n_durations[i]; -pr_alert ("%s%s writer %d gps: %d\n" , - scale_type,SCALE_FLAG , i, j); - ngps += j; - } -pr_alert ("%s%s start: %llu end: %llu duration: %llu gps: %d batches: %ld\n" , - scale_type,SCALE_FLAG , - t_rcu_scale_writer_started, t_rcu_scale_writer_finished, - t_rcu_scale_writer_finished - - t_rcu_scale_writer_started, - ngps, -rcuscale_seq_diff (b_rcu_gp_test_finished, - b_rcu_gp_test_started)); -for (i =0 ; i < nrealwriters; i++) { -if (!writer_durations) -break ; -if (!writer_n_durations) -continue ; - wdpp = writer_durations[i]; -if (!wdpp) -continue ; -for (j =0 ; j < writer_n_durations[i]; j++) { - wdp = &wdpp[j]; -pr_alert ("%s%s %4d writer-duration: %5d %llu\n" , - scale_type,SCALE_FLAG , - i, j, *wdp); -if (j %100 ==0 ) -schedule_timeout_uninterruptible (1 ); - } -kfree (writer_durations[i]); - } -kfree (writer_tasks); -kfree (writer_durations); -kfree (writer_n_durations); - } - -/* Do torture-type-specific cleanup operations. */ -if (cur_ops->cleanup !=NULL ) - cur_ops->cleanup (); - -torture_cleanup_end (); -} -/* * Return the number if non-negative. If -1, the number of CPUs. * If less than -1, that much less than the number of CPUs, but
@@ -624,20 +541,6 @@ static int compute_real(int n)return nr; } -/* -* RCU scalability shutdown kthread. Just waits to be awakened, then shuts -* down system. -*/ -static int -rcu_scale_shutdown (void *arg) -{ -wait_event_idle (shutdown_wq,atomic_read (&n_rcu_scale_writer_finished) >= nrealwriters); -smp_mb ();/* Wake before output. */ -rcu_scale_cleanup (); -kernel_power_off (); -return -EINVAL ; -} -/* * kfree_rcu() scalability tests: Start a kfree_rcu() loop on all CPUs for number * of iterations and measure total time and number of GP for all iterations to complete.
@@ -874,6 +777,103 @@ kfree_scale_init(void)return firsterr; } +static void +rcu_scale_cleanup (void ) +{ +int i; +int j; +int ngps =0 ; +u64 *wdp; +u64 *wdpp; + +/* +* Would like warning at start, but everything is expedited +* during the mid-boot phase, so have to wait till the end. +*/ +if (rcu_gp_is_expedited () && !rcu_gp_is_normal () && !gp_exp) +SCALEOUT_ERRSTRING ("All grace periods expedited, no normal ones to measure!" ); +if (rcu_gp_is_normal () && gp_exp) +SCALEOUT_ERRSTRING ("All grace periods normal, no expedited ones to measure!" ); +if (gp_exp && gp_async) +SCALEOUT_ERRSTRING ("No expedited async GPs, so went with async!" ); + +if (torture_cleanup_begin ()) +return ; +if (!cur_ops) { +torture_cleanup_end (); +return ; + } + +if (reader_tasks) { +for (i =0 ; i < nrealreaders; i++) +torture_stop_kthread (rcu_scale_reader, + reader_tasks[i]); +kfree (reader_tasks); + } + +if (writer_tasks) { +for (i =0 ; i < nrealwriters; i++) { +torture_stop_kthread (rcu_scale_writer, + writer_tasks[i]); +if (!writer_n_durations) +continue ; + j = writer_n_durations[i]; +pr_alert ("%s%s writer %d gps: %d\n" , + scale_type,SCALE_FLAG , i, j); + ngps += j; + } +pr_alert ("%s%s start: %llu end: %llu duration: %llu gps: %d batches: %ld\n" , + scale_type,SCALE_FLAG , + t_rcu_scale_writer_started, t_rcu_scale_writer_finished, + t_rcu_scale_writer_finished - + t_rcu_scale_writer_started, + ngps, +rcuscale_seq_diff (b_rcu_gp_test_finished, + b_rcu_gp_test_started)); +for (i =0 ; i < nrealwriters; i++) { +if (!writer_durations) +break ; +if (!writer_n_durations) +continue ; + wdpp = writer_durations[i]; +if (!wdpp) +continue ; +for (j =0 ; j < writer_n_durations[i]; j++) { + wdp = &wdpp[j]; +pr_alert ("%s%s %4d writer-duration: %5d %llu\n" , + scale_type,SCALE_FLAG , + i, j, *wdp); +if (j %100 ==0 ) +schedule_timeout_uninterruptible (1 ); + } +kfree (writer_durations[i]); + } +kfree (writer_tasks); +kfree (writer_durations); +kfree (writer_n_durations); + } + +/* Do torture-type-specific cleanup operations. */ +if (cur_ops->cleanup !=NULL ) + cur_ops->cleanup (); + +torture_cleanup_end (); +} + +/* +* RCU scalability shutdown kthread. Just waits to be awakened, then shuts +* down system. +*/ +static int +rcu_scale_shutdown (void *arg) +{ +wait_event_idle (shutdown_wq,atomic_read (&n_rcu_scale_writer_finished) >= nrealwriters); +smp_mb ();/* Wake before output. */ +rcu_scale_cleanup (); +kernel_power_off (); +return -EINVAL ; +} +static int __init rcu_scale_init (void ) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 63/431 rcu/rcuscale: Stop kfree_scale_thread thread(s) after unloading rcuscale
In reply to Greg Kroah-HartmanFrom: Qiuxu Zhuo <[email protected]>
[ Upstream commit 23fc8df26dead16687ae6eb47b0561a4a832e2f6 ]
Running the 'kfree_rcu_test' test case [1] results in a splat [2]. The root cause is the kfree_scale_thread thread(s) continue running after unloading the rcuscale module. This commit fixes that isue by invoking kfree_scale_cleanup() from rcu_scale_cleanup() when removing the rcuscale module.
[1] modprobe rcuscale kfree_rcu_test=1
// After some time
rmmod rcuscale
rmmod torture[2] BUG: unable to handle page fault for address: ffffffffc0601a87
#PF: supervisor instruction fetch in kernel mode
#PF: error_code(0x0010) - not-present page
PGD 11de4f067 P4D 11de4f067 PUD 11de51067 PMD 112f4d067 PTE 0
Oops: 0010 [#1] PREEMPT SMP NOPTI
CPU: 1 PID: 1798 Comm: kfree_scale_thr Not tainted 6.3.0-rc1-rcu+ #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 0.0.0 02/06/2015
RIP: 0010:0xffffffffc0601a87
Code: Unable to access opcode bytes at 0xffffffffc0601a5d.
RSP: 0018:ffffb25bc2e57e18 EFLAGS: 00010297
RAX: 0000000000000000 RBX: ffffffffc061f0b6 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff962fd0de RDI: ffffffff962fd0de
RBP: ffffb25bc2e57ea8 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000001 R12: 0000000000000000
R13: 0000000000000000 R14: 000000000000000a R15: 00000000001c1dbe
FS: 0000000000000000(0000) GS:ffff921fa2200000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffc0601a5d CR3: 000000011de4c006 CR4: 0000000000370ee0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
? kvfree_call_rcu+0xf0/0x3a0
? kthread+0xf3/0x120
? kthread_complete_and_exit+0x20/0x20
? ret_from_fork+0x1f/0x30
</TASK>
Modules linked in: rfkill sunrpc ... [last unloaded: torture]
CR2: ffffffffc0601a87
---[ end trace 0000000000000000 ]------ kernel/rcu/rcuscale.c | 5 +++++ 1 file changed, 5 insertions(+)
kernel/rcu/rcuscale.c +5 -0
@@ -797,6 +797,11 @@ rcu_scale_cleanup(void)if (gp_exp && gp_async)SCALEOUT_ERRSTRING ("No expedited async GPs, so went with async!" ); +if (kfree_rcu_test) { +kfree_scale_cleanup (); +return ; + } +if (torture_cleanup_begin ())return ;if (!cur_ops) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 64/431 x86/mtrr: Remove physical address size calculation
In reply to Greg Kroah-HartmanFrom: Juergen Gross <[email protected]>
[ Upstream commit f6b980646b93a8c585b4ed991b8a34e8fc6ef847 ]
The physical address width calculation in mtrr_bp_init() can easily be replaced with using the already available value x86_phys_bits from struct cpuinfo_x86.
The same information source can be used in mtrr/cleanup.c, removing the need to pass that value on to mtrr_cleanup().
In print_mtrr_state() use x86_phys_bits instead of recalculating it from size_or_mask.
Move setting of size_or_mask and size_and_mask into a dedicated new function in mtrr/generic.c, enabling to make those 2 variables static, as they are used in generic.c only now.
Stable-dep-of: a153f254e5cd ("x86/xen: Set MTRR state when running as Xen PV initial domain")
--- arch/x86/kernel/cpu/mtrr/cleanup.c | 16 ++++---- arch/x86/kernel/cpu/mtrr/generic.c | 12 +++++- arch/x86/kernel/cpu/mtrr/mtrr.c | 61 ++++-------------------------- arch/x86/kernel/cpu/mtrr/mtrr.h | 4 +- 4 files changed, 29 insertions(+), 64 deletions(-)
arch/x86/kernel/cpu/mtrr/cleanup.c +8 -8
@@ -173,7 +173,7 @@ early_param("mtrr_cleanup_debug", mtrr_cleanup_debug_setup);static void __init set_var_mtrr (unsigned int reg,unsigned long basek,unsigned long sizek, -unsigned char type,unsigned int address_bits) +unsigned char type) {u32 base_lo, base_hi, mask_lo, mask_hi;u64 base, mask;
@@ -183,7 +183,7 @@ set_var_mtrr(unsigned int reg, unsigned long basek, unsigned long sizek,return ; } - mask = (1ULL << address_bits) -1 ; + mask = (1ULL << boot_cpu_data.x86_phys_bits) -1 ; mask &= ~((((u64 )sizek) <<10 ) -1 ); base = ((u64 )basek) <<10 ;
@@ -209,7 +209,7 @@ save_var_mtrr(unsigned int reg, unsigned long basek, unsigned long sizek, range_state[reg].type = type; } -static void __init set_var_mtrr_all (unsigned int address_bits) +static void __init set_var_mtrr_all (void ) {unsigned long basek, sizek;unsigned char type;
@@ -220,7 +220,7 @@ static void __init set_var_mtrr_all(unsigned int address_bits) sizek = range_state[reg].size_pfn << (PAGE_SHIFT -10 ); type = range_state[reg].type; -set_var_mtrr (reg, basek, sizek, type, address_bits); +set_var_mtrr (reg, basek, sizek, type); } }
@@ -680,7 +680,7 @@ static int __init mtrr_search_optimal_index(void)return index_good; } -int __init mtrr_cleanup (unsigned address_bits) +int __init mtrr_cleanup (void ) {unsigned long x_remove_base, x_remove_size;unsigned long base, size, def, dummy;
@@ -742,7 +742,7 @@ int __init mtrr_cleanup(unsigned address_bits)mtrr_print_out_one_result (i);if (!result[i].bad) { -set_var_mtrr_all (address_bits); +set_var_mtrr_all ();pr_debug ("New variable MTRRs\n" );print_out_mtrr_range_state ();return 1 ;
@@ -786,7 +786,7 @@ int __init mtrr_cleanup(unsigned address_bits) gran_size = result[i].gran_sizek; gran_size <<=10 ;x86_setup_var_mtrrs (range, nr_range, chunk_size, gran_size); -set_var_mtrr_all (address_bits); +set_var_mtrr_all ();pr_debug ("New variable MTRRs\n" );print_out_mtrr_range_state ();return 1 ;
@@ -802,7 +802,7 @@ int __init mtrr_cleanup(unsigned address_bits) return 0; }#else -int __init mtrr_cleanup (unsigned address_bits) +int __init mtrr_cleanup (void ) {return 0 ; }
arch/x86/kernel/cpu/mtrr/generic.c +11 -1
@@ -38,6 +38,16 @@ u64 mtrr_tom2;struct mtrr_state_type mtrr_state;EXPORT_SYMBOL_GPL (mtrr_state); +static u64 size_or_mask, size_and_mask; + +void __init mtrr_set_mask (void ) +{ +unsigned int phys_addr = boot_cpu_data.x86_phys_bits; + + size_or_mask = ~GENMASK_ULL (phys_addr -PAGE_SHIFT -1 ,0 ); + size_and_mask = ~size_or_mask &GENMASK_ULL (39 ,20 ); +} +/* * BIOS is expected to clear MtrrFixDramModEn bit, see for example * "BIOS and Kernel Developer's Guide for the AMD Athlon 64 and AMD
@@ -422,7 +432,7 @@ static void __init print_mtrr_state(void) }pr_debug ("MTRR variable ranges %sabled:\n" , mtrr_state.enabled &MTRR_STATE_MTRR_ENABLED ?"en" :"dis" ); - high_width = (__ffs64 (size_or_mask) - (32 -PAGE_SHIFT ) +3 ) /4 ; + high_width = (boot_cpu_data.x86_phys_bits - (32 -PAGE_SHIFT ) +3 ) /4 ;for (i =0 ; i < num_var_ranges; ++i) {if (mtrr_state.var_ranges[i].mask_lo & (1 <<11 ))
arch/x86/kernel/cpu/mtrr/mtrr.c +8 -53
100 lines not on this page · raw message
arch/x86/kernel/cpu/mtrr/mtrr.h +2 -2
@@ -51,7 +51,6 @@ void fill_mtrr_var_range(unsigned int index, u32 base_lo, u32 base_hi, u32 mask_lo, u32 mask_hi);bool get_mtrr_state (void ); -extern u64 size_or_mask, size_and_mask;extern const struct mtrr_ops *mtrr_if;#define is_cpu (vnd) (mtrr_if && mtrr_if->vendor == X86_VENDOR_##vnd)
@@ -60,6 +59,7 @@ extern unsigned int num_var_ranges;extern u64 mtrr_tom2;extern struct mtrr_state_type mtrr_state; +void mtrr_set_mask (void );void mtrr_state_warn (void );const char *mtrr_attrib_to_str (int x);void mtrr_wrmsr (unsigned ,unsigned ,unsigned );
@@ -70,4 +70,4 @@ extern const struct mtrr_ops cyrix_mtrr_ops;extern const struct mtrr_ops centaur_mtrr_ops;extern int changed_by_mtrr_cleanup; -extern int mtrr_cleanup (unsigned address_bits); +extern int mtrr_cleanup (void );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 65/431 x86/mtrr: Replace size_or_mask and size_and_mask with a much easier concept
In reply to Greg Kroah-HartmanFrom: Juergen Gross <[email protected]>
[ Upstream commit d053b481a5f16dbd4f020c6b3ebdf9173fdef0e2 ]
Replace size_or_mask and size_and_mask with the much easier concept of high reserved bits.
While at it, instead of using constants in the MTRR code, use some new
[ bp:
- Drop mtrr_set_mask()
- Unbreak long lines
- Move struct mtrr_state_type out of the uapi header as it doesn't belong there. It also fixes a HDRTEST breakage "unknown type name ‘bool’" as Reported-by: kernel test robot <[email protected]>
- Massage.
]
Stable-dep-of: a153f254e5cd ("x86/xen: Set MTRR state when running as Xen PV initial domain")
--- arch/x86/include/asm/mtrr.h | 32 +++++++++++++- arch/x86/include/uapi/asm/mtrr.h | 8 ---- arch/x86/kernel/cpu/mtrr/cleanup.c | 2 +- arch/x86/kernel/cpu/mtrr/generic.c | 70 +++++++++++++----------------- arch/x86/kernel/cpu/mtrr/mtrr.c | 4 +- arch/x86/kernel/cpu/mtrr/mtrr.h | 2 +- 6 files changed, 65 insertions(+), 53 deletions(-)
arch/x86/include/asm/mtrr.h +30 -2
@@ -23,8 +23,35 @@#ifndef _ASM_X86_MTRR_H#define _ASM_X86_MTRR_H +#include <linux/bits.h> #include <uapi/asm/mtrr.h> +/* Defines for hardware MTRR registers. */ +#define MTRR_CAP_VCNT GENMASK(7, 0) +#define MTRR_CAP_FIX BIT_MASK(8) +#define MTRR_CAP_WC BIT_MASK(10) + +#define MTRR_DEF_TYPE_TYPE GENMASK(7, 0) +#define MTRR_DEF_TYPE_FE BIT_MASK(10) +#define MTRR_DEF_TYPE_E BIT_MASK(11) + +#define MTRR_DEF_TYPE_ENABLE (MTRR_DEF_TYPE_FE | MTRR_DEF_TYPE_E) +#define MTRR_DEF_TYPE_DISABLE ~(MTRR_DEF_TYPE_TYPE | MTRR_DEF_TYPE_ENABLE) + +#define MTRR_PHYSBASE_TYPE GENMASK(7, 0) +#define MTRR_PHYSBASE_RSVD GENMASK(11, 8) + +#define MTRR_PHYSMASK_RSVD GENMASK(10, 0) +#define MTRR_PHYSMASK_V BIT_MASK(11) + +struct mtrr_state_type { +struct mtrr_var_range var_ranges[MTRR_MAX_VAR_RANGES ]; +mtrr_type fixed_ranges[MTRR_NUM_FIXED_RANGES ]; +unsigned char enabled; +bool have_fixed; +mtrr_type def_type; +}; +/* * The following functions are for use by other drivers that cannot use * arch_phys_wc_add and arch_phys_wc_del.
@@ -121,7 +148,8 @@ struct mtrr_gentry32 {#endif /* CONFIG_COMPAT */ /* Bit fields for enabled in struct mtrr_state_type */ -#define MTRR_STATE_MTRR_FIXED_ENABLED 0x01 -#define MTRR_STATE_MTRR_ENABLED 0x02 +#define MTRR_STATE_SHIFT 10 +#define MTRR_STATE_MTRR_FIXED_ENABLED (MTRR_DEF_TYPE_FE >> MTRR_STATE_SHIFT) +#define MTRR_STATE_MTRR_ENABLED (MTRR_DEF_TYPE_E >> MTRR_STATE_SHIFT)#endif /* _ASM_X86_MTRR_H */
arch/x86/include/uapi/asm/mtrr.h +0 -8
@@ -81,14 +81,6 @@ typedef __u8 mtrr_type;#define MTRR_NUM_FIXED_RANGES 88#define MTRR_MAX_VAR_RANGES 256 -struct mtrr_state_type { -struct mtrr_var_range var_ranges[MTRR_MAX_VAR_RANGES ]; -mtrr_type fixed_ranges[MTRR_NUM_FIXED_RANGES ]; -unsigned char enabled; -unsigned char have_fixed; -mtrr_type def_type; -}; -#define MTRRphysBase_MSR (reg) (0x200 + 2 * (reg))#define MTRRphysMask_MSR (reg) (0x200 + 2 * (reg) + 1)
arch/x86/kernel/cpu/mtrr/cleanup.c +1 -1
@@ -890,7 +890,7 @@ int __init mtrr_trim_uncached_memory(unsigned long end_pfn)return 0 ;rdmsr (MSR_MTRRdefType, def, dummy); - def &=0xff ; + def &=MTRR_DEF_TYPE_TYPE ;if (def !=MTRR_TYPE_UNCACHABLE )return 0 ;
arch/x86/kernel/cpu/mtrr/generic.c +31 -39
175 lines not on this page · raw message
arch/x86/kernel/cpu/mtrr/mtrr.c +2 -2
@@ -115,7 +115,7 @@ static void __init set_num_var_ranges(bool use_generic)else if (is_cpu (CYRIX ) ||is_cpu (CENTAUR )) config =8 ; - num_var_ranges = config &0xff ; + num_var_ranges = config &MTRR_CAP_VCNT ; }static void __init init_table (void )
@@ -627,7 +627,7 @@ void __init mtrr_bp_init(void) {const char *why ="(not available)" ; -mtrr_set_mask (); + phys_hi_rsvd =GENMASK (31 , boot_cpu_data.x86_phys_bits -32 );if (cpu_feature_enabled (X86_FEATURE_MTRR )) { mtrr_if = &generic_mtrr_ops;
arch/x86/kernel/cpu/mtrr/mtrr.h +1 -1
@@ -58,8 +58,8 @@ extern const struct mtrr_ops *mtrr_if;extern unsigned int num_var_ranges;extern u64 mtrr_tom2;extern struct mtrr_state_type mtrr_state; +extern u32 phys_hi_rsvd; -void mtrr_set_mask (void );void mtrr_state_warn (void );const char *mtrr_attrib_to_str (int x);void mtrr_wrmsr (unsigned ,unsigned ,unsigned );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 66/431 x86/mtrr: Support setting MTRR state for software defined MTRRs
In reply to Greg Kroah-HartmanFrom: Juergen Gross <[email protected]>
[ Upstream commit 29055dc74287467bd7a053d60b4afe753832960d ]
When running virtualized, MTRR access can be reduced (e.g. in Xen PV guests or when running as a SEV-SNP guest under Hyper-V). Typically, the hypervisor will not advertize the MTRR feature in CPUID data, resulting in no MTRR memory type information being available for the kernel.
This has turned out to result in problems (Link tags below):
- Hyper-V SEV-SNP guests using uncached mappings where they shouldn't
- Xen PV dom0 mapping memory as WB which should be UC- instead
Solve those problems by allowing an MTRR static state override, overwriting the empty state used today. In case such a state has been set, don't call get_mtrr_state() in mtrr_bp_init().
The set state will only be used by mtrr_type_lookup(), as in all other cases mtrr_enabled() is being checked, which will return false. Accept the overwrite call only for selected cases when running as a guest. Disable X86_FEATURE_MTRR in order to avoid any MTRR modifications by just refusing them.
[ bp: Massage. ]
Stable-dep-of: a153f254e5cd ("x86/xen: Set MTRR state when running as Xen PV initial domain")
--- arch/x86/include/asm/mtrr.h | 8 ++++ arch/x86/kernel/cpu/mtrr/generic.c | 60 +++++++++++++++++++++++++++++- arch/x86/kernel/cpu/mtrr/mtrr.c | 14 ++++++- arch/x86/kernel/setup.c | 2 + 4 files changed, 82 insertions(+), 2 deletions(-)
arch/x86/include/asm/mtrr.h +8 -0
@@ -58,6 +58,8 @@ struct mtrr_state_type {*/ # ifdef CONFIG_MTRR void mtrr_bp_init (void ); +void mtrr_overwrite_state (struct mtrr_var_range *var,unsigned int num_var, +mtrr_type def_type);extern u8 mtrr_type_lookup (u64 addr,u64 end,u8 *uniform);extern void mtrr_save_fixed_ranges (void *);extern void mtrr_save_state (void );
@@ -75,6 +77,12 @@ void mtrr_disable(void);void mtrr_enable (void );void mtrr_generic_set_state (void );# else +static inline void mtrr_overwrite_state (struct mtrr_var_range *var, +unsigned int num_var, +mtrr_type def_type) +{ +} +static inline u8 mtrr_type_lookup (u64 addr,u64 end,u8 *uniform) {/*
arch/x86/kernel/cpu/mtrr/generic.c +59 -1
75 lines not on this page · raw message
arch/x86/kernel/cpu/mtrr/mtrr.c +13 -1
@@ -625,11 +625,23 @@ int __initdata changed_by_mtrr_cleanup;*/ void __init mtrr_bp_init (void ) { +bool generic_mtrrs =cpu_feature_enabled (X86_FEATURE_MTRR );const char *why ="(not available)" ; phys_hi_rsvd =GENMASK (31 , boot_cpu_data.x86_phys_bits -32 ); -if (cpu_feature_enabled (X86_FEATURE_MTRR )) { +if (!generic_mtrrs && mtrr_state.enabled) { +/* +* Software overwrite of MTRR state, only for generic case. +* Note that X86_FEATURE_MTRR has been reset in this case. +*/ +init_table (); +pr_info ("MTRRs set to read-only\n" ); + +return ; + } + +if (generic_mtrrs) { mtrr_if = &generic_mtrr_ops; }else {switch (boot_cpu_data.x86_vendor) {
arch/x86/kernel/setup.c +2 -0
@@ -1037,6 +1037,8 @@ void __init setup_arch(char **cmdline_p)/* * VMware detection requires dmi to be available, so this * needs to be done after dmi_setup(), for the boot CPU. +* For some guest types (Xen PV, SEV-SNP, TDX) it is required to be +* called before cache_bp_init() for setting up MTRR state. */ init_hypervisor_platform ();
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 67/431 x86/xen: Set MTRR state when running as Xen PV initial domain
In reply to Greg Kroah-HartmanFrom: Juergen Gross <[email protected]>
[ Upstream commit a153f254e5cdf8fa3a1df90a6ffed3063fede154 ]
When running as Xen PV initial domain (aka dom0), MTRRs are disabled by the hypervisor, but the system should nevertheless use correct cache memory types. This has always kind of worked, as disabled MTRRs resulted in disabled PAT, too, so that the kernel avoided code paths resulting in inconsistencies. This bypassed all of the sanity checks the kernel is doing with enabled MTRRs in order to avoid memory mappings with conflicting memory types.
This has been changed recently, leading to PAT being accepted to be enabled, while MTRRs stayed disabled. The result is that mtrr_type_lookup() no longer is accepting all memory type requests, but started to return WB even if UC- was requested. This led to driver failures during initialization of some devices.
In reality MTRRs are still in effect, but they are under complete control of the Xen hypervisor. It is possible, however, to retrieve the MTRR settings from the hypervisor.
In order to fix those problems, overwrite the MTRR state via mtrr_overwrite_state() with the MTRR data from the hypervisor, if the system is running as a Xen dom0.
--- arch/x86/xen/enlighten_pv.c | 52 +++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+)
arch/x86/xen/enlighten_pv.c +52 -0
@@ -68,6 +68,7 @@#include <asm/reboot.h> #include <asm/hypervisor.h> #include <asm/mach_traps.h> +#include <asm/mtrr.h> #include <asm/mwait.h> #include <asm/pci_x86.h> #include <asm/cpu.h>
@@ -119,6 +120,54 @@ static int __init parse_xen_msr_safe(char *str) }early_param ("xen_msr_safe" , parse_xen_msr_safe); +/* Get MTRR settings from Xen and put them into mtrr_state. */ +static void __init xen_set_mtrr_data (void ) +{ +#ifdef CONFIG_MTRR +struct xen_platform_op op = { + .cmd = XENPF_read_memtype, + .interface_version =XENPF_INTERFACE_VERSION , + }; +unsigned int reg; +unsigned long mask; +uint32_t eax, width; +static struct mtrr_var_range var[MTRR_MAX_VAR_RANGES ]__initdata ; + +/* Get physical address width (only 64-bit cpus supported). */ + width =36 ; + eax =cpuid_eax (0x80000000 ); +if ((eax >>16 ) ==0x8000 && eax >=0x80000008 ) { + eax =cpuid_eax (0x80000008 ); + width = eax &0xff ; + } + +for (reg =0 ; reg <MTRR_MAX_VAR_RANGES ; reg++) { + op.u.read_memtype.reg = reg; +if (HYPERVISOR_platform_op (&op)) +break ; + +/* +* Only called in dom0, which has all RAM PFNs mapped at +* RAM MFNs, and all PCI space etc. is identity mapped. +* This means we can treat MFN == PFN regarding MTRR settings. +*/ + var[reg].base_lo = op.u.read_memtype.type; + var[reg].base_lo |= op.u.read_memtype.mfn <<PAGE_SHIFT ; + var[reg].base_hi = op.u.read_memtype.mfn >> (32 -PAGE_SHIFT ); + mask = ~((op.u.read_memtype.nr_mfns <<PAGE_SHIFT ) -1 ); + mask &= (1UL << width) -1 ; +if (mask) + mask |=MTRR_PHYSMASK_V ; + var[reg].mask_lo = mask; + var[reg].mask_hi = mask >>32 ; + } + +/* Only overwrite MTRR state if any MTRR could be got from Xen. */ +if (reg) +mtrr_overwrite_state (var, reg,MTRR_TYPE_UNCACHABLE ); +#endif +} +static void __init xen_pv_init_platform (void ) {/* PV guests can't operate virtio devices without grants. */
@@ -135,6 +184,9 @@ static void __init xen_pv_init_platform(void)/* pvclock is in shared info area */ xen_init_time_ops (); + +if (xen_initial_domain ()) +xen_set_mtrr_data (); }static void __init xen_pv_guest_late_init (void )
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 68/431 kselftest: vDSO: Fix accumulation of uninitialized ret when CLOCK_REALTIME is undefined
In reply to Greg Kroah-HartmanFrom: Colin Ian King <[email protected]>
[ Upstream commit 375b9ff53cb6f9c042817b75f2be0a650626dc4f ]
In the unlikely case that CLOCK_REALTIME is not defined, variable ret is not initialized and further accumulation of return values to ret can leave ret in an undefined state. Fix this by initialized ret to zero and changing the assignment of ret to an accumulation for the CLOCK_REALTIME case.
--- tools/testing/selftests/vDSO/vdso_test_clock_getres.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/vDSO/vdso_test_clock_getres.c +2 -2
@@ -84,12 +84,12 @@ static inline int vdso_test_clock(unsigned int clock_id)int main (int argc,char **argv) { -int ret; +int ret =0 ;#if _POSIX_TIMERS >0 #ifdef CLOCK_REALTIME - ret =vdso_test_clock (CLOCK_REALTIME ); + ret +=vdso_test_clock (CLOCK_REALTIME );#endif #ifdef CLOCK_BOOTTIME
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 69/431 perf/ibs: Fix interface via core pmu events
In reply to Greg Kroah-HartmanFrom: Ravi Bangoria <[email protected]>
[ Upstream commit 2fad201fe38ff9a692acedb1990ece2c52a29f95 ]
Although, IBS pmus can be invoked via their own interface, indirect IBS invocation via core pmu events is also supported with fixed set of events: cpu-cycles:p, r076:p (same as cpu-cycles:p) and r0C1:p (micro-ops) for user convenience.
This indirect IBS invocation is broken since commit 66d258c5b048 ("perf/core: Optimize perf_init_event()"), which added RAW pmu under 'pmu_idr' list and thus if event_init() fails with RAW pmu, it started returning error instead of trying other pmus.
Forward precise events from core pmu to IBS by overwriting 'type' and 'config' in the kernel copy of perf_event_attr. Overwriting will cause perf_init_event() to retry with updated 'type' and 'config', which will automatically forward event to IBS pmu.
Without patch:
$ sudo ./perf record -C 0 -e r076:p -- sleep 1 Error: The r076:p event is not supported.
With patch:
$ sudo ./perf record -C 0 -e r076:p -- sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.341 MB perf.data (37 samples) ]
--- arch/x86/events/amd/core.c | 2 +- arch/x86/events/amd/ibs.c | 53 +++++++++++++++---------------- arch/x86/include/asm/perf_event.h | 2 ++ 3 files changed, 29 insertions(+), 28 deletions(-)
arch/x86/events/amd/core.c +1 -1
@@ -374,7 +374,7 @@ static int amd_pmu_hw_config(struct perf_event *event)/* pass precise event sampling to ibs: */ if (event->attr.precise_ip &&get_ibs_caps ()) -return -ENOENT ; +return forward_event_to_ibs (event);if (has_branch_stack (event) && !x86_pmu.lbr_nr)return -EOPNOTSUPP ;
arch/x86/events/amd/ibs.c +26 -27
80 lines not on this page · raw message
arch/x86/include/asm/perf_event.h +2 -0
@@ -478,8 +478,10 @@ struct pebs_xmm {#ifdef CONFIG_X86_LOCAL_APIC extern u32 get_ibs_caps (void ); +extern int forward_event_to_ibs (struct perf_event *event);#else static inline u32 get_ibs_caps (void ) {return 0 ; } +static inline int forward_event_to_ibs (struct perf_event *event) {return -ENOENT ; }#endif #ifdef CONFIG_PERF_EVENTS
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 70/431 x86/mm: Fix __swp_entry_to_pte() for Xen PV guests
In reply to Greg Kroah-HartmanFrom: Juergen Gross <[email protected]>
[ Upstream commit 0f88130e8a6fd185b0aeb5d8e286083735f2585a ]
Normally __swp_entry_to_pte() is never called with a value translating to a valid PTE. The only known exception is pte_swap_tests(), resulting in a WARN splat in Xen PV guests, as __pte_to_swp_entry() did translate the PFN of the valid PTE to a guest local PFN, while __swp_entry_to_pte() doesn't do the opposite translation.
Fix that by using __pte() in __swp_entry_to_pte() instead of open coding the native variant of it.
For correctness do the similar conversion for __swp_entry_to_pmd().
--- arch/x86/include/asm/pgtable_64.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/include/asm/pgtable_64.h +2 -2
@@ -237,8 +237,8 @@ static inline void native_pgd_clear(pgd_t *pgd)#define __pte_to_swp_entry (pte) ((swp_entry_t) { pte_val((pte)) })#define __pmd_to_swp_entry (pmd) ((swp_entry_t) { pmd_val((pmd)) }) -#define __swp_entry_to_pte (x) ((pte_t) { .pte = (x).val }) -#define __swp_entry_to_pmd (x) ((pmd_t) { .pmd = (x).val }) +#define __swp_entry_to_pte (x) (__pte((x).val)) +#define __swp_entry_to_pmd (x) (__pmd((x).val))extern void cleanup_highmap (void );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 71/431 locking/atomic: arm: fix sync ops
In reply to Greg Kroah-HartmanFrom: Mark Rutland <[email protected]>
[ Upstream commit dda5f312bb09e56e7a1c3e3851f2000eb2e9c879 ]
The sync_*() ops on arch/arm are defined in terms of the regular bitops with no special handling. This is not correct, as UP kernels elide barriers for the fully-ordered operations, and so the required ordering is lost when such UP kernels are run under a hypervsior on an SMP system.
Fix this by defining sync ops with the required barriers.
Note: On 32-bit arm, the sync_*() ops are currently only used by Xen, which requires ARMv7, but the semantics can be implemented for ARMv6+.
--- arch/arm/include/asm/assembler.h | 17 +++++++++++++++++ arch/arm/include/asm/sync_bitops.h | 29 +++++++++++++++++++++++++---- arch/arm/lib/bitops.h | 14 +++++++++++--- arch/arm/lib/testchangebit.S | 4 ++++ arch/arm/lib/testclearbit.S | 4 ++++ arch/arm/lib/testsetbit.S | 4 ++++ 6 files changed, 65 insertions(+), 7 deletions(-)
arch/arm/include/asm/assembler.h +17 -0
@@ -394,6 +394,23 @@ ALT_UP_B(.L0_\@)#endif .endm +/* + * Raw SMP data memory barrier + */ + .macro __smp_dmb mode +#if __LINUX_ARM_ARCH__ >=7 + .ifeqs "\mode","arm" + dmb ish + .else + W(dmb) ish + .endif +#elif __LINUX_ARM_ARCH__ ==6 + mcr p15, 0, r0, c7, c10, 5 @ dmb +#else + .error "Incompatible SMP platform" +#endif + .endm +#if defined(CONFIG_CPU_V7M )/* * setmode is used to assert to be in svc mode during boot. For v7-M
arch/arm/include/asm/sync_bitops.h +25 -4
@@ -14,14 +14,35 @@* ops which are SMP safe even on a UP kernel. */ +/* +* Unordered +*/ +#define sync_set_bit (nr, p) _set_bit(nr, p)#define sync_clear_bit (nr, p) _clear_bit(nr, p)#define sync_change_bit (nr, p) _change_bit(nr, p) -#define sync_test_and_set_bit (nr, p) _test_and_set_bit(nr, p) -#define sync_test_and_clear_bit (nr, p) _test_and_clear_bit(nr, p) -#define sync_test_and_change_bit (nr, p) _test_and_change_bit(nr, p)#define sync_test_bit (nr, addr) test_bit(nr, addr) -#define arch_sync_cmpxchg arch_cmpxchg +/* +* Fully ordered +*/ + +int _sync_test_and_set_bit (int nr,volatile unsigned long * p); +#define sync_test_and_set_bit (nr, p) _sync_test_and_set_bit(nr, p) + +int _sync_test_and_clear_bit (int nr,volatile unsigned long * p); +#define sync_test_and_clear_bit (nr, p) _sync_test_and_clear_bit(nr, p) + +int _sync_test_and_change_bit (int nr,volatile unsigned long * p); +#define sync_test_and_change_bit (nr, p) _sync_test_and_change_bit(nr, p) + +#define arch_sync_cmpxchg (ptr, old, new) \ +({ \ + __typeof__(*(ptr)) __ret; \ + __smp_mb__before_atomic(); \ + __ret = arch_cmpxchg_relaxed((ptr), (old), (new)); \ + __smp_mb__after_atomic(); \ + __ret; \ +})#endif
arch/arm/lib/bitops.h +11 -3
@@ -28,7 +28,7 @@ UNWIND( .fnend ) ENDPROC(\name ) .endm - .macro testop, name, instr, store + .macro __testop, name, instr, store, barrier ENTRY( \name ) UNWIND( .fnstart ) ands ip, r1, #3
@@ -38,7 +38,7 @@ UNWIND( .fnstart ) mov r0, r0, lsr #5 add r1, r1, r0, lsl #2 @ Get word offset mov r3, r2, lsl r3 @ create mask - smp_dmb + \barrier #if __LINUX_ARM_ARCH__ >= 7 && defined(CONFIG_SMP) .arch_extension mpALT_SMP (W (pldw ) [r1])
@@ -50,13 +50,21 @@ UNWIND( .fnstart ) strex ip, r2, [r1] cmp ip, #0 bne 1b - smp_dmb + \barrier cmp r0, #0 movne r0, #1 2: bx lr UNWIND( .fnend ) ENDPROC(\name ) .endm + + .macro testop, name, instr, store + __testop \name, \instr, \store, smp_dmb + .endm + + .macro sync_testop, name, instr, store + __testop \name, \instr, \store, __smp_dmb + .endm #else .macro bitop, name, instr ENTRY( \name )
arch/arm/lib/testchangebit.S +4 -0
@@ -10,3 +10,7 @@ .text testop _test_and_change_bit, eor, str + +#if __LINUX_ARM_ARCH__ >= 6 +sync_testop _sync_test_and_change_bit, eor, str +#endif
arch/arm/lib/testclearbit.S +4 -0
@@ -10,3 +10,7 @@ .text testop _test_and_clear_bit, bicne, strne + +#if __LINUX_ARM_ARCH__ >= 6 +sync_testop _sync_test_and_clear_bit, bicne, strne +#endif
arch/arm/lib/testsetbit.S +4 -0
@@ -10,3 +10,7 @@ .text testop _test_and_set_bit, orreq, streq + +#if __LINUX_ARM_ARCH__ >= 6 +sync_testop _sync_test_and_set_bit, orreq, streq +#endif
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 72/431 evm: Complete description of evm_inode_setattr()
In reply to Greg Kroah-HartmanFrom: Roberto Sassu <[email protected]>
[ Upstream commit b1de86d4248b273cb12c4cd7d20c08d459519f7d ]
Add the description for missing parameters of evm_inode_setattr() to avoid the warning arising with W=n compile option.
--- security/integrity/evm/evm_main.c | 2 ++ 1 file changed, 2 insertions(+)
security/integrity/evm/evm_main.c +2 -0
@@ -795,7 +795,9 @@ static int evm_attr_change(struct mnt_idmap *idmap,/** * evm_inode_setattr - prevent updating an invalid EVM extended attribute +* @idmap: idmap of the mount * @dentry: pointer to the affected dentry +* @attr: iattr structure containing the new file attributes * * Permit update of file attributes when files have a valid EVM signature, * except in the case of them having an immutable portable signature.
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 73/431 evm: Fix build warnings
In reply to Greg Kroah-HartmanFrom: Roberto Sassu <[email protected]>
[ Upstream commit 996e0a97ebd7b11cb785794e2a83c20c1add9d92 ]
Fix build warnings (function parameters description) for evm_read_protected_xattrs(), evm_set_key() and evm_verifyxattr().
--- security/integrity/evm/evm_crypto.c | 2 +- security/integrity/evm/evm_main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
security/integrity/evm/evm_crypto.c +1 -1
@@ -40,7 +40,7 @@ static const char evm_hmac[] = "hmac(sha1)";/** * evm_set_key() - set EVM HMAC key from the kernel * @key: pointer to a buffer with the key data -* @size: length of the key data +* @keylen: length of the key data * * This function allows setting the EVM HMAC key from the kernel * without using the "encrypted" key subsystem keys. It can be used
security/integrity/evm/evm_main.c +1 -1
@@ -318,7 +318,6 @@ int evm_protected_xattr_if_enabled(const char *req_xattr_name)/** * evm_read_protected_xattrs - read EVM protected xattr names, lengths, values * @dentry: dentry of the read xattrs -* @inode: inode of the read xattrs * @buffer: buffer xattr names, lengths or values are copied to * @buffer_size: size of buffer * @type: n: names, l: lengths, v: values
@@ -390,6 +389,7 @@ int evm_read_protected_xattrs(struct dentry *dentry, u8 *buffer,* @xattr_name: requested xattr * @xattr_value: requested xattr value * @xattr_value_len: requested xattr value length +* @iint: inode integrity metadata * * Calculate the HMAC for the given dentry and verify it against the stored * security.evm xattr. For performance, use the xattr value and length
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 74/431 ima: Fix build warnings
In reply to Greg Kroah-HartmanFrom: Roberto Sassu <[email protected]>
[ Upstream commit 95526d13038c2bbddd567a4d8e39fac42484e182 ]
Fix build warnings (function parameters description) for ima_collect_modsig(), ima_match_policy() and ima_parse_add_rule().
--- security/integrity/ima/ima_modsig.c | 3 +++ security/integrity/ima/ima_policy.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-)
security/integrity/ima/ima_modsig.c +3 -0
@@ -89,6 +89,9 @@ int ima_read_modsig(enum ima_hooks func, const void *buf, loff_t buf_len,/** * ima_collect_modsig - Calculate the file hash without the appended signature. +* @modsig: parsed module signature +* @buf: data to verify the signature on +* @size: data size * * Since the modsig is part of the file contents, the hash used in its signature * isn't the same one ordinarily calculated by IMA. Therefore PKCS7 code
security/integrity/ima/ima_policy.c +2 -1
@@ -721,6 +721,7 @@ static int get_subaction(struct ima_rule_entry *rule, enum ima_hooks func)* @secid: LSM secid of the task to be validated * @func: IMA hook identifier * @mask: requested action (MAY_READ | MAY_WRITE | MAY_APPEND | MAY_EXEC) +* @flags: IMA actions to consider (e.g. IMA_MEASURE | IMA_APPRAISE) * @pcr: set the pcr to extend * @template_desc: the template that should be used for this rule * @func_data: func specific data, may be NULL
@@ -1915,7 +1916,7 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry)/** * ima_parse_add_rule - add a rule to ima_policy_rules -* @rule - ima measurement policy rule +* @rule: ima measurement policy rule * * Avoid locking by allowing just one writer at a time in ima_write_policy() * Returns the length of the rule parsed, an error code on failure
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 75/431 pstore/ram: Add check for kstrdup
In reply to Greg Kroah-HartmanFrom: Jiasheng Jiang <[email protected]>
[ Upstream commit d97038d5ec2062733c1e016caf9baaf68cf64ea1 ]
Add check for the return value of kstrdup() and return the error if it fails in order to avoid NULL pointer dereference.
--- fs/pstore/ram_core.c | 2 ++ 1 file changed, 2 insertions(+)
fs/pstore/ram_core.c +2 -0
@@ -599,6 +599,8 @@ struct persistent_ram_zone *persistent_ram_new(phys_addr_t start, size_t size,raw_spin_lock_init (&prz->buffer_lock); prz->flags = flags; prz->label =kstrdup (label,GFP_KERNEL ); +if (!prz->label) + goto err; ret =persistent_ram_buffer_map (start, size, prz, memtype);if (ret)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 76/431 sched/core: Avoid multiple calling update_rq_clock() in __cfsb_csd_unthrottle()
In reply to Greg Kroah-HartmanFrom: Hao Jia <[email protected]>
[ Upstream commit ebb83d84e49b54369b0db67136a5fe1087124dcc ]
After commit 8ad075c2eb1f ("sched: Async unthrottling for cfs bandwidth"), we may update the rq clock multiple times in the loop of __cfsb_csd_unthrottle().
A prior (although less common) instance of this problem exists in unthrottle_offline_cfs_rqs().
Cure both by ensuring update_rq_clock() is called before the loop and setting RQCF_ACT_SKIP during the loop, to supress further updates. The alternative would be pulling update_rq_clock() out of unthrottle_cfs_rq(), but that gives an even bigger mess.
--- kernel/sched/fair.c | 18 ++++++++++++++++++ kernel/sched/sched.h | 22 ++++++++++++++++++++++ 2 files changed, 40 insertions(+)
kernel/sched/fair.c +18 -0
@@ -5519,6 +5519,14 @@ static void __cfsb_csd_unthrottle(void *arg)rq_lock (rq, &rf); +/* +* Iterating over the list can trigger several call to +* update_rq_clock() in unthrottle_cfs_rq(). +* Do it once and skip the potential next ones. +*/ +update_rq_clock (rq); +rq_clock_start_loop_update (rq); +/* * Since we hold rq lock we're safe from concurrent manipulation of * the CSD list. However, this RCU critical section annotates the
@@ -5538,6 +5546,7 @@ static void __cfsb_csd_unthrottle(void *arg)rcu_read_unlock (); +rq_clock_stop_loop_update (rq);rq_unlock (rq, &rf); }
@@ -6054,6 +6063,13 @@ static void __maybe_unused unthrottle_offline_cfs_rqs(struct rq *rq)lockdep_assert_rq_held (rq); +/* +* The rq clock has already been updated in the +* set_rq_offline(), so we should skip updating +* the rq clock again in unthrottle_cfs_rq(). +*/ +rq_clock_start_loop_update (rq); +rcu_read_lock ();list_for_each_entry_rcu (tg, &task_groups, list) {struct cfs_rq *cfs_rq = tg->cfs_rq[cpu_of (rq)];
@@ -6076,6 +6092,8 @@ static void __maybe_unused unthrottle_offline_cfs_rqs(struct rq *rq) unthrottle_cfs_rq(cfs_rq); }rcu_read_unlock (); + +rq_clock_stop_loop_update (rq); }#else /* CONFIG_CFS_BANDWIDTH */
kernel/sched/sched.h +22 -0
@@ -1546,6 +1546,28 @@ static inline void rq_clock_cancel_skipupdate(struct rq *rq) rq->clock_update_flags &= ~RQCF_REQ_SKIP ; } +/* +* During cpu offlining and rq wide unthrottling, we can trigger +* an update_rq_clock() for several cfs and rt runqueues (Typically +* when using list_for_each_entry_*) +* rq_clock_start_loop_update() can be called after updating the clock +* once and before iterating over the list to prevent multiple update. +* After the iterative traversal, we need to call rq_clock_stop_loop_update() +* to clear RQCF_ACT_SKIP of rq->clock_update_flags. +*/ +static inline void rq_clock_start_loop_update (struct rq *rq) +{ +lockdep_assert_rq_held (rq); +SCHED_WARN_ON (rq->clock_update_flags &RQCF_ACT_SKIP ); + rq->clock_update_flags |=RQCF_ACT_SKIP ; +} + +static inline void rq_clock_stop_loop_update (struct rq *rq) +{ +lockdep_assert_rq_held (rq); + rq->clock_update_flags &= ~RQCF_ACT_SKIP ; +} +struct rq_flags {unsigned long flags;struct pin_cookie cookie;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 77/431 igc: Enable and fix RX hash usage by netstack
In reply to Greg Kroah-HartmanFrom: Jesper Dangaard Brouer <[email protected]>
[ Upstream commit 84214ab4689f962b4bfc47fc9a5838d25ac4274d ]
When function igc_rx_hash() was introduced in v4.20 via commit 0507ef8a0372 ("igc: Add transmit and receive fastpath and interrupt handlers"), the hardware wasn't configured to provide RSS hash, thus it made sense to not enable net_device NETIF_F_RXHASH feature bit.
The NIC hardware was configured to enable RSS hash info in v5.2 via commit 2121c2712f82 ("igc: Add multiple receive queues control supporting"), but forgot to set the NETIF_F_RXHASH feature bit.
The original implementation of igc_rx_hash() didn't extract the associated pkt_hash_type, but statically set PKT_HASH_TYPE_L3. The largest portions of this patch are about extracting the RSS Type from the hardware and mapping this to enum pkt_hash_types. This was based on Foxville i225 software user manual rev-1.3.1 and tested on Intel Ethernet Controller I225-LM (rev 03).
For UDP it's worth noting that RSS (type) hashing have been disabled both for IPv4 and IPv6 (see IGC_MRQC_RSS_FIELD_IPV4_UDP + IGC_MRQC_RSS_FIELD_IPV6_UDP) because hardware RSS doesn't handle fragmented pkts well when enabled (can cause out-of-order). This results in PKT_HASH_TYPE_L3 for UDP packets, and hash value doesn't include UDP port numbers. Not being PKT_HASH_TYPE_L4, have the effect that netstack will do a software based hash calc calling into flow_dissect, but only when code calls skb_get_hash(), which doesn't necessary happen for local delivery.
For QA verification testing I wrote a small bpftrace prog:
[0] https://github.com/xdp-project/xdp-project/blob/master/areas/hints/monitor_skb_hash_on_dev.bt
--- drivers/net/ethernet/intel/igc/igc.h | 28 ++++++++++++++++++++ drivers/net/ethernet/intel/igc/igc_main.c | 31 ++++++++++++++++++++--- 2 files changed, 55 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/igc/igc.h +28 -0
@@ -13,6 +13,7 @@#include <linux/ptp_clock_kernel.h> #include <linux/timecounter.h> #include <linux/net_tstamp.h> +#include <linux/bitfield.h> #include "igc_hw.h"
@@ -311,6 +312,33 @@ extern char igc_driver_name[];#define IGC_MRQC_RSS_FIELD_IPV4_UDP 0x00400000#define IGC_MRQC_RSS_FIELD_IPV6_UDP 0x00800000 +/* RX-desc Write-Back format RSS Type's */ +enum igc_rss_type_num { +IGC_RSS_TYPE_NO_HASH =0 , +IGC_RSS_TYPE_HASH_TCP_IPV4 =1 , +IGC_RSS_TYPE_HASH_IPV4 =2 , +IGC_RSS_TYPE_HASH_TCP_IPV6 =3 , +IGC_RSS_TYPE_HASH_IPV6_EX =4 , +IGC_RSS_TYPE_HASH_IPV6 =5 , +IGC_RSS_TYPE_HASH_TCP_IPV6_EX =6 , +IGC_RSS_TYPE_HASH_UDP_IPV4 =7 , +IGC_RSS_TYPE_HASH_UDP_IPV6 =8 , +IGC_RSS_TYPE_HASH_UDP_IPV6_EX =9 , +IGC_RSS_TYPE_MAX =10 , +}; +#define IGC_RSS_TYPE_MAX_TABLE 16 +#define IGC_RSS_TYPE_MASK GENMASK(3,0)/* 4-bits (3:0) = mask 0x0F */ + +/* igc_rss_type - Rx descriptor RSS type field */ +static inline u32 igc_rss_type (const union igc_adv_rx_desc *rx_desc) +{ +/* RSS Type 4-bits (3:0) number: 0-9 (above 9 is reserved) +* Accessing the same bits via u16 (wb.lower.lo_dword.hs_rss.pkt_info) +* is slightly slower than via u32 (wb.lower.lo_dword.data) +*/ +return le32_get_bits (rx_desc->wb.lower.lo_dword.data,IGC_RSS_TYPE_MASK ); +} +/* Interrupt defines */ #define IGC_START_ITR 648/* ~6000 ints/sec */ #define IGC_4K_ITR 980
drivers/net/ethernet/intel/igc/igc_main.c +27 -4
@@ -1687,14 +1687,36 @@ static void igc_rx_checksum(struct igc_ring *ring, le32_to_cpu(rx_desc->wb.upper.status_error)); } +/* Mapping HW RSS Type to enum pkt_hash_types */ +static const enum pkt_hash_types igc_rss_type_table[IGC_RSS_TYPE_MAX_TABLE ] = { + [IGC_RSS_TYPE_NO_HASH ] =PKT_HASH_TYPE_L2 , + [IGC_RSS_TYPE_HASH_TCP_IPV4 ] =PKT_HASH_TYPE_L4 , + [IGC_RSS_TYPE_HASH_IPV4 ] =PKT_HASH_TYPE_L3 , + [IGC_RSS_TYPE_HASH_TCP_IPV6 ] =PKT_HASH_TYPE_L4 , + [IGC_RSS_TYPE_HASH_IPV6_EX ] =PKT_HASH_TYPE_L3 , + [IGC_RSS_TYPE_HASH_IPV6 ] =PKT_HASH_TYPE_L3 , + [IGC_RSS_TYPE_HASH_TCP_IPV6_EX ] =PKT_HASH_TYPE_L4 , + [IGC_RSS_TYPE_HASH_UDP_IPV4 ] =PKT_HASH_TYPE_L4 , + [IGC_RSS_TYPE_HASH_UDP_IPV6 ] =PKT_HASH_TYPE_L4 , + [IGC_RSS_TYPE_HASH_UDP_IPV6_EX ] =PKT_HASH_TYPE_L4 , + [10 ] =PKT_HASH_TYPE_NONE ,/* RSS Type above 9 "Reserved" by HW */ + [11 ] =PKT_HASH_TYPE_NONE ,/* keep array sized for SW bit-mask */ + [12 ] =PKT_HASH_TYPE_NONE ,/* to handle future HW revisons */ + [13 ] =PKT_HASH_TYPE_NONE , + [14 ] =PKT_HASH_TYPE_NONE , + [15 ] =PKT_HASH_TYPE_NONE , +}; +static inline void igc_rx_hash (struct igc_ring *ring,union igc_adv_rx_desc *rx_desc,struct sk_buff *skb) { -if (ring->netdev->features &NETIF_F_RXHASH ) -skb_set_hash (skb, -le32_to_cpu (rx_desc->wb.lower.hi_dword.rss), -PKT_HASH_TYPE_L3 ); +if (ring->netdev->features &NETIF_F_RXHASH ) { +u32 rss_hash =le32_to_cpu (rx_desc->wb.lower.hi_dword.rss); +u32 rss_type =igc_rss_type (rx_desc); + +skb_set_hash (skb, rss_hash, igc_rss_type_table[rss_type]); + } } static void igc_rx_vlan(struct igc_ring *rx_ring,
@@ -6553,6 +6575,7 @@ static int igc_probe(struct pci_dev *pdev, netdev->features |=NETIF_F_TSO ; netdev->features |=NETIF_F_TSO6 ; netdev->features |=NETIF_F_TSO_ECN ; + netdev->features |=NETIF_F_RXHASH ; netdev->features |=NETIF_F_RXCSUM ; netdev->features |=NETIF_F_HW_CSUM ; netdev->features |=NETIF_F_SCTP_CRC ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 78/431 wifi: ath9k: fix AR9003 mac hardware hang check register offset calculation
In reply to Greg Kroah-HartmanFrom: Peter Seiderer <[email protected]>
[ Upstream commit 3e56c80931c7615250fe4bf83f93b57881969266 ]
Fix ath9k_hw_verify_hang()/ar9003_hw_detect_mac_hang() register offset calculation (do not overflow the shift for the second register/queues above five, use the register layout described in the comments above ath9k_hw_verify_hang() instead).
--- drivers/net/wireless/ath/ath9k/ar9003_hw.c | 27 ++++++++++++++-------- 1 file changed, 18 insertions(+), 9 deletions(-)
drivers/net/wireless/ath/ath9k/ar9003_hw.c +18 -9
@@ -1099,17 +1099,22 @@ static bool ath9k_hw_verify_hang(struct ath_hw *ah, unsigned int queue) {u32 dma_dbg_chain, dma_dbg_complete;u8 dcu_chain_state, dcu_complete_state; +unsigned int dbg_reg, reg_offset;int i; -for (i =0 ; i <NUM_STATUS_READS ; i++) { -if (queue <6 ) - dma_dbg_chain =REG_READ (ah,AR_DMADBG_4 ); -else - dma_dbg_chain =REG_READ (ah,AR_DMADBG_5 ); +if (queue <6 ) { + dbg_reg =AR_DMADBG_4 ; + reg_offset = queue *5 ; + }else { + dbg_reg =AR_DMADBG_5 ; + reg_offset = (queue -6 ) *5 ; + } +for (i =0 ; i <NUM_STATUS_READS ; i++) { + dma_dbg_chain =REG_READ (ah, dbg_reg); dma_dbg_complete =REG_READ (ah,AR_DMADBG_6 ); - dcu_chain_state = (dma_dbg_chain >> (5 * queue)) &0x1f ; + dcu_chain_state = (dma_dbg_chain >> reg_offset) &0x1f ; dcu_complete_state = dma_dbg_complete &0x3 ;if ((dcu_chain_state !=0x6 ) || (dcu_complete_state !=0x1 ))
@@ -1128,6 +1133,7 @@ static bool ar9003_hw_detect_mac_hang(struct ath_hw *ah)u8 dcu_chain_state, dcu_complete_state;bool dcu_wait_frdone = false;unsigned long chk_dcu =0 ; +unsigned int reg_offset;unsigned int i =0 ; dma_dbg_4 =REG_READ (ah,AR_DMADBG_4 );
@@ -1139,12 +1145,15 @@ static bool ar9003_hw_detect_mac_hang(struct ath_hw *ah) goto exit;for (i =0 ; i <ATH9K_NUM_TX_QUEUES ; i++) { -if (i <6 ) +if (i <6 ) { chk_dbg = dma_dbg_4; -else + reg_offset = i *5 ; + }else { chk_dbg = dma_dbg_5; + reg_offset = (i -6 ) *5 ; + } - dcu_chain_state = (chk_dbg >> (5 * i)) &0x1f ; + dcu_chain_state = (chk_dbg >> reg_offset) &0x1f ;if (dcu_chain_state ==0x6 ) { dcu_wait_frdone = true; chk_dcu |=BIT (i);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 79/431 wifi: ath9k: avoid referencing uninit memory in ath9k_wmi_ctrl_rx
In reply to Greg Kroah-HartmanFrom: Fedor Pchelkin <[email protected]>
[ Upstream commit f24292e827088bba8de7158501ac25a59b064953 ]
For the reasons also described in commit b383e8abed41 ("wifi: ath9k: avoid uninit memory read in ath9k_htc_rx_msg()"), ath9k_htc_rx_msg() should validate pkt_len before accessing the SKB.
For example, the obtained SKB may have been badly constructed with pkt_len = 8. In this case, the SKB can only contain a valid htc_frame_hdr but after being processed in ath9k_htc_rx_msg() and passed to ath9k_wmi_ctrl_rx() endpoint RX handler, it is expected to have a WMI command header which should be located inside its data payload.
Implement sanity checking inside ath9k_wmi_ctrl_rx(). Otherwise, uninit memory can be referenced.
Tested on Qualcomm Atheros Communications AR9271 802.11n .
Found by Linux Verification Center (linuxtesting.org) with Syzkaller.
--- drivers/net/wireless/ath/ath9k/wmi.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/wireless/ath/ath9k/wmi.c +4 -0
@@ -221,6 +221,10 @@ static void ath9k_wmi_ctrl_rx(void *priv, struct sk_buff *skb,if (unlikely (wmi->stopped)) goto free_skb; +/* Validate the obtained SKB. */ +if (unlikely (skb->len <sizeof (struct wmi_cmd_hdr ))) + goto free_skb; + hdr = (struct wmi_cmd_hdr *) skb->data; cmd_id =be16_to_cpu (hdr->command_id);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 80/431 libbpf: btf_dump_type_data_check_overflow needs to consider BTF_MEMBER_BITFIELD_SIZE
In reply to Greg Kroah-HartmanFrom: Martin KaFai Lau <[email protected]>
[ Upstream commit c39028b333f3a3a765c5c0b9726b8e38aedf0ba1 ]
The btf_dump/struct_data selftest is failing with:
[...]
test_btf_dump_struct_data:FAIL:unexpected return value dumping fs_context unexpected unexpected return value dumping fs_context: actual -7 != expected 264 [...]
The reason is in btf_dump_type_data_check_overflow(). It does not use BTF_MEMBER_BITFIELD_SIZE from the struct's member (btf_member). Instead, it is using the enum size which is 4. It had been working till the recent commit 4e04143c869c ("fs_context: drop the unused lsm_flags member") removed an integer member which also removed the 4 bytes padding at the end of the fs_context. Missing this 4 bytes padding exposed this bug. In particular, when btf_dump_type_data_check_overflow() reaches the member 'phase', -E2BIG is returned.
The fix is to pass bit_sz to btf_dump_type_data_check_overflow(). In btf_dump_type_data_check_overflow(), it does a different size check when bit_sz is not zero.
The current fs_context:
[3600] ENUM 'fs_context_purpose' encoding=UNSIGNED size=4 vlen=3
'FS_CONTEXT_FOR_MOUNT' val=0 'FS_CONTEXT_FOR_SUBMOUNT' val=1 'FS_CONTEXT_FOR_RECONFIGURE' val=2
[3601] ENUM 'fs_context_phase' encoding=UNSIGNED size=4 vlen=7
'FS_CONTEXT_CREATE_PARAMS' val=0 'FS_CONTEXT_CREATING' val=1 'FS_CONTEXT_AWAITING_MOUNT' val=2 'FS_CONTEXT_AWAITING_RECONF' val=3 'FS_CONTEXT_RECONF_PARAMS' val=4 'FS_CONTEXT_RECONFIGURING' val=5 'FS_CONTEXT_FAILED' val=6
[3602] STRUCT 'fs_context' size=264 vlen=21
'ops' type_id=3603 bits_offset=0 'uapi_mutex' type_id=235 bits_offset=64 'fs_type' type_id=872 bits_offset=1216 'fs_private' type_id=21 bits_offset=1280 'sget_key' type_id=21 bits_offset=1344 'root' type_id=781 bits_offset=1408 'user_ns' type_id=251 bits_offset=1472 'net_ns' type_id=984 bits_offset=1536 'cred' type_id=1785 bits_offset=1600 'log' type_id=3621 bits_offset=1664 'source' type_id=42 bits_offset=1792 'security' type_id=21 bits_offset=1856 's_fs_info' type_id=21 bits_offset=1920 'sb_flags' type_id=20 bits_offset=1984 'sb_flags_mask' type_id=20 bits_offset=2016 's_iflags' type_id=20 bits_offset=2048 'purpose' type_id=3600 bits_offset=2080 bitfield_size=8 'phase' type_id=3601 bits_offset=2088 bitfield_size=8 'need_free' type_id=67 bits_offset=2096 bitfield_size=1 'global' type_id=67 bits_offset=2097 bitfield_size=1 'oldapi' type_id=67 bits_offset=2098 bitfield_size=1
--- tools/lib/bpf/btf_dump.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-)
tools/lib/bpf/btf_dump.c +19 -3
@@ -2250,9 +2250,25 @@ static int btf_dump_type_data_check_overflow(struct btf_dump *d,const struct btf_type *t, __u32 id, const void *data, - __u8 bits_offset) + __u8 bits_offset, + __u8 bit_sz) { - __s64 size = btf__resolve_size(d->btf, id); + __s64 size; + +if (bit_sz) { +/* bits_offset is at most 7. bit_sz is at most 128. */ +__u8 nr_bytes = (bits_offset + bit_sz +7 ) /8 ; + +/* When bit_sz is non zero, it is called from +* btf_dump_struct_data() where it only cares about +* negative error value. +* Return nr_bytes in success case to make it +* consistent as the regular integer case below. +*/ +return data + nr_bytes > d->typed_dump->data_end ? -E2BIG : nr_bytes; + } + + size =btf__resolve_size (d->btf, id);if (size <0 || size >=INT_MAX ) { pr_warn("unexpected size [%zu] for id [%u]\n",
@@ -2407,7 +2423,7 @@ static int btf_dump_dump_type_data(struct btf_dump *d, {int size, err =0 ; - size =btf_dump_type_data_check_overflow (d, t, id, data, bits_offset); + size =btf_dump_type_data_check_overflow (d, t, id, data, bits_offset, bit_sz);if (size <0 )return size; err =btf_dump_type_data_check_zero (d, t, id, data, bits_offset, bit_sz);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 81/431 samples/bpf: Fix buffer overflow in tcp_basertt
In reply to Greg Kroah-HartmanFrom: Pengcheng Yang <[email protected]>
[ Upstream commit f4dea9689c5fea3d07170c2cb0703e216f1a0922 ]
Using sizeof(nv) or strlen(nv)+1 is correct.
--- samples/bpf/tcp_basertt_kern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
samples/bpf/tcp_basertt_kern.c +1 -1
@@ -47,7 +47,7 @@ int bpf_basertt(struct bpf_sock_ops *skops)case BPF_SOCK_OPS_BASE_RTT : n =bpf_getsockopt (skops,SOL_TCP ,TCP_CONGESTION , cong,sizeof (cong)); -if (!n && !__builtin_memcmp (cong, nv,sizeof (nv)+1 )) { +if (!n && !__builtin_memcmp (cong, nv,sizeof (nv))) {/* Set base_rtt to 80us */ rv =80 ; }else if (n) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 82/431 spi: spi-geni-qcom: Correct CS_TOGGLE bit in SPI_TRANS_CFG
In reply to Greg Kroah-HartmanFrom: Vijaya Krishna Nivarthi <[email protected]>
[ Upstream commit 5fd7c99ecf45c8ee8a9b1268f0ffc91cc6271da2 ]
The CS_TOGGLE bit when set is supposed to instruct FW to toggle CS line between words. The driver with intent of disabling this behaviour has been unsetting BIT(0). This has not caused any trouble so far because the original BIT(1) is untouched and BIT(0) likely wasn't being used.
Correct this to prevent a potential future bug.
--- drivers/spi/spi-geni-qcom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-geni-qcom.c +1 -1
@@ -35,7 +35,7 @@#define CS_DEMUX_OUTPUT_SEL GENMASK(3, 0)#define SE_SPI_TRANS_CFG 0x25c -#define CS_TOGGLE BIT(0) +#define CS_TOGGLE BIT(1)#define SE_SPI_WORD_LEN 0x268#define WORD_LEN_MSK GENMASK(9, 0)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 83/431 wifi: wilc1000: fix for absent RSN capabilities WFA testcase
In reply to Greg Kroah-HartmanFrom: Amisha Patel <[email protected]>
[ Upstream commit 9ce4bb09123e9754996e358bd808d39f5d112899 ]
Mandatory WFA testcase CT_Security_WPA2Personal_STA_RSNEBoundsVerification-AbsentRSNCap, performs bounds verfication on Beacon and/or Probe response frames. It failed and observed the reason to be absence of cipher suite and AKM suite in RSN information. To fix this, enable the RSN flag before extracting RSN capabilities.
--- drivers/net/wireless/microchip/wilc1000/hif.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/microchip/wilc1000/hif.c +4 -4
@@ -485,6 +485,9 @@ void *wilc_parse_join_bss_param(struct cfg80211_bss *bss,int rsn_ie_len =sizeof (struct element ) + rsn_ie[1 ];int offset =8 ; + param->mode_802_11i =2 ; + param->rsn_found = true; +/* extract RSN capabilities */ if (offset < rsn_ie_len) {/* skip over pairwise suites */
@@ -494,11 +497,8 @@ void *wilc_parse_join_bss_param(struct cfg80211_bss *bss,/* skip over authentication suites */ offset += (rsn_ie[offset] *4 ) +2 ; -if (offset +1 < rsn_ie_len) { - param->mode_802_11i =2 ; - param->rsn_found = true; +if (offset +1 < rsn_ie_len)memcpy (param->rsn_cap, &rsn_ie[offset],2 ); - } } } }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 84/431 wifi: mwifiex: Fix the size of a memory allocation in mwifiex_ret_802_11_scan()
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit d9aef04fcfa81ee4fb2804a21a3712b7bbd936af ]
The type of "mwifiex_adapter->nd_info" is "struct cfg80211_wowlan_nd_info", not "struct cfg80211_wowlan_nd_match".
Use struct_size() to ease the computation of the needed size.
The current code over-allocates some memory, so is safe. But it wastes 32 bytes.
--- drivers/net/wireless/marvell/mwifiex/scan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/marvell/mwifiex/scan.c +3 -3
@@ -2187,9 +2187,9 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,if (nd_config) { adapter->nd_info = -kzalloc (sizeof (struct cfg80211_wowlan_nd_match ) + -sizeof (struct cfg80211_wowlan_nd_match *) * - scan_rsp->number_of_sets,GFP_ATOMIC ); +kzalloc (struct_size (adapter->nd_info, matches, + scan_rsp->number_of_sets), +GFP_ATOMIC );if (adapter->nd_info) adapter->nd_info->n_matches = scan_rsp->number_of_sets;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 85/431 sctp: add bpf_bypass_getsockopt proto callback
In reply to Greg Kroah-HartmanFrom: Alexander Mikhalitsyn <[email protected]>
[ Upstream commit 2598619e012cee5273a2821441b9a051ad931249 ]
Implement ->bpf_bypass_getsockopt proto callback and filter out SCTP_SOCKOPT_PEELOFF, SCTP_SOCKOPT_PEELOFF_FLAGS and SCTP_SOCKOPT_CONNECTX3 socket options from running eBPF hook on them.
SCTP_SOCKOPT_PEELOFF and SCTP_SOCKOPT_PEELOFF_FLAGS options do fd_install(), and if BPF_CGROUP_RUN_PROG_GETSOCKOPT hook returns an error after success of the original handler sctp_getsockopt(...), userspace will receive an error from getsockopt syscall and will be not aware that fd was successfully installed into a fdtable.
As pointed by Marcelo Ricardo Leitner it seems reasonable to skip bpf getsockopt hook for SCTP_SOCKOPT_CONNECTX3 sockopt too. Because internaly, it triggers connect() and if error is masked then userspace will be confused.
This patch was born as a result of discussion around a new SCM_PIDFD interface:
https://lore.kernel.org/all/[email protected]/
--- net/sctp/socket.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
net/sctp/socket.c +18 -0
@@ -8280,6 +8280,22 @@ static int sctp_getsockopt(struct sock *sk, int level, int optname,return retval; } +static bool sctp_bpf_bypass_getsockopt (int level,int optname) +{ +if (level ==SOL_SCTP ) { +switch (optname) { +case SCTP_SOCKOPT_PEELOFF : +case SCTP_SOCKOPT_PEELOFF_FLAGS : +case SCTP_SOCKOPT_CONNECTX3 : +return true; +default : +return false; + } + } + +return false; +} +static int sctp_hash (struct sock *sk) {/* STUB */
@@ -9649,6 +9665,7 @@ struct proto sctp_prot = { .shutdown = sctp_shutdown, .setsockopt = sctp_setsockopt, .getsockopt = sctp_getsockopt, + .bpf_bypass_getsockopt = sctp_bpf_bypass_getsockopt, .sendmsg = sctp_sendmsg, .recvmsg = sctp_recvmsg, .bind = sctp_bind,
@@ -9704,6 +9721,7 @@ struct proto sctpv6_prot = { .shutdown = sctp_shutdown, .setsockopt = sctp_setsockopt, .getsockopt = sctp_getsockopt, + .bpf_bypass_getsockopt = sctp_bpf_bypass_getsockopt, .sendmsg = sctp_sendmsg, .recvmsg = sctp_recvmsg, .bind = sctp_bind,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 86/431 libbpf: fix offsetof() and container_of() to work with CO-RE
In reply to Greg Kroah-HartmanFrom: Andrii Nakryiko <[email protected]>
[ Upstream commit bdeeed3498c7871c17465bb4f11d1bc67f9098af ]
It seems like __builtin_offset() doesn't preserve CO-RE field relocations properly. So if offsetof() macro is defined through __builtin_offset(), CO-RE-enabled BPF code using container_of() will be subtly and silently broken.
To avoid this problem, redefine offsetof() and container_of() in the form that works with CO-RE relocations more reliably.
--- tools/lib/bpf/bpf_helpers.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
tools/lib/bpf/bpf_helpers.h +10 -5
@@ -77,16 +77,21 @@/* * Helper macros to manipulate data structures */ -#ifndef offsetof -#define offsetof (TYPE ,MEMBER ) ((unsigned long)&((TYPE *)0)->MEMBER) -#endif -#ifndef container_of + +/* offsetof() definition that uses __builtin_offset() might not preserve field +* offset CO-RE relocation properly, so force-redefine offsetof() using +* old-school approach which works with CO-RE correctly +*/ +#undef offsetof +#define offsetof (type, member) ((unsigned long)&((type *)0)->member) + +/* redefined container_of() to ensure we use the above offsetof() macro */ +#undef container_of#define container_of (ptr, type, member) \ ({ \ void *__mptr = (void *)(ptr); \ ((type *)(__mptr - offsetof(type, member))); \ }) -#endif /* * Compiler (optimization) barrier.
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 87/431 bpf: Dont EFAULT for {g,s}setsockopt with wrong optlen
In reply to Greg Kroah-HartmanFrom: Stanislav Fomichev <[email protected]>
[ Upstream commit 29ebbba7d46136cba324264e513a1e964ca16c0a ]
With the way the hooks implemented right now, we have a special
condition: optval larger than PAGE_SIZE will expose only first 4k into BPF; any modifications to the optval are ignored. If the BPF program doesn't handle this condition by resetting optlen to 0,
the userspace will get EFAULT.
The intention of the EFAULT was to make it apparent to the developers that the program is doing something wrong. However, this inadvertently might affect production workloads with the BPF programs that are not too careful (i.e., returning EFAULT for perfectly valid setsockopt/getsockopt calls).
Let's try to minimize the chance of BPF program screwing up userspace by ignoring the output of those BPF programs (instead of returning EFAULT to the userspace). pr_info_once those cases to
the dmesg to help with figuring out what's going wrong.
--- kernel/bpf/cgroup.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
kernel/bpf/cgroup.c +15 -0
@@ -1826,6 +1826,12 @@ int __cgroup_bpf_run_filter_setsockopt(struct sock *sk, int *level, ret =1 ; }else if (ctx.optlen > max_optlen || ctx.optlen <-1 ) {/* optlen is out of bounds */ +if (*optlen >PAGE_SIZE && ctx.optlen >=0 ) { +pr_info_once ("bpf setsockopt: ignoring program buffer with optlen=%d (max_optlen=%d)\n" , + ctx.optlen, max_optlen); + ret =0 ; + goto out; + } ret = -EFAULT ; }else {/* optlen within bounds, run kernel handler */
@@ -1881,8 +1887,10 @@ int __cgroup_bpf_run_filter_getsockopt(struct sock *sk, int level, .optname = optname, .current_task = current, }; +int orig_optlen;int ret; + orig_optlen = max_optlen; ctx.optlen = max_optlen; max_optlen =sockopt_alloc_buf (&ctx, max_optlen, &buf);if (max_optlen <0 )
@@ -1905,6 +1913,7 @@ int __cgroup_bpf_run_filter_getsockopt(struct sock *sk, int level, ret = -EFAULT ; goto out; } + orig_optlen = ctx.optlen;if (copy_from_user (ctx.optval, optval,min (ctx.optlen, max_optlen)) !=0 ) {
@@ -1922,6 +1931,12 @@ int __cgroup_bpf_run_filter_getsockopt(struct sock *sk, int level, goto out;if (optval && (ctx.optlen > max_optlen || ctx.optlen <0 )) { +if (orig_optlen >PAGE_SIZE && ctx.optlen >=0 ) { +pr_info_once ("bpf getsockopt: ignoring program buffer with optlen=%d (max_optlen=%d)\n" , + ctx.optlen, max_optlen); + ret = retval; + goto out; + } ret = -EFAULT ; goto out; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 88/431 spi: dw: Round of n_bytes to power of 2
In reply to Greg Kroah-HartmanFrom: Joy Chakraborty <[email protected]>
[ Upstream commit 9f34baf67e4d08908fd94ff29c825bb673295336 ]
n_bytes variable in the driver represents the number of bytes per word that needs to be sent/copied to fifo. Bits/word can be between 8 and 32 bits from the client but in memory they are a power of 2, same is mentioned in spi.h header:
"
* @bits_per_word: Data transfers involve one or more words; word sizes
* like eight or 12 bits are common. In-memory wordsizes are * powers of two bytes (e.g. 20 bit samples use 32 bits). * This may be changed by the device's driver, or left at the * default (0) indicating protocol words are eight bit bytes. * The spi_transfer.bits_per_word can override this for each transfer.
"
Hence, round of n_bytes to a power of 2 to avoid values like 3 which would generate unalligned/odd accesses to memory/fifo.
* tested on Baikal-T1 based system with DW SPI-looped back interface transferring a chunk of data with DFS:8,12,16.
--- drivers/spi/spi-dw-core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/spi/spi-dw-core.c +4 -1
@@ -426,7 +426,10 @@ static int dw_spi_transfer_one(struct spi_controller *master,int ret; dws->dma_mapped =0 ; - dws->n_bytes =DIV_ROUND_UP (transfer->bits_per_word,BITS_PER_BYTE ); + dws->n_bytes = +roundup_pow_of_two (DIV_ROUND_UP (transfer->bits_per_word, +BITS_PER_BYTE )); + dws->tx = (void *)transfer->tx_buf; dws->tx_len = transfer->len / dws->n_bytes; dws->rx = transfer->rx_buf;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 89/431 nfc: llcp: fix possible use of uninitialized variable in nfc_llcp_send_connect()
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 0d9b41daa5907756a31772d8af8ac5ff25cf17c1 ]
If sock->service_name is NULL, the local variable service_name_tlv_length will not be assigned by nfc_llcp_build_tlv(), later leading to using value frmo the stack. Smatch warning:
net/nfc/llcp_commands.c:442 nfc_llcp_send_connect() error: uninitialized symbol 'service_name_tlv_length'.
--- net/nfc/llcp_commands.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/nfc/llcp_commands.c +2 -1
@@ -390,7 +390,8 @@ int nfc_llcp_send_connect(struct nfc_llcp_sock *sock)const u8 *service_name_tlv =NULL ;const u8 *miux_tlv =NULL ;const u8 *rw_tlv =NULL ; -u8 service_name_tlv_length, miux_tlv_length, rw_tlv_length, rw; +u8 service_name_tlv_length =0 ; +u8 miux_tlv_length, rw_tlv_length, rw;int err;u16 size =0 ;__be16 miux;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 90/431 bpftool: JIT limited misreported as negative value on aarch64
In reply to Greg Kroah-HartmanFrom: Alan Maguire <[email protected]>
[ Upstream commit 04cb8453a91c7c22f60ddadb6cef0d19abb33bb5 ]
On aarch64, "bpftool feature" reports an incorrect BPF JIT limit:
$ sudo /sbin/bpftool feature Scanning system configuration... bpf() syscall restricted to privileged users JIT compiler is enabled JIT compiler hardening is disabled JIT compiler kallsyms exports are enabled for root skipping kernel config, can't open file: No such file or directory Global memory limit for JIT compiler for unprivileged users is -201326592 bytes
This is because /proc/sys/net/core/bpf_jit_limit reports
$ sudo cat /proc/sys/net/core/bpf_jit_limit 68169519595520
...and an int is assumed in read_procfs(). Change read_procfs() to return a long to avoid negative value reporting.
--- tools/bpf/bpftool/feature.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
tools/bpf/bpftool/feature.c +12 -12
@@ -167,12 +167,12 @@ static int get_vendor_id(int ifindex)return strtol (buf,NULL ,0 ); } -static int read_procfs (const char *path) +static long read_procfs (const char *path) {char *endptr, *line =NULL ;size_t len =0 ;FILE *fd; -int res; +long res; fd =fopen (path,"r" );if (!fd)
@@ -194,7 +194,7 @@ static int read_procfs(const char *path)static void probe_unprivileged_disabled (void ) { -int res; +long res;/* No support for C-style ouptut */
@@ -216,14 +216,14 @@ static void probe_unprivileged_disabled(void)printf ("Unable to retrieve required privileges for bpf() syscall\n" );break ;default : -printf ("bpf() syscall restriction has unknown value %d\n" , res); +printf ("bpf() syscall restriction has unknown value %ld\n" , res); } } }static void probe_jit_enable (void ) { -int res; +long res;/* No support for C-style ouptut */
@@ -245,7 +245,7 @@ static void probe_jit_enable(void)printf ("Unable to retrieve JIT-compiler status\n" );break ;default : -printf ("JIT-compiler status has unknown value %d\n" , +printf ("JIT-compiler status has unknown value %ld\n" , res); } }
@@ -253,7 +253,7 @@ static void probe_jit_enable(void)static void probe_jit_harden (void ) { -int res; +long res;/* No support for C-style ouptut */
@@ -275,7 +275,7 @@ static void probe_jit_harden(void)printf ("Unable to retrieve JIT hardening status\n" );break ;default : -printf ("JIT hardening status has unknown value %d\n" , +printf ("JIT hardening status has unknown value %ld\n" , res); } }
@@ -283,7 +283,7 @@ static void probe_jit_harden(void)static void probe_jit_kallsyms (void ) { -int res; +long res;/* No support for C-style ouptut */
@@ -302,14 +302,14 @@ static void probe_jit_kallsyms(void)printf ("Unable to retrieve JIT kallsyms export status\n" );break ;default : -printf ("JIT kallsyms exports status has unknown value %d\n" , res); +printf ("JIT kallsyms exports status has unknown value %ld\n" , res); } } }static void probe_jit_limit (void ) { -int res; +long res;/* No support for C-style ouptut */
@@ -322,7 +322,7 @@ static void probe_jit_limit(void)printf ("Unable to retrieve global memory limit for JIT compiler for unprivileged users\n" );break ;default : -printf ("Global memory limit for JIT compiler for unprivileged users is %d bytes\n" , res); +printf ("Global memory limit for JIT compiler for unprivileged users is %ld bytes\n" , res); } } }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 91/431 bpf: Remove bpf trampoline selector
In reply to Greg Kroah-HartmanFrom: Yafang Shao <[email protected]>
[ Upstream commit 47e79cbeea4b3891ad476047f4c68543eb51c8e0 ]
After commit e21aa341785c ("bpf: Fix fexit trampoline."), the selector is only used to indicate how many times the bpf trampoline image are updated and been displayed in the trampoline ksym name. After the trampoline is freed, the selector will start from 0 again. So the selector is a useless value to the user. We can remove it.
If the user want to check whether the bpf trampoline image has been updated or not, the user can compare the address. Each time the trampoline image is updated, the address will change consequently. Jiri also pointed out another issue that perf is still using the old name "bpf_trampoline_%lu", so this change can fix the issue in perf.
--- include/linux/bpf.h | 1 - kernel/bpf/trampoline.c | 11 ++++------- 2 files changed, 4 insertions(+), 8 deletions(-)
include/linux/bpf.h +0 -1
@@ -1082,7 +1082,6 @@ struct bpf_trampoline {int progs_cnt[BPF_TRAMP_MAX ];/* Executable image of trampoline */ struct bpf_tramp_image *cur_image; -u64 selector;struct module *mod; };
kernel/bpf/trampoline.c +4 -7
@@ -372,7 +372,7 @@ static void bpf_tramp_image_put(struct bpf_tramp_image *im)call_rcu_tasks_trace (&im->rcu, __bpf_tramp_image_put_rcu_tasks); } -static struct bpf_tramp_image *bpf_tramp_image_alloc (u64 key,u32 idx) +static struct bpf_tramp_image *bpf_tramp_image_alloc (u64 key) {struct bpf_tramp_image *im;struct bpf_ksym *ksym;
@@ -399,7 +399,7 @@ static struct bpf_tramp_image *bpf_tramp_image_alloc(u64 key, u32 idx) ksym = &im->ksym;INIT_LIST_HEAD_RCU (&ksym->lnode); -snprintf (ksym->name,KSYM_NAME_LEN ,"bpf_trampoline_%llu_%u" , key, idx); +snprintf (ksym->name,KSYM_NAME_LEN ,"bpf_trampoline_%llu" , key);bpf_image_ksym_add (image, ksym);return im;
@@ -429,11 +429,10 @@ static int bpf_trampoline_update(struct bpf_trampoline *tr, bool lock_direct_mut err =unregister_fentry (tr, tr->cur_image->image);bpf_tramp_image_put (tr->cur_image); tr->cur_image =NULL ; - tr->selector =0 ; goto out; } - im =bpf_tramp_image_alloc (tr->key, tr->selector); + im =bpf_tramp_image_alloc (tr->key);if (IS_ERR (im)) { err =PTR_ERR (im); goto out;
@@ -470,8 +469,7 @@ static int bpf_trampoline_update(struct bpf_trampoline *tr, bool lock_direct_mutset_memory_rox ((long )im->image,1 ); -WARN_ON (tr->cur_image && tr->selector ==0 ); -WARN_ON (!tr->cur_image && tr->selector); +WARN_ON (tr->cur_image && total ==0 );if (tr->cur_image)/* progs already running at this address */ err =modify_fentry (tr, tr->cur_image->image, im->image, lock_direct_mutex);
@@ -501,7 +499,6 @@ static int bpf_trampoline_update(struct bpf_trampoline *tr, bool lock_direct_mutif (tr->cur_image)bpf_tramp_image_put (tr->cur_image); tr->cur_image = im; - tr->selector++; out:/* If any error happens, restore previous flags */ if (err)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 92/431 bpf: Fix memleak due to fentry attach failure
In reply to Greg Kroah-HartmanFrom: Yafang Shao <[email protected]>
[ Upstream commit 108598c39eefbedc9882273ac0df96127a629220 ]
If it fails to attach fentry, the allocated bpf trampoline image will be left in the system. That can be verified by checking /proc/kallsyms.
This meamleak can be verified by a simple bpf program as follows:
SEC("fentry/trap_init")
int fentry_run()
{
return 0;
}It will fail to attach trap_init because this function is freed after kernel init, and then we can find the trampoline image is left in the system by checking /proc/kallsyms.
$ tail /proc/kallsyms ffffffffc0613000 t bpf_trampoline_6442453466_1 [bpf] ffffffffc06c3000 t bpf_trampoline_6442453466_1 [bpf]
$ bpftool btf dump file /sys/kernel/btf/vmlinux | grep "FUNC 'trap_init'" [2522] FUNC 'trap_init' type_id=119 linkage=static
$ echo $((6442453466 & 0x7fffffff)) 2522
Note that there are two left bpf trampoline images, that is because the libbpf will fallback to raw tracepoint if -EINVAL is returned.
--- kernel/bpf/trampoline.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)
kernel/bpf/trampoline.c +15 -6
@@ -279,11 +279,8 @@ bpf_trampoline_get_progs(const struct bpf_trampoline *tr, int *total, bool *ip_areturn tlinks; } -static void __bpf_tramp_image_put_deferred (struct work_struct *work) +static void bpf_tramp_image_free (struct bpf_tramp_image *im) { -struct bpf_tramp_image *im; - - im = container_of(work, struct bpf_tramp_image, work);bpf_image_ksym_del (&im->ksym);bpf_jit_free_exec (im->image);bpf_jit_uncharge_modmem (PAGE_SIZE );
@@ -291,6 +288,14 @@ static void __bpf_tramp_image_put_deferred(struct work_struct *work)kfree_rcu (im, rcu); } +static void __bpf_tramp_image_put_deferred (struct work_struct *work) +{ +struct bpf_tramp_image *im; + + im = container_of(work, struct bpf_tramp_image, work); +bpf_tramp_image_free (im); +} +/* callback, fexit step 3 or fentry step 2 */ static void __bpf_tramp_image_put_rcu (struct rcu_head *rcu) {
@@ -465,7 +470,7 @@ static int bpf_trampoline_update(struct bpf_trampoline *tr, bool lock_direct_mut &tr->func.model, tr->flags, tlinks, tr->func.addr);if (err <0 ) - goto out; + goto out_free;set_memory_rox ((long )im->image,1 );
@@ -494,7 +499,7 @@ static int bpf_trampoline_update(struct bpf_trampoline *tr, bool lock_direct_mut }#endif if (err) - goto out; + goto out_free;if (tr->cur_image)bpf_tramp_image_put (tr->cur_image);
@@ -505,6 +510,10 @@ static int bpf_trampoline_update(struct bpf_trampoline *tr, bool lock_direct_mut tr->flags = orig_flags;kfree (tlinks);return err; + +out_free: +bpf_tramp_image_free (im); + goto out; }static enum bpf_tramp_prog_type bpf_attach_type_to_tramp (struct bpf_prog *prog)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 93/431 selftests/bpf: Do not use sign-file as testcase
In reply to Greg Kroah-HartmanFrom: Alexey Gladkov <[email protected]>
[ Upstream commit f04a32b2c5b539e3c097cb5c7c1df12a8f4a0cf0 ]
The sign-file utility (from scripts/) is used in prog_tests/verify_pkcs7_sig.c, but the utility should not be called as a test. Executing this utility produces the following error:
selftests: /linux/tools/testing/selftests/bpf: urandom_read ok 16 selftests: /linux/tools/testing/selftests/bpf: urandom_read
selftests: /linux/tools/testing/selftests/bpf: sign-file
not ok 17 selftests: /linux/tools/testing/selftests/bpf: sign-file # exit=2
Also, urandom_read is mistakenly used as a test. It does not lead to an error, but should be moved over to TEST_GEN_FILES as well. The empty TEST_CUSTOM_PROGS can then be removed.
--- tools/testing/selftests/bpf/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
tools/testing/selftests/bpf/Makefile +1 -2
@@ -88,8 +88,7 @@ TEST_GEN_PROGS_EXTENDED = test_sock_addr test_skb_cgroup_id_user \ xskxceiver xdp_redirect_multi xdp_synproxy veristat xdp_hw_metadata \ xdp_features -TEST_CUSTOM_PROGS = $(OUTPUT)/urandom_read $(OUTPUT)/sign-file -TEST_GEN_FILES += liburandom_read.so +TEST_GEN_FILES += liburandom_read.so urandom_read sign-file # Emit succinct information message describing current building step # $1 - generic step name (e.g., CC, LINK, etc);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 94/431 regulator: core: Fix more error checking for debugfs_create_dir()
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 2715bb11cfff964aa33946847f9527cfbd4874f5 ]
In case of failure, debugfs_create_dir() does not return NULL, but an error pointer. Most incorrect error checks were fixed, but the one in create_regulator() was forgotten.
Fix the remaining error check.
--- drivers/regulator/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/core.c +1 -1
@@ -1918,7 +1918,7 @@ static struct regulator *create_regulator(struct regulator_dev *rdev,if (err != -EEXIST ) regulator->debugfs =debugfs_create_dir (supply_name, rdev->debugfs); -if (!regulator->debugfs) { +if (IS_ERR (regulator->debugfs)) {rdev_dbg (rdev,"Failed to create debugfs directory\n" ); }else { debugfs_create_u32("uA_load", 0444, regulator->debugfs,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 95/431 regulator: core: Streamline debugfs operations
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 08880713ceec023dd94d634f1e8902728c385939 ]
If CONFIG_DEBUG_FS is not set:
regulator: Failed to create debugfs directory
...
regulator-dummy: Failed to create debugfs directory
As per the comments for debugfs_create_dir(), errors returned by this function should be expected, and ignored:
* If debugfs is not enabled in the kernel, the value -%ENODEV will be
* returned.
*
* NOTE: it's expected that most callers should _ignore_ the errors returned
* by this function. Other debugfs functions handle the fact that the "dentry"
* passed to them could be an error and they don't crash in that case.
* Drivers should generally work fine even if debugfs fails to init anyway.
Adhere to the debugfs spirit, and streamline all operations by:
1. Demoting the importance of the printed error messages to debug level, like is already done in create_regulator(),
2. Further ignoring any returned errors, as by design, all debugfs functions are no-ops when passed an error pointer.
--- drivers/regulator/core.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-)
drivers/regulator/core.c +13 -17
@@ -1918,19 +1918,17 @@ static struct regulator *create_regulator(struct regulator_dev *rdev,if (err != -EEXIST ) regulator->debugfs =debugfs_create_dir (supply_name, rdev->debugfs); -if (IS_ERR (regulator->debugfs)) { +if (IS_ERR (regulator->debugfs))rdev_dbg (rdev,"Failed to create debugfs directory\n" ); - }else { -debugfs_create_u32 ("uA_load" ,0444 , regulator->debugfs, - ®ulator->uA_load); -debugfs_create_u32 ("min_uV" ,0444 , regulator->debugfs, - ®ulator->voltage[PM_SUSPEND_ON ].min_uV); -debugfs_create_u32 ("max_uV" ,0444 , regulator->debugfs, - ®ulator->voltage[PM_SUSPEND_ON ].max_uV); -debugfs_create_file ("constraint_flags" ,0444 , - regulator->debugfs, regulator, - &constraint_flags_fops); - } + +debugfs_create_u32 ("uA_load" ,0444 , regulator->debugfs, + ®ulator->uA_load); +debugfs_create_u32 ("min_uV" ,0444 , regulator->debugfs, + ®ulator->voltage[PM_SUSPEND_ON ].min_uV); +debugfs_create_u32 ("max_uV" ,0444 , regulator->debugfs, + ®ulator->voltage[PM_SUSPEND_ON ].max_uV); +debugfs_create_file ("constraint_flags" ,0444 , regulator->debugfs, + regulator, &constraint_flags_fops);/* * Check now if the regulator is an always on regulator - if
@@ -5263,10 +5261,8 @@ static void rdev_init_debugfs(struct regulator_dev *rdev) } rdev->debugfs =debugfs_create_dir (rname, debugfs_root); -if (IS_ERR (rdev->debugfs)) { -rdev_warn (rdev,"Failed to create debugfs directory\n" ); -return ; - } +if (IS_ERR (rdev->debugfs)) +rdev_dbg (rdev,"Failed to create debugfs directory\n" );debugfs_create_u32 ("use_count" ,0444 , rdev->debugfs, &rdev->use_count);
@@ -6186,7 +6182,7 @@ static int __init regulator_init(void) debugfs_root =debugfs_create_dir ("regulator" ,NULL );if (IS_ERR (debugfs_root)) -pr_warn ("regulator: Failed to create debugfs directory\n" ); +pr_debug ("regulator: Failed to create debugfs directory\n" );#ifdef CONFIG_DEBUG_FS debugfs_create_file("supply_map", 0444, debugfs_root, NULL,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 96/431 wifi: orinoco: Fix an error handling path in spectrum_cs_probe()
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit 925244325159824385209e3e0e3f91fa6bf0646c ]
Should spectrum_cs_config() fail, some resources need to be released as already done in the remove function.
While at it, remove a useless and erroneous comment. The probe is spectrum_cs_probe(), not spectrum_cs_attach().
--- drivers/net/wireless/intersil/orinoco/spectrum_cs.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/net/wireless/intersil/orinoco/spectrum_cs.c +11 -2
@@ -157,6 +157,7 @@ spectrum_cs_probe(struct pcmcia_device *link) {struct orinoco_private *priv;struct orinoco_pccard *card; +int ret; priv = alloc_orinocodev(sizeof(*card), &link->dev, spectrum_cs_hard_reset,
@@ -169,8 +170,16 @@ spectrum_cs_probe(struct pcmcia_device *link) card->p_dev = link; link->priv = priv; -return spectrum_cs_config (link); -}/* spectrum_cs_attach */ + ret =spectrum_cs_config (link); +if (ret) + goto err_free_orinocodev; + +return 0 ; + +err_free_orinocodev: +free_orinocodev (priv); +return ret; +}static void spectrum_cs_detach (struct pcmcia_device *link) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 97/431 wifi: orinoco: Fix an error handling path in orinoco_cs_probe()
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit 67a81d911c01225f426cc6bee2373df044c1a9b7 ]
Should orinoco_cs_config() fail, some resources need to be released as already done in the remove function.
While at it, remove a useless and erroneous comment. The probe is orinoco_cs_probe(), not orinoco_cs_attach().
--- drivers/net/wireless/intersil/orinoco/orinoco_cs.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/net/wireless/intersil/orinoco/orinoco_cs.c +11 -2
@@ -96,6 +96,7 @@ orinoco_cs_probe(struct pcmcia_device *link) {struct orinoco_private *priv;struct orinoco_pccard *card; +int ret; priv =alloc_orinocodev (sizeof (*card), &link->dev, orinoco_cs_hard_reset,NULL );
@@ -107,8 +108,16 @@ orinoco_cs_probe(struct pcmcia_device *link) card->p_dev = link; link->priv = priv; -return orinoco_cs_config (link); -}/* orinoco_cs_attach */ + ret =orinoco_cs_config (link); +if (ret) + goto err_free_orinocodev; + +return 0 ; + +err_free_orinocodev: +free_orinocodev (priv); +return ret; +}static void orinoco_cs_detach (struct pcmcia_device *link) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 98/431 wifi: atmel: Fix an error handling path in atmel_probe()
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit 6b92e4351a29af52c285fe235e6e4d1a75de04b2 ]
Should atmel_config() fail, some resources need to be released as already done in the remove function.
While at it, remove a useless and erroneous comment. The probe is atmel_probe(), not atmel_attach().
--- drivers/net/wireless/atmel/atmel_cs.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/net/wireless/atmel/atmel_cs.c +11 -2
@@ -72,6 +72,7 @@ struct local_info {static int atmel_probe (struct pcmcia_device *p_dev) {struct local_info *local; +int ret;dev_dbg (&p_dev->dev,"atmel_attach()\n" );
@@ -82,8 +83,16 @@ static int atmel_probe(struct pcmcia_device *p_dev) p_dev->priv = local; -return atmel_config (p_dev); -}/* atmel_attach */ + ret =atmel_config (p_dev); +if (ret) + goto err_free_priv; + +return 0 ; + +err_free_priv: +kfree (p_dev->priv); +return ret; +}static void atmel_detach (struct pcmcia_device *link) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 99/431 wifi: wl3501_cs: Fix an error handling path in wl3501_probe()
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit 391af06a02e7642039ac5f6c4b2c034ab0992b5d ]
Should wl3501_config() fail, some resources need to be released as already done in the remove function.
--- drivers/net/wireless/wl3501_cs.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
drivers/net/wireless/wl3501_cs.c +11 -5
@@ -1862,6 +1862,7 @@ static int wl3501_probe(struct pcmcia_device *p_dev) {struct net_device *dev;struct wl3501_card *this; +int ret;/* The io structure describes IO port mapping */ p_dev->resource[0 ]->end =16 ;
@@ -1873,8 +1874,7 @@ static int wl3501_probe(struct pcmcia_device *p_dev) dev =alloc_etherdev (sizeof (struct wl3501_card ));if (!dev) - goto out_link; - +return -ENOMEM ; dev->netdev_ops = &wl3501_netdev_ops; dev->watchdog_timeo =5 *HZ ;
@@ -1887,9 +1887,15 @@ static int wl3501_probe(struct pcmcia_device *p_dev)netif_stop_queue (dev); p_dev->priv = dev; -return wl3501_config (p_dev); -out_link: -return -ENOMEM ; + ret =wl3501_config (p_dev); +if (ret) + goto out_free_etherdev; + +return 0 ; + +out_free_etherdev: +free_netdev (dev); +return ret; }static int wl3501_config (struct pcmcia_device *link)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 100/431 wifi: ray_cs: Fix an error handling path in ray_probe()
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit 4f8d66a9fb2edcd05c1e563456a55a08910bfb37 ]
Should ray_config() fail, some resources need to be released as already done in the remove function.
While at it, remove a useless and erroneous comment. The probe is ray_probe(), not ray_attach().
--- drivers/net/wireless/ray_cs.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
drivers/net/wireless/ray_cs.c +11 -5
@@ -270,13 +270,14 @@ static int ray_probe(struct pcmcia_device *p_dev) {ray_dev_t *local;struct net_device *dev; +int ret;dev_dbg (&p_dev->dev,"ray_attach()\n" );/* Allocate space for private device-specific data */ dev =alloc_etherdev (sizeof (ray_dev_t));if (!dev) - goto fail_alloc_dev; +return -ENOMEM ; local =netdev_priv (dev); local->finder = p_dev;
@@ -313,11 +314,16 @@ static int ray_probe(struct pcmcia_device *p_dev)timer_setup (&local->timer,NULL ,0 ); this_device = p_dev; -return ray_config (p_dev); + ret =ray_config (p_dev); +if (ret) + goto err_free_dev; + +return 0 ; -fail_alloc_dev: -return -ENOMEM ; -}/* ray_attach */ +err_free_dev: +free_netdev (dev); +return ret; +}static void ray_detach (struct pcmcia_device *link) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 101/431 wifi: ath9k: dont allow to overwrite ENDPOINT0 attributes
In reply to Greg Kroah-HartmanFrom: Fedor Pchelkin <[email protected]>
[ Upstream commit 061b0cb9327b80d7a0f63a33e7c3e2a91a71f142 ]
A bad USB device is able to construct a service connection response message with target endpoint being ENDPOINT0 which is reserved for HTC_CTRL_RSVD_SVC and should not be modified to be used for any other services.
Reject such service connection responses.
Found by Linux Verification Center (linuxtesting.org) with Syzkaller.
--- drivers/net/wireless/ath/ath9k/htc_hst.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/htc_hst.c +7 -1
@@ -114,7 +114,13 @@ static void htc_process_conn_rsp(struct htc_target *target,if (svc_rspmsg->status ==HTC_SERVICE_SUCCESS ) { epid = svc_rspmsg->endpoint_id; -if (epid <0 || epid >=ENDPOINT_MAX ) + +/* Check that the received epid for the endpoint to attach +* a new service is valid. ENDPOINT0 can't be used here as it +* is already reserved for HTC_CTRL_RSVD_SVC service and thus +* should not be modified. +*/ +if (epid <=ENDPOINT0 || epid >=ENDPOINT_MAX )return ; service_id =be16_to_cpu (svc_rspmsg->service_id);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 102/431 wifi: rtw88: usb: silence log flooding error message
In reply to Greg Kroah-HartmanFrom: Sascha Hauer <[email protected]>
[ Upstream commit 1f1784a59caf3eefd127908a1a3cf224017ff9c7 ]
When receiving more rx packets than the kernel can handle the driver drops the packets and issues an error message. This is bad for two reasons. The logs are flooded with myriads of messages, but then time consumed for printing messages in that critical code path brings down the device. After some time of excessive rx load the driver responds with:
rtw_8822cu 1-1:1.2: failed to get tx report from firmware rtw_8822cu 1-1:1.2: firmware failed to report density after scan rtw_8822cu 1-1:1.2: firmware failed to report density after scan
The device stops working until being replugged.
Fix this by lowering the priority to debug level and also by ratelimiting it.
--- drivers/net/wireless/realtek/rtw88/usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw88/usb.c +1 -1
@@ -535,7 +535,7 @@ static void rtw_usb_rx_handler(struct work_struct *work) }if (skb_queue_len (&rtwusb->rx_queue) >=RTW_USB_MAX_RXQ_LEN ) { -rtw_err (rtwdev,"failed to get rx_queue, overflow\n" ); +dev_dbg_ratelimited (rtwdev->dev,"failed to get rx_queue, overflow\n" );dev_kfree_skb_any (skb);continue ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 103/431 samples/bpf: xdp1 and xdp2 reduce XDPBUFSIZE to 60
In reply to Greg Kroah-HartmanFrom: Jesper Dangaard Brouer <[email protected]>
[ Upstream commit 60548b825b082cedf89b275c21c28b1e1d030e50 ]
Default samples/pktgen scripts send 60 byte packets as hardware adds 4-bytes FCS checksum, which fulfils minimum Ethernet 64 bytes frame size.
XDP layer will not necessary have access to the 4-bytes FCS checksum.
This leads to bpf_xdp_load_bytes() failing as it tries to copy 64-bytes from an XDP packet that only have 60-bytes available.
--- samples/bpf/xdp1_kern.c | 2 +- samples/bpf/xdp2_kern.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
samples/bpf/xdp1_kern.c +1 -1
@@ -39,7 +39,7 @@ static int parse_ipv6(void *data, u64 nh_off, void *data_end)return ip6h->nexthdr; } -#define XDPBUFSIZE 64 +#define XDPBUFSIZE 60 SEC("xdp.frags")int xdp_prog1 (struct xdp_md *ctx) {
samples/bpf/xdp2_kern.c +1 -1
@@ -55,7 +55,7 @@ static int parse_ipv6(void *data, u64 nh_off, void *data_end)return ip6h->nexthdr; } -#define XDPBUFSIZE 64 +#define XDPBUFSIZE 60 SEC("xdp.frags")int xdp_prog1 (struct xdp_md *ctx) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 104/431 wifi: ath10k: Trigger STA disconnect after reconfig complete on hardware restart
In reply to Greg Kroah-HartmanFrom: Youghandhar Chintala <[email protected]>
[ Upstream commit 75bd32f5ce94bc365ba0b9b68bcf9de84a391d37 ]
Currently, on WCN3990, the station disconnect after hardware recovery is not working as expected. This is because of setting the IEEE80211_SDATA_DISCONNECT_HW_RESTART flag very early in the hardware recovery process even before the driver invokes ieee80211_hw_restart(). On the contrary, mac80211 expects this flag to be set after ieee80211_hw_restart() is invoked for it to trigger station disconnect.
Set the IEEE80211_SDATA_DISCONNECT_HW_RESTART flag in ath10k_reconfig_complete() instead to fix this.
The other targets are not affected by this change, since the hardware params flag is not set.
Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.2.2.c10-00754-QCAHLSWMTPL-1
--- drivers/net/wireless/ath/ath10k/core.c | 9 --------- drivers/net/wireless/ath/ath10k/mac.c | 7 +++++++ 2 files changed, 7 insertions(+), 9 deletions(-)
drivers/net/wireless/ath/ath10k/core.c +0 -9
@@ -2504,7 +2504,6 @@ EXPORT_SYMBOL(ath10k_core_napi_sync_disable);static void ath10k_core_restart (struct work_struct *work) { struct ath10k *ar = container_of(work, struct ath10k, restart_work); -struct ath10k_vif *arvif;int ret;set_bit (ATH10K_FLAG_CRASH_FLUSH , &ar->dev_flags);
@@ -2543,14 +2542,6 @@ static void ath10k_core_restart(struct work_struct *work) ar->state =ATH10K_STATE_RESTARTING ;ath10k_halt (ar);ath10k_scan_finish (ar); -if (ar->hw_params.hw_restart_disconnect) { -list_for_each_entry (arvif, &ar->arvifs, list) { -if (arvif->is_up && - arvif->vdev_type ==WMI_VDEV_TYPE_STA ) -ieee80211_hw_restart_disconnect (arvif->vif); - } - } -ieee80211_restart_hw (ar->hw);break ;case ATH10K_STATE_OFF :
drivers/net/wireless/ath/ath10k/mac.c +7 -0
@@ -8108,6 +8108,7 @@ static void ath10k_reconfig_complete(struct ieee80211_hw *hw, enum ieee80211_reconfig_type reconfig_type) {struct ath10k *ar = hw->priv; +struct ath10k_vif *arvif;if (reconfig_type !=IEEE80211_RECONFIG_TYPE_RESTART )return ;
@@ -8122,6 +8123,12 @@ static void ath10k_reconfig_complete(struct ieee80211_hw *hw, ar->state =ATH10K_STATE_ON ;ieee80211_wake_queues (ar->hw);clear_bit (ATH10K_FLAG_RESTARTING , &ar->dev_flags); +if (ar->hw_params.hw_restart_disconnect) { +list_for_each_entry (arvif, &ar->arvifs, list) { +if (arvif->is_up && arvif->vdev_type ==WMI_VDEV_TYPE_STA ) +ieee80211_hw_restart_disconnect (arvif->vif); + } + } }mutex_unlock (&ar->conf_mutex);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 105/431 tools/resolve_btfids: Fix setting HOSTCFLAGS
In reply to Greg Kroah-HartmanFrom: Viktor Malik <[email protected]>
[ Upstream commit edd75c802855271c8610f58a2fc9e54aefc49ce5 ]
Building BPF selftests with custom HOSTCFLAGS yields an error:
# make HOSTCFLAGS="-O2"
[...]
HOSTCC ./tools/testing/selftests/bpf/tools/build/resolve_btfids/main.o
main.c:73:10: fatal error: linux/rbtree.h: No such file or directory
73 | #include <linux/rbtree.h>
| ^~~~~~~~~~~~~~~~The reason is that tools/bpf/resolve_btfids/Makefile passes header include paths by extending HOSTCFLAGS which is overridden by setting HOSTCFLAGS in the make command (because of Makefile rules [1]).
This patch fixes the above problem by passing the include paths via HOSTCFLAGS_resolve_btfids which is used by tools/build/Build.include and can be combined with overridding HOSTCFLAGS.
[1] https://www.gnu.org/software/make/manual/html_node/Overriding.html
--- tools/bpf/resolve_btfids/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/bpf/resolve_btfids/Makefile +2 -2
@@ -67,7 +67,7 @@ $(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(LIBBPF_OU LIBELF_FLAGS := $(shell $(HOSTPKG_CONFIG) libelf --cflags 2>/dev/null) LIBELF_LIBS := $(shell $(HOSTPKG_CONFIG) libelf --libs 2>/dev/null || echo -lelf) -HOSTCFLAGS += -g \ +HOSTCFLAGS_resolve_btfids += -g \ -I$(srctree)/tools/include \ -I$(srctree)/tools/include/uapi \ -I$(LIBBPF_INCLUDE) \
@@ -76,7 +76,7 @@ HOSTCFLAGS += -g \ LIBS = $(LIBELF_LIBS) -lz -export srctree OUTPUT HOSTCFLAGS Q HOSTCC HOSTLD HOSTAR +export srctree OUTPUT HOSTCFLAGS_resolve_btfids Q HOSTCC HOSTLD HOSTAR include $(srctree)/tools/build/Makefile.include $(BINARY_IN): fixdep FORCE prepare | $(OUTPUT)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 106/431 wifi: mac80211: recalc min chandef for new STA links
In reply to Greg Kroah-HartmanFrom: Johannes Berg <[email protected]>
[ Upstream commit ba7af2654e3b7b810c750b3c6106f6f20b81cc88 ]
When adding a new link to a station, this needs to cause a recalculation of the minimum chandef since otherwise we can have a higher bandwidth station connected on that link than the link is operating at. Do the appropriate recalc.
--- net/mac80211/sta_info.c | 2 ++ 1 file changed, 2 insertions(+)
net/mac80211/sta_info.c +2 -0
@@ -2901,6 +2901,8 @@ int ieee80211_sta_activate_link(struct sta_info *sta, unsigned int link_id)if (!test_sta_flag (sta,WLAN_STA_INSERTED )) goto hash; +ieee80211_recalc_min_chandef (sdata, link_id); +/* Ensure the values are updated for the driver, * redone by sta_remove_link on failure. */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 107/431 selftests/bpf: Fix check_mtu using wrong variable type
In reply to Greg Kroah-HartmanFrom: Jesper Dangaard Brouer <[email protected]>
[ Upstream commit 095641817e1bf6aa2560e025e47575188ee3edaf ]
Dan Carpenter found via Smatch static checker, that unsigned 'mtu_lo' is never less than zero.
Variable mtu_lo should have been an 'int', because read_mtu_device_lo() uses minus as error indications.
--- tools/testing/selftests/bpf/prog_tests/check_mtu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/bpf/prog_tests/check_mtu.c +1 -1
@@ -183,7 +183,7 @@ static void test_check_mtu_tc(__u32 mtu, __u32 ifindex)void serial_test_check_mtu (void ) { -__u32 mtu_lo; +int mtu_lo;if (test__start_subtest ("bpf_check_mtu XDP-attach" ))test_check_mtu_xdp_attach ();
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 108/431 wifi: rsi: Do not configure WoWlan in shutdown hook if not enabled
In reply to Greg Kroah-HartmanFrom: Marek Vasut <[email protected]>
[ Upstream commit b241e260820b68c09586e8a0ae0fc23c0e3215bd ]
In case WoWlan was never configured during the operation of the system, the hw->wiphy->wowlan_config will be NULL. rsi_config_wowlan() checks whether wowlan_config is non-NULL and if it is not, then WARNs about it. The warning is valid, as during normal operation the rsi_config_wowlan() should only ever be called with non-NULL wowlan_config. In shutdown this rsi_config_wowlan() should only ever be called if WoWlan was configured before by the user.
Add checks for non-NULL wowlan_config into the shutdown hook. While at it, check whether the wiphy is also non-NULL before accessing wowlan_config . Drop the single-use wowlan_config variable, just inline it into function call.
--- drivers/net/wireless/rsi/rsi_91x_sdio.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/wireless/rsi/rsi_91x_sdio.c +2 -4
@@ -1463,10 +1463,8 @@ static void rsi_shutdown(struct device *dev)rsi_dbg (ERR_ZONE ,"SDIO Bus shutdown =====>\n" ); -if (hw) { -struct cfg80211_wowlan *wowlan = hw->wiphy->wowlan_config; - -if (rsi_config_wowlan (adapter, wowlan)) +if (hw && hw->wiphy && hw->wiphy->wowlan_config) { +if (rsi_config_wowlan (adapter, hw->wiphy->wowlan_config))rsi_dbg (ERR_ZONE ,"Failed to configure WoWLAN\n" ); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 109/431 wifi: rsi: Do not set MMC_PM_KEEP_POWER in shutdown
In reply to Greg Kroah-HartmanFrom: Marek Vasut <[email protected]>
[ Upstream commit e74f562328b03fbe9cf438f958464dff3a644dfc ]
It makes no sense to set MMC_PM_KEEP_POWER in shutdown. The flag indicates to the MMC subsystem to keep the slot powered on during suspend, but in shutdown the slot should actually be powered off. Drop this call.
--- drivers/net/wireless/rsi/rsi_91x_sdio.c | 3 --- 1 file changed, 3 deletions(-)
drivers/net/wireless/rsi/rsi_91x_sdio.c +0 -3
@@ -1479,9 +1479,6 @@ static void rsi_shutdown(struct device *dev)if (sdev->write_fail)rsi_dbg (INFO_ZONE ,"###### Device is not ready #######\n" ); -if (rsi_set_sdio_pm_caps (adapter)) -rsi_dbg (INFO_ZONE ,"Setting power management caps failed\n" ); -rsi_dbg (INFO_ZONE ,"***** RSI module shut down *****\n" ); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 110/431 ice: handle extts in the miscellaneous interrupt thread
In reply to Greg Kroah-HartmanFrom: Karol Kolacinski <[email protected]>
[ Upstream commit 6e8b2c88fc8cf95ed09de25946b20b7536c88cd5 ]
The ice_ptp_extts_work() and ice_ptp_periodic_work() functions are both scheduled on the same kthread worker, pf.ptp.kworker. The ice_ptp_periodic_work() function sends to the firmware to interact with the PHY, and must block to wait for responses.
This can cause delay in responding to the PFINT_OICR_TSYN_EVNT interrupt cause, ultimately resulting in disruption to processing an input signal of the frequency is high enough. In our testing, even 100 Hz signals get disrupted.
Fix this by instead processing the signal inside the miscellaneous interrupt thread prior to handling Tx timestamps.
Use atomic bits in a new pf->misc_thread bitmap in order to safely communicate which tasks require processing within the ice_misc_intr_thread_fn(). This ensures the communication of desired tasks from the ice_misc_intr() are correctly processed without racing even in the event that the interrupt triggers again before the thread function exits.
--- drivers/net/ethernet/intel/ice/ice.h | 7 ++++++ drivers/net/ethernet/intel/ice/ice_main.c | 29 ++++++++++++++++------- drivers/net/ethernet/intel/ice/ice_ptp.c | 12 +++------- drivers/net/ethernet/intel/ice/ice_ptp.h | 4 ++-- 4 files changed, 33 insertions(+), 19 deletions(-)
drivers/net/ethernet/intel/ice/ice.h +7 -0
@@ -515,6 +515,12 @@ enum ice_pf_flags {ICE_PF_FLAGS_NBITS /* must be last */ }; +enum ice_misc_thread_tasks { +ICE_MISC_THREAD_EXTTS_EVENT , +ICE_MISC_THREAD_TX_TSTAMP , +ICE_MISC_THREAD_NBITS /* must be last */ +}; +struct ice_switchdev_info {struct ice_vsi *control_vsi;struct ice_vsi *uplink_vsi;
@@ -557,6 +563,7 @@ struct ice_pf {DECLARE_BITMAP (features,ICE_F_MAX );DECLARE_BITMAP (state,ICE_STATE_NBITS );DECLARE_BITMAP (flags,ICE_PF_FLAGS_NBITS ); +DECLARE_BITMAP (misc_thread,ICE_MISC_THREAD_NBITS );unsigned long *avail_txqs;/* bitmap to track PF Tx queue usage */ unsigned long *avail_rxqs;/* bitmap to track PF Rx queue usage */ unsigned long serv_tmr_period;
drivers/net/ethernet/intel/ice/ice_main.c +21 -8
@@ -3134,20 +3134,28 @@ static irqreturn_t ice_misc_intr(int __always_unused irq, void *data)if (oicr &PFINT_OICR_TSYN_TX_M ) { ena_mask &= ~PFINT_OICR_TSYN_TX_M ; -if (!hw->reset_ongoing) +if (!hw->reset_ongoing) { +set_bit (ICE_MISC_THREAD_TX_TSTAMP , pf->misc_thread); ret =IRQ_WAKE_THREAD ; + } }if (oicr &PFINT_OICR_TSYN_EVNT_M ) {u8 tmr_idx = hw->func_caps.ts_func_info.tmr_index_owned;u32 gltsyn_stat =rd32 (hw,GLTSYN_STAT (tmr_idx)); -/* Save EVENTs from GTSYN register */ - pf->ptp.ext_ts_irq |= gltsyn_stat & (GLTSYN_STAT_EVENT0_M | -GLTSYN_STAT_EVENT1_M | -GLTSYN_STAT_EVENT2_M ); ena_mask &= ~PFINT_OICR_TSYN_EVNT_M ; -kthread_queue_work (pf->ptp.kworker, &pf->ptp.extts_work); + +if (hw->func_caps.ts_func_info.src_tmr_owned) { +/* Save EVENTs from GLTSYN register */ + pf->ptp.ext_ts_irq |= gltsyn_stat & + (GLTSYN_STAT_EVENT0_M | +GLTSYN_STAT_EVENT1_M | +GLTSYN_STAT_EVENT2_M ); + +set_bit (ICE_MISC_THREAD_EXTTS_EVENT , pf->misc_thread); + ret =IRQ_WAKE_THREAD ; + } }#define ICE_AUX_CRIT_ERR (PFINT_OICR_PE_CRITERR_M | PFINT_OICR_HMC_ERR_M | PFINT_OICR_PE_PUSH_M)
@@ -3191,8 +3199,13 @@ static irqreturn_t ice_misc_intr_thread_fn(int __always_unused irq, void *data)if (ice_is_reset_in_progress (pf->state))return IRQ_HANDLED ; -while (!ice_ptp_process_ts (pf)) -usleep_range (50 ,100 ); +if (test_and_clear_bit (ICE_MISC_THREAD_EXTTS_EVENT , pf->misc_thread)) +ice_ptp_extts_event (pf); + +if (test_and_clear_bit (ICE_MISC_THREAD_TX_TSTAMP , pf->misc_thread)) { +while (!ice_ptp_process_ts (pf)) +usleep_range (50 ,100 ); + }return IRQ_HANDLED ; }
drivers/net/ethernet/intel/ice/ice_ptp.c +3 -9
@@ -1458,15 +1458,11 @@ static int ice_ptp_adjfine(struct ptp_clock_info *info, long scaled_ppm) }/** -* ice_ptp_extts_work - Workqueue task function -* @work: external timestamp work structure -* -* Service for PTP external clock event +* ice_ptp_extts_event - Process PTP external clock event +* @pf: Board private structure */ -static void ice_ptp_extts_work (struct kthread_work *work) +void ice_ptp_extts_event (struct ice_pf *pf) { - struct ice_ptp *ptp = container_of(work, struct ice_ptp, extts_work); - struct ice_pf *pf = container_of(ptp, struct ice_pf, ptp);struct ptp_clock_event event;struct ice_hw *hw = &pf->hw;u8 chan, tmr_idx;
@@ -2558,7 +2554,6 @@ void ice_ptp_prepare_for_reset(struct ice_pf *pf)ice_ptp_cfg_timestamp (pf, false);kthread_cancel_delayed_work_sync (&ptp->work); -kthread_cancel_work_sync (&ptp->extts_work);if (test_bit (ICE_PFR_REQ , pf->state))return ;
@@ -2656,7 +2651,6 @@ static int ice_ptp_init_work(struct ice_pf *pf, struct ice_ptp *ptp)/* Initialize work functions */ kthread_init_delayed_work (&ptp->work, ice_ptp_periodic_work); -kthread_init_work (&ptp->extts_work, ice_ptp_extts_work);/* Allocate a kworker for handling work required for the ports * connected to the PTP hardware clock.
drivers/net/ethernet/intel/ice/ice_ptp.h +2 -2
@@ -169,7 +169,6 @@ struct ice_ptp_port {* struct ice_ptp - data used for integrating with CONFIG_PTP_1588_CLOCK * @port: data for the PHY port initialization procedure * @work: delayed work function for periodic tasks -* @extts_work: work function for handling external Tx timestamps * @cached_phc_time: a cached copy of the PHC time for timestamp extension * @cached_phc_jiffies: jiffies when cached_phc_time was last updated * @ext_ts_chan: the external timestamp channel in use
@@ -190,7 +189,6 @@ struct ice_ptp_port {struct ice_ptp {struct ice_ptp_port port;struct kthread_delayed_work work; -struct kthread_work extts_work;u64 cached_phc_time;unsigned long cached_phc_jiffies;u8 ext_ts_chan;
@@ -256,6 +254,7 @@ int ice_ptp_get_ts_config(struct ice_pf *pf, struct ifreq *ifr);void ice_ptp_cfg_timestamp (struct ice_pf *pf,bool ena);int ice_get_ptp_clock_index (struct ice_pf *pf); +void ice_ptp_extts_event (struct ice_pf *pf);s8 ice_ptp_request_ts (struct ice_ptp_tx *tx,struct sk_buff *skb);bool ice_ptp_process_ts (struct ice_pf *pf);
@@ -284,6 +283,7 @@ static inline int ice_get_ptp_clock_index(struct ice_pf *pf)return -1 ; } +static inline void ice_ptp_extts_event (struct ice_pf *pf) { }static inline s8 ice_ptp_request_ts (struct ice_ptp_tx *tx,struct sk_buff *skb) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 111/431 selftests: cgroup: fix unexpected failure on test_memcg_low
In reply to Greg Kroah-HartmanFrom: Haifeng Xu <[email protected]>
[ Upstream commit 19ab365762c6cc39dfdee9e13ab0d12fe4b5540d ]
Since commit f079a020ba95 ("selftests: memcg: factor out common parts of memory.{low,min} tests"), the value used in second alloc_anon has changed from 148M to 170M. Because memory.low allows reclaiming page cache in child cgroups, so the memory.current is close to 30M instead of 50M. Therefore, adjust the expected value of parent cgroup.
--- tools/testing/selftests/cgroup/test_memcontrol.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tools/testing/selftests/cgroup/test_memcontrol.c +3 -1
@@ -292,6 +292,7 @@ static int test_memcg_protection(const char *root, bool min)char *children[4 ] = {NULL };const char *attribute = min ?"memory.min" :"memory.low" ;long c[4 ]; +long current;int i, attempts;int fd;
@@ -400,7 +401,8 @@ static int test_memcg_protection(const char *root, bool min) goto cleanup; } -if (!values_close (cg_read_long (parent[1 ],"memory.current" ),MB (50 ),3 )) + current = min ?MB (50 ) :MB (30 ); +if (!values_close (cg_read_long (parent[1 ],"memory.current" ), current,3 )) goto cleanup;if (!reclaim_until (children[0 ],MB (10 )))
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 112/431 watchdog/perf: define dummy watchdog_update_hrtimer_threshold() on correct config
In reply to Greg Kroah-HartmanFrom: Douglas Anderson <[email protected]>
[ Upstream commit 5e008df11c55228a86a1bae692cc2002503572c9 ]
Patch series "watchdog/hardlockup: Add the buddy hardlockup detector", v5.
This patch series adds the "buddy" hardlockup detector. In brief, the buddy hardlockup detector can detect hardlockups without arch-level support by having CPUs checkup on a "buddy" CPU periodically.
Given the new design of this patch series, testing all combinations is fairly difficult. I've attempted to make sure that all combinations of CONFIG_ options are good, but it wouldn't surprise me if I missed something. I apologize in advance and I'll do my best to fix any problems that are found.
This patch (of 18):
The real watchdog_update_hrtimer_threshold() is defined in kernel/watchdog_hld.c. That file is included if CONFIG_HARDLOCKUP_DETECTOR_PERF and the function is defined in that file if CONFIG_HARDLOCKUP_CHECK_TIMESTAMP.
The dummy version of the function in "nmi.h" didn't get that quite right. While this doesn't appear to be a huge deal, it's nice to make it consistent.
It doesn't break builds because CHECK_TIMESTAMP is only defined by x86 so others don't get a double definition, and x86 uses perf lockup detector, so it gets the out of line version.
--- include/linux/nmi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/nmi.h +1 -1
@@ -197,7 +197,7 @@ u64 hw_nmi_get_sample_period(int watchdog_thresh);#endif #if defined(CONFIG_HARDLOCKUP_CHECK_TIMESTAMP ) && \ - defined(CONFIG_HARDLOCKUP_DETECTOR ) + defined(CONFIG_HARDLOCKUP_DETECTOR_PERF )void watchdog_update_hrtimer_threshold (u64 period);#else static inline void watchdog_update_hrtimer_threshold (u64 period) { }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 113/431 watchdog/perf: more properly prevent false positives with turbo modes
In reply to Greg Kroah-HartmanFrom: Douglas Anderson <[email protected]>
[ Upstream commit 4379e59fe5665cfda737e45b8bf2f05321ef049c ]
Currently, in the watchdog_overflow_callback() we first check to see if the watchdog had been touched and _then_ we handle the workaround for turbo mode. This order should be reversed.
Specifically, "touching" the hardlockup detector's watchdog should avoid lockups being detected for one period that should be roughly the same regardless of whether we're running turbo or not. That means that we should do the extra accounting for turbo _before_ we look at (and clear) the global indicating that we've been touched.
NOTE: this fix is made based on code inspection. I am not aware of any reports where the old code would have generated false positives. That being said, this order seems more correct and also makes it easier down the line to share code with the "buddy" hardlockup detector.
--- kernel/watchdog_hld.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/watchdog_hld.c +3 -3
@@ -114,14 +114,14 @@ static void watchdog_overflow_callback(struct perf_event *event,/* Ensure the watchdog never gets throttled */ event->hw.interrupts =0 ; +if (!watchdog_check_timestamp ()) +return ; +if (__this_cpu_read (watchdog_nmi_touch) == true) {__this_cpu_write (watchdog_nmi_touch, false);return ; } -if (!watchdog_check_timestamp ()) -return ; -/* check for a hardlockup * This is done by making sure our timer interrupt * is incrementing. The timer interrupt should have
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 114/431 kexec: fix a memory leak in crash_shrink_memory()
In reply to Greg Kroah-HartmanFrom: Zhen Lei <[email protected]>
[ Upstream commit 1cba6c4309f03de570202c46f03df3f73a0d4c82 ]
Patch series "kexec: enable kexec_crash_size to support two crash kernel regions".
When crashkernel=X fails to reserve region under 4G, it will fall back to reserve region above 4G and a region of the default size will also be reserved under 4G. Unfortunately, /sys/kernel/kexec_crash_size only supports one crash kernel region now, the user cannot sense the low memory reserved by reading /sys/kernel/kexec_crash_size. Also, low memory cannot be freed by writing this file.
For example:resource_size(crashk_res) = 512Mresource_size(crashk_low_res) = 256M
The result of 'cat /sys/kernel/kexec_crash_size' is 512M, but it should be 768M. When we execute 'echo 0 > /sys/kernel/kexec_crash_size', the size of crashk_res becomes 0 and resource_size(crashk_low_res) is still 256 MB, which is incorrect.
Since crashk_res manages the memory with high address and crashk_low_res manages the memory with low address, crashk_low_res is shrunken only when all crashk_res is shrunken. And because when there is only one crash kernel region, crashk_res is always used. Therefore, if all crashk_res is shrunken and crashk_low_res still exists, swap them.
This patch (of 6):
If the value of parameter 'new_size' is in the semi-open and semi-closed interval (crashk_res.end - KEXEC_CRASH_MEM_ALIGN + 1, crashk_res.end], the calculation result of ram_res is:
ram_res->start = crashk_res.end + 1 ram_res->end = crashk_res.end
The operation of insert_resource() fails, and ram_res is not added to iomem_resource. As a result, the memory of the control block ram_res is leaked.
In fact, on all architectures, the start address and size of crashk_res are already aligned by KEXEC_CRASH_MEM_ALIGN. Therefore, we do not need to round up crashk_res.start again. Instead, we should round up 'new_size' in advance.
--- kernel/kexec_core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
kernel/kexec_core.c +2 -3
@@ -1122,6 +1122,7 @@ int crash_shrink_memory(unsigned long new_size) start = crashk_res.start; end = crashk_res.end; old_size = (end ==0 ) ?0 : end - start +1 ; + new_size =roundup (new_size,KEXEC_CRASH_MEM_ALIGN );if (new_size >= old_size) { ret = (new_size == old_size) ?0 : -EINVAL ; goto unlock;
@@ -1133,9 +1134,7 @@ int crash_shrink_memory(unsigned long new_size) goto unlock; } - start =roundup (start,KEXEC_CRASH_MEM_ALIGN ); - end =roundup (start + new_size,KEXEC_CRASH_MEM_ALIGN ); - + end = start + new_size;crash_free_reserved_phys_range (end, crashk_res.end);if ((start == end) && (crashk_res.parent !=NULL ))
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 115/431 mmc: mediatek: Avoid ugly error message when SDIO wakeup IRQ isnt used
In reply to Greg Kroah-HartmanFrom: Douglas Anderson <[email protected]>
[ Upstream commit a3332b7aad346b14770797e03ddd02ebdb14db41 ]
When I boot a kukui-kodama board, I see an ugly warning in my kernel log:
mtk-msdc 11240000.mmc: error -ENXIO: IRQ sdio_wakeup not found
It's pretty normal not to have an "sdio_wakeup" IRQ defined. In fact, no device trees in mainline seem to have it. Let's use the platform_get_irq_byname_optional() to avoid the error message.
--- drivers/mmc/host/mtk-sd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/mtk-sd.c +1 -1
@@ -2707,7 +2707,7 @@ static int msdc_drv_probe(struct platform_device *pdev)/* Support for SDIO eint irq ? */ if ((mmc->pm_caps &MMC_PM_WAKE_SDIO_IRQ ) && (mmc->pm_caps &MMC_PM_KEEP_POWER )) { - host->eint_irq =platform_get_irq_byname (pdev,"sdio_wakeup" ); + host->eint_irq =platform_get_irq_byname_optional (pdev,"sdio_wakeup" );if (host->eint_irq >0 ) { host->pins_eint =pinctrl_lookup_state (host->pinctrl,"state_eint" );if (IS_ERR (host->pins_eint)) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 116/431 memstick r592: make memstick_debug_get_tpc_name() static
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 434587df9f7fd68575f99a889cc5f2efc2eaee5e ]
There are no other files referencing this function, apparently it was left global to avoid an 'unused function' warning when the only caller is left out. With a 'W=1' build, it causes a 'missing prototype' warning though:
drivers/memstick/host/r592.c:47:13: error: no previous prototype for 'memstick_debug_get_tpc_name' [-Werror=missing-prototypes]
Annotate the function as 'static __maybe_unused' to avoid both problems.
--- drivers/memstick/host/r592.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/memstick/host/r592.c +1 -3
@@ -44,12 +44,10 @@ static const char *tpc_names[] = {* memstick_debug_get_tpc_name - debug helper that returns string for * a TPC number */ -const char *memstick_debug_get_tpc_name (int tpc) +static __maybe_unused const char *memstick_debug_get_tpc_name (int tpc) {return tpc_names[tpc-1 ]; } -EXPORT_SYMBOL (memstick_debug_get_tpc_name); -/* Read a register*/ static inline u32 r592_read_reg (struct r592_device *dev,int address)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 117/431 selftests/bpf: Fix invalid pointer check in get_xlated_program()
In reply to Greg Kroah-HartmanFrom: Eduard Zingerman <[email protected]>
[ Upstream commit b23ed4d74c4d583b5f621ee4c776699442833554 ]
Dan Carpenter reported invalid check for calloc() result in test_verifier.c:get_xlated_program():
./tools/testing/selftests/bpf/test_verifier.c:1365 get_xlated_program()
warn: variable dereferenced before check 'buf' (see line 1364)
./tools/testing/selftests/bpf/test_verifier.c
1363 *cnt = xlated_prog_len / buf_element_size;
1364 *buf = calloc(*cnt, buf_element_size);
1365 if (!buf) {
This should be if (!*buf) { 1366 perror("can't allocate xlated program buffer");
1367 return -ENOMEM;This commit refactors the get_xlated_program() to avoid using double pointer type.
--- tools/testing/selftests/bpf/test_verifier.c | 24 +++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-)
tools/testing/selftests/bpf/test_verifier.c +13 -11
@@ -1232,45 +1232,46 @@ static bool cmp_str_seq(const char *log, const char *exp)return true; } -static int get_xlated_program (int fd_prog,struct bpf_insn **buf,int *cnt) +static struct bpf_insn *get_xlated_program (int fd_prog,int *cnt) { +__u32 buf_element_size =sizeof (struct bpf_insn );struct bpf_prog_info info = {};__u32 info_len =sizeof (info);__u32 xlated_prog_len; -__u32 buf_element_size =sizeof (struct bpf_insn ); +struct bpf_insn *buf;if (bpf_prog_get_info_by_fd (fd_prog, &info, &info_len)) {perror ("bpf_prog_get_info_by_fd failed" ); -return -1 ; +return NULL ; } xlated_prog_len = info.xlated_prog_len;if (xlated_prog_len % buf_element_size) {printf ("Program length %d is not multiple of %d\n" , xlated_prog_len, buf_element_size); -return -1 ; +return NULL ; } *cnt = xlated_prog_len / buf_element_size; - *buf =calloc (*cnt, buf_element_size); + buf =calloc (*cnt, buf_element_size);if (!buf) {perror ("can't allocate xlated program buffer" ); -return -ENOMEM ; +return NULL ; }bzero (&info,sizeof (info)); info.xlated_prog_len = xlated_prog_len; - info.xlated_prog_insns = (__u64 )(unsigned long )*buf; + info.xlated_prog_insns = (__u64 )(unsigned long )buf;if (bpf_prog_get_info_by_fd (fd_prog, &info, &info_len)) {perror ("second bpf_prog_get_info_by_fd failed" ); goto out_free_buf; } -return 0 ; +return buf; out_free_buf: -free (*buf); -return -1 ; +free (buf); +return NULL ; }static bool is_null_insn (struct bpf_insn *insn)
@@ -1403,7 +1404,8 @@ static bool check_xlated_program(struct bpf_test *test, int fd_prog)if (!check_expected && !check_unexpected) goto out; -if (get_xlated_program (fd_prog, &buf, &cnt)) { + buf =get_xlated_program (fd_prog, &cnt); +if (!buf) {printf ("FAIL: can't get xlated program\n" ); result = false; goto out;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 118/431 wifi: ath9k: Fix possible stall on ath9k_txq_list_has_key()
In reply to Greg Kroah-HartmanFrom: Remi Pommarel <[email protected]>
[ Upstream commit 75086cc6dee046e3fbb3dba148b376d8802f83bc ]
On EDMA capable hardware, ath9k_txq_list_has_key() can enter infinite loop if it is called while all txq_fifos have packets that use different key that the one we are looking for. Fix it by exiting the loop if all txq_fifos have been checked already.
Because this loop is called under spin_lock_bh() (see ath_txq_lock) it causes the following rcu stall:
rcu: INFO: rcu_sched self-detected stall on CPU
ath10k_pci 0000:01:00.0: failed to read temperature -11
rcu: 1-....: (5254 ticks this GP) idle=189/1/0x4000000000000002 softirq=8442983/8442984 fqs=2579
(t=5257 jiffies g=17983297 q=334)
Task dump for CPU 1:
task:hostapd state:R running task stack: 0 pid: 297 ppid: 289 flags:0x0000000a
Call trace:
dump_backtrace+0x0/0x170
show_stack+0x1c/0x24
sched_show_task+0x140/0x170
dump_cpu_task+0x48/0x54
rcu_dump_cpu_stacks+0xf0/0x134
rcu_sched_clock_irq+0x8d8/0x9fc
update_process_times+0xa0/0xec
tick_sched_timer+0x5c/0xd0
__hrtimer_run_queues+0x154/0x320
hrtimer_interrupt+0x120/0x2f0
arch_timer_handler_virt+0x38/0x44
handle_percpu_devid_irq+0x9c/0x1e0
handle_domain_irq+0x64/0x90
gic_handle_irq+0x78/0xb0
call_on_irq_stack+0x28/0x38
do_interrupt_handler+0x54/0x5c
el1_interrupt+0x2c/0x4c
el1h_64_irq_handler+0x14/0x1c
el1h_64_irq+0x74/0x78
ath9k_txq_has_key+0x1bc/0x250 [ath9k]
ath9k_set_key+0x1cc/0x3dc [ath9k]
drv_set_key+0x78/0x170
ieee80211_key_replace+0x564/0x6cc
ieee80211_key_link+0x174/0x220
ieee80211_add_key+0x11c/0x300
nl80211_new_key+0x12c/0x330
genl_family_rcv_msg_doit+0xbc/0x11c
genl_rcv_msg+0xd8/0x1c4
netlink_rcv_skb+0x40/0x100
genl_rcv+0x3c/0x50
netlink_unicast+0x1ec/0x2c0
netlink_sendmsg+0x198/0x3c0
____sys_sendmsg+0x210/0x250
___sys_sendmsg+0x78/0xc4
__sys_sendmsg+0x4c/0x90
__arm64_sys_sendmsg+0x28/0x30
invoke_syscall.constprop.0+0x60/0x100
do_el0_svc+0x48/0xd0
el0_svc+0x14/0x50
el0t_64_sync_handler+0xa8/0xb0
el0t_64_sync+0x158/0x15cThis rcu stall is hard to reproduce as is, but changing ATH_TXFIFO_DEPTH from 8 to 2 makes it reasonably easy to reproduce.
--- drivers/net/wireless/ath/ath9k/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +4 -3
@@ -850,7 +850,7 @@ static bool ath9k_txq_list_has_key(struct list_head *txq_list, u32 keyix)static bool ath9k_txq_has_key (struct ath_softc *sc,u32 keyix) {struct ath_hw *ah = sc->sc_ah; -int i; +int i, j;struct ath_txq *txq;bool key_in_use = false;
@@ -868,8 +868,9 @@ static bool ath9k_txq_has_key(struct ath_softc *sc, u32 keyix)if (sc->sc_ah->caps.hw_caps &ATH9K_HW_CAP_EDMA ) {int idx = txq->txq_tailidx; -while (!key_in_use && - !list_empty (&txq->txq_fifo[idx])) { +for (j =0 ; !key_in_use && + !list_empty (&txq->txq_fifo[idx]) && + j <ATH_TXFIFO_DEPTH ; j++) { key_in_use =ath9k_txq_list_has_key ( &txq->txq_fifo[idx], keyix);INCR (idx,ATH_TXFIFO_DEPTH );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 119/431 wifi: mac80211: Fix permissions for valid_links debugfs entry
In reply to Greg Kroah-HartmanFrom: Ilan Peer <[email protected]>
[ Upstream commit 4cacadc0dbd8013e6161aa8843d8e9d8ad435b47 ]
The entry should be a read only one and not a write only one. Fix it.
--- net/mac80211/debugfs_netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/debugfs_netdev.c +1 -1
@@ -691,7 +691,7 @@ static void add_sta_files(struct ieee80211_sub_if_data *sdata)DEBUGFS_ADD_MODE (uapsd_queues,0600 );DEBUGFS_ADD_MODE (uapsd_max_sp_len,0600 );DEBUGFS_ADD_MODE (tdls_wider_bw,0600 ); -DEBUGFS_ADD_MODE (valid_links,0200 ); +DEBUGFS_ADD_MODE (valid_links,0400 );DEBUGFS_ADD_MODE (active_links,0600 ); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 120/431 rtnetlink: extend RTEXT_FILTER_SKIP_STATS to IFLA_VF_INFO
In reply to Greg Kroah-HartmanFrom: Edwin Peer <[email protected]>
[ Upstream commit fa0e21fa44438a0e856d42224bfa24641d37b979 ]
This filter already exists for excluding IPv6 SNMP stats. Extend its definition to also exclude IFLA_VF_INFO stats in RTM_GETLINK.
This patch constitutes a partial fix for a netlink attribute nesting overflow bug in IFLA_VFINFO_LIST. By excluding the stats when the requester doesn't need them, the truncation of the VF list is avoided.
While it was technically only the stats added in commit c5a9f6f0ab40 ("net/core: Add drop counters to VF statistics") breaking the camel's back, the appreciable size of the stats data should never have been included without due consideration for the maximum number of VFs supported by PCI.
--- net/core/rtnetlink.c | 96 +++++++++++++++++++++++--------------------- 1 file changed, 51 insertions(+), 45 deletions(-)
net/core/rtnetlink.c +51 -45
@@ -958,24 +958,27 @@ static inline int rtnl_vfinfo_size(const struct net_device *dev,nla_total_size (sizeof (struct ifla_vf_rate )) +nla_total_size (sizeof (struct ifla_vf_link_state )) +nla_total_size (sizeof (struct ifla_vf_rss_query_en )) + -nla_total_size (0 ) +/* nest IFLA_VF_STATS */ -/* IFLA_VF_STATS_RX_PACKETS */ -nla_total_size_64bit (sizeof (__u64)) + -/* IFLA_VF_STATS_TX_PACKETS */ -nla_total_size_64bit (sizeof (__u64)) + -/* IFLA_VF_STATS_RX_BYTES */ -nla_total_size_64bit (sizeof (__u64)) + -/* IFLA_VF_STATS_TX_BYTES */ -nla_total_size_64bit (sizeof (__u64)) + -/* IFLA_VF_STATS_BROADCAST */ -nla_total_size_64bit (sizeof (__u64)) + -/* IFLA_VF_STATS_MULTICAST */ -nla_total_size_64bit (sizeof (__u64)) + -/* IFLA_VF_STATS_RX_DROPPED */ -nla_total_size_64bit (sizeof (__u64)) + -/* IFLA_VF_STATS_TX_DROPPED */ -nla_total_size_64bit (sizeof (__u64)) + nla_total_size(sizeof(struct ifla_vf_trust))); +if (~ext_filter_mask &RTEXT_FILTER_SKIP_STATS ) { + size += num_vfs * + (nla_total_size (0 ) +/* nest IFLA_VF_STATS */ +/* IFLA_VF_STATS_RX_PACKETS */ +nla_total_size_64bit (sizeof (__u64)) + +/* IFLA_VF_STATS_TX_PACKETS */ +nla_total_size_64bit (sizeof (__u64)) + +/* IFLA_VF_STATS_RX_BYTES */ +nla_total_size_64bit (sizeof (__u64)) + +/* IFLA_VF_STATS_TX_BYTES */ +nla_total_size_64bit (sizeof (__u64)) + +/* IFLA_VF_STATS_BROADCAST */ +nla_total_size_64bit (sizeof (__u64)) + +/* IFLA_VF_STATS_MULTICAST */ +nla_total_size_64bit (sizeof (__u64)) + +/* IFLA_VF_STATS_RX_DROPPED */ +nla_total_size_64bit (sizeof (__u64)) + +/* IFLA_VF_STATS_TX_DROPPED */ +nla_total_size_64bit (sizeof (__u64))); + }return size; }else return 0 ;
@@ -1267,7 +1270,8 @@ static noinline_for_stack int rtnl_fill_stats(struct sk_buff *skb, static noinline_for_stack int rtnl_fill_vfinfo(struct sk_buff *skb,struct net_device *dev,int vfs_num, -struct nlattr *vfinfo) +struct nlattr *vfinfo, +u32 ext_filter_mask) {struct ifla_vf_rss_query_en vf_rss_query_en;struct nlattr *vf, *vfstats, *vfvlanlist;
@@ -1373,33 +1377,35 @@ static noinline_for_stack int rtnl_fill_vfinfo(struct sk_buff *skb, goto nla_put_vf_failure; }nla_nest_end (skb, vfvlanlist); -memset (&vf_stats,0 ,sizeof (vf_stats)); -if (dev->netdev_ops->ndo_get_vf_stats) - dev->netdev_ops->ndo_get_vf_stats (dev, vfs_num, - &vf_stats); - vfstats =nla_nest_start_noflag (skb,IFLA_VF_STATS ); -if (!vfstats) - goto nla_put_vf_failure; -if (nla_put_u64_64bit (skb,IFLA_VF_STATS_RX_PACKETS , - vf_stats.rx_packets,IFLA_VF_STATS_PAD ) || -nla_put_u64_64bit (skb,IFLA_VF_STATS_TX_PACKETS , - vf_stats.tx_packets,IFLA_VF_STATS_PAD ) || -nla_put_u64_64bit (skb,IFLA_VF_STATS_RX_BYTES , - vf_stats.rx_bytes,IFLA_VF_STATS_PAD ) || -nla_put_u64_64bit (skb,IFLA_VF_STATS_TX_BYTES , - vf_stats.tx_bytes,IFLA_VF_STATS_PAD ) || -nla_put_u64_64bit (skb,IFLA_VF_STATS_BROADCAST , - vf_stats.broadcast,IFLA_VF_STATS_PAD ) || -nla_put_u64_64bit (skb,IFLA_VF_STATS_MULTICAST , - vf_stats.multicast,IFLA_VF_STATS_PAD ) || -nla_put_u64_64bit (skb,IFLA_VF_STATS_RX_DROPPED , - vf_stats.rx_dropped,IFLA_VF_STATS_PAD ) || -nla_put_u64_64bit (skb,IFLA_VF_STATS_TX_DROPPED , - vf_stats.tx_dropped,IFLA_VF_STATS_PAD )) { -nla_nest_cancel (skb, vfstats); - goto nla_put_vf_failure; +if (~ext_filter_mask &RTEXT_FILTER_SKIP_STATS ) { +memset (&vf_stats,0 ,sizeof (vf_stats)); +if (dev->netdev_ops->ndo_get_vf_stats) + dev->netdev_ops->ndo_get_vf_stats (dev, vfs_num, + &vf_stats); + vfstats =nla_nest_start_noflag (skb,IFLA_VF_STATS ); +if (!vfstats) + goto nla_put_vf_failure; +if (nla_put_u64_64bit (skb,IFLA_VF_STATS_RX_PACKETS , + vf_stats.rx_packets,IFLA_VF_STATS_PAD ) || +nla_put_u64_64bit (skb,IFLA_VF_STATS_TX_PACKETS , + vf_stats.tx_packets,IFLA_VF_STATS_PAD ) || +nla_put_u64_64bit (skb,IFLA_VF_STATS_RX_BYTES , + vf_stats.rx_bytes,IFLA_VF_STATS_PAD ) || +nla_put_u64_64bit (skb,IFLA_VF_STATS_TX_BYTES , + vf_stats.tx_bytes,IFLA_VF_STATS_PAD ) || +nla_put_u64_64bit (skb,IFLA_VF_STATS_BROADCAST , + vf_stats.broadcast,IFLA_VF_STATS_PAD ) || +nla_put_u64_64bit (skb,IFLA_VF_STATS_MULTICAST , + vf_stats.multicast,IFLA_VF_STATS_PAD ) || +nla_put_u64_64bit (skb,IFLA_VF_STATS_RX_DROPPED , + vf_stats.rx_dropped,IFLA_VF_STATS_PAD ) || +nla_put_u64_64bit (skb,IFLA_VF_STATS_TX_DROPPED , + vf_stats.tx_dropped,IFLA_VF_STATS_PAD )) { +nla_nest_cancel (skb, vfstats); + goto nla_put_vf_failure; + } +nla_nest_end (skb, vfstats); } -nla_nest_end (skb, vfstats);nla_nest_end (skb, vf);return 0 ;
@@ -1432,7 +1438,7 @@ static noinline_for_stack int rtnl_fill_vf(struct sk_buff *skb,return -EMSGSIZE ;for (i =0 ; i < num_vfs; i++) { -if (rtnl_fill_vfinfo (skb, dev, i, vfinfo)) +if (rtnl_fill_vfinfo (skb, dev, i, vfinfo, ext_filter_mask))return -EMSGSIZE ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 121/431 wifi: ath11k: Add missing check for ioremap
In reply to Greg Kroah-HartmanFrom: Jiasheng Jiang <[email protected]>
[ Upstream commit 16e0077e14a73866e9b0f4a6bf4ad3d4a5cb0f2a ]
Add check for ioremap() and return the error if it fails in order to guarantee the success of ioremap(), same as in ath11k_qmi_load_file_target_mem().
--- drivers/net/wireless/ath/ath11k/qmi.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/wireless/ath/ath11k/qmi.c +5 -0
@@ -2058,6 +2058,9 @@ static int ath11k_qmi_assign_target_mem_chunk(struct ath11k_base *ab) ab->qmi.target_mem[idx].iaddr =ioremap (ab->qmi.target_mem[idx].paddr, ab->qmi.target_mem[i].size); +if (!ab->qmi.target_mem[idx].iaddr) +return -EIO ; + ab->qmi.target_mem[idx].size = ab->qmi.target_mem[i].size; host_ddr_sz = ab->qmi.target_mem[i].size; ab->qmi.target_mem[idx].type = ab->qmi.target_mem[i].type;
@@ -2083,6 +2086,8 @@ static int ath11k_qmi_assign_target_mem_chunk(struct ath11k_base *ab) ab->qmi.target_mem[idx].iaddr =ioremap (ab->qmi.target_mem[idx].paddr, ab->qmi.target_mem[i].size); +if (!ab->qmi.target_mem[idx].iaddr) +return -EIO ; }else { ab->qmi.target_mem[idx].paddr =ATH11K_QMI_CALDB_ADDRESS ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 122/431 wifi: ath11k: Add missing ops config for IPQ5018 in ath11k_ahb_probe()
In reply to Greg Kroah-HartmanFrom: Ziyang Huang <[email protected]>
[ Upstream commit 469ddb20cae61cad9c4f208a4c8682305905a511 ]
Without this patch, the IPQ5018 WiFi will fail and print the following logs:
[ 11.033179] ath11k c000000.wifi: unsupported device type 7 [ 11.033223] ath11k: probe of c000000.wifi failed with error -95
--- drivers/net/wireless/ath/ath11k/ahb.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/ath/ath11k/ahb.c +1 -0
@@ -1127,6 +1127,7 @@ static int ath11k_ahb_probe(struct platform_device *pdev)switch (hw_rev) {case ATH11K_HW_IPQ8074 :case ATH11K_HW_IPQ6018_HW10 : +case ATH11K_HW_IPQ5018_HW10 : hif_ops = &ath11k_ahb_hif_ops_ipq8074; pci_ops =NULL ;break ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 123/431 wifi: ath11k: Restart firmware after cold boot calibration for IPQ5018
In reply to Greg Kroah-HartmanFrom: Ziyang Huang <[email protected]>
[ Upstream commit 80c5390e1f5e5b16d820512265530ef26073d8e0 ]
Restart is required after cold boot calibration on IPQ5018. Otherwise, we get the following exception:
[ 14.412829] qcom-q6-mpd cd00000.remoteproc: fatal error received: err_smem_ver.2.1: [ 14.412829] QC Image Version : QC_IMAGE_VERSION_STRING=WLAN.HK.2.6.0.1-00974-QCAHKSWPL_SILICONZ-1 [ 14.412829] Image Variant : IMAGE_VARIANT_STRING=5018.wlanfw2.map_spr_spr_evalQ [ 14.412829] DALSysLogEvent.c:174 Assertion 0 failed param0 :zero,param1 :zero,param2 :zero [ 14.412829] Thread ID : 0x00000048 Thread name : WLAN RT0 Process ID : 0x00000001 Process name :wlan0 [ 14.412829] [ 14.412829] Registers: [ 14.412829] SP : 0x4c81c120 [ 14.412829] FP : 0x4c81c138 [ 14.412829] PC : 0xb022c590 [ 14.412829] SSR : 0x00000000 [ 14.412829] BADVA : 0x00000000 [ 14.412829] LR : 0xb0008490 [ 14.412829] [ 14.412829] StackDump [ 14.412829] from:0x4c81c120 [ 14.412829] to: 0x00000000: [ 14.412829] [ 14.463006] remoteproc remoteproc0: crash detected in cd00000.remoteproc: type fatal error
--- drivers/net/wireless/ath/ath11k/core.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/ath/ath11k/core.c +1 -0
@@ -671,6 +671,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .hal_params = &ath11k_hw_hal_params_ipq8074, .single_pdev_only = false, .cold_boot_calib = true, + .cbcal_restart_fw = true, .fix_l1ss = true, .supports_dynamic_smps_6ghz = false, .alloc_cacheable_memory = true,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 124/431 wifi: ath11k: Add missing hw_ops->get_ring_selector() for IPQ5018
In reply to Greg Kroah-HartmanFrom: Ziyang Huang <[email protected]>
[ Upstream commit ce282d8de71f07f0056ea319541141152c65f552 ]
During sending data after clients connected, hw_ops->get_ring_selector() will be called. But for IPQ5018, this member isn't set, and the following NULL pointer exception will be occurred:
[ 38.840478] 8<--- cut here --- [ 38.840517] Unable to handle kernel NULL pointer dereference at virtual address 00000000 ... [ 38.923161] PC is at 0x0 [ 38.927930] LR is at ath11k_dp_tx+0x70/0x730 [ath11k] ... [ 39.063264] Process hostapd (pid: 1034, stack limit = 0x801ceb3d) [ 39.068994] Stack: (0x856a9a68 to 0x856aa000) ... [ 39.438467] [<7f323804>] (ath11k_dp_tx [ath11k]) from [<7f314e6c>] (ath11k_mac_op_tx+0x80/0x190 [ath11k]) [ 39.446607] [<7f314e6c>] (ath11k_mac_op_tx [ath11k]) from [<7f17dbe0>] (ieee80211_handle_wake_tx_queue+0x7c/0xc0 [mac80211]) [ 39.456162] [<7f17dbe0>] (ieee80211_handle_wake_tx_queue [mac80211]) from [<7f174450>] (ieee80211_probereq_get+0x584/0x704 [mac80211]) [ 39.467443] [<7f174450>] (ieee80211_probereq_get [mac80211]) from [<7f178c40>] (ieee80211_tx_prepare_skb+0x1f8/0x248 [mac80211]) [ 39.479334] [<7f178c40>] (ieee80211_tx_prepare_skb [mac80211]) from [<7f179e28>] (__ieee80211_subif_start_xmit+0x32c/0x3d4 [mac80211]) [ 39.491053] [<7f179e28>] (__ieee80211_subif_start_xmit [mac80211]) from [<7f17af08>] (ieee80211_tx_control_port+0x19c/0x288 [mac80211]) [ 39.502946] [<7f17af08>] (ieee80211_tx_control_port [mac80211]) from [<7f0fc704>] (nl80211_tx_control_port+0x174/0x1d4 [cfg80211]) [ 39.515017] [<7f0fc704>] (nl80211_tx_control_port [cfg80211]) from [<808ceac4>] (genl_rcv_msg+0x154/0x340) [ 39.526814] [<808ceac4>] (genl_rcv_msg) from [<808cdb74>] (netlink_rcv_skb+0xb8/0x11c) [ 39.536446] [<808cdb74>] (netlink_rcv_skb) from [<808ce1d0>] (genl_rcv+0x28/0x34) [ 39.544344] [<808ce1d0>] (genl_rcv) from [<808cd234>] (netlink_unicast+0x174/0x274) [ 39.551895] [<808cd234>] (netlink_unicast) from [<808cd510>] (netlink_sendmsg+0x1dc/0x440) [ 39.559362] [<808cd510>] (netlink_sendmsg) from [<808596e0>] (____sys_sendmsg+0x1a8/0x1fc) [ 39.567697] [<808596e0>] (____sys_sendmsg) from [<8085b1a8>] (___sys_sendmsg+0xa4/0xdc) [ 39.575941] [<8085b1a8>] (___sys_sendmsg) from [<8085b310>] (sys_sendmsg+0x44/0x74) [ 39.583841] [<8085b310>] (sys_sendmsg) from [<80300060>] (ret_fast_syscall+0x0/0x40) ... [ 39.620734] Code: bad PC value [ 39.625869] ---[ end trace 8aef983ad3cbc032 ]---
--- drivers/net/wireless/ath/ath11k/hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath11k/hw.c +1 -1
@@ -1165,7 +1165,7 @@ const struct ath11k_hw_ops ipq5018_ops = { .mpdu_info_get_peerid = ath11k_hw_ipq8074_mpdu_info_get_peerid, .rx_desc_mac_addr2_valid = ath11k_hw_ipq9074_rx_desc_mac_addr2_valid, .rx_desc_mpdu_start_addr2 = ath11k_hw_ipq9074_rx_desc_mpdu_start_addr2, - + .get_ring_selector = ath11k_hw_ipq8074_get_tcl_ring_selector, };#define ATH11K_TX_RING_MASK_0 BIT(0)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 125/431 wifi: iwlwifi: pull from TXQs with softirqs disabled
In reply to Greg Kroah-HartmanFrom: Johannes Berg <[email protected]>
[ Upstream commit 96fb6f47db24a712d650b0a9b9074873f273fb0e ]
In mac80211, it's required that we pull from TXQs by calling ieee80211_tx_dequeue() only with softirqs disabled. However, in iwl_mvm_queue_state_change() we're often called with them enabled, e.g. from flush if anything was flushed, triggering a mac80211 warning.
Fix that by disabling the softirqs across the TX call.
--- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +4 -1
@@ -1697,8 +1697,11 @@ static void iwl_mvm_queue_state_change(struct iwl_op_mode *op_mode,else set_bit (IWL_MVM_TXQ_STATE_STOP_FULL , &mvmtxq->state); -if (start && mvmsta->sta_state !=IEEE80211_STA_NOTEXIST ) +if (start && mvmsta->sta_state !=IEEE80211_STA_NOTEXIST ) { +local_bh_disable ();iwl_mvm_mac_itxq_xmit (mvm->hw, txq); +local_bh_enable (); + } } out:
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 126/431 wifi: iwlwifi: pcie: fix NULL pointer dereference in iwl_pcie_irq_rx_msix_handler()
In reply to Greg Kroah-HartmanFrom: Anjaneyulu <[email protected]>
[ Upstream commit 1902f1953b8ba100ee8705cb8a6f1a9795550eca ]
rxq can be NULL only when trans_pcie->rxq is NULL and entry->entry is zero. For the case when entry->entry is not equal to 0, rxq won't be NULL even if trans_pcie->rxq is NULL. Modify checker to check for trans_pcie->rxq.
--- drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/pcie/rx.c +3 -2
@@ -1620,14 +1620,14 @@ irqreturn_t iwl_pcie_irq_rx_msix_handler(int irq, void *dev_id)struct msix_entry *entry = dev_id;struct iwl_trans_pcie *trans_pcie =iwl_pcie_get_trans_pcie (entry);struct iwl_trans *trans = trans_pcie->trans; -struct iwl_rxq *rxq = &trans_pcie->rxq[entry->entry]; +struct iwl_rxq *rxq;trace_iwlwifi_dev_irq_msix (trans->dev, entry, false,0 ,0 );if (WARN_ON (entry->entry >= trans->num_rx_queues))return IRQ_NONE ; -if (!rxq) { +if (!trans_pcie->rxq) {if (net_ratelimit ()) IWL_ERR(trans, "[%d] Got MSI-X interrupt before we have Rx queues\n",
@@ -1635,6 +1635,7 @@ irqreturn_t iwl_pcie_irq_rx_msix_handler(int irq, void *dev_id)return IRQ_NONE ; } + rxq = &trans_pcie->rxq[entry->entry];lock_map_acquire (&trans->sync_cmd_lockdep_map);IWL_DEBUG_ISR (trans,"[%d] Got interrupt\n" , entry->entry);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 127/431 wifi: mac80211: Remove "Missing iftype sband data/EHT cap" spam
In reply to Greg Kroah-HartmanFrom: Nicolas Cavallari <[email protected]>
[ Upstream commit 6e21e7b8cd897193cee3c2649640efceb3004ba5 ]
In mesh mode, ieee80211_chandef_he_6ghz_oper() is called by mesh_matches_local() for every received mesh beacon.
On a 6 GHz mesh of a HE-only phy, this spams that the hardware does not have EHT capabilities, even if the received mesh beacon does not have an EHT element.
Unlike HE, not supporting EHT in the 6 GHz band is not an error so do not print anything in this case.
--- net/mac80211/util.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
net/mac80211/util.c +1 -3
@@ -3707,10 +3707,8 @@ bool ieee80211_chandef_he_6ghz_oper(struct ieee80211_sub_if_data *sdata, } eht_cap =ieee80211_get_eht_iftype_cap (sband, iftype); -if (!eht_cap) { -sdata_info (sdata,"Missing iftype sband data/EHT cap" ); +if (!eht_cap) eht_oper =NULL ; - } he_6ghz_oper =ieee80211_he_6ghz_oper (he_oper);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 128/431 wifi: cfg80211: rewrite merging of inherited elements
In reply to Greg Kroah-HartmanFrom: Benjamin Berg <[email protected]>
[ Upstream commit dfd9aa3e7a456d57b18021d66472ab7ff8373ab7 ]
The cfg80211_gen_new_ie function merges the IEs using inheritance rules. Rewrite this function to fix issues around inheritance rules. In particular, vendor elements do not require any special handling, as they are either all inherited or overridden by the subprofile. Also, add fragmentation handling as this may be needed in some cases.
This also changes the function to not require making a copy. The new version could be optimized a bit by explicitly tracking which IEs have been handled already rather than looking that up again every time.
Note that a small behavioural change is the removal of the SSID special handling. This should be fine for the MBSSID element, as the SSID must be included in the subelement.
--- net/wireless/scan.c | 213 ++++++++++++++++++++++++++------------------ 1 file changed, 124 insertions(+), 89 deletions(-)
net/wireless/scan.c +124 -89
@@ -259,117 +259,152 @@ bool cfg80211_is_element_inherited(const struct element *elem, }EXPORT_SYMBOL (cfg80211_is_element_inherited); -static size_t cfg80211_gen_new_ie (const u8 *ie,size_t ielen, -const u8 *subelement,size_t subie_len, -u8 *new_ie,gfp_t gfp) +static size_t cfg80211_copy_elem_with_frags (const struct element *elem, +const u8 *ie,size_t ie_len, +u8 **pos,u8 *buf,size_t buf_len) { -u8 *pos, *tmp; -const u8 *tmp_old, *tmp_new; -const struct element *non_inherit_elem; -u8 *sub_copy; +if (WARN_ON ((u8 *)elem < ie || elem->data > ie + ie_len || + elem->data + elem->datalen > ie + ie_len)) +return 0 ; -/* copy subelement as we need to change its content to -* mark an ie after it is processed. -*/ - sub_copy =kmemdup (subelement, subie_len, gfp); -if (!sub_copy) +if (elem->datalen +2 > buf + buf_len - *pos)return 0 ; - pos = &new_ie[0 ]; +memcpy (*pos, elem, elem->datalen +2 ); + *pos += elem->datalen +2 ; -/* set new ssid */ - tmp_new =cfg80211_find_ie (WLAN_EID_SSID , sub_copy, subie_len); -if (tmp_new) { -memcpy (pos, tmp_new, tmp_new[1 ] +2 ); - pos += (tmp_new[1 ] +2 ); +/* Finish if it is not fragmented */ +if (elem->datalen !=255 ) +return *pos - buf; + + ie_len = ie + ie_len - elem->data - elem->datalen; + ie = (const u8 *)elem->data + elem->datalen; + +for_each_element (elem, ie, ie_len) { +if (elem->id !=WLAN_EID_FRAGMENT ) +break ; + +if (elem->datalen +2 > buf + buf_len - *pos) +return 0 ; + +memcpy (*pos, elem, elem->datalen +2 ); + *pos += elem->datalen +2 ; + +if (elem->datalen !=255 ) +break ; } -/* get non inheritance list if exists */ - non_inherit_elem = -cfg80211_find_ext_elem (WLAN_EID_EXT_NON_INHERITANCE , - sub_copy, subie_len); +return *pos - buf; +} -/* go through IEs in ie (skip SSID) and subelement, -* merge them into new_ie +static size_t cfg80211_gen_new_ie (const u8 *ie,size_t ielen, +const u8 *subie,size_t subie_len, +u8 *new_ie,size_t new_ie_len) +{ +const struct element *non_inherit_elem, *parent, *sub; +u8 *pos = new_ie; +u8 id, ext_id; +unsigned int match_len; + + non_inherit_elem =cfg80211_find_ext_elem (WLAN_EID_EXT_NON_INHERITANCE , + subie, subie_len); + +/* We copy the elements one by one from the parent to the generated +* elements. +* If they are not inherited (included in subie or in the non +* inheritance element), then we copy all occurrences the first time +* we see this element type. */ - tmp_old =cfg80211_find_ie (WLAN_EID_SSID , ie, ielen); - tmp_old = (tmp_old) ? tmp_old + tmp_old[1 ] +2 : ie; - -while (tmp_old +2 - ie <= ielen && - tmp_old + tmp_old[1 ] +2 - ie <= ielen) { -if (tmp_old[0 ] ==0 ) { - tmp_old++; +for_each_element (parent, ie, ielen) { +if (parent->id ==WLAN_EID_FRAGMENT )continue ; + +if (parent->id ==WLAN_EID_EXTENSION ) { +if (parent->datalen <1 ) +continue ; + + id =WLAN_EID_EXTENSION ; + ext_id = parent->data[0 ]; + match_len =1 ; + }else { + id = parent->id; + match_len =0 ; } -if (tmp_old[0 ] ==WLAN_EID_EXTENSION ) - tmp = (u8 *)cfg80211_find_ext_ie (tmp_old[2 ], sub_copy, - subie_len); -else - tmp = (u8 *)cfg80211_find_ie (tmp_old[0 ], sub_copy, - subie_len); +/* Find first occurrence in subie */ + sub =cfg80211_find_elem_match (id, subie, subie_len, + &ext_id, match_len,0 ); -if (!tmp) { -const struct element *old_elem = (void *)tmp_old; +/* Copy from parent if not in subie and inherited */ +if (!sub && +cfg80211_is_element_inherited (parent, non_inherit_elem)) { +if (!cfg80211_copy_elem_with_frags (parent, + ie, ielen, + &pos, new_ie, + new_ie_len)) +return 0 ; -/* ie in old ie but not in subelement */ -if (cfg80211_is_element_inherited (old_elem, - non_inherit_elem)) { -memcpy (pos, tmp_old, tmp_old[1 ] +2 ); - pos += tmp_old[1 ] +2 ; - } - }else { -/* ie in transmitting ie also in subelement, -* copy from subelement and flag the ie in subelement -* as copied (by setting eid field to WLAN_EID_SSID, -* which is skipped anyway). -* For vendor ie, compare OUI + type + subType to -* determine if they are the same ie. -*/ -if (tmp_old[0 ] ==WLAN_EID_VENDOR_SPECIFIC ) { -if (tmp_old[1 ] >=5 && tmp[1 ] >=5 && - !memcmp (tmp_old +2 , tmp +2 ,5 )) { -/* same vendor ie, copy from -* subelement -*/ -memcpy (pos, tmp, tmp[1 ] +2 ); - pos += tmp[1 ] +2 ; - tmp[0 ] =WLAN_EID_SSID ; - }else { -memcpy (pos, tmp_old, tmp_old[1 ] +2 ); - pos += tmp_old[1 ] +2 ; - } - }else { -/* copy ie from subelement into new ie */ -memcpy (pos, tmp, tmp[1 ] +2 ); - pos += tmp[1 ] +2 ; - tmp[0 ] =WLAN_EID_SSID ; - } +continue ; } -if (tmp_old + tmp_old[1 ] +2 - ie == ielen) -break ; +/* Already copied if an earlier element had the same type */ +if (cfg80211_find_elem_match (id, ie, (u8 *)parent - ie, + &ext_id, match_len,0 )) +continue ; - tmp_old += tmp_old[1 ] +2 ; +/* Not inheriting, copy all similar elements from subie */ +while (sub) { +if (!cfg80211_copy_elem_with_frags (sub, + subie, subie_len, + &pos, new_ie, + new_ie_len)) +return 0 ; + + sub =cfg80211_find_elem_match (id, + sub->data + sub->datalen, + subie_len + subie - + (sub->data + + sub->datalen), + &ext_id, match_len,0 ); + } } -/* go through subelement again to check if there is any ie not -* copied to new ie, skip ssid, capability, bssid-index ie +/* The above misses elements that are included in subie but not in the +* parent, so do a pass over subie and append those. +* Skip the non-tx BSSID caps and non-inheritance element. */ - tmp_new = sub_copy; -while (tmp_new +2 - sub_copy <= subie_len && - tmp_new + tmp_new[1 ] +2 - sub_copy <= subie_len) { -if (!(tmp_new[0 ] ==WLAN_EID_NON_TX_BSSID_CAP || - tmp_new[0 ] ==WLAN_EID_SSID )) { -memcpy (pos, tmp_new, tmp_new[1 ] +2 ); - pos += tmp_new[1 ] +2 ; +for_each_element (sub, subie, subie_len) { +if (sub->id ==WLAN_EID_NON_TX_BSSID_CAP ) +continue ; + +if (sub->id ==WLAN_EID_FRAGMENT ) +continue ; + +if (sub->id ==WLAN_EID_EXTENSION ) { +if (sub->datalen <1 ) +continue ; + + id =WLAN_EID_EXTENSION ; + ext_id = sub->data[0 ]; + match_len =1 ; + +if (ext_id ==WLAN_EID_EXT_NON_INHERITANCE ) +continue ; + }else { + id = sub->id; + match_len =0 ; } -if (tmp_new + tmp_new[1 ] +2 - sub_copy == subie_len) -break ; - tmp_new += tmp_new[1 ] +2 ; + +/* Processed if one was included in the parent */ +if (cfg80211_find_elem_match (id, ie, ielen, + &ext_id, match_len,0 )) +continue ; + +if (!cfg80211_copy_elem_with_frags (sub, subie, subie_len, + &pos, new_ie, new_ie_len)) +return 0 ; } -kfree (sub_copy);return pos - new_ie; }
@@ -2217,7 +2252,7 @@ static void cfg80211_parse_mbssid_data(struct wiphy *wiphy, new_ie_len =cfg80211_gen_new_ie (ie, ielen, profile, profile_len, new_ie, - gfp); +IEEE80211_MAX_DATA_LEN );if (!new_ie_len)continue ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 129/431 wifi: cfg80211: drop incorrect nontransmitted BSS update code
In reply to Greg Kroah-HartmanFrom: Benjamin Berg <[email protected]>
[ Upstream commit 39432f8a3752a87a53fd8d5e51824a43aaae5cab ]
The removed code ran for any BSS that was not included in the MBSSID element in order to update it. However, instead of using the correct inheritance rules, it would simply copy the elements from the transmitting AP. The result is that we would report incorrect elements in this case.
After some discussions, it seems that there are likely not even APs actually using this feature. Either way, removing the code decreases complexity and makes the cfg80211 behaviour more correct.
--- net/wireless/scan.c | 154 ++++---------------------------------------- 1 file changed, 11 insertions(+), 143 deletions(-)
net/wireless/scan.c +11 -143
@@ -2301,118 +2301,6 @@ cfg80211_inform_bss_data(struct wiphy *wiphy, }EXPORT_SYMBOL (cfg80211_inform_bss_data); -static void -cfg80211_parse_mbssid_frame_data (struct wiphy *wiphy, -struct cfg80211_inform_bss *data, -struct ieee80211_mgmt *mgmt,size_t len, -struct cfg80211_non_tx_bss *non_tx_data, -gfp_t gfp) -{ -enum cfg80211_bss_frame_type ftype; -const u8 *ie = mgmt->u.probe_resp.variable; -size_t ielen = len - offsetof(struct ieee80211_mgmt , - u.probe_resp.variable); - - ftype =ieee80211_is_beacon (mgmt->frame_control) ? -CFG80211_BSS_FTYPE_BEACON :CFG80211_BSS_FTYPE_PRESP ; - -cfg80211_parse_mbssid_data (wiphy, data, ftype, mgmt->bssid, -le64_to_cpu (mgmt->u.probe_resp.timestamp), -le16_to_cpu (mgmt->u.probe_resp.beacon_int), - ie, ielen, non_tx_data, gfp); -} - -static void -cfg80211_update_notlisted_nontrans (struct wiphy *wiphy, -struct cfg80211_bss *nontrans_bss, -struct ieee80211_mgmt *mgmt,size_t len) -{ -u8 *ie, *new_ie, *pos; -const struct element *nontrans_ssid; -const u8 *trans_ssid, *mbssid; -size_t ielen = len - offsetof(struct ieee80211_mgmt , - u.probe_resp.variable); -size_t new_ie_len; -struct cfg80211_bss_ies *new_ies; -const struct cfg80211_bss_ies *old; -size_t cpy_len; - -lockdep_assert_held (&wiphy_to_rdev (wiphy)->bss_lock); - - ie = mgmt->u.probe_resp.variable; - - new_ie_len = ielen; - trans_ssid =cfg80211_find_ie (WLAN_EID_SSID , ie, ielen); -if (!trans_ssid) -return ; - new_ie_len -= trans_ssid[1 ]; - mbssid =cfg80211_find_ie (WLAN_EID_MULTIPLE_BSSID , ie, ielen); -/* -* It's not valid to have the MBSSID element before SSID -* ignore if that happens - the code below assumes it is -* after (while copying things inbetween). -*/ -if (!mbssid || mbssid < trans_ssid) -return ; - new_ie_len -= mbssid[1 ]; - - nontrans_ssid =ieee80211_bss_get_elem (nontrans_bss,WLAN_EID_SSID ); -if (!nontrans_ssid) -return ; - - new_ie_len += nontrans_ssid->datalen; - -/* generate new ie for nontrans BSS -* 1. replace SSID with nontrans BSS' SSID -* 2. skip MBSSID IE -*/ - new_ie =kzalloc (new_ie_len,GFP_ATOMIC ); -if (!new_ie) -return ; - - new_ies =kzalloc (sizeof (*new_ies) + new_ie_len,GFP_ATOMIC ); -if (!new_ies) - goto out_free; - - pos = new_ie; - -/* copy the nontransmitted SSID */ - cpy_len = nontrans_ssid->datalen +2 ; -memcpy (pos, nontrans_ssid, cpy_len); - pos += cpy_len; -/* copy the IEs between SSID and MBSSID */ - cpy_len = trans_ssid[1 ] +2 ; -memcpy (pos, (trans_ssid + cpy_len), (mbssid - (trans_ssid + cpy_len))); - pos += (mbssid - (trans_ssid + cpy_len)); -/* copy the IEs after MBSSID */ - cpy_len = mbssid[1 ] +2 ; -memcpy (pos, mbssid + cpy_len, ((ie + ielen) - (mbssid + cpy_len))); - -/* update ie */ - new_ies->len = new_ie_len; - new_ies->tsf =le64_to_cpu (mgmt->u.probe_resp.timestamp); - new_ies->from_beacon =ieee80211_is_beacon (mgmt->frame_control); -memcpy (new_ies->data, new_ie, new_ie_len); -if (ieee80211_is_probe_resp (mgmt->frame_control)) { - old =rcu_access_pointer (nontrans_bss->proberesp_ies); -rcu_assign_pointer (nontrans_bss->proberesp_ies, new_ies); -rcu_assign_pointer (nontrans_bss->ies, new_ies); -if (old) -kfree_rcu ((struct cfg80211_bss_ies *)old, rcu_head); - }else { - old =rcu_access_pointer (nontrans_bss->beacon_ies); -rcu_assign_pointer (nontrans_bss->beacon_ies, new_ies); -cfg80211_update_hidden_bsses (bss_from_pub (nontrans_bss), - new_ies, old); -rcu_assign_pointer (nontrans_bss->ies, new_ies); -if (old) -kfree_rcu ((struct cfg80211_bss_ies *)old, rcu_head); - } - -out_free: -kfree (new_ie); -} -/* cfg80211_inform_bss_width_frame helper */ static struct cfg80211_bss * cfg80211_inform_single_bss_frame_data(struct wiphy *wiphy,
@@ -2554,51 +2442,31 @@ cfg80211_inform_bss_frame_data(struct wiphy *wiphy, struct ieee80211_mgmt *mgmt, size_t len, gfp_t gfp) { - struct cfg80211_bss *res, *tmp_bss; + struct cfg80211_bss *res;const u8 *ie = mgmt->u.probe_resp.variable; -const struct cfg80211_bss_ies *ies1, *ies2;size_t ielen = len - offsetof(struct ieee80211_mgmt , u.probe_resp.variable); +enum cfg80211_bss_frame_type ftype;struct cfg80211_non_tx_bss non_tx_data = {}; res =cfg80211_inform_single_bss_frame_data (wiphy, data, mgmt, len, gfp); +if (!res) +return NULL ;/* don't do any further MBSSID handling for S1G */ if (ieee80211_is_s1g_beacon (mgmt->frame_control))return res; -if (!res || !wiphy->support_mbssid || - !cfg80211_find_elem (WLAN_EID_MULTIPLE_BSSID , ie, ielen)) -return res; -if (wiphy->support_only_he_mbssid && - !cfg80211_find_ext_elem (WLAN_EID_EXT_HE_CAPABILITY , ie, ielen)) -return res; - + ftype =ieee80211_is_beacon (mgmt->frame_control) ? +CFG80211_BSS_FTYPE_BEACON :CFG80211_BSS_FTYPE_PRESP ; non_tx_data.tx_bss = res; -/* process each non-transmitting bss */ -cfg80211_parse_mbssid_frame_data (wiphy, data, mgmt, len, - &non_tx_data, gfp); - -spin_lock_bh (&wiphy_to_rdev (wiphy)->bss_lock); -/* check if the res has other nontransmitting bss which is not -* in MBSSID IE -*/ - ies1 =rcu_access_pointer (res->ies); - -/* go through nontrans_list, if the timestamp of the BSS is -* earlier than the timestamp of the transmitting BSS then -* update it -*/ -list_for_each_entry (tmp_bss, &res->nontrans_list, - nontrans_list) { - ies2 =rcu_access_pointer (tmp_bss->ies); -if (ies2->tsf < ies1->tsf) -cfg80211_update_notlisted_nontrans (wiphy, tmp_bss, - mgmt, len); - } -spin_unlock_bh (&wiphy_to_rdev (wiphy)->bss_lock); +/* process each non-transmitting bss */ +cfg80211_parse_mbssid_data (wiphy, data, ftype, mgmt->bssid, +le64_to_cpu (mgmt->u.probe_resp.timestamp), +le16_to_cpu (mgmt->u.probe_resp.beacon_int), + ie, ielen, &non_tx_data, gfp);return res; }
Signature · 1 line
2.39.2