# git rev-parse -q --verify 8f5b27347e88b171c755562f0090ce40e514fc00^{commit} 8f5b27347e88b171c755562f0090ce40e514fc00 already have revision, skipping fetch # git checkout -q -f -B kisskb 8f5b27347e88b171c755562f0090ce40e514fc00 # git clean -qxdf # < git log -1 # commit 8f5b27347e88b171c755562f0090ce40e514fc00 # Author: Alexey Kardashevskiy # Date: Mon Feb 18 16:58:01 2019 +1100 # # powerpc/powernv/sriov: Register IOMMU groups for VFs # # The compound IOMMU group rework moved iommu_register_group() together # in pnv_pci_ioda_setup_iommu_api() (which is a part of # ppc_md.pcibios_fixup). As the result, pnv_ioda_setup_bus_iommu_group() # does not create groups any more, it only adds devices to groups. # # This works fine for boot time devices. However IOMMU groups for # SRIOV's VFs were added by pnv_ioda_setup_bus_iommu_group() so this got # broken: pnv_tce_iommu_bus_notifier() expects a group to be registered # for VF and it is not. # # This adds missing group registration and adds a NULL pointer check # into the bus notifier so we won't crash if there is no group, although # it is not expected to happen now because of the change above. # # Example oops seen prior to this patch: # # $ echo 1 > /sys/bus/pci/devices/0000\:01\:00.0/sriov_numvfs # Unable to handle kernel paging request for data at address 0x00000030 # Faulting instruction address: 0xc0000000004a6018 # Oops: Kernel access of bad area, sig: 11 [#1] # LE SMP NR_CPUS=2048 NUMA PowerNV # CPU: 46 PID: 7006 Comm: bash Not tainted 4.15-ish # NIP: c0000000004a6018 LR: c0000000004a6014 CTR: 0000000000000000 # REGS: c000008fc876b400 TRAP: 0300 Not tainted (4.15-ish) # MSR: 900000000280b033 # CFAR: c000000000d0be20 DAR: 0000000000000030 DSISR: 40000000 SOFTE: 1 # ... # NIP sysfs_do_create_link_sd.isra.0+0x68/0x150 # LR sysfs_do_create_link_sd.isra.0+0x64/0x150 # Call Trace: # pci_dev_type+0x0/0x30 (unreliable) # iommu_group_add_device+0x8c/0x600 # iommu_add_device+0xe8/0x180 # pnv_tce_iommu_bus_notifier+0xb0/0xf0 # notifier_call_chain+0x9c/0x110 # blocking_notifier_call_chain+0x64/0xa0 # device_add+0x524/0x7d0 # pci_device_add+0x248/0x450 # pci_iov_add_virtfn+0x294/0x3e0 # pci_enable_sriov+0x43c/0x580 # mlx5_core_sriov_configure+0x15c/0x2f0 [mlx5_core] # sriov_numvfs_store+0x180/0x240 # dev_attr_store+0x3c/0x60 # sysfs_kf_write+0x64/0x90 # kernfs_fop_write+0x1ac/0x240 # __vfs_write+0x3c/0x70 # vfs_write+0xd8/0x220 # SyS_write+0x6c/0x110 # system_call+0x58/0x6c # # Fixes: 0bd971676e68 ("powerpc/powernv/npu: Add compound IOMMU groups") # Signed-off-by: Alexey Kardashevskiy # Reported-by: Santwana Samantray # Signed-off-by: Michael Ellerman # < /opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux-ld --version # < git log --format=%s --max-count=1 8f5b27347e88b171c755562f0090ce40e514fc00 # < make -s -j 8 ARCH=powerpc O=/kisskb/build/powerpc-fixes_mpc85xx_smp_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- mpc85xx_smp_defconfig # make -s -j 8 ARCH=powerpc O=/kisskb/build/powerpc-fixes_mpc85xx_smp_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- In file included from /kisskb/src/include/linux/kernel.h:10:0, from /kisskb/src/include/linux/list.h:9, from /kisskb/src/include/linux/module.h:9, from /kisskb/src/drivers/net/ethernet/freescale/fs_enet/mac-scc.c:15: /kisskb/src/drivers/net/ethernet/freescale/fs_enet/mac-scc.c: In function 'allocate_bd': /kisskb/src/include/linux/err.h:22:49: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO) ^ /kisskb/src/include/linux/compiler.h:77:42: note: in definition of macro 'unlikely' # define unlikely(x) __builtin_expect(!!(x), 0) ^ /kisskb/src/drivers/net/ethernet/freescale/fs_enet/mac-scc.c:139:6: note: in expansion of macro 'IS_ERR_VALUE' if (IS_ERR_VALUE(fep->ring_mem_addr)) ^ /kisskb/src/arch/powerpc/boot/dts/fsl/mpc8541cds.dts:334.3-21: Warning (pci_device_bus_num): /pci@e0008000/i8259@19000:bus-range: PCI bus number 1 out of range, expected (0 - 0) /kisskb/src/arch/powerpc/boot/dts/fsl/mpc8555cds.dts:334.3-21: Warning (pci_device_bus_num): /pci@e0008000/i8259@19000:bus-range: PCI bus number 1 out of range, expected (0 - 0) INFO: Uncompressed kernel (size 0xc296d0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xc296d0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xc296d0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xc296d0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xc296d0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xc296d0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xc296d0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xc18e9c) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) Image Name: Linux-5.0.0-rc1-g8f5b27347e88 Created: Tue Feb 19 13:22:56 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5983452 Bytes = 5843.21 KiB = 5.71 MiB Load Address: 00000000 Entry Point: 00000000 INFO: Uncompressed kernel (size 0xc296d0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) Image Name: Linux-5.0.0-rc1-g8f5b27347e88 Created: Tue Feb 19 13:22:56 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6013922 Bytes = 5872.97 KiB = 5.74 MiB Load Address: 00d00000 Entry Point: 00d00314 INFO: Uncompressed kernel (size 0xc296d0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) Image Name: Linux-5.0.0-rc1-g8f5b27347e88 Created: Tue Feb 19 13:22:56 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6013718 Bytes = 5872.77 KiB = 5.74 MiB Load Address: 00d00000 Entry Point: 00d002a4 Image Name: Linux-5.0.0-rc1-g8f5b27347e88 Created: Tue Feb 19 13:22:56 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6013874 Bytes = 5872.92 KiB = 5.74 MiB Load Address: 00d00000 Entry Point: 00d002a4 INFO: Uncompressed kernel (size 0xc296d0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xc296d0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) Image Name: Linux-5.0.0-rc1-g8f5b27347e88 Created: Tue Feb 19 13:22:56 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6014383 Bytes = 5873.42 KiB = 5.74 MiB Load Address: 00d00000 Entry Point: 00d002a4 INFO: Uncompressed kernel (size 0xc296d0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) Image Name: Linux-5.0.0-rc1-g8f5b27347e88 Created: Tue Feb 19 13:22:56 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6013872 Bytes = 5872.92 KiB = 5.74 MiB Load Address: 00d00000 Entry Point: 00d002a4 INFO: Uncompressed kernel (size 0xc296d0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) Image Name: Linux-5.0.0-rc1-g8f5b27347e88 Created: Tue Feb 19 13:22:57 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6013886 Bytes = 5872.94 KiB = 5.74 MiB Load Address: 00d00000 Entry Point: 00d002a4 Image Name: Linux-5.0.0-rc1-g8f5b27347e88 Created: Tue Feb 19 13:22:57 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6013855 Bytes = 5872.91 KiB = 5.74 MiB Load Address: 00d00000 Entry Point: 00d002a4 INFO: Uncompressed kernel (size 0xc296d0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) INFO: Uncompressed kernel (size 0xc296d0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xd00000) Image Name: Linux-5.0.0-rc1-g8f5b27347e88 Created: Tue Feb 19 13:22:59 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6014481 Bytes = 5873.52 KiB = 5.74 MiB Load Address: 00d00000 Entry Point: 00d002a4 Image Name: Linux-5.0.0-rc1-g8f5b27347e88 Created: Tue Feb 19 13:22:59 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6013665 Bytes = 5872.72 KiB = 5.74 MiB Load Address: 00d00000 Entry Point: 00d002a4 Image Name: Linux-5.0.0-rc1-g8f5b27347e88 Created: Tue Feb 19 13:22:59 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6013704 Bytes = 5872.76 KiB = 5.74 MiB Load Address: 00d00000 Entry Point: 00d00314 Image Name: Linux-5.0.0-rc1-g8f5b27347e88 Created: Tue Feb 19 13:23:00 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6013941 Bytes = 5872.99 KiB = 5.74 MiB Load Address: 00d00000 Entry Point: 00d00314 Image Name: Linux-5.0.0-rc1-g8f5b27347e88 Created: Tue Feb 19 13:23:00 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6013899 Bytes = 5872.95 KiB = 5.74 MiB Load Address: 00d00000 Entry Point: 00d002a4 Image Name: Linux-5.0.0-rc1-g8f5b27347e88 Created: Tue Feb 19 13:23:00 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6013705 Bytes = 5872.76 KiB = 5.74 MiB Load Address: 00d00000 Entry Point: 00d00314 Image Name: Linux-5.0.0-rc1-g8f5b27347e88 Created: Tue Feb 19 13:23:00 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6013766 Bytes = 5872.82 KiB = 5.74 MiB Load Address: 00d00000 Entry Point: 00d00314 Image Name: Linux-5.0.0-rc1-g8f5b27347e88 Created: Tue Feb 19 13:23:00 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 6013913 Bytes = 5872.96 KiB = 5.74 MiB Load Address: 00d00000 Entry Point: 00d002a4 Completed OK # rm -rf /kisskb/build/powerpc-fixes_mpc85xx_smp_defconfig_powerpc-gcc5 # Build took: 0:02:44.237548