On 4/6/26 23:49, Barry Song (Xiaomi) wrote:
> From: Xueyuan Chen <Xueyuan.chen21(a)gmail.com>
>
> Replace the heavy for_each_sgtable_page() iterator in system_heap_do_vmap()
> with a more efficient nested loop approach.
>
> Instead of iterating page by page, we now iterate through the scatterlist
> entries via for_each_sgtable_sg(). Because pages within a single sg entry
> are physically contiguous, we can populate the page array with a in an
> inner loop using simple pointer math. This save a lot of time.
>
> The WARN_ON check is also pulled out of the loop to save branch
> instructions.
>
> Performance results mapping a 2GB buffer on Radxa O6:
> - Before: ~1440000 ns
> - After: ~232000 ns
> (~84% reduction in iteration time, or ~6.2x faster)
Well real question is why do you care about the vmap performance?
That should basically only be used for fbdev emulation (except for VMGFX) and we absolutely don't care about performance there.
Regards,
Christian.
>
> Cc: Sumit Semwal <sumit.semwal(a)linaro.org>
> Cc: Benjamin Gaignard <benjamin.gaignard(a)collabora.com>
> Cc: Brian Starkey <Brian.Starkey(a)arm.com>
> Cc: John Stultz <jstultz(a)google.com>
> Cc: T.J. Mercier <tjmercier(a)google.com>
> Cc: Christian König <christian.koenig(a)amd.com>
> Signed-off-by: Xueyuan Chen <Xueyuan.chen21(a)gmail.com>
> Signed-off-by: Barry Song (Xiaomi) <baohua(a)kernel.org>
> ---
> drivers/dma-buf/heaps/system_heap.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/dma-buf/heaps/system_heap.c b/drivers/dma-buf/heaps/system_heap.c
> index b3650d8fd651..769f01f0cc96 100644
> --- a/drivers/dma-buf/heaps/system_heap.c
> +++ b/drivers/dma-buf/heaps/system_heap.c
> @@ -224,16 +224,21 @@ static void *system_heap_do_vmap(struct system_heap_buffer *buffer)
> int npages = PAGE_ALIGN(buffer->len) / PAGE_SIZE;
> struct page **pages = vmalloc(sizeof(struct page *) * npages);
> struct page **tmp = pages;
> - struct sg_page_iter piter;
> void *vaddr;
> + u32 i, j, count;
> + struct page *base_page;
> + struct scatterlist *sg;
>
> if (!pages)
> return ERR_PTR(-ENOMEM);
>
> - for_each_sgtable_page(table, &piter, 0) {
> - WARN_ON(tmp - pages >= npages);
> - *tmp++ = sg_page_iter_page(&piter);
> + for_each_sgtable_sg(table, sg, i) {
> + base_page = sg_page(sg);
> + count = sg->length >> PAGE_SHIFT;
> + for (j = 0; j < count; j++)
> + *tmp++ = base_page + j;
> }
> + WARN_ON(tmp - pages != npages);
>
> vaddr = vmap(pages, npages, VM_MAP, PAGE_KERNEL);
> vfree(pages);
On Thu, Apr 2, 2026 at 7:11 AM Jiri Pirko <jiri(a)resnulli.us> wrote:
>
> From: Jiri Pirko <jiri(a)nvidia.com>
>
> Document the system_cc_shared dma-buf heap that was introduced
> recently. Describe its purpose, availability conditions and
> relation to confidential computing VMs.
>
> Signed-off-by: Jiri Pirko <jiri(a)nvidia.com>
> ---
> Documentation/userspace-api/dma-buf-heaps.rst | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/Documentation/userspace-api/dma-buf-heaps.rst b/Documentation/userspace-api/dma-buf-heaps.rst
> index 05445c83b79a..591732393e7d 100644
> --- a/Documentation/userspace-api/dma-buf-heaps.rst
> +++ b/Documentation/userspace-api/dma-buf-heaps.rst
> @@ -16,6 +16,14 @@ following heaps:
>
> - The ``system`` heap allocates virtually contiguous, cacheable, buffers.
>
> + - The ``system_cc_shared`` heap allocates virtually contiguous, cacheable,
> + buffers using shared (decrypted) memory. It is only present on
> + confidential computing (CoCo) VMs where memory encryption is active
> + (e.g., AMD SEV, Intel TDX). The allocated pages have the encryption
> + bit cleared, making them accessible for device DMA without TDISP
> + support. On non-CoCo VMs configurations, this heap is
"non-CoCo VM configurations"
> + not registered.
Doesn't seem like you need to wrap this line.
with that: Reviewed-by: T.J.Mercier <tjmercier(a)google.com>
> +
> - The ``default_cma_region`` heap allocates physically contiguous,
> cacheable, buffers. Only present if a CMA region is present. Such a
> region is usually created either through the kernel commandline
Each paragraph starting with '-' confused me for a second there. Those
aren't part of the diff. :)
Safeguard is not just another name in the crowded field of cryptocurrency recovery; they are renowned for their effectiveness and expertise in tracing lost funds. Their team comprises skilled professionals who understand the intricate workings of blockchain technology and the tactics employed by online scammers. This specialized knowledge enables them to devise tailored strategies to recover your assets.
Email,.. safeguardbitcoin(a)consultant.com
WhatsApp,.. +44 7426 168300
Web:., https://safeguardbitcoin.wixsite.com/safeguard-bitcoin--1
Don't worry, TREK Tech Corp is here to help you get your lost coins back. Our expert team specializes in recovering funds from fraudulent schemes and can assist you in reclaiming what is rightfully yours. Contact us today for a free consultation and let us help you get back on track. Don't let scammers hold you back any longer, trust TREK Tech Corp to help you recover your lost funds.
Contact email: trektechcorp1(a)gmail.com / trektechcorp(a)consultant.com.
In the volatile world of cryptocurrency, where billions are lost annually to scams, hacks, phishing attacks, rug pulls, and wallet compromises, the demand for legitimate recovery services has never been higher. As of 02/ 22/ 2026, victims often face a dual challenge: recovering stolen or inaccessible funds while avoiding secondary scams that prey on desperation with false promises and upfront fees. Amid this landscape, TREK Tech Corp—commonly referred to as CCS—has established itself as a credible, professional firm specializing in blockchain forensics, crypto asset tracing, fraud investigation, and realistic recovery support.
TREK Tech Corp operates with a foundation built on 14 years of experience in digital investigations, long predating the widespread adoption of cryptocurrencies. This extensive background in forensics gives CCS a significant edge over many newer entrants in the crypto recovery space. The firm focuses on helping individuals, families, and institutions trace lost or stolen digital assets using advanced, transparent methods rather than speculative or guaranteed outcomes. Their official website is https://www.trektechcorp.net, and direct inquiries can be sent to trektechcorp1(a)gmail.com.
What sets TREK Tech Corp apart as a legitimate provider is its commitment to ethical standards and evidence-based processes. Unlike fraudulent recovery operations that demand large upfront payments without case evaluation or promise 100% success (a clear red flag in the industry), CCS conducts honest feasibility assessments from the outset. They never require clients to share private keys, seed phrases, or sensitive wallet credentials during initial consultations. Fees are typically aligned with outcomes, and the firm maintains strict confidentiality with robust data protection protocols.
The core of TREK Tech Corp’ service is multi-layer blockchain attribution—a proprietary technique that tracks funds through complex laundering paths. Scammers frequently use mixers, cross-chain bridges, decentralized exchanges, privacy protocols, flash-loan obfuscation, and automated smart-contract tumbling to break direct traceability. Basic block explorers lose visibility after one or two hops, but CCS reconstructs these movements by analyzing on-chain behavioral patterns: timing correlations, amount similarities, address clustering via co-spending heuristics, change address reuse, and interactions with known services.
A typical engagement begins with a secure intake process. Victims submit transaction hashes (TXIDs), wallet addresses, scam communications, screenshots, and timelines. TREK Tech Corp then performs comprehensive on-chain and off-chain analysis, building detailed transaction graphs and identifying probable endpoints—most commonly centralized exchanges that enforce KYC/AML compliance. When funds reach such platforms, CCS prepares evidence-grade forensic reports that include visualized flow diagrams, confidence-scored address clusters, identified laundering techniques, and recommended intervention steps. These reports are frequently used to support asset freeze requests submitted to exchange compliance teams or filed with law enforcement agencies such as the FBI’s Internet Crime Complaint Center (IC3), local cybercrime units, or financial regulators.
TREK Tech Corp emphasizes speed: the sooner a theft is reported and analyzed, the higher the chance of intervention before funds are fully dispersed. In cases where rapid action was taken, partial recoveries—often 70–90% of stolen amounts—have been achieved through coordinated freezes and subsequent legal processes. While full recovery is never guaranteed due to blockchain’s immutable design and variables like scammer sophistication and jurisdictional limits, CCS provides clear, realistic expectations from day one.
Beyond recovery support, TREK Tech Corp prioritizes victim education and prevention. Clients receive tailored guidance on hardening security: using hardware wallets, enabling strong multi-factor authentication, securely backing up seed phrases in multiple encrypted locations, verifying addresses before every transfer, monitoring wallet activity proactively, and recognizing emerging threats such as AI-enhanced impersonation scams, clipboard hijacking, or malicious browser extensions. This preventive focus helps reduce the likelihood of future incidents and empowers users in an environment where threats evolve rapidly.
The firm’s legitimacy is further reinforced by its performance metrics and client feedback. As of early 2026, TREK Tech Corp has successfully handled over 426 documented projects and maintains a 4.28 out of 5 rating based on more than 2,467 verified reviews. Clients consistently highlight the team’s professionalism, technical precision, clear communication, regular updates, and genuine support during high-stress situations. In an industry rife with advance-fee fraud and misleading marketing, CCS stands out for refusing high-pressure tactics, avoiding unrealistic guarantees, and focusing on evidence-driven results.
For anyone who has suffered a crypto loss—whether through a sophisticated scam, forgotten credentials, hardware failure, or inheritance complications—TREK Tech Corp offers a professional, confidential pathway forward. Their website, https://www.trektechcorp.net, provides in-depth information about services, the investigation process, anonymized case examples, and how to initiate contact. Direct email communication is available at trektechcorp1(a)gmail.com for a no-obligation initial consultation.
In conclusion, legitimate crypto recovery requires expertise, transparency, and ethical conduct—qualities TREK Tech Corp consistently demonstrates. While blockchain’s architecture limits reversals, CCS leverages decades of investigative rigor, advanced multi-layer attribution, and strategic coordination to deliver clarity, evidence, and realistic recovery opportunities. In 2026’s high-risk digital asset environment, partnering with a reputable firm like TREK Tech Corp can make the critical difference between permanent loss and meaningful progress toward reclamation and renewed security.
Safeguard is not just another name in the crowded field of cryptocurrency recovery; they are renowned for their effectiveness and expertise in tracing lost funds. Their team comprises skilled professionals who understand the intricate workings of blockchain technology and the tactics employed by online scammers. This specialized knowledge enables them to devise tailored strategies to recover your assets.
Email,.. safeguardbitcoin(a)consultant.com
WhatsApp,.. +44 7426 168300
Web:., https://safeguardbitcoin.wixsite.com/safeguard-bitcoin--1
Safeguard is not just another name in the crowded field of cryptocurrency recovery; they are renowned for their effectiveness and expertise in tracing lost funds. Their team comprises skilled professionals who understand the intricate workings of blockchain technology and the tactics employed by online scammers. This specialized knowledge enables them to devise tailored strategies to recover your assets.
Email,.. safeguardbitcoin(a)consultant.com
WhatsApp,.. +44 7426 168300
Web:., https://safeguardbitcoin.wixsite.com/safeguard-bitcoin--1
On 4/2/26 18:13, Bence Csókás wrote:
> [Sie erhalten nicht häufig E-Mails von bence.csokas(a)arm.com. Weitere Informationen, warum dies wichtig ist, finden Sie unter https://aka.ms/LearnAboutSenderIdentification ]
>
> Hi,
>
> I just came across this commit while researching something else.
> Original patch had too few context lines, so I here's the diff with `-U10`.
>
> On 3/18/25 20:22, Daniel Almeida wrote:
>> From: Asahi Lina <lina(a)asahilina.net>
>>
>> Since commit 21aa27ddc582 ("drm/shmem-helper: Switch to reservation
>> lock"), the drm_gem_shmem_vmap and drm_gem_shmem_vunmap functions
>> require that the caller holds the DMA reservation lock for the object.
>> Add lockdep assertions to help validate this.
>
> There were already lockdep assertions...
Good point, I completely missed that.
>
>> Signed-off-by: Asahi Lina <lina(a)asahilina.net>
>> Signed-off-by: Daniel Almeida <daniel.almeida(a)collabora.com>
>> Reviewed-by: Christian König <christian.koenig(a)amd.com>
>> Signed-off-by: Lyude Paul <lyude(a)redhat.com>
>> Link: https://lore.kernel.org/r/20250318-drm-gem-shmem-v1-1-64b96511a84f@collabor…
>> ---
>> Â drivers/gpu/drm/drm_gem_shmem_helper.c | 4 ++++
>> Â 1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c
>> index aa43265f4f4f..0b41f0346bad 100644
>> --- a/drivers/gpu/drm/drm_gem_shmem_helper.c
>> +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c
>> @@ -341,20 +341,22 @@ EXPORT_SYMBOL_GPL(drm_gem_shmem_unpin);
>> Â Â *
>> Â Â * Returns:
>> Â Â * 0 on success or a negative error code on failure.
>> Â Â */
>> Â int drm_gem_shmem_vmap_locked(struct drm_gem_shmem_object *shmem,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â struct iosys_map *map)
>> Â {
>> Â Â Â Â Â struct drm_gem_object *obj = &shmem->base;
>> Â Â Â Â Â int ret = 0;
>>
>> +Â Â Â Â dma_resv_assert_held(obj->resv);
>> +
>> Â Â Â Â Â if (drm_gem_is_imported(obj)) {
>> Â Â Â Â Â Â Â Â Â Â Â Â Â ret = dma_buf_vmap(obj->dma_buf, map);
>> Â Â Â Â Â } else {
>> Â Â Â Â Â Â Â Â Â Â Â Â Â pgprot_t prot = PAGE_KERNEL;
>>
>> Â Â Â Â Â Â Â Â Â Â Â Â Â dma_resv_assert_held(shmem->base.resv);
>
> ... right here, and
>
>> Â Â Â Â Â Â Â Â Â Â Â Â Â if (refcount_inc_not_zero(&shmem->vmap_use_count)) {
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â iosys_map_set_vaddr(map, shmem->vaddr);
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â return 0;
>> @@ -401,20 +403,22 @@ EXPORT_SYMBOL_GPL(drm_gem_shmem_vmap_locked);
>> Â Â * drops to zero.
>> Â Â *
>> Â Â * This function hides the differences between dma-buf imported and natively
>> Â Â * allocated objects.
>> Â Â */
>> Â void drm_gem_shmem_vunmap_locked(struct drm_gem_shmem_object *shmem,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â struct iosys_map *map)
>> Â {
>> Â Â Â Â Â struct drm_gem_object *obj = &shmem->base;
>>
>> +Â Â Â Â dma_resv_assert_held(obj->resv);
>> +
>> Â Â Â Â Â if (drm_gem_is_imported(obj)) {
>> Â Â Â Â Â Â Â Â Â Â Â Â Â dma_buf_vunmap(obj->dma_buf, map);
>> Â Â Â Â Â } else {
>> Â Â Â Â Â Â Â Â Â Â Â Â Â dma_resv_assert_held(shmem->base.resv);
>
> ...here.
>
>> Â Â Â Â Â Â Â Â Â Â Â Â Â if (refcount_dec_and_test(&shmem->vmap_use_count)) {
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â vunmap(shmem->vaddr);
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â shmem->vaddr = NULL;
>>
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â drm_gem_shmem_unpin_locked(shmem);
>
> Or were those insufficient for some reason? If so, should we keep both
> of them, or should the older ones have been removed?
The dma_buf_vmap()/dma_buf_vunmap() functions require the caller to be holding the reservation lock as well.
So it kind of makes sense to move the assertions to the beginning of the functions.
Regards,
Christian.
>
> Bence
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 v4:
- Fix compilation failure
- Rework to take into account OF_RESERVED_MEM
- Fix regression making the default CMA area disappear if not created
through the DT
- Added some documentation and comments
- Link to v3: https://lore.kernel.org/r/20260303-dma-buf-heaps-as-modules-v3-0-24344812c7…
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 | 22 +++----------
drivers/dma-buf/heaps/system_heap.c | 5 +++
include/linux/dma-buf/heaps/cma.h | 16 ---------
include/linux/dma-map-ops.h | 14 ++++----
kernel/dma/contiguous.c | 66 +++++++++++++++++++++++++++++++++----
mm/cma.c | 3 ++
8 files changed, 82 insertions(+), 49 deletions(-)
---
base-commit: c081b71f11732ad2c443f170ab19c3ebe8a1a422
change-id: 20260225-dma-buf-heaps-as-modules-1034b3ec9f2a
Best regards,
--
Maxime Ripard <mripard(a)kernel.org>
Hi,
I know I'm late to the party here...
Like John, I'm also not very close to this stuff any more, but I agree
with the other discussions: makes sense for this to be a separate
heap, and cc_shared makes sense too.
I'm not clear why the heap depends on !CONFIG_HIGHMEM, but I also
don't know anything about SEV/TDX.
-Brian
On Wed, Mar 25, 2026 at 08:23:50PM +0000, Jiri Pirko wrote:
> From: Jiri Pirko <jiri(a)nvidia.com>
>
> Confidential computing (CoCo) VMs/guests, such as AMD SEV and Intel TDX,
> run with private/encrypted 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 shared 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 shared
> (decrypted) memory allocations from new dma-buf system_cc_shared 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.
>
> Based on dma-mapping-for-next e7442a68cd1ee797b585f045d348781e9c0dde0d
>
> Jiri Pirko (2):
> dma-mapping: introduce DMA_ATTR_CC_SHARED for shared memory
> dma-buf: heaps: system: add system_cc_shared heap for explicitly
> shared 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
>