- 24 11月, 2022 40 次提交
-
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit 9806eb5c category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 9806eb5c dmaengine: idxd: set descriptor allocation size to threshold for swq. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Since submission is sent to limited portal, the actual wq size for shared wq is set by the threshold rather than the wq size. When the wq type is shared, set the allocated descriptors to the threshold. Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162827151733.3459223.3829837172226042408.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit 0b030f54 category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 0b030f54 dmaengine: idxd: make submit failure path consistent on desc freeing. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- The submission path for dmaengine API does not do descriptor freeing on failure. Also, with the abort mechanism, the freeing of descriptor happens when the abort callback is completed. Therefore free descriptor on all error paths for submission call to make things consistent. Also remove the double free that would happen on abort in idxd_dma_tx_submit() call. Fixes: 6b4b87f2 ("dmaengine: idxd: fix submission race window") Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162827146072.3459011.10255348500504659810.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit 9fce3b3a category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 9fce3b3a dmaengine: idxd: remove interrupt flag for completion list spinlock. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- The list lock is never acquired in interrupt context. Therefore there is no need to disable interrupts. Remove interrupt flags for lock operations. Reviewed-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162826417450.3454650.3733188117742416238.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit d803c8b9 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit d803c8b9 dmaengine: idxd: make I/O interrupt handler one shot. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- The interrupt thread handler currently loops forever to process outstanding completions. This causes either an "irq X: nobody cared" kernel splat or the NMI watchdog kicks in due to running too long in the function. The irq thread handler is expected to run again after exiting if there are interrupts fired while the thread handler is running. So the handler code can process all the completed I/O in a single pass and exit without losing the follow on completed I/O. Reviewed-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162802977005.3084234.11836261157026497585.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit bd2f4ae5 category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit bd2f4ae5 dmaengine: idxd: clear block on fault flag when clear wq. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- The block on fault flag is not cleared when we disable or reset wq. This causes it to remain set if the user does not clear it on the next configuration load. Add clear of flag in dxd_wq_disable_cleanup() routine. Fixes: da32b28c ("dmaengine: idxd: cleanup workqueue config after disabling") Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162803023553.3086015.8158952172068868803.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit 81c2f79c category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 81c2f79c dmaengine: idxd: add capability check for 'block on fault' attribute. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- The device general capability has a bit that indicate whether 'block on fault' is supported. Add check to wq sysfs knob to check if cap exists before allowing user to toggle. Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162802992615.3084999.12539468940404102898.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Nathan Chancellor 提交于
mainline inclusion from mainline-v5.15 commit 53cbf462 category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 53cbf462 dmaengine: idxd: Remove unused status variable in irq_process_work_list(). Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- status is no longer used within this block: drivers/dma/idxd/irq.c:255:6: warning: unused variable 'status' [-Wunused-variable] u8 status = desc->completion->status & DSA_COMP_STATUS_MASK; ^ 1 warning generated. Fixes: b60bb6e2 ("dmaengine: idxd: fix abort status check") Signed-off-by: NNathan Chancellor <nathan@kernel.org> Acked-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/20210802175820.3153920-1-nathan@kernel.orgSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Christophe JAILLET 提交于
mainline inclusion from mainline-v5.15 commit e9c5b0b5 category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit e9c5b0b5 dmaengine: idxd: Fix a possible NULL pointer dereference. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- 'device_driver_attach()' dereferences its first argument (i.e. 'alt_drv') so it must not be NULL. Simplify the error handling logic about NULL 'alt_drv' in order to be more robust and future-proof. Fixes: 568b2126 ("dmaengine: idxd: fix uninit var for alt_drv") Fixes: 6e7f3ee9 ("dmaengine: idxd: move dsa_drv support to compatible mode") Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr> Acked-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/77f0dc4f3966591d1f0cffb614a94085f8895a85.1627560174.git.christophe.jaillet@wanadoo.frSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit b60bb6e2 category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit b60bb6e2 dmaengine: idxd: fix abort status check. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Coverity static analysis of linux-next found issue. The check (status == IDXD_COMP_DESC_ABORT) is always false since status was previously masked with 0x7f and IDXD_COMP_DESC_ABORT is 0xff. Fixes: 6b4b87f2 ("dmaengine: idxd: fix submission race window") Reported-by: NColin Ian King <colin.king@canonical.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162698465160.3560828.18173186265683415384.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit 125d1037 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 125d1037 dmanegine: idxd: add software command status. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Enabling device and wq returns standard errno and that does not provide enough details to indicate what exactly failed. The hardware command status is only 8bits. Expand the command status to 32bits and use the upper 16 bits to define software errors to provide more details on the exact failure. Bit 31 will be used to indicate the error is software set as the driver is using some of the spec defined hardware error as well. Cc: Ramesh Thomas <ramesh.thomas@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162681373579.1968485.5891788397526827892.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit a9c17152 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit a9c17152 dmaengine: idxd: rotate portal address for better performance. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- The device submission portal is on a 4k page and any of those 64bit aligned address on the page can be used for descriptor submission. By rotating the offset through the 4k range and prevent successive writes to the same MMIO address, performance improvement is observed through testing. Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162681372446.1968485.10634280461681015569.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit 568b2126 category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 568b2126 dmaengine: idxd: fix uninit var for alt_drv. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- 0-day detected uninitialized alt_drv variable in the bind_store() function. The branch can be taken when device is not idxd device or wq 'struct device'. Init alt_drv to NULL. Fixes: 6e7f3ee9 ("dmaengine: idxd: move dsa_drv support to compatible mode") Reported-by: Nkernel test robot <lkp@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162689250332.2114335.636367120454420852.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit ade8a86b category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit ade8a86b dmaengine: idxd: Set defaults for GRPCFG traffic class. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Set GRPCFG traffic class to value of 1 for best performance on current generation of accelerators. Also add override option to allow experimentation. Sysfs knobs are disabled for DSA/IAX gen1 devices. Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162681373005.1968485.3761065664382799202.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit 0e96454c category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 0e96454c dmaengine: idxd: remove fault processing code. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Kernel memory are pinned and will not cause faults. Since the driver does not support interrupts for user descriptors, no fault errors are expected to come through the misc interrupt. Remove dead code. Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162630502789.631986.10591230961790023856.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit 6e7f3ee9 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/i596wo cve: na Intel-SIG: commit 6e7f3ee9 dmaengine: idxd: move dsa_drv support to compatible mode. incremental backporting patches for dsa/iaa on intel xeon platform. -------------------------------- The original architecture of /sys/bus/dsa invented a scheme whereby a single entry in the list of bus drivers, /sys/bus/drivers/dsa, handled all device types and internally routed them to different different drivers. Those internal drivers were invisible to userspace. With the idxd driver transitioned to a proper bus device-driver model, the legacy behavior needs to be preserved due to it being exposed to user space via sysfs. Create a compat driver to provide the legacy behavior for /sys/bus/dsa/drivers/dsa. This should satisfy user tool accel-config v3.2 or ealier where this behavior is expected. If the distro has a newer accel-config then the legacy mode does not need to be enabled. When the compat driver binds the device (i.e. dsa0) to the dsa driver, it will be bound to the new idxd_drv. The wq device (i.e. wq0.0) will be bound to either the dmaengine_drv or the user_drv. The dsa_drv becomes a routing mechansim for the new drivers. It will not support additional external drivers that are implemented later. Reviewed-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162637468705.744545.4399080971745974435.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit d9e5481f category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit d9e5481f dmaengine: dsa: move dsa_bus_type out of idxd driver to standalone. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- In preparation for dsa_drv compat support to be built-in, move the bus code to its own compilation unit. A follow-on patch adds the compat implementation. Recall that the compat implementation allows for the deprecated / omnibus dsa_drv binding scheme rather than the idiomatic organization of a full fledged bus driver per driver type. Reviewed-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162637468142.744545.2811632736881720857.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit 448c3de8 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 448c3de8 dmaengine: idxd: create user driver for wq 'device'. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- The original architecture of /sys/bus/dsa invented a scheme whereby a single entry in the list of bus drivers, /sys/bus/drivers/dsa, handled all device types and internally routed them to different drivers. Those internal drivers were invisible to userspace. Now, as /sys/bus/dsa wants to grow support for alternate drivers for a given device, for example vfio-mdev instead of kernel-internal-dmaengine, a proper bus device-driver model is needed. The first step in that process is separating the existing omnibus/implicit "dsa" driver into proper individual drivers registered on /sys/bus/dsa. Establish the idxd_user_drv driver that controls the enabling and disabling of the wq and also register and unregister a char device to allow user space to mmap the descriptor submission portal. The cdev related bits are moved to the cdev driver probe/remove and out of the drv_enabe/disable_wq() calls. These bits are exclusive to the cdev operation and not part of the generic enable/disable of the wq device. Reviewed-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162637467578.744545.10203997610072341376.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit 0cda4f69 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 0cda4f69 dmaengine: idxd: create dmaengine driver for wq 'device'. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- The original architecture of /sys/bus/dsa invented a scheme whereby a single entry in the list of bus drivers, /sys/bus/drivers/dsa, handled all device types and internally routed them to different drivers. Those internal drivers were invisible to userspace. Now, as /sys/bus/dsa wants to grow support for alternate drivers for a given device, for example vfio-mdev instead of kernel-internal-dmaengine, a proper bus device-driver model is needed. The first step in that process is separating the existing omnibus/implicit "dsa" driver into proper individual drivers registered on /sys/bus/dsa. Establish the idxd_dmaengine_drv driver that controls the enabling and disabling of the wq and also register and unregister the dma channel. idxd_wq_alloc_resources() and idxd_wq_free_resources() also get moved to the dmaengine driver. The resources (dma descriptors allocation and setup) are only used by the dmaengine driver and should only happen when it loads. The char dev driver (cdev) related bits are left in the __drv_enable_wq() and __drv_disable_wq() calls to be moved when we split out the char dev driver just like how the dmaengine driver is split out. WQ autoload support is not expected currently. With the amount of configuration needed for the device, the wq is always expected to be enabled by a tool (or via sysfs) rather than auto enabled at driver load. Reviewed-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162637467033.744545.12330636655625405394.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit 034b3290 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 034b3290 dmaengine: idxd: create idxd_device sub-driver. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- The original architecture of /sys/bus/dsa invented a scheme whereby a single entry in the list of bus drivers, /sys/bus/drivers/dsa, handled all device types and internally routed them to different drivers. Those internal drivers were invisible to userspace. Now, as /sys/bus/dsa wants to grow support for alternate drivers for a given device, for example vfio-mdev instead of kernel-internal-dmaengine, a proper bus device-driver model is needed. The first step in that process is separating the existing omnibus/implicit "dsa" driver into proper individual drivers registered on /sys/bus/dsa. Establish the idxd_drv driver that control the enabling and disabling of the accelerator device. Reviewed-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162637466439.744545.15210886092627144577.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit 5fee6567 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 5fee6567 dmaengine: idxd: add type to driver in order to allow device matching. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Add an array of support device types to the idxd_device_driver definition in order to enable simple matching of device type to a given driver. The deprecated / omnibus dsa_drv driver specifies IDXD_DEV_NONE as its only role is to service legacy userspace (old accel-config) directed bind requests and route them to them the proper driver. It need not attach to a device when the bus is autoprobed. The accel-config tooling is being updated to drop its dependency on this deprecated bind scheme. Reviewed-by: NDan Willliams <dan.j.williams@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162637465882.744545.17456174666211577867.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit c05257b5 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit c05257b5 dmanegine: idxd: open code the dsa_drv registration. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Don't need a wrapper to register the driver. Just do it directly. Reviewed-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162637465319.744545.16325178432532362906.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit 745e92a6 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 745e92a6 dmaengine: idxd: idxd: move remove() bits for idxd 'struct device' to device.c. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Move the code related to a ->remove() function for the idxd 'struct device' to device.c to prep for the idxd device sub-driver in device.c. Reviewed-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162637464768.744545.15797285510999151668.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit bd42805b category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit bd42805b dmaengine: idxd: move probe() bits for idxd 'struct device' to device.c. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Move the code related to a ->probe() function for the idxd 'struct device' to device.c to prep for the idxd device sub-driver in device.c. Reviewed-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162637464189.744545.17423830646786162194.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit fcc2281b category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit fcc2281b dmaengine: idxd: fix bus_probe() and bus_remove() for dsa_bus. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Current implementation have put all the code that should be in a driver probe/remove in the bus probe/remove function. Add ->probe() and ->remove() support for the dsa_drv and move all those code out of bus probe/remove. The change does not split out the distinction between device sub-driver and wq sub-driver. It only cleans up the bus calls. The split out will be addressed in follow on patches. Reviewed-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162637463586.744545.5806250155539938643.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit 1c264299 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 1c264299 dmaengine: idxd: remove iax_bus_type prototype. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Remove unused iax_bus_type prototype declaration. Should have been removed when iax_bus_type was removed. Reviewed-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162637462909.744545.7106049898386277608.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit 3a5cc016 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 3a5cc016 dmaengine: idxd: remove bus shutdown. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Remove ->shutdown() function for the dsa bus as it does not do anything and is not necessary. Reviewed-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162637462319.744545.10383189484257042066.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit 69e4f8be category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 69e4f8be dmaengine: idxd: move wq_disable() to device.c. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Move the wq_disable() function to device.c in preparation of setting up the idxd internal sub-driver framework. No logic changes. Reviewed-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162637461775.744545.9644048686618957886.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit 1f2bb403 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 1f2bb403 dmaengine: idxd: move wq_enable() to device.c. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Move the wq_enable() function to device.c in preparation of setting up the idxd internal sub-driver framework. No logic changes. Reviewed-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162637461176.744545.3806109011554118998.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit f52058ae category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit f52058ae dmaengine: idxd: remove IDXD_DEV_CONF_READY. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- The IDXD_DEV_CONF_READY state flag is no longer needed. The current implementation uses this flag to stop the device from doing configuration until the pci driver probe has completed. With the driver architecture going towards multiple sub-driver attached to the dsa_bus, this is no longer feasible. The sub-drivers will be allowed to probe and return with failure when they are not ready to complete the probe rather than using a state flag to gate the probing. There is no expectation that the devices auto-attach to a driver. Userspace configuration is expected to setup the device before enabling. Reviewed-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162637460633.744545.8902095097471365420.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit 700af3a0 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 700af3a0 dmaengine: idxd: add 'struct idxd_dev' as wrapper for conf_dev. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Add a 'struct idxd_dev' that wraps the 'struct device' for idxd conf_dev that registers with the dsa bus. This is introduced in order to deal with multiple different types of 'devices' that are registered on the dsa_bus when the compat driver needs to route them to the correct driver to attach. The bind() call now can determine the type of device and then do the appropriate driver matching. Reviewed-by Dan Williams <dan.j.williams@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162637460065.744545.584492831446090984.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit da5a11d7 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit da5a11d7 dmaengine: idxd: add driver name. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Add name field in idxd_device_driver so we don't have to touch the 'struct device_driver' during declaration. Reviewed-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162637459517.744545.7572915135318813722.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit 3ecfc913 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 3ecfc913 dmaengine: idxd: add driver register helper. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Add helper functions for dsa-driver registration similar to other bus-types. In particular, do not require dsa-drivers to open-code the bus, owner, and mod_name fields. Let registration and unregistration operate on the 'struct idxd_device_driver' instead of the raw / embedded 'struct device_driver'. Reviewed-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162637458949.744545.14996726325385482050.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit 53499d1f category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 53499d1f dmaengine: idxd: have command status always set. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- The cached command status is only set when the write back status is is passed in. Move the variable set outside of the check so it is always set. Fixes: 0d5c10b4 ("dmaengine: idxd: add work queue drain support") Reported-by: NRamesh Thomas <ramesh.thomas@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162274329740.1822314.3443875665504707588.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit e753a64b category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit e753a64b dmaengine: idxd: Add wq occupancy information to sysfs attribute. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Add occupancy information to wq sysfs attribute. Attribute will show wq occupancy data if "WQ Occupancy Support" field in WQCAP is 1. It displays the number of entries currently in this WQ. This is provided as an estimate and should not be relied on to determine whether there is space in the WQ. The data is to provide information to user apps for flow control. Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162275745546.1857062.8765615879420582018.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit 0dcfe41e category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 0dcfe41e dmanegine: idxd: cleanup all device related bits after disabling device. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- The previous state cleanup patch only performed wq state cleanups. This does not go far enough as when device is disabled or reset, the state for groups and engines must also be cleaned up. Add additional state cleanup beyond wq cleanup. Tie those cleanups directly to device disable and reset, and wq disable and reset. Fixes: da32b28c ("dmaengine: idxd: cleanup workqueue config after disabling") Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162285154108.2096632.5572805472362321307.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Christophe JAILLET 提交于
mainline inclusion from mainline-v5.15 commit 53b50458 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 53b50458 dmaengine: idxd: Simplify code and axe the use of a deprecated API. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- The wrappers in include/linux/pci-dma-compat.h should go away. Replace 'pci_set_dma_mask/pci_set_consistent_dma_mask' by an equivalent and less verbose 'dma_set_mask_and_coherent()' call. Even if the code may look different, it should have exactly the same run-time behavior. If pci_set_dma_mask(64) fails and pci_set_dma_mask(32) succeeds, then pci_set_consistent_dma_mask(64) will also fail. Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr> Acked-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/70c8a3bc67e41c5fefb526ecd64c5174c1e2dc76.1625720835.git.christophe.jaillet@wanadoo.frSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.14 commit 6b4b87f2 category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 6b4b87f2 dmaengine: idxd: fix submission race window. Incremental backporting patches for DSA/IAA on Intel Xeon platform. Deviation from upstream: Merge commit 88c5d0a2 Merge branch 'fixes' into next. -------------------------------- Konstantin observed that when descriptors are submitted, the descriptor is added to the pending list after the submission. This creates a race window with the slight possibility that the descriptor can complete before it gets added to the pending list and this window would cause the completion handler to miss processing the descriptor. To address the issue, the addition of the descriptor to the pending list must be done before it gets submitted to the hardware. However, submitting to swq with ENQCMDS instruction can cause a failure with the condition of either wq is full or wq is not "active". With the descriptor allocation being the gate to the wq capacity, it is not possible to hit a retry with ENQCMDS submission to the swq. The only possible failure can happen is when wq is no longer "active" due to hw error and therefore we are moving towards taking down the portal. Given this is a rare condition and there's no longer concern over I/O performance, the driver can walk the completion lists in order to retrieve and abort the descriptor. The error path will set the descriptor to aborted status. It will take the work list lock to prevent further processing of worklist. It will do a delete_all on the pending llist to retrieve all descriptors on the pending llist. The delete_all action does not require a lock. It will walk through the acquired llist to find the aborted descriptor while add all remaining descriptors to the work list since it holds the lock. If it does not find the aborted descriptor on the llist, it will walk through the work list. And if it still does not find the descriptor, then it means the interrupt handler has removed the desc from the llist but is pending on the work list lock and will process it once the error path releases the lock. Fixes: eb15e715 ("dmaengine: idxd: add interrupt handle request and release support") Reported-by: NKonstantin Ananyev <konstantin.ananyev@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162628855747.360485.10101925573082466530.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.14 commit 7eb25da1 category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 7eb25da1 dmaengine: idxd: fix sequence for pci driver remove() and shutdown(). Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- ->shutdown() call should only be responsible for quiescing the device. Currently it is doing PCI device tear down. This causes issue when things like MMIO mapping is removed while idxd_unregister_devices() will trigger removal of idxd device sub-driver and still initiates MMIO writes to the device. Another issue is with the unregistering of idxd 'struct device', the memory context gets freed. So the teardown calls are accessing freed memory and can cause kernel oops. Move all the teardown bits that doesn't belong in shutdown to ->remove() call. Move unregistering of the idxd conf_dev 'struct device' to after doing all the teardown to free all the memory that's no longer needed. Fixes: 47c16ac2 ("dmaengine: idxd: fix idxd conf_dev 'struct device' lifetime") Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162629983901.395844.17964803190905549615.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.14 commit d5c10e0f category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit d5c10e0f dmaengine: idxd: fix setup sequence for MSIXPERM table. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- The MSIX permission table should be programmed BEFORE request_irq() happens. This prevents any possibility of an interrupt happening before the MSIX perm table is setup, however slight. Fixes: 6df0e6c5 ("dmaengine: idxd: clear MSIX permission entry on shutdown") Sign-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162456741222.1138073.1298447364671237896.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit 6cfd9e62 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 6cfd9e62 dmaengine: idxd: assign MSIX vectors to each WQ rather than roundrobin. Incremental backporting patches for DSA/IAA on Intel Xeon platform. Deviation from upstream: Merge commit da435aed dmaengine: idxd: fix array index when int_handles are being used. -------------------------------- IOPS increased when changing MSIX vector to per WQ from roundrobin. Allows descriptor to be completed by the submitter improves caching locality. Suggested-by: NKonstantin Ananyev <konstantin.ananyev@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Acked-by: NKonstantin Ananyev <konstantin.ananyev@intel.com> Link: https://lore.kernel.org/r/162456717326.1130457.15258077196523268356.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-