<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/misc/uacce, branch v5.15.199</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.15.199</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.15.199'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2026-02-06T15:41:58Z</updated>
<entry>
<title>uacce: ensure safe queue release with state management</title>
<updated>2026-02-06T15:41:58Z</updated>
<author>
<name>Chenghai Huang</name>
<email>huangchenghai2@huawei.com</email>
</author>
<published>2025-12-02T06:12:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8b57bf1d3b1db692f34bce694a03e41be79f6016'/>
<id>urn:sha1:8b57bf1d3b1db692f34bce694a03e41be79f6016</id>
<content type='text'>
commit 26c08dabe5475d99a13f353d8dd70e518de45663 upstream.

Directly calling `put_queue` carries risks since it cannot
guarantee that resources of `uacce_queue` have been fully released
beforehand. So adding a `stop_queue` operation for the
UACCE_CMD_PUT_Q command and leaving the `put_queue` operation to
the final resource release ensures safety.

Queue states are defined as follows:
- UACCE_Q_ZOMBIE: Initial state
- UACCE_Q_INIT: After opening `uacce`
- UACCE_Q_STARTED: After `start` is issued via `ioctl`

When executing `poweroff -f` in virt while accelerator are still
working, `uacce_fops_release` and `uacce_remove` may execute
concurrently. This can cause `uacce_put_queue` within
`uacce_fops_release` to access a NULL `ops` pointer. Therefore, add
state checks to prevent accessing freed pointers.

Fixes: 015d239ac014 ("uacce: add uacce driver")
Cc: stable@vger.kernel.org
Signed-off-by: Chenghai Huang &lt;huangchenghai2@huawei.com&gt;
Signed-off-by: Yang Shen &lt;shenyang39@huawei.com&gt;
Acked-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Link: https://patch.msgid.link/20251202061256.4158641-5-huangchenghai2@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>uacce: implement mremap in uacce_vm_ops to return -EPERM</title>
<updated>2026-02-06T15:41:57Z</updated>
<author>
<name>Yang Shen</name>
<email>shenyang39@huawei.com</email>
</author>
<published>2025-12-02T06:12:55Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ebfa85658a39b49ec3901ceea7535b73aa0429e6'/>
<id>urn:sha1:ebfa85658a39b49ec3901ceea7535b73aa0429e6</id>
<content type='text'>
commit 02695347be532b628f22488300d40c4eba48b9b7 upstream.

The current uacce_vm_ops does not support the mremap operation of
vm_operations_struct. Implement .mremap to return -EPERM to remind
users.

The reason we need to explicitly disable mremap is that when the
driver does not implement .mremap, it uses the default mremap
method. This could lead to a risk scenario:

An application might first mmap address p1, then mremap to p2,
followed by munmap(p1), and finally munmap(p2). Since the default
mremap copies the original vma's vm_private_data (i.e., q) to the
new vma, both munmap operations would trigger vma_close, causing
q-&gt;qfr to be freed twice(qfr will be set to null here, so repeated
release is ok).

Fixes: 015d239ac014 ("uacce: add uacce driver")
Cc: stable@vger.kernel.org
Signed-off-by: Yang Shen &lt;shenyang39@huawei.com&gt;
Signed-off-by: Chenghai Huang &lt;huangchenghai2@huawei.com&gt;
Acked-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Link: https://patch.msgid.link/20251202061256.4158641-4-huangchenghai2@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>uacce: fix cdev handling in the cleanup path</title>
<updated>2026-02-06T15:41:57Z</updated>
<author>
<name>Wenkai Lin</name>
<email>linwenkai6@hisilicon.com</email>
</author>
<published>2025-12-02T06:12:53Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1bc3e51367c420e6db31f41efa874c7a8e12194a'/>
<id>urn:sha1:1bc3e51367c420e6db31f41efa874c7a8e12194a</id>
<content type='text'>
commit a3bece3678f6c88db1f44c602b2a63e84b4040ac upstream.

When cdev_device_add fails, it internally releases the cdev memory,
and if cdev_device_del is then executed, it will cause a hang error.
To fix it, we check the return value of cdev_device_add() and clear
uacce-&gt;cdev to avoid calling cdev_device_del in the uacce_remove.

