Linux 4.17.9
Greg KH
maintainerI'm announcing the release of the 4.17.9 kernel.
All users of the 4.17 kernel series must upgrade.
The updated 4.17.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.17.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Documentation/admin-guide/kernel-parameters.txt | 17 + Makefile | 2 arch/arm/include/asm/kvm_host.h | 12 arch/arm/include/asm/kvm_mmu.h | 5 arch/arm/net/bpf_jit_32.c | 2 arch/arm64/Kconfig | 9 arch/arm64/include/asm/cpucaps.h | 3 arch/arm64/include/asm/cpufeature.h | 22 + arch/arm64/include/asm/kvm_asm.h | 30 ++ arch/arm64/include/asm/kvm_host.h | 26 + arch/arm64/include/asm/kvm_mmu.h | 24 + arch/arm64/include/asm/thread_info.h | 1 arch/arm64/kernel/Makefile | 1 arch/arm64/kernel/asm-offsets.c | 1 arch/arm64/kernel/cpu_errata.c | 180 +++++++++++++ arch/arm64/kernel/entry.S | 30 ++ arch/arm64/kernel/hibernate.c | 11 arch/arm64/kernel/ssbd.c | 110 +++++++ arch/arm64/kernel/suspend.c | 8 arch/arm64/kvm/hyp/hyp-entry.S | 38 ++ arch/arm64/kvm/hyp/switch.c | 42 +++ arch/arm64/kvm/reset.c | 4 arch/x86/include/asm/asm.h | 59 ++++ arch/x86/include/asm/irqflags.h | 2 arch/x86/kernel/Makefile | 1 arch/x86/kernel/irqflags.S | 26 + arch/x86/kvm/Kconfig | 2 block/blk-core.c | 4 block/blk-merge.c | 10 crypto/af_alg.c | 4 drivers/atm/zatm.c | 2 drivers/infiniband/hw/mlx5/main.c | 2 drivers/net/ethernet/atheros/alx/main.c | 8 drivers/net/ethernet/cadence/macb_main.c | 2 drivers/net/ethernet/cadence/macb_ptp.c | 5 drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c | 2 drivers/net/ethernet/cisco/enic/enic_main.c | 9 drivers/net/ethernet/huawei/hinic/hinic_rx.c | 1 drivers/net/ethernet/intel/i40e/i40e_txrx.c | 24 + drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 24 + drivers/net/ethernet/marvell/mvneta.c | 2 drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 8 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 12 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 8 drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 2 drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 4 drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 3 drivers/net/ethernet/mellanox/mlx5/core/fw.c | 5 drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.c | 9 drivers/net/ethernet/mellanox/mlx5/core/port.c | 4 drivers/net/ethernet/mellanox/mlx5/core/sriov.c | 7 drivers/net/ethernet/netronome/nfp/bpf/main.c | 3 drivers/net/ethernet/netronome/nfp/flower/match.c | 14 + drivers/net/ethernet/netronome/nfp/flower/offload.c | 11 drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 8 drivers/net/ethernet/qlogic/qed/qed_dev.c | 2 drivers/net/ethernet/qlogic/qed/qed_main.c | 8 drivers/net/ethernet/qlogic/qed/qed_sriov.c | 19 + drivers/net/ethernet/qlogic/qede/qede_ptp.c | 10 drivers/net/ethernet/sfc/farch.c | 1 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 10 drivers/net/ethernet/sun/sungem.c | 22 - drivers/net/geneve.c | 2 drivers/net/hyperv/hyperv_net.h | 2 drivers/net/hyperv/netvsc.c | 37 ++ drivers/net/hyperv/netvsc_drv.c | 17 + drivers/net/hyperv/rndis_filter.c | 61 ---- drivers/net/ipvlan/ipvlan_main.c | 3 drivers/net/usb/lan78xx.c | 5 drivers/net/usb/qmi_wwan.c | 1 drivers/net/usb/r8152.c | 3 drivers/net/virtio_net.c | 30 +- drivers/net/vxlan.c | 4 drivers/net/wireless/realtek/rtlwifi/base.c | 17 - drivers/net/wireless/realtek/rtlwifi/base.h | 2 drivers/net/wireless/realtek/rtlwifi/core.c | 3 drivers/net/wireless/realtek/rtlwifi/pci.c | 2 drivers/net/wireless/realtek/rtlwifi/ps.c | 4 drivers/net/wireless/realtek/rtlwifi/usb.c | 2 drivers/net/xen-netfront.c | 11 drivers/pci/host/pci-hyperv.c | 8 drivers/pinctrl/mediatek/pinctrl-mt7622.c | 25 + drivers/pinctrl/sh-pfc/pfc-r8a77970.c | 12 drivers/s390/net/qeth_core.h | 11 drivers/s390/net/qeth_core_main.c | 24 + drivers/s390/net/qeth_l2_main.c | 19 - drivers/vhost/net.c | 3 fs/autofs4/dev-ioctl.c | 22 - fs/reiserfs/prints.c | 141 +++++----- include/linux/arm-smccc.h | 10 include/linux/atmdev.h | 15 + include/linux/backing-dev-defs.h | 2 include/linux/blk_types.h | 2 include/linux/compiler-gcc.h | 29 +- include/linux/filter.h | 42 --- include/linux/mlx5/eswitch.h | 2 include/linux/mlx5/mlx5_ifc.h | 2 include/linux/netdevice.h | 20 + include/net/pkt_cls.h | 5 kernel/bpf/core.c | 25 + kernel/bpf/sockmap.c | 63 +++- kernel/bpf/syscall.c | 4 kernel/bpf/verifier.c | 11 mm/backing-dev.c | 20 - net/8021q/vlan.c | 2 net/atm/br2684.c | 3 net/atm/clip.c | 3 net/atm/common.c | 3 net/atm/lec.c | 3 net/atm/mpc.c | 3 net/atm/pppoatm.c | 3 net/atm/raw.c | 4 net/bridge/netfilter/ebtables.c | 13 net/core/dev_ioctl.c | 11 net/dccp/ccids/ccid3.c | 16 - net/dns_resolver/dns_key.c | 28 +- net/ipv4/fou.c | 4 net/ipv4/gre_offload.c | 2 net/ipv4/inet_hashtables.c | 4 net/ipv4/sysctl_net_ipv4.c | 18 - net/ipv4/tcp_input.c | 9 net/ipv4/udp_offload.c | 2 net/ipv6/inet6_hashtables.c | 4 net/ipv6/netfilter/nf_conntrack_reasm.c | 2 net/ipv6/seg6_hmac.c | 2 net/netfilter/ipvs/ip_vs_lblc.c | 1 net/netfilter/ipvs/ip_vs_lblcr.c | 1 net/nfc/llcp_commands.c | 9 net/nsh/nsh.c | 2 net/packet/af_packet.c | 16 - net/rds/loop.c | 1 net/rds/rds.h | 5 net/rds/recv.c | 5 net/sched/act_ife.c | 12 net/sched/sch_blackhole.c | 2 net/strparser/strparser.c | 17 - net/tls/tls_sw.c | 2 net/vmw_vsock/virtio_transport.c | 2 virt/kvm/arm/arm.c | 4 virt/kvm/arm/psci.c | 18 + 140 files changed, 1447 insertions(+), 449 deletions(-)
Aleksander Morgado (1):
qmi_wwan: add support for the Dell Wireless 5821e module
Alex Vesker (2):
net/mlx5: Fix command interface race in polling mode net/mlx5: Fix incorrect raw command length parsing
Alexandre Belloni (1):
net: macb: initialize bp->queues[0].bp for at91rm9200
Antoine Tenart (1):
net: mvneta: fix the Rx desc DMA address in the Rx path
Bert Kenward (1):
sfc: correctly initialise filter rwsem for farch
Bhadram Varka (1):
stmmac: fix DMA channel hang in half-duplex mode
Claudio Imbrenda (1):
VSOCK: fix loopback on big-endian systems
Cong Wang (3):
net: use dev_change_tx_queue_len() for SIOCSIFTXQLEN
ipvs: initialize tbl->entries after allocation
ipvs: initialize tbl->entries in ip_vs_lblc_init_svc()Daniel Borkmann (4):
bpf: reject any prog that failed read-only lock
bpf: don't leave partial mangled prog in jit_subprogs error path bpf, arm32: fix to use bpf_jit_binary_lock_ro api
bpf: undo prog rejection on read-only lock failure
Dave Watson (1):
tls: Stricter error checking in zerocopy sendmsg path
David Ahern (1):
net/tcp: Fix socket lookups with SO_BINDTODEVICE
David Woodhouse (1):
atm: Preserve value of skb->truesize when accounting to vcc
Davide Caratti (2):
net/sched: act_ife: fix recursive lock and idr leak net/sched: act_ife: preserve the action control in case of error
Dexuan Cui (1):
PCI: hv: Disable/enable IRQs rather than BH in hv_compose_msi_msg()
Doron Roberts-Kedes (1):
strparser: Remove early eaten to fix full tcp receive buffer stall
Eli Cohen (1):
net/mlx5: Fix required capability for manipulating MPFS
Eric Biggers (3):
ipv6: sr: fix passing wrong flags to crypto_alloc_shash()
reiserfs: fix buffer overflow with long warning messages
KEYS: DNS: fix parsing multiple options
Eric Dumazet (5):
net: dccp: avoid crash in ccid3_hc_rx_send_feedback()
net: dccp: switch rx_tstamp_last_feedback to monotonic clock net/packet: fix use-after-free
net: sungem: fix rx checksum support
bpf: enforce correct alignment for instructions
Florian Westphal (2):
netfilter: ebtables: reject non-bridge targets
netfilter: ipv6: nf_defrag: drop skb dst before queueing
Govindarajulu Varadarajan (1):
enic: do not overwrite error code
Greg Kroah-Hartman (1):
Linux 4.17.9
Gustavo A. R. Silva (2):
atm: zatm: Fix potential Spectre v1
net: cxgb3_main: fix potential Spectre v1
H. Peter Anvin (1):
x86/asm: Add _ASM_ARG* constants for argument registers to <asm/asm.h>
Harini Katakam (1):
net: macb: Fix ptp time adjustment for large negative delta
Ilpo Järvinen (1):
tcp: prevent bogus FRTO undos with non-SACK flows
Jan Kara (1):
bdi: Fix another oops in wb_workfn()
Janakarajan Natarajan (1):
x86/kvm/Kconfig: Ensure CRYPTO_DEV_CCP_DD state at minimum matches KVM_AMD
Jason Wang (1):
vhost_net: validate sock before trying to put its fd
Jens Axboe (1):
block: don't use blocking queue entered for recursive bio submits
Jesper Dangaard Brouer (3):
ixgbe: split XDP_TX tail and XDP_REDIRECT map flushing
i40e: split XDP_TX tail and XDP_REDIRECT map flushing
virtio_net: split XDP_TX kick and XDP_REDIRECT map flushing
Jiri Slaby (1):
r8152: napi hangup fix after disconnect
John Fastabend (2):
bpf: sockmap, fix crash when ipv6 sock is added
bpf: sockmap, consume_skb in close path
John Hurley (1):
nfp: reject binding to shared blocks
Julian Wiedmann (3):
s390/qeth: don't clobber buffer on async TX completion Revert "s390/qeth: use Read device to query hypervisor for MAC" s390/qeth: fix race when setting MAC address
Konstantin Khlebnikov (1):
net_sched: blackhole: tell upper qdisc about dropped packets
Marc Zyngier (14):
arm/arm64: smccc: Add SMCCC-specific return codes
arm64: Call ARCH_WORKAROUND_2 on transitions between EL0 and EL1
arm64: Add per-cpu infrastructure to call ARCH_WORKAROUND_2
arm64: Add ARCH_WORKAROUND_2 probing
arm64: Add 'ssbd' command-line option
arm64: ssbd: Add global mitigation state accessor
arm64: ssbd: Skip apply_ssbd if not using dynamic mitigation
arm64: ssbd: Restore mitigation status on CPU resume
arm64: ssbd: Introduce thread flag to control userspace mitigation
arm64: ssbd: Add prctl interface for per-thread mitigation
arm64: KVM: Add HYP per-cpu accessors
arm64: KVM: Add ARCH_WORKAROUND_2 support for guests
arm64: KVM: Handle guest's ARCH_WORKAROUND_2 requests
arm64: KVM: Add ARCH_WORKAROUND_2 discovery through ARCH_FEATURES_FUNC_ID
Nick Desaulniers (2):
compiler-gcc.h: Add __attribute__((gnu_inline)) to all inline declarations x86/paravirt: Make native_save_fl() extern inline
Niklas Söderlund (1):
pinctrl: sh-pfc: r8a77970: remove SH_PFC_PIN_CFG_DRIVE_STRENGTH flag
Or Gerlitz (4):
net/mlx5e: Avoid dealing with vport representors if not being e-switch manager net/mlx5e: Don't attempt to dereference the ppriv struct if not being eswitch manager net/mlx5: E-Switch, Avoid setup attempt if not being e-switch manager IB/mlx5: Avoid dealing with vport representors if not being e-switch manager
Pieter Jansen van Vuuren (1):
nfp: flower: fix mpls ether type detection
Ping-Ke Shih (2):
rtlwifi: Fix kernel Oops "Fw download fail!!"
rtlwifi: rtl8821ae: fix firmware is not ready to run
Ross Lagerwall (2):
xen-netfront: Fix mismatched rtnl_unlock
xen-netfront: Update features after registering netdev
Sabrina Dubroca (2):
alx: take rtnl before calling __alx_open from resume
net: fix use-after-free in GRO with ESP
Santosh Shilimkar (1):
rds: avoid unenecessary cong_update in loop transport
Sean Wang (3):
pinctrl: mt7622: fix error path on failing at groups building
pinctrl: mt7622: stop using the deprecated pinctrl_add_gpio_range
pinctrl: mt7622: fix a kernel panic when gpio-hog is being applied
Shay Agroskin (1):
net/mlx5: Fix wrong size allocation for QoS ETC TC regitster
Stefan Wahren (1):
net: lan78xx: Fix race in tx pending skb size calculation
Stephan Mueller (1):
crypto: af_alg - Initialize sg_num_bytes in error code path
Stephen Hemminger (1):
hv_netvsc: split sub-channel setup into async and sync
Sudarsana Reddy Kalluru (4):
qede: Adverstise software timestamp caps when PHC is not available.
qed: Fix setting of incorrect eswitch mode.
qed: Fix use of incorrect size in memcpy call.
qed: Limit msix vectors in kdump kernel to the minimum required count.
Tetsuo Handa (1):
net/nfc: Avoid stalls when nfc_alloc_send_skb() returned NULL.
Tomas Bortoli (1):
autofs: fix slab out of bounds read in getname_kernel()
Vasily Gorbik (1):
s390/qeth: avoid using is_multicast_ether_addr_64bits on (u8 *)[6]
Wei Yongjun (1):
hinic: reset irq affinity before freeing irq
Willem de Bruijn (1):
nsh: set mac len based on inner packet
Xin Long (1):
ipvlan: fix IFLA_MTU ignored on NEWLINK
Yuchung Cheng (1):
tcp: fix Fast Open key endianness
Greg KH
maintainerDocumentation/admin-guide/kernel-parameters.txt +17 -0
@@ -4092,6 +4092,23 @@ expediting. Set to zero to disable automatic expediting. + ssbd= [ARM64,HW] + Speculative Store Bypass Disable control + + On CPUs that are vulnerable to the Speculative + Store Bypass vulnerability and offer a + firmware based mitigation, this parameter + indicates how the mitigation should be used: + + force-on: Unconditionally enable mitigation for + for both kernel and userspace + force-off: Unconditionally disable mitigation for + for both kernel and userspace + kernel: Always enable mitigation in the + kernel, and offer a prctl interface + to allow userspace to register its + interest in being mitigated too. + stack_guard_gap= [MM] override the default stack gap protection. The value is in page units and it defines how many pages prior
Makefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 17 -SUBLEVEL = 8 +SUBLEVEL = 9 EXTRAVERSION = NAME = Merciless Moray
arch/arm/include/asm/kvm_host.h +12 -0
@@ -315,6 +315,18 @@ static inline bool kvm_arm_harden_branch_predictor(void)return false; } +#define KVM_SSBD_UNKNOWN -1 +#define KVM_SSBD_FORCE_DISABLE 0 +#define KVM_SSBD_KERNEL 1 +#define KVM_SSBD_FORCE_ENABLE 2 +#define KVM_SSBD_MITIGATED 3 + +static inline int kvm_arm_have_ssbd (void ) +{ +/* No way to detect it yet, pretend it is not there. */ +return KVM_SSBD_UNKNOWN ; +} +static inline void kvm_vcpu_load_sysregs (struct kvm_vcpu *vcpu) {}static inline void kvm_vcpu_put_sysregs (struct kvm_vcpu *vcpu) {}
arch/arm/include/asm/kvm_mmu.h +5 -0
@@ -335,6 +335,11 @@ static inline int kvm_map_vectors(void) return 0; } +static inline int hyp_map_aux_data (void ) +{ +return 0 ; +} +#define kvm_phys_to_vttbr (addr) (addr)#endif /* !__ASSEMBLY__ */
arch/arm/net/bpf_jit_32.c +1 -1
@@ -1928,7 +1928,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)/* there are 2 passes here */ bpf_jit_dump (prog->len, image_size,2 , ctx.target); -set_memory_ro ((unsigned long )header, header->pages); +bpf_jit_binary_lock_ro (header); prog->bpf_func = (void *)ctx.target; prog->jited =1 ; prog->jited_len = image_size;
arch/arm64/Kconfig +9 -0
@@ -938,6 +938,15 @@ config HARDEN_EL2_VECTORS If unsure, say Y. +config ARM64_SSBD + bool "Speculative Store Bypass Disable" if EXPERT + default y + help + This enables mitigation of the bypassing of previous stores + by speculative loads. + + If unsure, say Y. + menuconfig ARMV8_DEPRECATED bool "Emulate deprecated/obsolete ARMv8 instructions" depends on COMPAT
arch/arm64/include/asm/cpucaps.h +2 -1
@@ -48,7 +48,8 @@#define ARM64_HAS_CACHE_IDC 27#define ARM64_HAS_CACHE_DIC 28#define ARM64_HW_DBM 29 +#define ARM64_SSBD 30 -#define ARM64_NCAPS 30 +#define ARM64_NCAPS 31#endif /* __ASM_CPUCAPS_H */
arch/arm64/include/asm/cpufeature.h +22 -0
@@ -537,6 +537,28 @@ static inline u64 read_zcr_features(void)return zcr; } +#define ARM64_SSBD_UNKNOWN -1 +#define ARM64_SSBD_FORCE_DISABLE 0 +#define ARM64_SSBD_KERNEL 1 +#define ARM64_SSBD_FORCE_ENABLE 2 +#define ARM64_SSBD_MITIGATED 3 + +static inline int arm64_get_ssbd_state (void ) +{ +#ifdef CONFIG_ARM64_SSBD +extern int ssbd_state; +return ssbd_state; +#else +return ARM64_SSBD_UNKNOWN ; +#endif +} + +#ifdef CONFIG_ARM64_SSBD +void arm64_set_ssbd_mitigation (bool state); +#else +static inline void arm64_set_ssbd_mitigation (bool state) {} +#endif +#endif /* __ASSEMBLY__ */ #endif
arch/arm64/include/asm/kvm_asm.h +28 -2
@@ -33,6 +33,9 @@#define KVM_ARM64_DEBUG_DIRTY_SHIFT 0#define KVM_ARM64_DEBUG_DIRTY (1 << KVM_ARM64_DEBUG_DIRTY_SHIFT) +#define VCPU_WORKAROUND_2_FLAG_SHIFT 0 +#define VCPU_WORKAROUND_2_FLAG (_AC(1, UL) << VCPU_WORKAROUND_2_FLAG_SHIFT) +/* Translate a kernel address of @sym into its equivalent linear mapping */ #define kvm_ksym_ref (sym) \ ({ \
@@ -71,14 +74,37 @@ extern u32 __kvm_get_mdcr_el2(void);extern u32 __init_stage2_translation (void ); +/* Home-grown __this_cpu_{ptr,read} variants that always work at HYP */ +#define __hyp_this_cpu_ptr (sym) \ + ({ \ + void *__ptr = hyp_symbol_addr(sym); \ + __ptr += read_sysreg(tpidr_el2); \ + (typeof(&sym))__ptr; \ + }) + +#define __hyp_this_cpu_read (sym) \ + ({ \ + *__hyp_this_cpu_ptr(sym); \ + }) +#else /* __ASSEMBLY__ */ -.macro get_host_ctxt reg, tmp - adr_l \reg, kvm_host_cpu_state +.macro hyp_adr_this_cpu reg, sym, tmp + adr_l \reg, \sym mrs \tmp, tpidr_el2 add \reg, \reg, \tmp .endm +.macro hyp_ldr_this_cpu reg, sym, tmp + adr_l \reg, \sym + mrs \tmp, tpidr_el2 + ldr \reg, [\reg, \tmp] +.endm + +.macro get_host_ctxt reg, tmp + hyp_adr_this_cpu \reg, kvm_host_cpu_state, \tmp +.endm + .macro get_vcpu_ptr vcpu, ctxt get_host_ctxt \ctxt, \vcpu ldr \vcpu, [\ctxt, #HOST_CONTEXT_VCPU]
arch/arm64/include/asm/kvm_host.h +26 -0
@@ -216,6 +216,9 @@ struct kvm_vcpu_arch {/* Exception Information */ struct kvm_vcpu_fault_info fault; +/* State of various workarounds, see kvm_asm.h for bit assignment */ +u64 workaround_flags; +/* Guest debug state */ u64 debug_flags;
@@ -452,6 +455,29 @@ static inline bool kvm_arm_harden_branch_predictor(void)return cpus_have_const_cap (ARM64_HARDEN_BRANCH_PREDICTOR ); } +#define KVM_SSBD_UNKNOWN -1 +#define KVM_SSBD_FORCE_DISABLE 0 +#define KVM_SSBD_KERNEL 1 +#define KVM_SSBD_FORCE_ENABLE 2 +#define KVM_SSBD_MITIGATED 3 + +static inline int kvm_arm_have_ssbd (void ) +{ +switch (arm64_get_ssbd_state ()) { +case ARM64_SSBD_FORCE_DISABLE : +return KVM_SSBD_FORCE_DISABLE ; +case ARM64_SSBD_KERNEL : +return KVM_SSBD_KERNEL ; +case ARM64_SSBD_FORCE_ENABLE : +return KVM_SSBD_FORCE_ENABLE ; +case ARM64_SSBD_MITIGATED : +return KVM_SSBD_MITIGATED ; +case ARM64_SSBD_UNKNOWN : +default : +return KVM_SSBD_UNKNOWN ; + } +} +void kvm_vcpu_load_sysregs (struct kvm_vcpu *vcpu);void kvm_vcpu_put_sysregs (struct kvm_vcpu *vcpu);
arch/arm64/include/asm/kvm_mmu.h +24 -0
@@ -473,6 +473,30 @@ static inline int kvm_map_vectors(void) }#endif +#ifdef CONFIG_ARM64_SSBD +DECLARE_PER_CPU_READ_MOSTLY (u64, arm64_ssbd_callback_required); + +static inline int hyp_map_aux_data (void ) +{ +int cpu, err; + +for_each_possible_cpu (cpu) { +u64 *ptr; + + ptr =per_cpu_ptr (&arm64_ssbd_callback_required, cpu); + err =create_hyp_mappings (ptr, ptr +1 ,PAGE_HYP ); +if (err) +return err; + } +return 0 ; +} +#else +static inline int hyp_map_aux_data (void ) +{ +return 0 ; +} +#endif +#define kvm_phys_to_vttbr (addr) phys_to_ttbr(addr)#endif /* __ASSEMBLY__ */
arch/arm64/include/asm/thread_info.h +1 -0
@@ -94,6 +94,7 @@ void arch_release_task_struct(struct task_struct *tsk);#define TIF_32BIT 22/* 32bit process */ #define TIF_SVE 23/* Scalable Vector Extension in use */ #define TIF_SVE_VL_INHERIT 24/* Inherit sve_vl_onexec across exec */ +#define TIF_SSBD 25/* Wants SSB mitigation */ #define _TIF_SIGPENDING (1 << TIF_SIGPENDING)#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
arch/arm64/kernel/Makefile +1 -0
@@ -54,6 +54,7 @@ arm64-obj-$(CONFIG_ARM64_RELOC_TEST) += arm64-reloc-test.o arm64-reloc-test-y := reloc_test_core.o reloc_test_syms.o arm64-obj-$(CONFIG_CRASH_DUMP) += crash_dump.o arm64-obj-$(CONFIG_ARM_SDE_INTERFACE) += sdei.o +arm64-obj-$(CONFIG_ARM64_SSBD) += ssbd.o obj-y += $(arm64-obj-y) vdso/ probes/ obj-m += $(arm64-obj-m)
arch/arm64/kernel/asm-offsets.c +1 -0
@@ -136,6 +136,7 @@ int main(void)#ifdef CONFIG_KVM_ARM_HOST DEFINE(VCPU_CONTEXT, offsetof(struct kvm_vcpu, arch.ctxt)); DEFINE(VCPU_FAULT_DISR, offsetof(struct kvm_vcpu, arch.fault.disr_el1)); + DEFINE(VCPU_WORKAROUND_FLAGS, offsetof(struct kvm_vcpu, arch.workaround_flags));DEFINE (CPU_GP_REGS , offsetof(struct kvm_cpu_context , gp_regs));DEFINE (CPU_USER_PT_REGS , offsetof(struct kvm_regs , regs));DEFINE (CPU_FP_REGS , offsetof(struct kvm_regs , fp_regs));
arch/arm64/kernel/cpu_errata.c +180 -0
192 lines not on this page · raw message
arch/arm64/kernel/entry.S +30 -0
@@ -18,6 +18,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <linux/arm-smccc.h> #include <linux/init.h> #include <linux/linkage.h>
@@ -137,6 +138,25 @@ alternative_else_nop_endif add \dst, \dst, #(\sym - .entry.tramp.text) .endm + // This macro corrupts x0-x3. It is the caller's duty + // to save/restore them if required. + .macro apply_ssbd, state, targ, tmp1, tmp2 +#ifdef CONFIG_ARM64_SSBD +alternative_cb arm64_enable_wa2_handling + b \targ +alternative_cb_end + ldr_this_cpu \tmp2, arm64_ssbd_callback_required, \tmp1 + cbz \tmp2, \targ + ldr \tmp2, [tsk, #TSK_TI_FLAGS] + tbnz \tmp2, #TIF_SSBD, \targ + mov w0, #ARM_SMCCC_ARCH_WORKAROUND_2 + mov w1, #\state +alternative_cb arm64_update_smccc_conduit + nop // Patched to SMC/HVC #0 +alternative_cb_end +#endif + .endm + .macro kernel_entry, el, regsize = 64 .if \regsize == 32 mov w0, w0 // zero upper 32 bits of x0
@@ -163,6 +183,14 @@ alternative_else_nop_endif ldr x19, [tsk, #TSK_TI_FLAGS] // since we can unmask debug disable_step_tsk x19, x20 // exceptions when scheduling. + apply_ssbd 1, 1f, x22, x23 + +#ifdef CONFIG_ARM64_SSBD + ldp x0, x1, [sp, #16 * 0] + ldp x2, x3, [sp, #16 * 1] +#endif +1: + mov x29, xzr // fp pointed to user-space .else add x21, sp, #S_FRAME_SIZE
@@ -303,6 +331,8 @@ alternative_if ARM64_WORKAROUND_845719 alternative_else_nop_endif #endif 3: + apply_ssbd 0, 5f, x0, x1 +5: .endif msr elr_el1, x21 // set up the return data
arch/arm64/kernel/hibernate.c +11 -0
@@ -313,6 +313,17 @@ int swsusp_arch_suspend(void) sleep_cpu = -EINVAL ;__cpu_suspend_exit (); + +/* +* Just in case the boot kernel did turn the SSBD +* mitigation off behind our back, let's set the state +* to what we expect it to be. +*/ +switch (arm64_get_ssbd_state ()) { +case ARM64_SSBD_FORCE_ENABLE : +case ARM64_SSBD_KERNEL : +arm64_set_ssbd_mitigation (true); + } }local_daif_restore (flags);
arch/arm64/kernel/ssbd.c new file +110 -0
110 lines not on this page · raw message
arch/arm64/kernel/suspend.c +8 -0
@@ -62,6 +62,14 @@ void notrace __cpu_suspend_exit(void)*/ if (hw_breakpoint_restore)hw_breakpoint_restore (cpu); + +/* +* On resume, firmware implementing dynamic mitigation will +* have turned the mitigation on. If the user has forcefully +* disabled it, make sure their wishes are obeyed. +*/ +if (arm64_get_ssbd_state () ==ARM64_SSBD_FORCE_DISABLE ) +arm64_set_ssbd_mitigation (false); }/*
arch/arm64/kvm/hyp/hyp-entry.S +37 -1
@@ -106,8 +106,44 @@ el1_hvc_guest: */ ldr x1, [sp] // Guest's x0 eor w1, w1, #ARM_SMCCC_ARCH_WORKAROUND_1 + cbz w1, wa_epilogue + + /* ARM_SMCCC_ARCH_WORKAROUND_2 handling */ + eor w1, w1, #(ARM_SMCCC_ARCH_WORKAROUND_1 ^ \ + ARM_SMCCC_ARCH_WORKAROUND_2) cbnz w1, el1_trap - mov x0, x1 + +#ifdef CONFIG_ARM64_SSBD +alternative_cb arm64_enable_wa2_handling + b wa2_end +alternative_cb_end + get_vcpu_ptr x2, x0 + ldr x0, [x2, #VCPU_WORKAROUND_FLAGS] + + // Sanitize the argument and update the guest flags + ldr x1, [sp, #8] // Guest's x1 + clz w1, w1 // Murphy's device: + lsr w1, w1, #5 // w1 = !!w1 without using + eor w1, w1, #1 // the flags... + bfi x0, x1, #VCPU_WORKAROUND_2_FLAG_SHIFT, #1 + str x0, [x2, #VCPU_WORKAROUND_FLAGS] + + /* Check that we actually need to perform the call */ + hyp_ldr_this_cpu x0, arm64_ssbd_callback_required, x2 + cbz x0, wa2_end + + mov w0, #ARM_SMCCC_ARCH_WORKAROUND_2 + smc #0 + + /* Don't leak data from the SMC call */ + mov x3, xzr +wa2_end: + mov x2, xzr + mov x1, xzr +#endif + +wa_epilogue: + mov x0, xzr add sp, sp, #16 eret
arch/arm64/kvm/hyp/switch.c +42 -0
78 lines not on this page · raw message
arch/arm64/kvm/reset.c +4 -0
@@ -122,6 +122,10 @@ int kvm_reset_vcpu(struct kvm_vcpu *vcpu)/* Reset PMU */ kvm_pmu_vcpu_reset (vcpu); +/* Default workaround setup is enabled (if supported) */ +if (kvm_arm_have_ssbd () ==KVM_SSBD_KERNEL ) + vcpu->arch.workaround_flags |=VCPU_WORKAROUND_2_FLAG ; +/* Reset timer */ return kvm_timer_vcpu_reset (vcpu); }
arch/x86/include/asm/asm.h +59 -0
65 lines not on this page · raw message
arch/x86/include/asm/irqflags.h +1 -1
@@ -13,7 +13,7 @@* Interrupt control: */ -static inline unsigned long native_save_fl (void ) +extern inline unsigned long native_save_fl (void ) {unsigned long flags;
arch/x86/kernel/Makefile +1 -0
@@ -61,6 +61,7 @@ obj-y += alternative.o i8253.o hw_breakpoint.o obj-y += tsc.o tsc_msr.o io_delay.o rtc.o obj-y += pci-iommu_table.o obj-y += resource.o +obj-y += irqflags.o obj-y += process.o obj-y += fpu/
arch/x86/kernel/irqflags.S new file +26 -0
@@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#include <asm/asm.h> +#include <asm/export.h> +#include <linux/linkage.h> + +/* + * unsigned long native_save_fl(void) + */ +ENTRY(native_save_fl) + pushf + pop %_ASM_AX + ret +ENDPROC(native_save_fl) +EXPORT_SYMBOL(native_save_fl) + +/* + * void native_restore_fl(unsigned long flags) + * %eax/%rdi: flags + */ +ENTRY(native_restore_fl) + push %_ASM_ARG1 + popf + ret +ENDPROC(native_restore_fl) +EXPORT_SYMBOL(native_restore_fl)
arch/x86/kvm/Kconfig +1 -1
@@ -85,7 +85,7 @@ config KVM_AMD_SEV def_bool y bool "AMD Secure Encrypted Virtualization (SEV) support" depends on KVM_AMD && X86_64 - depends on CRYPTO_DEV_CCP && CRYPTO_DEV_CCP_DD && CRYPTO_DEV_SP_PSP + depends on CRYPTO_DEV_SP_PSP && !(KVM_AMD=y && CRYPTO_DEV_CCP_DD=m) ---help--- Provides support for launching Encrypted VMs on AMD processors.
block/blk-core.c +3 -1
@@ -2392,7 +2392,9 @@ blk_qc_t generic_make_request(struct bio *bio)if (bio->bi_opf &REQ_NOWAIT ) flags =BLK_MQ_REQ_NOWAIT ; -if (blk_queue_enter (q, flags) <0 ) { +if (bio_flagged (bio,BIO_QUEUE_ENTERED )) +blk_queue_enter_live (q); +else if (blk_queue_enter (q, flags) <0 ) {if (!blk_queue_dying (q) && (bio->bi_opf &REQ_NOWAIT ))bio_wouldblock_error (bio);else
block/blk-merge.c +10 -0
@@ -210,6 +210,16 @@ void blk_queue_split(struct request_queue *q, struct bio **bio)/* there isn't chance to merge the splitted bio */ split->bi_opf |=REQ_NOMERGE ; +/* +* Since we're recursing into make_request here, ensure +* that we mark this bio as already having entered the queue. +* If not, and the queue is going away, we can get stuck +* forever on waiting for the queue reference to drop. But +* that will never happen, as we're already holding a +* reference to it. +*/ +bio_set_flag (*bio,BIO_QUEUE_ENTERED ); +bio_chain (split, *bio);trace_block_split (q, split, (*bio)->bi_iter.bi_sector);generic_make_request (*bio);
crypto/af_alg.c +3 -1
@@ -1156,8 +1156,10 @@ int af_alg_get_rsgl(struct sock *sk, struct msghdr *msg, int flags,/* make one iovec available as scatterlist */ err =af_alg_make_sg (&rsgl->sgl, &msg->msg_iter, seglen); -if (err <0 ) +if (err <0 ) { + rsgl->sg_num_bytes =0 ;return err; + }/* chain the new scatterlist with previous one */ if (areq->last_rsgl)
drivers/atm/zatm.c +2 -0
@@ -1483,6 +1483,8 @@ static int zatm_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg)return -EFAULT ;if (pool <0 || pool >ZATM_LAST_POOL )return -EINVAL ; + pool =array_index_nospec (pool, +ZATM_LAST_POOL +1 );if (copy_from_user (&info, &((struct zatm_pool_req __user *) arg)->info,sizeof (info)))return -EFAULT ;
drivers/infiniband/hw/mlx5/main.c +1 -1
@@ -5736,7 +5736,7 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev) dev->num_ports =max (MLX5_CAP_GEN (mdev, num_ports),MLX5_CAP_GEN (mdev, num_vhca_ports)); -if (MLX5_VPORT_MANAGER (mdev) && +if (MLX5_ESWITCH_MANAGER (mdev) &&mlx5_ib_eswitch_mode (mdev->priv.eswitch) ==SRIOV_OFFLOADS ) { dev->rep =mlx5_ib_vport_rep (mdev->priv.eswitch,0 );
drivers/net/ethernet/atheros/alx/main.c +7 -1
@@ -1897,13 +1897,19 @@ static int alx_resume(struct device *dev)struct pci_dev *pdev =to_pci_dev (dev);struct alx_priv *alx =pci_get_drvdata (pdev);struct alx_hw *hw = &alx->hw; +int err;alx_reset_phy (hw);if (!netif_running (alx->dev))return 0 ;netif_device_attach (alx->dev); -return __alx_open (alx, true); + +rtnl_lock (); + err =__alx_open (alx, true); +rtnl_unlock (); + +return err; } static SIMPLE_DEV_PM_OPS(alx_pm_ops, alx_suspend, alx_resume);
drivers/net/ethernet/cadence/macb_main.c +2 -0
@@ -3732,6 +3732,8 @@ static int at91ether_init(struct platform_device *pdev)int err;u32 reg; + bp->queues[0 ].bp = bp; + dev->netdev_ops = &at91ether_netdev_ops; dev->ethtool_ops = &macb_ethtool_ops;
drivers/net/ethernet/cadence/macb_ptp.c +1 -4
@@ -170,10 +170,7 @@ static int gem_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)if (delta >TSU_NSEC_MAX_VAL ) {gem_tsu_get_time (&bp->ptp_clock_info, &now); -if (sign) - now =timespec64_sub (now, then); -else - now =timespec64_add (now, then); + now =timespec64_add (now, then);gem_tsu_set_time (&bp->ptp_clock_info, (const struct timespec64 *)&now);
drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c +2 -0
@@ -51,6 +51,7 @@#include <linux/sched.h> #include <linux/slab.h> #include <linux/uaccess.h> +#include <linux/nospec.h> #include "common.h" #include "cxgb3_ioctl.h"
@@ -2268,6 +2269,7 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)if (t.qset_idx >= nqsets)return -EINVAL ; + t.qset_idx =array_index_nospec (t.qset_idx, nqsets); q = &adapter->params.sge.qset[q1 + t.qset_idx]; t.rspq_size = q->rspq_size;
drivers/net/ethernet/cisco/enic/enic_main.c +4 -5
@@ -1920,7 +1920,7 @@ static int enic_open(struct net_device *netdev) {struct enic *enic =netdev_priv (netdev);unsigned int i; -int err; +int err, ret; err =enic_request_intr (enic);if (err) {
@@ -1977,10 +1977,9 @@ static int enic_open(struct net_device *netdev) err_out_free_rq:for (i =0 ; i < enic->rq_count; i++) { - err =vnic_rq_disable (&enic->rq[i]); -if (err) -return err; -vnic_rq_clean (&enic->rq[i], enic_free_rq_buf); + ret =vnic_rq_disable (&enic->rq[i]); +if (!ret) +vnic_rq_clean (&enic->rq[i], enic_free_rq_buf); }enic_dev_notify_unset (enic); err_out_free_intr:
drivers/net/ethernet/huawei/hinic/hinic_rx.c +1 -0
@@ -439,6 +439,7 @@ static void rx_free_irq(struct hinic_rxq *rxq) {struct hinic_rq *rq = rxq->rq; +irq_set_affinity_hint (rq->irq,NULL );free_irq (rq->irq, rxq);rx_del_napi (rxq); }
drivers/net/ethernet/intel/i40e/i40e_txrx.c +15 -9
@@ -2199,9 +2199,10 @@ static bool i40e_is_non_eop(struct i40e_ring *rx_ring,return true; } -#define I40E_XDP_PASS 0 -#define I40E_XDP_CONSUMED 1 -#define I40E_XDP_TX 2 +#define I40E_XDP_PASS 0 +#define I40E_XDP_CONSUMED BIT(0) +#define I40E_XDP_TX BIT(1) +#define I40E_XDP_REDIR BIT(2)static int i40e_xmit_xdp_ring (struct xdp_buff *xdp,struct i40e_ring *xdp_ring);
@@ -2235,7 +2236,7 @@ static struct sk_buff *i40e_run_xdp(struct i40e_ring *rx_ring,break ;case XDP_REDIRECT : err =xdp_do_redirect (rx_ring->netdev, xdp, xdp_prog); - result = !err ?I40E_XDP_TX :I40E_XDP_CONSUMED ; + result = !err ?I40E_XDP_REDIR :I40E_XDP_CONSUMED ;break ;default :bpf_warn_invalid_xdp_action (act);
@@ -2298,7 +2299,8 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)unsigned int total_rx_bytes =0 , total_rx_packets =0 ;struct sk_buff *skb = rx_ring->skb;u16 cleaned_count =I40E_DESC_UNUSED (rx_ring); -bool failure = false, xdp_xmit = false; +unsigned int xdp_xmit =0 ; +bool failure = false;struct xdp_buff xdp; xdp.rxq = &rx_ring->xdp_rxq;
@@ -2359,8 +2361,10 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget) }if (IS_ERR (skb)) { -if (PTR_ERR (skb) == -I40E_XDP_TX ) { - xdp_xmit = true; +unsigned int xdp_res = -PTR_ERR (skb); + +if (xdp_res & (I40E_XDP_TX |I40E_XDP_REDIR )) { + xdp_xmit |= xdp_res;i40e_rx_buffer_flip (rx_ring, rx_buffer, size); }else { rx_buffer->pagecnt_bias++;
@@ -2414,12 +2418,14 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget) total_rx_packets++; } -if (xdp_xmit) { +if (xdp_xmit &I40E_XDP_REDIR ) +xdp_do_flush_map (); + +if (xdp_xmit &I40E_XDP_TX ) {struct i40e_ring *xdp_ring = rx_ring->vsi->xdp_rings[rx_ring->queue_index];i40e_xdp_ring_update_tail (xdp_ring); -xdp_do_flush_map (); } rx_ring->skb = skb;
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +14 -10
@@ -2257,9 +2257,10 @@ static struct sk_buff *ixgbe_build_skb(struct ixgbe_ring *rx_ring,return skb; } -#define IXGBE_XDP_PASS 0 -#define IXGBE_XDP_CONSUMED 1 -#define IXGBE_XDP_TX 2 +#define IXGBE_XDP_PASS 0 +#define IXGBE_XDP_CONSUMED BIT(0) +#define IXGBE_XDP_TX BIT(1) +#define IXGBE_XDP_REDIR BIT(2)static int ixgbe_xmit_xdp_ring (struct ixgbe_adapter *adapter,struct xdp_buff *xdp);
@@ -2288,7 +2289,7 @@ static struct sk_buff *ixgbe_run_xdp(struct ixgbe_adapter *adapter,case XDP_REDIRECT : err =xdp_do_redirect (adapter->netdev, xdp, xdp_prog);if (!err) - result =IXGBE_XDP_TX ; + result =IXGBE_XDP_REDIR ;else result =IXGBE_XDP_CONSUMED ;break ;
@@ -2348,7 +2349,7 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,unsigned int mss =0 ;#endif /* IXGBE_FCOE */ u16 cleaned_count =ixgbe_desc_unused (rx_ring); -bool xdp_xmit = false; +unsigned int xdp_xmit =0 ;struct xdp_buff xdp; xdp.rxq = &rx_ring->xdp_rxq;
@@ -2391,8 +2392,10 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, }if (IS_ERR (skb)) { -if (PTR_ERR (skb) == -IXGBE_XDP_TX ) { - xdp_xmit = true; +unsigned int xdp_res = -PTR_ERR (skb); + +if (xdp_res & (IXGBE_XDP_TX |IXGBE_XDP_REDIR )) { + xdp_xmit |= xdp_res;ixgbe_rx_buffer_flip (rx_ring, rx_buffer, size); }else { rx_buffer->pagecnt_bias++;
@@ -2464,7 +2467,10 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, total_rx_packets++; } -if (xdp_xmit) { +if (xdp_xmit &IXGBE_XDP_REDIR ) +xdp_do_flush_map (); + +if (xdp_xmit &IXGBE_XDP_TX ) {struct ixgbe_ring *ring = adapter->xdp_ring[smp_processor_id ()];/* Force memory writes to complete before letting h/w
@@ -2472,8 +2478,6 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,*/ wmb ();writel (ring->next_to_use, ring->tail); - -xdp_do_flush_map (); }u64_stats_update_begin (&rx_ring->syncp);
drivers/net/ethernet/marvell/mvneta.c +1 -1
@@ -1932,7 +1932,7 @@ static int mvneta_rx_swbm(struct mvneta_port *pp, int rx_todo, rx_bytes = rx_desc->data_size - (ETH_FCS_LEN +MVNETA_MH_SIZE ); index = rx_desc - rxq->descs; data = rxq->buf_virt_addr[index]; - phys_addr = rx_desc->buf_phys_addr; + phys_addr = rx_desc->buf_phys_addr - pp->rx_offset_correction;if (!mvneta_rxq_desc_is_first_last (rx_status) || (rx_status &MVNETA_RXD_ERR_SUMMARY )) {
drivers/net/ethernet/mellanox/mlx5/core/cmd.c +4 -4
@@ -803,6 +803,7 @@ static void cmd_work_handler(struct work_struct *work)unsigned long flags;bool poll_cmd = ent->polling;int alloc_ret; +int cmd_mode; sem = ent->page_queue ? &cmd->pages_sem : &cmd->sem;down (sem);
@@ -849,6 +850,7 @@ static void cmd_work_handler(struct work_struct *work)set_signature (ent, !cmd->checksum_disabled);dump_command (dev, ent,1 ); ent->ts1 =ktime_get_ns (); + cmd_mode = cmd->mode;if (ent->callback)schedule_delayed_work (&ent->cb_timeout_work, cb_timeout);
@@ -873,7 +875,7 @@ static void cmd_work_handler(struct work_struct *work)iowrite32be (1 << ent->idx, &dev->iseg->cmd_dbell);mmiowb ();/* if not in polling don't use ent after this point */ -if (cmd->mode ==CMD_MODE_POLLING || poll_cmd) { +if (cmd_mode ==CMD_MODE_POLLING || poll_cmd) {poll_timeout (ent);/* make sure we read the descriptor after ownership is SW */ rmb ();
@@ -1274,7 +1276,7 @@ static ssize_t outlen_write(struct file *filp, const char __user *buf, {struct mlx5_core_dev *dev = filp->private_data;struct mlx5_cmd_debug *dbg = &dev->cmd.dbg; -char outlen_str[8 ]; +char outlen_str[8 ] = {0 };int outlen;void *ptr;int err;
@@ -1289,8 +1291,6 @@ static ssize_t outlen_write(struct file *filp, const char __user *buf,if (copy_from_user (outlen_str, buf, count))return -EFAULT ; - outlen_str[7 ] =0 ; - err =sscanf (outlen_str,"%d" , &outlen);if (err <0 )return err;
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +6 -6
@@ -2612,7 +2612,7 @@ void mlx5e_activate_priv_channels(struct mlx5e_priv *priv)mlx5e_activate_channels (&priv->channels);netif_tx_start_all_queues (priv->netdev); -if (MLX5_VPORT_MANAGER (priv->mdev)) +if (MLX5_ESWITCH_MANAGER (priv->mdev))mlx5e_add_sqs_fwd_rules (priv);mlx5e_wait_channels_min_rx_wqes (&priv->channels);
@@ -2623,7 +2623,7 @@ void mlx5e_deactivate_priv_channels(struct mlx5e_priv *priv) {mlx5e_redirect_rqts_to_drop (priv); -if (MLX5_VPORT_MANAGER (priv->mdev)) +if (MLX5_ESWITCH_MANAGER (priv->mdev))mlx5e_remove_sqs_fwd_rules (priv);/* FIXME: This is a W/A only for tx timeout watch dog false alarm when
@@ -4315,7 +4315,7 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev)mlx5e_set_netdev_dev_addr (netdev);#if IS_ENABLED (CONFIG_MLX5_ESWITCH ) -if (MLX5_VPORT_MANAGER (mdev)) +if (MLX5_ESWITCH_MANAGER (mdev)) netdev->switchdev_ops = &mlx5e_switchdev_ops;#endif
@@ -4465,7 +4465,7 @@ static void mlx5e_nic_enable(struct mlx5e_priv *priv)mlx5e_enable_async_events (priv); -if (MLX5_VPORT_MANAGER (priv->mdev)) +if (MLX5_ESWITCH_MANAGER (priv->mdev))mlx5e_register_vport_reps (priv);if (netdev->reg_state !=NETREG_REGISTERED )
@@ -4500,7 +4500,7 @@ static void mlx5e_nic_disable(struct mlx5e_priv *priv)queue_work (priv->wq, &priv->set_rx_mode_work); -if (MLX5_VPORT_MANAGER (priv->mdev)) +if (MLX5_ESWITCH_MANAGER (priv->mdev))mlx5e_unregister_vport_reps (priv);mlx5e_disable_async_events (priv);
@@ -4684,7 +4684,7 @@ static void *mlx5e_add(struct mlx5_core_dev *mdev)return NULL ;#ifdef CONFIG_MLX5_ESWITCH -if (MLX5_VPORT_MANAGER (mdev)) { +if (MLX5_ESWITCH_MANAGER (mdev)) { rpriv =mlx5e_alloc_nic_rep_priv (mdev);if (!rpriv) {mlx5_core_warn (mdev,"Failed to alloc NIC rep priv data\n" );
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +6 -2
@@ -790,7 +790,7 @@ bool mlx5e_is_uplink_rep(struct mlx5e_priv *priv)struct mlx5e_rep_priv *rpriv = priv->ppriv;struct mlx5_eswitch_rep *rep; -if (!MLX5_CAP_GEN (priv->mdev, vport_group_manager)) +if (!MLX5_ESWITCH_MANAGER (priv->mdev))return false; rep = rpriv->rep;
@@ -804,8 +804,12 @@ bool mlx5e_is_uplink_rep(struct mlx5e_priv *priv)static bool mlx5e_is_vf_vport_rep (struct mlx5e_priv *priv) {struct mlx5e_rep_priv *rpriv = priv->ppriv; -struct mlx5_eswitch_rep *rep = rpriv->rep; +struct mlx5_eswitch_rep *rep; +if (!MLX5_ESWITCH_MANAGER (priv->mdev)) +return false; + + rep = rpriv->rep;if (rep && rep->vport !=FDB_UPLINK_VPORT )return true;
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +1 -1
@@ -1604,7 +1604,7 @@ int mlx5_eswitch_enable_sriov(struct mlx5_eswitch *esw, int nvfs, int mode)if (!ESW_ALLOWED (esw))return 0 ; -if (!MLX5_CAP_GEN (esw->dev, eswitch_flow_table) || +if (!MLX5_ESWITCH_MANAGER (esw->dev) || !MLX5_CAP_ESW_FLOWTABLE_FDB (esw->dev, ft_support)) {esw_warn (esw->dev,"E-Switch FDB is not supported, aborting ...\n" );return -EOPNOTSUPP ;
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +2 -2
@@ -983,8 +983,8 @@ static int mlx5_devlink_eswitch_check(struct devlink *devlink)if (MLX5_CAP_GEN (dev, port_type) !=MLX5_CAP_PORT_TYPE_ETH )return -EOPNOTSUPP ; -if (!MLX5_CAP_GEN (dev, vport_group_manager)) -return -EOPNOTSUPP ; +if (!MLX5_ESWITCH_MANAGER (dev)) +return -EPERM ;if (dev->priv.eswitch->mode ==SRIOV_NONE )return -EOPNOTSUPP ;
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +2 -1
@@ -32,6 +32,7 @@#include <linux/mutex.h> #include <linux/mlx5/driver.h> +#include <linux/mlx5/eswitch.h> #include "mlx5_core.h" #include "fs_core.h"
@@ -2631,7 +2632,7 @@ int mlx5_init_fs(struct mlx5_core_dev *dev) goto err; } -if (MLX5_CAP_GEN (dev, eswitch_flow_table)) { +if (MLX5_ESWITCH_MANAGER (dev)) {if (MLX5_CAP_ESW_FLOWTABLE_FDB (dev, ft_support)) { err =init_fdb_root_ns (steering);if (err)
drivers/net/ethernet/mellanox/mlx5/core/fw.c +3 -2
@@ -32,6 +32,7 @@#include <linux/mlx5/driver.h> #include <linux/mlx5/cmd.h> +#include <linux/mlx5/eswitch.h> #include <linux/module.h> #include "mlx5_core.h" #include "../../mlxfw/mlxfw.h"
@@ -159,13 +160,13 @@ int mlx5_query_hca_caps(struct mlx5_core_dev *dev) }if (MLX5_CAP_GEN (dev, vport_group_manager) && -MLX5_CAP_GEN (dev, eswitch_flow_table)) { +MLX5_ESWITCH_MANAGER (dev)) { err =mlx5_core_get_caps (dev,MLX5_CAP_ESWITCH_FLOW_TABLE );if (err)return err; } -if (MLX5_CAP_GEN (dev, eswitch_flow_table)) { +if (MLX5_ESWITCH_MANAGER (dev)) { err =mlx5_core_get_caps (dev,MLX5_CAP_ESWITCH );if (err)return err;
drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.c +5 -4
@@ -33,6 +33,7 @@#include <linux/etherdevice.h> #include <linux/mlx5/driver.h> #include <linux/mlx5/mlx5_ifc.h> +#include <linux/mlx5/eswitch.h> #include "mlx5_core.h" #include "lib/mpfs.h"
@@ -98,7 +99,7 @@ int mlx5_mpfs_init(struct mlx5_core_dev *dev)int l2table_size =1 <<MLX5_CAP_GEN (dev, log_max_l2_table);struct mlx5_mpfs *mpfs; -if (!MLX5_VPORT_MANAGER (dev)) +if (!MLX5_ESWITCH_MANAGER (dev))return 0 ; mpfs =kzalloc (sizeof (*mpfs),GFP_KERNEL );
@@ -122,7 +123,7 @@ void mlx5_mpfs_cleanup(struct mlx5_core_dev *dev) {struct mlx5_mpfs *mpfs = dev->priv.mpfs; -if (!MLX5_VPORT_MANAGER (dev)) +if (!MLX5_ESWITCH_MANAGER (dev))return ;WARN_ON (!hlist_empty (mpfs->hash));
@@ -137,7 +138,7 @@ int mlx5_mpfs_add_mac(struct mlx5_core_dev *dev, u8 *mac)u32 index;int err; -if (!MLX5_VPORT_MANAGER (dev)) +if (!MLX5_ESWITCH_MANAGER (dev))return 0 ;mutex_lock (&mpfs->lock);
@@ -179,7 +180,7 @@ int mlx5_mpfs_del_mac(struct mlx5_core_dev *dev, u8 *mac)int err =0 ;u32 index; -if (!MLX5_VPORT_MANAGER (dev)) +if (!MLX5_ESWITCH_MANAGER (dev))return 0 ;mutex_lock (&mpfs->lock);
drivers/net/ethernet/mellanox/mlx5/core/port.c +2 -2
@@ -701,7 +701,7 @@ EXPORT_SYMBOL_GPL(mlx5_query_port_prio_tc);static int mlx5_set_port_qetcr_reg (struct mlx5_core_dev *mdev,u32 *in,int inlen) { -u32 out[MLX5_ST_SZ_DW (qtct_reg)]; +u32 out[MLX5_ST_SZ_DW (qetc_reg)];if (!MLX5_CAP_GEN (mdev, ets))return -EOPNOTSUPP ;
@@ -713,7 +713,7 @@ static int mlx5_set_port_qetcr_reg(struct mlx5_core_dev *mdev, u32 *in,static int mlx5_query_port_qetcr_reg (struct mlx5_core_dev *mdev,u32 *out,int outlen) { -u32 in[MLX5_ST_SZ_DW (qtct_reg)]; +u32 in[MLX5_ST_SZ_DW (qetc_reg)];if (!MLX5_CAP_GEN (mdev, ets))return -EOPNOTSUPP ;
drivers/net/ethernet/mellanox/mlx5/core/sriov.c +6 -1
@@ -88,6 +88,9 @@ static int mlx5_device_enable_sriov(struct mlx5_core_dev *dev, int num_vfs)return -EBUSY ; } +if (!MLX5_ESWITCH_MANAGER (dev)) + goto enable_vfs_hca; + err =mlx5_eswitch_enable_sriov (dev->priv.eswitch, num_vfs,SRIOV_LEGACY );if (err) { mlx5_core_warn(dev,
@@ -95,6 +98,7 @@ static int mlx5_device_enable_sriov(struct mlx5_core_dev *dev, int num_vfs)return err; } +enable_vfs_hca:for (vf =0 ; vf < num_vfs; vf++) { err =mlx5_core_enable_hca (dev, vf +1 );if (err) {
@@ -140,7 +144,8 @@ static void mlx5_device_disable_sriov(struct mlx5_core_dev *dev) } out: -mlx5_eswitch_disable_sriov (dev->priv.eswitch); +if (MLX5_ESWITCH_MANAGER (dev)) +mlx5_eswitch_disable_sriov (dev->priv.eswitch);if (mlx5_wait_for_vf_pages (dev))mlx5_core_warn (dev,"timeout reclaiming VFs pages\n" );
drivers/net/ethernet/netronome/nfp/bpf/main.c +3 -0
@@ -194,6 +194,9 @@ static int nfp_bpf_setup_tc_block(struct net_device *netdev,if (f->binder_type !=TCF_BLOCK_BINDER_TYPE_CLSACT_INGRESS )return -EOPNOTSUPP ; +if (tcf_block_shared (f->block)) +return -EOPNOTSUPP ; +switch (f->command) {case TC_BLOCK_BIND : return tcf_block_cb_register(f->block,
drivers/net/ethernet/netronome/nfp/flower/match.c +14 -0
@@ -123,6 +123,20 @@ nfp_flower_compile_mac(struct nfp_flower_mac_mpls *frame,NFP_FLOWER_MASK_MPLS_Q ; frame->mpls_lse =cpu_to_be32 (t_mpls); + }else if (dissector_uses_key (flow->dissector, +FLOW_DISSECTOR_KEY_BASIC )) { +/* Check for mpls ether type and set NFP_FLOWER_MASK_MPLS_Q +* bit, which indicates an mpls ether type but without any +* mpls fields. +*/ +struct flow_dissector_key_basic *key_basic; + + key_basic =skb_flow_dissector_target (flow->dissector, +FLOW_DISSECTOR_KEY_BASIC , + flow->key); +if (key_basic->n_proto ==cpu_to_be16 (ETH_P_MPLS_UC ) || + key_basic->n_proto ==cpu_to_be16 (ETH_P_MPLS_MC )) + frame->mpls_lse =cpu_to_be32 (NFP_FLOWER_MASK_MPLS_Q ); } }
drivers/net/ethernet/netronome/nfp/flower/offload.c +11 -0
@@ -264,6 +264,14 @@ nfp_flower_calculate_key_layers(struct nfp_app *app,case cpu_to_be16 (ETH_P_ARP ):return -EOPNOTSUPP ; +case cpu_to_be16 (ETH_P_MPLS_UC ): +case cpu_to_be16 (ETH_P_MPLS_MC ): +if (!(key_layer &NFP_FLOWER_LAYER_MAC )) { + key_layer |=NFP_FLOWER_LAYER_MAC ; + key_size +=sizeof (struct nfp_flower_mac_mpls ); + } +break ; +/* Will be included in layer 2. */ case cpu_to_be16 (ETH_P_8021Q ):break ;
@@ -593,6 +601,9 @@ static int nfp_flower_setup_tc_block(struct net_device *netdev,if (f->binder_type !=TCF_BLOCK_BINDER_TYPE_CLSACT_INGRESS )return -EOPNOTSUPP ; +if (tcf_block_shared (f->block)) +return -EOPNOTSUPP ; +switch (f->command) {case TC_BLOCK_BIND : return tcf_block_cb_register(f->block,
drivers/net/ethernet/qlogic/qed/qed_dcbx.c +4 -4
@@ -700,9 +700,9 @@ qed_dcbx_get_local_lldp_params(struct qed_hwfn *p_hwfn, p_local = &p_hwfn->p_dcbx_info->lldp_local[LLDP_NEAREST_BRIDGE ];memcpy (params->lldp_local.local_chassis_id, p_local->local_chassis_id, -ARRAY_SIZE (p_local->local_chassis_id)); +sizeof (p_local->local_chassis_id));memcpy (params->lldp_local.local_port_id, p_local->local_port_id, -ARRAY_SIZE (p_local->local_port_id)); +sizeof (p_local->local_port_id)); } static void
@@ -714,9 +714,9 @@ qed_dcbx_get_remote_lldp_params(struct qed_hwfn *p_hwfn, p_remote = &p_hwfn->p_dcbx_info->lldp_remote[LLDP_NEAREST_BRIDGE ];memcpy (params->lldp_remote.peer_chassis_id, p_remote->peer_chassis_id, -ARRAY_SIZE (p_remote->peer_chassis_id)); +sizeof (p_remote->peer_chassis_id));memcpy (params->lldp_remote.peer_port_id, p_remote->peer_port_id, -ARRAY_SIZE (p_remote->peer_port_id)); +sizeof (p_remote->peer_port_id)); } static int
drivers/net/ethernet/qlogic/qed/qed_dev.c +1 -1
@@ -1789,7 +1789,7 @@ int qed_hw_init(struct qed_dev *cdev, struct qed_hw_init_params *p_params)DP_INFO (p_hwfn,"Failed to update driver state\n" ); rc =qed_mcp_ov_update_eswitch (p_hwfn, p_hwfn->p_main_ptt, -QED_OV_ESWITCH_VEB ); +QED_OV_ESWITCH_NONE );if (rc)DP_INFO (p_hwfn,"Failed to update eswitch mode\n" ); }
drivers/net/ethernet/qlogic/qed/qed_main.c +8 -0
@@ -780,6 +780,14 @@ static int qed_slowpath_setup_int(struct qed_dev *cdev,/* We want a minimum of one slowpath and one fastpath vector per hwfn */ cdev->int_params.in.min_msix_cnt = cdev->num_hwfns *2 ; +if (is_kdump_kernel ()) { +DP_INFO (cdev, +"Kdump kernel: Limit the max number of requested MSI-X vectors to %hd\n" , + cdev->int_params.in.min_msix_cnt); + cdev->int_params.in.num_vectors = + cdev->int_params.in.min_msix_cnt; + } + rc =qed_set_int_mode (cdev, false);if (rc) {DP_ERR (cdev,"qed_slowpath_setup_int ERR\n" );
drivers/net/ethernet/qlogic/qed/qed_sriov.c +17 -2
@@ -4400,6 +4400,8 @@ static void qed_sriov_enable_qid_config(struct qed_hwfn *hwfn,static int qed_sriov_enable (struct qed_dev *cdev,int num) {struct qed_iov_vf_init_params params; +struct qed_hwfn *hwfn; +struct qed_ptt *ptt;int i, j, rc;if (num >=RESC_NUM (&cdev->hwfns[0 ],QED_VPORT )) {
@@ -4412,8 +4414,8 @@ static int qed_sriov_enable(struct qed_dev *cdev, int num)/* Initialize HW for VF access */ for_each_hwfn (cdev, j) { -struct qed_hwfn *hwfn = &cdev->hwfns[j]; -struct qed_ptt *ptt =qed_ptt_acquire (hwfn); + hwfn = &cdev->hwfns[j]; + ptt =qed_ptt_acquire (hwfn);/* Make sure not to use more than 16 queues per VF */ params.num_queues = min_t(int,
@@ -4449,6 +4451,19 @@ static int qed_sriov_enable(struct qed_dev *cdev, int num) goto err; } + hwfn =QED_LEADING_HWFN (cdev); + ptt =qed_ptt_acquire (hwfn); +if (!ptt) { +DP_ERR (hwfn,"Failed to acquire ptt\n" ); + rc = -EBUSY ; + goto err; + } + + rc =qed_mcp_ov_update_eswitch (hwfn, ptt,QED_OV_ESWITCH_VEB ); +if (rc) +DP_INFO (cdev,"Failed to update eswitch mode\n" ); +qed_ptt_release (hwfn, ptt); +return num; err:
drivers/net/ethernet/qlogic/qede/qede_ptp.c +8 -2
@@ -337,8 +337,14 @@ int qede_ptp_get_ts_info(struct qede_dev *edev, struct ethtool_ts_info *info) {struct qede_ptp *ptp = edev->ptp; -if (!ptp) -return -EIO ; +if (!ptp) { + info->so_timestamping =SOF_TIMESTAMPING_TX_SOFTWARE | +SOF_TIMESTAMPING_RX_SOFTWARE | +SOF_TIMESTAMPING_SOFTWARE ; + info->phc_index =-1 ; + +return 0 ; + } info->so_timestamping =SOF_TIMESTAMPING_TX_SOFTWARE | SOF_TIMESTAMPING_RX_SOFTWARE |
drivers/net/ethernet/sfc/farch.c +1 -0
@@ -2794,6 +2794,7 @@ int efx_farch_filter_table_probe(struct efx_nic *efx)if (!state)return -ENOMEM ; efx->filter_state = state; +init_rwsem (&state->lock); table = &state->table[EFX_FARCH_FILTER_TABLE_RX_IP ]; table->id =EFX_FARCH_FILTER_TABLE_RX_IP ;
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +10 -0
@@ -927,6 +927,7 @@ static void stmmac_check_pcs_mode(struct stmmac_priv *priv)static int stmmac_init_phy (struct net_device *dev) {struct stmmac_priv *priv =netdev_priv (dev); +u32 tx_cnt = priv->plat->tx_queues_to_use;struct phy_device *phydev;char phy_id_fmt[MII_BUS_ID_SIZE +3 ];char bus_id[MII_BUS_ID_SIZE ];
@@ -967,6 +968,15 @@ static int stmmac_init_phy(struct net_device *dev) phydev->advertising &= ~(SUPPORTED_1000baseT_Half | SUPPORTED_1000baseT_Full); +/* +* Half-duplex mode not supported with multiqueue +* half-duplex can only works with single queue +*/ +if (tx_cnt >1 ) + phydev->supported &= ~(SUPPORTED_1000baseT_Half | + SUPPORTED_100baseT_Half | + SUPPORTED_10baseT_Half); +/* * Broken HW is sometimes missing the pull-up resistor on the * MDIO line, which results in reads to non-existent devices returning
drivers/net/ethernet/sun/sungem.c +12 -10
@@ -60,8 +60,7 @@#include <linux/sungem_phy.h> #include "sungem.h" -/* Stripping FCS is causing problems, disabled for now */ -#undef STRIP_FCS +#define STRIP_FCS #define DEFAULT_MSG (NETIF_MSG_DRV | \ NETIF_MSG_PROBE | \
@@ -435,7 +434,7 @@ static int gem_rxmac_reset(struct gem *gp)writel (desc_dma &0xffffffff , gp->regs +RXDMA_DBLOW );writel (RX_RING_SIZE -4 , gp->regs +RXDMA_KICK ); val = (RXDMA_CFG_BASE | (RX_OFFSET <<10 ) | - ((14 /2 ) <<13 ) |RXDMA_CFG_FTHRESH_128 ); + (ETH_HLEN <<13 ) |RXDMA_CFG_FTHRESH_128 );writel (val, gp->regs +RXDMA_CFG );if (readl (gp->regs +GREG_BIFCFG ) &GREG_BIFCFG_M66EN ) writel(((5 & RXDMA_BLANK_IPKTS) |
@@ -760,7 +759,6 @@ static int gem_rx(struct gem *gp, int work_to_do)struct net_device *dev = gp->dev;int entry, drops, work_done =0 ;u32 done; -__sum16 csum;if (netif_msg_rx_status (gp)) printk(KERN_DEBUG "%s: rx interrupt, done: %d, rx_new: %d\n",
@@ -855,9 +853,13 @@ static int gem_rx(struct gem *gp, int work_to_do) skb = copy_skb; } - csum = (__force __sum16 )htons ((status &RXDCTRL_TCPCSUM ) ^0xffff ); - skb->csum =csum_unfold (csum); - skb->ip_summed =CHECKSUM_COMPLETE ; +if (likely (dev->features &NETIF_F_RXCSUM )) { +__sum16 csum; + + csum = (__force __sum16 )htons ((status &RXDCTRL_TCPCSUM ) ^0xffff ); + skb->csum =csum_unfold (csum); + skb->ip_summed =CHECKSUM_COMPLETE ; + } skb->protocol =eth_type_trans (skb, gp->dev);napi_gro_receive (&gp->napi, skb);
@@ -1761,7 +1763,7 @@ static void gem_init_dma(struct gem *gp)writel (0 , gp->regs +TXDMA_KICK ); val = (RXDMA_CFG_BASE | (RX_OFFSET <<10 ) | - ((14 /2 ) <<13 ) |RXDMA_CFG_FTHRESH_128 ); + (ETH_HLEN <<13 ) |RXDMA_CFG_FTHRESH_128 );writel (val, gp->regs +RXDMA_CFG );writel (desc_dma >>32 , gp->regs +RXDMA_DBHI );
@@ -2985,8 +2987,8 @@ static int gem_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)pci_set_drvdata (pdev, dev);/* We can do scatter/gather and HW checksum */ - dev->hw_features =NETIF_F_SG |NETIF_F_HW_CSUM ; - dev->features |= dev->hw_features |NETIF_F_RXCSUM ; + dev->hw_features =NETIF_F_SG |NETIF_F_HW_CSUM |NETIF_F_RXCSUM ; + dev->features = dev->hw_features;if (pci_using_dac) dev->features |=NETIF_F_HIGHDMA ;
drivers/net/geneve.c +1 -1
@@ -474,7 +474,7 @@ static struct sk_buff **geneve_gro_receive(struct sock *sk, out_unlock:rcu_read_unlock (); out: -NAPI_GRO_CB (skb)->flush |= flush; +skb_gro_flush_final (skb, pp, flush);return pp; }
drivers/net/hyperv/hyperv_net.h +1 -1
@@ -211,7 +211,7 @@ int netvsc_recv_callback(struct net_device *net,void netvsc_channel_cb (void *context);int netvsc_poll (struct napi_struct *napi,int budget); -void rndis_set_subchannel (struct work_struct *w); +int rndis_set_subchannel (struct net_device *ndev,struct netvsc_device *nvdev);int rndis_filter_open (struct netvsc_device *nvdev);int rndis_filter_close (struct netvsc_device *nvdev); struct netvsc_device *rndis_filter_device_add(struct hv_device *dev,
drivers/net/hyperv/netvsc.c +36 -1
@@ -66,6 +66,41 @@ void netvsc_switch_datapath(struct net_device *ndev, bool vf) VM_PKT_DATA_INBAND, 0); } +/* Worker to setup sub channels on initial setup +* Initial hotplug event occurs in softirq context +* and can't wait for channels. +*/ +static void netvsc_subchan_work (struct work_struct *w) +{ +struct netvsc_device *nvdev = + container_of(w, struct netvsc_device, subchan_work); +struct rndis_device *rdev; +int i, ret; + +/* Avoid deadlock with device removal already under RTNL */ +if (!rtnl_trylock ()) { +schedule_work (w); +return ; + } + + rdev = nvdev->extension; +if (rdev) { + ret =rndis_set_subchannel (rdev->ndev, nvdev); +if (ret ==0 ) { +netif_device_attach (rdev->ndev); + }else { +/* fallback to only primary channel */ +for (i =1 ; i < nvdev->num_chn; i++) +netif_napi_del (&nvdev->chan_table[i].napi); + + nvdev->max_chn =1 ; + nvdev->num_chn =1 ; + } + } + +rtnl_unlock (); +} +static struct netvsc_device *alloc_net_device (void ) {struct netvsc_device *net_device;
@@ -82,7 +117,7 @@ static struct netvsc_device *alloc_net_device(void)init_completion (&net_device->channel_init_wait);init_waitqueue_head (&net_device->subchan_open); -INIT_WORK (&net_device->subchan_work, rndis_set_subchannel); +INIT_WORK (&net_device->subchan_work, netvsc_subchan_work);return net_device; }
drivers/net/hyperv/netvsc_drv.c +16 -1
@@ -905,8 +905,20 @@ static int netvsc_attach(struct net_device *ndev,if (IS_ERR (nvdev))return PTR_ERR (nvdev); -/* Note: enable and attach happen when sub-channels setup */ +if (nvdev->num_chn >1 ) { + ret =rndis_set_subchannel (ndev, nvdev); + +/* if unavailable, just proceed with one queue */ +if (ret) { + nvdev->max_chn =1 ; + nvdev->num_chn =1 ; + } + } + +/* In any case device is now ready */ +netif_device_attach (ndev); +/* Note: enable and attach happen when sub-channels setup */ netif_carrier_off (ndev);if (netif_running (ndev)) {
@@ -2064,6 +2076,9 @@ static int netvsc_probe(struct hv_device *dev,memcpy (net->dev_addr, device_info.mac_adr,ETH_ALEN ); +if (nvdev->num_chn >1 ) +schedule_work (&nvdev->subchan_work); +/* hw_features computed in rndis_netdev_set_hwcaps() */ net->features = net->hw_features | NETIF_F_HIGHDMA | NETIF_F_SG |
drivers/net/hyperv/rndis_filter.c +12 -49
96 lines not on this page · raw message
drivers/net/ipvlan/ipvlan_main.c +2 -1
@@ -594,7 +594,8 @@ int ipvlan_link_new(struct net *src_net, struct net_device *dev, ipvlan->phy_dev = phy_dev; ipvlan->dev = dev; ipvlan->sfeatures =IPVLAN_FEATURES ; -ipvlan_adjust_mtu (ipvlan, phy_dev); +if (!tb[IFLA_MTU ]) +ipvlan_adjust_mtu (ipvlan, phy_dev);INIT_LIST_HEAD (&ipvlan->addrs);spin_lock_init (&ipvlan->addrs_lock);
drivers/net/usb/lan78xx.c +4 -1
@@ -3193,6 +3193,7 @@ static void lan78xx_tx_bh(struct lan78xx_net *dev) pkt_cnt =0 ; count =0 ; length =0 ; +spin_lock_irqsave (&tqp->lock, flags);for (skb = tqp->next; pkt_cnt < tqp->qlen; skb = skb->next) {if (skb_is_gso (skb)) {if (pkt_cnt) {
@@ -3201,7 +3202,8 @@ static void lan78xx_tx_bh(struct lan78xx_net *dev) } count =1 ; length = skb->len -TX_OVERHEAD ; - skb2 =skb_dequeue (tqp); +__skb_unlink (skb, tqp); +spin_unlock_irqrestore (&tqp->lock, flags); goto gso_skb; }
@@ -3210,6 +3212,7 @@ static void lan78xx_tx_bh(struct lan78xx_net *dev) skb_totallen = skb->len +roundup (skb_totallen,sizeof (u32)); pkt_cnt++; } +spin_unlock_irqrestore (&tqp->lock, flags);/* copy to a single skb */ skb =alloc_skb (skb_totallen,GFP_ATOMIC );
drivers/net/usb/qmi_wwan.c +1 -0
@@ -1246,6 +1246,7 @@ static const struct usb_device_id products[] = { {QMI_FIXED_INTF(0x413c, 0x81b3, 8)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */ {QMI_FIXED_INTF(0x413c, 0x81b6, 8)}, /* Dell Wireless 5811e */ {QMI_FIXED_INTF(0x413c, 0x81b6, 10)}, /* Dell Wireless 5811e */ + {QMI_FIXED_INTF(0x413c, 0x81d7, 1)}, /* Dell Wireless 5821e */ {QMI_FIXED_INTF(0x03f0, 0x4e1d, 8)}, /* HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module */ {QMI_FIXED_INTF(0x03f0, 0x9d1d, 1)}, /* HP lt4120 Snapdragon X5 LTE */ {QMI_FIXED_INTF(0x22de, 0x9061, 3)}, /* WeTelecom WPD-600N */
drivers/net/usb/r8152.c +2 -1
@@ -3962,7 +3962,8 @@ static int rtl8152_close(struct net_device *netdev)#ifdef CONFIG_PM_SLEEP unregister_pm_notifier (&tp->pm_notifier);#endif -napi_disable (&tp->napi); +if (!test_bit (RTL8152_UNPLUG , &tp->flags)) +napi_disable (&tp->napi);clear_bit (WORK_ENABLE , &tp->flags);usb_kill_urb (tp->intr_urb);cancel_delayed_work_sync (&tp->schedule);
drivers/net/virtio_net.c +19 -11
@@ -50,6 +50,10 @@ module_param(napi_tx, bool, 0644);/* Amount of XDP headroom to prepend to packets for use by xdp_adjust_head */ #define VIRTIO_XDP_HEADROOM 256 +/* Separating two types of XDP xmit */ +#define VIRTIO_XDP_TX BIT(0) +#define VIRTIO_XDP_REDIR BIT(1) +/* RX packet size EWMA. The average packet size is used to determine the packet * buffer size when refilling RX rings. As the entire RX ring may be refilled * at once, the weight is chosen so that the EWMA will be insensitive to short-
@@ -547,7 +551,7 @@ static struct sk_buff *receive_small(struct net_device *dev,struct receive_queue *rq, void *buf, void *ctx, unsigned int len, - bool *xdp_xmit) + unsigned int *xdp_xmit) { struct sk_buff *skb;struct bpf_prog *xdp_prog;
@@ -615,14 +619,14 @@ static struct sk_buff *receive_small(struct net_device *dev,trace_xdp_exception (vi->dev, xdp_prog, act); goto err_xdp; } - *xdp_xmit = true; + *xdp_xmit |=VIRTIO_XDP_TX ;rcu_read_unlock (); goto xdp_xmit;case XDP_REDIRECT : err =xdp_do_redirect (dev, &xdp, xdp_prog);if (err) goto err_xdp; - *xdp_xmit = true; + *xdp_xmit |=VIRTIO_XDP_REDIR ;rcu_read_unlock (); goto xdp_xmit;default :
@@ -684,7 +688,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev,void *buf, void *ctx, unsigned int len, - bool *xdp_xmit) + unsigned int *xdp_xmit) { struct virtio_net_hdr_mrg_rxbuf *hdr = buf;u16 num_buf =virtio16_to_cpu (vi->vdev, hdr->num_buffers);
@@ -772,7 +776,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev,put_page (xdp_page); goto err_xdp; } - *xdp_xmit = true; + *xdp_xmit |=VIRTIO_XDP_REDIR ;if (unlikely (xdp_page != page))put_page (page);rcu_read_unlock ();
@@ -784,7 +788,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev,put_page (xdp_page); goto err_xdp; } - *xdp_xmit = true; + *xdp_xmit |=VIRTIO_XDP_TX ;if (unlikely (xdp_page != page))put_page (page);rcu_read_unlock ();
@@ -893,7 +897,8 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, }static int receive_buf (struct virtnet_info *vi,struct receive_queue *rq, -void *buf,unsigned int len,void **ctx,bool *xdp_xmit) +void *buf,unsigned int len,void **ctx, +unsigned int *xdp_xmit) {struct net_device *dev = vi->dev;struct sk_buff *skb;
@@ -1186,7 +1191,8 @@ static void refill_work(struct work_struct *work) } } -static int virtnet_receive (struct receive_queue *rq,int budget,bool *xdp_xmit) +static int virtnet_receive (struct receive_queue *rq,int budget, +unsigned int *xdp_xmit) {struct virtnet_info *vi = rq->vq->vdev->priv;unsigned int len, received =0 , bytes =0 ;
@@ -1275,7 +1281,7 @@ static int virtnet_poll(struct napi_struct *napi, int budget)struct virtnet_info *vi = rq->vq->vdev->priv;struct send_queue *sq;unsigned int received, qp; -bool xdp_xmit = false; +unsigned int xdp_xmit =0 ;virtnet_poll_cleantx (rq);
@@ -1285,12 +1291,14 @@ static int virtnet_poll(struct napi_struct *napi, int budget)if (received < budget)virtqueue_napi_complete (napi, rq->vq, received); -if (xdp_xmit) { +if (xdp_xmit &VIRTIO_XDP_REDIR ) +xdp_do_flush_map (); + +if (xdp_xmit &VIRTIO_XDP_TX ) { qp = vi->curr_queue_pairs - vi->xdp_queue_pairs +smp_processor_id (); sq = &vi->sq[qp];virtqueue_kick (sq->vq); -xdp_do_flush_map (); }return received;
drivers/net/vxlan.c +1 -3
@@ -623,9 +623,7 @@ static struct sk_buff **vxlan_gro_receive(struct sock *sk, flush =0 ; out: -skb_gro_remcsum_cleanup (skb, &grc); - skb->remcsum_offload =0 ; -NAPI_GRO_CB (skb)->flush |= flush; +skb_gro_flush_final_remcsum (skb, pp, flush, &grc);return pp; }
drivers/net/wireless/realtek/rtlwifi/base.c +10 -7
@@ -485,18 +485,21 @@ static void _rtl_init_deferred_work(struct ieee80211_hw *hw) } -void rtl_deinit_deferred_work (struct ieee80211_hw *hw) +void rtl_deinit_deferred_work (struct ieee80211_hw *hw,bool ips_wq) {struct rtl_priv *rtlpriv =rtl_priv (hw);del_timer_sync (&rtlpriv->works.watchdog_timer); -cancel_delayed_work (&rtlpriv->works.watchdog_wq); -cancel_delayed_work (&rtlpriv->works.ips_nic_off_wq); -cancel_delayed_work (&rtlpriv->works.ps_work); -cancel_delayed_work (&rtlpriv->works.ps_rfon_wq); -cancel_delayed_work (&rtlpriv->works.fwevt_wq); -cancel_delayed_work (&rtlpriv->works.c2hcmd_wq); +cancel_delayed_work_sync (&rtlpriv->works.watchdog_wq); +if (ips_wq) +cancel_delayed_work (&rtlpriv->works.ips_nic_off_wq); +else +cancel_delayed_work_sync (&rtlpriv->works.ips_nic_off_wq); +cancel_delayed_work_sync (&rtlpriv->works.ps_work); +cancel_delayed_work_sync (&rtlpriv->works.ps_rfon_wq); +cancel_delayed_work_sync (&rtlpriv->works.fwevt_wq); +cancel_delayed_work_sync (&rtlpriv->works.c2hcmd_wq); }EXPORT_SYMBOL_GPL (rtl_deinit_deferred_work);
drivers/net/wireless/realtek/rtlwifi/base.h +1 -1
@@ -121,7 +121,7 @@ void rtl_init_rfkill(struct ieee80211_hw *hw);void rtl_deinit_rfkill (struct ieee80211_hw *hw);void rtl_watch_dog_timer_callback (struct timer_list *t); -void rtl_deinit_deferred_work (struct ieee80211_hw *hw); +void rtl_deinit_deferred_work (struct ieee80211_hw *hw,bool ips_wq);bool rtl_action_proc (struct ieee80211_hw *hw,struct sk_buff *skb,u8 is_tx); int rtlwifi_rate_mapping(struct ieee80211_hw *hw, bool isht,
drivers/net/wireless/realtek/rtlwifi/core.c +1 -2
@@ -130,7 +130,6 @@ static void rtl_fw_do_work(const struct firmware *firmware, void *context, firmware->size); rtlpriv->rtlhal.wowlan_fwsize = firmware->size; } - rtlpriv->rtlhal.fwsize = firmware->size;release_firmware (firmware); }
@@ -196,7 +195,7 @@ static void rtl_op_stop(struct ieee80211_hw *hw)/* reset sec info */ rtl_cam_reset_sec_info (hw); -rtl_deinit_deferred_work (hw); +rtl_deinit_deferred_work (hw, false); } rtlpriv->intf_ops->adapter_stop (hw);
drivers/net/wireless/realtek/rtlwifi/pci.c +1 -1
@@ -2375,7 +2375,7 @@ void rtl_pci_disconnect(struct pci_dev *pdev)ieee80211_unregister_hw (hw); rtlmac->mac80211_registered =0 ; }else { -rtl_deinit_deferred_work (hw); +rtl_deinit_deferred_work (hw, false); rtlpriv->intf_ops->adapter_stop (hw); } rtlpriv->cfg->ops->disable_interrupt (hw);
drivers/net/wireless/realtek/rtlwifi/ps.c +2 -2
@@ -71,7 +71,7 @@ bool rtl_ps_disable_nic(struct ieee80211_hw *hw)struct rtl_priv *rtlpriv =rtl_priv (hw);/*<1> Stop all timer */ -rtl_deinit_deferred_work (hw); +rtl_deinit_deferred_work (hw, true);/*<2> Disable Interrupt */ rtlpriv->cfg->ops->disable_interrupt (hw);
@@ -292,7 +292,7 @@ void rtl_ips_nic_on(struct ieee80211_hw *hw)struct rtl_ps_ctl *ppsc =rtl_psc (rtl_priv (hw));enum rf_pwrstate rtstate; -cancel_delayed_work (&rtlpriv->works.ips_nic_off_wq); +cancel_delayed_work_sync (&rtlpriv->works.ips_nic_off_wq);mutex_lock (&rtlpriv->locks.ips_mutex);if (ppsc->inactiveps) {
drivers/net/wireless/realtek/rtlwifi/usb.c +1 -1
@@ -1132,7 +1132,7 @@ void rtl_usb_disconnect(struct usb_interface *intf)ieee80211_unregister_hw (hw); rtlmac->mac80211_registered =0 ; }else { -rtl_deinit_deferred_work (hw); +rtl_deinit_deferred_work (hw, false); rtlpriv->intf_ops->adapter_stop (hw); }/*deinit rfkill */
drivers/net/xen-netfront.c +6 -5
@@ -1810,7 +1810,7 @@ static int talk_to_netback(struct xenbus_device *dev, err =xen_net_read_mac (dev, info->netdev->dev_addr);if (err) {xenbus_dev_fatal (dev, err,"parsing %s/mac" , dev->nodename); - goto out; + goto out_unlocked; }rtnl_lock ();
@@ -1925,6 +1925,7 @@ static int talk_to_netback(struct xenbus_device *dev,xennet_destroy_queues (info); out:rtnl_unlock (); +out_unlocked:device_unregister (&dev->dev);return err; }
@@ -1950,10 +1951,6 @@ static int xennet_connect(struct net_device *dev)/* talk_to_netback() sets the correct number of queues */ num_queues = dev->real_num_tx_queues; -rtnl_lock (); -netdev_update_features (dev); -rtnl_unlock (); -if (dev->reg_state ==NETREG_UNINITIALIZED ) { err =register_netdev (dev);if (err) {
@@ -1963,6 +1960,10 @@ static int xennet_connect(struct net_device *dev) } } +rtnl_lock (); +netdev_update_features (dev); +rtnl_unlock (); +/* * All public and private state should now be sane. Get * ready to start sending and receiving packets and give the driver
drivers/pci/host/pci-hyperv.c +5 -3
@@ -1077,6 +1077,7 @@ static void hv_compose_msi_msg(struct irq_data *data, struct msi_msg *msg)struct pci_bus *pbus;struct pci_dev *pdev;struct cpumask *dest; +unsigned long flags;struct compose_comp_ctxt comp;struct tran_int_desc *int_desc;struct {
@@ -1168,14 +1169,15 @@ static void hv_compose_msi_msg(struct irq_data *data, struct msi_msg *msg)* the channel callback directly when channel->target_cpu is * the current CPU. When the higher level interrupt code * calls us with interrupt enabled, let's add the -* local_bh_disable()/enable() to avoid race. +* local_irq_save()/restore() to avoid race: +* hv_pci_onchannelcallback() can also run in tasklet. */ -local_bh_disable (); +local_irq_save (flags);if (hbus->hdev->channel->target_cpu ==smp_processor_id ())hv_pci_onchannelcallback (hbus); -local_bh_enable (); +local_irq_restore (flags);if (hpdev->state == hv_pcichild_ejecting) { dev_err_once(&hbus->hdev->device,
drivers/pinctrl/mediatek/pinctrl-mt7622.c +17 -8
@@ -1411,7 +1411,7 @@ static struct pinctrl_desc mtk_desc = {static int mtk_gpio_get (struct gpio_chip *chip,unsigned int gpio) { -struct mtk_pinctrl *hw =dev_get_drvdata (chip->parent); +struct mtk_pinctrl *hw =gpiochip_get_data (chip);int value, err; err =mtk_hw_get_value (hw, gpio,PINCTRL_PIN_REG_DI , &value);
@@ -1423,7 +1423,7 @@ static int mtk_gpio_get(struct gpio_chip *chip, unsigned int gpio)static void mtk_gpio_set (struct gpio_chip *chip,unsigned int gpio,int value) { -struct mtk_pinctrl *hw =dev_get_drvdata (chip->parent); +struct mtk_pinctrl *hw =gpiochip_get_data (chip);mtk_hw_set_value (hw, gpio,PINCTRL_PIN_REG_DO , !!value); }
@@ -1463,11 +1463,20 @@ static int mtk_build_gpiochip(struct mtk_pinctrl *hw, struct device_node *np)if (ret <0 )return ret; - ret =gpiochip_add_pin_range (chip,dev_name (hw->dev),0 ,0 , - chip->ngpio); -if (ret <0 ) { -gpiochip_remove (chip); -return ret; +/* Just for backward compatible for these old pinctrl nodes without +* "gpio-ranges" property. Otherwise, called directly from a +* DeviceTree-supported pinctrl driver is DEPRECATED. +* Please see Section 2.1 of +* Documentation/devicetree/bindings/gpio/gpio.txt on how to +* bind pinctrl and gpio drivers via the "gpio-ranges" property. +*/ +if (!of_find_property (np,"gpio-ranges" ,NULL )) { + ret =gpiochip_add_pin_range (chip,dev_name (hw->dev),0 ,0 , + chip->ngpio); +if (ret <0 ) { +gpiochip_remove (chip); +return ret; + } }return 0 ;
@@ -1561,7 +1570,7 @@ static int mtk_pinctrl_probe(struct platform_device *pdev) err =mtk_build_groups (hw);if (err) {dev_err (&pdev->dev,"Failed to build groups\n" ); -return 0 ; +return err; }/* Setup functions descriptions per SoC types */
drivers/pinctrl/sh-pfc/pfc-r8a77970.c +6 -6
@@ -22,12 +22,12 @@#include "sh_pfc.h" #define CPU_ALL_PORT (fn, sfx) \ - PORT_GP_CFG_22(0, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH), \ - PORT_GP_CFG_28(1, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH), \ - PORT_GP_CFG_17(2, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH), \ - PORT_GP_CFG_17(3, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH), \ - PORT_GP_CFG_6(4, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH), \ - PORT_GP_CFG_15(5, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH) + PORT_GP_22(0, fn, sfx), \ + PORT_GP_28(1, fn, sfx), \ + PORT_GP_17(2, fn, sfx), \ + PORT_GP_17(3, fn, sfx), \ + PORT_GP_6(4, fn, sfx), \ + PORT_GP_15(5, fn, sfx)/* * F_() : just information * FM() : macro for FN_xxx / xxx_MARK
drivers/s390/net/qeth_core.h +11 -0
@@ -831,6 +831,17 @@ struct qeth_trap_id {/*some helper functions*/ #define QETH_CARD_IFNAME (card) (((card)->dev)? (card)->dev->name : "") +static inline void qeth_scrub_qdio_buffer (struct qdio_buffer *buf, +unsigned int elements) +{ +unsigned int i; + +for (i =0 ; i < elements; i++) +memset (&buf->element[i],0 ,sizeof (struct qdio_buffer_element )); + buf->element[14 ].sflags =0 ; + buf->element[15 ].sflags =0 ; +} +/** * qeth_get_elements_for_range() - find number of SBALEs to cover range. * @start: Start of the address range.
drivers/s390/net/qeth_core_main.c +17 -7
@@ -73,9 +73,6 @@ static void qeth_notify_skbs(struct qeth_qdio_out_q *queue,struct qeth_qdio_out_buffer *buf, enum iucv_tx_notify notification);static void qeth_release_skbs (struct qeth_qdio_out_buffer *buf); -static void qeth_clear_output_buffer (struct qeth_qdio_out_q *queue, -struct qeth_qdio_out_buffer *buf, -enum qeth_qdio_buffer_states newbufstate);static int qeth_init_qdio_out_buf (struct qeth_qdio_out_q *,int );struct workqueue_struct *qeth_wq;
@@ -488,6 +485,7 @@ static void qeth_qdio_handle_aob(struct qeth_card *card,struct qaob *aob;struct qeth_qdio_out_buffer *buffer;enum iucv_tx_notify notification; +unsigned int i; aob = (struct qaob *)phys_to_virt (phys_aob_addr);QETH_CARD_TEXT (card,5 ,"haob" );
@@ -512,10 +510,18 @@ static void qeth_qdio_handle_aob(struct qeth_card *card,qeth_notify_skbs (buffer->q, buffer, notification); buffer->aob =NULL ; -qeth_clear_output_buffer (buffer->q, buffer, -QETH_QDIO_BUF_HANDLED_DELAYED ); +/* Free dangling allocations. The attached skbs are handled by +* qeth_cleanup_handled_pending(). +*/ +for (i =0 ; + i < aob->sb_count && i <QETH_MAX_BUFFER_ELEMENTS (card); + i++) { +if (aob->sba[i] && buffer->is_header[i]) +kmem_cache_free (qeth_core_header_cache, + (void *) aob->sba[i]); + } +atomic_set (&buffer->state,QETH_QDIO_BUF_HANDLED_DELAYED ); -/* from here on: do not touch buffer anymore */ qdio_release_aob (aob); }
@@ -3759,6 +3765,10 @@ void qeth_qdio_output_handler(struct ccw_device *ccwdev,QETH_CARD_TEXT (queue->card,5 ,"aob" );QETH_CARD_TEXT_ (queue->card,5 ,"%lx" ,virt_to_phys (buffer->aob)); + +/* prepare the queue slot for re-use: */ +qeth_scrub_qdio_buffer (buffer->buffer, +QETH_MAX_BUFFER_ELEMENTS (card));if (qeth_init_qdio_out_buf (queue, bidx)) {QETH_CARD_TEXT (card,2 ,"outofbuf" );qeth_schedule_recovery (card);
@@ -4835,7 +4845,7 @@ int qeth_vm_request_mac(struct qeth_card *card) goto out; } -ccw_device_get_id (CARD_RDEV (card), &id); +ccw_device_get_id (CARD_DDEV (card), &id); request->resp_buf_len =sizeof (*response); request->resp_version =DIAG26C_VERSION2 ; request->op_code =DIAG26C_GET_MAC ;
drivers/s390/net/qeth_l2_main.c +13 -6
@@ -141,7 +141,7 @@ static int qeth_l2_send_setmac(struct qeth_card *card, __u8 *mac)static int qeth_l2_write_mac (struct qeth_card *card,u8 *mac) { -enum qeth_ipa_cmds cmd =is_multicast_ether_addr_64bits (mac) ? +enum qeth_ipa_cmds cmd =is_multicast_ether_addr (mac) ?IPA_CMD_SETGMAC :IPA_CMD_SETVMAC ;int rc;
@@ -158,7 +158,7 @@ static int qeth_l2_write_mac(struct qeth_card *card, u8 *mac)static int qeth_l2_remove_mac (struct qeth_card *card,u8 *mac) { -enum qeth_ipa_cmds cmd =is_multicast_ether_addr_64bits (mac) ? +enum qeth_ipa_cmds cmd =is_multicast_ether_addr (mac) ?IPA_CMD_DELGMAC :IPA_CMD_DELVMAC ;int rc;
@@ -523,27 +523,34 @@ static int qeth_l2_set_mac_address(struct net_device *dev, void *p)return -ERESTARTSYS ; } +/* avoid racing against concurrent state change: */ +if (!mutex_trylock (&card->conf_mutex)) +return -EAGAIN ; +if (!qeth_card_hw_is_reachable (card)) {ether_addr_copy (dev->dev_addr, addr->sa_data); -return 0 ; + goto out_unlock; }/* don't register the same address twice */ if (ether_addr_equal_64bits (dev->dev_addr, addr->sa_data) && (card->info.mac_bits &QETH_LAYER2_MAC_REGISTERED )) -return 0 ; + goto out_unlock;/* add the new address, switch over, drop the old */ rc =qeth_l2_send_setmac (card, addr->sa_data);if (rc) -return rc; + goto out_unlock;ether_addr_copy (old_addr, dev->dev_addr);ether_addr_copy (dev->dev_addr, addr->sa_data);if (card->info.mac_bits &QETH_LAYER2_MAC_REGISTERED )qeth_l2_remove_mac (card, old_addr); card->info.mac_bits |=QETH_LAYER2_MAC_REGISTERED ; -return 0 ; + +out_unlock: +mutex_unlock (&card->conf_mutex); +return rc; }static void qeth_promisc_to_bridge (struct qeth_card *card)
drivers/vhost/net.c +2 -1
@@ -1219,7 +1219,8 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)if (ubufs)vhost_net_ubuf_put_wait_and_free (ubufs); err_ubufs: -sockfd_put (sock); +if (sock) +sockfd_put (sock); err_vq:mutex_unlock (&vq->mutex); err:
fs/autofs4/dev-ioctl.c +13 -9
@@ -148,6 +148,15 @@ static int validate_dev_ioctl(int cmd, struct autofs_dev_ioctl *param) cmd); goto out; } + }else { +unsigned int inr =_IOC_NR (cmd); + +if (inr ==AUTOFS_DEV_IOCTL_OPENMOUNT_CMD || + inr ==AUTOFS_DEV_IOCTL_REQUESTER_CMD || + inr ==AUTOFS_DEV_IOCTL_ISMOUNTPOINT_CMD ) { + err = -EINVAL ; + goto out; + } } err =0 ;
@@ -284,7 +293,8 @@ static int autofs_dev_ioctl_openmount(struct file *fp,dev_t devid;int err, fd; -/* param->path has already been checked */ +/* param->path has been checked in validate_dev_ioctl() */ +if (!param->openmount.devid)return -EINVAL ;
@@ -446,10 +456,7 @@ static int autofs_dev_ioctl_requester(struct file *fp,dev_t devid;int err = -ENOENT ; -if (param->size <=AUTOFS_DEV_IOCTL_SIZE ) { - err = -EINVAL ; - goto out; - } +/* param->path has been checked in validate_dev_ioctl() */ devid = sbi->sb->s_dev;
@@ -534,10 +541,7 @@ static int autofs_dev_ioctl_ismountpoint(struct file *fp,unsigned int devid, magic;int err = -ENOENT ; -if (param->size <=AUTOFS_DEV_IOCTL_SIZE ) { - err = -EINVAL ; - goto out; - } +/* param->path has been checked in validate_dev_ioctl() */ name = param->path; type = param->ismountpoint.in.type;
fs/reiserfs/prints.c +81 -60
219 lines not on this page · raw message
include/linux/arm-smccc.h +10 -0
@@ -80,6 +80,11 @@ ARM_SMCCC_SMC_32, \ 0, 0x8000) +#define ARM_SMCCC_ARCH_WORKAROUND_2 \ + ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ + ARM_SMCCC_SMC_32, \ + 0, 0x7fff) +#ifndef __ASSEMBLY__#include <linux/linkage.h>
@@ -291,5 +296,10 @@ asmlinkage void __arm_smccc_hvc(unsigned long a0, unsigned long a1,*/ #define arm_smccc_1_1_hvc (...) __arm_smccc_1_1(SMCCC_HVC_INST, __VA_ARGS__) +/* Return codes defined in ARM DEN 0070A */ +#define SMCCC_RET_SUCCESS 0 +#define SMCCC_RET_NOT_SUPPORTED -1 +#define SMCCC_RET_NOT_REQUIRED -2 +#endif /*__ASSEMBLY__*/ #endif /*__LINUX_ARM_SMCCC_H*/
include/linux/atmdev.h +15 -0
@@ -214,6 +214,7 @@ struct atmphy_ops {struct atm_skb_data {struct atm_vcc *vcc;/* ATM VCC */ unsigned long atm_options;/* ATM layer options */ +unsigned int acct_truesize;/* truesize accounted to vcc */ };#define VCC_HTABLE_SIZE 32
@@ -241,6 +242,20 @@ void vcc_insert_socket(struct sock *sk);void atm_dev_release_vccs (struct atm_dev *dev); +static inline void atm_account_tx (struct atm_vcc *vcc,struct sk_buff *skb) +{ +/* +* Because ATM skbs may not belong to a sock (and we don't +* necessarily want to), skb->truesize may be adjusted, +* escaping the hack in pskb_expand_head() which avoids +* doing so for some cases. So stash the value of truesize +* at the time we accounted it, and atm_pop_raw() can use +* that value later, in case it changes. +*/ +refcount_add (skb->truesize, &sk_atm (vcc)->sk_wmem_alloc); +ATM_SKB (skb)->acct_truesize = skb->truesize; +ATM_SKB (skb)->atm_options = vcc->atm_options; +}static inline void atm_force_charge (struct atm_vcc *vcc,int truesize) {
include/linux/backing-dev-defs.h +1 -1
@@ -22,7 +22,6 @@ struct dentry;*/ enum wb_state { WB_registered,/* bdi_register() was done */ - WB_shutting_down,/* wb_shutdown() in progress */ WB_writeback_running,/* Writeback is in progress */ WB_has_dirty_io,/* Dirty inodes on ->b_{dirty|io|more_io} */ WB_start_all,/* nr_pages == 0 (all) work pending */
@@ -189,6 +188,7 @@ struct backing_dev_info {#ifdef CONFIG_CGROUP_WRITEBACK struct radix_tree_root cgwb_tree;/* radix tree of active cgroup wbs */ struct rb_root cgwb_congested_tree;/* their congested states */ +struct mutex cgwb_release_mutex;/* protect shutdown of wb structs */ #else struct bdi_writeback_congested *wb_congested;#endif
include/linux/blk_types.h +2 -0
@@ -186,6 +186,8 @@ struct bio {* throttling rules. Don't do it again. */ #define BIO_TRACE_COMPLETION 10/* bio_endio() should trace the final completion * of this bio. */ +#define BIO_QUEUE_ENTERED 11/* can use blk_queue_enter_live() */ +/* See BVEC_POOL_OFFSET below before adding new flags */ /*
include/linux/compiler-gcc.h +22 -7
@@ -65,6 +65,18 @@#define __must_be_array (a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))#endif +/* +* Feature detection for gnu_inline (gnu89 extern inline semantics). Either +* __GNUC_STDC_INLINE__ is defined (not using gnu89 extern inline semantics, +* and we opt in to the gnu89 semantics), or __GNUC_STDC_INLINE__ is not +* defined so the gnu89 semantics are the default. +*/ +#ifdef __GNUC_STDC_INLINE__ +# define __gnu_inline __attribute__((gnu_inline)) +#else +# define __gnu_inline +#endif +/* * Force always-inline if the user requests it so via the .config, * or if gcc is too old.
@@ -72,19 +84,22 @@* -Wunused-function. This turns out to avoid the need for complex #ifdef * directives. Suppress the warning in clang as well by using "unused" * function attribute, which is redundant but not harmful for gcc. +* Prefer gnu_inline, so that extern inline functions do not emit an +* externally visible function. This makes extern inline behave as per gnu89 +* semantics rather than c99. This prevents multiple symbol definition errors +* of extern inline functions at link time. +* A lot of inline functions can cause havoc with function tracing. */ #if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING ) || \ !defined(CONFIG_OPTIMIZE_INLINING ) || (__GNUC__ <4 ) -#define inline inline __attribute__((always_inline,unused)) notrace -#define __inline__ __inline__ __attribute__((always_inline,unused)) notrace -#define __inline __inline __attribute__((always_inline,unused)) notrace +#define inline \ + inline __attribute__((always_inline, unused)) notrace __gnu_inline#else -/* A lot of inline functions can cause havoc with function tracing */ -#define inline inline __attribute__((unused)) notrace -#define __inline__ __inline__ __attribute__((unused)) notrace -#define __inline __inline __attribute__((unused)) notrace +#define inline inline __attribute__((unused)) notrace __gnu_inline#endif +#define __inline__ inline +#define __inline inline#define __always_inline inline __attribute__((always_inline))#define noinline __attribute__((noinline))
include/linux/filter.h +10 -32
75 lines not on this page · raw message
include/linux/mlx5/eswitch.h +2 -0
@@ -8,6 +8,8 @@#include <linux/mlx5/driver.h> +#define MLX5_ESWITCH_MANAGER (mdev) MLX5_CAP_GEN(mdev, eswitch_manager) +enum {SRIOV_NONE ,SRIOV_LEGACY ,
include/linux/mlx5/mlx5_ifc.h +1 -1
@@ -905,7 +905,7 @@ struct mlx5_ifc_cmd_hca_cap_bits {u8 vnic_env_queue_counters[0x1 ];u8 ets[0x1 ];u8 nic_flow_table[0x1 ]; -u8 eswitch_flow_table[0x1 ]; +u8 eswitch_manager[0x1 ];u8 device_memory[0x1 ];u8 mcam_reg[0x1 ];u8 pcam_reg[0x1 ];
include/linux/netdevice.h +20 -0
@@ -2735,11 +2735,31 @@ static inline void skb_gro_flush_final(struct sk_buff *skb, struct sk_buff **pp,if (PTR_ERR (pp) != -EINPROGRESS )NAPI_GRO_CB (skb)->flush |= flush; } +static inline void skb_gro_flush_final_remcsum (struct sk_buff *skb, +struct sk_buff **pp, +int flush, +struct gro_remcsum *grc) +{ +if (PTR_ERR (pp) != -EINPROGRESS ) { +NAPI_GRO_CB (skb)->flush |= flush; +skb_gro_remcsum_cleanup (skb, grc); + skb->remcsum_offload =0 ; + } +}#else static inline void skb_gro_flush_final (struct sk_buff *skb,struct sk_buff **pp,int flush) {NAPI_GRO_CB (skb)->flush |= flush; } +static inline void skb_gro_flush_final_remcsum (struct sk_buff *skb, +struct sk_buff **pp, +int flush, +struct gro_remcsum *grc) +{ +NAPI_GRO_CB (skb)->flush |= flush; +skb_gro_remcsum_cleanup (skb, grc); + skb->remcsum_offload =0 ; +}#endif static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev,
include/net/pkt_cls.h +5 -0
@@ -111,6 +111,11 @@ void tcf_block_put_ext(struct tcf_block *block, struct Qdisc *q, { } +static inline bool tcf_block_shared (struct tcf_block *block) +{ +return false; +} +static inline struct Qdisc *tcf_block_q (struct tcf_block *block) {return NULL ;
kernel/bpf/core.c +19 -6
@@ -1513,6 +1513,17 @@ static int bpf_check_tail_call(const struct bpf_prog *fp)return 0 ; } +static void bpf_prog_select_func (struct bpf_prog *fp) +{ +#ifndef CONFIG_BPF_JIT_ALWAYS_ON +u32 stack_depth =max_t (u32, fp->aux->stack_depth,1 ); + + fp->bpf_func = interpreters[(round_up (stack_depth,32 ) /32 ) -1 ]; +#else + fp->bpf_func = __bpf_prog_ret0_warn; +#endif +} +/** * bpf_prog_select_runtime - select exec runtime for BPF program * @fp: bpf_prog populated with internal BPF program
@@ -1523,13 +1534,13 @@ static int bpf_check_tail_call(const struct bpf_prog *fp)*/ struct bpf_prog *bpf_prog_select_runtime (struct bpf_prog *fp,int *err) { -#ifndef CONFIG_BPF_JIT_ALWAYS_ON -u32 stack_depth =max_t (u32, fp->aux->stack_depth,1 ); +/* In case of BPF to BPF calls, verifier did all the prep +* work with regards to JITing, etc. +*/ +if (fp->bpf_func) + goto finalize; - fp->bpf_func = interpreters[(round_up (stack_depth,32 ) /32 ) -1 ]; -#else - fp->bpf_func = __bpf_prog_ret0_warn; -#endif +bpf_prog_select_func (fp);/* eBPF JITs can rewrite the program in case constant * blinding is active. However, in case of error during
@@ -1550,6 +1561,8 @@ struct bpf_prog *bpf_prog_select_runtime(struct bpf_prog *fp, int *err)if (*err)return fp; } + +finalize:bpf_prog_lock_ro (fp);/* The tail call compatibility check can only be done at
kernel/bpf/sockmap.c +52 -11
100 lines not on this page · raw message
kernel/bpf/syscall.c +1 -3
@@ -1328,9 +1328,7 @@ static int bpf_prog_load(union bpf_attr *attr)if (err <0 ) goto free_used_maps; -/* eBPF program is ready to be JITed */ -if (!prog->bpf_func) - prog =bpf_prog_select_runtime (prog, &err); + prog =bpf_prog_select_runtime (prog, &err);if (err <0 ) goto free_used_maps;
kernel/bpf/verifier.c +9 -2
@@ -5349,6 +5349,10 @@ static int jit_subprogs(struct bpf_verifier_env *env)if (insn->code != (BPF_JMP |BPF_CALL ) || insn->src_reg !=BPF_PSEUDO_CALL )continue ; +/* Upon error here we cannot fall back to interpreter but +* need a hard reject of the program. Thus -EFAULT is +* propagated in any case. +*/ subprog =find_subprog (env, i + insn->imm +1 );
Lines of this file are not shown. View the raw message.
net/ipv6/netfilter/nf_conntrack_reasm.c +2 -0
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.