ARM: sunxi: Add machine match for the Allwinner V3 SoC
Subsystems (9)
Sasha Levin
maintainerPATCH 8/15 drm/amd/display: Prevent bandwidth overflow
In reply to Sasha LevinFrom: Chris Park <[email protected]>
[ Upstream commit 80089dd8410f356d5104496d5ab71a66a4f4646b ]
[Why]
At very high pixel clock, bandwidth calculation exceeds 32 bit size and overflow value. This causes the resulting selection of link rate to be inaccurate.
[How]
Change order of operation and use fixed point to deal with integer accuracy. Also address bug found when forcing link rate.
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +5 -2
@@ -3394,10 +3394,13 @@ uint32_t dc_bandwidth_in_kbps_from_timing( {uint32_t bits_per_channel =0 ;uint32_t kbps; +struct fixed31_32 link_bw_kbps;if (timing->flags.DSC) { - kbps = (timing->pix_clk_100hz * timing->dsc_cfg.bits_per_pixel); - kbps = kbps /160 + ((kbps %160 ) ?1 :0 ); + link_bw_kbps =dc_fixpt_from_int (timing->pix_clk_100hz); + link_bw_kbps =dc_fixpt_div_int (link_bw_kbps,160 ); + link_bw_kbps =dc_fixpt_mul_int (link_bw_kbps, timing->dsc_cfg.bits_per_pixel); + kbps =dc_fixpt_ceil (link_bw_kbps);return kbps; }
Signature · 6 lines
2.27.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Sasha Levin
maintainerPATCH 9/15 drm/amdkfd: Fix leak in dmabuf import
In reply to Sasha LevinFrom: Felix Kuehling <[email protected]>
[ Upstream commit c897934da15f182ce99536007f8ef61c4748c07e ]
Release dmabuf reference before returning from kfd_ioctl_import_dmabuf. amdgpu_amdkfd_gpuvm_import_dmabuf takes a reference to the underlying GEM BO and doesn't keep the reference to the dmabuf wrapper.
--- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +2 -0
@@ -1729,6 +1729,7 @@ static int kfd_ioctl_import_dmabuf(struct file *filep, }mutex_unlock (&p->mutex); +dma_buf_put (dmabuf); args->handle =MAKE_HANDLE (args->gpu_id, idr_handle);
@@ -1738,6 +1739,7 @@ static int kfd_ioctl_import_dmabuf(struct file *filep,amdgpu_amdkfd_gpuvm_free_memory_of_gpu (dev->kgd, (struct kgd_mem *)mem,NULL ); err_unlock:mutex_unlock (&p->mutex); +dma_buf_put (dmabuf);return r; }
Signature · 6 lines
2.27.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Sasha Levin
maintainerPATCH 1/15 ARM: sunxi: Add machine match for the Allwinner V3 SoC
From: Paul Kocialkowski <[email protected]>
[ Upstream commit ad2091f893bd5dfe2824f0d6819600d120698e9f ]
The Allwinner V3 SoC shares the same base as the V3s but comes with extra pins and features available. As a result, it has its dedicated compatible string (already used in device trees), which is added here.
--- arch/arm/mach-sunxi/sunxi.c | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-sunxi/sunxi.c +1 -0
@@ -66,6 +66,7 @@ static const char * const sun8i_board_dt_compat[] = {"allwinner,sun8i-h2-plus" ,"allwinner,sun8i-h3" ,"allwinner,sun8i-r40" , +"allwinner,sun8i-v3" ,"allwinner,sun8i-v3s" , NULL, };
Signature · 1 line
2.27.0
Sasha Levin
maintainerPATCH 2/15 pNFS/flexfiles: Fix array overflow when flexfiles mirroring is enabled
From: Trond Myklebust <[email protected]>
[ Upstream commit 63e2fffa59a9dd91e443b08832656399fd80b7f0 ]
If the flexfiles mirroring is enabled, then the read code expects to be able to set pgio->pg_mirror_idx to point to the data server that is being used for this particular read. However it does not change the pg_mirror_count because we only need to send a single read.
--- fs/nfs/flexfilelayout/flexfilelayout.c | 27 ++++++++++++++----- fs/nfs/pagelist.c | 36 +++++++++++++++++++------- include/linux/nfs_page.h | 4 +++ 3 files changed, 52 insertions(+), 15 deletions(-)
fs/nfs/flexfilelayout/flexfilelayout.c +21 -6
@@ -838,7 +838,7 @@ ff_layout_pg_init_read(struct nfs_pageio_descriptor *pgio,struct nfs_pgio_mirror *pgm;struct nfs4_ff_layout_mirror *mirror;struct nfs4_pnfs_ds *ds; -u32 ds_idx, i; +u32 ds_idx; retry:ff_layout_pg_check_layout (pgio, req);
@@ -864,11 +864,9 @@ ff_layout_pg_init_read(struct nfs_pageio_descriptor *pgio, goto retry; } -for (i =0 ; i < pgio->pg_mirror_count; i++) { - mirror =FF_LAYOUT_COMP (pgio->pg_lseg, i); - pgm = &pgio->pg_mirrors[i]; - pgm->pg_bsize = mirror->mirror_ds->ds_versions[0 ].rsize; - } + mirror =FF_LAYOUT_COMP (pgio->pg_lseg, ds_idx); + pgm = &pgio->pg_mirrors[0 ]; + pgm->pg_bsize = mirror->mirror_ds->ds_versions[0 ].rsize; pgio->pg_mirror_idx = ds_idx;
@@ -985,6 +983,21 @@ ff_layout_pg_get_mirror_count_write(struct nfs_pageio_descriptor *pgio,return 1 ; } +static u32 +ff_layout_pg_set_mirror_write (struct nfs_pageio_descriptor *desc,u32 idx) +{ +u32 old = desc->pg_mirror_idx; + + desc->pg_mirror_idx = idx; +return old; +} + +static struct nfs_pgio_mirror * +ff_layout_pg_get_mirror_write (struct nfs_pageio_descriptor *desc,u32 idx) +{ +return &desc->pg_mirrors[idx]; +} +static const struct nfs_pageio_ops ff_layout_pg_read_ops = { .pg_init = ff_layout_pg_init_read, .pg_test = pnfs_generic_pg_test,
@@ -998,6 +1011,8 @@ static const struct nfs_pageio_ops ff_layout_pg_write_ops = { .pg_doio = pnfs_generic_pg_writepages, .pg_get_mirror_count = ff_layout_pg_get_mirror_count_write, .pg_cleanup = pnfs_generic_pg_cleanup, + .pg_get_mirror = ff_layout_pg_get_mirror_write, + .pg_set_mirror = ff_layout_pg_set_mirror_write, };static void ff_layout_reset_write (struct nfs_pgio_header *hdr,bool retry_pnfs)
fs/nfs/pagelist.c +27 -9
@@ -31,13 +31,29 @@static struct kmem_cache *nfs_page_cachep;static const struct rpc_call_ops nfs_pgio_common_ops; +static struct nfs_pgio_mirror * +nfs_pgio_get_mirror (struct nfs_pageio_descriptor *desc,u32 idx) +{ +if (desc->pg_ops->pg_get_mirror) +return desc->pg_ops->pg_get_mirror (desc, idx); +return &desc->pg_mirrors[0 ]; +} +struct nfs_pgio_mirror *nfs_pgio_current_mirror (struct nfs_pageio_descriptor *desc) { -return &desc->pg_mirrors[desc->pg_mirror_idx]; +return nfs_pgio_get_mirror (desc, desc->pg_mirror_idx); }EXPORT_SYMBOL_GPL (nfs_pgio_current_mirror); +static u32 +nfs_pgio_set_current_mirror (struct nfs_pageio_descriptor *desc,u32 idx) +{ +if (desc->pg_ops->pg_set_mirror) +return desc->pg_ops->pg_set_mirror (desc, idx); +return desc->pg_mirror_idx; +} +void nfs_pgheader_init (struct nfs_pageio_descriptor *desc,struct nfs_pgio_header *hdr,void (*release)(struct nfs_pgio_header *hdr))
@@ -1259,7 +1275,7 @@ static void nfs_pageio_error_cleanup(struct nfs_pageio_descriptor *desc)return ;for (midx =0 ; midx < desc->pg_mirror_count; midx++) { - mirror = &desc->pg_mirrors[midx]; + mirror =nfs_pgio_get_mirror (desc, midx); desc->pg_completion_ops->error_cleanup (&mirror->pg_list, desc->pg_error); }
@@ -1293,12 +1309,12 @@ int nfs_pageio_add_request(struct nfs_pageio_descriptor *desc, goto out_failed; } - desc->pg_mirror_idx = midx; +nfs_pgio_set_current_mirror (desc, midx);if (!nfs_pageio_add_request_mirror (desc, dupreq)) goto out_cleanup_subreq; } - desc->pg_mirror_idx =0 ; +nfs_pgio_set_current_mirror (desc,0 );if (!nfs_pageio_add_request_mirror (desc, req)) goto out_failed;
@@ -1320,10 +1336,12 @@ int nfs_pageio_add_request(struct nfs_pageio_descriptor *desc,static void nfs_pageio_complete_mirror (struct nfs_pageio_descriptor *desc,u32 mirror_idx) { -struct nfs_pgio_mirror *mirror = &desc->pg_mirrors[mirror_idx]; -u32 restore_idx = desc->pg_mirror_idx; +struct nfs_pgio_mirror *mirror; +u32 restore_idx; + + restore_idx =nfs_pgio_set_current_mirror (desc, mirror_idx); + mirror =nfs_pgio_current_mirror (desc); - desc->pg_mirror_idx = mirror_idx;for (;;) {nfs_pageio_doio (desc);if (desc->pg_error <0 || !mirror->pg_recoalesce)
@@ -1331,7 +1349,7 @@ static void nfs_pageio_complete_mirror(struct nfs_pageio_descriptor *desc,if (!nfs_do_recoalesce (desc))break ; } - desc->pg_mirror_idx = restore_idx; +nfs_pgio_set_current_mirror (desc, restore_idx); }/*
@@ -1405,7 +1423,7 @@ void nfs_pageio_cond_complete(struct nfs_pageio_descriptor *desc, pgoff_t index)u32 midx;for (midx =0 ; midx < desc->pg_mirror_count; midx++) { - mirror = &desc->pg_mirrors[midx]; + mirror =nfs_pgio_get_mirror (desc, midx);if (!list_empty (&mirror->pg_list)) { prev =nfs_list_entry (mirror->pg_list.prev);if (index != prev->wb_index +1 ) {
include/linux/nfs_page.h +4 -0
@@ -55,6 +55,7 @@ struct nfs_page {unsigned short wb_nio;/* Number of I/O attempts */ }; +struct nfs_pgio_mirror ;struct nfs_pageio_descriptor ;struct nfs_pageio_ops {void (*pg_init)(struct nfs_pageio_descriptor *,struct nfs_page *);
@@ -64,6 +65,9 @@ struct nfs_pageio_ops {unsigned int (*pg_get_mirror_count)(struct nfs_pageio_descriptor *,struct nfs_page *);void (*pg_cleanup)(struct nfs_pageio_descriptor *); +struct nfs_pgio_mirror * + (*pg_get_mirror)(struct nfs_pageio_descriptor *,u32 ); +u32 (*pg_set_mirror)(struct nfs_pageio_descriptor *,u32 ); };struct nfs_rw_ops {
Signature · 1 line
2.27.0
Sasha Levin
maintainerPATCH 3/15 cfg80211: initialize rekey_data
In reply to Sasha LevinFrom: Sara Sharon <[email protected]>
[ Upstream commit f495acd8851d7b345e5f0e521b2645b1e1f928a0 ]
In case we have old supplicant, the akm field is uninitialized.
--- net/wireless/nl80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/wireless/nl80211.c +1 -1
@@ -12348,7 +12348,7 @@ static int nl80211_set_rekey_data(struct sk_buff *skb, struct genl_info *info)struct net_device *dev = info->user_ptr[1 ];struct wireless_dev *wdev = dev->ieee80211_ptr;struct nlattr *tb[NUM_NL80211_REKEY_DATA ]; -struct cfg80211_gtk_rekey_data rekey_data; +struct cfg80211_gtk_rekey_data rekey_data = {};int err;if (!info->attrs[NL80211_ATTR_REKEY_DATA ])
Signature · 1 line
2.27.0
Sasha Levin
maintainerPATCH 4/15 ethernet: select CONFIG_CRC32 as needed
In reply to Sasha LevinFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 0b32e91fdfd87314af9943e69eb85a88adb4233c ]
A number of ethernet drivers require crc32 functionality to be avaialable in the kernel, causing a link error otherwise:
arm-linux-gnueabi-ld: drivers/net/ethernet/agere/et131x.o: in function `et1310_setup_device_for_multicast':
et131x.c:(.text+0x5918): undefined reference to `crc32_le'
arm-linux-gnueabi-ld: drivers/net/ethernet/cadence/macb_main.o: in function `macb_start_xmit':
macb_main.c:(.text+0x4b88): undefined reference to `crc32_le'
arm-linux-gnueabi-ld: drivers/net/ethernet/faraday/ftgmac100.o: in function `ftgmac100_set_rx_mode':
ftgmac100.c:(.text+0x2b38): undefined reference to `crc32_le'
arm-linux-gnueabi-ld: drivers/net/ethernet/freescale/fec_main.o: in function `set_multicast_list':
fec_main.c:(.text+0x6120): undefined reference to `crc32_le'
arm-linux-gnueabi-ld: drivers/net/ethernet/freescale/fman/fman_dtsec.o: in function `dtsec_add_hash_mac_address':
fman_dtsec.c:(.text+0x830): undefined reference to `crc32_le'
arm-linux-gnueabi-ld: drivers/net/ethernet/freescale/fman/fman_dtsec.o:fman_dtsec.c:(.text+0xb68): more undefined references to `crc32_le' follow
arm-linux-gnueabi-ld: drivers/net/ethernet/netronome/nfp/nfpcore/nfp_hwinfo.o: in function `nfp_hwinfo_read':
nfp_hwinfo.c:(.text+0x250): undefined reference to `crc32_be'
arm-linux-gnueabi-ld: nfp_hwinfo.c:(.text+0x288): undefined reference to `crc32_be'
arm-linux-gnueabi-ld: drivers/net/ethernet/netronome/nfp/nfpcore/nfp_resource.o: in function `nfp_resource_acquire':
nfp_resource.c:(.text+0x144): undefined reference to `crc32_be'
arm-linux-gnueabi-ld: nfp_resource.c:(.text+0x158): undefined reference to `crc32_be'
arm-linux-gnueabi-ld: drivers/net/ethernet/nxp/lpc_eth.o: in function `lpc_eth_set_multicast_list':
lpc_eth.c:(.text+0x1934): undefined reference to `crc32_le'
arm-linux-gnueabi-ld: drivers/net/ethernet/rocker/rocker_ofdpa.o: in function `ofdpa_flow_tbl_do':
rocker_ofdpa.c:(.text+0x2e08): undefined reference to `crc32_le'
arm-linux-gnueabi-ld: drivers/net/ethernet/rocker/rocker_ofdpa.o: in function `ofdpa_flow_tbl_del':
rocker_ofdpa.c:(.text+0x3074): undefined reference to `crc32_le'
arm-linux-gnueabi-ld: drivers/net/ethernet/rocker/rocker_ofdpa.o: in function `ofdpa_port_fdb':
arm-linux-gnueabi-ld: drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.o: in function `mlx5dr_ste_calc_hash_index':
dr_ste.c:(.text+0x354): undefined reference to `crc32_le'
arm-linux-gnueabi-ld: drivers/net/ethernet/microchip/lan743x_main.o: in function `lan743x_netdev_set_multicast':
lan743x_main.c:(.text+0x5dc4): undefined reference to `crc32_le'
Add the missing 'select CRC32' entries in Kconfig for each of them.
--- drivers/net/ethernet/agere/Kconfig | 1 + drivers/net/ethernet/cadence/Kconfig | 1 + drivers/net/ethernet/faraday/Kconfig | 1 + drivers/net/ethernet/freescale/Kconfig | 1 + drivers/net/ethernet/freescale/fman/Kconfig | 1 + drivers/net/ethernet/mellanox/mlx5/core/Kconfig | 1 + drivers/net/ethernet/microchip/Kconfig | 1 + drivers/net/ethernet/netronome/Kconfig | 1 + drivers/net/ethernet/nxp/Kconfig | 1 + drivers/net/ethernet/rocker/Kconfig | 1 + 10 files changed, 10 insertions(+)
drivers/net/ethernet/agere/Kconfig +1 -0
@@ -21,6 +21,7 @@ config ET131X tristate "Agere ET-1310 Gigabit Ethernet support" depends on PCI select PHYLIB + select CRC32 help This driver supports Agere ET-1310 ethernet adapters.
drivers/net/ethernet/cadence/Kconfig +1 -0
@@ -23,6 +23,7 @@ config MACB tristate "Cadence MACB/GEM support" depends on HAS_DMA && COMMON_CLK select PHYLINK + select CRC32 help The Cadence MACB ethernet interface is found on many Atmel AT32 and AT91 parts. This driver also supports the Cadence GEM (Gigabit
drivers/net/ethernet/faraday/Kconfig +1 -0
@@ -33,6 +33,7 @@ config FTGMAC100 depends on !64BIT || BROKEN select PHYLIB select MDIO_ASPEED if MACH_ASPEED_G6 + select CRC32 help This driver supports the FTGMAC100 Gigabit Ethernet controller from Faraday. It is used on Faraday A369, Andes AG102 and some
drivers/net/ethernet/freescale/Kconfig +1 -0
@@ -25,6 +25,7 @@ config FEC depends on (M523x || M527x || M5272 || M528x || M520x || M532x || \ ARCH_MXC || SOC_IMX28 || COMPILE_TEST) default ARCH_MXC || SOC_IMX28 if ARM + select CRC32 select PHYLIB imply PTP_1588_CLOCK help
drivers/net/ethernet/freescale/fman/Kconfig +1 -0
@@ -4,6 +4,7 @@ config FSL_FMAN depends on FSL_SOC || ARCH_LAYERSCAPE || COMPILE_TEST select GENERIC_ALLOCATOR select PHYLIB + select CRC32 default n help Freescale Data-Path Acceleration Architecture Frame Manager
drivers/net/ethernet/mellanox/mlx5/core/Kconfig +1 -0
@@ -198,6 +198,7 @@ config MLX5_EN_TLS config MLX5_SW_STEERING bool "Mellanox Technologies software-managed steering" depends on MLX5_CORE_EN && MLX5_ESWITCH + select CRC32 default y help Build support for software-managed steering in the NIC.
drivers/net/ethernet/microchip/Kconfig +1 -0
@@ -47,6 +47,7 @@ config LAN743X depends on PCI select PHYLIB select CRC16 + select CRC32 help Support for the Microchip LAN743x PCI Express Gigabit Ethernet chip
drivers/net/ethernet/netronome/Kconfig +1 -0
@@ -22,6 +22,7 @@ config NFP depends on VXLAN || VXLAN=n depends on TLS && TLS_DEVICE || TLS_DEVICE=n select NET_DEVLINK + select CRC32 help This driver supports the Netronome(R) NFP4000/NFP6000 based cards working as a advanced Ethernet NIC. It works with both
drivers/net/ethernet/nxp/Kconfig +1 -0
@@ -3,6 +3,7 @@ config LPC_ENET tristate "NXP ethernet MAC on LPC devices" depends on ARCH_LPC32XX || COMPILE_TEST select PHYLIB + select CRC32 help Say Y or M here if you want to use the NXP ethernet MAC included on some NXP LPC devices. You can safely enable this option for LPC32xx
drivers/net/ethernet/rocker/Kconfig +1 -0
@@ -19,6 +19,7 @@ if NET_VENDOR_ROCKER config ROCKER tristate "Rocker switch driver (EXPERIMENTAL)" depends on PCI && NET_SWITCHDEV && BRIDGE + select CRC32 help This driver supports Rocker switch device.
Signature · 1 line
2.27.0
Sasha Levin
maintainerPATCH 5/15 fix namespaced fscaps when !CONFIG_SECURITY
In reply to Sasha LevinFrom: Serge Hallyn <[email protected]>
[ Upstream commit ed9b25d1970a4787ac6a39c2091e63b127ecbfc1 ]
Namespaced file capabilities were introduced in 8db6c34f1dbc . When userspace reads an xattr for a namespaced capability, a virtualized representation of it is returned if the caller is in a user namespace owned by the capability's owning rootid. The function which performs this virtualization was not hooked up if CONFIG_SECURITY=n. Therefore in that case the original xattr was shown instead of the virtualized one.
To test this using libcap-bin (*1),
$ v=$(mktemp) $ unshare -Ur setcap cap_sys_admin-eip $v $ unshare -Ur setcap -v cap_sys_admin-eip $v /tmp/tmp.lSiIFRvt8Y: OK
"setcap -v" verifies the values instead of setting them, and will check whether the rootid value is set. Therefore, with this bug un-fixed, and with CONFIG_SECURITY=n, setcap -v will fail:
$ v=$(mktemp) $ unshare -Ur setcap cap_sys_admin=eip $v $ unshare -Ur setcap -v cap_sys_admin=eip $v nsowner[got=1000, want=0],/tmp/tmp.HHDiOOl9fY differs in []
Fix this bug by calling cap_inode_getsecurity() in security_inode_getsecurity() instead of returning -EOPNOTSUPP, when CONFIG_SECURITY=n.
*1 - note, if libcap is too old for getcap to have the '-n' option, then use verify-caps instead.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=209689
--- include/linux/security.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/security.h +1 -1
@@ -864,7 +864,7 @@ static inline int security_inode_killpriv(struct dentry *dentry)static inline int security_inode_getsecurity (struct inode *inode,const char *name,void **buffer,bool alloc) { -return -EOPNOTSUPP ; +return cap_inode_getsecurity (inode, name, buffer, alloc); }static inline int security_inode_setsecurity (struct inode *inode,const char *name,const void *value,size_t size,int flags)
Signature · 1 line
2.27.0
Sasha Levin
maintainerPATCH 7/15 net: stmmac: increase the timeout for dma reset
In reply to Sasha LevinFrom: Fugang Duan <[email protected]>
[ Upstream commit 9d14edfdeabf37d8d8f045e63e5873712aadcd6b ]
Current timeout value is not enough for gmac5 dma reset on imx8mp platform, increase the timeout range.
--- drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c +1 -1
@@ -22,7 +22,7 @@ int dwmac4_dma_reset(void __iomem *ioaddr)return readl_poll_timeout (ioaddr +DMA_BUS_MODE , value, !(value &DMA_BUS_MODE_SFT_RESET ), -10000 ,100000 ); +10000 ,1000000 ); }void dwmac4_set_rx_tail_ptr (void __iomem *ioaddr,u32 tail_ptr,u32 chan)
Signature · 7 lines
2.27.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 14/15 elfcore: fix building with clang
In reply to Sasha LevinFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 6e7b64b9dd6d96537d816ea07ec26b7dedd397b9 ]
kernel/elfcore.c only contains weak symbols, which triggers a bug with clang in combination with recordmcount:
Cannot find symbol for section 2: .text.
kernel/elfcore.o: failed
Move the empty stubs into linux/elfcore.h as inline functions. As only two architectures use these, just use the architecture specific Kconfig symbols to key off the declaration.
--- include/linux/elfcore.h | 22 ++++++++++++++++++++++ kernel/Makefile | 1 - kernel/elfcore.c | 26 -------------------------- 3 files changed, 22 insertions(+), 27 deletions(-) delete mode 100644 kernel/elfcore.c
include/linux/elfcore.h +22 -0
@@ -104,6 +104,7 @@ static inline int elf_core_copy_task_fpregs(struct task_struct *t, struct pt_reg#endif } +#if defined(CONFIG_UM ) || defined(CONFIG_IA64 )/* * These functions parameterize elf_core_dump in fs/binfmt_elf.c to write out * extra segments containing the gate DSO contents. Dumping its
@@ -118,5 +119,26 @@ elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset);extern int elf_core_write_extra_data (struct coredump_params *cprm);extern size_t elf_core_extra_data_size (void ); +#else +static inline Elf_Half elf_core_extra_phdrs (void ) +{ +return 0 ; +} + +static inline int elf_core_write_extra_phdrs (struct coredump_params *cprm,loff_t offset) +{ +return 1 ; +} + +static inline int elf_core_write_extra_data (struct coredump_params *cprm) +{ +return 1 ; +} + +static inline size_t elf_core_extra_data_size (void ) +{ +return 0 ; +} +#endif #endif /* _LINUX_ELFCORE_H */
kernel/Makefile +0 -1
@@ -100,7 +100,6 @@ obj-$(CONFIG_TASK_DELAY_ACCT) += delayacct.o obj-$(CONFIG_TASKSTATS) += taskstats.o tsacct.o obj-$(CONFIG_TRACEPOINTS) += tracepoint.o obj-$(CONFIG_LATENCYTOP) += latencytop.o -obj-$(CONFIG_ELFCORE) += elfcore.o obj-$(CONFIG_FUNCTION_TRACER) += trace/ obj-$(CONFIG_TRACING) += trace/ obj-$(CONFIG_TRACE_CLOCK) += trace/
kernel/elfcore.c deleted +0 -26
@@ -1,26 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include <linux/elf.h> -#include <linux/fs.h> -#include <linux/mm.h> -#include <linux/binfmts.h> -#include <linux/elfcore.h> - -Elf_Half __weak elf_core_extra_phdrs (void ) -{ -return 0 ; -} - -int __weak elf_core_write_extra_phdrs (struct coredump_params *cprm,loff_t offset) -{ -return 1 ; -} - -int __weak elf_core_write_extra_data (struct coredump_params *cprm) -{ -return 1 ; -} - -size_t __weak elf_core_extra_data_size (void ) -{ -return 0 ; -}
Signature · 1 line
2.27.0
Sasha Levin
maintainerPATCH 12/15 selftests/bpf: Fix "dubious pointer arithmetic" test
In reply to Sasha LevinFrom: Jean-Philippe Brucker <[email protected]>
[ Upstream commit 3615bdf6d9b19db12b1589861609b4f1c6a8d303 ]
The verifier trace changed following a bugfix. After checking the 64-bit sign, only the upper bit mask is known, not bit 31. Update the test accordingly.
--- tools/testing/selftests/bpf/prog_tests/align.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
tools/testing/selftests/bpf/prog_tests/align.c +4 -4
@@ -456,10 +456,10 @@ static struct bpf_align_test tests[] = {*/ {7, "R5_w=inv(id=0,smin_value=-9223372036854775806,smax_value=9223372036854775806,umin_value=2,umax_value=18446744073709551614,var_off=(0x2; 0xfffffffffffffffc)"},/* Checked s>=0 */ - {9, "R5=inv(id=0,umin_value=2,umax_value=9223372034707292158,var_off=(0x2; 0x7fffffff7ffffffc)"}, + {9, "R5=inv(id=0,umin_value=2,umax_value=9223372036854775806,var_off=(0x2; 0x7ffffffffffffffc)"},/* packet pointer + nonnegative (4n+2) */ - {11, "R6_w=pkt(id=1,off=0,r=0,umin_value=2,umax_value=9223372034707292158,var_off=(0x2; 0x7fffffff7ffffffc)"}, - {13, "R4_w=pkt(id=1,off=4,r=0,umin_value=2,umax_value=9223372034707292158,var_off=(0x2; 0x7fffffff7ffffffc)"}, + {11, "R6_w=pkt(id=1,off=0,r=0,umin_value=2,umax_value=9223372036854775806,var_off=(0x2; 0x7ffffffffffffffc)"}, + {13, "R4_w=pkt(id=1,off=4,r=0,umin_value=2,umax_value=9223372036854775806,var_off=(0x2; 0x7ffffffffffffffc)"},/* NET_IP_ALIGN + (4n+2) == (4n), alignment is fine. * We checked the bounds, but it might have been able * to overflow if the packet pointer started in the
@@ -467,7 +467,7 @@ static struct bpf_align_test tests[] = {* So we did not get a 'range' on R6, and the access * attempt will fail. */ - {15, "R6_w=pkt(id=1,off=0,r=0,umin_value=2,umax_value=9223372034707292158,var_off=(0x2; 0x7fffffff7ffffffc)"}, + {15, "R6_w=pkt(id=1,off=0,r=0,umin_value=2,umax_value=9223372036854775806,var_off=(0x2; 0x7ffffffffffffffc)"}, } }, {
Signature · 1 line
2.27.0
Sasha Levin
maintainerPATCH 15/15 Input: goodix - add upside-down quirk for Teclast X98 Pro tablet
In reply to Sasha LevinFrom: Simon Beginn <[email protected]>
[ Upstream commit cffdd6d90482316e18d686060a4397902ea04bd2 ]
The touchscreen on the Teclast x98 Pro is also mounted upside-down in relation to the display orientation.
--- drivers/input/touchscreen/goodix.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/input/touchscreen/goodix.c +12 -0
@@ -192,6 +192,18 @@ static const struct dmi_system_id rotated_screen[] = { DMI_MATCH(DMI_BIOS_DATE, "12/19/2014"), }, }, + { + .ident = "Teclast X98 Pro", + .matches = { +/* +* Only match BIOS date, because the manufacturers +* BIOS does not report the board name at all +* (sometimes)... +*/ +DMI_MATCH (DMI_BOARD_VENDOR ,"TECLAST" ), + DMI_MATCH(DMI_BIOS_DATE, "10/28/2015"), + }, + }, { .ident ="WinBook TW100" , .matches = {
Signature · 1 line
2.27.0
Sasha Levin
maintainerPATCH 6/15 lwt: Disable BH too in run_lwt_bpf()
In reply to Sasha LevinFrom: Dongdong Wang <[email protected]>
[ Upstream commit d9054a1ff585ba01029584ab730efc794603d68f ]
The per-cpu bpf_redirect_info is shared among all skb_do_redirect() and BPF redirect helpers. Callers on RX path are all in BH context, disabling preemption is not sufficient to prevent BH interruption.
In production, we observed strange packet drops because of the race condition between LWT xmit and TC ingress, and we verified this issue is fixed after we disable BH.
Although this bug was technically introduced from the beginning, that is commit 3a0af8fd61f9 ("bpf: BPF for lightweight tunnel infrastructure"), at that time call_rcu() had to be call_rcu_bh() to match the RCU context. So this patch may not work well before RCU flavor consolidation has been completed around v5.0.
Update the comments above the code too, as call_rcu() is now BH friendly.
--- net/core/lwt_bpf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
net/core/lwt_bpf.c +4 -4
@@ -39,12 +39,11 @@ static int run_lwt_bpf(struct sk_buff *skb, struct bpf_lwt_prog *lwt, {int ret; -/* Preempt disable is needed to protect per-cpu redirect_info between -* BPF prog and skb_do_redirect(). The call_rcu in bpf_prog_put() and -* access to maps strictly require a rcu_read_lock() for protection, -* mixing with BH RCU lock doesn't work. +/* Preempt disable and BH disable are needed to protect per-cpu +* redirect_info between BPF prog and skb_do_redirect(). */ preempt_disable (); +local_bh_disable ();bpf_compute_data_pointers (skb); ret =bpf_prog_run_save_cb (lwt->prog, skb);
@@ -78,6 +77,7 @@ static int run_lwt_bpf(struct sk_buff *skb, struct bpf_lwt_prog *lwt,break ; } +local_bh_enable ();preempt_enable ();return ret;
Signature · 1 line
2.27.0
Sasha Levin
maintainerPATCH 13/15 initramfs: fix clang build failure
In reply to Sasha LevinFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 55d5b7dd6451b58489ce384282ca5a4a289eb8d5 ]
There is only one function in init/initramfs.c that is in the .text section, and it is marked __weak. When building with clang-12 and the integrated assembler, this leads to a bug with recordmcount:
./scripts/recordmcount "init/initramfs.o"
Cannot find symbol for section 2: .text.
init/initramfs.o: failed
I'm not quite sure what exactly goes wrong, but I notice that this function is only ever called from an __init function, and normally inlined. Marking it __init as well is clearly correct and it leads to recordmcount no longer complaining.
--- init/initramfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
init/initramfs.c +1 -1
@@ -535,7 +535,7 @@ extern unsigned long __initramfs_size;#include <linux/initrd.h> #include <linux/kexec.h> -void __weak free_initrd_mem (unsigned long start,unsigned long end) +void __weak __init free_initrd_mem (unsigned long start,unsigned long end) {#ifdef CONFIG_ARCH_KEEP_MEMBLOCK unsigned long aligned_start =ALIGN_DOWN (start,PAGE_SIZE );
Signature · 1 line
2.27.0
Sasha Levin
maintainerPATCH 11/15 selftests/bpf: Fix array access with signed variable test
In reply to Sasha LevinFrom: Jean-Philippe Brucker <[email protected]>
[ Upstream commit 77ce220c0549dcc3db8226c61c60e83fc59dfafc ]
The test fails because of a recent fix to the verifier, even though this program is valid. In details what happens is:
7: (61) r1 = *(u32 *)(r0 +0)
Load a 32-bit value, with signed bounds [S32_MIN, S32_MAX]. The bounds of the 64-bit value are [0, U32_MAX]...
8: (65) if r1 s> 0xffffffff goto pc+1
... therefore this is always true (the operand is sign-extended).
10: (b4) w2 = 11
11: (6d) if r2 s> r1 goto pc+1When true, the 64-bit bounds become [0, 10]. The 32-bit bounds are still [S32_MIN, 10].
13: (64) w1 <<= 2
Because this is a 32-bit operation, the verifier propagates the new 32-bit bounds to the 64-bit ones, and the knowledge gained from insn 11 is lost.
14: (0f) r0 += r1
15: (7a) *(u64 *)(r0 +0) = 4Then the verifier considers r0 unbounded here, rejecting the test. To make the test work, change insn 8 to check the sign of the 32-bit value.
--- tools/testing/selftests/bpf/verifier/array_access.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/bpf/verifier/array_access.c +1 -1
@@ -68,7 +68,7 @@BPF_RAW_INSN (BPF_JMP |BPF_CALL ,0 ,0 ,0 , BPF_FUNC_map_lookup_elem),BPF_JMP_IMM (BPF_JEQ ,BPF_REG_0 ,0 ,9 ),BPF_LDX_MEM (BPF_W ,BPF_REG_1 ,BPF_REG_0 ,0 ), -BPF_JMP_IMM (BPF_JSGT ,BPF_REG_1 ,0xffffffff ,1 ), +BPF_JMP32_IMM (BPF_JSGT ,BPF_REG_1 ,0xffffffff ,1 ),BPF_MOV32_IMM (BPF_REG_1 ,0 ),BPF_MOV32_IMM (BPF_REG_2 ,MAX_ENTRIES ), BPF_JMP_REG(BPF_JSGT, BPF_REG_2, BPF_REG_1, 1),
Signature · 1 line
2.27.0
Sasha Levin
maintainerPATCH 10/15 Input: cros_ec_keyb - send 'scancodes' in addition to key events
In reply to Sasha LevinFrom: Dmitry Torokhov <[email protected]>
[ Upstream commit 80db2a087f425b63f0163bc95217abd01c637cb5 ]
To let userspace know what 'scancodes' should be used in EVIOCGKEYCODE and EVIOCSKEYCODE ioctls, we should send EV_MSC/MSC_SCAN events in addition to EV_KEY/KEY_* events. The driver already declared MSC_SCAN capability, so it is only matter of actually sending the events.
--- drivers/input/keyboard/cros_ec_keyb.c | 1 + 1 file changed, 1 insertion(+)
drivers/input/keyboard/cros_ec_keyb.c +1 -0
@@ -183,6 +183,7 @@ static void cros_ec_keyb_process(struct cros_ec_keyb *ckdev,"changed: [r%d c%d]: byte %02x\n" , row, col, new_state); +input_event (idev,EV_MSC ,MSC_SCAN , pos);input_report_key (idev, keycodes[pos], new_state); }
Signature · 1 line
2.27.0