# 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_ppc40x_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- ppc40x_defconfig # make -s -j 8 ARCH=powerpc O=/kisskb/build/powerpc-fixes_ppc40x_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- /kisskb/src/arch/powerpc/kernel/head_40x.S: Assembler messages: /kisskb/src/arch/powerpc/kernel/head_40x.S:883: Warning: invalid register expression INFO: Uncompressed kernel (size 0x53d708) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x53d708) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x52d028) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x53d708) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) Image Name: Linux-5.0.0-rc1-g8f5b27347e88 Created: Tue Feb 19 13:05:26 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2659314 Bytes = 2596.99 KiB = 2.54 MiB Load Address: 00000000 Entry Point: 00000000 INFO: Uncompressed kernel (size 0x53d708) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) Image Name: Linux-5.0.0-rc1-g8f5b27347e88 Created: Tue Feb 19 13:05:26 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2693288 Bytes = 2630.16 KiB = 2.57 MiB Load Address: 00600000 Entry Point: 00601a18 Image Name: Linux-5.0.0-rc1-g8f5b27347e88 Created: Tue Feb 19 13:05:26 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2692846 Bytes = 2629.73 KiB = 2.57 MiB Load Address: 00600000 Entry Point: 006017dc Completed OK # rm -rf /kisskb/build/powerpc-fixes_ppc40x_defconfig_powerpc-gcc5 # Build took: 0:01:04.256932