Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

volatile: revert changes introduced by #95 #132

Closed
wants to merge 1 commit into from

Conversation

jiangliu
Copy link
Member

@jiangliu jiangliu commented Jan 4, 2021

#95 fixed the problem of torn reads/writes caused by the implementation
of read/write_obj essentially leveraging the environment specific
memcpy, and the implicit assumption that read/write_obj perform atomic
accesses up to a certain size at aligned addresses. Meanwhile, we added
the load/store operations to Bytes which provide explicit atomic access
semantics.

Now there are three possible types of memory access methods:

  1. atomic access: VolatileSlice::load/store() for integer atomic data
    types
  2. volatile access: {VolatileRef|VolatileArrayRef}::{load|store()|
    copy_from|copy_from} when size_of::() > 1
  3. normal access: all other byte stream oriented memory accesses

Explicitly states that GuestMemory/Bytes are byte stream oriented, and do
not guarantee atomicity. Callers need to be care to choose the access method,
in preference for both safety and high performance.

Signed-off-by: Liu Jiang gerry@linux.alibaba.com

Fixes: #95

rust-vmm#95 fixed the problem of torn reads/writes caused by the implementation
of read/write_obj essentially leveraging the environment specific
memcpy, and the implicit assumption that read/write_obj perform atomic
accesses up to a certain size at aligned addresses. Meanwhile, we added
the load/store operations to Bytes which provide explicit atomic access
semantics.

Now there are three possible types of memory access methods:
1) atomic access: `VolatileSlice`::load/store() for integer atomic data
   types
2) volatile access: {`VolatileRef`|`VolatileArrayRef`}::{load|store()|
   copy_from<T>|copy_from<T>} when size_of::<T>() > 1
3) normal access: all other byte stream oriented memory accesses

Callers need to be care to choose the access method, in preferrence for
both safety and high performance.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
@alexandruag
Copy link
Collaborator

As we mentioned in #123, this may have more profound implications on the consumers of vm-memory. Is it ok if we try to merge and release the other active PRs first, and then circle back to this one and release it as well?

@jiangliu jiangliu closed this Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants