Hi,
The recent introduction of heaps in the optee driver [1] made possible
the creation of heaps as modules.
It's generally a good idea if possible, including for the already
existing system and CMA heaps.
The system one is pretty trivial, the CMA one is a bit more involved,
especially since we have a call from kernel/dma/contiguous.c to the CMA
heap code. This was solved by turning the logic around and making the
CMA heap call into the contiguous DMA code.
Let me know what you think,
Maxime
1: https://lore.kernel.org/dri-devel/20250911135007.1275833-4-jens.wiklander@l…
Signed-off-by: Maxime Ripard <mripard(a)kernel.org>
---
Changes in v3:
- Squashed cma_get_name and cma_alloc/release patches
- Fixed typo in Export dev_get_cma_area commit title
- Fixed compilation failure with DMA_CMA but not OF_RESERVED_MEM
- Link to v2: https://lore.kernel.org/r/20260227-dma-buf-heaps-as-modules-v2-0-454aee7e06…
Changes in v2:
- Collect tags
- Don't export dma_contiguous_default_area anymore, but export
dev_get_cma_area instead
- Mentioned that heap modules can't be removed
- Link to v1: https://lore.kernel.org/r/20260225-dma-buf-heaps-as-modules-v1-0-2109225a09…
---
Maxime Ripard (8):
dma: contiguous: Turn heap registration logic around
dma: contiguous: Make dev_get_cma_area() a proper function
dma: contiguous: Make dma_contiguous_default_area static
dma: contiguous: Export dev_get_cma_area()
mm: cma: Export cma_alloc(), cma_release() and cma_get_name()
dma-buf: heaps: Export mem_accounting parameter
dma-buf: heaps: cma: Turn the heap into a module
dma-buf: heaps: system: Turn the heap into a module
drivers/dma-buf/dma-heap.c | 1 +
drivers/dma-buf/heaps/Kconfig | 4 ++--
drivers/dma-buf/heaps/cma_heap.c | 21 +++++----------------
drivers/dma-buf/heaps/system_heap.c | 5 +++++
include/linux/dma-map-ops.h | 18 ++++++++++--------
kernel/dma/contiguous.c | 37 ++++++++++++++++++++++++++++++++++---
mm/cma.c | 3 +++
7 files changed, 60 insertions(+), 29 deletions(-)
---
base-commit: 499a718536dc0e1c1d1b6211847207d58acd9916
change-id: 20260225-dma-buf-heaps-as-modules-1034b3ec9f2a
Best regards,
--
Maxime Ripard <mripard(a)kernel.org>
Introduce a new accel driver for the Neutron Neural Processing Unit
(NPU), along with associated dt-bindings and DTS node.
The first patch extends the GEM DMA helper APIs to allow bidirectional
mapping of non-coherent DMA buffers. While not part of the Neutron
driver, it's a prerequisite allowing us to use the GEM DMA helper.
Neutron is a Neural Processing Unit from NXP, providing machine
learning (ML) acceleration for edge AI applications. Neutron is
integrated on NXP SoCs such as the i.MX95.
The NPU consists of the following:
- RISC-V core running a proprietary firmware
- One or more Neutron cores, representing the main computation
engine performing ML operations
- Dedicated fast memory (TCM)
- DMA engine that handles data transfers between DDR and TCM
The firmware is closed source and distributed as a binary here [1].
The Neutron software stack also contains a userspace library [1] and
a LiteRT custom delegate [2] that allow integration with standard
LiteRT tools.
[1] https://github.com/nxp-upstream/neutron/tree/upstream
[2] https://github.com/nxp-imx/tflite-neutron-delegate
Signed-off-by: Ioana Ciocoi-Radulescu <ruxandra.radulescu(a)nxp.com>
---
Changes in v2:
- rebase on newer drm-misc-next
- dt bindings: clock fixes and renames
- update DTS to match new names
- remove unnecessary fields from neutron_job structure
- fix use of uninitialized variable
- Link to v1: https://lore.kernel.org/r/20260226-neutron-v1-0-46eccb3bb50a@nxp.com
---
Ioana Ciocoi-Radulescu (9):
drm/gem-dma: Add flag for bidirectional mapping of non-coherent GEM DMA buffers
accel/neutron: Add documentation for NXP Neutron accelerator driver
dt-bindings: npu: Add NXP Neutron
accel/neutron: Add driver for NXP Neutron NPU
accel/neutron: Add GEM buffer object support
accel/neutron: Add mailbox support
accel/neutron: Add job submission IOCTL
accel/neutron: Add logging support
arm64: dts: imx95: Add Neutron node
Documentation/accel/index.rst | 1 +
Documentation/accel/neutron/index.rst | 12 +
Documentation/accel/neutron/neutron.rst | 131 ++++++++
.../devicetree/bindings/npu/nxp,imx95-neutron.yaml | 96 ++++++
MAINTAINERS | 10 +
arch/arm64/boot/dts/freescale/imx95.dtsi | 28 ++
drivers/accel/Kconfig | 1 +
drivers/accel/Makefile | 3 +-
drivers/accel/neutron/Kconfig | 16 +
drivers/accel/neutron/Makefile | 12 +
drivers/accel/neutron/neutron_debugfs.c | 34 ++
drivers/accel/neutron/neutron_debugfs.h | 15 +
drivers/accel/neutron/neutron_device.c | 239 +++++++++++++
drivers/accel/neutron/neutron_device.h | 155 +++++++++
drivers/accel/neutron/neutron_driver.c | 262 +++++++++++++++
drivers/accel/neutron/neutron_driver.h | 16 +
drivers/accel/neutron/neutron_gem.c | 116 +++++++
drivers/accel/neutron/neutron_gem.h | 14 +
drivers/accel/neutron/neutron_job.c | 372 +++++++++++++++++++++
drivers/accel/neutron/neutron_job.h | 43 +++
drivers/accel/neutron/neutron_mailbox.c | 47 +++
drivers/accel/neutron/neutron_mailbox.h | 42 +++
drivers/gpu/drm/drm_gem_dma_helper.c | 6 +-
include/drm/drm_gem_dma_helper.h | 3 +
include/uapi/drm/neutron_accel.h | 130 +++++++
25 files changed, 1801 insertions(+), 3 deletions(-)
---
base-commit: 6716101ae42949e98ad4b9e71eeba08c055be410
change-id: 20260226-neutron-c435e39d167f
Best regards,
--
Ioana Ciocoi-Radulescu <ruxandra.radulescu(a)nxp.com>
Ever find yourself with five minutes to spare and a craving for some quick, competitive fun? Look no further than the ever-expanding universe of io games! These browser-based gems offer instant gratification and addictive gameplay, making them perfect for short bursts of entertainment or even surprisingly engaging longer sessions. Let's explore how to get started and truly enjoy these simple yet captivating games.
https://iogamesweb.com/
Introduction: What's the Allure of io Games?
The beauty of io games lies in their accessibility. No downloads, no complex tutorials, just pure, unadulterated gaming. Often featuring simple graphics and intuitive controls, they're incredibly easy to pick up. But don't let the simplicity fool you – under the hood lies competitive gameplay that can be surprisingly strategic and rewarding. The “io” suffix typically indicates a game hosted on a public domain, allowing for many different developers and styles within the genre.
Tips for Thriving in the io Arena
While easy to learn, mastering io games requires some strategy. Here are a few tips to help you succeed:
Observe and Adapt: Pay attention to the gameplay style of other players. Are they aggressive or defensive? What strategies are they using? Adjust your own approach accordingly.
Learn the Maps: Familiarize yourself with the layout of each game's map. Knowing where resources are located and where potential dangers lurk can give you a significant advantage.
Team Up (Sometimes): Some io games encourage or even necessitate teamwork. Forming alliances with other players can provide mutual protection and increase your chances of survival. However, be wary of betrayal!
Practice Makes Perfect: The more you play, the better you'll become at understanding the game's mechanics, anticipating enemy movements, and executing effective strategies. Don’t get discouraged if you are constantly losing in the beginning.
Have Fun! The most important tip of all! Don't take the games too seriously. Relax, experiment, and enjoy the fast-paced, chaotic nature of io games. Explore different types of io games to find what style best suits your gaming preferences.
Conclusion: A Quick Escape for the Modern Gamer
io games offer a fantastic escape for anyone looking for a quick dose of competitive fun. Their accessibility, simple mechanics, and addictive gameplay make them a perfect choice for short breaks or longer gaming sessions. So, jump in, give it a try, and prepare to be captivated by the surprisingly engaging world of io games!
From: Jiri Pirko <jiri(a)nvidia.com>
Confidential computing (CoCo) VMs/guests, such as AMD SEV and Intel TDX,
run with encrypted/protected memory which creates a challenge
for devices that do not support DMA to it (no TDISP support).
For kernel-only DMA operations, swiotlb bounce buffering provides a
transparent solution by copying data through decrypted memory.
However, the only way to get this memory into userspace is via the DMA
API's dma_alloc_pages()/dma_mmap_pages() type interfaces which limits
the use of the memory to a single DMA device, and is incompatible with
pin_user_pages().
These limitations are particularly problematic for the RDMA subsystem
which makes heavy use of pin_user_pages() and expects flexible memory
usage between many different DMA devices.
This patch series enables userspace to explicitly request decrypted
(shared) memory allocations from the dma-buf system heap.
Userspace can mmap this memory and pass the dma-buf fd to other
existing importers such as RDMA or DRM devices to access the
memory. The DMA API is improved to allow the dma heap exporter to DMA
map the shared memory to each importing device.
Jiri Pirko (2):
dma-mapping: introduce DMA_ATTR_CC_DECRYPTED for pre-decrypted memory
dma-buf: heaps: system: add system_cc_decrypted heap for explicitly
decrypted memory
drivers/dma-buf/heaps/system_heap.c | 103 ++++++++++++++++++++++++++--
include/linux/dma-mapping.h | 6 ++
include/trace/events/dma.h | 3 +-
kernel/dma/direct.h | 14 +++-
4 files changed, 117 insertions(+), 9 deletions(-)
--
2.51.1
From: Jiri Pirko <jiri(a)nvidia.com>
Confidential computing (CoCo) VMs/guests, such as AMD SEV and Intel TDX,
run with encrypted/protected memory which creates a challenge
for devices that do not support DMA to it (no TDISP support).
For kernel-only DMA operations, swiotlb bounce buffering provides a
transparent solution by copying data through decrypted memory.
However, the only way to get this memory into userspace is via the DMA
API's dma_alloc_pages()/dma_mmap_pages() type interfaces which limits
the use of the memory to a single DMA device, and is incompatible with
pin_user_pages().
These limitations are particularly problematic for the RDMA subsystem
which makes heavy use of pin_user_pages() and expects flexible memory
usage between many different DMA devices.
This patch series enables userspace to explicitly request decrypted
(shared) memory allocations from new dma-buf system_cc_decrypted heap.
Userspace can mmap this memory and pass the dma-buf fd to other
existing importers such as RDMA or DRM devices to access the
memory. The DMA API is improved to allow the dma heap exporter to DMA
map the shared memory to each importing device.
Jiri Pirko (2):
dma-mapping: introduce DMA_ATTR_CC_DECRYPTED for pre-decrypted memory
dma-buf: heaps: system: add system_cc_decrypted heap for explicitly
decrypted memory
drivers/dma-buf/heaps/system_heap.c | 103 ++++++++++++++++++++++++++--
include/linux/dma-mapping.h | 10 +++
include/trace/events/dma.h | 3 +-
kernel/dma/direct.h | 14 +++-
kernel/dma/mapping.c | 13 +++-
5 files changed, 132 insertions(+), 11 deletions(-)
--
2.51.1
The while loop in pluto_dma_end() scans the DMA buffer for MPEG-TS sync
bytes (0x47) at 188-byte intervals. However, it does not check the buffer
boundary. If the buffer contains 0x47 at every 188-byte offset, the loop
index will exceed the buffer size, causing an out-of-bounds read.
Add a check to ensure the index stays within TS_DMA_BYTES.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: c7cadb3a02b5 ("[PATCH] dvb: add Pluto2 driver")
Signed-off-by: Dmitriy Chumachenko <Dmitry.Chumachenko(a)cyberprotect.ru>
---
drivers/media/pci/pluto2/pluto2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/pci/pluto2/pluto2.c b/drivers/media/pci/pluto2/pluto2.c
index 6ac9b9bd7435..fd7f8d8b85a8 100644
--- a/drivers/media/pci/pluto2/pluto2.c
+++ b/drivers/media/pci/pluto2/pluto2.c
@@ -291,7 +291,7 @@ static void pluto_dma_end(struct pluto *pluto, unsigned int nbpackets)
*/
if ((nbpackets == 0) || (nbpackets > TS_DMA_PACKETS)) {
unsigned int i = 0;
- while (pluto->dma_buf[i] == 0x47)
+ while (i < TS_DMA_BYTES && pluto->dma_buf[i] == 0x47)
i += 188;
nbpackets = i / 188;
if (i == 0) {
--
2.49.0
In case of a refcounting bug dma_fence_release() can be called before the
fence was even signaled.
Previously the dma_fence framework then force signaled the fence to make
sure to unblock waiters, but that can potentially lead to random memory
corruption when the DMA operation continues. So be more defensive here and
pick the lesser evil.
Instead of force signaling the fence set an error code on the fence,
re-initialize the refcount to something large and taint the kernel.
This will leak memory and eventually can cause a deadlock when the fence
is never signaled, but at least we won't run into an use after free or
random memory corruption.
Signed-off-by: Christian König <christian.koenig(a)amd.com>
---
drivers/dma-buf/dma-fence.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
index 1826ba73094c..8bf07685a053 100644
--- a/drivers/dma-buf/dma-fence.c
+++ b/drivers/dma-buf/dma-fence.c
@@ -593,14 +593,24 @@ void dma_fence_release(struct kref *kref)
/*
* Failed to signal before release, likely a refcounting issue.
*
- * This should never happen, but if it does make sure that we
- * don't leave chains dangling. We set the error flag first
- * so that the callbacks know this signal is due to an error.
+ * This should never happen, but if try to be defensive and take
+ * the lesser evil. Initialize the refcount to something large,
+ * but not so large that it can overflow.
+ *
+ * That will leak memory and could deadlock if the fence never
+ * signals, but at least it doesn't cause an use after free or
+ * random memory corruption.
+ *
+ * Also taint the kernel to note that it is rather unreliable to
+ * continue.
*/
dma_fence_lock_irqsave(fence, flags);
fence->error = -EDEADLK;
- dma_fence_signal_locked(fence);
+ refcount_set(&fence->refcount.refcount, INT_MAX);
dma_fence_unlock_irqrestore(fence, flags);
+ rcu_read_unlock();
+ add_taint(TAINT_SOFTLOCKUP, LOCKDEP_STILL_OK);
+ return;
}
ops = rcu_dereference(fence->ops);
--
2.43.0
When a caller already guards a tracepoint with an explicit enabled check:
if (trace_foo_enabled() && cond)
trace_foo(args);
trace_foo() internally re-evaluates the static_branch_unlikely() key.
Since static branches are patched binary instructions the compiler cannot
fold the two evaluations, so every such site pays the cost twice.
This series introduces trace_invoke_##name() as a companion to
trace_##name(). It calls __do_trace_##name() directly, bypassing the
redundant static-branch re-check, while preserving all other correctness
properties of the normal path (RCU-watching assertion, might_fault() for
syscall tracepoints). The internal __do_trace_##name() symbol is not
leaked to call sites; trace_invoke_##name() is the only new public API.
if (trace_foo_enabled() && cond)
trace_invoke_foo(args); /* calls __do_trace_foo() directly */
The first patch adds the three-location change to
include/linux/tracepoint.h (__DECLARE_TRACE, __DECLARE_TRACE_SYSCALL,
and the !TRACEPOINTS_ENABLED stub). The remaining 14 patches
mechanically convert all guarded call sites found in the tree:
kernel/, io_uring/, net/, accel/habanalabs, cpufreq/, devfreq/,
dma-buf/, fsi/, drm/, HID, i2c/, spi/, scsi/ufs/, and btrfs/.
This series is motivated by Peter Zijlstra's observation in the discussion
around Dmitry Ilvokhin's locking tracepoint instrumentation series, where
he noted that compilers cannot optimize static branches and that guarded
call sites end up evaluating the static branch twice for no reason, and
by Steven Rostedt's suggestion to add a proper API instead of exposing
internal implementation details like __do_trace_##name() directly to
call sites:
https://lore.kernel.org/linux-trace-kernel/8298e098d3418cb446ef396f119edac5…
Suggested-by: Steven Rostedt <rostedt(a)goodmis.org>
Suggested-by: Peter Zijlstra <peterz(a)infradead.org>
Vineeth Pillai (Google) (15):
tracepoint: Add trace_invoke_##name() API
kernel: Use trace_invoke_##name() at guarded tracepoint call sites
io_uring: Use trace_invoke_##name() at guarded tracepoint call sites
net: Use trace_invoke_##name() at guarded tracepoint call sites
accel/habanalabs: Use trace_invoke_##name() at guarded tracepoint call
sites
cpufreq: Use trace_invoke_##name() at guarded tracepoint call sites
devfreq: Use trace_invoke_##name() at guarded tracepoint call sites
dma-buf: Use trace_invoke_##name() at guarded tracepoint call sites
fsi: Use trace_invoke_##name() at guarded tracepoint call sites
drm: Use trace_invoke_##name() at guarded tracepoint call sites
HID: Use trace_invoke_##name() at guarded tracepoint call sites
i2c: Use trace_invoke_##name() at guarded tracepoint call sites
spi: Use trace_invoke_##name() at guarded tracepoint call sites
scsi: ufs: Use trace_invoke_##name() at guarded tracepoint call sites
btrfs: Use trace_invoke_##name() at guarded tracepoint call sites
drivers/accel/habanalabs/common/device.c | 12 ++++++------
drivers/accel/habanalabs/common/mmu/mmu.c | 3 ++-
drivers/accel/habanalabs/common/pci/pci.c | 4 ++--
drivers/cpufreq/amd-pstate.c | 10 +++++-----
drivers/cpufreq/cpufreq.c | 2 +-
drivers/cpufreq/intel_pstate.c | 2 +-
drivers/devfreq/devfreq.c | 2 +-
drivers/dma-buf/dma-fence.c | 4 ++--
drivers/fsi/fsi-master-aspeed.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++--
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
drivers/gpu/drm/scheduler/sched_entity.c | 4 ++--
drivers/hid/intel-ish-hid/ipc/pci-ish.c | 2 +-
drivers/i2c/i2c-core-slave.c | 2 +-
drivers/spi/spi-axi-spi-engine.c | 4 ++--
drivers/ufs/core/ufshcd.c | 12 ++++++------
fs/btrfs/extent_map.c | 4 ++--
fs/btrfs/raid56.c | 4 ++--
include/linux/tracepoint.h | 11 +++++++++++
io_uring/io_uring.h | 2 +-
kernel/irq_work.c | 2 +-
kernel/sched/ext.c | 2 +-
kernel/smp.c | 2 +-
net/core/dev.c | 2 +-
net/core/xdp.c | 2 +-
net/openvswitch/actions.c | 2 +-
net/openvswitch/datapath.c | 2 +-
net/sctp/outqueue.c | 2 +-
net/tipc/node.c | 2 +-
30 files changed, 62 insertions(+), 50 deletions(-)
--
2.53.0