Skip to content

Commit 4b8649a

Browse files
RuoqingHeroypat
authored andcommitted
chore: Format .md files with mdformat
Signed-off-by: Ruoqing He <[email protected]>
1 parent 4adccfd commit 4b8649a

File tree

3 files changed

+94
-79
lines changed

3 files changed

+94
-79
lines changed

CHANGELOG.md

Lines changed: 89 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -2,220 +2,234 @@
22

33
## Upcoming version
44

5-
## [v0.16.0]
5+
## \[v0.16.0\]
66

77
### Added
88

9-
- [[#287](https://github.com/rust-vmm/vm-memory/pull/287)] Support for RISC-V 64-bit platform.
10-
- [[#299](https://github.com/rust-vmm/vm-memory/pull/299)] atomic_bitmap: support enlarging the bitmap.
9+
- \[[#287](https://github.com/rust-vmm/vm-memory/pull/287)\] Support for RISC-V 64-bit platform.
10+
- \[[#299](https://github.com/rust-vmm/vm-memory/pull/299)\] atomic_bitmap: support enlarging the bitmap.
1111

1212
### Changed
1313

14-
- [[#278](https://github.com/rust-vmm/vm-memory/pull/278) Remove `GuestMemoryIterator` trait,
14+
- \[[#278](https://github.com/rust-vmm/vm-memory/pull/278) Remove `GuestMemoryIterator` trait,
1515
and instead have GuestMemory::iter() return `impl Iterator`.
1616

17-
## [v0.15.0]
17+
## \[v0.15.0\]
1818

1919
### Added
20-
- [[#270](https://github.com/rust-vmm/vm-memory/pull/270)] atomic_bitmap: add capability to reset bits range
21-
- [[#285](https://github.com/rust-vmm/vm-memory/pull/285)] Annotated modules in lib.rs to indicate their feature
20+
21+
- \[[#270](https://github.com/rust-vmm/vm-memory/pull/270)\] atomic_bitmap: add capability to reset bits range
22+
- \[[#285](https://github.com/rust-vmm/vm-memory/pull/285)\] Annotated modules in lib.rs to indicate their feature
2223
dependencies such that it is reflected in the docs, enhancing documentation clarity for users.
2324

2425
### Changed
25-
- [[#275](https://github.com/rust-vmm/vm-memory/pull/275)] Fail builds on non 64-bit platforms.
26+
27+
- \[[#275](https://github.com/rust-vmm/vm-memory/pull/275)\] Fail builds on non 64-bit platforms.
28+
2629
### Fixed
27-
- [[#279](https://github.com/rust-vmm/vm-memory/pull/279)] Remove restriction from `read_volatile_from` and `write_volatile_into`
30+
31+
- \[[#279](https://github.com/rust-vmm/vm-memory/pull/279)\] Remove restriction from `read_volatile_from` and `write_volatile_into`
2832
that made it copy data it chunks of 4096.
2933

3034
### Removed
35+
3136
### Deprecated
3237

33-
## [v0.14.0]
38+
## \[v0.14.0\]
3439

3540
### Added
36-
- [[#266](https://github.com/rust-vmm/vm-memory/pull/266)] Derive `Debug` for several
41+
42+
- \[[#266](https://github.com/rust-vmm/vm-memory/pull/266)\] Derive `Debug` for several
3743
types that were missing it.
3844

3945
### Changed
40-
- [[#274](https://github.com/rust-vmm/vm-memory/pull/274)] Drop `Default` as requirement for `ByteValued`.
4146

42-
## [v0.13.1]
47+
- \[[#274](https://github.com/rust-vmm/vm-memory/pull/274)\] Drop `Default` as requirement for `ByteValued`.
48+
49+
## \[v0.13.1\]
4350

4451
### Added
4552

46-
- [[#256](https://github.com/rust-vmm/vm-memory/pull/256)] Implement `WriteVolatile`
53+
- \[[#256](https://github.com/rust-vmm/vm-memory/pull/256)\] Implement `WriteVolatile`
4754
for `std::io::Stdout`.
48-
- [[#256](https://github.com/rust-vmm/vm-memory/pull/256)] Implement `WriteVolatile`
55+
- \[[#256](https://github.com/rust-vmm/vm-memory/pull/256)\] Implement `WriteVolatile`
4956
for `std::vec::Vec`.
50-
- [[#256](https://github.com/rust-vmm/vm-memory/pull/256)] Implement `WriteVolatile`
57+
- \[[#256](https://github.com/rust-vmm/vm-memory/pull/256)\] Implement `WriteVolatile`
5158
for `Cursor<&mut [u8]>`.
52-
- [[#256](https://github.com/rust-vmm/vm-memory/pull/256)] Implement `ReadVolatile`
59+
- \[[#256](https://github.com/rust-vmm/vm-memory/pull/256)\] Implement `ReadVolatile`
5360
for `Cursor<T: AsRef[u8]>`.
5461

55-
## [v0.13.0]
62+
## \[v0.13.0\]
5663

5764
### Added
58-
- [[#247]](https://github.com/rust-vmm/vm-memory/pull/247) Add `ReadVolatile` and
65+
66+
- [\[#247\]](https://github.com/rust-vmm/vm-memory/pull/247) Add `ReadVolatile` and
5967
`WriteVolatile` traits which are equivalents of `Read`/`Write` with volatile
6068
access semantics.
6169

6270
### Changed
6371

64-
- [[#247]](https://github.com/rust-vmm/vm-memory/pull/247) Deprecate
72+
- [\[#247\]](https://github.com/rust-vmm/vm-memory/pull/247) Deprecate
6573
`Bytes::{read_from, read_exact_from, write_to, write_all_to}`. Instead use
6674
`ReadVolatile`/`WriteVolatile`, which do not incur the performance penalty
6775
of copying to hypervisor memory due to `Read`/`Write` being incompatible
6876
with volatile semantics (see also #217).
6977

70-
71-
## [v0.12.2]
78+
## \[v0.12.2\]
7279

7380
### Fixed
74-
- [[#251]](https://github.com/rust-vmm/vm-memory/pull/251): Inserted checks
81+
82+
- [\[#251\]](https://github.com/rust-vmm/vm-memory/pull/251): Inserted checks
7583
that verify that the value returned by `VolatileMemory::get_slice` is of
7684
the correct length.
7785

7886
### Deprecated
79-
- [[#244]](https://github.com/rust-vmm/vm-memory/pull/241) Deprecate volatile
87+
88+
- [\[#244\]](https://github.com/rust-vmm/vm-memory/pull/241) Deprecate volatile
8089
memory's `as_ptr()` interfaces. The new interfaces to be used instead are:
8190
`ptr_guard()` and `ptr_guard_mut()`.
8291

83-
## [v0.12.1]
92+
## \[v0.12.1\]
8493

8594
### Fixed
86-
- [[#241]](https://github.com/rust-vmm/vm-memory/pull/245) mmap_xen: Don't drop
95+
96+
- [\[#241\]](https://github.com/rust-vmm/vm-memory/pull/245) mmap_xen: Don't drop
8797
the FileOffset while in use #245
8898

89-
## [v0.12.0]
99+
## \[v0.12.0\]
90100

91101
### Added
92-
- [[#241]](https://github.com/rust-vmm/vm-memory/pull/241) Add Xen memory
102+
103+
- [\[#241\]](https://github.com/rust-vmm/vm-memory/pull/241) Add Xen memory
93104
mapping support: Foreign and Grant. Add new API for accessing pointers to
94105
volatile slices, as `as_ptr()` can't be used with Xen's Grant mapping.
95-
- [[#237]](https://github.com/rust-vmm/vm-memory/pull/237) Implement `ByteValued` for `i/u128`.
106+
- [\[#237\]](https://github.com/rust-vmm/vm-memory/pull/237) Implement `ByteValued` for `i/u128`.
96107

97-
## [v0.11.0]
108+
## \[v0.11.0\]
98109

99110
### Added
100-
- [[#216]](https://github.com/rust-vmm/vm-memory/pull/216) Add `GuestRegionMmap::from_region`.
111+
112+
- [\[#216\]](https://github.com/rust-vmm/vm-memory/pull/216) Add `GuestRegionMmap::from_region`.
101113

102114
### Fixed
103-
- [[#217]](https://github.com/rust-vmm/vm-memory/pull/217) Fix vm-memory internally
104-
taking rust-style slices to guest memory in ways that could potentially cause
115+
116+
- [\[#217\]](https://github.com/rust-vmm/vm-memory/pull/217) Fix vm-memory internally
117+
taking rust-style slices to guest memory in ways that could potentially cause
105118
undefined behavior. Removes/deprecates various `as_slice`/`as_slice_mut` methods
106-
whose usage violated rust's aliasing rules, as well as an unsound
119+
whose usage violated rust's aliasing rules, as well as an unsound
107120
`impl<'a> VolatileMemory for &'a mut [u8]`.
108121

109-
## [v0.10.0]
122+
## \[v0.10.0\]
110123

111124
### Changed
112-
- [[#208]](https://github.com/rust-vmm/vm-memory/issues/208) Updated
125+
126+
- [\[#208\]](https://github.com/rust-vmm/vm-memory/issues/208) Updated
113127
vmm-sys-util dependency to v0.11.0
114-
- [[#203]](https://github.com/rust-vmm/vm-memory/pull/203) Switched to Rust
128+
- [\[#203\]](https://github.com/rust-vmm/vm-memory/pull/203) Switched to Rust
115129
edition 2021.
116130

117-
## [v0.9.0]
131+
## \[v0.9.0\]
118132

119133
### Fixed
120134

121-
- [[#195]](https://github.com/rust-vmm/vm-memory/issues/195):
135+
- [\[#195\]](https://github.com/rust-vmm/vm-memory/issues/195):
122136
`mmap::check_file_offset` is doing the correct size validation for block and
123137
char devices as well.
124138

125139
### Changed
126140

127-
- [[#198]](https://github.com/rust-vmm/vm-memory/pull/198): atomic: enable 64
141+
- [\[#198\]](https://github.com/rust-vmm/vm-memory/pull/198): atomic: enable 64
128142
bit atomics on ppc64le and s390x.
129-
- [[#200]](https://github.com/rust-vmm/vm-memory/pull/200): docs: enable all
143+
- [\[#200\]](https://github.com/rust-vmm/vm-memory/pull/200): docs: enable all
130144
features in `docs.rs`.
131-
- [[#199]](https://github.com/rust-vmm/vm-memory/issues/199): Update the way
145+
- [\[#199\]](https://github.com/rust-vmm/vm-memory/issues/199): Update the way
132146
the dependencies are pulled such that we don't end up with incompatible
133147
versions.
134148

135-
## [v0.8.0]
149+
## \[v0.8.0\]
136150

137151
### Fixed
138152

139-
- [[#190]](https://github.com/rust-vmm/vm-memory/pull/190):
153+
- [\[#190\]](https://github.com/rust-vmm/vm-memory/pull/190):
140154
`VolatileSlice::read/write` when input slice is empty.
141155

142-
## [v0.7.0]
156+
## \[v0.7.0\]
143157

144158
### Changed
145159

146-
- [[#176]](https://github.com/rust-vmm/vm-memory/pull/176): Relax the trait
160+
- [\[#176\]](https://github.com/rust-vmm/vm-memory/pull/176): Relax the trait
147161
bounds of `Bytes` auto impl for `T: GuestMemory`
148-
- [[#178]](https://github.com/rust-vmm/vm-memory/pull/178):
162+
- [\[#178\]](https://github.com/rust-vmm/vm-memory/pull/178):
149163
`MmapRegion::build_raw` no longer requires that the length of the region is a
150164
multiple of the page size.
151165

152-
## [v0.6.0]
166+
## \[v0.6.0\]
153167

154168
### Added
155169

156-
- [[#160]](https://github.com/rust-vmm/vm-memory/pull/160): Add `ArcRef` and `AtomicBitmapArc` bitmap
157-
backend implementations.
158-
- [[#149]](https://github.com/rust-vmm/vm-memory/issues/149): Implement builder for MmapRegion.
159-
- [[#140]](https://github.com/rust-vmm/vm-memory/issues/140): Add dirty bitmap tracking abstractions.
170+
- [\[#160\]](https://github.com/rust-vmm/vm-memory/pull/160): Add `ArcRef` and `AtomicBitmapArc` bitmap
171+
backend implementations.
172+
- [\[#149\]](https://github.com/rust-vmm/vm-memory/issues/149): Implement builder for MmapRegion.
173+
- [\[#140\]](https://github.com/rust-vmm/vm-memory/issues/140): Add dirty bitmap tracking abstractions.
160174

161-
### Deprecated
175+
### Deprecated
162176

163-
- [[#133]](https://github.com/rust-vmm/vm-memory/issues/8): Deprecate `GuestMemory::with_regions()`,
164-
`GuestMemory::with_regions_mut()`, `GuestMemory::map_and_fold()`.
177+
- [\[#133\]](https://github.com/rust-vmm/vm-memory/issues/8): Deprecate `GuestMemory::with_regions()`,
178+
`GuestMemory::with_regions_mut()`, `GuestMemory::map_and_fold()`.
165179

166-
## [v0.5.0]
180+
## \[v0.5.0\]
167181

168182
### Added
169183

170-
- [[#8]](https://github.com/rust-vmm/vm-memory/issues/8): Add GuestMemory method to return an Iterator
171-
- [[#120]](https://github.com/rust-vmm/vm-memory/pull/120): Add is_hugetlbfs() to GuestMemoryRegion
172-
- [[#126]](https://github.com/rust-vmm/vm-memory/pull/126): Add VolatileSlice::split_at()
173-
- [[#128]](https://github.com/rust-vmm/vm-memory/pull/128): Add VolatileSlice::subslice()
184+
- [\[#8\]](https://github.com/rust-vmm/vm-memory/issues/8): Add GuestMemory method to return an Iterator
185+
- [\[#120\]](https://github.com/rust-vmm/vm-memory/pull/120): Add is_hugetlbfs() to GuestMemoryRegion
186+
- [\[#126\]](https://github.com/rust-vmm/vm-memory/pull/126): Add VolatileSlice::split_at()
187+
- [\[#128\]](https://github.com/rust-vmm/vm-memory/pull/128): Add VolatileSlice::subslice()
174188

175-
## [v0.4.0]
189+
## \[v0.4.0\]
176190

177191
### Fixed
178192

179-
- [[#100]](https://github.com/rust-vmm/vm-memory/issues/100): Performance
193+
- [\[#100\]](https://github.com/rust-vmm/vm-memory/issues/100): Performance
180194
degradation after fixing [#95](https://github.com/rust-vmm/vm-memory/pull/95).
181-
- [[#122]](https://github.com/rust-vmm/vm-memory/pull/122): atomic,
195+
- [\[#122\]](https://github.com/rust-vmm/vm-memory/pull/122): atomic,
182196
Cargo.toml: Update for arc-swap 1.0.0.
183197

184-
## [v0.3.0]
198+
## \[v0.3.0\]
185199

186200
### Added
187201

188-
- [[#109]](https://github.com/rust-vmm/vm-memory/pull/109): Added `build_raw` to
202+
- [\[#109\]](https://github.com/rust-vmm/vm-memory/pull/109): Added `build_raw` to
189203
`MmapRegion` which can be used to operate on externally created mappings.
190-
- [[#101]](https://github.com/rust-vmm/vm-memory/pull/101): Added `check_range` for
204+
- [\[#101\]](https://github.com/rust-vmm/vm-memory/pull/101): Added `check_range` for
191205
GuestMemory which could be used to validate a range of guest memory.
192-
- [[#115]](https://github.com/rust-vmm/vm-memory/pull/115): Add methods for atomic
206+
- [\[#115\]](https://github.com/rust-vmm/vm-memory/pull/115): Add methods for atomic
193207
access to `Bytes`.
194208

195209
### Fixed
196210

197-
- [[#93]](https://github.com/rust-vmm/vm-memory/issues/93): DoS issue when using
211+
- [\[#93\]](https://github.com/rust-vmm/vm-memory/issues/93): DoS issue when using
198212
virtio with rust-vmm/vm-memory.
199-
- [[#106]](https://github.com/rust-vmm/vm-memory/issues/106): Asserts trigger
200-
on zero-length access.
213+
- [\[#106\]](https://github.com/rust-vmm/vm-memory/issues/106): Asserts trigger
214+
on zero-length access.
201215

202216
### Removed
203217

204218
- `integer-atomics` is no longer a distinct feature of the crate.
205219

206-
## [v0.2.0]
220+
## \[v0.2.0\]
207221

208222
### Added
209223

210-
- [[#76]](https://github.com/rust-vmm/vm-memory/issues/76): Added `get_slice` and
224+
- [\[#76\]](https://github.com/rust-vmm/vm-memory/issues/76): Added `get_slice` and
211225
`as_volatile_slice` to `GuestMemoryRegion`.
212-
- [[#82]](https://github.com/rust-vmm/vm-memory/issues/82): Added `Clone` bound
226+
- [\[#82\]](https://github.com/rust-vmm/vm-memory/issues/82): Added `Clone` bound
213227
for `GuestAddressSpace::T`, the return value of `GuestAddressSpace::memory()`.
214-
- [[#88]](https://github.com/rust-vmm/vm-memory/issues/88): Added `as_bytes` for
228+
- [\[#88\]](https://github.com/rust-vmm/vm-memory/issues/88): Added `as_bytes` for
215229
`ByteValued` which can be used for reading into POD structures from
216230
raw bytes.
217231

218-
## [v0.1.0]
232+
## \[v0.1.0\]
219233

220234
### Added
221235

DESIGN.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The `vm-memory` crate could be divided into four logic parts as:
3939

4040
- [Abstraction of Address Space](#abstraction-of-address-space)
4141
- [Specialization for Virtual Machine Physical Address Space](#specialization-for-virtual-machine-physical-address-space)
42-
- [Backend Implementation Based on `mmap`](#backend-implementation-based-on-`mmap`)
42+
- [Backend Implementation Based on `mmap`](#backend-implementation-based-on-mmap)
4343
- [Utilities and helpers](#utilities-and-helpers)
4444

4545
### Address Space Abstraction
@@ -48,9 +48,9 @@ The address space abstraction contains traits and implementations for working
4848
with addresses as follows:
4949

5050
- `AddressValue`: stores the raw value of an address. Typically `u32`, `u64` or
51-
`usize` are used to store the raw value. Pointers such as `*u8`, can not be
52-
used as an implementation of `AddressValue` because the `Add` and `Sub`
53-
traits are not implemented for that type.
51+
`usize` are used to store the raw value. Pointers such as `*u8`, can not be
52+
used as an implementation of `AddressValue` because the `Add` and `Sub`
53+
traits are not implemented for that type.
5454
- `Address`: implementation of `AddressValue`.
5555
- `Bytes`: trait for volatile access to memory. The `Bytes` trait can be
5656
parameterized with types that represent addresses, in order to enforce that

TODO.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
### TODO List
2+
23
- Abstraction layer to seperate VM memory management from VM memory accessor.
34
- Help needed to refine documentation and usage examples.

0 commit comments

Comments
 (0)