Commit Graph

7240 Commits

Author SHA1 Message Date
Jinank Jain
5fd79571b7 vmm: Add a feature flag for SEV-SNP support
This feature flag gates the development for SEV-SNP enabled guest.

Also add a helper function to identify if SNP should be enabled for the
guest.

Signed-off-by: Jinank Jain <jinankjain@microsoft.com>
2023-09-07 12:52:27 +01:00
dependabot[bot]
3e1b0bc124 build: Bump regex-syntax from 0.7.4 to 0.7.5
Bumps [regex-syntax](https://github.com/rust-lang/regex) from 0.7.4 to 0.7.5.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/regex-syntax-0.7.4...regex-syntax-0.7.5)

---
updated-dependencies:
- dependency-name: regex-syntax
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-07 07:14:34 +00:00
dependabot[bot]
1632dbbf29 build: Bump zerocopy from 0.6.3 to 0.6.4 in /fuzz
Bumps [zerocopy](https://github.com/google/zerocopy) from 0.6.3 to 0.6.4.
- [Commits](https://github.com/google/zerocopy/compare/v0.6.3...v0.6.4)

---
updated-dependencies:
- dependency-name: zerocopy
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-06 23:18:49 +00:00
Thomas Barrett
8d2e590886 rate-limiter: Allow RateLimiter to be shared between threads
Signed-off-by: Thomas Barrett <tbarrett@crusoeenergy.com>
2023-09-06 15:02:37 -07:00
dependabot[bot]
e880aeed8d build: Bump openssl-sys from 0.9.91 to 0.9.93
Bumps [openssl-sys](https://github.com/sfackler/rust-openssl) from 0.9.91 to 0.9.93.
- [Release notes](https://github.com/sfackler/rust-openssl/releases)
- [Commits](https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.91...openssl-sys-v0.9.93)

---
updated-dependencies:
- dependency-name: openssl-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-06 17:39:14 +00:00
Rob Bradford
8bdf59bbee build: Use focal version of azure-cli client on aarch64
The worker is running focal not bionic - this fixes build issues on that
worker machine due to the bionic version not being installable.

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2023-09-06 12:06:20 +01:00
dependabot[bot]
14edd6d9de build: Bump thiserror from 1.0.47 to 1.0.48 in /fuzz
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.47 to 1.0.48.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.47...1.0.48)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-05 23:43:35 +00:00
Rob Bradford
01097aa130 block: Ensure probing reads are block size aligned
This is necessary for O_DIRECT based use of raw block devices which may
require access at a larger block size than that of a sector (512 bytes.)

Fixes: #5722

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2023-09-05 13:09:49 -07:00
Rob Bradford
9ca2c336f2 block: Move DiskTopology to common code
It doens't make sense to limit this to the async_io module and import
across modules so place in default create module.

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2023-09-05 13:09:49 -07:00
dependabot[bot]
b1a1b2a622 build: Bump nix from 0.26.2 to 0.26.4
Bumps [nix](https://github.com/nix-rust/nix) from 0.26.2 to 0.26.4.
- [Changelog](https://github.com/nix-rust/nix/blob/v0.26.4/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.26.2...v0.26.4)

---
updated-dependencies:
- dependency-name: nix
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-01 23:52:31 +00:00
Philipp Schuster
556bda74a0 hypervisor: emulator: Use wrapping add for memory offset
Assume rax is 0xfee003e0 and the displacement is negative 0x60. The effective
address is then 0xfee00380. This is perfectly valid.

Example instruction:
c7 40 a0 00 10 00 00    movl   $0x1000,-0x60(%rax)

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
2023-09-01 14:27:54 +01:00
dependabot[bot]
8db85eca1f build: Bump io-uring from 0.6.0 to 0.6.1
Bumps [io-uring](https://github.com/tokio-rs/io-uring) from 0.6.0 to 0.6.1.
- [Commits](https://github.com/tokio-rs/io-uring/commits)

---
updated-dependencies:
- dependency-name: io-uring
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-31 23:59:42 +00:00
Rob Bradford
b5766028a8 virtio-devices: block: Make latency infinite before first op
Logically until we have handled the first operation the latency is
infinite; this logic was applied to the minimum latency originally but
this patch extends that logic to the maximum and average latency.

To prevent the initial average latency being skewed by the inclusion of
infinity the average value is initally seeded with the first measured
latency.

Fixes: #5704

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2023-08-31 08:22:07 -07:00
dependabot[bot]
35757ec45a build: Bump mshv-ioctls from a45fbeb to c5a6050
Bumps [mshv-ioctls](https://github.com/rust-vmm/mshv) from `a45fbeb` to `c5a6050`.
- [Commits](a45fbeb4a3...c5a6050859)

---
updated-dependencies:
- dependency-name: mshv-ioctls
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-31 00:28:57 +00:00
Ruslan Mstoi
a51b48a095 tests: fix typo expected_events to latest_events
In the documentation of function check_latest_events_exact use same events
argument name as in the implementation

Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2023-08-30 13:06:32 -07:00
dependabot[bot]
d1ee623f0e build: Bump regex-automata from 0.3.3 to 0.3.7
Bumps [regex-automata](https://github.com/rust-lang/regex) from 0.3.3 to 0.3.7.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/regex-automata-0.3.3...regex-syntax-0.3.7)

---
updated-dependencies:
- dependency-name: regex-automata
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-30 00:22:15 +00:00
Rob Bradford
a2752fe04f virtio-devices: vsock: Support single descriptor
Since kernel v6.3 the vsock packet is not split over two descriptors
and is instead included in a single one.

This change is based on the discovery and fix identified by Stefano
Garzarella for the vm-virtio vsock implementation and adapted for our
very different codebase.

Fixes: #5691

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2023-08-29 15:36:49 -07:00
Omer Faruk Bayram
cc5dd8c297 docs: api: document newly added event signal to the D-Bus API
Signed-off-by: Omer Faruk Bayram <omer.faruk@sartura.hr>
2023-08-28 17:01:03 -07:00
Omer Faruk Bayram
2ed96cd3ed vmm: dbus: broadcast event_monitor events over the DBus API
This commit builds on top of the `Monitor::subscribe` function and
makes it possible to broadcast events published from `event-monitor`
over D-Bus.

The broadcasting functionality is enabled if the D-Bus API is enabled
and users who wish to also enable the file based `event-monitor` can do
so with the CLI arg `--event-monitor`.

Signed-off-by: Omer Faruk Bayram <omer.faruk@sartura.hr>
2023-08-28 17:01:03 -07:00
Omer Faruk Bayram
e02efe9ba0 event_monitor: make it possible to subscribe to Monitor
Signed-off-by: Omer Faruk Bayram <omer.faruk@sartura.hr>
2023-08-28 17:01:03 -07:00
dependabot[bot]
654ac49bd6 build: Bump micro_http from b538bf8 to 0d0fdcd
Bumps [micro_http](https://github.com/firecracker-microvm/micro-http) from `b538bf8` to `0d0fdcd`.
- [Commits](b538bf89e5...0d0fdcd50e)

---
updated-dependencies:
- dependency-name: micro_http
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-28 23:55:16 +00:00
dependabot[bot]
8013e47856 build: Bump openssl-sys from 0.9.90 to 0.9.91
Bumps [openssl-sys](https://github.com/sfackler/rust-openssl) from 0.9.90 to 0.9.91.
- [Release notes](https://github.com/sfackler/rust-openssl/releases)
- [Commits](https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.90...openssl-sys-v0.9.91)

---
updated-dependencies:
- dependency-name: openssl-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-26 00:16:59 +00:00
dependabot[bot]
7216d934de build: Bump quote from 1.0.32 to 1.0.33 in /fuzz
Bumps [quote](https://github.com/dtolnay/quote) from 1.0.32 to 1.0.33.
- [Release notes](https://github.com/dtolnay/quote/releases)
- [Commits](https://github.com/dtolnay/quote/compare/1.0.32...1.0.33)

---
updated-dependencies:
- dependency-name: quote
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-25 23:34:35 +00:00
dependabot[bot]
f45bbbfcac build: Bump serde from 1.0.164 to 1.0.168
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.164 to 1.0.168.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.164...v1.0.168)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-25 09:53:12 +00:00
dependabot[bot]
d87024a752 build: Bump micro_http from b538bf8 to 0d0fdcd in /fuzz
Bumps [micro_http](https://github.com/firecracker-microvm/micro-http) from `b538bf8` to `0d0fdcd`.
- [Commits](b538bf89e5...0d0fdcd50e)

---
updated-dependencies:
- dependency-name: micro_http
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-24 23:46:18 +00:00
dependabot[bot]
bb94dd18ee build: Bump openssl-src from 111.26.0+1.1.1u to 111.27.0+1.1.1v
Bumps [openssl-src](https://github.com/alexcrichton/openssl-src-rs) from 111.26.0+1.1.1u to 111.27.0+1.1.1v.
- [Release notes](https://github.com/alexcrichton/openssl-src-rs/releases)
- [Commits](https://github.com/alexcrichton/openssl-src-rs/commits)

---
updated-dependencies:
- dependency-name: openssl-src
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-24 08:03:35 +00:00
dependabot[bot]
00e4f28e8f build: Bump thiserror from 1.0.44 to 1.0.47 in /fuzz
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.44 to 1.0.47.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.44...1.0.47)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-24 00:01:37 +00:00
Rob Bradford
89661f6579 Revert "build: Temporarily disable bare metal Intel workers"
This reverts commit 96df501b7f.

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2023-08-23 17:16:50 +01:00
Rob Bradford
cd7eecc0b0 devices: pvpanic: Clean up struct visibility
There is no need for this struct to be public and since it is used in
this module the #[allow(dead_code)] invocation can be removed.

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2023-08-23 08:05:53 +01:00
dependabot[bot]
78ec651cbf build: Bump serde_with from 3.2.0 to 3.3.0 in /fuzz
Bumps [serde_with](https://github.com/jonasbb/serde_with) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/jonasbb/serde_with/releases)
- [Commits](https://github.com/jonasbb/serde_with/compare/v3.2.0...v3.3.0)

---
updated-dependencies:
- dependency-name: serde_with
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-23 00:04:13 +00:00
dependabot[bot]
3e54a586ce build: Bump async-trait from 0.1.71 to 0.1.73
Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.71 to 0.1.73.
- [Release notes](https://github.com/dtolnay/async-trait/releases)
- [Commits](https://github.com/dtolnay/async-trait/compare/0.1.71...0.1.73)

---
updated-dependencies:
- dependency-name: async-trait
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-22 23:52:19 +00:00
Rob Bradford
9d5c5a6410 vmm: sigwinch_listener: Remove unncessary mut from reference
warning: this argument is a mutable reference, but not used mutably
   --> vmm/src/sigwinch_listener.rs:121:38
    |
121 | fn set_foreground_process_group(tty: &mut File) -> io::Result<()> {
    |                                      ^^^^^^^^^ help: consider changing to: `&File`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2023-08-22 12:01:54 +01:00
Rob Bradford
8d072fef15 vmm: device_manager: Remove unnecessary mut from reference
warning: this argument is a mutable reference, but not used mutably
    --> vmm/src/device_manager.rs:1908:35
     |
1908 |     fn set_raw_mode(&mut self, f: &mut dyn AsRawFd) -> vmm_sys_util::errno::Result<()> {
     |                                   ^^^^^^^^^^^^^^^^ help: consider changing to: `&dyn AsRawFd`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
     = note: `#[warn(clippy::needless_pass_by_ref_mut)]` on by default

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2023-08-22 12:01:54 +01:00
Rob Bradford
1dd1850747 ch-remote: dbus: Remove unnecessary mut from reference
warning: this argument is a mutable reference, but not used mutably
   --> src/bin/ch-remote.rs:397:52
    |
397 | fn dbus_api_do_command(toplevel: &TopLevel, proxy: &mut DBusApi1ProxyBlocking<'_>) -> ApiResult {
    |                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&DBusApi1ProxyBlocking<'_>`
    |
    = note: this is cfg-gated and may require further changes
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
    = note: `#[warn(clippy::needless_pass_by_ref_mut)]` on by default

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2023-08-22 12:01:54 +01:00
Rob Bradford
0bead9ebe1 vmm: cpu: Fix slow vector initialization
warning: slow zero-filling initialization
    --> vmm/src/cpu.rs:1780:9
     |
1779 |         let mut mat_data: Vec<u8> = Vec::new();
     |                                     ---------- help: consider replacing this with: `vec![0; std::mem::size_of_val(&lapic)]`
1780 |         mat_data.resize(std::mem::size_of_val(&lapic), 0);
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#slow_vector_initialization
     = note: `#[warn(clippy::slow_vector_initialization)]` on by default

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2023-08-22 12:01:54 +01:00
Rob Bradford
05a86d892e virtio-devices: vsock: Fix slow vector initialization
warning: slow zero-filling initialization
   --> virtio-devices/src/vsock/csm/txbuf.rs:218:9
    |
216 |         let mut tmp: Vec<u8> = Vec::new();
    |                                ---------- help: consider replacing this with: `vec![0; TxBuf::SIZE - 2]`
217 |
218 |         tmp.resize(TxBuf::SIZE - 2, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#slow_vector_initialization
    = note: `#[warn(clippy::slow_vector_initialization)]` on by default

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2023-08-22 12:01:54 +01:00
Rob Bradford
4d8dacec5e virtio-devices: transport: Remove unnecessary mut from reference
warning: this argument is a mutable reference, but not used mutably
   --> virtio-devices/src/transport/pci_common_config.rs💯17
    |
100 |         queues: &mut [Queue],
    |                 ^^^^^^^^^^^^ help: consider changing to: `&[Queue]`
    |
    = warning: changing this function will impact semver compatibility
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
    = note: `#[warn(clippy::needless_pass_by_ref_mut)]` on by default

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2023-08-22 12:01:54 +01:00
Rob Bradford
cc4422d58b vm-device: bus: Fix incorrect partial_cmp implementation
warning: incorrect implementation of `partial_cmp` on an `Ord` type
  --> vm-device/src/bus.rs:86:1
   |
86 | /  impl PartialOrd for BusRange {
87 | |      fn partial_cmp(&self, other: &BusRange) -> Option<Ordering> {
   | | _________________________________________________________________-
88 | ||         self.base.partial_cmp(&other.base)
89 | ||     }
   | ||_____- help: change this to: `{ Some(self.cmp(other)) }`
90 | |  }
   | |__^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incorrect_partial_ord_impl_on_ord_type
   = note: `#[warn(clippy::incorrect_partial_ord_impl_on_ord_type)]` on by default

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2023-08-22 12:01:54 +01:00
Rob Bradford
239f422203 hypervisor: x86: emulator: Remove unncessary mut from reference
warning: this argument is a mutable reference, but not used mutably
  --> hypervisor/src/arch/x86/emulator/instructions/mod.rs:22:15
   |
22 |     platform: &mut dyn PlatformEmulator<CpuState = T>,
   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&dyn PlatformEmulator<CpuState = T>`
   |
   = note: this is cfg-gated and may require further changes
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2023-08-22 12:01:54 +01:00
Rob Bradford
5636d91524 net_util: queue_pair: Remove unnecessary mut from reference
warning: this argument is a mutable reference, but not used mutably
   --> net_util/src/queue_pair.rs:167:14
    |
167 |         tap: &mut Tap,
    |              ^^^^^^^^ help: consider changing to: `&Tap`
    |
    = warning: changing this function will impact semver compatibility
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2023-08-22 12:01:54 +01:00
Rob Bradford
11c58870c4 block: async_io: Remove unnecessary mut from reference
warning: this argument is a mutable reference, but not used mutably
  --> block/src/async_io.rs:68:28
   |
68 |     fn query_block_size(f: &mut File, block_size_type: BlockSize) -> std::io::Result<u64> {
   |                            ^^^^^^^^^ help: consider changing to: `&File`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2023-08-22 12:01:54 +01:00
Rob Bradford
b74907fa1b block: vhdx: Fix block size check
warning: boolean expression will never evaluate to 'true'
   --> block/src/vhdx/vhdx_metadata.rs:136:20
    |
136 |                 if disk_spec.block_size < BLOCK_SIZE_MIN && disk_spec.block_size > BLOCK_SIZE_MAX {
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: since `BLOCK_SIZE_MIN` < `BLOCK_SIZE_MAX`, the expression evaluates to false for any value of `disk_spec.block_size`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#impossible_comparisons
    = note: `#[warn(clippy::impossible_comparisons)]` on by default

&& was used when || should have been used

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2023-08-22 12:01:54 +01:00
Wei Liu
dbe67fca7f hypervisor: mshv: handle APIC EOI message
Signed-off-by: Wei Liu <liuwe@microsoft.com>
2023-08-21 17:20:05 -07:00
dependabot[bot]
d3fc12b160 build: Bump cpufeatures from 0.2.8 to 0.2.9
Bumps [cpufeatures](https://github.com/RustCrypto/utils) from 0.2.8 to 0.2.9.
- [Commits](https://github.com/RustCrypto/utils/compare/cpufeatures-v0.2.8...cpufeatures-v0.2.9)

---
updated-dependencies:
- dependency-name: cpufeatures
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-22 00:06:45 +00:00
dependabot[bot]
d73d3203dc build: Bump cc from 1.0.82 to 1.0.83 in /fuzz
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.0.82 to 1.0.83.
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Commits](https://github.com/rust-lang/cc-rs/compare/1.0.82...1.0.83)

---
updated-dependencies:
- dependency-name: cc
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-21 23:21:46 +00:00
Jianyong Wu
16e1449f1e balloon: let balloon deflation works on page size other than 4k
Similar to balloon inflation, memory allocation is also constrained to
align with the page size. Therefore, memory is allocated in units of the
host page size, one page at a time, until all host pages that the memory
range requested by the guest are managed. If the requested size is
smaller than the page size, the entire page will still be allocated
because smaller allocations are not possible due to the page size
limitation.

Fixes: cloud-hypervisor#5369
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2023-08-21 16:35:23 +01:00
Jianyong Wu
9dd1698556 balloon: let balloon inflation works on page size other than 4k
Currently, virtio-balloon can't work well with page size other than 4k.
The virtio-balloon always works in units of 4kiB (BALLOON_PAGE_SIZE), but
we can only actually discard memory in units of the host page size.

We get some idea from [1] to solve this issue.

What has been done in this commit:

For balloon inflation:

A bitmap is employed to track the memory range to be released in 4k
granularity. Once it accumulates to one host page size, the corresponding
page is released, and the bitmap is cleared to handle the next record.
This process continues until all the memory range is managed. Memory will
only be released when a consecutive set of balloon request entries from
the same host page reaches the full host page size. If a balloon request
entry from a different host page is encountered, the bitmap and the base
host page address will be reset. Consequently, memory is released in
units of the page size, ensuring efficient memory management. That's say
if memory range length to be released smaller than page size or if the
guest scatters requests each of whose size is smaller than page size
across different host pages no memory will be released.

[1] https://patchwork.kernel.org/project/qemu-devel/patch/20190214043916.22128-6-david@gibson.dropbear.id.au/

Fixes: cloud-hypervisor#5369
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2023-08-21 16:35:23 +01:00
Yi Wang
d46dd4b31f vmm: cpu: Add pending removed vcpu check to avoid resize vcpu hang
Add pending removed vcpu check according to VcpuState.removing, which
can avoid cloud hypervisor hangup during continual vcpu resize.

Fix #5419

Signed-off-by: Yi Wang <foxywang@tencent.com>
2023-08-20 10:40:43 +01:00
Anatol Belski
0e75e7d079 scripts: Set LAST_RELEASE_VERSION to v34.0
Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2023-08-20 10:39:11 +01:00
Anatol Belski
be81fea46a tests: Re-enable live migration tests for AMD
These had to be previously disabled because a released binary has to be
used in course of the test scenario. The necessary functionality is now
supported with the release 34.0, thus these tests should now pass.

Fixes: #5660

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2023-08-20 10:39:11 +01:00