Fixes: 015d239ac014 ("uacce: add uacce driver")
Cc: stable@vger.kernel.org
Signed-off-by: Wenkai Lin &lt;linwenkai6@hisilicon.com&gt;
Signed-off-by: Chenghai Huang &lt;huangchenghai2@huawei.com&gt;
Acked-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Link: https://patch.msgid.link/20251202061256.4158641-2-huangchenghai2@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>uacce: Handle parent device removal or parent driver module rmmod</title>
<updated>2022-08-25T09:40:34Z</updated>
<author>
<name>Jean-Philippe Brucker</name>
<email>jean-philippe@linaro.org</email>
</author>
<published>2022-07-01T03:48:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=50de5045815e4c3a5b261187c1497dad517f3420'/>
<id>urn:sha1:50de5045815e4c3a5b261187c1497dad517f3420</id>
<content type='text'>
[ Upstream commit 80fc671bcc0173836e9032b0c698ea74c13b9d7c ]

The uacce driver must deal with a possible removal of the parent device
or parent driver module rmmod at any time.

Although uacce_remove(), called on device removal and on driver unbind,
prevents future use of the uacce fops by removing the cdev, fops that
were called before that point may still be running.

Serialize uacce_fops_open() and uacce_remove() with uacce-&gt;mutex.
Serialize other fops against uacce_remove() with q-&gt;mutex.
Since we need to protect uacce_fops_poll() which gets called on the fast
path, replace uacce-&gt;queues_lock with q-&gt;mutex to improve scalability.
The other fops are only used during setup.

uacce_queue_is_valid(), checked under q-&gt;mutex or uacce-&gt;mutex, denotes
whether uacce_remove() has disabled all queues. If that is the case,
don't go any further since the parent device is being removed and
uacce-&gt;ops should not be called anymore.

Reported-by: Yang Shen &lt;shenyang39@huawei.com&gt;
Signed-off-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Signed-off-by: Jean-Philippe Brucker &lt;jean-philippe@linaro.org&gt;
Link: https://lore.kernel.org/r/20220701034843.7502-1-zhangfei.gao@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>uacce: add print information if not enable sva</title>
<updated>2021-06-09T16:53:29Z</updated>
<author>
<name>Kai Ye</name>
<email>yekai13@huawei.com</email>
</author>
<published>2021-06-09T10:09:05Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=762b296bcbbc7344752ebf3a25583cf38f8adbdc'/>
<id>urn:sha1:762b296bcbbc7344752ebf3a25583cf38f8adbdc</id>
<content type='text'>
Add print information necessary if user not enable sva.

Signed-off-by: Kai Ye &lt;yekai13@huawei.com&gt;
Link: https://lore.kernel.org/r/1623233345-8765-1-git-send-email-yekai13@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'iommu-updates-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu</title>
<updated>2021-05-01T16:33:00Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2021-05-01T16:33:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4f9701057a9cc1ae6bfc533204c9d3ba386687de'/>
<id>urn:sha1:4f9701057a9cc1ae6bfc533204c9d3ba386687de</id>
<content type='text'>
Pull iommu updates from Joerg Roedel:

 - Big cleanup of almost unsused parts of the IOMMU API by Christoph
   Hellwig. This mostly affects the Freescale PAMU driver.

 - New IOMMU driver for Unisoc SOCs

 - ARM SMMU Updates from Will:
     - Drop vestigial PREFETCH_ADDR support (SMMUv3)
     - Elide TLB sync logic for empty gather (SMMUv3)
     - Fix "Service Failure Mode" handling (SMMUv3)
     - New Qualcomm compatible string (SMMUv2)

 - Removal of the AMD IOMMU performance counter writeable check on AMD.
   It caused long boot delays on some machines and is only needed to
   work around an errata on some older (possibly pre-production) chips.
   If someone is still hit by this hardware issue anyway the performance
   counters will just return 0.

 - Support for targeted invalidations in the AMD IOMMU driver. Before
   that the driver only invalidated a single 4k page or the whole IO/TLB
   for an address space. This has been extended now and is mostly useful
   for emulated AMD IOMMUs.

 - Several fixes for the Shared Virtual Memory support in the Intel VT-d
   driver

 - Mediatek drivers can now be built as modules

 - Re-introduction of the forcedac boot option which got lost when
   converting the Intel VT-d driver to the common dma-iommu
   implementation.

 - Extension of the IOMMU device registration interface and support
   iommu_ops to be const again when drivers are built as modules.

