# git rev-parse -q --verify 7f92891778dff62303c070ac81de7b7d80de331a^{commit} 7f92891778dff62303c070ac81de7b7d80de331a already have revision, skipping fetch # git checkout -q -f -B kisskb 7f92891778dff62303c070ac81de7b7d80de331a # git clean -qxdf # < git log -1 # commit 7f92891778dff62303c070ac81de7b7d80de331a # Author: Alexey Kardashevskiy # Date: Thu Dec 20 12:10:36 2018 +1100 # # vfio_pci: Add NVIDIA GV100GL [Tesla V100 SXM2] subdriver # # POWER9 Witherspoon machines come with 4 or 6 V100 GPUs which are not # pluggable PCIe devices but still have PCIe links which are used # for config space and MMIO. In addition to that the GPUs have 6 NVLinks # which are connected to other GPUs and the POWER9 CPU. POWER9 chips # have a special unit on a die called an NPU which is an NVLink2 host bus # adapter with p2p connections to 2 to 3 GPUs, 3 or 2 NVLinks to each. # These systems also support ATS (address translation services) which is # a part of the NVLink2 protocol. Such GPUs also share on-board RAM # (16GB or 32GB) to the system via the same NVLink2 so a CPU has # cache-coherent access to a GPU RAM. # # This exports GPU RAM to the userspace as a new VFIO device region. This # preregisters the new memory as device memory as it might be used for DMA. # This inserts pfns from the fault handler as the GPU memory is not onlined # until the vendor driver is loaded and trained the NVLinks so doing this # earlier causes low level errors which we fence in the firmware so # it does not hurt the host system but still better be avoided; for the same # reason this does not map GPU RAM into the host kernel (usual thing for # emulated access otherwise). # # This exports an ATSD (Address Translation Shootdown) register of NPU which # allows TLB invalidations inside GPU for an operating system. The register # conveniently occupies a single 64k page. It is also presented to # the userspace as a new VFIO device region. One NPU has 8 ATSD registers, # each of them can be used for TLB invalidation in a GPU linked to this NPU. # This allocates one ATSD register per an NVLink bridge allowing passing # up to 6 registers. Due to the host firmware bug (just recently fixed), # only 1 ATSD register per NPU was actually advertised to the host system # so this passes that alone register via the first NVLink bridge device in # the group which is still enough as QEMU collects them all back and # presents to the guest via vPHB to mimic the emulated NPU PHB on the host. # # In order to provide the userspace with the information about GPU-to-NVLink # connections, this exports an additional capability called "tgt" # (which is an abbreviated host system bus address). The "tgt" property # tells the GPU its own system address and allows the guest driver to # conglomerate the routing information so each GPU knows how to get directly # to the other GPUs. # # For ATS to work, the nest MMU (an NVIDIA block in a P9 CPU) needs to # know LPID (a logical partition ID or a KVM guest hardware ID in other # words) and PID (a memory context ID of a userspace process, not to be # confused with a linux pid). This assigns a GPU to LPID in the NPU and # this is why this adds a listener for KVM on an IOMMU group. A PID comes # via NVLink from a GPU and NPU uses a PID wildcard to pass it through. # # This requires coherent memory and ATSD to be available on the host as # the GPU vendor only supports configurations with both features enabled # and other configurations are known not to work. Because of this and # because of the ways the features are advertised to the host system # (which is a device tree with very platform specific properties), # this requires enabled POWERNV platform. # # The V100 GPUs do not advertise any of these capabilities via the config # space and there are more than just one device ID so this relies on # the platform to tell whether these GPUs have special abilities such as # NVLinks. # # Signed-off-by: Alexey Kardashevskiy # Acked-by: Alex Williamson # Signed-off-by: Michael Ellerman # < /opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux-gcc --version # < /opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux-ld --version # < git log --format=%s --max-count=1 7f92891778dff62303c070ac81de7b7d80de331a # < make -s -j 120 ARCH=powerpc O=/kisskb/build/powerpc-next_pmac32_defconfig+kexec_powerpc CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- pmac32_defconfig # Added to kconfig configs/2006/11/29/pmac32_defconfigkexec # yes \n | make -s -j 120 ARCH=powerpc O=/kisskb/build/powerpc-next_pmac32_defconfig+kexec_powerpc CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- oldconfig yes: standard output: Broken pipe # make -s -j 120 ARCH=powerpc O=/kisskb/build/powerpc-next_pmac32_defconfig+kexec_powerpc CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux- /kisskb/src/kernel/printk/printk.c: In function 'devkmsg_sysctl_set_loglvl': /kisskb/src/kernel/printk/printk.c:186:16: warning: 'old' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/base/regmap/regmap.c: In function 'regmap_raw_read': /kisskb/src/drivers/base/regmap/regmap.c:2594:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/sound/ppc/awacs.c: In function 'snd_pmac_awacs_init': /kisskb/src/include/sound/control.h:223:2: warning: 'speaker_vol' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/sound/ppc/awacs.c:886:36: note: 'speaker_vol' was declared here /kisskb/src/drivers/base/regmap/regmap.c: In function '_regmap_raw_write': /kisskb/src/drivers/base/regmap/regmap.c:1855:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/dma-buf/reservation.c: In function 'reservation_object_add_shared_fence': /kisskb/src/drivers/dma-buf/reservation.c:226:6: warning: 'k' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/tty/serial/8250/8250_core.c: In function 'univ8250_release_irq': /kisskb/src/drivers/tty/serial/8250/8250_core.c:247:18: warning: 'i' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/tty/serial/8250/8250_core.c:227:19: note: 'i' was declared here /kisskb/src/drivers/i2c/i2c-core-base.c: In function 'i2c_generic_scl_recovery': /kisskb/src/drivers/i2c/i2c-core-base.c:235:5: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/proc/inode.c: In function 'proc_reg_open': /kisskb/src/include/linux/list.h:65:12: warning: 'pdeo' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/proc/inode.c:341:21: note: 'pdeo' was declared here /kisskb/src/drivers/net/tun.c: In function 'tun_get_user': /kisskb/src/drivers/net/tun.c:1819:30: warning: 'copylen' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/net/tun.c:1729:46: warning: 'linear' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/nfsd/nfs4xdr.c: In function 'nfsd4_encode_components_esc': /kisskb/src/fs/nfsd/nfs4xdr.c:2076:9: warning: 'str' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/net/wireless/broadcom/b43/phy_n.c: In function 'b43_nphy_rf_ctl_override_rev7': /kisskb/src/drivers/net/wireless/broadcom/b43/phy_n.c:202:21: warning: 'val_addr' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/fs/udf/unicode.c: In function 'udf_name_conv_char': /kisskb/src/fs/udf/unicode.c:132:8: warning: 'c' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/net/mac80211/mlme.c: In function 'ieee80211_rx_mgmt_beacon': /kisskb/src/net/mac80211/mlme.c:1513:3: warning: 'pwr_level_cisco' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/net/mac80211/mlme.c:1470:6: note: 'pwr_level_cisco' was declared here INFO: Uncompressed kernel (size 0x8e4774) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x900000) Completed OK # rm -rf /kisskb/build/powerpc-next_pmac32_defconfig+kexec_powerpc # Build took: 0:00:46.973862