Linux 6.1.85
Greg Kroah-Hartman
maintainerI'm announcing the release of the 6.1.85 kernel.
All users of the 6.1 kernel series must upgrade.
The updated 6.1.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-6.1.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Documentation/admin-guide/hw-vuln/spectre.rst | 48 +++ Documentation/admin-guide/kernel-parameters.txt | 12 Makefile | 2 arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi | 2 arch/riscv/include/asm/uaccess.h | 4 arch/riscv/kernel/process.c | 3 arch/s390/kernel/entry.S | 1 arch/x86/Kconfig | 25 + arch/x86/coco/core.c | 41 +++ arch/x86/entry/common.c | 10 arch/x86/entry/entry_64.S | 61 ++++ arch/x86/entry/entry_64_compat.S | 16 + arch/x86/entry/syscall_32.c | 21 + arch/x86/entry/syscall_64.c | 19 + arch/x86/entry/syscall_x32.c | 10 arch/x86/events/amd/core.c | 4 arch/x86/events/amd/lbr.c | 16 - arch/x86/include/asm/asm-prototypes.h | 1 arch/x86/include/asm/coco.h | 2 arch/x86/include/asm/cpufeature.h | 8 arch/x86/include/asm/cpufeatures.h | 15 + arch/x86/include/asm/disabled-features.h | 3 arch/x86/include/asm/msr-index.h | 9 arch/x86/include/asm/nospec-branch.h | 37 ++ arch/x86/include/asm/required-features.h | 3 arch/x86/include/asm/syscall.h | 11 arch/x86/kernel/cpu/bugs.c | 121 ++++++++- arch/x86/kernel/cpu/common.c | 24 + arch/x86/kernel/cpu/mce/core.c | 4 arch/x86/kernel/cpu/scattered.c | 2 arch/x86/kernel/setup.c | 2 arch/x86/kvm/reverse_cpuid.h | 5 arch/x86/kvm/svm/sev.c | 60 ++-- arch/x86/kvm/trace.h | 10 arch/x86/kvm/vmx/vmenter.S | 2 arch/x86/kvm/x86.c | 2 arch/x86/lib/retpoline.S | 6 arch/x86/mm/ident_map.c | 23 - arch/x86/mm/pat/memtype.c | 49 ++- drivers/acpi/acpica/dbnames.c | 8 drivers/ata/sata_mv.c | 63 ++-- drivers/ata/sata_sx4.c | 6 drivers/base/core.c | 26 + drivers/bluetooth/btqca.c | 8 drivers/bluetooth/hci_qca.c | 19 - drivers/dma-buf/st-dma-fence-chain.c | 6 drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 38 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 10 drivers/gpu/drm/amd/include/amd_shared.h | 1 drivers/gpu/drm/panfrost/panfrost_gpu.c | 6 drivers/md/dm-integrity.c | 2 drivers/net/ethernet/freescale/fec_main.c | 11 drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c | 2 drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 19 + drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 4 drivers/net/ethernet/intel/i40e/i40e.h | 6 drivers/net/ethernet/intel/i40e/i40e_main.c | 14 - drivers/net/ethernet/intel/i40e/i40e_ptp.c | 6 drivers/net/ethernet/intel/i40e/i40e_register.h | 3 drivers/net/ethernet/intel/i40e/i40e_txrx.c | 82 ++++-- drivers/net/ethernet/intel/i40e/i40e_txrx.h | 5 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 45 +-- drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 16 - drivers/net/ethernet/marvell/octeontx2/af/cgx.c | 5 drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c | 2 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c | 2 drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 2 drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c | 31 +- drivers/net/ethernet/microchip/lan743x_main.c | 18 + drivers/net/ethernet/microchip/lan743x_main.h | 4 drivers/net/ethernet/realtek/r8169_main.c | 131 ++++++++-- drivers/net/ethernet/renesas/ravb_main.c | 33 +- drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 40 ++- drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 38 ++ drivers/net/phy/micrel.c | 31 +- drivers/net/usb/asix_devices.c | 4 drivers/net/usb/ax88179_178a.c | 2 drivers/net/wireless/intel/iwlwifi/mvm/rfi.c | 8 drivers/net/wwan/t7xx/t7xx_cldma.c | 4 drivers/net/wwan/t7xx/t7xx_hif_cldma.c | 9 drivers/net/wwan/t7xx/t7xx_pcie_mac.c | 8 drivers/net/xen-netfront.c | 1 drivers/nvme/host/core.c | 4 drivers/nvme/host/ioctl.c | 3 drivers/nvme/host/nvme.h | 2 drivers/nvme/target/passthru.c | 3 drivers/of/dynamic.c | 12 drivers/perf/riscv_pmu.c | 4 drivers/s390/net/qeth_core_main.c | 38 ++ drivers/scsi/myrb.c | 20 - drivers/scsi/myrs.c | 24 - drivers/scsi/sd.c | 2 fs/nfsd/nfs4state.c | 7 fs/pipe.c | 17 - fs/smb/client/cached_dir.c | 6 fs/smb/client/cifs_debug.c | 6 fs/smb/client/cifsfs.c | 11 fs/smb/client/cifsglob.h | 17 + fs/smb/client/connect.c | 2 fs/smb/client/dir.c | 15 + fs/smb/client/file.c | 111 +++++++- fs/smb/client/fscache.c | 16 + fs/smb/client/fscache.h | 6 fs/smb/client/inode.c | 2 fs/smb/client/misc.c | 2 fs/smb/client/smb1ops.c | 4 fs/smb/client/smb2misc.c | 4 fs/smb/client/smb2ops.c | 11 fs/smb/client/smb2pdu.c | 2 fs/smb/server/ksmbd_netlink.h | 3 fs/smb/server/mgmt/share_config.c | 7 fs/smb/server/smb2ops.c | 10 fs/smb/server/smb2pdu.c | 3 fs/smb/server/transport_ipc.c | 37 ++ fs/vboxsf/super.c | 3 include/kvm/arm_pmu.h | 2 include/linux/device.h | 1 include/linux/secretmem.h | 4 include/linux/skbuff.h | 7 include/linux/udp.h | 28 ++ include/net/bluetooth/hci.h | 9 include/net/inet_connection_sock.h | 1 include/net/sock.h | 7 kernel/bpf/verifier.c | 5 mm/memory.c | 4 net/9p/client.c | 10 net/bluetooth/hci_debugfs.c | 48 ++- net/bluetooth/hci_event.c | 25 + net/bluetooth/hci_sync.c | 5 net/bridge/netfilter/ebtables.c | 6 net/core/gro.c | 3 net/core/sock_map.c | 6 net/ipv4/inet_connection_sock.c | 33 +- net/ipv4/inet_fragment.c | 70 ++++- net/ipv4/ip_fragment.c | 2 net/ipv4/ip_gre.c | 5 net/ipv4/netfilter/arp_tables.c | 4 net/ipv4/netfilter/ip_tables.c | 4 net/ipv4/tcp.c | 2 net/ipv4/udp.c | 7 net/ipv4/udp_offload.c | 23 - net/ipv6/ip6_fib.c | 14 - net/ipv6/ip6_gre.c | 3 net/ipv6/netfilter/ip6_tables.c | 4 net/ipv6/netfilter/nf_conntrack_reasm.c | 2 net/ipv6/udp.c | 2 net/ipv6/udp_offload.c | 8 net/mptcp/protocol.c | 3 net/mptcp/subflow.c | 2 net/netfilter/nf_tables_api.c | 13 net/nfc/nci/core.c | 5 net/rds/rdma.c | 2 net/sched/act_skbmod.c | 10 net/sched/sch_api.c | 2 net/tls/tls_sw.c | 7 net/vmw_vsock/virtio_transport.c | 3 scripts/bpf_doc.py | 4 sound/pci/hda/patch_realtek.c | 3 sound/soc/codecs/rt5682-sdw.c | 4 sound/soc/codecs/rt711-sdca-sdw.c | 4 sound/soc/codecs/rt711-sdw.c | 4 sound/soc/soc-ops.c | 2 tools/testing/selftests/net/mptcp/mptcp_connect.sh | 7 tools/testing/selftests/net/mptcp/mptcp_join.sh | 7 tools/testing/selftests/net/reuseaddr_conflict.c | 2 tools/testing/selftests/net/udpgro_fwd.sh | 10 167 files changed, 1790 insertions(+), 546 deletions(-)
Aleksandr Loktionov (2):
i40e: fix i40e_count_filters() to count only active/new filters
i40e: fix vf may be used uninitialized in this function warning
Aleksandr Mishin (2):
net: phy: micrel: Fix potential null pointer dereference
octeontx2-af: Add array index check
Alexander Mikhalitsyn (1):
KVM: SVM: enhance info printk's in SEV init
Alexandra Winter (1):
s390/qeth: handle deferred cc1
Andrei Matei (1):
bpf: Protect against int overflow for stack access size
Antoine Tenart (5):
selftests: net: gro fwd: update vxlan GRO test expectations
gro: fix ownership transfer
udp: do not accept non-tunnel GSO skbs landing in a tunnel
udp: do not transition UDP GRO fraglist partial checksums to unnecessary
udp: prevent local UDP tunnel packets from being GROed
Arnd Bergmann (4):
dm integrity: fix out-of-range warning
ata: sata_sx4: fix pdc20621_get_from_dimm() on 64-bit
scsi: mylex: Fix sysfs buffer lengths
ata: sata_mv: Fix PCI device ID table declaration compilation warning
Ashish Kalra (1):
KVM: SVM: Add support for allowing zero SEV ASIDs
Atlas Yu (1):
r8169: skip DASH fw status checks when DASH is disabled
Bastien Nocera (1):
Bluetooth: Fix TOCTOU in HCI debugfs implementation
Bjørn Mork (1):
net: wwan: t7xx: Split 64bit accesses to fix alignment issues
Borislav Petkov (AMD) (4):
x86/bugs: Fix the SRSO mitigation on Zen3/4
x86/retpoline: Do the necessary fixup to the Zen3/4 srso return thunk for !SRSO x86/retpoline: Add NOENDBR annotation to the SRSO dummy return thunk x86/mce: Make sure to grab mce_sysfs_mutex in set_bank()
Christian Hewitt (1):
drm/panfrost: fix power transition timeout warnings
Christoffer Sandberg (1):
ALSA: hda/realtek - Fix inactive headset mic jack
Christophe JAILLET (1):
vboxsf: Avoid an spurious warning if load_nls_xxx() fails
Claudiu Beznea (1):
net: ravb: Let IP-specific receive function to interrogate descriptors
Daniel Sneddon (2):
x86/bhi: Define SPEC_CTRL_BHI_DIS_S
KVM: x86: Add BHI_NO
David Hildenbrand (2):
x86/mm/pat: fix VM_PAT handling in COW mappings mm/secretmem: fix GUP-fast succeeding on secretmem folios
David Howells (2):
cifs: Fix duplicate fscache cookie warnings
cifs: Fix caching to try to do open O_WRONLY as rdwr on server
David Thompson (3):
mlxbf_gige: stop PHY during open() error paths
mlxbf_gige: call request_irq() after NAPI initialized
mlxbf_gige: stop interface during shutdown
Davide Caratti (1):
mptcp: don't account accept() of non-MPC client as fallback to TCP
Denis Kirjanov (1):
drivers: net: convert to boolean for the mac_managed_pm flag
Dominique Martinet (1):
9p: Fix read/write debug statements to report server reply
Eric Dumazet (5):
tcp: properly terminate timers for kernel sockets
netfilter: validate user input for expected length net/sched: act_skbmod: prevent kernel-infoleak net/sched: fix lockdep splat in qdisc_tree_reduce_backlog()
erspan: make sure erspan_base_hdr is present in skb->head
Florian Westphal (1):
inet: inet_defrag: prevent sk release while still in use
Geliang Tang (2):
selftests: mptcp: join: fix dev in check_endpoint
selftests: mptcp: display simult in extra_msg
Greg Kroah-Hartman (2):
x86: set SPECTRE_BHI_ON as default
Linux 6.1.85
Hangbin Liu (1):
scripts/bpf_doc: Use silent mode when exec make cmd
Hariprasad Kelam (2):
Octeontx2-af: fix pause frame configuration in GMP mode
octeontx2-af: Fix issue with loading coalesced KPU profiles
Heiner Kallweit (4):
r8169: fix issue caused by buggy BIOS on certain boards with RTL8168d
r8169: use spinlock to protect mac ocp register access
r8169: use spinlock to protect access to registers Config2 and Config5
r8169: prepare rtl_hw_aspm_clkreq_enable for usage in atomic context
Herve Codina (2):
driver core: Introduce device_link_wait_removal()
of: dynamic: Synchronize of_changeset_destroy() with the devlink removals
Horatiu Vultur (1):
net: phy: micrel: lan8814: Fix when enabling/disabling 1-step timestamping
Hui Wang (1):
Bluetooth: hci_event: set the conn encrypted before conn establishes
I Gede Agastya Darma Laksana (1):
ALSA: hda/realtek: Update Panasonic CF-SZ6 quirk to support headset with microphone
Ingo Molnar (1):
Revert "x86/mm/ident_map: Use gbpages only where full GB page should be mapped."
Ivan Vecera (3):
i40e: Fix VF MAC filter removal
i40e: Remove _t suffix from enum type names
i40e: Enforce software interrupt during busy-poll exit
Jakub Kicinski (1):
selftests: reuseaddr_conflict: add missing new line at the end of the output
Jakub Sitnicki (1):
bpf, sockmap: Prevent lock inversion deadlock in map delete elem
Jann Horn (1):
fs/pipe: Fix lockdep false-positive in watchqueue pipe_write()
Jason A. Donenfeld (1):
x86/coco: Require seeding RNG with RDRAND on CoCo systems
Jeff Layton (1):
nfsd: hold a lighter-weight client reference over CB_RECALL_ANY
Jesper Dangaard Brouer (1):
xen-netfront: Add missing skb_mark_for_recycle
Jian Shen (1):
net: hns3: mark unexcuted loopback test result as UNEXECUTED
Jie Wang (1):
net: hns3: fix index limit to support all queue stats
Joe Damato (1):
i40e: Store the irq number in i40e_q_vector
Johan Hovold (4):
Revert "Bluetooth: hci_qca: Set BDA quirk bit if fwnode exists in DT"
arm64: dts: qcom: sc7180-trogdor: mark bluetooth address as broken
Bluetooth: qca: fix device-address endianness
Bluetooth: add quirk for broken address properties
Johannes Berg (1):
wifi: iwlwifi: mvm: rfi: fix potential response leaks
Jose Ignacio Tornos Martinez (1):
net: usb: ax88179_178a: avoid the interface always configured as random address
Josh Poimboeuf (1):
x86/bugs: Change commas to semicolons in 'spectre_v2' sysfs file
Kuniyuki Iwashima (2):
ipv6: Fix infinite recursion in fib6_dump_done().
tcp: Fix bind() regression for v6-only wildcard and v4(-mapped-v6) non-wildcard addresses.
Li Nan (1):
scsi: sd: Unregister device if device_add_disk() failed in sd_probe()
Linus Torvalds (1):
x86/syscall: Don't force use of indirect calls for system calls
Mahmoud Adam (1):
net/rds: fix possible cp null dereference
Marco Pinna (1):
vsock/virtio: fix packet delivery to tap device
Mario Limonciello (3):
drm/amd: Evict resources during PM ops prepare() callback drm/amd: Add concept of running prepare_suspend() sequence for IP blocks drm/amd: Flush GFXOFF requests in prepare stage
Namjae Jeon (3):
ksmbd: don't send oplock break if rename fails
ksmbd: validate payload size in ipc response
ksmbd: do not set SMB2_GLOBAL_CAP_ENCRYPTION for SMB 3.1.1
Nikita Kiryushin (1):
ACPICA: debugger: check status of acpi_evaluate_object() in acpi_db_walk_for_fields()
Oliver Upton (1):
KVM: arm64: Fix host-programmed guest events in nVHE
Pablo Neira Ayuso (2):
netfilter: nf_tables: reject new basechain after table flag update
netfilter: nf_tables: flush pending destroy work before exit_net release
Paul Barker (2):
net: ravb: Always process TX descriptor ring
net: ravb: Always update error counters
Paulo Alcantara (8):
smb: client: fix potential UAF in cifs_debug_files_proc_show()
smb: client: fix potential UAF in cifs_stats_proc_write()
smb: client: fix potential UAF in cifs_stats_proc_show()
smb: client: fix potential UAF in smb2_is_valid_oplock_break()
smb: client: fix potential UAF in smb2_is_valid_lease_break()
smb: client: fix potential UAF in is_valid_oplock_break()
smb: client: fix potential UAF in smb2_is_network_name_deleted()
smb: client: fix potential UAF in cifs_signal_cifsd_for_reconnect()
Pavel Sakharov (1):
dma-buf: Fix NULL pointer dereference in sanitycheck()
Pawan Gupta (4):
x86/bhi: Add support for clearing branch history at syscall entry x86/bhi: Enumerate Branch History Injection (BHI) bug x86/bhi: Add BHI mitigation knob
x86/bhi: Mitigate KVM by default
Pierre-Louis Bossart (3):
ASoC: rt5682-sdw: fix locking sequence
ASoC: rt711-sdca: fix locking sequence
ASoC: rt711-sdw: fix locking sequence
Piotr Wejman (1):
net: stmmac: fix rx queue priority assignment
Przemek Kitszel (1):
ixgbe: avoid sleeping allocation in ixgbe_ipsec_vf_add_sa()
Pu Lehui (1):
drivers/perf: riscv: Disable PERF_SAMPLE_BRANCH_* while not supported
Raju Lakkaraju (1):
net: lan743x: Add set RFE read fifo threshold for PCI1x1x chips
Ritvik Budhiraja (1):
smb3: retrying on failed server close
Ryosuke Yasuoka (1):
nfc: nci: Fix uninit-value in nci_dev_up and nci_ntf_packet
Sabrina Dubroca (3):
tls: recv: process_rx_list shouldn't use an offset with kvec
tls: adjust recv return with async crypto and failed copy to userspace
tls: get psock ref after taking rxlock to avoid leak
Samuel Holland (1):
riscv: Fix spurious errors from __get/put_kernel_nofault
Sandipan Das (2):
x86/cpufeatures: Add new word for scattered features perf/x86/amd/lbr: Use freeze based on availability
Sean Christopherson (3):
x86/cpufeatures: Add CPUID_LNX_5 to track recently added Linux-defined word
KVM: SVM: WARN, but continue, if misc_cg_set_capacity() fails
KVM: SVM: Use unsigned integers when dealing with ASIDs
Stefan O'Rear (1):
riscv: process: Fix kernel gp leakage
Stephen Lee (1):
ASoC: ops: Fix wraparound for mask in snd_soc_get_volsw
Su Hui (1):
octeontx2-pf: check negative error code in otx2_open()
Sumanth Korikkar (1):
s390/entry: align system call table on 8 bytes
Wei Fang (1):
net: fec: Set mac_managed_pm during probe
Yonglong Liu (1):
net: hns3: fix kernel crash when devlink reload during pf initialization
Ziyang Xuan (1):
netfilter: nf_tables: Fix potential data-race in __nft_flowtable_type_get()
min15.li (1):
nvme: fix miss command type check
Greg Kroah-Hartman
maintainerDocumentation/admin-guide/hw-vuln/spectre.rst +42 -6
@@ -138,11 +138,10 @@ associated with the source address of the indirect branch. Specifically, the BHB might be shared across privilege levels even in the presence of Enhanced IBRS. -Currently the only known real-world BHB attack vector is via -unprivileged eBPF. Therefore, it's highly recommended to not enable -unprivileged eBPF, especially when eIBRS is used (without retpolines). -For a full mitigation against BHB attacks, it's recommended to use -retpolines (or eIBRS combined with retpolines). +Previously the only known real-world BHB attack vector was via unprivileged +eBPF. Further research has found attacks that don't require unprivileged eBPF. +For a full mitigation against BHB attacks it is recommended to set BHI_DIS_S or +use the BHB clearing sequence. Attack scenarios ----------------
@@ -430,6 +429,23 @@ The possible values in this file are: 'PBRSB-eIBRS: Not affected' CPU is not affected by PBRSB =========================== ======================================================= + - Branch History Injection (BHI) protection status: + +.. list-table:: + + * - BHI: Not affected + - System is not affected + * - BHI: Retpoline + - System is protected by retpoline + * - BHI: BHI_DIS_S + - System is protected by BHI_DIS_S + * - BHI: SW loop; KVM SW loop + - System is protected by software clearing sequence + * - BHI: Syscall hardening + - Syscalls are hardened against BHI + * - BHI: Syscall hardening; KVM: SW loop + - System is protected from userspace attacks by syscall hardening; KVM is protected by software clearing sequence + Full mitigation might require a microcode update from the CPU vendor. When the necessary microcode is not available, the kernel will report vulnerability.
@@ -484,7 +500,11 @@ Spectre variant 2 Systems which support enhanced IBRS (eIBRS) enable IBRS protection once at boot, by setting the IBRS bit, and they're automatically protected against - Spectre v2 variant attacks. + some Spectre v2 variant attacks. The BHB can still influence the choice of + indirect branch predictor entry, and although branch predictor entries are + isolated between modes when eIBRS is enabled, the BHB itself is not isolated + between modes. Systems which support BHI_DIS_S will set it to protect against + BHI attacks. On Intel's enhanced IBRS systems, this includes cross-thread branch target injections on SMT systems (STIBP). In other words, Intel eIBRS enables
@@ -638,6 +658,22 @@ kernel command line. spectre_v2=off. Spectre variant 1 mitigations cannot be disabled. + spectre_bhi= + + [X86] Control mitigation of Branch History Injection + (BHI) vulnerability. Syscalls are hardened against BHI + regardless of this setting. This setting affects the deployment + of the HW BHI control and the SW BHB clearing sequence. + + on + unconditionally enable. + off + unconditionally disable. + auto + enable if hardware mitigation + control(BHI_DIS_S) is available, otherwise + enable alternate mitigation in KVM. + For spectre_v2_user see Documentation/admin-guide/kernel-parameters.txt Mitigation selection guide
Documentation/admin-guide/kernel-parameters.txt +12 -0
@@ -5733,6 +5733,18 @@ sonypi.*= [HW] Sony Programmable I/O Control Device driver See Documentation/admin-guide/laptops/sonypi.rst + spectre_bhi= [X86] Control mitigation of Branch History Injection + (BHI) vulnerability. Syscalls are hardened against BHI + reglardless of this setting. This setting affects the + deployment of the HW BHI control and the SW BHB + clearing sequence. + + on - unconditionally enable. + off - unconditionally disable. + auto - (default) enable hardware mitigation + (BHI_DIS_S) if available, otherwise enable + alternate mitigation in KVM. + spectre_v2= [X86] Control mitigation of Spectre variant 2 (indirect branch speculation) vulnerability. The default operation protects the kernel from
Makefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 6 PATCHLEVEL = 1 -SUBLEVEL = 84 +SUBLEVEL = 85 EXTRAVERSION = NAME = Curry Ramen
arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi +2 -0
@@ -923,6 +923,8 @@ bluetooth: bluetooth { vddrf-supply = <&pp1300_l2c>; vddch0-supply = <&pp3300_l10c>; max-speed = <3200000>; + + qcom,local-bd-address-broken; }; };
arch/riscv/include/asm/uaccess.h +2 -2
@@ -319,7 +319,7 @@ unsigned long __must_check clear_user(void __user *to, unsigned long n)#define __get_kernel_nofault (dst, src, type, err_label) \ do { \ - long __kr_err; \ + long __kr_err = 0; \ \ __get_user_nocheck(*((type *)(dst)), (type *)(src), __kr_err); \ if (unlikely(__kr_err)) \
@@ -328,7 +328,7 @@ do { \#define __put_kernel_nofault (dst, src, type, err_label) \ do { \ - long __kr_err; \ + long __kr_err = 0; \ \ __put_user_nocheck(*((type *)(src)), (type *)(dst), __kr_err); \ if (unlikely(__kr_err)) \
arch/riscv/kernel/process.c +0 -3
@@ -25,8 +25,6 @@#include <asm/thread_info.h> #include <asm/cpuidle.h> -registerunsigned long gp_in_global __asm__("gp" ); -#if defined(CONFIG_STACKPROTECTOR ) && !defined(CONFIG_STACKPROTECTOR_PER_TASK )#include <linux/stackprotector.h> unsigned long __stack_chk_guard__read_mostly ;
@@ -170,7 +168,6 @@ int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)if (unlikely (args->fn)) {/* Kernel thread */ memset (childregs,0 ,sizeof (struct pt_regs )); - childregs->gp = gp_in_global;/* Supervisor/Machine, irqs on: */ childregs->status =SR_PP |SR_PIE ;
arch/s390/kernel/entry.S +1 -0
@@ -699,6 +699,7 @@ ENDPROC(stack_overflow) .Lthis_cpu: .short 0 .Lstosm_tmp: .byte 0 .section .rodata, "a" + .balign 8 #define SYSCALL(esame,emu) .quad __s390x_ ## esame .globl sys_call_table sys_call_table:
arch/x86/Kconfig +25 -0
@@ -2563,6 +2563,31 @@ config MITIGATION_RFDS stored in floating point, vector and integer registers. See also <file:Documentation/admin-guide/hw-vuln/reg-file-data-sampling.rst> +choice + prompt "Clear branch history" + depends on CPU_SUP_INTEL + default SPECTRE_BHI_ON + help + Enable BHI mitigations. BHI attacks are a form of Spectre V2 attacks + where the branch history buffer is poisoned to speculatively steer + indirect branches. + See <file:Documentation/admin-guide/hw-vuln/spectre.rst> + +config SPECTRE_BHI_ON + bool "on" + help + Equivalent to setting spectre_bhi=on command line parameter. +config SPECTRE_BHI_OFF + bool "off" + help + Equivalent to setting spectre_bhi=off command line parameter. +config SPECTRE_BHI_AUTO + bool "auto" + help + Equivalent to setting spectre_bhi=auto command line parameter. + +endchoice + endif config ARCH_HAS_ADD_PAGES
arch/x86/coco/core.c +41 -0
57 lines not on this page · raw message
arch/x86/entry/common.c +5 -5
@@ -48,7 +48,7 @@ static __always_inline bool do_syscall_x64(struct pt_regs *regs, int nr)if (likely (unr < NR_syscalls)) { unr =array_index_nospec (unr, NR_syscalls); - regs->ax = sys_call_table[unr](regs); + regs->ax =x64_sys_call (regs, unr);return true; }return false;
@@ -65,7 +65,7 @@ static __always_inline bool do_syscall_x32(struct pt_regs *regs, int nr)if (IS_ENABLED (CONFIG_X86_X32_ABI ) &&likely (xnr < X32_NR_syscalls)) { xnr =array_index_nospec (xnr, X32_NR_syscalls); - regs->ax = x32_sys_call_table[xnr](regs); + regs->ax =x32_sys_call (regs, xnr);return true; }return false;
@@ -114,7 +114,7 @@ static __always_inline void do_syscall_32_irqs_on(struct pt_regs *regs, int nr)if (likely (unr < IA32_NR_syscalls)) { unr =array_index_nospec (unr, IA32_NR_syscalls); - regs->ax = ia32_sys_call_table[unr](regs); + regs->ax =ia32_sys_call (regs, unr); }else if (nr !=-1 ) { regs->ax =__ia32_sys_ni_syscall (regs); }
@@ -141,7 +141,7 @@ static __always_inline bool int80_is_external(void) }/** -* int80_emulation - 32-bit legacy syscall entry +* do_int80_emulation - 32-bit legacy syscall C entry from asm * * This entry point can be used by 32-bit and 64-bit programs to perform * 32-bit system calls. Instances of INT $0x80 can be found inline in
@@ -159,7 +159,7 @@ static __always_inline bool int80_is_external(void)* eax: system call number * ebx, ecx, edx, esi, edi, ebp: arg1 - arg 6 */ -DEFINE_IDTENTRY_RAW (int80_emulation) +__visible noinstr void do_int80_emulation(struct pt_regs *regs) {int nr;
arch/x86/entry/entry_64.S +61 -0
70 lines not on this page · raw message
arch/x86/entry/entry_64_compat.S +16 -0
@@ -92,6 +92,7 @@ SYM_INNER_LABEL(entry_SYSENTER_compat_after_hwframe, SYM_L_GLOBAL) IBRS_ENTER UNTRAIN_RET + CLEAR_BRANCH_HISTORY /* * SYSENTER doesn't filter flags, so we need to clear NT and AC
@@ -210,6 +211,7 @@ SYM_INNER_LABEL(entry_SYSCALL_compat_after_hwframe, SYM_L_GLOBAL) IBRS_ENTER UNTRAIN_RET + CLEAR_BRANCH_HISTORY movq %rsp, %rdi call do_fast_syscall_32
@@ -278,3 +280,17 @@ SYM_INNER_LABEL(entry_SYSRETL_compat_end, SYM_L_GLOBAL) ANNOTATE_NOENDBR int3 SYM_CODE_END(entry_SYSCALL_compat) + +/* + * int 0x80 is used by 32 bit mode as a system call entry. Normally idt entries + * point to C routines, however since this is a system call interface the branch + * history needs to be scrubbed to protect against BHI attacks, and that + * scrubbing needs to take place in assembly code prior to entering any C + * routines. + */ +SYM_CODE_START(int80_emulation) + ANNOTATE_NOENDBR + UNWIND_HINT_FUNC + CLEAR_BRANCH_HISTORY + jmp do_int80_emulation +SYM_CODE_END(int80_emulation)
arch/x86/entry/syscall_32.c +19 -2
@@ -18,8 +18,25 @@#include <asm/syscalls_32.h> #undef __SYSCALL +/* +* The sys_call_table[] is no longer used for system calls, but +* kernel/trace/trace_syscalls.c still wants to know the system +* call address. +*/ +#ifdef CONFIG_X86_32 #define __SYSCALL (nr, sym) __ia32_##sym, - -__visible const sys_call_ptr_t ia32_sys_call_table[] = { +const sys_call_ptr_t sys_call_table[] = { #include <asm/syscalls_32.h> }; +#undef __SYSCALL +#endif + +#define __SYSCALL (nr, sym) case nr: return __ia32_##sym(regs); + +long ia32_sys_call (const struct pt_regs *regs,unsigned int nr) +{ +switch (nr) { +#include <asm/syscalls_32.h> +default :return __ia32_sys_ni_syscall (regs); + } +};
arch/x86/entry/syscall_64.c +17 -2
@@ -11,8 +11,23 @@#include <asm/syscalls_64.h> #undef __SYSCALL +/* +* The sys_call_table[] is no longer used for system calls, but +* kernel/trace/trace_syscalls.c still wants to know the system +* call address. +*/ #define __SYSCALL (nr, sym) __x64_##sym, - -asmlinkage const sys_call_ptr_t sys_call_table[] = { +const sys_call_ptr_t sys_call_table[] = {#include <asm/syscalls_64.h> }; +#undef __SYSCALL + +#define __SYSCALL (nr, sym) case nr: return __x64_##sym(regs); + +long x64_sys_call (const struct pt_regs *regs,unsigned int nr) +{ +switch (nr) { +#include <asm/syscalls_64.h> +default :return __x64_sys_ni_syscall (regs); + } +};
arch/x86/entry/syscall_x32.c +7 -3
@@ -11,8 +11,12 @@#include <asm/syscalls_x32.h> #undef __SYSCALL -#define __SYSCALL (nr, sym) __x64_##sym, +#define __SYSCALL (nr, sym) case nr: return __x64_##sym(regs); -asmlinkage const sys_call_ptr_t x32_sys_call_table[] = { -#include <asm/syscalls_x32.h> +long x32_sys_call (const struct pt_regs *regs,unsigned int nr) +{ +switch (nr) { +#include <asm/syscalls_x32.h> +default :return __x64_sys_ni_syscall (regs); + } };
arch/x86/events/amd/core.c +2 -2
@@ -904,8 +904,8 @@ static int amd_pmu_v2_handle_irq(struct pt_regs *regs)if (!status) goto done; -/* Read branch records before unfreezing */ -if (status &GLOBAL_STATUS_LBRS_FROZEN ) { +/* Read branch records */ +if (x86_pmu.lbr_nr) {amd_pmu_lbr_read (); status &= ~GLOBAL_STATUS_LBRS_FROZEN ; }
arch/x86/events/amd/lbr.c +10 -6
@@ -400,10 +400,12 @@ void amd_pmu_lbr_enable_all(void)wrmsrl (MSR_AMD64_LBR_SELECT , lbr_select); } -rdmsrl (MSR_IA32_DEBUGCTLMSR , dbg_ctl); -rdmsrl (MSR_AMD_DBG_EXTN_CFG , dbg_extn_cfg); +if (cpu_feature_enabled (X86_FEATURE_AMD_LBR_PMC_FREEZE )) { +rdmsrl (MSR_IA32_DEBUGCTLMSR , dbg_ctl); +wrmsrl (MSR_IA32_DEBUGCTLMSR , dbg_ctl |DEBUGCTLMSR_FREEZE_LBRS_ON_PMI ); + } -wrmsrl (MSR_IA32_DEBUGCTLMSR , dbg_ctl |DEBUGCTLMSR_FREEZE_LBRS_ON_PMI ); +rdmsrl (MSR_AMD_DBG_EXTN_CFG , dbg_extn_cfg);wrmsrl (MSR_AMD_DBG_EXTN_CFG , dbg_extn_cfg |DBG_EXTN_CFG_LBRV2EN ); }
@@ -416,10 +418,12 @@ void amd_pmu_lbr_disable_all(void)return ;rdmsrl (MSR_AMD_DBG_EXTN_CFG , dbg_extn_cfg); -rdmsrl (MSR_IA32_DEBUGCTLMSR , dbg_ctl); -wrmsrl (MSR_AMD_DBG_EXTN_CFG , dbg_extn_cfg & ~DBG_EXTN_CFG_LBRV2EN ); -wrmsrl (MSR_IA32_DEBUGCTLMSR , dbg_ctl & ~DEBUGCTLMSR_FREEZE_LBRS_ON_PMI ); + +if (cpu_feature_enabled (X86_FEATURE_AMD_LBR_PMC_FREEZE )) { +rdmsrl (MSR_IA32_DEBUGCTLMSR , dbg_ctl); +wrmsrl (MSR_IA32_DEBUGCTLMSR , dbg_ctl & ~DEBUGCTLMSR_FREEZE_LBRS_ON_PMI ); + } }__init int amd_pmu_lbr_init (void )
arch/x86/include/asm/asm-prototypes.h +1 -0
@@ -12,6 +12,7 @@#include <asm/special_insns.h> #include <asm/preempt.h> #include <asm/asm.h> +#include <asm/nospec-branch.h> #ifndef CONFIG_X86_CMPXCHG64 extern void cmpxchg8b_emu (void );
arch/x86/include/asm/coco.h +2 -0
@@ -23,6 +23,7 @@ static inline void cc_set_mask(u64 mask)u64 cc_mkenc (u64 val);u64 cc_mkdec (u64 val); +void cc_random_init (void );#else static inline u64 cc_mkenc (u64 val) {
@@ -33,6 +34,7 @@ static inline u64 cc_mkdec(u64 val) {return val; } +static inline void cc_random_init (void ) { }#endif #endif /* _ASM_X86_COCO_H */
arch/x86/include/asm/cpufeature.h +6 -2
@@ -33,6 +33,8 @@ enum cpuid_leafsCPUID_7_EDX ,CPUID_8000_001F_EAX ,CPUID_8000_0021_EAX , +CPUID_LNX_5 , + NR_CPUID_WORDS, };#define X86_CAP_FMT_NUM "%d:%d"
@@ -96,8 +98,9 @@ extern const char * const x86_bug_flags[NBUGINTS*32]; CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 18, feature_bit) || \ CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 19, feature_bit) || \ CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 20, feature_bit) || \ + CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 21, feature_bit) || \ REQUIRED_MASK_CHECK || \ - BUILD_BUG_ON_ZERO(NCAPINTS != 21)) + BUILD_BUG_ON_ZERO(NCAPINTS != 22))#define DISABLED_MASK_BIT_SET (feature_bit) \ ( CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 0, feature_bit) || \
@@ -121,8 +124,9 @@ extern const char * const x86_bug_flags[NBUGINTS*32]; CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 18, feature_bit) || \ CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 19, feature_bit) || \ CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 20, feature_bit) || \ + CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 21, feature_bit) || \ DISABLED_MASK_CHECK || \ - BUILD_BUG_ON_ZERO(NCAPINTS != 21)) + BUILD_BUG_ON_ZERO(NCAPINTS != 22))#define cpu_has (c, bit) \ (__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 : \
arch/x86/include/asm/cpufeatures.h +14 -1
@@ -13,7 +13,7 @@/* * Defines x86 CPU feature bits */ -#define NCAPINTS 21/* N 32-bit words worth of info */ +#define NCAPINTS 22/* N 32-bit words worth of info */ #define NBUGINTS 2/* N 32-bit bug flags */ /*
@@ -432,6 +432,18 @@#define X86_FEATURE_IBPB_BRTYPE (20*32+28)/* "" MSR_PRED_CMD[IBPB] flushes all branch type predictions */ #define X86_FEATURE_SRSO_NO (20*32+29)/* "" CPU is not affected by SRSO */ +/* +* Extended auxiliary flags: Linux defined - for features scattered in various +* CPUID levels like 0x80000022, etc and Linux defined features. +* +* Reuse free bits when adding new feature flags! +*/ +#define X86_FEATURE_AMD_LBR_PMC_FREEZE (21*32+ 0)/* AMD LBR and PMC Freeze */ +#define X86_FEATURE_CLEAR_BHB_LOOP (21*32+ 1)/* "" Clear branch history at syscall entry using SW loop */ +#define X86_FEATURE_BHI_CTRL (21*32+ 2)/* "" BHI_DIS_S HW control available */ +#define X86_FEATURE_CLEAR_BHB_HW (21*32+ 3)/* "" BHI_DIS_S HW control enabled */ +#define X86_FEATURE_CLEAR_BHB_LOOP_ON_VMEXIT (21*32+ 4)/* "" Clear branch history at vmexit using SW loop */ +/* * BUG word(s) */
@@ -479,4 +491,5 @@#define X86_BUG_SRSO X86_BUG(1*32 + 0)/* AMD SRSO bug */ #define X86_BUG_DIV0 X86_BUG(1*32 + 1)/* AMD DIV0 speculation bug */ #define X86_BUG_RFDS X86_BUG(1*32 + 2)/* CPU is vulnerable to Register File Data Sampling */ +#define X86_BUG_BHI X86_BUG(1*32 + 3)/* CPU is affected by Branch History Injection */ #endif /* _ASM_X86_CPUFEATURES_H */
arch/x86/include/asm/disabled-features.h +2 -1
@@ -112,6 +112,7 @@#define DISABLED_MASK18 0#define DISABLED_MASK19 0#define DISABLED_MASK20 0 -#define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 21) +#define DISABLED_MASK21 0 +#define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 22)#endif /* _ASM_X86_DISABLED_FEATURES_H */
arch/x86/include/asm/msr-index.h +8 -1
@@ -55,10 +55,13 @@#define SPEC_CTRL_SSBD BIT(SPEC_CTRL_SSBD_SHIFT)/* Speculative Store Bypass Disable */ #define SPEC_CTRL_RRSBA_DIS_S_SHIFT 6/* Disable RRSBA behavior */ #define SPEC_CTRL_RRSBA_DIS_S BIT(SPEC_CTRL_RRSBA_DIS_S_SHIFT) +#define SPEC_CTRL_BHI_DIS_S_SHIFT 10/* Disable Branch History Injection behavior */ +#define SPEC_CTRL_BHI_DIS_S BIT(SPEC_CTRL_BHI_DIS_S_SHIFT)/* A mask for bits which the kernel toggles when controlling mitigations */ #define SPEC_CTRL_MITIGATIONS_MASK (SPEC_CTRL_IBRS | SPEC_CTRL_STIBP | SPEC_CTRL_SSBD \ - | SPEC_CTRL_RRSBA_DIS_S) + | SPEC_CTRL_RRSBA_DIS_S \ + | SPEC_CTRL_BHI_DIS_S)#define MSR_IA32_PRED_CMD 0x00000049/* Prediction Command */ #define PRED_CMD_IBPB BIT(0)/* Indirect Branch Prediction Barrier */
@@ -157,6 +160,10 @@* are restricted to targets in * kernel. */ +#define ARCH_CAP_BHI_NO BIT(20)/* +* CPU is not affected by Branch +* History Injection. +*/ #define ARCH_CAP_PBRSB_NO BIT(24)/* * Not susceptible to Post-Barrier * Return Stack Buffer Predictions.
arch/x86/include/asm/nospec-branch.h +31 -6
@@ -167,11 +167,20 @@ .Lskip_rsb_\@: .endm +/* + * The CALL to srso_alias_untrain_ret() must be patched in directly at + * the spot where untraining must be done, ie., srso_alias_untrain_ret() + * must be the target of a CALL instruction instead of indirectly + * jumping to a wrapper which then calls it. Therefore, this macro is + * called outside of __UNTRAIN_RET below, for the time being, before the + * kernel can support nested alternatives with arbitrary nesting. + */ +.macro CALL_UNTRAIN_RET#ifdef CONFIG_CPU_UNRET_ENTRY -#define CALL_UNTRAIN_RET "call entry_untrain_ret" -#else -#define CALL_UNTRAIN_RET "" +ALTERNATIVE_2 "" ,"call entry_untrain_ret" ,X86_FEATURE_UNRET , \ +"call srso_alias_untrain_ret" ,X86_FEATURE_SRSO_ALIAS #endif +.endm/* * Mitigate RETBleed for AMD/Hygon Zen uarch. Requires KERNEL CR3 because the
@@ -188,9 +197,8 @@#if defined(CONFIG_CPU_UNRET_ENTRY ) || defined(CONFIG_CPU_IBPB_ENTRY ) || \ defined(CONFIG_CPU_SRSO )ANNOTATE_UNRET_END - ALTERNATIVE_2 "", \ -CALL_UNTRAIN_RET ,X86_FEATURE_UNRET , \ -"call entry_ibpb" ,X86_FEATURE_ENTRY_IBPB + CALL_UNTRAIN_RET +ALTERNATIVE "" ,"call entry_ibpb" ,X86_FEATURE_ENTRY_IBPB #endif .endm
@@ -207,6 +215,19 @@ .Lskip_verw_\@: .endm +#ifdef CONFIG_X86_64 +.macro CLEAR_BRANCH_HISTORY + ALTERNATIVE "", "call clear_bhb_loop", X86_FEATURE_CLEAR_BHB_LOOP +.endm + +.macro CLEAR_BRANCH_HISTORY_VMEXIT + ALTERNATIVE "", "call clear_bhb_loop", X86_FEATURE_CLEAR_BHB_LOOP_ON_VMEXIT +.endm +#else +#define CLEAR_BRANCH_HISTORY +#define CLEAR_BRANCH_HISTORY_VMEXIT +#endif +#else /* __ASSEMBLY__ */ #define ANNOTATE_RETPOLINE_SAFE \
@@ -235,6 +256,10 @@ extern void srso_alias_untrain_ret(void);extern void entry_untrain_ret (void );extern void entry_ibpb (void ); +#ifdef CONFIG_X86_64 +extern void clear_bhb_loop (void ); +#endif +extern void (*x86_return_thunk)(void );#ifdef CONFIG_RETPOLINE
arch/x86/include/asm/required-features.h +2 -1
@@ -99,6 +99,7 @@#define REQUIRED_MASK18 0#define REQUIRED_MASK19 0#define REQUIRED_MASK20 0 -#define REQUIRED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 21) +#define REQUIRED_MASK21 0 +#define REQUIRED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 22)#endif /* _ASM_X86_REQUIRED_FEATURES_H */
arch/x86/include/asm/syscall.h +5 -6
@@ -16,19 +16,17 @@#include <asm/thread_info.h> /* for TS_COMPAT */ #include <asm/unistd.h> +/* This is used purely for kernel/trace/trace_syscalls.c */ typedef long (*sys_call_ptr_t )(const struct pt_regs *);extern const sys_call_ptr_t sys_call_table[]; -#if defined(CONFIG_X86_32 ) -#define ia32_sys_call_table sys_call_table -#else /* * These may not exist, but still put the prototypes in so we * can use IS_ENABLED(). */ -extern const sys_call_ptr_t ia32_sys_call_table[]; -extern const sys_call_ptr_t x32_sys_call_table[]; -#endif +extern long ia32_sys_call (const struct pt_regs *,unsigned int nr); +extern long x32_sys_call (const struct pt_regs *,unsigned int nr); +extern long x64_sys_call (const struct pt_regs *,unsigned int nr);/* * Only the low 32 bits of orig_ax are meaningful, so we return int.
@@ -129,6 +127,7 @@ static inline int syscall_get_arch(struct task_struct *task)void do_syscall_64 (struct pt_regs *regs,int nr);void do_int80_syscall_32 (struct pt_regs *regs);long do_fast_syscall_32 (struct pt_regs *regs); +void do_int80_emulation (struct pt_regs *regs);#endif /* CONFIG_X86_32 */
arch/x86/kernel/cpu/bugs.c +108 -13
172 lines not on this page · raw message
arch/x86/kernel/cpu/common.c +16 -8
@@ -1144,6 +1144,7 @@ static void identify_cpu_without_cpuid(struct cpuinfo_x86 *c)#define NO_SPECTRE_V2 BIT(8)#define NO_MMIO BIT(9)#define NO_EIBRS_PBRSB BIT(10) +#define NO_BHI BIT(11)#define VULNWL (vendor, family, model, whitelist) \ X86_MATCH_VENDOR_FAM_MODEL(vendor, family, model, whitelist)
@@ -1206,18 +1207,18 @@ static const __initconst struct x86_cpu_id cpu_vuln_whitelist[] = {VULNWL_INTEL (ATOM_TREMONT_D ,NO_ITLB_MULTIHIT |NO_EIBRS_PBRSB ),/* AMD Family 0xf - 0x12 */ -VULNWL_AMD (0x0f ,NO_MELTDOWN |NO_SSB |NO_L1TF |NO_MDS |NO_SWAPGS |NO_ITLB_MULTIHIT |NO_MMIO ), -VULNWL_AMD (0x10 ,NO_MELTDOWN |NO_SSB |NO_L1TF |NO_MDS |NO_SWAPGS |NO_ITLB_MULTIHIT |NO_MMIO ), -VULNWL_AMD (0x11 ,NO_MELTDOWN |NO_SSB |NO_L1TF |NO_MDS |NO_SWAPGS |NO_ITLB_MULTIHIT |NO_MMIO ), -VULNWL_AMD (0x12 ,NO_MELTDOWN |NO_SSB |NO_L1TF |NO_MDS |NO_SWAPGS |NO_ITLB_MULTIHIT |NO_MMIO ), +VULNWL_AMD (0x0f ,NO_MELTDOWN |NO_SSB |NO_L1TF |NO_MDS |NO_SWAPGS |NO_ITLB_MULTIHIT |NO_MMIO |NO_BHI ), +VULNWL_AMD (0x10 ,NO_MELTDOWN |NO_SSB |NO_L1TF |NO_MDS |NO_SWAPGS |NO_ITLB_MULTIHIT |NO_MMIO |NO_BHI ), +VULNWL_AMD (0x11 ,NO_MELTDOWN |NO_SSB |NO_L1TF |NO_MDS |NO_SWAPGS |NO_ITLB_MULTIHIT |NO_MMIO |NO_BHI ), +VULNWL_AMD (0x12 ,NO_MELTDOWN |NO_SSB |NO_L1TF |NO_MDS |NO_SWAPGS |NO_ITLB_MULTIHIT |NO_MMIO |NO_BHI ),/* FAMILY_ANY must be last, otherwise 0x0f - 0x12 matches won't work */ -VULNWL_AMD (X86_FAMILY_ANY ,NO_MELTDOWN |NO_L1TF |NO_MDS |NO_SWAPGS |NO_ITLB_MULTIHIT |NO_MMIO |NO_EIBRS_PBRSB ), -VULNWL_HYGON (X86_FAMILY_ANY ,NO_MELTDOWN |NO_L1TF |NO_MDS |NO_SWAPGS |NO_ITLB_MULTIHIT |NO_MMIO |NO_EIBRS_PBRSB ), +VULNWL_AMD (X86_FAMILY_ANY ,NO_MELTDOWN |NO_L1TF |NO_MDS |NO_SWAPGS |NO_ITLB_MULTIHIT |NO_MMIO |NO_EIBRS_PBRSB |NO_BHI ), +VULNWL_HYGON (X86_FAMILY_ANY ,NO_MELTDOWN |NO_L1TF |NO_MDS |NO_SWAPGS |NO_ITLB_MULTIHIT |NO_MMIO |NO_EIBRS_PBRSB |NO_BHI ),/* Zhaoxin Family 7 */ -VULNWL (CENTAUR ,7 ,X86_MODEL_ANY ,NO_SPECTRE_V2 |NO_SWAPGS |NO_MMIO ), - VULNWL(ZHAOXIN, 7, X86_MODEL_ANY, NO_SPECTRE_V2 | NO_SWAPGS | NO_MMIO), +VULNWL (CENTAUR ,7 ,X86_MODEL_ANY ,NO_SPECTRE_V2 |NO_SWAPGS |NO_MMIO |NO_BHI ), + VULNWL(ZHAOXIN, 7, X86_MODEL_ANY, NO_SPECTRE_V2 | NO_SWAPGS | NO_MMIO | NO_BHI), {} };
@@ -1454,6 +1455,13 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c)if (vulnerable_to_rfds (ia32_cap))setup_force_cpu_bug (X86_BUG_RFDS ); +/* When virtualized, eIBRS could be hidden, assume vulnerable */ +if (!(ia32_cap &ARCH_CAP_BHI_NO ) && + !cpu_matches (cpu_vuln_whitelist,NO_BHI ) && + (boot_cpu_has (X86_FEATURE_IBRS_ENHANCED ) || +boot_cpu_has (X86_FEATURE_HYPERVISOR ))) +setup_force_cpu_bug (X86_BUG_BHI ); +if (cpu_matches (cpu_vuln_whitelist,NO_MELTDOWN ))return ;
arch/x86/kernel/cpu/mce/core.c +3 -1
@@ -2471,12 +2471,14 @@ static ssize_t set_bank(struct device *s, struct device_attribute *attr,return -EINVAL ; b = &per_cpu (mce_banks_array, s->id)[bank]; -if (!b->init)return -ENODEV ; b->ctl = new; + +mutex_lock (&mce_sysfs_mutex);mce_restart (); +mutex_unlock (&mce_sysfs_mutex);return size; }
arch/x86/kernel/cpu/scattered.c +2 -0
@@ -28,6 +28,7 @@ static const struct cpuid_bit cpuid_bits[] = { { X86_FEATURE_EPB, CPUID_ECX, 3, 0x00000006, 0 }, { X86_FEATURE_INTEL_PPIN, CPUID_EBX, 0, 0x00000007, 1 }, { X86_FEATURE_RRSBA_CTRL, CPUID_EDX, 2, 0x00000007, 2 }, + { X86_FEATURE_BHI_CTRL, CPUID_EDX, 4, 0x00000007, 2 }, { X86_FEATURE_CQM_LLC, CPUID_EDX, 1, 0x0000000f, 0 }, { X86_FEATURE_CQM_OCCUP_LLC, CPUID_EDX, 0, 0x0000000f, 1 }, { X86_FEATURE_CQM_MBM_TOTAL, CPUID_EDX, 1, 0x0000000f, 1 },
@@ -46,6 +47,7 @@ static const struct cpuid_bit cpuid_bits[] = { { X86_FEATURE_MBA, CPUID_EBX, 6, 0x80000008, 0 }, { X86_FEATURE_PERFMON_V2, CPUID_EAX, 0, 0x80000022, 0 }, { X86_FEATURE_AMD_LBR_V2, CPUID_EAX, 1, 0x80000022, 0 }, + { X86_FEATURE_AMD_LBR_PMC_FREEZE, CPUID_EAX, 2, 0x80000022, 0 }, { 0, 0, 0, 0, 0 } };
arch/x86/kernel/setup.c +2 -0
@@ -33,6 +33,7 @@#include <asm/numa.h> #include <asm/bios_ebda.h> #include <asm/bugs.h> +#include <asm/coco.h> #include <asm/cpu.h> #include <asm/efi.h> #include <asm/gart.h>
@@ -1132,6 +1133,7 @@ void __init setup_arch(char **cmdline_p)* memory size. */ sev_setup_arch (); +cc_random_init ();efi_fake_memmap ();efi_find_mirror ();
arch/x86/kvm/reverse_cpuid.h +4 -1
@@ -42,7 +42,7 @@ enum kvm_only_cpuid_leafs {#define X86_FEATURE_IPRED_CTRL KVM_X86_FEATURE(CPUID_7_2_EDX, 1)#define KVM_X86_FEATURE_RRSBA_CTRL KVM_X86_FEATURE(CPUID_7_2_EDX, 2)#define X86_FEATURE_DDPD_U KVM_X86_FEATURE(CPUID_7_2_EDX, 3) -#define X86_FEATURE_BHI_CTRL KVM_X86_FEATURE(CPUID_7_2_EDX, 4) +#define KVM_X86_FEATURE_BHI_CTRL KVM_X86_FEATURE(CPUID_7_2_EDX, 4)#define X86_FEATURE_MCDT_NO KVM_X86_FEATURE(CPUID_7_2_EDX, 5)struct cpuid_reg {
@@ -83,10 +83,12 @@ static const struct cpuid_reg reverse_cpuid[] = {*/ static __always_inline void reverse_cpuid_check(unsigned int x86_leaf) { +BUILD_BUG_ON (NR_CPUID_WORDS !=NCAPINTS );BUILD_BUG_ON (x86_leaf ==CPUID_LNX_1 );BUILD_BUG_ON (x86_leaf ==CPUID_LNX_2 );BUILD_BUG_ON (x86_leaf ==CPUID_LNX_3 );BUILD_BUG_ON (x86_leaf ==CPUID_LNX_4 ); +BUILD_BUG_ON (x86_leaf ==CPUID_LNX_5 );BUILD_BUG_ON (x86_leaf >=ARRAY_SIZE (reverse_cpuid));BUILD_BUG_ON (reverse_cpuid[x86_leaf].function ==0 ); }
@@ -104,6 +106,7 @@ static __always_inline u32 __feature_translate(int x86_feature)KVM_X86_TRANSLATE_FEATURE (SGX1 );KVM_X86_TRANSLATE_FEATURE (SGX2 );KVM_X86_TRANSLATE_FEATURE (RRSBA_CTRL ); +KVM_X86_TRANSLATE_FEATURE (BHI_CTRL );default :return x86_feature; }
arch/x86/kvm/svm/sev.c +37 -23
126 lines not on this page · raw message
arch/x86/kvm/trace.h +5 -5
@@ -729,13 +729,13 @@ TRACE_EVENT(kvm_nested_intr_vmexit,* Tracepoint for nested #vmexit because of interrupt pending */ TRACE_EVENT(kvm_invlpga, - TP_PROTO(__u64 rip, int asid, u64 address), + TP_PROTO(__u64 rip, unsigned int asid, u64 address), TP_ARGS(rip, asid, address), TP_STRUCT__entry( - __field( __u64, rip ) - __field( int, asid ) - __field( __u64, address ) + __field( __u64, rip ) + __field( unsigned int, asid ) + __field( __u64, address ) ), TP_fast_assign(
@@ -744,7 +744,7 @@ TRACE_EVENT(kvm_invlpga, __entry->address = address; ), -TP_printk ("rip: 0x%016llx asid: %d address: 0x%016llx" , +TP_printk ("rip: 0x%016llx asid: %u address: 0x%016llx" , __entry->rip, __entry->asid, __entry->address) );
arch/x86/kvm/vmx/vmenter.S +2 -0
@@ -242,6 +242,8 @@ SYM_INNER_LABEL(vmx_vmexit, SYM_L_GLOBAL) call vmx_spec_ctrl_restore_host + CLEAR_BRANCH_HISTORY_VMEXIT + /* Put return value in AX */ mov %_ASM_BX, %_ASM_AX
arch/x86/kvm/x86.c +1 -1
@@ -1614,7 +1614,7 @@ static unsigned int num_msr_based_features; ARCH_CAP_PSCHANGE_MC_NO | ARCH_CAP_TSX_CTRL_MSR | ARCH_CAP_TAA_NO | \ ARCH_CAP_SBDR_SSDP_NO | ARCH_CAP_FBSDP_NO | ARCH_CAP_PSDP_NO | \ ARCH_CAP_FB_CLEAR | ARCH_CAP_RRSBA | ARCH_CAP_PBRSB_NO | ARCH_CAP_GDS_NO | \ - ARCH_CAP_RFDS_NO | ARCH_CAP_RFDS_CLEAR) + ARCH_CAP_RFDS_NO | ARCH_CAP_RFDS_CLEAR | ARCH_CAP_BHI_NO)static u64 kvm_get_arch_capabilities (void ) {
arch/x86/lib/retpoline.S +3 -3
@@ -110,6 +110,7 @@ SYM_START(srso_alias_untrain_ret, SYM_L_GLOBAL, SYM_A_NONE) ret int3 SYM_FUNC_END(srso_alias_untrain_ret) +__EXPORT_THUNK(srso_alias_untrain_ret) #endif SYM_START(srso_alias_safe_ret, SYM_L_GLOBAL, SYM_A_NONE)
@@ -252,9 +253,7 @@ SYM_CODE_START(srso_return_thunk) SYM_CODE_END(srso_return_thunk) SYM_FUNC_START(entry_untrain_ret) - ALTERNATIVE_2 "jmp retbleed_untrain_ret", \ - "jmp srso_untrain_ret", X86_FEATURE_SRSO, \ - "jmp srso_alias_untrain_ret", X86_FEATURE_SRSO_ALIAS + ALTERNATIVE "jmp retbleed_untrain_ret", "jmp srso_untrain_ret", X86_FEATURE_SRSO SYM_FUNC_END(entry_untrain_ret) __EXPORT_THUNK(entry_untrain_ret)
@@ -262,6 +261,7 @@ SYM_CODE_START(__x86_return_thunk) UNWIND_HINT_FUNC ANNOTATE_NOENDBR ANNOTATE_UNRET_SAFE + ANNOTATE_NOENDBR ret int3 SYM_CODE_END(__x86_return_thunk)
arch/x86/mm/ident_map.c +5 -18
@@ -26,31 +26,18 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page,for (; addr < end; addr = next) {pud_t *pud = pud_page +pud_index (addr);pmd_t *pmd; -bool use_gbpage; next = (addr &PUD_MASK ) +PUD_SIZE ;if (next > end) next = end; -/* if this is already a gbpage, this portion is already mapped */ -if (pud_large (*pud)) -continue ; - -/* Is using a gbpage allowed? */ - use_gbpage = info->direct_gbpages; - -/* Don't use gbpage if it maps more than the requested region. */ -/* at the begining: */ - use_gbpage &= ((addr & ~PUD_MASK ) ==0 ); -/* ... or at the end: */ - use_gbpage &= ((next & ~PUD_MASK ) ==0 ); - -/* Never overwrite existing mappings */ - use_gbpage &= !pud_present (*pud); - -if (use_gbpage) { +if (info->direct_gbpages) {pud_t pudval; +if (pud_present (*pud)) +continue ; + + addr &=PUD_MASK ; pudval =__pud ((addr - info->offset) | info->page_flag);set_pud (pud, pudval);continue ;
arch/x86/mm/pat/memtype.c +35 -14
79 lines not on this page · raw message
drivers/acpi/acpica/dbnames.c +6 -2
@@ -550,8 +550,12 @@ acpi_db_walk_for_fields(acpi_handle obj_handle,ACPI_FREE (buffer.pointer); buffer.length =ACPI_ALLOCATE_LOCAL_BUFFER ; -acpi_evaluate_object (obj_handle,NULL ,NULL , &buffer); - + status =acpi_evaluate_object (obj_handle,NULL ,NULL , &buffer); +if (ACPI_FAILURE (status)) { +acpi_os_printf ("Could Not evaluate object %p\n" , + obj_handle); +return (AE_OK ); + }/* * Since this is a field unit, surround the output in braces */
drivers/ata/sata_mv.c +31 -32
87 lines not on this page · raw message
drivers/ata/sata_sx4.c +2 -4
@@ -958,8 +958,7 @@ static void pdc20621_get_from_dimm(struct ata_host *host, void *psource, offset -= (idx * window_size); idx++; - dist = ((long ) (window_size - (offset + size))) >=0 ? size : - (long ) (window_size - offset); + dist =min (size, window_size - offset);memcpy_fromio (psource, dimm_mmio + offset /4 , dist); psource += dist;
@@ -1006,8 +1005,7 @@ static void pdc20621_put_to_dimm(struct ata_host *host, void *psource,readl (mmio +PDC_DIMM_WINDOW_CTLR ); offset -= (idx * window_size); idx++; - dist = ((long )(s32)(window_size - (offset + size))) >=0 ? size : - (long ) (window_size - offset); + dist =min (size, window_size - offset);memcpy_toio (dimm_mmio + offset /4 , psource, dist);writel (0x01 , mmio +PDC_GENERAL_CTLR );readl (mmio +PDC_GENERAL_CTLR );
drivers/base/core.c +23 -3
@@ -56,6 +56,7 @@ static bool fw_devlink_is_permissive(void);static void __fw_devlink_link_to_consumers (struct device *dev);static bool fw_devlink_drv_reg_done;static bool fw_devlink_best_effort; +static struct workqueue_struct *device_link_wq;/** * __fwnode_link_add - Create a link between two fwnode_handles.
@@ -585,12 +586,26 @@ static void devlink_dev_release(struct device *dev)/* * It may take a while to complete this work because of the SRCU * synchronization in device_link_release_fn() and if the consumer or -* supplier devices get deleted when it runs, so put it into the "long" -* workqueue. +* supplier devices get deleted when it runs, so put it into the +* dedicated workqueue. */ -queue_work (system_long_wq, &link->rm_work); +queue_work (device_link_wq, &link->rm_work); } +/** +* device_link_wait_removal - Wait for ongoing devlink removal jobs to terminate +*/ +void device_link_wait_removal (void ) +{ +/* +* devlink removal jobs are queued in the dedicated work queue. +* To be sure that all removal jobs are terminated, ensure that any +* scheduled work has run to completion. +*/ +flush_workqueue (device_link_wq); +} +EXPORT_SYMBOL_GPL (device_link_wait_removal); +static struct class devlink_class = { .name ="devlink" , .owner =THIS_MODULE ,
@@ -4132,9 +4147,14 @@ int __init devices_init(void) sysfs_dev_char_kobj =kobject_create_and_add ("char" , dev_kobj);if (!sysfs_dev_char_kobj) goto char_kobj_err; + device_link_wq =alloc_workqueue ("device_link_wq" ,0 ,0 ); +if (!device_link_wq) + goto wq_err;return 0 ; + wq_err: +kobject_put (sysfs_dev_char_kobj); char_kobj_err:kobject_put (sysfs_dev_block_kobj); block_kobj_err:
drivers/bluetooth/btqca.c +6 -2
@@ -758,11 +758,15 @@ EXPORT_SYMBOL_GPL(qca_uart_setup);int qca_set_bdaddr (struct hci_dev *hdev,const bdaddr_t *bdaddr) { +bdaddr_t bdaddr_swapped;struct sk_buff *skb;int err; - skb =__hci_cmd_sync_ev (hdev,EDL_WRITE_BD_ADDR_OPCODE ,6 , bdaddr, -HCI_EV_VENDOR ,HCI_INIT_TIMEOUT ); +baswap (&bdaddr_swapped, bdaddr); + + skb =__hci_cmd_sync_ev (hdev,EDL_WRITE_BD_ADDR_OPCODE ,6 , + &bdaddr_swapped,HCI_EV_VENDOR , +HCI_INIT_TIMEOUT );if (IS_ERR (skb)) { err =PTR_ERR (skb);bt_dev_err (hdev,"QCA Change address cmd failed (%d)" , err);
drivers/bluetooth/hci_qca.c +9 -10
@@ -7,7 +7,6 @@* * Copyright (C) 2007 Texas Instruments, Inc. * Copyright (c) 2010, 2012, 2018 The Linux Foundation. All rights reserved. -* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Acknowledgements: * This file is based on hci_ll.c, which was...
@@ -226,6 +225,7 @@ struct qca_serdev {struct qca_power *bt_power;u32 init_speed;u32 oper_speed; +bool bdaddr_property_broken;const char *firmware_name; };
@@ -1788,6 +1788,7 @@ static int qca_setup(struct hci_uart *hu)const char *firmware_name =qca_get_firmware_name (hu);int ret;struct qca_btsoc_version ver; +struct qca_serdev *qcadev;const char *soc_name; ret =qca_check_speeds (hu);
@@ -1845,16 +1846,11 @@ static int qca_setup(struct hci_uart *hu)case QCA_WCN6750 :case QCA_WCN6855 :case QCA_WCN7850 : +set_bit (HCI_QUIRK_USE_BDADDR_PROPERTY , &hdev->quirks); -/* Set BDA quirk bit for reading BDA value from fwnode property -* only if that property exist in DT. -*/ -if (fwnode_property_present (dev_fwnode (hdev->dev.parent),"local-bd-address" )) { -set_bit (HCI_QUIRK_USE_BDADDR_PROPERTY , &hdev->quirks); -bt_dev_info (hdev,"setting quirk bit to read BDA from fwnode later" ); - }else { -bt_dev_dbg (hdev,"local-bd-address` is not present in the devicetree so not setting quirk bit for BDA" ); - } + qcadev =serdev_device_get_drvdata (hu->serdev); +if (qcadev->bdaddr_property_broken) +set_bit (HCI_QUIRK_BDADDR_PROPERTY_BROKEN , &hdev->quirks);hci_set_aosp_capable (hdev);
@@ -2223,6 +2219,9 @@ static int qca_serdev_probe(struct serdev_device *serdev)if (!qcadev->oper_speed)BT_DBG ("UART will pick default operating speed" ); + qcadev->bdaddr_property_broken =device_property_read_bool (&serdev->dev, +"qcom,local-bd-address-broken" ); +if (data) qcadev->btsoc_type = data->soc_type;else
drivers/dma-buf/st-dma-fence-chain.c +3 -3
@@ -84,11 +84,11 @@ static int sanitycheck(void *arg)return -ENOMEM ; chain =mock_chain (NULL , f,1 ); -if (!chain) +if (chain) +dma_fence_enable_sw_signaling (chain); +else err = -ENOMEM ; -dma_fence_enable_sw_signaling (chain); -dma_fence_signal (f);dma_fence_put (f);
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
@@ -1342,6 +1342,7 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,void amdgpu_driver_release_kms (struct drm_device *dev);int amdgpu_device_ip_suspend (struct amdgpu_device *adev); +int amdgpu_device_prepare (struct drm_device *dev);int amdgpu_device_suspend (struct drm_device *dev,bool fbcon);int amdgpu_device_resume (struct drm_device *dev,bool fbcon);u32 amdgpu_get_vblank_counter_kms (struct drm_crtc *crtc);
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +38 -0
@@ -1639,6 +1639,7 @@ static void amdgpu_switcheroo_set_state(struct pci_dev *pdev, }else {pr_info ("switched off\n" ); dev->switch_power_state =DRM_SWITCH_POWER_CHANGING ; +amdgpu_device_prepare (dev);amdgpu_device_suspend (dev, true);amdgpu_device_cache_pci_state (pdev);/* Shut down the device */
@@ -4167,6 +4168,43 @@ static int amdgpu_device_evict_resources(struct amdgpu_device *adev)/* * Suspend & resume. */ +/** +* amdgpu_device_prepare - prepare for device suspend +* +* @dev: drm dev pointer +* +* Prepare to put the hw in the suspend state (all asics). +* Returns 0 for success or an error on failure. +* Called at driver suspend. +*/ +int amdgpu_device_prepare (struct drm_device *dev) +{ +struct amdgpu_device *adev =drm_to_adev (dev); +int i, r; + +if (dev->switch_power_state ==DRM_SWITCH_POWER_OFF ) +return 0 ; + +/* Evict the majority of BOs before starting suspend sequence */ + r =amdgpu_device_evict_resources (adev); +if (r) +return r; + +flush_delayed_work (&adev->gfx.gfx_off_delay_work); + +for (i =0 ; i < adev->num_ip_blocks; i++) { +if (!adev->ip_blocks[i].status.valid) +continue ; +if (!adev->ip_blocks[i].version->funcs->prepare_suspend) +continue ; + r = adev->ip_blocks[i].version->funcs->prepare_suspend ((void *)adev); +if (r) +return r; + } + +return 0 ; +} +/** * amdgpu_device_suspend - initiate device suspend *
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +7 -3
@@ -2391,8 +2391,9 @@ static int amdgpu_pmops_prepare(struct device *dev)/* Return a positive number here so * DPM_FLAG_SMART_SUSPEND works properly */ -if (amdgpu_device_supports_boco (drm_dev)) -return pm_runtime_suspended (dev); +if (amdgpu_device_supports_boco (drm_dev) && +pm_runtime_suspended (dev)) +return 1 ;/* if we will not support s3 or s2i for the device * then skip suspend
@@ -2401,7 +2402,7 @@ static int amdgpu_pmops_prepare(struct device *dev) !amdgpu_acpi_is_s3_active(adev))return 1 ; -return 0 ; +return amdgpu_device_prepare (drm_dev); }static void amdgpu_pmops_complete (struct device *dev)
@@ -2600,6 +2601,9 @@ static int amdgpu_pmops_runtime_suspend(struct device *dev)if (amdgpu_device_supports_boco (drm_dev)) adev->mp1_state =PP_MP1_STATE_UNLOAD ; + ret =amdgpu_device_prepare (drm_dev); +if (ret) +return ret; ret =amdgpu_device_suspend (drm_dev, false);if (ret) { adev->in_runpm = false;
drivers/gpu/drm/amd/include/amd_shared.h +1 -0
@@ -294,6 +294,7 @@ struct amd_ip_funcs {int (*hw_init)(void *handle);int (*hw_fini)(void *handle);void (*late_fini)(void *handle); +int (*prepare_suspend)(void *handle);int (*suspend)(void *handle);int (*resume)(void *handle);bool (*is_idle)(void *handle);
drivers/gpu/drm/panfrost/panfrost_gpu.c +3 -3
@@ -379,19 +379,19 @@ void panfrost_gpu_power_off(struct panfrost_device *pfdev)gpu_write (pfdev,SHADER_PWROFF_LO , pfdev->features.shader_present); ret =readl_relaxed_poll_timeout (pfdev->iomem +SHADER_PWRTRANS_LO , - val, !val,1 ,1000 ); + val, !val,1 ,2000 );if (ret)dev_err (pfdev->dev,"shader power transition timeout" );gpu_write (pfdev,TILER_PWROFF_LO , pfdev->features.tiler_present); ret =readl_relaxed_poll_timeout (pfdev->iomem +TILER_PWRTRANS_LO , - val, !val,1 ,1000 ); + val, !val,1 ,2000 );if (ret)dev_err (pfdev->dev,"tiler power transition timeout" );gpu_write (pfdev,L2_PWROFF_LO , pfdev->features.l2_present); ret =readl_poll_timeout (pfdev->iomem +L2_PWRTRANS_LO , - val, !val,0 ,1000 ); + val, !val,0 ,2000 );if (ret)dev_err (pfdev->dev,"l2 power transition timeout" ); }
drivers/md/dm-integrity.c +1 -1
@@ -4167,7 +4167,7 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned int argc, char **argv }else if (sscanf (opt_string,"sectors_per_bit:%llu%c" , &llval, &dummy) ==1 ) { log2_sectors_per_bitmap_bit = !llval ?0 :__ilog2_u64 (llval); }else if (sscanf (opt_string,"bitmap_flush_interval:%u%c" , &val, &dummy) ==1 ) { -if (val >= (uint64_t )UINT_MAX *1000 /HZ ) { +if ((uint64_t )val >= (uint64_t )UINT_MAX *1000 /HZ ) { r = -EINVAL ; ti->error ="Invalid bitmap_flush_interval argument" ; goto bad;
drivers/net/ethernet/freescale/fec_main.c +9 -2
@@ -2236,8 +2236,6 @@ static int fec_enet_mii_probe(struct net_device *ndev) fep->link =0 ; fep->full_duplex =0 ; - phy_dev->mac_managed_pm =1 ; -phy_attached_info (phy_dev);return 0 ;
@@ -2249,10 +2247,12 @@ static int fec_enet_mii_init(struct platform_device *pdev)struct net_device *ndev =platform_get_drvdata (pdev);struct fec_enet_private *fep =netdev_priv (ndev);bool suppress_preamble = false; +struct phy_device *phydev;struct device_node *node;int err = -ENXIO ;u32 mii_speed, holdtime;u32 bus_freq; +int addr;/* * The i.MX28 dual fec interfaces are not equal.
@@ -2362,6 +2362,13 @@ static int fec_enet_mii_init(struct platform_device *pdev) goto err_out_free_mdiobus;of_node_put (node); +/* find all the PHY devices on the bus and set mac_managed_pm to true */ +for (addr =0 ; addr <PHY_MAX_ADDR ; addr++) { + phydev =mdiobus_get_phy (fep->mii_bus, addr); +if (phydev) + phydev->mac_managed_pm = true; + } + mii_cnt++;/* save fec0 mii_bus */
drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c +1 -1
@@ -85,7 +85,7 @@ int hclge_comm_tqps_update_stats(struct hnae3_handle *handle,hclge_comm_cmd_setup_basic_desc (&desc,HCLGE_OPC_QUERY_TX_STATS , true); - desc.data[0 ] =cpu_to_le32 (tqp->index &0x1ff ); + desc.data[0 ] =cpu_to_le32 (tqp->index); ret =hclge_comm_cmd_send (hw, &desc,1 );if (ret) { dev_err(&hw->cmq.csq.pdev->dev,
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c +17 -2
@@ -78,6 +78,9 @@ static const struct hns3_stats hns3_rxq_stats[] = {#define HNS3_NIC_LB_TEST_NO_MEM_ERR 1#define HNS3_NIC_LB_TEST_TX_CNT_ERR 2#define HNS3_NIC_LB_TEST_RX_CNT_ERR 3 +#define HNS3_NIC_LB_TEST_UNEXECUTED 4 + +static int hns3_get_sset_count (struct net_device *netdev,int stringset);static int hns3_lp_setup (struct net_device *ndev,enum hnae3_loop loop,bool en) {
@@ -419,18 +422,26 @@ static void hns3_do_external_lb(struct net_device *ndev,static void hns3_self_test (struct net_device *ndev,struct ethtool_test *eth_test,u64 *data) { +int cnt =hns3_get_sset_count (ndev,ETH_SS_TEST );struct hns3_nic_priv *priv =netdev_priv (ndev);struct hnae3_handle *h = priv->ae_handle;int st_param[HNAE3_LOOP_NONE ][2 ];bool if_running =netif_running (ndev); +int i; + +/* initialize the loopback test result, avoid marking an unexcuted +* loopback test as PASS. +*/ +for (i =0 ; i < cnt; i++) + data[i] =HNS3_NIC_LB_TEST_UNEXECUTED ;if (hns3_nic_resetting (ndev)) {netdev_err (ndev,"dev resetting!" ); -return ; + goto failure; }if (!(eth_test->flags Ð_TEST_FL_OFFLINE )) -return ; + goto failure;if (netif_msg_ifdown (h))netdev_info (ndev,"self test start\n" );
@@ -452,6 +463,10 @@ static void hns3_self_test(struct net_device *ndev,if (netif_msg_ifdown (h))netdev_info (ndev,"self test end\n" ); +return ; + +failure: + eth_test->flags |=ETH_TEST_FL_FAILED ; } static void hns3_update_limit_promisc_mode(struct net_device *netdev,
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +4 -0
@@ -11604,6 +11604,8 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev)if (ret) goto err_pci_uninit; +devl_lock (hdev->devlink); +/* Firmware command queue initialize */ ret =hclge_comm_cmd_queue_init (hdev->pdev, &hdev->hw.hw);if (ret)
@@ -11778,6 +11780,7 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev)hclge_task_schedule (hdev,round_jiffies_relative (HZ )); +devl_unlock (hdev->devlink);return 0 ; err_mdiobus_unreg:
@@ -11790,6 +11793,7 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev) err_cmd_uninit:hclge_comm_cmd_uninit (hdev->ae_dev, &hdev->hw.hw); err_devlink_uninit: +devl_unlock (hdev->devlink);hclge_devlink_uninit (hdev); err_pci_uninit:pcim_iounmap (pdev, hdev->hw.hw.io_base);
drivers/net/ethernet/intel/i40e/i40e.h +4 -2
@@ -108,7 +108,7 @@#define I40E_MAX_BW_INACTIVE_ACCUM 4/* accumulate 4 credits max */ /* driver state flags */ -enum i40e_state_t { +enum i40e_state { __I40E_TESTING, __I40E_CONFIG_BUSY, __I40E_CONFIG_DONE,
@@ -156,7 +156,7 @@ enum i40e_state_t {BIT_ULL (__I40E_PF_RESET_AND_REBUILD_REQUESTED)/* VSI state flags */ -enum i40e_vsi_state_t { +enum i40e_vsi_state { __I40E_VSI_DOWN, __I40E_VSI_NEEDS_RESTART, __I40E_VSI_SYNCING_FILTERS,
@@ -992,6 +992,8 @@ struct i40e_q_vector {struct rcu_head rcu;/* to avoid race with update stats on free */ char name[I40E_INT_NAME_STR_LEN ];bool arm_wb_state; +bool in_busy_poll; +int irq_num;/* IRQ assigned to this q_vector */ }____cacheline_internodealigned_in_smp ;/* lan device */
drivers/net/ethernet/intel/i40e/i40e_main.c +12 -2
@@ -1249,8 +1249,11 @@ int i40e_count_filters(struct i40e_vsi *vsi)int bkt;int cnt =0 ; -hash_for_each_safe (vsi->mac_filter_hash, bkt, h, f, hlist) - ++cnt; +hash_for_each_safe (vsi->mac_filter_hash, bkt, h, f, hlist) { +if (f->state ==I40E_FILTER_NEW || + f->state ==I40E_FILTER_ACTIVE ) + ++cnt; + }return cnt; }
@@ -3888,6 +3891,12 @@ static void i40e_vsi_configure_msix(struct i40e_vsi *vsi) q_vector->tx.target_itr >> 1); q_vector->tx.current_itr = q_vector->tx.target_itr; +/* Set ITR for software interrupts triggered after exiting +* busy-loop polling. +*/ +wr32 (hw,I40E_PFINT_ITRN (I40E_SW_ITR , vector -1 ), +I40E_ITR_20K ); +wr32 (hw,I40E_PFINT_RATEN (vector -1 ),i40e_intrl_usec_to_reg (vsi->int_rate_limit));
@@ -4142,6 +4151,7 @@ static int i40e_vsi_request_irq_msix(struct i40e_vsi *vsi, char *basename) }/* register for affinity change notifications */ + q_vector->irq_num = irq_num; q_vector->affinity_notify.notify = i40e_irq_affinity_notify; q_vector->affinity_notify.release = i40e_irq_affinity_release;irq_set_affinity_notifier (irq_num, &q_vector->affinity_notify);
drivers/net/ethernet/intel/i40e/i40e_ptp.c +3 -3
@@ -34,7 +34,7 @@ enum i40e_ptp_pin {GPIO_4 }; -enum i40e_can_set_pins_t { +enum i40e_can_set_pins {CANT_DO_PINS =-1 ,CAN_SET_PINS ,CAN_DO_PINS
@@ -192,7 +192,7 @@ static bool i40e_is_ptp_pin_dev(struct i40e_hw *hw)* return CAN_DO_PINS if pins can be manipulated within a NIC or * return CANT_DO_PINS otherwise. **/ -static enum i40e_can_set_pins_t i40e_can_set_pins (struct i40e_pf *pf) +static enum i40e_can_set_pins i40e_can_set_pins (struct i40e_pf *pf) {if (!i40e_is_ptp_pin_dev (&pf->hw)) { dev_warn(&pf->pdev->dev,
@@ -1081,7 +1081,7 @@ static void i40e_ptp_set_pins_hw(struct i40e_pf *pf)static int i40e_ptp_set_pins (struct i40e_pf *pf,struct i40e_ptp_pins_settings *pins) { -enum i40e_can_set_pins_t pin_caps =i40e_can_set_pins (pf); +enum i40e_can_set_pins pin_caps =i40e_can_set_pins (pf);int i =0 ;if (pin_caps ==CANT_DO_PINS )
drivers/net/ethernet/intel/i40e/i40e_register.h +3 -0
@@ -328,8 +328,11 @@#define I40E_PFINT_DYN_CTLN_ITR_INDX_SHIFT 3#define I40E_PFINT_DYN_CTLN_ITR_INDX_MASK I40E_MASK(0x3, I40E_PFINT_DYN_CTLN_ITR_INDX_SHIFT)#define I40E_PFINT_DYN_CTLN_INTERVAL_SHIFT 5 +#define I40E_PFINT_DYN_CTLN_INTERVAL_MASK I40E_MASK(0xFFF, I40E_PFINT_DYN_CTLN_INTERVAL_SHIFT)#define I40E_PFINT_DYN_CTLN_SW_ITR_INDX_ENA_SHIFT 24#define I40E_PFINT_DYN_CTLN_SW_ITR_INDX_ENA_MASK I40E_MASK(0x1, I40E_PFINT_DYN_CTLN_SW_ITR_INDX_ENA_SHIFT) +#define I40E_PFINT_DYN_CTLN_SW_ITR_INDX_SHIFT 25 +#define I40E_PFINT_DYN_CTLN_SW_ITR_INDX_MASK I40E_MASK(0x3, I40E_PFINT_DYN_CTLN_SW_ITR_INDX_SHIFT)#define I40E_PFINT_ICR0 0x00038780/* Reset: CORER */ #define I40E_PFINT_ICR0_INTEVENT_SHIFT 0#define I40E_PFINT_ICR0_INTEVENT_MASK I40E_MASK(0x1, I40E_PFINT_ICR0_INTEVENT_SHIFT)
drivers/net/ethernet/intel/i40e/i40e_txrx.c +61 -21
138 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_txrx.h +3 -2
@@ -57,7 +57,7 @@ static inline u16 i40e_intrl_usec_to_reg(int intrl)* mentioning ITR_INDX, ITR_NONE cannot be used as an index 'n' into any * register but instead is a special value meaning "don't update" ITR0/1/2. */ -enum i40e_dyn_idx_t { +enum i40e_dyn_idx {I40E_IDX_ITR0 =0 ,I40E_IDX_ITR1 =1 ,I40E_IDX_ITR2 =2 ,
@@ -67,6 +67,7 @@ enum i40e_dyn_idx_t {/* these are indexes into ITRN registers */ #define I40E_RX_ITR I40E_IDX_ITR0#define I40E_TX_ITR I40E_IDX_ITR1 +#define I40E_SW_ITR I40E_IDX_ITR2/* Supported RSS offloads */ #define I40E_DEFAULT_RSS_HENA ( \
@@ -304,7 +305,7 @@ struct i40e_rx_queue_stats {u64 page_busy_count; }; -enum i40e_ring_state_t { +enum i40e_ring_state { __I40E_TX_FDIR_INIT_DONE, __I40E_TX_XPS_INIT_DONE, __I40E_RING_STATE_NBITS/* must be last */
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +22 -23
124 lines not on this page · raw message
drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c +8 -8
@@ -908,7 +908,13 @@ int ixgbe_ipsec_vf_add_sa(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf) goto err_out; } - xs =kzalloc (sizeof (*xs),GFP_KERNEL ); + algo =xfrm_aead_get_byname (aes_gcm_name,IXGBE_IPSEC_AUTH_BITS ,1 ); +if (unlikely (!algo)) { + err = -ENOENT ; + goto err_out; + } + + xs =kzalloc (sizeof (*xs),GFP_ATOMIC );if (unlikely (!xs)) { err = -ENOMEM ; goto err_out;
@@ -924,14 +930,8 @@ int ixgbe_ipsec_vf_add_sa(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf)memcpy (&xs->id.daddr.a4, sam->addr,sizeof (xs->id.daddr.a4)); xs->xso.dev = adapter->netdev; - algo =xfrm_aead_get_byname (aes_gcm_name,IXGBE_IPSEC_AUTH_BITS ,1 ); -if (unlikely (!algo)) { - err = -ENOENT ; - goto err_xs; - } - aead_len =sizeof (*xs->aead) +IXGBE_IPSEC_KEY_BITS /8 ; - xs->aead =kzalloc (aead_len,GFP_KERNEL ); + xs->aead =kzalloc (aead_len,GFP_ATOMIC );if (unlikely (!xs->aead)) { err = -ENOMEM ; goto err_xs;
drivers/net/ethernet/marvell/octeontx2/af/cgx.c +5 -0
@@ -814,6 +814,11 @@ static int cgx_lmac_enadis_pause_frm(void *cgxd, int lmac_id,if (!is_lmac_valid (cgx, lmac_id))return -ENODEV ; + cfg =cgx_read (cgx, lmac_id,CGXX_GMP_GMI_RXX_FRM_CTL ); + cfg &= ~CGX_GMP_GMI_RXX_FRM_CTL_CTL_BCK ; + cfg |= rx_pause ?CGX_GMP_GMI_RXX_FRM_CTL_CTL_BCK :0x0 ; +cgx_write (cgx, lmac_id,CGXX_GMP_GMI_RXX_FRM_CTL , cfg); + cfg =cgx_read (cgx, lmac_id,CGXX_SMUX_RX_FRM_CTL ); cfg &= ~CGX_SMUX_RX_FRM_CTL_CTL_BCK ; cfg |= rx_pause ?CGX_SMUX_RX_FRM_CTL_CTL_BCK :0x0 ;
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +2 -0
@@ -160,6 +160,8 @@ static int rvu_map_cgx_lmac_pf(struct rvu *rvu)continue ; lmac_bmap =cgx_get_lmac_bmap (rvu_cgx_pdata (cgx, rvu));for_each_set_bit (iter, &lmac_bmap, rvu->hw->lmac_per_cgx) { +if (iter >=MAX_LMAC_COUNT ) +continue ; lmac =cgx_get_lmacid (rvu_cgx_pdata (cgx, rvu), iter); rvu->pf2cgxlmac_map[pf] =cgxlmac_id_to_bmap (cgx, lmac);
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +1 -1
@@ -1669,7 +1669,7 @@ static int npc_fwdb_detect_load_prfl_img(struct rvu *rvu, uint64_t prfl_sz,struct npc_coalesced_kpu_prfl *img_data =NULL ;int i =0 , rc = -EINVAL ;void __iomem *kpu_prfl_addr; -u16 offset; +u32 offset; img_data = (struct npc_coalesced_kpu_prfl __force *)rvu->kpu_prfl_addr; if (le64_to_cpu(img_data->signature) == KPU_SIGN &&
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +1 -1
@@ -1914,7 +1914,7 @@ int otx2_open(struct net_device *netdev)* mcam entries are enabled to receive the packets. Hence disable the * packet I/O. */ -if (err ==EIO ) +if (err == -EIO ) goto err_disable_rxtx;else if (err) goto err_tx_stop_queues;
drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c +22 -9
@@ -14,6 +14,7 @@#include <linux/module.h> #include <linux/phy.h> #include <linux/platform_device.h> +#include <linux/rtnetlink.h> #include <linux/skbuff.h> #include "mlxbf_gige.h"
@@ -139,13 +140,10 @@ static int mlxbf_gige_open(struct net_device *netdev) control |=MLXBF_GIGE_CONTROL_PORT_EN ;writeq (control, priv->base +MLXBF_GIGE_CONTROL ); - err =mlxbf_gige_request_irqs (priv); -if (err) -return err;mlxbf_gige_cache_stats (priv); err =mlxbf_gige_clean_port (priv);if (err) - goto free_irqs; +return err;/* Clear driver's valid_polarity to match hardware, * since the above call to clean_port() resets the
@@ -157,7 +155,7 @@ static int mlxbf_gige_open(struct net_device *netdev) err =mlxbf_gige_tx_init (priv);if (err) - goto free_irqs; + goto phy_deinit; err =mlxbf_gige_rx_init (priv);if (err) goto tx_deinit;
@@ -166,6 +164,10 @@ static int mlxbf_gige_open(struct net_device *netdev)napi_enable (&priv->napi);netif_start_queue (netdev); + err =mlxbf_gige_request_irqs (priv); +if (err) + goto napi_deinit; +/* Set bits in INT_EN that we care about */ int_en =MLXBF_GIGE_INT_EN_HW_ACCESS_ERROR | MLXBF_GIGE_INT_EN_TX_CHECKSUM_INPUTS |
@@ -182,11 +184,17 @@ static int mlxbf_gige_open(struct net_device *netdev)return 0 ; +napi_deinit: +netif_stop_queue (netdev); +napi_disable (&priv->napi); +netif_napi_del (&priv->napi); +mlxbf_gige_rx_deinit (priv); + tx_deinit:mlxbf_gige_tx_deinit (priv); -free_irqs: -mlxbf_gige_free_irqs (priv); +phy_deinit: +phy_stop (phydev);return err; }
@@ -410,8 +418,13 @@ static void mlxbf_gige_shutdown(struct platform_device *pdev) {struct mlxbf_gige *priv =platform_get_drvdata (pdev); -writeq (0 , priv->base +MLXBF_GIGE_INT_EN ); -mlxbf_gige_clean_port (priv); +rtnl_lock (); +netif_device_detach (priv->netdev); + +if (netif_running (priv->netdev)) +dev_close (priv->netdev); + +rtnl_unlock (); }static const struct acpi_device_id __maybe_unused mlxbf_gige_acpi_match[] = {
drivers/net/ethernet/microchip/lan743x_main.c +18 -0
@@ -25,6 +25,8 @@#define PCS_POWER_STATE_DOWN 0x6#define PCS_POWER_STATE_UP 0x4 +#define RFE_RD_FIFO_TH_3_DWORDS 0x3 +static void pci11x1x_strap_get_status (struct lan743x_adapter *adapter) {u32 chip_rev;
@@ -3217,6 +3219,21 @@ static void lan743x_full_cleanup(struct lan743x_adapter *adapter)lan743x_pci_cleanup (adapter); } +static void pci11x1x_set_rfe_rd_fifo_threshold (struct lan743x_adapter *adapter) +{ +u16 rev = adapter->csr.id_rev &ID_REV_CHIP_REV_MASK_ ; + +if (rev ==ID_REV_CHIP_REV_PCI11X1X_B0_ ) { +u32 misc_ctl; + + misc_ctl =lan743x_csr_read (adapter,MISC_CTL_0 ); + misc_ctl &= ~MISC_CTL_0_RFE_READ_FIFO_MASK_ ; + misc_ctl |=FIELD_PREP (MISC_CTL_0_RFE_READ_FIFO_MASK_ , +RFE_RD_FIFO_TH_3_DWORDS ); +lan743x_csr_write (adapter,MISC_CTL_0 , misc_ctl); + } +} +static int lan743x_hardware_init (struct lan743x_adapter *adapter,struct pci_dev *pdev) {
@@ -3232,6 +3249,7 @@ static int lan743x_hardware_init(struct lan743x_adapter *adapter,pci11x1x_strap_get_status (adapter);spin_lock_init (&adapter->eth_syslock_spinlock);mutex_init (&adapter->sgmii_rw_lock); +pci11x1x_set_rfe_rd_fifo_threshold (adapter); }else { adapter->max_tx_channels =LAN743X_MAX_TX_CHANNELS ; adapter->used_tx_channels =LAN743X_USED_TX_CHANNELS ;
drivers/net/ethernet/microchip/lan743x_main.h +4 -0
@@ -26,6 +26,7 @@#define ID_REV_CHIP_REV_MASK_ (0x0000FFFF)#define ID_REV_CHIP_REV_A0_ (0x00000000)#define ID_REV_CHIP_REV_B0_ (0x00000010) +#define ID_REV_CHIP_REV_PCI11X1X_B0_ (0x000000B0)#define FPGA_REV (0x04)#define FPGA_REV_GET_MINOR_ (fpga_rev) (((fpga_rev) >> 8) & 0x000000FF)
@@ -311,6 +312,9 @@#define SGMII_CTL_LINK_STATUS_SOURCE_ BIT(8)#define SGMII_CTL_SGMII_POWER_DN_ BIT(1) +#define MISC_CTL_0 (0x920) +#define MISC_CTL_0_RFE_READ_FIFO_MASK_ GENMASK(6, 4) +/* Vendor Specific SGMII MMD details */ #define SR_VSMMD_PCS_ID1 0x0004#define SR_VSMMD_PCS_ID2 0x0005
drivers/net/ethernet/realtek/r8169_main.c +110 -21
268 lines not on this page · raw message
drivers/net/ethernet/renesas/ravb_main.c +14 -19
@@ -1290,25 +1290,16 @@ static int ravb_poll(struct napi_struct *napi, int budget)struct net_device *ndev = napi->dev;struct ravb_private *priv =netdev_priv (ndev);const struct ravb_hw_info *info = priv->info; -bool gptp = info->gptp || info->ccc_gac; -struct ravb_rx_desc *desc;unsigned long flags;int q = napi - priv->napi;int mask =BIT (q);int quota = budget; -unsigned int entry; +bool unmask; -if (!gptp) { - entry = priv->cur_rx[q] % priv->num_rx_ring[q]; - desc = &priv->gbeth_rx_ring[entry]; - }/* Processing RX Descriptor Ring */ /* Clear RX interrupt */ ravb_write (ndev, ~(mask |RIS0_RESERVED ),RIS0 ); -if (gptp || desc->die_dt !=DT_FEMPTY ) { -if (ravb_rx (ndev, "a, q)) - goto out; - } + unmask = !ravb_rx (ndev, "a, q);/* Processing TX Descriptor Ring */ spin_lock_irqsave (&priv->lock, flags);
@@ -1318,6 +1309,18 @@ static int ravb_poll(struct napi_struct *napi, int budget)netif_wake_subqueue (ndev, q);spin_unlock_irqrestore (&priv->lock, flags); +/* Receive error message handling */ + priv->rx_over_errors = priv->stats[RAVB_BE ].rx_over_errors; +if (info->nc_queues) + priv->rx_over_errors += priv->stats[RAVB_NC ].rx_over_errors; +if (priv->rx_over_errors != ndev->stats.rx_over_errors) + ndev->stats.rx_over_errors = priv->rx_over_errors; +if (priv->rx_fifo_errors != ndev->stats.rx_fifo_errors) + ndev->stats.rx_fifo_errors = priv->rx_fifo_errors; + +if (!unmask) + goto out; +napi_complete (napi);/* Re-enable RX/TX interrupts */
@@ -1331,14 +1334,6 @@ static int ravb_poll(struct napi_struct *napi, int budget) }spin_unlock_irqrestore (&priv->lock, flags); -/* Receive error message handling */ - priv->rx_over_errors = priv->stats[RAVB_BE ].rx_over_errors; -if (info->nc_queues) - priv->rx_over_errors += priv->stats[RAVB_NC ].rx_over_errors; -if (priv->rx_over_errors != ndev->stats.rx_over_errors) - ndev->stats.rx_over_errors = priv->rx_over_errors; -if (priv->rx_fifo_errors != ndev->stats.rx_fifo_errors) - ndev->stats.rx_fifo_errors = priv->rx_fifo_errors; out:return budget - quota; }
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +31 -9
@@ -87,19 +87,41 @@ static void dwmac4_rx_queue_priority(struct mac_device_info *hw, u32 prio, u32 queue) { void __iomem *ioaddr = hw->pcsr; -u32 base_register; -u32 value; +u32 clear_mask =0 ; +u32 ctrl2, ctrl3; +int i; - base_register = (queue <4 ) ?GMAC_RXQ_CTRL2 :GMAC_RXQ_CTRL3 ; -if (queue >=4 ) - queue -=4 ; + ctrl2 =readl (ioaddr +GMAC_RXQ_CTRL2 ); + ctrl3 =readl (ioaddr +GMAC_RXQ_CTRL3 ); - value =readl (ioaddr + base_register); +/* The software must ensure that the same priority +* is not mapped to multiple Rx queues +*/ +for (i =0 ; i <4 ; i++) + clear_mask |= ((prio <<GMAC_RXQCTRL_PSRQX_SHIFT (i)) & +GMAC_RXQCTRL_PSRQX_MASK (i)); - value &= ~GMAC_RXQCTRL_PSRQX_MASK (queue); - value |= (prio <<GMAC_RXQCTRL_PSRQX_SHIFT (queue)) & + ctrl2 &= ~clear_mask; + ctrl3 &= ~clear_mask; + +/* First assign new priorities to a queue, then +* clear them from others queues +*/ +if (queue <4 ) { + ctrl2 |= (prio <<GMAC_RXQCTRL_PSRQX_SHIFT (queue)) &GMAC_RXQCTRL_PSRQX_MASK (queue); -writel (value, ioaddr + base_register); + +writel (ctrl2, ioaddr +GMAC_RXQ_CTRL2 ); +writel (ctrl3, ioaddr +GMAC_RXQ_CTRL3 ); + }else { + queue -=4 ; + + ctrl3 |= (prio <<GMAC_RXQCTRL_PSRQX_SHIFT (queue)) & +GMAC_RXQCTRL_PSRQX_MASK (queue); + +writel (ctrl3, ioaddr +GMAC_RXQ_CTRL3 ); +writel (ctrl2, ioaddr +GMAC_RXQ_CTRL2 ); + } } static void dwmac4_tx_queue_priority(struct mac_device_info *hw,
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c +31 -7
@@ -97,17 +97,41 @@ static void dwxgmac2_rx_queue_prio(struct mac_device_info *hw, u32 prio, u32 queue) {void __iomem *ioaddr = hw->pcsr; -u32 value, reg; +u32 clear_mask =0 ; +u32 ctrl2, ctrl3; +int i; - reg = (queue <4 ) ?XGMAC_RXQ_CTRL2 :XGMAC_RXQ_CTRL3 ; -if (queue >=4 ) + ctrl2 =readl (ioaddr +XGMAC_RXQ_CTRL2 ); + ctrl3 =readl (ioaddr +XGMAC_RXQ_CTRL3 ); + +/* The software must ensure that the same priority +* is not mapped to multiple Rx queues +*/ +for (i =0 ; i <4 ; i++) + clear_mask |= ((prio <<XGMAC_PSRQ_SHIFT (i)) & +XGMAC_PSRQ (i)); + + ctrl2 &= ~clear_mask; + ctrl3 &= ~clear_mask; + +/* First assign new priorities to a queue, then +* clear them from others queues +*/ +if (queue <4 ) { + ctrl2 |= (prio <<XGMAC_PSRQ_SHIFT (queue)) & +XGMAC_PSRQ (queue); + +writel (ctrl2, ioaddr +XGMAC_RXQ_CTRL2 ); +writel (ctrl3, ioaddr +XGMAC_RXQ_CTRL3 ); + }else { queue -=4 ; - value =readl (ioaddr + reg); - value &= ~XGMAC_PSRQ (queue); - value |= (prio <<XGMAC_PSRQ_SHIFT (queue)) &XGMAC_PSRQ (queue); + ctrl3 |= (prio <<XGMAC_PSRQ_SHIFT (queue)) & +XGMAC_PSRQ (queue); -writel (value, ioaddr + reg); +writel (ctrl3, ioaddr +XGMAC_RXQ_CTRL3 ); +writel (ctrl2, ioaddr +XGMAC_RXQ_CTRL2 ); + } } static void dwxgmac2_tx_queue_prio(struct mac_device_info *hw, u32 prio,
drivers/net/phy/micrel.c +24 -7
@@ -2188,6 +2188,7 @@ static int lan8814_hwtstamp(struct mii_timestamper *mii_ts, struct ifreq *ifr)struct hwtstamp_config config;int txcfg =0 , rxcfg =0 ;int pkt_ts_enable; +int tx_mod;if (copy_from_user (&config, ifr->ifr_data,sizeof (config)))return -EFAULT ;
@@ -2237,9 +2238,14 @@ static int lan8814_hwtstamp(struct mii_timestamper *mii_ts, struct ifreq *ifr)lanphy_write_page_reg (ptp_priv->phydev,5 ,PTP_RX_TIMESTAMP_EN , pkt_ts_enable);lanphy_write_page_reg (ptp_priv->phydev,5 ,PTP_TX_TIMESTAMP_EN , pkt_ts_enable); -if (ptp_priv->hwts_tx_type ==HWTSTAMP_TX_ONESTEP_SYNC ) + tx_mod =lanphy_read_page_reg (ptp_priv->phydev,5 ,PTP_TX_MOD ); +if (ptp_priv->hwts_tx_type ==HWTSTAMP_TX_ONESTEP_SYNC ) {lanphy_write_page_reg (ptp_priv->phydev,5 ,PTP_TX_MOD , -PTP_TX_MOD_TX_PTP_SYNC_TS_INSERT_ ); + tx_mod |PTP_TX_MOD_TX_PTP_SYNC_TS_INSERT_ ); + }else if (ptp_priv->hwts_tx_type ==HWTSTAMP_TX_ON ) { +lanphy_write_page_reg (ptp_priv->phydev,5 ,PTP_TX_MOD , + tx_mod & ~PTP_TX_MOD_TX_PTP_SYNC_TS_INSERT_ ); + }if (config.rx_filter !=HWTSTAMP_FILTER_NONE )lan8814_config_ts_intr (ptp_priv->phydev, true);
@@ -2297,7 +2303,7 @@ static void lan8814_txtstamp(struct mii_timestamper *mii_ts, } } -static void lan8814_get_sig_rx (struct sk_buff *skb,u16 *sig) +static bool lan8814_get_sig_rx (struct sk_buff *skb,u16 *sig) {struct ptp_header *ptp_header;u32 type;
@@ -2307,7 +2313,11 @@ static void lan8814_get_sig_rx(struct sk_buff *skb, u16 *sig) ptp_header =ptp_parse_header (skb, type);skb_pull_inline (skb,ETH_HLEN ); +if (!ptp_header) +return false; + *sig = (__force u16)(ntohs (ptp_header->sequence_id)); +return true; } static bool lan8814_match_rx_ts(struct kszphy_ptp_priv *ptp_priv,
@@ -2319,7 +2329,8 @@ static bool lan8814_match_rx_ts(struct kszphy_ptp_priv *ptp_priv,bool ret = false;u16 skb_sig; -lan8814_get_sig_rx (skb, &skb_sig); +if (!lan8814_get_sig_rx (skb, &skb_sig)) +return ret;/* Iterate over all RX timestamps and match it with the received skbs */ spin_lock_irqsave (&ptp_priv->rx_ts_lock, flags);
@@ -2599,7 +2610,7 @@ static int lan8814_ptpci_adjfine(struct ptp_clock_info *ptpci, long scaled_ppm)return 0 ; } -static void lan8814_get_sig_tx (struct sk_buff *skb,u16 *sig) +static bool lan8814_get_sig_tx (struct sk_buff *skb,u16 *sig) {struct ptp_header *ptp_header;u32 type;
@@ -2607,7 +2618,11 @@ static void lan8814_get_sig_tx(struct sk_buff *skb, u16 *sig) type =ptp_classify_raw (skb); ptp_header =ptp_parse_header (skb, type); +if (!ptp_header) +return false; + *sig = (__force u16)(ntohs (ptp_header->sequence_id)); +return true; }static void lan8814_dequeue_tx_skb (struct kszphy_ptp_priv *ptp_priv)
@@ -2625,7 +2640,8 @@ static void lan8814_dequeue_tx_skb(struct kszphy_ptp_priv *ptp_priv)spin_lock_irqsave (&ptp_priv->tx_queue.lock, flags); skb_queue_walk_safe(&ptp_priv->tx_queue, skb, skb_tmp) { -lan8814_get_sig_tx (skb, &skb_sig); +if (!lan8814_get_sig_tx (skb, &skb_sig)) +continue ;if (memcmp (&skb_sig, &seq_id,sizeof (seq_id)))continue ;
@@ -2669,7 +2685,8 @@ static bool lan8814_match_skb(struct kszphy_ptp_priv *ptp_priv,spin_lock_irqsave (&ptp_priv->rx_queue.lock, flags); skb_queue_walk_safe(&ptp_priv->rx_queue, skb, skb_tmp) { -lan8814_get_sig_rx (skb, &skb_sig); +if (!lan8814_get_sig_rx (skb, &skb_sig)) +continue ;if (memcmp (&skb_sig, &rx_ts->seq_id,sizeof (rx_ts->seq_id)))continue ;
drivers/net/usb/asix_devices.c +2 -2
@@ -714,7 +714,7 @@ static int ax88772_init_phy(struct usbnet *dev) }phy_suspend (priv->phydev); - priv->phydev->mac_managed_pm =1 ; + priv->phydev->mac_managed_pm = true;phy_attached_info (priv->phydev);
@@ -734,7 +734,7 @@ static int ax88772_init_phy(struct usbnet *dev)return -ENODEV ; } - priv->phydev_int->mac_managed_pm =1 ; + priv->phydev_int->mac_managed_pm = true;phy_suspend (priv->phydev_int);return 0 ;
drivers/net/usb/ax88179_178a.c +2 -0
@@ -1273,6 +1273,8 @@ static void ax88179_get_mac_addr(struct usbnet *dev)if (is_valid_ether_addr (mac)) {eth_hw_addr_set (dev->net, mac); +if (!is_local_ether_addr (mac)) + dev->net->addr_assign_type =NET_ADDR_PERM ; }else {netdev_info (dev->net,"invalid MAC address, using random\n" );eth_hw_addr_random (dev->net);
drivers/net/wireless/intel/iwlwifi/mvm/rfi.c +6 -2
@@ -122,14 +122,18 @@ struct iwl_rfi_freq_table_resp_cmd *iwl_rfi_get_freq_table(struct iwl_mvm *mvm)if (ret)return ERR_PTR (ret); -if (WARN_ON_ONCE (iwl_rx_packet_payload_len (cmd.resp_pkt) != resp_size)) +if (WARN_ON_ONCE (iwl_rx_packet_payload_len (cmd.resp_pkt) != + resp_size)) { +iwl_free_resp (&cmd);return ERR_PTR (-EIO ); + } resp =kmemdup (cmd.resp_pkt->data, resp_size,GFP_KERNEL ); +iwl_free_resp (&cmd); +if (!resp)return ERR_PTR (-ENOMEM ); -iwl_free_resp (&cmd);return resp; }
drivers/net/wwan/t7xx/t7xx_cldma.c +2 -2
@@ -106,7 +106,7 @@ bool t7xx_cldma_tx_addr_is_set(struct t7xx_cldma_hw *hw_info, unsigned int qno) {u32 offset =REG_CLDMA_UL_START_ADDRL_0 + qno *ADDR_SIZE ; -return ioread64 (hw_info->ap_pdn_base + offset); +return ioread64_lo_hi (hw_info->ap_pdn_base + offset); } void t7xx_cldma_hw_set_start_addr(struct t7xx_cldma_hw *hw_info, unsigned int qno, u64 address,
@@ -117,7 +117,7 @@ void t7xx_cldma_hw_set_start_addr(struct t7xx_cldma_hw *hw_info, unsigned int qn reg = tx_rx ==MTK_RX ? hw_info->ap_ao_base +REG_CLDMA_DL_START_ADDRL_0 : hw_info->ap_pdn_base +REG_CLDMA_UL_START_ADDRL_0 ; -iowrite64 (address, reg + offset); +iowrite64_lo_hi (address, reg + offset); } void t7xx_cldma_hw_resume_queue(struct t7xx_cldma_hw *hw_info, unsigned int qno,
drivers/net/wwan/t7xx/t7xx_hif_cldma.c +5 -4
@@ -139,8 +139,9 @@ static int t7xx_cldma_gpd_rx_from_q(struct cldma_queue *queue, int budget, boolreturn -ENODEV ; } - gpd_addr =ioread64 (hw_info->ap_pdn_base +REG_CLDMA_DL_CURRENT_ADDRL_0 + - queue->index *sizeof (u64)); + gpd_addr =ioread64_lo_hi (hw_info->ap_pdn_base + +REG_CLDMA_DL_CURRENT_ADDRL_0 + + queue->index *sizeof (u64));if (req->gpd_addr == gpd_addr || hwo_polling_count++ >=100 )return 0 ;
@@ -318,8 +319,8 @@ static void t7xx_cldma_txq_empty_hndl(struct cldma_queue *queue)struct t7xx_cldma_hw *hw_info = &md_ctrl->hw_info;/* Check current processing TGPD, 64-bit address is in a table by Q index */ - ul_curr_addr =ioread64 (hw_info->ap_pdn_base +REG_CLDMA_UL_CURRENT_ADDRL_0 + - queue->index *sizeof (u64)); + ul_curr_addr =ioread64_lo_hi (hw_info->ap_pdn_base +REG_CLDMA_UL_CURRENT_ADDRL_0 + + queue->index *sizeof (u64));if (req->gpd_addr != ul_curr_addr) {spin_unlock_irqrestore (&md_ctrl->cldma_lock, flags); dev_err(md_ctrl->dev, "CLDMA%d queue %d is not empty\n",
drivers/net/wwan/t7xx/t7xx_pcie_mac.c +4 -4
@@ -75,7 +75,7 @@ static void t7xx_pcie_mac_atr_tables_dis(void __iomem *pbase, enum t7xx_atr_src_for (i =0 ; i <ATR_TABLE_NUM_PER_ATR ; i++) { offset =ATR_PORT_OFFSET * port +ATR_TABLE_OFFSET * i; reg = pbase +ATR_PCIE_WIN0_T0_ATR_PARAM_SRC_ADDR + offset; -iowrite64 (0 , reg); +iowrite64_lo_hi (0 , reg); } }
@@ -112,17 +112,17 @@ static int t7xx_pcie_mac_atr_cfg(struct t7xx_pci_dev *t7xx_dev, struct t7xx_atr_ reg = pbase +ATR_PCIE_WIN0_T0_TRSL_ADDR + offset; value = cfg->trsl_addr &ATR_PCIE_WIN0_ADDR_ALGMT ; -iowrite64 (value, reg); +iowrite64_lo_hi (value, reg); reg = pbase +ATR_PCIE_WIN0_T0_TRSL_PARAM + offset;iowrite32 (cfg->trsl_id, reg); reg = pbase +ATR_PCIE_WIN0_T0_ATR_PARAM_SRC_ADDR + offset; value = (cfg->src_addr &ATR_PCIE_WIN0_ADDR_ALGMT ) | (atr_size <<1 ) |BIT (0 ); -iowrite64 (value, reg); +iowrite64_lo_hi (value, reg);/* Ensure ATR is set */ -ioread64 (reg); +ioread64_lo_hi (reg);return 0 ; }
drivers/net/xen-netfront.c +1 -0
@@ -285,6 +285,7 @@ static struct sk_buff *xennet_alloc_one_rx_buffer(struct netfront_queue *queue)return NULL ; }skb_add_rx_frag (skb,0 , page,0 ,0 ,PAGE_SIZE ); +skb_mark_for_recycle (skb);/* Align ip header to a 16 bytes boundary */ skb_reserve (skb,NET_IP_ALIGN );
drivers/nvme/host/core.c +3 -1
@@ -1151,7 +1151,7 @@ static u32 nvme_passthru_start(struct nvme_ctrl *ctrl, struct nvme_ns *ns,return effects; } -void nvme_passthru_end (struct nvme_ctrl *ctrl,u32 effects, +void nvme_passthru_end (struct nvme_ctrl *ctrl,struct nvme_ns *ns,u32 effects,struct nvme_command *cmd,int status) {if (effects &NVME_CMD_EFFECTS_CSE_MASK ) {
@@ -1167,6 +1167,8 @@ void nvme_passthru_end(struct nvme_ctrl *ctrl, u32 effects,nvme_queue_scan (ctrl);flush_work (&ctrl->scan_work); } +if (ns) +return ;switch (cmd->common.opcode) {case nvme_admin_set_features:
drivers/nvme/host/ioctl.c +2 -1
@@ -147,6 +147,7 @@ static int nvme_submit_user_cmd(struct request_queue *q, unsigned bufflen, void __user *meta_buffer, unsigned meta_len, u32 meta_seed, u64 *result, unsigned timeout, bool vec) { + struct nvme_ns *ns = q->queuedata;struct nvme_ctrl *ctrl;struct request *req;void *meta =NULL ;
@@ -181,7 +182,7 @@ static int nvme_submit_user_cmd(struct request_queue *q,blk_mq_free_request (req);if (effects) -nvme_passthru_end (ctrl, effects, cmd, ret); +nvme_passthru_end (ctrl, ns, effects, cmd, ret);return ret; }
drivers/nvme/host/nvme.h +1 -1
@@ -1063,7 +1063,7 @@ static inline void nvme_auth_free(struct nvme_ctrl *ctrl) {};u32 nvme_command_effects (struct nvme_ctrl *ctrl,struct nvme_ns *ns,u8 opcode);int nvme_execute_passthru_rq (struct request *rq,u32 *effects); -void nvme_passthru_end (struct nvme_ctrl *ctrl,u32 effects, +void nvme_passthru_end (struct nvme_ctrl *ctrl,struct nvme_ns *ns,u32 effects,struct nvme_command *cmd,int status);
Lines of this file are not shown. View the raw message.
fs/smb/client/file.c +95 -16
111 lines not on this page · raw message
net/bluetooth/hci_debugfs.c +32 -16
48 lines not on this page · raw message
net/ipv4/inet_fragment.c +57 -13
70 lines not on this page · raw message
net/ipv6/netfilter/nf_conntrack_reasm.c +1 -1
Lines of this file are not shown. View the raw message.
tools/testing/selftests/net/mptcp/mptcp_connect.sh +7 -0
Lines of this file are not shown. View the raw message.
tools/testing/selftests/net/mptcp/mptcp_join.sh +5 -2
Lines of this file are not shown. View the raw message.
tools/testing/selftests/net/reuseaddr_conflict.c +1 -1
Lines of this file are not shown. View the raw message.
tools/testing/selftests/net/udpgro_fwd.sh +2 -8
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.