- 24 11月, 2022 32 次提交
-
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.15 commit f9f4082d category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit f9f4082d dmaengine: idxd: remove interrupt disable for cmd_lock. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- The cmd_lock spinlock is not being used in hard interrupt context. There is no need to disable irq when acquiring the lock. Convert all cmd_lock acquisition to plain spin_lock() calls. Reviewed-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162984027930.1939209.15758413737332339204.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 d8071323 category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit d8071323 dmaengine: idxd: fix setting up priv mode for dwq. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- DSA spec says WQ priv bit is 0 if the Privileged Mode Enable field of the PCI Express PASID capability is 0 and pasid is enabled. Make sure that the WQCFG priv field is set correctly according to usage type. Reject config if setting up kernel WQ type and no support. Also add the correct priv setup for a descriptor. Fixes: 484f910e ("dmaengine: idxd: fix wq config registers offset programming") Cc: Ramesh Thomas <ramesh.thomas@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162939084657.903168.14160019185148244596.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 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 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 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 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 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 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 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 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 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>
-
由 Dave Jiang 提交于
mainline inclusion from mainline-v5.13 commit 53b2ee7f category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 53b2ee7f dmaengine: idxd: device cmd should use dedicated lock. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Create a dedicated lock for device command operations. Put the device command operation under finer grained locking instead of using the idxd->dev_lock. Suggested-by: NSanjay Kumar <sanjay.k.kumar@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/161894525685.3210132.16160045731436382560.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.13 commit 5b0c68c4 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 5b0c68c4 dmaengine: idxd: support reporting of halt interrupt. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Unmask the halt error interrupt so it gets reported to the interrupt handler. When halt state interrupt is received, quiesce the kernel WQs and unmap the portals to stop submission. Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/161894441167.3202472.9485946398140619501.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.13 commit eb15e715 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit eb15e715 dmaengine: idxd: add interrupt handle request and release support. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- DSA spec states that when Request Interrupt Handle and Release Interrupt Handle command bits are set in the CMDCAP register, these device commands must be supported by the driver. The interrupt handle is programmed in a descriptor. When Request Interrupt Handle is not supported, the interrupt handle is the index of the desired entry in the MSI-X table. When the command is supported, driver must use the command to obtain a handle to be programmed in the submitted descriptor. A requested handle may be revoked. After the handle is revoked, any use of the handle will result in Invalid Interrupt Handle error. Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/161894439422.3202472.17579543737810265471.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.13 commit 8c66bbdc category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 8c66bbdc dmaengine: idxd: add support for readonly config mode. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- The read-only configuration mode is defined by the DSA spec as a mode of the device WQ configuration. When GENCAP register bit 31 is set to 0, the device is in RO mode and group configuration and some fields of the workqueue configuration registers are read-only and reflect the fixed configuration of the device. Add support for RO mode. The driver will load the values from the registers directly setup all the internally cached data structures based on the device configuration. Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/161894438847.3202472.6317563824045432727.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.13 commit 93a40a6d category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 93a40a6d dmaengine: idxd: add percpu_ref to descriptor submission path. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Current submission path has no way to restrict the submitter from stop submiting on shutdown path or wq disable path. This provides a way to quiesce the submission path. Modeling after 'struct reqeust_queue' usage of percpu_ref. One of the abilities of per_cpu reference counting is the ability to stop new references from being taken while awaiting outstanding references to be dropped. On wq shutdown, we want to block any new submissions to the kernel workqueue and quiesce before disabling. The percpu_ref allows us to block any new submissions and wait for any current submission calls to finish submitting to the workqueue. A percpu_ref is embedded in each idxd_wq context to allow control for individual wq. The wq->wq_active counter is elevated before calling movdir64b() or enqcmds() to submit a descriptor to the wq and dropped once the submission call completes. The function is gated by percpu_ref_tryget_live(). On shutdown with percpu_ref_kill() called, any new submission would be blocked from acquiring a ref and failed. Once all references are dropped for the wq, shutdown can continue. Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/161894438293.3202472.14894701611500822232.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.13 commit 435b512d category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 435b512d dmaengine: idxd: remove detection of device type. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Move all static data type for per device type to an idxd_driver_data data structure. The data can be attached to the pci_device_id and provided by the pci probe function. This removes a lot of unnecessary type detection and setup code. Suggested-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/161852988924.2203940.2787590808682466398.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.13 commit defe49f9 category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit defe49f9 dmaengine: idxd: fix group conf_dev lifetime. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Remove devm_* allocation and fix group->conf_dev 'struct device' lifetime. Address issues flagged by CONFIG_DEBUG_KOBJECT_RELEASE. Add release functions in order to free the allocated memory at the group->conf_dev destruction time. Reported-by: NJason Gunthorpe <jgg@nvidia.com> Fixes: bfe1d560 ("dmaengine: idxd: Init and probe for Intel data accelerators") Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/161852987144.2203940.8830315575880047.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.13 commit 75b91130 category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 75b91130 dmaengine: idxd: fix engine conf_dev lifetime. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Remove devm_* allocation and fix engine->conf_dev 'struct device' lifetime. Address issues flagged by CONFIG_DEBUG_KOBJECT_RELEASE. Add release functions in order to free the allocated memory at the engine conf_dev destruction time. Reported-by: NJason Gunthorpe <jgg@nvidia.com> Fixes: bfe1d560 ("dmaengine: idxd: Init and probe for Intel data accelerators") Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/161852986460.2203940.16603218225412118431.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.13 commit 7c5dd23e category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 7c5dd23e dmaengine: idxd: fix wq conf_dev 'struct device' lifetime. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Remove devm_* allocation and fix wq->conf_dev 'struct device' lifetime. Address issues flagged by CONFIG_DEBUG_KOBJECT_RELEASE. Add release functions in order to free the allocated memory for the wq context at device destruction time. Reported-by: NJason Gunthorpe <jgg@nvidia.com> Fixes: bfe1d560 ("dmaengine: idxd: Init and probe for Intel data accelerators") Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/161852985907.2203940.6840120734115043753.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.13 commit 5fc8e85f category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 5fc8e85f dmaengine: idxd: cleanup pci interrupt vector allocation management. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- The devm managed lifetime is incompatible with 'struct device' objects that resides in idxd context. This is one of the series that clean up the idxd driver 'struct device' lifetime. Remove devm managed pci interrupt vectors and replace with unmanged allocators. Reported-by: NJason Gunthorpe <jgg@nvidia.com> Fixes: bfe1d560 ("dmaengine: idxd: Init and probe for Intel data accelerators") Signed-off-by: NDave Jiang <dave.jiang@intel.com> Reviewed-by: NDan Williams <dan.j.williams@intel.com> Link: https://lore.kernel.org/r/161852983563.2203940.8116028229124776669.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.12 commit 6df0e6c5 category: bugfix bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 6df0e6c5 dmaengine: idxd: clear MSIX permission entry on shutdown. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Add disabling/clearing of MSIX permission entries on device shutdown to mirror the enabling of the MSIX entries on probe. Current code left the MSIX enabled and the pasid entries still programmed at device shutdown. Fixes: 8e50d392 ("dmaengine: idxd: Add shared workqueue support") Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/161824457969.882533.6020239898682672311.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.11 commit f25b4638 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit f25b4638 dmaengine: idxd: add IAX configuration support in the IDXD driver. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Add support to allow configuration of Intel Analytics Accelerator (IAX) in addition to the Intel Data Streaming Accelerator (DSA). The IAX hardware has the same configuration interface as DSA. The main difference is the type of operations it performs. We can support the DSA and IAX devices on the same driver with some tweaks. IAX has a 64B completion record that needs to be 64B aligned, as opposed to a 32B completion record that is 32B aligned for DSA. IAX also does not support token management. Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/160564555488.1834439.4261958859935360473.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.11 commit 92de5fa2 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 92de5fa2 dmaengine: idxd: add ATS disable knob for work queues. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- With the DSA spec 1.1 update, a knob to disable ATS for individually is introduced. Add enabling code to allow a system admin to make the configuration through sysfs. Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/160530810593.1288392.2561048329116529566.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.11 commit 5a712701 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 5a712701 dmaengine: idxd: Update calculation of group offset to be more readable. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Create helper macros to make group offset calculation more readable. Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/160407294683.839093.10740868559754142070.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.11 commit 8e50d392 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO CVE: NA Intel-SIG: commit 8e50d392 dmaengine: idxd: Add shared workqueue support. Incremental backporting patches for DSA/IAA on Intel Xeon platform. -------------------------------- Add shared workqueue support that includes the support of Shared Virtual memory (SVM) or in similar terms On Demand Paging (ODP). The shared workqueue uses the enqcmds command in kernel and will respond with retry if the workqueue is full. Shared workqueue only works when there is PASID support from the IOMMU. Signed-off-by: NDave Jiang <dave.jiang@intel.com> Reviewed-by: NTony Luck <tony.luck@intel.com> Reviewed-by: NDan Williams <dan.j.williams@intel.com> Link: https://lore.kernel.org/r/160382007499.3911367.26043087963708134.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
-
- 03 6月, 2021 2 次提交
-
-
由 Dave Jiang 提交于
stable inclusion from stable-5.10.38 commit 975c4b2b997659c47dfae1d8073cf4370f96e598 bugzilla: 51875 CVE: NA -------------------------------- [ Upstream commit 39786285 ] The devm managed lifetime is incompatible with 'struct device' objects that resides in idxd context. This is one of the series that clean up the idxd driver 'struct device' lifetime. Remove embedding of dma_device and dma_chan in idxd since it's not the only interface that idxd will use. The freeing of the dma_device will be managed by the ->release() function. Reported-by: NJason Gunthorpe <jgg@nvidia.com> Fixes: bfe1d560 ("dmaengine: idxd: Init and probe for Intel data accelerators") Signed-off-by: NDave Jiang <dave.jiang@intel.com> Reviewed-by: NDan Williams <dan.j.williams@intel.com> Link: https://lore.kernel.org/r/161852983001.2203940.14817017492384561719.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: NChen Jun <chenjun102@huawei.com> Acked-by: NWeilong Chen <chenweilong@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
由 Colin Ian King 提交于
stable inclusion from stable-5.10.38 commit 5756f757c72501ef1a16f5f63f940623044180e9 bugzilla: 51875 CVE: NA -------------------------------- [ Upstream commit 28ac8e03 ] There are calls to idxd_cmd_exec that pass a null status pointer however a recent commit has added an assignment to *status that can end up with a null pointer dereference. The function expects a null status pointer sometimes as there is a later assignment to *status where status is first null checked. Fix the issue by null checking status before making the assignment. Addresses-Coverity: ("Explicit null dereferenced") Fixes: 89e3becd ("dmaengine: idxd: check device state before issue command") Signed-off-by: NColin Ian King <colin.king@canonical.com> Acked-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/20210415110654.1941580-1-colin.king@canonical.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: NChen Jun <chenjun102@huawei.com> Acked-by: NWeilong Chen <chenweilong@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
- 26 4月, 2021 1 次提交
-
-
由 Dave Jiang 提交于
stable inclusion from stable-5.10.32 commit e5eb9757fe4c2392e069246ae78badc573af1833 bugzilla: 51796 -------------------------------- [ Upstream commit ea9aadc0 ] A pre-release silicon erratum workaround where wq reset does not clear WQCFG registers was leaked into upstream code. Use wq reset command instead of blasting the MMIO region. This also address an issue where we clobber registers in future devices. Fixes: da32b28c ("dmaengine: idxd: cleanup workqueue config after disabling") Reported-by: NShreenivaas Devarajan <shreenivaas.devarajan@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/161824330020.881560.16375921906426627033.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: NChen Jun <chenjun102@huawei.com> Acked-by: NWeilong Chen <chenweilong@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
-
- 09 3月, 2021 1 次提交
-
-
由 Dave Jiang 提交于
stable inclusion from stable-5.10.17 commit 40e3b5c128645d2ddad12310c7be98758cafb2b0 bugzilla: 48169 -------------------------------- [ Upstream commit 89e3becd ] Add device state check before executing command. Without the check the command can be issued while device is in halt state and causes the driver to block while waiting for the completion of the command. Reported-by: NSanjay Kumar <sanjay.k.kumar@intel.com> Signed-off-by: NDave Jiang <dave.jiang@intel.com> Tested-by: NSanjay Kumar <sanjay.k.kumar@intel.com> Fixes: 0d5c10b4 ("dmaengine: idxd: add work queue drain support") Link: https://lore.kernel.org/r/161219313921.2976211.12222625226450097465.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com> Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
-
- 17 11月, 2020 1 次提交
-
-
由 Dave Jiang 提交于
Portal size is 4k. Current code is mapping all 4 portals in a single chunk. Restrict the mapped portal size to a single portal to ensure that submission only goes to the intended portal address. Fixes: c52ca478 ("dmaengine: idxd: add configuration component of driver") Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/160513342642.510187.16450549281618747065.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
-
- 28 10月, 2020 1 次提交
-
-
由 Dave Jiang 提交于
DSA spec v1.1 [1] updated to include a stride size register for WQ configuration that will specify how much space is reserved for the WQ configuration register set. This change is expected to be in the final gen1 DSA hardware. Fix the driver to use WQCFG_OFFSET() for all WQ offset calculation and fixup WQCFG_OFFSET() to use the new calculated wq size. [1]: https://software.intel.com/content/www/us/en/develop/download/intel-data-streaming-accelerator-preliminary-architecture-specification.html Fixes: bfe1d560 ("dmaengine: idxd: Init and probe for Intel data accelerators") Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/160383444959.48058.14249265538404901781.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
-
- 03 9月, 2020 2 次提交
-
-
由 Dave Jiang 提交于
Export admin command status to sysfs attribute in order to allow user to retrieve configuration error. Allows user tooling to retrieve the command error and provide more user friendly error messages. Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/159865278770.29455.8026892329182750127.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
-
由 Dave Jiang 提交于
Add sysfs attribute max_batch_size to wq in order to allow the max batch size configured on a per wq basis. Add support code to configure the valid user input on wq enable. This is a performance tuning parameter. Signed-off-by: NDave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/159865273617.29141.4383066301730821749.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
-