Merge 5.10.239 into android12-5.10-lts
Changes in 5.10.239
tracing: Fix compilation warning on arm32
pinctrl: armada-37xx: use correct OUTPUT_VAL register for GPIOs > 31
pinctrl: armada-37xx: set GPIO output value before setting direction
acpi-cpufreq: Fix nominal_freq units to KHz in get_max_boost_ratio()
usb: quirks: Add NO_LPM quirk for SanDisk Extreme 55AE
usb: storage: Ignore UAS driver for SanDisk 3.2 Gen2 storage device
usb: usbtmc: Fix timeout value in get_stb
thunderbolt: Do not double dequeue a configuration request
netfilter: nft_socket: fix sk refcount leaks
gfs2: gfs2_create_inode error handling fix
perf/core: Fix broken throttling when max_samples_per_tick=1
crypto: sun8i-ss - do not use sg_dma_len before calling DMA functions
x86/cpu: Sanitize CPUID(0x80000000) output
crypto: marvell/cesa - Handle zero-length skcipher requests
crypto: marvell/cesa - Avoid empty transfer descriptor
crypto: lrw - Only add ecb if it is not already there
crypto: xts - Only add ecb if it is not already there
crypto: sun8i-ce - move fallback ahash_request to the end of the struct
EDAC/skx_common: Fix general protection fault
power: reset: at91-reset: Optimize at91_reset()
PM: wakeup: Delete space in the end of string shown by pm_show_wakelocks()
x86/mtrr: Check if fixed-range MTRRs exist in mtrr_save_fixed_ranges()
ACPI: OSI: Stop advertising support for "3.0 _SCP Extensions"
spi: sh-msiof: Fix maximum DMA transfer size
drm/vmwgfx: Add seqno waiter for sync_files
media: rkvdec: Fix frame size enumeration
m68k: mac: Fix macintosh_config for Mac II
firmware: psci: Fix refcount leak in psci_dt_init
selftests/seccomp: fix syscall_restart test for arm compat
drm: rcar-du: Fix memory leak in rcar_du_vsps_init()
drm/vkms: Adjust vkms_state->active_planes allocation type
drm/tegra: rgb: Fix the unbound reference count
firmware: SDEI: Allow sdei initialization without ACPI_APEI_GHES
wifi: ath11k: fix node corruption in ar->arvifs list
f2fs: fix to do sanity check on sbi->total_valid_block_count
net: ncsi: Fix GCPS 64-bit member variables
wifi: rtw88: do not ignore hardware read error during DPK
RDMA/hns: Include hnae3.h in hns_roce_hw_v2.h
f2fs: clean up w/ fscrypt_is_bounce_page()
netfilter: bridge: Move specific fragmented packet to slow_path instead of dropping it
RDMA/mlx5: Fix error flow upon firmware failure for RQ destruction
clk: bcm: rpi: Add NULL check in raspberrypi_clk_register()
ktls, sockmap: Fix missing uncharge operation
libbpf: Use proper errno value in nlattr
pinctrl: at91: Fix possible out-of-boundary access
bpf: Fix WARN() in get_bpf_raw_tp_regs
clk: qcom: gcc-msm8939: Fix mclk0 & mclk1 for 24 MHz
s390/bpf: Store backchain even for leaf progs
wifi: ath9k_htc: Abort software beacon handling if disabled
netfilter: nf_tables: nft_fib_ipv6: fix VRF ipv4/ipv6 result discrepancy
vfio/type1: Fix error unwind in migration dirty bitmap allocation
netfilter: nft_tunnel: fix geneve_opt dump
net: usb: aqc111: fix error handling of usbnet read calls
net: lan743x: rename lan743x_reset_phy to lan743x_hw_reset_phy
calipso: Don't call calipso functions for AF_INET sk.
net: openvswitch: Fix the dead loop of MPLS parse
net: phy: mscc: Stop clearing the the UDPv4 checksum for L2 frames
f2fs: use d_inode(dentry) cleanup dentry->d_inode
f2fs: fix to correct check conditions in f2fs_cross_rename
ARM: dts: at91: usb_a9263: fix GPIO for Dataflash chip select
ARM: dts: at91: at91sam9263: fix NAND chip selects
arm64: dts: imx8mm-beacon: Fix RTC capacitive load
Squashfs: check return result of sb_min_blocksize
nilfs2: add pointer check for nilfs_direct_propagate()
nilfs2: do not propagate ENOENT error from nilfs_btree_propagate()
bus: fsl-mc: fix double-free on mc_dev
ARM: dts: qcom: apq8064 merge hw splinlock into corresponding syscon device
arm64: dts: rockchip: disable unrouted USB controllers and PHY on RK3399 Puma with Haikou
soc: aspeed: lpc: Fix impossible judgment condition
soc: aspeed: Add NULL check in aspeed_lpc_enable_snoop()
fbdev: core: fbcvt: avoid division by 0 in fb_cvt_hperiod()
perf build: Warn when libdebuginfod devel files are not available
perf ui browser hists: Set actions->thread before calling do_zoom_thread()
backlight: pm8941: Add NULL check in wled_configure()
perf scripts python: exported-sql-viewer.py: Fix pattern matching with Python 3
rpmsg: qcom_smd: Fix uninitialized return variable in __qcom_smd_send()
mfd: exynos-lpass: Avoid calling exynos_lpass_disable() twice in exynos_lpass_remove()
mfd: stmpe-spi: Correct the name used in MODULE_DEVICE_TABLE
perf tests switch-tracking: Fix timestamp comparison
perf record: Fix incorrect --user-regs comments
nfs: clear SB_RDONLY before getting superblock
nfs: ignore SB_RDONLY when remounting nfs
rtc: sh: assign correct interrupts with DT
PCI: cadence: Fix runtime atomic count underflow
dmaengine: ti: Add NULL check in udma_probe()
PCI/DPC: Initialize aer_err_info before using it
rtc: Fix offset calculation for .start_secs < 0
usb: renesas_usbhs: Reorder clock handling and power management in probe
serial: Fix potential null-ptr-deref in mlb_usio_probe()
iio: adc: ad7124: Fix 3dB filter frequency reading
MIPS: Loongson64: Add missing '#interrupt-cells' for loongson64c_ls7a
vt: remove VT_RESIZE and VT_RESIZEX from vt_compat_ioctl()
net: stmmac: platform: guarantee uniqueness of bus_id
gve: Fix RX_BUFFERS_POSTED stat to report per-queue fill_cnt
net: tipc: fix refcount warning in tipc_aead_encrypt
driver: net: ethernet: mtk_star_emac: fix suspend/resume issue
net/mlx4_en: Prevent potential integer overflow calculating Hz
spi: bcm63xx-spi: fix shared reset
spi: bcm63xx-hsspi: fix shared reset
Bluetooth: L2CAP: Fix not responding with L2CAP_CR_LE_ENCRYPTION
ice: create new Tx scheduler nodes for new queues only
vmxnet3: correctly report gso type for UDP tunnels
PM: sleep: Fix power.is_suspended cleanup for direct-complete devices
do_change_type(): refuse to operate on unmounted/not ours mounts
pmdomain: core: Fix error checking in genpd_dev_pm_attach_by_id()
Input: synaptics-rmi4 - convert to use sysfs_emit() APIs
Input: synaptics-rmi - fix crash with unsupported versions of F34
arm64: dts: ti: k3-am65-main: Drop deprecated ti,otap-del-sel property
arm64: dts: ti: k3-am65-main: Fix sdhci node properties
arm64: dts: ti: k3-am65-main: Add missing taps to sdhci0
serial: sh-sci: Check if TX data was written to device in .tx_empty()
serial: sh-sci: Move runtime PM enable to sci_probe_single()
serial: sh-sci: Clean sci_ports[0] after at earlycon exit
ath10k: add atomic protection for device recovery
ath10k: prevent deinitializing NAPI twice
ath10k: snoc: fix unbalanced IRQ enable in crash recovery
scsi: iscsi: Fix incorrect error path labels for flashnode operations
net_sched: sch_sfq: fix a potential crash on gso_skb handling
powerpc/vas: Move VAS API to book3s common platform
powerpc/vas: Return -EINVAL if the offset is non-zero in mmap()
i40e: return false from i40e_reset_vf if reset is in progress
i40e: retry VFLR handling if there is ongoing VF reset
tcp: factorize logic into tcp_epollin_ready()
bpf: Clean up sockmap related Kconfigs
net: Rename ->stream_memory_read to ->sock_is_readable
net: Fix TOCTOU issue in sk_is_readable()
macsec: MACsec SCI assignment for ES = 0
net: mdio: C22 is now optional, EOPNOTSUPP if not provided
net/mdiobus: Fix potential out-of-bounds read/write access
net/mlx5: Ensure fw pages are always allocated on same NUMA
net/mlx5: Fix return value when searching for existing flow group
net_sched: prio: fix a race in prio_tune()
net_sched: red: fix a race in __red_change()
net_sched: tbf: fix a race in tbf_change()
sch_ets: make est_qlen_notify() idempotent
net_sched: ets: fix a race in ets_qdisc_change()
fs/filesystems: Fix potential unsigned integer underflow in fs_name()
posix-cpu-timers: fix race between handle_posix_cpu_timers() and posix_cpu_timer_del()
x86/boot/compressed: prefer cc-option for CFLAGS additions
MIPS: Move '-Wa,-msoft-float' check from as-option to cc-option
MIPS: Prefer cc-option for additions to cflags
kbuild: Update assembler calls to use proper flags and language target
drm/amd/display: Do not add '-mhard-float' to dml_ccflags for clang
mips: Include KBUILD_CPPFLAGS in CHECKFLAGS invocation
kbuild: Add CLANG_FLAGS to as-instr
kbuild: add $(CLANG_FLAGS) to KBUILD_CPPFLAGS
kbuild: Add KBUILD_CPPFLAGS to as-option invocation
drm/amd/display: Do not add '-mhard-float' to dcn2{1,0}_resource.o for clang
usb: Flush altsetting 0 endpoints before reinitializating them after reset.
xen/arm: call uaccess_ttbr0_enable for dm_op hypercall
x86/iopl: Cure TIF_IO_BITMAP inconsistencies
calipso: unlock rcu before returning -EAFNOSUPPORT
net: usb: aqc111: debug info before sanitation
kbuild: userprogs: fix bitsize and target detection on clang
kbuild: hdrcheck: fix cross build with clang
tcp: tcp_data_ready() must look at SOCK_DONE
configfs: Do not override creating attribute file failure in populate_attrs()
crypto: marvell/cesa - Do not chain submitted requests
gfs2: move msleep to sleepable context
ASoC: qcom: sdm845: Add error handling in sdm845_slim_snd_hw_params()
ASoC: meson: meson-card-utils: use of_property_present() for DT parsing
net/mlx5_core: Add error handling inmlx5_query_nic_vport_qkey_viol_cntr()
net/mlx5: Add error handling in mlx5_query_nic_vport_node_guid()
wifi: p54: prevent buffer-overflow in p54_rx_eeprom_readback()
nfsd: nfsd4_spo_must_allow() must check this is a v4 compound request
nfsd: Initialize ssc before laundromat_work to prevent NULL dereference
jbd2: fix data-race and null-ptr-deref in jbd2_journal_dirty_metadata()
wifi: rtlwifi: disable ASPM for RTL8723BE with subsystem ID 11ad:1723
media: ov8856: suppress probe deferral errors
media: cxusb: no longer judge rbuf when the write fails
media: gspca: Add error handling for stv06xx_read_sensor()
media: v4l2-dev: fix error handling in __video_register_device()
media: venus: Fix probe error handling
media: videobuf2: use sgtable-based scatterlist wrappers
media: vidtv: Terminating the subsequent process of initialization failure
media: vivid: Change the siize of the composing
ARM: 9447/1: arm/memremap: fix arch_memremap_can_ram_remap()
ARM: omap: pmic-cpcap: do not mess around without CPCAP or OMAP4
bus: mhi: host: Fix conflict between power_up and SYSERR
ata: pata_via: Force PIO for ATAPI devices on VT6415/VT6330
bus: fsl-mc: do not add a device-link for the UAPI used DPMCP device
ext4: inline: fix len overflow in ext4_prepare_inline_data
ext4: fix calculation of credits for extent tree modification
ext4: factor out ext4_get_maxbytes()
ext4: ensure i_size is smaller than maxbytes
Input: ims-pcu - check record size in ims_pcu_flash_firmware()
f2fs: prevent kernel warning due to negative i_nlink from corrupted image
f2fs: fix to do sanity check on sit_bitmap_size
NFC: nci: uart: Set tty->disc_data only in success path
EDAC/altera: Use correct write width with the INTTEST register
fbdev: Fix fb_set_var to prevent null-ptr-deref in fb_videomode_to_var
vgacon: Add check for vc_origin address range in vgacon_scroll()
parisc: fix building with gcc-15
clk: meson-g12a: add missing fclk_div2 to spicc
ipc: fix to protect IPCS lookups using RCU
mm: fix ratelimit_pages update error in dirty_ratio_handler()
mtd: rawnand: sunxi: Add randomizer configuration in sunxi_nfc_hw_ecc_write_chunk
mtd: nand: sunxi: Add randomizer configuration before randomizer enable
dm-mirror: fix a tiny race condition
ftrace: Fix UAF when lookup kallsym after ftrace disabled
net: ch9200: fix uninitialised access during mii_nway_restart
staging: iio: ad5933: Correct settling cycles encoding per datasheet
mips: Add -std= flag specified in KBUILD_CFLAGS to vdso CFLAGS
regulator: max14577: Add error check for max14577_read_reg()
uio_hv_generic: Use correct size for interrupt and monitor pages
PCI: Add ACS quirk for Loongson PCIe
PCI: Fix lock symmetry in pci_slot_unlock()
iio: imu: inv_icm42600: Fix temperature calculation
iio: adc: ad7606_spi: fix reg write value mask
ACPICA: fix acpi operand cache leak in dswstate.c
clocksource: Fix the CPUs' choice in the watchdog per CPU verification
ACPICA: Avoid sequence overread in call to strncmp()
ASoC: tas2770: Power cycle amp on ISENSE/VSENSE change
ACPICA: fix acpi parse and parseext cache leaks
power: supply: bq27xxx: Retrieve again when busy
ACPICA: utilities: Fix overflow check in vsnprintf()
ASoC: tegra210_ahub: Add check to of_device_get_match_data()
PM: runtime: fix denying of auto suspend in pm_suspend_timer_fn()
ACPI: battery: negate current when discharging
drm/amdgpu/gfx6: fix CSIB handling
sunrpc: update nextcheck time when adding new cache entries
drm/bridge: analogix_dp: Add irq flag IRQF_NO_AUTOEN instead of calling disable_irq()
exfat: fix double free in delayed_free
drm/msm/hdmi: add runtime PM calls to DDC transfer function
media: uapi: v4l: Fix V4L2_TYPE_IS_OUTPUT condition
drm/amd/display: Add NULL pointer checks in dm_force_atomic_commit()
drm/msm/a6xx: Increase HFI response timeout
drm/amdgpu/gfx10: fix CSIB handling
media: uapi: v4l: Change V4L2_TYPE_IS_CAPTURE condition
drm/amdgpu/gfx7: fix CSIB handling
ext4: ext4: unify EXT4_EX_NOCACHE|NOFAIL flags in ext4_ext_remove_space()
jfs: fix array-index-out-of-bounds read in add_missing_indices
media: rkvdec: Initialize the m2m context before the controls
sunrpc: fix race in cache cleanup causing stale nextcheck time
ext4: prevent stale extent cache entries caused by concurrent get es_cache
drm/amdgpu/gfx8: fix CSIB handling
drm/amdgpu/gfx9: fix CSIB handling
jfs: Fix null-ptr-deref in jfs_ioc_trim
drm/msm/dpu: don't select single flush for active CTL blocks
drm/amdkfd: Set SDMA_RLCx_IB_CNTL/SWITCH_INSIDE_IB
media: tc358743: ignore video while HPD is low
media: platform: exynos4-is: Add hardware sync wait to fimc_is_hw_change_mode()
nios2: force update_mmu_cache on spurious tlb-permission--related pagefaults
thermal/drivers/qcom/tsens: Update conditions to strictly evaluate for IP v2+
cpufreq: Force sync policy boost with global boost on sysfs update
net: macb: Check return value of dma_set_mask_and_coherent()
tipc: use kfree_sensitive() for aead cleanup
i2c: designware: Invoke runtime suspend on quick slave re-registration
emulex/benet: correct command version selection in be_cmd_get_stats()
wifi: mt76: mt76x2: Add support for LiteOn WN4516R,WN4519R
sctp: Do not wake readers in __sctp_write_space()
i2c: npcm: Add clock toggle recovery
net: dlink: add synchronization for stats update
tcp: always seek for minimal rtt in tcp_rcv_rtt_update()
tcp: fix initial tp->rcvq_space.space value for passive TS enabled flows
ipv4/route: Use this_cpu_inc() for stats on PREEMPT_RT
net: atlantic: generate software timestamp just before the doorbell
pinctrl: armada-37xx: propagate error from armada_37xx_pmx_set_by_name()
pinctrl: armada-37xx: propagate error from armada_37xx_gpio_get_direction()
pinctrl: armada-37xx: propagate error from armada_37xx_pmx_gpio_set_direction()
pinctrl: armada-37xx: propagate error from armada_37xx_gpio_get()
net: mlx4: add SOF_TIMESTAMPING_TX_SOFTWARE flag when getting ts info
wifi: mac80211: do not offer a mesh path if forwarding is disabled
clk: rockchip: rk3036: mark ddrphy as critical
scsi: lpfc: Fix lpfc_check_sli_ndlp() handling for GEN_REQUEST64 commands
iommu/amd: Ensure GA log notifier callbacks finish running before module unload
vxlan: Do not treat dst cache initialization errors as fatal
software node: Correct a OOB check in software_node_get_reference_args()
scsi: lpfc: Use memcpy() for BIOS version
sock: Correct error checking condition for (assign|release)_proto_idx()
i40e: fix MMIO write access to an invalid page in i40e_clear_hw
watchdog: da9052_wdt: respect TWDMIN
bus: fsl-mc: increase MC_CMD_COMPLETION_TIMEOUT_MS value
ARM: OMAP2+: Fix l4ls clk domain handling in STANDBY
tee: Prevent size calculation wraparound on 32-bit kernels
Revert "bus: ti-sysc: Probe for l4_wkup and l4_cfg interconnect devices first"
platform: Add Surface platform directory
platform/x86: dell_rbu: Fix list usage
platform/x86: dell_rbu: Stop overwriting data buffer
powerpc/eeh: Fix missing PE bridge reconfiguration during VFIO EEH recovery
Revert "x86/bugs: Make spectre user default depend on MITIGATION_SPECTRE_V2" on v6.6 and older
drivers/rapidio/rio_cm.c: prevent possible heap overwrite
jffs2: check that raw node were preallocated before writing summary
jffs2: check jffs2_prealloc_raw_node_refs() result in few other places
scsi: storvsc: Increase the timeouts to storvsc_timeout
scsi: s390: zfcp: Ensure synchronous unit_add
udmabuf: use sgtable-based scatterlist wrappers
selinux: fix selinux_xfrm_alloc_user() to set correct ctx_len
atm: Revert atm_account_tx() if copy_from_iter_full() fails.
HID: usbhid: Eliminate recurrent out-of-bounds bug in usbhid_parse()
Input: sparcspkr - avoid unannotated fall-through
ALSA: usb-audio: Rename ALSA kcontrol PCM and PCM1 for the KTMicro sound card
ALSA: hda/intel: Add Thinkpad E15 to PM deny list
ALSA: hda/realtek: enable headset mic on Latitude 5420 Rugged
hugetlb: unshare some PMDs when splitting VMAs
mm/hugetlb: unshare page tables during VMA split, not before
mm: hugetlb: independent PMD page table shared count
mm/hugetlb: fix huge_pmd_unshare() vs GUP-fast race
erofs: remove unused trace event erofs_destroy_inode
drm/nouveau/bl: increase buffer size to avoid truncate warning
hwmon: (occ) Add new temperature sensor type
hwmon: (occ) Add soft minimum power cap attribute
hwmon: (occ) Rework attribute registration for stack usage
hwmon: (occ) fix unaligned accesses
pldmfw: Select CRC32 when PLDMFW is selected
aoe: clean device rq_list in aoedev_downdev()
net: ice: Perform accurate aRFS flow match
wifi: carl9170: do not ping device which has failed to load firmware
mpls: Use rcu_dereference_rtnl() in mpls_route_input_rcu().
atm: atmtcp: Free invalid length skb in atmtcp_c_send().
tcp: fix tcp_packet_delayed() for tcp_is_non_sack_preventing_reopen() behavior
tipc: fix null-ptr-deref when acquiring remote ip of ethernet bearer
calipso: Fix null-ptr-deref in calipso_req_{set,del}attr().
net: atm: add lec_mutex
net: atm: fix /proc/net/atm/lec handling
ARM: dts: am335x-bone-common: Add GPIO PHY reset on revision C3 board
ARM: dts: am335x-bone-common: Increase MDIO reset deassert time
ARM: dts: am335x-bone-common: Increase MDIO reset deassert delay to 50ms
serial: sh-sci: Increment the runtime usage counter for the earlycon device
arm64: insn: Add barrier encodings
arm64: move AARCH64_BREAK_FAULT into insn-def.h
arm64: insn: add encoders for atomic operations
arm64: insn: Add support for encoding DSB
arm64: proton-pack: Expose whether the platform is mitigated by firmware
arm64: errata: Assume that unknown CPUs _are_ vulnerable to Spectre BHB
arm64: errata: Add KRYO 2XX/3XX/4XX silver cores to Spectre BHB safe list
arm64: errata: Add newer ARM cores to the spectre_bhb_loop_affected() lists
arm64: errata: Add missing sentinels to Spectre-BHB MIDR arrays
arm64: proton-pack: Expose whether the branchy loop k value
arm64: spectre: increase parameters that can be used to turn off bhb mitigation individually
arm64: bpf: Add BHB mitigation to the epilogue for cBPF programs
arm64: bpf: Only mitigate cBPF programs loaded by unprivileged users
arm64: proton-pack: Add new CPUs 'k' values for branch mitigation
net/ipv4: fix type mismatch in inet_ehash_locks_alloc() causing build failure
net: Fix checksum update for ILA adj-transport
bpf: Fix L4 csum update on IPv6 in CHECKSUM_COMPLETE
rtc: Improve performance of rtc_time64_to_tm(). Add tests.
rtc: Make rtc_time64_to_tm() support dates before 1970
net_sched: sch_sfq: annotate data-races around q->perturb_period
net_sched: sch_sfq: handle bigger packets
net_sched: sch_sfq: don't allow 1 packet limit
net_sched: sch_sfq: use a temporary work area for validating configuration
net_sched: sch_sfq: move the limit validation
mm/huge_memory: fix dereferencing invalid pmd migration entry
hwmon: (occ) Fix P10 VRM temp sensors
rtc: test: Fix invalid format specifier.
s390/pci: Fix __pcilg_mio_inuser() inline assembly
perf: Fix sample vs do_exit()
arm64/ptrace: Fix stack-out-of-bounds read in regs_get_kernel_stack_nth()
bpf: fix precision backtracking instruction iteration
scsi: qedf: Use designated initializer for struct qed_fcoe_cb_ops
Linux 5.10.239
Change-Id: If83691fc44267d4d5e1bc04eb0d2ef52becfe05c
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
2
Makefile
2
Makefile
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 10
|
||||
SUBLEVEL = 238
|
||||
SUBLEVEL = 239
|
||||
EXTRAVERSION =
|
||||
NAME = Dare mighty things
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs, unsigned int n)
|
||||
|
||||
addr += n;
|
||||
if (regs_within_kernel_stack(regs, (unsigned long)addr))
|
||||
return *addr;
|
||||
return READ_ONCE_NOCHECK(*addr);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ static inline int __pcilg_mio_inuser(
|
||||
:
|
||||
[cc] "+d" (cc), [val] "=d" (val), [len] "+d" (len),
|
||||
[dst] "+a" (dst), [cnt] "+d" (cnt), [tmp] "=d" (tmp),
|
||||
[shift] "+d" (shift)
|
||||
[shift] "+a" (shift)
|
||||
:
|
||||
[ioaddr] "a" (addr)
|
||||
: "cc", "memory");
|
||||
|
||||
@@ -340,18 +340,11 @@ static ssize_t occ_show_temp_10(struct device *dev,
|
||||
if (val == OCC_TEMP_SENSOR_FAULT)
|
||||
return -EREMOTEIO;
|
||||
|
||||
/*
|
||||
* VRM doesn't return temperature, only alarm bit. This
|
||||
* attribute maps to tempX_alarm instead of tempX_input for
|
||||
* VRM
|
||||
*/
|
||||
if (temp->fru_type != OCC_FRU_TYPE_VRM) {
|
||||
/* sensor not ready */
|
||||
if (val == 0)
|
||||
return -EAGAIN;
|
||||
/* sensor not ready */
|
||||
if (val == 0)
|
||||
return -EAGAIN;
|
||||
|
||||
val *= 1000;
|
||||
}
|
||||
val *= 1000;
|
||||
break;
|
||||
case 2:
|
||||
val = temp->fru_type;
|
||||
@@ -888,7 +881,7 @@ static int occ_setup_sensor_attrs(struct occ *occ)
|
||||
0, i, "temp%d_label", s);
|
||||
attr++;
|
||||
|
||||
if (sensors->temp.version > 1 &&
|
||||
if (sensors->temp.version == 2 &&
|
||||
temp->fru_type == OCC_FRU_TYPE_VRM) {
|
||||
occ_init_attribute(attr, 0444, show_temp, NULL,
|
||||
1, i, "temp%d_alarm", s);
|
||||
|
||||
@@ -10,6 +10,16 @@ config RTC_MC146818_LIB
|
||||
bool
|
||||
select RTC_LIB
|
||||
|
||||
config RTC_LIB_KUNIT_TEST
|
||||
tristate "KUnit test for RTC lib functions" if !KUNIT_ALL_TESTS
|
||||
depends on KUNIT
|
||||
default KUNIT_ALL_TESTS
|
||||
select RTC_LIB
|
||||
help
|
||||
Enable this option to test RTC library functions.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
menuconfig RTC_CLASS
|
||||
bool "Real Time Clock"
|
||||
default n
|
||||
|
||||
@@ -183,3 +183,4 @@ obj-$(CONFIG_RTC_DRV_WM8350) += rtc-wm8350.o
|
||||
obj-$(CONFIG_RTC_DRV_X1205) += rtc-x1205.o
|
||||
obj-$(CONFIG_RTC_DRV_XGENE) += rtc-xgene.o
|
||||
obj-$(CONFIG_RTC_DRV_ZYNQMP) += rtc-zynqmp.o
|
||||
obj-$(CONFIG_RTC_LIB_KUNIT_TEST) += lib_test.o
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
* Author: Alessandro Zummo <a.zummo@towertech.it>
|
||||
*
|
||||
* based on arch/arm/common/rtctime.c and other bits
|
||||
*
|
||||
* Author: Cassio Neri <cassio.neri@gmail.com> (rtc_time64_to_tm)
|
||||
*/
|
||||
|
||||
#include <linux/export.h>
|
||||
@@ -22,8 +24,6 @@ static const unsigned short rtc_ydays[2][13] = {
|
||||
{ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
|
||||
};
|
||||
|
||||
#define LEAPS_THRU_END_OF(y) ((y) / 4 - (y) / 100 + (y) / 400)
|
||||
|
||||
/*
|
||||
* The number of days in the month.
|
||||
*/
|
||||
@@ -42,42 +42,109 @@ int rtc_year_days(unsigned int day, unsigned int month, unsigned int year)
|
||||
}
|
||||
EXPORT_SYMBOL(rtc_year_days);
|
||||
|
||||
/*
|
||||
* rtc_time64_to_tm - Converts time64_t to rtc_time.
|
||||
* Convert seconds since 01-01-1970 00:00:00 to Gregorian date.
|
||||
/**
|
||||
* rtc_time64_to_tm - converts time64_t to rtc_time.
|
||||
*
|
||||
* @time: The number of seconds since 01-01-1970 00:00:00.
|
||||
* Works for values since at least 1900
|
||||
* @tm: Pointer to the struct rtc_time.
|
||||
*/
|
||||
void rtc_time64_to_tm(time64_t time, struct rtc_time *tm)
|
||||
{
|
||||
unsigned int month, year, secs;
|
||||
int days;
|
||||
int days, secs;
|
||||
|
||||
/* time must be positive */
|
||||
u64 u64tmp;
|
||||
u32 u32tmp, udays, century, day_of_century, year_of_century, year,
|
||||
day_of_year, month, day;
|
||||
bool is_Jan_or_Feb, is_leap_year;
|
||||
|
||||
/*
|
||||
* Get days and seconds while preserving the sign to
|
||||
* handle negative time values (dates before 1970-01-01)
|
||||
*/
|
||||
days = div_s64_rem(time, 86400, &secs);
|
||||
|
||||
/*
|
||||
* We need 0 <= secs < 86400 which isn't given for negative
|
||||
* values of time. Fixup accordingly.
|
||||
*/
|
||||
if (secs < 0) {
|
||||
days -= 1;
|
||||
secs += 86400;
|
||||
}
|
||||
|
||||
/* day of the week, 1970-01-01 was a Thursday */
|
||||
tm->tm_wday = (days + 4) % 7;
|
||||
/* Ensure tm_wday is always positive */
|
||||
if (tm->tm_wday < 0)
|
||||
tm->tm_wday += 7;
|
||||
|
||||
year = 1970 + days / 365;
|
||||
days -= (year - 1970) * 365
|
||||
+ LEAPS_THRU_END_OF(year - 1)
|
||||
- LEAPS_THRU_END_OF(1970 - 1);
|
||||
while (days < 0) {
|
||||
year -= 1;
|
||||
days += 365 + is_leap_year(year);
|
||||
}
|
||||
tm->tm_year = year - 1900;
|
||||
tm->tm_yday = days + 1;
|
||||
/*
|
||||
* The following algorithm is, basically, Proposition 6.3 of Neri
|
||||
* and Schneider [1]. In a few words: it works on the computational
|
||||
* (fictitious) calendar where the year starts in March, month = 2
|
||||
* (*), and finishes in February, month = 13. This calendar is
|
||||
* mathematically convenient because the day of the year does not
|
||||
* depend on whether the year is leap or not. For instance:
|
||||
*
|
||||
* March 1st 0-th day of the year;
|
||||
* ...
|
||||
* April 1st 31-st day of the year;
|
||||
* ...
|
||||
* January 1st 306-th day of the year; (Important!)
|
||||
* ...
|
||||
* February 28th 364-th day of the year;
|
||||
* February 29th 365-th day of the year (if it exists).
|
||||
*
|
||||
* After having worked out the date in the computational calendar
|
||||
* (using just arithmetics) it's easy to convert it to the
|
||||
* corresponding date in the Gregorian calendar.
|
||||
*
|
||||
* [1] "Euclidean Affine Functions and Applications to Calendar
|
||||
* Algorithms". https://arxiv.org/abs/2102.06959
|
||||
*
|
||||
* (*) The numbering of months follows rtc_time more closely and
|
||||
* thus, is slightly different from [1].
|
||||
*/
|
||||
|
||||
for (month = 0; month < 11; month++) {
|
||||
int newdays;
|
||||
udays = days + 719468;
|
||||
|
||||
newdays = days - rtc_month_days(month, year);
|
||||
if (newdays < 0)
|
||||
break;
|
||||
days = newdays;
|
||||
}
|
||||
tm->tm_mon = month;
|
||||
tm->tm_mday = days + 1;
|
||||
u32tmp = 4 * udays + 3;
|
||||
century = u32tmp / 146097;
|
||||
day_of_century = u32tmp % 146097 / 4;
|
||||
|
||||
u32tmp = 4 * day_of_century + 3;
|
||||
u64tmp = 2939745ULL * u32tmp;
|
||||
year_of_century = upper_32_bits(u64tmp);
|
||||
day_of_year = lower_32_bits(u64tmp) / 2939745 / 4;
|
||||
|
||||
year = 100 * century + year_of_century;
|
||||
is_leap_year = year_of_century != 0 ?
|
||||
year_of_century % 4 == 0 : century % 4 == 0;
|
||||
|
||||
u32tmp = 2141 * day_of_year + 132377;
|
||||
month = u32tmp >> 16;
|
||||
day = ((u16) u32tmp) / 2141;
|
||||
|
||||
/*
|
||||
* Recall that January 01 is the 306-th day of the year in the
|
||||
* computational (not Gregorian) calendar.
|
||||
*/
|
||||
is_Jan_or_Feb = day_of_year >= 306;
|
||||
|
||||
/* Converts to the Gregorian calendar. */
|
||||
year = year + is_Jan_or_Feb;
|
||||
month = is_Jan_or_Feb ? month - 12 : month;
|
||||
day = day + 1;
|
||||
|
||||
day_of_year = is_Jan_or_Feb ?
|
||||
day_of_year - 306 : day_of_year + 31 + 28 + is_leap_year;
|
||||
|
||||
/* Converts to rtc_time's format. */
|
||||
tm->tm_year = (int) (year - 1900);
|
||||
tm->tm_mon = (int) month;
|
||||
tm->tm_mday = (int) day;
|
||||
tm->tm_yday = (int) day_of_year + 1;
|
||||
|
||||
tm->tm_hour = secs / 3600;
|
||||
secs -= tm->tm_hour * 3600;
|
||||
|
||||
79
drivers/rtc/lib_test.c
Normal file
79
drivers/rtc/lib_test.c
Normal file
@@ -0,0 +1,79 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1+
|
||||
|
||||
#include <kunit/test.h>
|
||||
#include <linux/rtc.h>
|
||||
|
||||
/*
|
||||
* Advance a date by one day.
|
||||
*/
|
||||
static void advance_date(int *year, int *month, int *mday, int *yday)
|
||||
{
|
||||
if (*mday != rtc_month_days(*month - 1, *year)) {
|
||||
++*mday;
|
||||
++*yday;
|
||||
return;
|
||||
}
|
||||
|
||||
*mday = 1;
|
||||
if (*month != 12) {
|
||||
++*month;
|
||||
++*yday;
|
||||
return;
|
||||
}
|
||||
|
||||
*month = 1;
|
||||
*yday = 1;
|
||||
++*year;
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks every day in a 160000 years interval starting on 1970-01-01
|
||||
* against the expected result.
|
||||
*/
|
||||
static void rtc_time64_to_tm_test_date_range(struct kunit *test)
|
||||
{
|
||||
/*
|
||||
* 160000 years = (160000 / 400) * 400 years
|
||||
* = (160000 / 400) * 146097 days
|
||||
* = (160000 / 400) * 146097 * 86400 seconds
|
||||
*/
|
||||
time64_t total_secs = ((time64_t) 160000) / 400 * 146097 * 86400;
|
||||
|
||||
int year = 1970;
|
||||
int month = 1;
|
||||
int mday = 1;
|
||||
int yday = 1;
|
||||
|
||||
struct rtc_time result;
|
||||
time64_t secs;
|
||||
s64 days;
|
||||
|
||||
for (secs = 0; secs <= total_secs; secs += 86400) {
|
||||
|
||||
rtc_time64_to_tm(secs, &result);
|
||||
|
||||
days = div_s64(secs, 86400);
|
||||
|
||||
#define FAIL_MSG "%d/%02d/%02d (%2d) : %lld", \
|
||||
year, month, mday, yday, days
|
||||
|
||||
KUNIT_ASSERT_EQ_MSG(test, year - 1900, result.tm_year, FAIL_MSG);
|
||||
KUNIT_ASSERT_EQ_MSG(test, month - 1, result.tm_mon, FAIL_MSG);
|
||||
KUNIT_ASSERT_EQ_MSG(test, mday, result.tm_mday, FAIL_MSG);
|
||||
KUNIT_ASSERT_EQ_MSG(test, yday, result.tm_yday, FAIL_MSG);
|
||||
|
||||
advance_date(&year, &month, &mday, &yday);
|
||||
}
|
||||
}
|
||||
|
||||
static struct kunit_case rtc_lib_test_cases[] = {
|
||||
KUNIT_CASE(rtc_time64_to_tm_test_date_range),
|
||||
{}
|
||||
};
|
||||
|
||||
static struct kunit_suite rtc_lib_test_suite = {
|
||||
.name = "rtc_lib_test_cases",
|
||||
.test_cases = rtc_lib_test_cases,
|
||||
};
|
||||
|
||||
kunit_test_suite(rtc_lib_test_suite);
|
||||
@@ -692,7 +692,7 @@ static u32 qedf_get_login_failures(void *cookie)
|
||||
}
|
||||
|
||||
static struct qed_fcoe_cb_ops qedf_cb_ops = {
|
||||
{
|
||||
.common = {
|
||||
.link_update = qedf_link_update,
|
||||
.bw_update = qedf_bw_update,
|
||||
.schedule_recovery_handler = qedf_schedule_recovery_handler,
|
||||
|
||||
@@ -152,7 +152,7 @@ void inet_proto_csum_replace16(__sum16 *sum, struct sk_buff *skb,
|
||||
const __be32 *from, const __be32 *to,
|
||||
bool pseudohdr);
|
||||
void inet_proto_csum_replace_by_diff(__sum16 *sum, struct sk_buff *skb,
|
||||
__wsum diff, bool pseudohdr);
|
||||
__wsum diff, bool pseudohdr, bool ipv6);
|
||||
|
||||
static __always_inline
|
||||
void inet_proto_csum_replace2(__sum16 *sum, struct sk_buff *skb,
|
||||
|
||||
@@ -909,6 +909,7 @@ union bpf_attr {
|
||||
* for updates resulting in a null checksum the value is set to
|
||||
* **CSUM_MANGLED_0** instead. Flag **BPF_F_PSEUDO_HDR** indicates
|
||||
* the checksum is to be computed against a pseudo-header.
|
||||
* Flag **BPF_F_IPV6** should be set for IPv6 packets.
|
||||
*
|
||||
* This helper works in combination with **bpf_csum_diff**\ (),
|
||||
* which does not update the checksum in-place, but offers more
|
||||
@@ -3937,6 +3938,7 @@ enum {
|
||||
BPF_F_PSEUDO_HDR = (1ULL << 4),
|
||||
BPF_F_MARK_MANGLED_0 = (1ULL << 5),
|
||||
BPF_F_MARK_ENFORCE = (1ULL << 6),
|
||||
BPF_F_IPV6 = (1ULL << 7),
|
||||
};
|
||||
|
||||
/* BPF_FUNC_clone_redirect and BPF_FUNC_redirect flags. */
|
||||
|
||||
@@ -1796,12 +1796,29 @@ static int push_jmp_history(struct bpf_verifier_env *env,
|
||||
|
||||
/* Backtrack one insn at a time. If idx is not at the top of recorded
|
||||
* history then previous instruction came from straight line execution.
|
||||
* Return -ENOENT if we exhausted all instructions within given state.
|
||||
*
|
||||
* It's legal to have a bit of a looping with the same starting and ending
|
||||
* insn index within the same state, e.g.: 3->4->5->3, so just because current
|
||||
* instruction index is the same as state's first_idx doesn't mean we are
|
||||
* done. If there is still some jump history left, we should keep going. We
|
||||
* need to take into account that we might have a jump history between given
|
||||
* state's parent and itself, due to checkpointing. In this case, we'll have
|
||||
* history entry recording a jump from last instruction of parent state and
|
||||
* first instruction of given state.
|
||||
*/
|
||||
static int get_prev_insn_idx(struct bpf_verifier_state *st, int i,
|
||||
u32 *history)
|
||||
{
|
||||
u32 cnt = *history;
|
||||
|
||||
if (i == st->first_insn_idx) {
|
||||
if (cnt == 0)
|
||||
return -ENOENT;
|
||||
if (cnt == 1 && st->jmp_history[0].idx == i)
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
if (cnt && st->jmp_history[cnt - 1].idx == i) {
|
||||
i = st->jmp_history[cnt - 1].prev_idx;
|
||||
(*history)--;
|
||||
@@ -2269,9 +2286,9 @@ static int __mark_chain_precision(struct bpf_verifier_env *env, int frame, int r
|
||||
* Nothing to be tracked further in the parent state.
|
||||
*/
|
||||
return 0;
|
||||
if (i == first_idx)
|
||||
break;
|
||||
i = get_prev_insn_idx(st, i, &history);
|
||||
if (i == -ENOENT)
|
||||
break;
|
||||
if (i >= env->prog->len) {
|
||||
/* This can happen if backtracking reached insn 0
|
||||
* and there are still reg_mask or stack_mask
|
||||
|
||||
@@ -6558,6 +6558,10 @@ perf_sample_ustack_size(u16 stack_size, u16 header_size,
|
||||
if (!regs)
|
||||
return 0;
|
||||
|
||||
/* No mm, no stack, no dump. */
|
||||
if (!current->mm)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* Check if we fit in with the requested stack size into the:
|
||||
* - TASK_SIZE
|
||||
@@ -7152,6 +7156,9 @@ perf_callchain(struct perf_event *event, struct pt_regs *regs)
|
||||
const u32 max_stack = event->attr.sample_max_stack;
|
||||
struct perf_callchain_entry *callchain;
|
||||
|
||||
if (!current->mm)
|
||||
user = false;
|
||||
|
||||
if (!kernel && !user)
|
||||
return &__empty_callchain;
|
||||
|
||||
|
||||
@@ -848,6 +848,15 @@ void __noreturn do_exit(long code)
|
||||
tsk->exit_code = code;
|
||||
taskstats_exit(tsk, group_dead);
|
||||
|
||||
/*
|
||||
* Since sampling can touch ->mm, make sure to stop everything before we
|
||||
* tear it down.
|
||||
*
|
||||
* Also flushes inherited counters to the parent - before the parent
|
||||
* gets woken up by child-exit notifications.
|
||||
*/
|
||||
perf_event_exit_task(tsk);
|
||||
|
||||
exit_mm();
|
||||
|
||||
if (group_dead)
|
||||
@@ -864,14 +873,6 @@ void __noreturn do_exit(long code)
|
||||
exit_task_work(tsk);
|
||||
exit_thread(tsk);
|
||||
|
||||
/*
|
||||
* Flush inherited counters to the parent - before the parent
|
||||
* gets woken up by child-exit notifications.
|
||||
*
|
||||
* because of cgroup mode, must be called before cgroup_exit()
|
||||
*/
|
||||
perf_event_exit_task(tsk);
|
||||
|
||||
sched_autogroup_exit_task(tsk);
|
||||
cgroup_exit(tsk);
|
||||
|
||||
|
||||
@@ -2241,7 +2241,7 @@ void __split_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
|
||||
VM_BUG_ON(freeze && !page);
|
||||
if (page) {
|
||||
VM_WARN_ON_ONCE(!PageLocked(page));
|
||||
if (page != pmd_page(*pmd))
|
||||
if (is_pmd_migration_entry(*pmd) || page != pmd_page(*pmd))
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
@@ -1953,10 +1953,11 @@ BPF_CALL_5(bpf_l4_csum_replace, struct sk_buff *, skb, u32, offset,
|
||||
bool is_pseudo = flags & BPF_F_PSEUDO_HDR;
|
||||
bool is_mmzero = flags & BPF_F_MARK_MANGLED_0;
|
||||
bool do_mforce = flags & BPF_F_MARK_ENFORCE;
|
||||
bool is_ipv6 = flags & BPF_F_IPV6;
|
||||
__sum16 *ptr;
|
||||
|
||||
if (unlikely(flags & ~(BPF_F_MARK_MANGLED_0 | BPF_F_MARK_ENFORCE |
|
||||
BPF_F_PSEUDO_HDR | BPF_F_HDR_FIELD_MASK)))
|
||||
BPF_F_PSEUDO_HDR | BPF_F_HDR_FIELD_MASK | BPF_F_IPV6)))
|
||||
return -EINVAL;
|
||||
if (unlikely(offset > 0xffff || offset & 1))
|
||||
return -EFAULT;
|
||||
@@ -1972,7 +1973,7 @@ BPF_CALL_5(bpf_l4_csum_replace, struct sk_buff *, skb, u32, offset,
|
||||
if (unlikely(from != 0))
|
||||
return -EINVAL;
|
||||
|
||||
inet_proto_csum_replace_by_diff(ptr, skb, to, is_pseudo);
|
||||
inet_proto_csum_replace_by_diff(ptr, skb, to, is_pseudo, is_ipv6);
|
||||
break;
|
||||
case 2:
|
||||
inet_proto_csum_replace2(ptr, skb, from, to, is_pseudo);
|
||||
|
||||
@@ -473,11 +473,11 @@ void inet_proto_csum_replace16(__sum16 *sum, struct sk_buff *skb,
|
||||
EXPORT_SYMBOL(inet_proto_csum_replace16);
|
||||
|
||||
void inet_proto_csum_replace_by_diff(__sum16 *sum, struct sk_buff *skb,
|
||||
__wsum diff, bool pseudohdr)
|
||||
__wsum diff, bool pseudohdr, bool ipv6)
|
||||
{
|
||||
if (skb->ip_summed != CHECKSUM_PARTIAL) {
|
||||
*sum = csum_fold(csum_add(diff, ~csum_unfold(*sum)));
|
||||
if (skb->ip_summed == CHECKSUM_COMPLETE && pseudohdr)
|
||||
if (skb->ip_summed == CHECKSUM_COMPLETE && pseudohdr && !ipv6)
|
||||
skb->csum = ~csum_add(diff, ~skb->csum);
|
||||
} else if (pseudohdr) {
|
||||
*sum = ~csum_fold(csum_add(diff, csum_unfold(*sum)));
|
||||
|
||||
@@ -86,7 +86,7 @@ static void ila_csum_adjust_transport(struct sk_buff *skb,
|
||||
|
||||
diff = get_csum_diff(ip6h, p);
|
||||
inet_proto_csum_replace_by_diff(&th->check, skb,
|
||||
diff, true);
|
||||
diff, true, true);
|
||||
}
|
||||
break;
|
||||
case NEXTHDR_UDP:
|
||||
@@ -97,7 +97,7 @@ static void ila_csum_adjust_transport(struct sk_buff *skb,
|
||||
if (uh->check || skb->ip_summed == CHECKSUM_PARTIAL) {
|
||||
diff = get_csum_diff(ip6h, p);
|
||||
inet_proto_csum_replace_by_diff(&uh->check, skb,
|
||||
diff, true);
|
||||
diff, true, true);
|
||||
if (!uh->check)
|
||||
uh->check = CSUM_MANGLED_0;
|
||||
}
|
||||
@@ -111,7 +111,7 @@ static void ila_csum_adjust_transport(struct sk_buff *skb,
|
||||
|
||||
diff = get_csum_diff(ip6h, p);
|
||||
inet_proto_csum_replace_by_diff(&ih->icmp6_cksum, skb,
|
||||
diff, true);
|
||||
diff, true, true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -77,12 +77,6 @@
|
||||
#define SFQ_EMPTY_SLOT 0xffff
|
||||
#define SFQ_DEFAULT_HASH_DIVISOR 1024
|
||||
|
||||
/* We use 16 bits to store allot, and want to handle packets up to 64K
|
||||
* Scale allot by 8 (1<<3) so that no overflow occurs.
|
||||
*/
|
||||
#define SFQ_ALLOT_SHIFT 3
|
||||
#define SFQ_ALLOT_SIZE(X) DIV_ROUND_UP(X, 1 << SFQ_ALLOT_SHIFT)
|
||||
|
||||
/* This type should contain at least SFQ_MAX_DEPTH + 1 + SFQ_MAX_FLOWS values */
|
||||
typedef u16 sfq_index;
|
||||
|
||||
@@ -104,7 +98,7 @@ struct sfq_slot {
|
||||
sfq_index next; /* next slot in sfq RR chain */
|
||||
struct sfq_head dep; /* anchor in dep[] chains */
|
||||
unsigned short hash; /* hash value (index in ht[]) */
|
||||
short allot; /* credit for this slot */
|
||||
int allot; /* credit for this slot */
|
||||
|
||||
unsigned int backlog;
|
||||
struct red_vars vars;
|
||||
@@ -120,7 +114,6 @@ struct sfq_sched_data {
|
||||
siphash_key_t perturbation;
|
||||
u8 cur_depth; /* depth of longest slot */
|
||||
u8 flags;
|
||||
unsigned short scaled_quantum; /* SFQ_ALLOT_SIZE(quantum) */
|
||||
struct tcf_proto __rcu *filter_list;
|
||||
struct tcf_block *block;
|
||||
sfq_index *ht; /* Hash table ('divisor' slots) */
|
||||
@@ -459,7 +452,7 @@ enqueue:
|
||||
*/
|
||||
q->tail = slot;
|
||||
/* We could use a bigger initial quantum for new flows */
|
||||
slot->allot = q->scaled_quantum;
|
||||
slot->allot = q->quantum;
|
||||
}
|
||||
if (++sch->q.qlen <= q->limit)
|
||||
return NET_XMIT_SUCCESS;
|
||||
@@ -496,7 +489,7 @@ next_slot:
|
||||
slot = &q->slots[a];
|
||||
if (slot->allot <= 0) {
|
||||
q->tail = slot;
|
||||
slot->allot += q->scaled_quantum;
|
||||
slot->allot += q->quantum;
|
||||
goto next_slot;
|
||||
}
|
||||
skb = slot_dequeue_head(slot);
|
||||
@@ -515,7 +508,7 @@ next_slot:
|
||||
}
|
||||
q->tail->next = next_a;
|
||||
} else {
|
||||
slot->allot -= SFQ_ALLOT_SIZE(qdisc_pkt_len(skb));
|
||||
slot->allot -= qdisc_pkt_len(skb);
|
||||
}
|
||||
return skb;
|
||||
}
|
||||
@@ -598,7 +591,7 @@ drop:
|
||||
q->tail->next = x;
|
||||
}
|
||||
q->tail = slot;
|
||||
slot->allot = q->scaled_quantum;
|
||||
slot->allot = q->quantum;
|
||||
}
|
||||
}
|
||||
sch->q.qlen -= dropped;
|
||||
@@ -611,6 +604,7 @@ static void sfq_perturbation(struct timer_list *t)
|
||||
struct Qdisc *sch = q->sch;
|
||||
spinlock_t *root_lock = qdisc_lock(qdisc_root_sleeping(sch));
|
||||
siphash_key_t nkey;
|
||||
int period;
|
||||
|
||||
get_random_bytes(&nkey, sizeof(nkey));
|
||||
spin_lock(root_lock);
|
||||
@@ -619,11 +613,16 @@ static void sfq_perturbation(struct timer_list *t)
|
||||
sfq_rehash(sch);
|
||||
spin_unlock(root_lock);
|
||||
|
||||
if (q->perturb_period)
|
||||
mod_timer(&q->perturb_timer, jiffies + q->perturb_period);
|
||||
/* q->perturb_period can change under us from
|
||||
* sfq_change() and sfq_destroy().
|
||||
*/
|
||||
period = READ_ONCE(q->perturb_period);
|
||||
if (period)
|
||||
mod_timer(&q->perturb_timer, jiffies + period);
|
||||
}
|
||||
|
||||
static int sfq_change(struct Qdisc *sch, struct nlattr *opt)
|
||||
static int sfq_change(struct Qdisc *sch, struct nlattr *opt,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct sfq_sched_data *q = qdisc_priv(sch);
|
||||
struct tc_sfq_qopt *ctl = nla_data(opt);
|
||||
@@ -632,6 +631,15 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt)
|
||||
struct red_parms *p = NULL;
|
||||
struct sk_buff *to_free = NULL;
|
||||
struct sk_buff *tail = NULL;
|
||||
unsigned int maxflows;
|
||||
unsigned int quantum;
|
||||
unsigned int divisor;
|
||||
int perturb_period;
|
||||
u8 headdrop;
|
||||
u8 maxdepth;
|
||||
int limit;
|
||||
u8 flags;
|
||||
|
||||
|
||||
if (opt->nla_len < nla_attr_size(sizeof(*ctl)))
|
||||
return -EINVAL;
|
||||
@@ -641,14 +649,10 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt)
|
||||
(!is_power_of_2(ctl->divisor) || ctl->divisor > 65536))
|
||||
return -EINVAL;
|
||||
|
||||
/* slot->allot is a short, make sure quantum is not too big. */
|
||||
if (ctl->quantum) {
|
||||
unsigned int scaled = SFQ_ALLOT_SIZE(ctl->quantum);
|
||||
|
||||
if (scaled <= 0 || scaled > SHRT_MAX)
|
||||
return -EINVAL;
|
||||
if ((int)ctl->quantum < 0) {
|
||||
NL_SET_ERR_MSG_MOD(extack, "invalid quantum");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (ctl_v1 && !red_check_params(ctl_v1->qth_min, ctl_v1->qth_max,
|
||||
ctl_v1->Wlog, ctl_v1->Scell_log, NULL))
|
||||
return -EINVAL;
|
||||
@@ -657,37 +661,64 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt)
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
sch_tree_lock(sch);
|
||||
if (ctl->quantum) {
|
||||
q->quantum = ctl->quantum;
|
||||
q->scaled_quantum = SFQ_ALLOT_SIZE(q->quantum);
|
||||
}
|
||||
q->perturb_period = ctl->perturb_period * HZ;
|
||||
|
||||
limit = q->limit;
|
||||
divisor = q->divisor;
|
||||
headdrop = q->headdrop;
|
||||
maxdepth = q->maxdepth;
|
||||
maxflows = q->maxflows;
|
||||
perturb_period = q->perturb_period;
|
||||
quantum = q->quantum;
|
||||
flags = q->flags;
|
||||
|
||||
/* update and validate configuration */
|
||||
if (ctl->quantum)
|
||||
quantum = ctl->quantum;
|
||||
perturb_period = ctl->perturb_period * HZ;
|
||||
if (ctl->flows)
|
||||
q->maxflows = min_t(u32, ctl->flows, SFQ_MAX_FLOWS);
|
||||
maxflows = min_t(u32, ctl->flows, SFQ_MAX_FLOWS);
|
||||
if (ctl->divisor) {
|
||||
q->divisor = ctl->divisor;
|
||||
q->maxflows = min_t(u32, q->maxflows, q->divisor);
|
||||
divisor = ctl->divisor;
|
||||
maxflows = min_t(u32, maxflows, divisor);
|
||||
}
|
||||
if (ctl_v1) {
|
||||
if (ctl_v1->depth)
|
||||
q->maxdepth = min_t(u32, ctl_v1->depth, SFQ_MAX_DEPTH);
|
||||
maxdepth = min_t(u32, ctl_v1->depth, SFQ_MAX_DEPTH);
|
||||
if (p) {
|
||||
swap(q->red_parms, p);
|
||||
red_set_parms(q->red_parms,
|
||||
red_set_parms(p,
|
||||
ctl_v1->qth_min, ctl_v1->qth_max,
|
||||
ctl_v1->Wlog,
|
||||
ctl_v1->Plog, ctl_v1->Scell_log,
|
||||
NULL,
|
||||
ctl_v1->max_P);
|
||||
}
|
||||
q->flags = ctl_v1->flags;
|
||||
q->headdrop = ctl_v1->headdrop;
|
||||
flags = ctl_v1->flags;
|
||||
headdrop = ctl_v1->headdrop;
|
||||
}
|
||||
if (ctl->limit) {
|
||||
q->limit = min_t(u32, ctl->limit, q->maxdepth * q->maxflows);
|
||||
q->maxflows = min_t(u32, q->maxflows, q->limit);
|
||||
limit = min_t(u32, ctl->limit, maxdepth * maxflows);
|
||||
maxflows = min_t(u32, maxflows, limit);
|
||||
}
|
||||
if (limit == 1) {
|
||||
sch_tree_unlock(sch);
|
||||
kfree(p);
|
||||
NL_SET_ERR_MSG_MOD(extack, "invalid limit");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* commit configuration */
|
||||
q->limit = limit;
|
||||
q->divisor = divisor;
|
||||
q->headdrop = headdrop;
|
||||
q->maxdepth = maxdepth;
|
||||
q->maxflows = maxflows;
|
||||
WRITE_ONCE(q->perturb_period, perturb_period);
|
||||
q->quantum = quantum;
|
||||
q->flags = flags;
|
||||
if (p)
|
||||
swap(q->red_parms, p);
|
||||
|
||||
qlen = sch->q.qlen;
|
||||
while (sch->q.qlen > q->limit) {
|
||||
@@ -724,7 +755,7 @@ static void sfq_destroy(struct Qdisc *sch)
|
||||
struct sfq_sched_data *q = qdisc_priv(sch);
|
||||
|
||||
tcf_block_put(q->block);
|
||||
q->perturb_period = 0;
|
||||
WRITE_ONCE(q->perturb_period, 0);
|
||||
del_timer_sync(&q->perturb_timer);
|
||||
sfq_free(q->ht);
|
||||
sfq_free(q->slots);
|
||||
@@ -757,12 +788,11 @@ static int sfq_init(struct Qdisc *sch, struct nlattr *opt,
|
||||
q->divisor = SFQ_DEFAULT_HASH_DIVISOR;
|
||||
q->maxflows = SFQ_DEFAULT_FLOWS;
|
||||
q->quantum = psched_mtu(qdisc_dev(sch));
|
||||
q->scaled_quantum = SFQ_ALLOT_SIZE(q->quantum);
|
||||
q->perturb_period = 0;
|
||||
get_random_bytes(&q->perturbation, sizeof(q->perturbation));
|
||||
|
||||
if (opt) {
|
||||
int err = sfq_change(sch, opt);
|
||||
int err = sfq_change(sch, opt, extack);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
@@ -873,7 +903,7 @@ static int sfq_dump_class_stats(struct Qdisc *sch, unsigned long cl,
|
||||
if (idx != SFQ_EMPTY_SLOT) {
|
||||
const struct sfq_slot *slot = &q->slots[idx];
|
||||
|
||||
xstats.allot = slot->allot << SFQ_ALLOT_SHIFT;
|
||||
xstats.allot = slot->allot;
|
||||
qs.qlen = slot->qlen;
|
||||
qs.backlog = slot->backlog;
|
||||
}
|
||||
|
||||
@@ -909,6 +909,7 @@ union bpf_attr {
|
||||
* for updates resulting in a null checksum the value is set to
|
||||
* **CSUM_MANGLED_0** instead. Flag **BPF_F_PSEUDO_HDR** indicates
|
||||
* the checksum is to be computed against a pseudo-header.
|
||||
* Flag **BPF_F_IPV6** should be set for IPv6 packets.
|
||||
*
|
||||
* This helper works in combination with **bpf_csum_diff**\ (),
|
||||
* which does not update the checksum in-place, but offers more
|
||||
@@ -3937,6 +3938,7 @@ enum {
|
||||
BPF_F_PSEUDO_HDR = (1ULL << 4),
|
||||
BPF_F_MARK_MANGLED_0 = (1ULL << 5),
|
||||
BPF_F_MARK_ENFORCE = (1ULL << 6),
|
||||
BPF_F_IPV6 = (1ULL << 7),
|
||||
};
|
||||
|
||||
/* BPF_FUNC_clone_redirect and BPF_FUNC_redirect flags. */
|
||||
|
||||
Reference in New Issue
Block a user