* tag 'iommu-updates-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (84 commits)
  iommu: Streamline registration interface
  iommu: Statically set module owner
  iommu/mediatek-v1: Add error handle for mtk_iommu_probe
  iommu/mediatek-v1: Avoid build fail when build as module
  iommu/mediatek: Always enable the clk on resume
  iommu/fsl-pamu: Fix uninitialized variable warning
  iommu/vt-d: Force to flush iotlb before creating superpage
  iommu/amd: Put newline after closing bracket in warning
  iommu/vt-d: Fix an error handling path in 'intel_prepare_irq_remapping()'
  iommu/vt-d: Fix build error of pasid_enable_wpe() with !X86
  iommu/amd: Remove performance counter pre-initialization test
  Revert "iommu/amd: Fix performance counter initialization"
  iommu/amd: Remove duplicate check of devid
  iommu/exynos: Remove unneeded local variable initialization
  iommu/amd: Page-specific invalidations for more than one page
  iommu/arm-smmu-v3: Remove the unused fields for PREFETCH_CONFIG command
  iommu/vt-d: Avoid unnecessary cache flush in pasid entry teardown
  iommu/vt-d: Invalidate PASID cache when root/context entry changed
  iommu/vt-d: Remove WO permissions on second-level paging entries
  iommu/vt-d: Report the right page fault address
  ...
</content>
</entry>
<entry>
<title>uacce: Enable IOMMU_DEV_FEAT_IOPF</title>
<updated>2021-04-07T08:54:29Z</updated>
<author>
<name>Jean-Philippe Brucker</name>
<email>jean-philippe@linaro.org</email>
</author>
<published>2021-04-01T15:47:14Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0860788df74085a5e14c1702610b2977fd9aac5e'/>
<id>urn:sha1:0860788df74085a5e14c1702610b2977fd9aac5e</id>
<content type='text'>
The IOPF (I/O Page Fault) feature is now enabled independently from the
SVA feature, because some IOPF implementations are device-specific and
do not require IOMMU support for PCIe PRI or Arm SMMU stall.

Enable IOPF unconditionally when enabling SVA for now. In the future, if
a device driver implementing a uacce interface doesn't need IOPF
support, it will need to tell the uacce module, for example with a new
flag.

Acked-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Signed-off-by: Jean-Philippe Brucker &lt;jean-philippe@linaro.org&gt;
Link: https://lore.kernel.org/r/20210401154718.307519-6-jean-philippe@linaro.org
Signed-off-by: Joerg Roedel &lt;jroedel@suse.de&gt;
</content>
</entry>
<entry>
<title>uacce: delete unneeded variable initialization</title>
<updated>2021-03-28T12:40:33Z</updated>
<author>
<name>Kai Ye</name>
<email>yekai13@huawei.com</email>
</author>
<published>2021-03-26T09:09:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f20b2c2a07f88c9a7532578674a60e501a07b839'/>
<id>urn:sha1:f20b2c2a07f88c9a7532578674a60e501a07b839</id>
<content type='text'>
delete unneeded variable initialization.

Signed-off-by: Kai Ye &lt;yekai13@huawei.com&gt;
Link: https://lore.kernel.org/r/1616749747-3882-1-git-send-email-yekai13@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>uacce: modify the module author information.</title>
<updated>2020-11-09T17:41:03Z</updated>
<author>
<name>Kai Ye</name>
<email>yekai13@huawei.com</email>
</author>
<published>2020-11-02T09:39:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=385997dc17ab4927bad332c1283dc461a973ab1d'/>
<id>urn:sha1:385997dc17ab4927bad332c1283dc461a973ab1d</id>
<content type='text'>
The spelling of "Hisilicon" is modified.

Reviewed-by: Zhou Wang &lt;wangzhou1@hisilicon.com&gt;
Reviewed-by: Jonathan Cameron &lt;Jonathan.Cameron@Huawei.com&gt;
Acked-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Signed-off-by: Kai Ye &lt;yekai13@huawei.com&gt;
Link: https://lore.kernel.org/r/1604309965-21752-3-git-send-email-yekai13@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>uacce: delete some redundant code.</title>
<updated>2020-11-09T17:41:03Z</updated>
<author>
<name>Kai Ye</name>
<email>yekai13@huawei.com</email>
</author>
<published>2020-11-02T09:39:24Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a67c43ac37f80b5e7e1876e8f5f7df62027445c8'/>
<id>urn:sha1:a67c43ac37f80b5e7e1876e8f5f7df62027445c8</id>
<content type='text'>
Delete some redundant code.

Reviewed-by: Zhou Wang &lt;wangzhou1@hisilicon.com&gt;
Reviewed-by: Jonathan Cameron &lt;Jonathan.Cameron@Huawei.com&gt;
Acked-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Signed-off-by: Kai Ye &lt;yekai13@huawei.com&gt;
Link: https://lore.kernel.org/r/1604309965-21752-2-git-send-email-yekai13@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
