islet-project / islet

An on-device confidential computing platform
Apache License 2.0
91 stars 16 forks source link

Avoid double copy on RMI_DATA_CREATE #334

Closed bitboom closed 2 months ago

bitboom commented 3 months ago

Background

To mitigate concurrency issues with memory regions shared between the host and RMM, the host::copy_from operation was used to copy data from the host.

Problem

However, for the RMI_DATA_CREATE case, this mitigation let to double copy costs.

This PR

To address this, a new function host::direct_copy_from has been added to perform the copy in a single step.

jinbpark commented 2 months ago

What this PR is doing has to do with our off-line discussion today? a new yet efficient method to enforce one-time copy using rust syntax.

bitboom commented 2 months ago

What this PR is doing has to do with our off-line discussion today? a new yet efficient method to enforce one-time copy using rust syntax.

In our offline discussion, we also talked about taking ownership of individual fields in the structure when reading them individually. Additional considerations are required to support these matters.