vm_memory/atomic.rs
1// Copyright (C) 2019 Alibaba Cloud Computing. All rights reserved.
2// Copyright (C) 2020 Red Hat, Inc. All rights reserved.
3// SPDX-License-Identifier: Apache-2.0
4
5//! A wrapper over an `ArcSwap<GuestMemory>` struct to support RCU-style mutability.
6//!
7//! With the `backend-atomic` feature enabled, simply replacing `GuestMemoryMmap`
8//! with `GuestMemoryAtomic<GuestMemoryMmap>` will enable support for mutable memory maps.
9//! To support mutable memory maps, devices will also need to use
10//! `GuestAddressSpace::memory()` to gain temporary access to guest memory.
11
12pub use vm_memory_new::atomic::{
13 GuestMemoryAtomic, GuestMemoryExclusiveGuard, GuestMemoryLoadGuard,
14};