Commit Graph

3792 Commits

Author SHA1 Message Date
Michael Zhao
e4bb6409ae aarch64: Change memory layout for UEFI & ACPI
Before this change, the FDT was loaded at the end of RAM. The address of
FDT was not fixed.
While UEFI (edk2 now) requires fixed address to find FDT and RSDP.
Now the FDT is moved to the beginning of RAM, which is a fixed address.
RSDP is wrote to 2 MiB after FDT, also a fixed address.
Kernel comes 2 MiB after RSDP.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2021-05-18 23:24:09 +02:00
Rob Bradford
b282ff44d4 vmm: Enhance boot with info!() level messages
These messages are predominantly during the boot process but will also
occur during events such as hotplug.

These cover all the significant steps of the boot and can be helpful for
diagnosing performance and functionality issues during the boot.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-18 20:45:38 +02:00
Dayu Liu
8160c2884b docs: Fix some typos in docs and comments
Fix some typos or misspellings without functional change.

Signed-off-by: Dayu Liu <liu.dayu@zte.com.cn>
2021-05-18 17:19:12 +01:00
dependabot[bot]
c91b16d2a1 build: Bump kvm-ioctls from 0.8.0 to 0.9.0 in /fuzz
Bumps [kvm-ioctls](https://github.com/rust-vmm/kvm-ioctls) from 0.8.0 to 0.9.0.
- [Release notes](https://github.com/rust-vmm/kvm-ioctls/releases)
- [Changelog](https://github.com/rust-vmm/kvm-ioctls/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-vmm/kvm-ioctls/compare/v0.8.0...v0.9.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-18 16:07:35 +00:00
Anatol Belski
65429cebae docker: Add ntfs-3g to the package list
This will make `mkfs.ntfs` available in the next image update, so then
it can be used in the tests.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2021-05-18 17:07:19 +01:00
dependabot[bot]
4449b0d3c2 build: Bump pnet from 0.27.2 to 0.28.0
Bumps [pnet](https://github.com/libpnet/libpnet) from 0.27.2 to 0.28.0.
- [Release notes](https://github.com/libpnet/libpnet/releases)
- [Commits](https://github.com/libpnet/libpnet/compare/v0.27.2...v0.28.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-17 10:43:21 +02:00
dependabot[bot]
589f93da92 build: Bump kvm-ioctls from 0.8.0 to 0.9.0
Bumps [kvm-ioctls](https://github.com/rust-vmm/kvm-ioctls) from 0.8.0 to 0.9.0.
- [Release notes](https://github.com/rust-vmm/kvm-ioctls/releases)
- [Changelog](https://github.com/rust-vmm/kvm-ioctls/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-vmm/kvm-ioctls/compare/v0.8.0...v0.9.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-17 10:16:12 +02:00
Rob Bradford
5296bd10c1 vmm: tdx: Reorder TDX ioctls
Separate the population of the memory and the HOB from the TDX
initialisation of the memory so that the latter can happen after the CPU
is initialised.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-17 07:39:52 +02:00
dependabot[bot]
d100c014bc build: Bump iced-x86 from 1.11.2 to 1.11.3 in /fuzz
Bumps [iced-x86](https://github.com/icedland/iced) from 1.11.2 to 1.11.3.
- [Release notes](https://github.com/icedland/iced/releases)
- [Commits](https://github.com/icedland/iced/compare/v1.11.2...v1.11.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-14 09:02:28 +00:00
dependabot[bot]
2cf75116d9 build: Bump libfuzzer-sys from 0.4.0 to 0.4.1 in /fuzz
Bumps [libfuzzer-sys](https://github.com/rust-fuzz/libfuzzer) from 0.4.0 to 0.4.1.
- [Release notes](https://github.com/rust-fuzz/libfuzzer/releases)
- [Changelog](https://github.com/rust-fuzz/libfuzzer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-fuzz/libfuzzer/compare/0.4.0...0.4.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-14 08:22:06 +00:00
dependabot[bot]
a45f7ac1bc build: Bump iced-x86 from 1.11.2 to 1.11.3
Bumps [iced-x86](https://github.com/icedland/iced) from 1.11.2 to 1.11.3.
- [Release notes](https://github.com/icedland/iced/releases)
- [Commits](https://github.com/icedland/iced/compare/v1.11.2...v1.11.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-14 08:20:39 +00:00
dependabot[bot]
e75de542df build: Bump serde_derive from 1.0.125 to 1.0.126
Bumps [serde_derive](https://github.com/serde-rs/serde) from 1.0.125 to 1.0.126.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.125...v1.0.126)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-13 09:51:55 +00:00
dependabot[bot]
252963190b build: Bump serde from 1.0.125 to 1.0.126
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.125 to 1.0.126.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.125...v1.0.126)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-13 09:22:55 +00:00
dependabot[bot]
93de4c67e5 build: Bump serde from 1.0.125 to 1.0.126 in /fuzz
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.125 to 1.0.126.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.125...v1.0.126)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-13 08:55:01 +00:00
dependabot[bot]
23791a45c8 build: Bump serde_derive from 1.0.125 to 1.0.126 in /fuzz
Bumps [serde_derive](https://github.com/serde-rs/serde) from 1.0.125 to 1.0.126.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.125...v1.0.126)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-13 08:17:45 +00:00
Sebastien Boeuf
355e7468e4 virtio-devices: vhost-user: Don't run threads for net and block
Some refactoring is performed in order to always expect the irqfd to be
provided by VirtioInterrupt trait. In case no irqfd is available, we
simply fail initializing the vhost-user device. This allows for further
simplification since we can assume the interrupt will always be
triggered directly by the vhost-user backend without proxying through
the VMM. This allows for complete removal of the dedicated thread for
both block and net.

vhost-user-fs is a bit more complex as it requires the slave request
protocol feature in order to support DAX. That's why we still need the
VMM to interfere and therefore run a dedicated thread for it.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-13 09:16:27 +01:00
Rob Bradford
496ceed1d0 misc: Remove unnecessary "extern crate"
Now all crates use edition = "2018" then the majority of the "extern
crate" statements can be removed. Only those for importing macros need
to remain.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-12 17:26:11 +02:00
Rob Bradford
1205bce0ef devices: Move to versioned snapshots
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-12 17:26:11 +02:00
Rob Bradford
c03fe508c1 net_get, net_util: Move crate to rust 2018 edition
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-12 17:26:11 +02:00
Rob Bradford
6895e634cc arch: Move crate to rust 2018 edition
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-12 17:26:11 +02:00
Rob Bradford
86015bef78 devices: Move crate to rust 2018 edition
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-12 17:26:11 +02:00
Rob Bradford
bd724fc304 virtio-devices: Stop deriving unnecessary traits
These structs only need to derive Versionize now.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-12 17:26:11 +02:00
Rob Bradford
6e6f66de2e build: Bulk upgrade dependencies including fuzz
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-12 13:57:16 +01:00
dependabot[bot]
daa935b5c9 build: Bump vfio-ioctls from ed8d253 to 5cb8550
Bumps [vfio-ioctls](https://github.com/rust-vmm/vfio-ioctls) from `ed8d253` to `5cb8550`.
- [Release notes](https://github.com/rust-vmm/vfio-ioctls/releases)
- [Commits](ed8d253457...5cb8550556)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-12 10:54:02 +02:00
dependabot[bot]
6fa1ec4f3c build: Bump vm-fdt from 8d81555 to 13ab882
Bumps [vm-fdt](https://github.com/rust-vmm/vm-fdt) from `8d81555` to `13ab882`.
- [Release notes](https://github.com/rust-vmm/vm-fdt/releases)
- [Commits](8d81555c14...13ab882e2f)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-12 09:55:45 +02:00
dependabot[bot]
363ca66c2d build: Bump vhost from cc4da71 to e5b930b
Bumps [vhost](https://github.com/rust-vmm/vhost) from `cc4da71` to `e5b930b`.
- [Release notes](https://github.com/rust-vmm/vhost/releases)
- [Commits](cc4da710ac...e5b930b73a)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-12 09:55:29 +02:00
Rob Bradford
b8f5911c4e misc: Remove unused errors from public interface
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-11 13:37:19 +02:00
Rob Bradford
30b74e74cd vmm: tdx: Reject attempt to use --kernel with --tdx
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-10 15:12:41 +01:00
Rob Bradford
c400702272 virtio-devices: Version state structures
Version the state for device state for the virtio devices.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-10 14:40:27 +01:00
Rob Bradford
dce846fdfd build: Use versionize_derive from Cloud Hypervisor fork
This allows the use of #[derive(Versionize)] on packed structs.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-10 14:40:27 +01:00
Rob Bradford
bbda08717f vm-migration: Add versioned versions of snapshot & state API
This will allow progressive porting of parts of the VMM to using
versioned state. A new trait VersionMapped is introduced with a default
implementation that returns an empty VersionMap to ease implementation.

If a struct is updated the the trait will need to be fully implemented
with VersionMapped::version_map() returning a new VersionMap handling
the change.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-10 14:40:27 +01:00
dependabot[bot]
2eeeaf5753 build: Bump backtrace from 0.3.58 to 0.3.59
Bumps [backtrace](https://github.com/rust-lang/backtrace-rs) from 0.3.58 to 0.3.59.
- [Release notes](https://github.com/rust-lang/backtrace-rs/releases)
- [Commits](https://github.com/rust-lang/backtrace-rs/compare/0.3.58...0.3.59)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-10 14:28:08 +01:00
dependabot[bot]
7299202d01 build: Bump vhost from c4cd1d3 to cc4da71
Bumps [vhost](https://github.com/rust-vmm/vhost) from `c4cd1d3` to `cc4da71`.
- [Release notes](https://github.com/rust-vmm/vhost/releases)
- [Commits](c4cd1d375e...cc4da710ac)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-10 13:47:40 +02:00
Henry Wang
1f63350eba resources: Remove libfdt in docker image
Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2021-05-07 18:49:17 +02:00
Henry Wang
cb26ad511b github-workflows: Remove libfdt installation
Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2021-05-07 18:49:17 +02:00
Henry Wang
139621778b arch: aarch64: Use vm_fdt crate methods
This commit moves the libfdt helpers to vm_fdt crate methods
when creating the FDT.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2021-05-07 18:49:17 +02:00
Sebastien Boeuf
ae4e01adc9 tests: vfio: Increase time for memory hotplug
Bump the sleep time before checking the guest RAM size from 10 to 30
seconds. This will help the VFIO baremetal CI passing more consistently.

Fixes #2606

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-07 18:44:31 +02:00
Rob Bradford
6d6cafafb2 tests: Fix clippy issues in integration tests
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-07 14:31:57 +02:00
Rob Bradford
0d3c5c966b virtio-devices: mem: Address clippy issue
error: all if blocks contain the same code at the start
   --> virtio-devices/src/mem.rs:508:9
    |
508 | /         if plug {
509 | |             let handlers =
    self.dma_mapping_handlers.lock().unwrap();
    |
|_____________________________________________________________________^
    |
    = note: `-D clippy::branches-sharing-code` implied by `-D warnings`
    = help: for further information visit
https://rust-lang.github.io/rust-clippy/master/index.html#branches_sharing_code
help: consider moving the start statements out like this
    |
508 |         let handlers = self.dma_mapping_handlers.lock().unwrap();
509 |         if plug {
    |

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-07 14:31:57 +02:00
Rob Bradford
18012d9ee8 virtio-devices: iommu: Address clippy issue
error: usage of `contains_key` followed by `insert` on a `BTreeMap`
   --> virtio-devices/src/iommu.rs:439:17
    |
439 | /                 if !mappings.contains_key(&domain) {
440 | |                     mappings.insert(domain, BTreeMap::new());
441 | |                 }
    | |_________________^ help: try this:
`mappings.entry(domain).or_insert_with(|| BTreeMap::new());`
    |
    = note: `-D clippy::map-entry` implied by `-D warnings`
    = help: for further information visit
https://rust-lang.github.io/rust-clippy/master/index.html#map_entry

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-07 14:31:57 +02:00
Rob Bradford
a6da5f9e77 virtio-devices: vsock: Address clippy issue
Issue from beta version of clippy:

  --> virtio-devices/src/vsock/csm/txbuf.rs:69:34
   |
69 |                 Box::new(unsafe {mem::MaybeUninit::<[u8;
   Self::SIZE]>::uninit().assume_init()}));
   |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[deny(clippy::uninit_assumed_init)]` on by default
   = help: for further information visit
https://rust-lang.github.io/rust-clippy/master/index.html#uninit_assumed_init

Fix backported Firecracker a8c9dffad439557081f3435a7819bf89b87870e7.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-07 14:31:57 +02:00
Rob Bradford
c418074360 virtio-devices: vhost_user: fs: Don't reference packed struct
error: reference to packed field is unaligned
  --> virtio-devices/src/vhost_user/fs.rs:85:21
   |
85 |                     fs.flags[i].bits() as i32,
   |                     ^^^^^^^^^^^
   |
   = note: `-D unaligned-references` implied by `-D warnings`
   = warning: this was previously accepted by the compiler but is being
phased out; it will become a hard error in a future release!
   = note: for more information, see issue #82523
<https://github.com/rust-lang/rust/issues/82523>
   = note: fields of packed structs are not properly aligned, and
creating a misaligned reference is undefined behavior (even if that
reference is never dereferenced)

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-07 14:31:57 +02:00
Rob Bradford
f0b64547c2 net_gen, net_util: Regenerate bindings
Regernating the bindings required some minor changes to accomodate
changes around the accessing of unions.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-07 14:31:57 +02:00
Sebastien Boeuf
1f94208090 Jenkinsfile: Don't wait for a node that is not being used
Since SGX and VFIO tests don't need to be run on pull requests, we
should not have to wait for the corresponding node (bionic-sgx or
bionic-vfio) to become available in order to skip them.

Fixes #2607

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-07 11:56:36 +01:00
Sebastien Boeuf
5268bf5a8c tests: Re-enable virtiofsd tests
Re-enable virtiofsd testing now that issues with capstone repository
have been resolved.

This reverts commit 2aec0a92a5.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-07 11:16:36 +02:00
dependabot[bot]
a097e29292 build: Bump openssl-sys from 0.9.62 to 0.9.63
Bumps [openssl-sys](https://github.com/sfackler/rust-openssl) from 0.9.62 to 0.9.63.
- [Release notes](https://github.com/sfackler/rust-openssl/releases)
- [Commits](https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.62...openssl-sys-v0.9.63)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-07 11:03:36 +02:00
dependabot[bot]
9f07c7940f build: Bump regex from 1.5.3 to 1.5.4
Bumps [regex](https://github.com/rust-lang/regex) from 1.5.3 to 1.5.4.
- [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/1.5.3...1.5.4)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-07 11:03:21 +02:00
Yi Wang
1adcf5225b virtio-device: fix some misspelled words in comment
Fix some trivial spelling problem.
No functional change.

Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
2021-05-07 09:07:36 +02:00
Wei Liu
c439324451 tests: add a Windows multiple queues test
Create as many queues as there are boot CPUs for block and twice as many
for net.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
2021-05-07 08:57:13 +02:00
Sebastien Boeuf
66b46a277e tests: Remove unused code from Windows integration tests
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-07 08:57:13 +02:00