Commit Graph

3934 Commits

Author SHA1 Message Date
Bo Chen
b5bcdbaf48 misc: Upgrade to use the vm-memory crate w/ dirty-page-tracking
As the first step to complete live-migration with tracking dirty-pages
written by the VMM, this commit patches the dependent vm-memory crate to
the upstream version with the dirty-page-tracking capability. Most
changes are due to the updated `GuestMemoryMmap`, `GuestRegionMmap`, and
`MmapRegion` structs which are taking an additional generic type
parameter to specify what 'bitmap backend' is used.

The above changes should be transparent to the rest of the code base,
e.g. all unit/integration tests should pass without additional changes.

Signed-off-by: Bo Chen <chen.bo@intel.com>
2021-06-03 08:34:45 +01:00
Muminul Islam
c7b794a7c5 hypervisor: Fix MSHV set_xsave API call
MSHV set_xsave got changed to fix the Snapshot and restore issue.
This patch fixes the API call.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2021-06-03 08:30:50 +01:00
Rob Bradford
280bef834b virtio-devices: Add helper to VirtioCommon for EventFd duplication
Add a helper to VirtioCommon which returns duplicates of the EventFds
for kill and pause event.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-06-02 12:39:10 -07:00
Sebastien Boeuf
df92495e31 virtio-devices: vhost_user: Fix connection retry logic
The logic was reversed, causing the retry to fail consistently.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-06-02 17:31:30 +02:00
Sebastien Boeuf
e62aafdf58 virtio-devices: Update seccomp filters for vhost-user-net control queue
The control queue was missing rt_sigprocmask syscall, which was causing
a crash when the VM was shutdown.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-06-02 17:31:18 +02:00
Rob Bradford
a14c70019a tests: Don't test virtiofsd
The CI is failing due the git server that the submodules required for
this fork of QEMU need to build from is unavailable.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
(cherry picked from commit 2aec0a92a5)
2021-06-02 16:12:30 +02:00
Sebastien Boeuf
48c8649891 virtio-devices: vhost_user: Retry connecting the backend
When in client mode, the VMM will retry connecting the backend for a
minute before giving up.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-06-02 11:59:13 +02:00
Sebastien Boeuf
b4eb015d86 virtio-devices: vhost_user: Move reconnection code to module
The reconnection code is moved to the vhost-user module as it is a
common place to be shared across all vhost-user devices.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-06-02 11:59:13 +02:00
Sebastien Boeuf
3e00247a47 virtio-devices: vhost_user: Factorize backend connection
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-06-02 11:59:13 +02:00
Sebastien Boeuf
6bce7f7937 virtio-devices: vhost_user: net: Handle reconnection
This commit implements the reconnection feature for vhost-user-net in
case the connection with the backend is shutdown.

The guest has no knowledge about what happens when a disconnection
occurs, which simplifies the code to handle the reconnection. The
reconnection happens with the backend, and the VMM goes through the
vhost-user setup once again.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-06-02 11:59:13 +02:00
dependabot[bot]
f3d3d8daed build: bump signal-hook from 0.3.8 to 0.3.9
Bumps [signal-hook](https://github.com/vorner/signal-hook) from 0.3.8 to 0.3.9.
- [Release notes](https://github.com/vorner/signal-hook/releases)
- [Changelog](https://github.com/vorner/signal-hook/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vorner/signal-hook/compare/v0.3.8...v0.3.9)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-02 07:48:03 +00:00
dependabot[bot]
dcddfbff91 build: bump signal-hook from 0.3.8 to 0.3.9 in /fuzz
Bumps [signal-hook](https://github.com/vorner/signal-hook) from 0.3.8 to 0.3.9.
- [Release notes](https://github.com/vorner/signal-hook/releases)
- [Changelog](https://github.com/vorner/signal-hook/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vorner/signal-hook/compare/v0.3.8...v0.3.9)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-02 07:22:10 +00:00
dependabot[bot]
787426d4e6 build: bump signal-hook-registry from 1.3.0 to 1.4.0 in /fuzz
Bumps [signal-hook-registry](https://github.com/vorner/signal-hook) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/vorner/signal-hook/releases)
- [Changelog](https://github.com/vorner/signal-hook/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vorner/signal-hook/compare/registry-v1.3.0...registry-v1.4.0)

---
updated-dependencies:
- dependency-name: signal-hook-registry
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-02 07:22:08 +00:00
Rob Bradford
c357adae44 vmm: tdx: Clear unsupported KVM PV features
This matches with the features that QEMU clears as they are not
supported with TDX.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-06-01 23:00:54 +02:00
Rob Bradford
9f5325fd52 hypervisor: tdx: Unconditionally enable TDX debug
For now enable the TDX attribute for TDX debug.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-06-01 09:50:22 -07:00
Michael Zhao
7f3fa39d81 vmm: Remove enable_interrupt_controller()
After adding "get_interrupt_controller()" function in DeviceManager,
"enable_interrupt_controller()" became redundant, because the latter
one is the a simple wrapper on the interrupt controller.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2021-06-01 16:56:43 +01:00
Michael Zhao
9a5f3fc2a7 vmm: Remove "gicr" handling from DeviceManager
The function used to calculate "gicr-typer" value has nothing with
DeviceManager. Now it is moved to AArch64 specific files.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2021-06-01 16:56:43 +01:00
Michael Zhao
7932cd22ca vmm: Remove GIC entity set/get from DeviceManager
Moved the set/get functions from vmm::DeviceManager to devices::Gic.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2021-06-01 16:56:43 +01:00
Michael Zhao
195eba188a vmm: Split create_gic() from configure_system()
Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2021-06-01 16:56:43 +01:00
Rob Bradford
9341cce8b3 tests: Temporarily disable test_ovs_dpdk
This test is flaking out regularly, particularly on the musl build.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-06-01 17:46:58 +02:00
Rob Bradford
2ac7232288 virtio-devices: vsock: Implement versioning for state
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-06-01 14:23:09 +02:00
Rob Bradford
905135fe8c virtio-devices: transport: Versionize VirtioPciDevice state
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-06-01 14:23:09 +02:00
Rob Bradford
57f532a760 virtio-devices, vm-virtio: Refactor queue state saving/restoring
Use a separate QueueState structure which can be versioned.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-06-01 14:23:09 +02:00
Rob Bradford
831dff8b4e virtio-devices: transport: Version common PCI config state
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-06-01 14:23:09 +02:00
Sebastien Boeuf
4db7530f28 ci: Add OVS-DPDK integration test
In order to avoid regression regarding OVS-DPDK support, a new
integration test is added. This test consists of running two VMs, both
attached to a distinct OVS port, where both ports are connected to an
OVS bridge. Once the VM are running, the test validates the connection
between the two VMs works correctly.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-06-01 12:17:23 +02:00
Sebastien Boeuf
239e2adc68 tests: Introduce ssh_command_ok()
Adding a new function ssh_command_ok() as a wrapper around the existing
ssh_command() function. The goal being to identify if the command
returned without any error.

This new function allow for a bit of factorization through the codebase.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-06-01 12:17:23 +02:00
Muminul Islam
1c60591eab rpm: Update version to 15.0
Signed-off-by: Muminul Islam <muislam@microsoft.com>
2021-05-31 09:56:30 +02:00
Michael Zhao
5e53bbf405 arch: Bump vm-fdt from 13ab882 to 956b5a5
Interface of vm-fdt changed.
Updated aarch64 code to adapt.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2021-05-28 10:53:55 +02:00
Sebastien Boeuf
fbaceea4c0 resources: Add ovs-dpdk install to Dockerfile
The Dockerfile is extended with some new instructions to install the
OVS-DPDK packages. This will be useful for writing new integration tests
and make sure OVS-DPDK is working properly.

This also updates the Rust toolchain from 1.51.0 to 1.52.1.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-27 13:51:06 +01:00
dependabot[bot]
56ec5ca260 build: bump libfuzzer-sys from 0.4.1 to 0.4.2 in /fuzz
Bumps [libfuzzer-sys](https://github.com/rust-fuzz/libfuzzer) from 0.4.1 to 0.4.2.
- [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.1...0.4.2)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-27 07:26:29 +00:00
Rob Bradford
3ffd2cb9be pci: Versionize PCI state
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-26 22:29:35 +02:00
Rob Bradford
cacec04df6 arch: Remove serde usage
With the only struct using it now using Versionize then the serde
dependency can be removed.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-26 22:27:41 +02:00
Rob Bradford
72ec98b8a8 arch: aarch64: Versionize Gicv3State
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-26 22:27:41 +02:00
Sebastien Boeuf
a174ad011e vhost_user_net: Move control queue handling out
We recently realized the control queue is not meant to be handled by the
backend, that's why we move it out of vhost-user-net implementation.

Revert "vhost_user_net: Handle control queue"
This reverts commit af88ff1c49.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-26 16:09:32 +01:00
Sebastien Boeuf
e9cc23ea94 virtio-devices: vhost_user: net: Move control queue back
We thought we could move the control queue to the backend as it was
making some good sense. Unfortunately, doing so was a wrong design
decision as it broke the compatibility with OVS-DPDK backend.

This is why this commit moves the control queue back to the VMM side,
meaning an additional thread is being run for handling the communication
with the guest.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-26 16:09:32 +01:00
dependabot[bot]
6c245f6cf1 build: Manual seccomp bump
Seccomp needs to be bumped in the main tree and fuzz at the same time.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-26 14:39:43 +02:00
dependabot[bot]
dd92715ed2 build: Bump libc from 0.2.94 to 0.2.95
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.94 to 0.2.95.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.94...0.2.95)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-26 07:18:40 +00:00
dependabot[bot]
b3d1278838 build: Bump libc from 0.2.94 to 0.2.95 in /fuzz
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.94 to 0.2.95.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.94...0.2.95)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-26 06:51:19 +00:00
Sebastien Boeuf
92c2101f7c virtio-devices: vhost_user: Enable most virtio reserved features
A lot of the VIRTIO reserved features should be supported or not by the
vhost-user backend. That means on the VMM side, these features should be
available, so that they don't get lost during the negotiation.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-25 12:12:22 +02:00
Michael Zhao
ff46fb69d0 aarch64: Fix IRQ number setting for ACPI
On FDT, VMM can allocate IRQ from 0 for devices.
But on ACPI, the lowest range below 32 has to be avoided.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2021-05-25 10:20:37 +02:00
Henry Wang
efc583c13e acpi: AArch64: Enable PSCI in FADT
This commit enables the PSCI (Power State Coordination Interface)
for the AArch64 platform, which allows the VMM to manage the power
status of the guest. Also, multiple vCPUs can be brought up using
PSCI.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2021-05-25 10:20:37 +02:00
Henry Wang
d882f8c928 acpi: Implement IORT for AArch64
This commit implements the IO Remapping Table (IORT) for AArch64.
The IORT is one of the required ACPI table for AArch64, since
it describes the GICv3ITS node.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2021-05-25 10:20:37 +02:00
Henry Wang
213da7d862 acpi: Implement SPCR on AArch64
This commit implements an AArch64-required ACPI table: Serial
Port Console Redirection Table (SPCR). The table provides
information about the configuration and use of the serial port
or non-legacy UART interface.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2021-05-25 10:20:37 +02:00
Henry Wang
9c5528490e acpi: Implement GTDT on AArch64
This commit implements an AArch64-specific ACPI table: Generic
Timer Description Table (GTDT). The GTDT provides OSPM with
information about a system’s Generic Timers configuration.

The Generic Timer (GT) is a standard timer interface implemented
on ARM processor-based systems.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2021-05-25 10:20:37 +02:00
Michael Zhao
7bfb51489b acpi: Implement MCFG for AArch64
Added the final PCI bus number in MCFG table. This field is mandatory on
AArch64. On X86 it is optional.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2021-05-25 10:20:37 +02:00
Michael Zhao
e1ef141112 acpi: Enable DSDT for CpuManager on AArch64
Simplified definition block of CPU's on AArch64. It is not complete yet.
Guest boots. But more is to do in future:
- Fix the error in ACPI definition blocks (seen in boot messages)
- Implement CPU hot-plug controller

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2021-05-25 10:20:37 +02:00
Michael Zhao
5f27d649a6 acpi: Enable DSDT for DeviceManager on AArch64
Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2021-05-25 10:20:37 +02:00
Michael Zhao
cab103d172 acpi: Implement MADT on AArch64
Added following structures in MADT table:
- GICC: GIC CPU interface structure
- GICD: GIC Distributor structure
- GICR: GIC Redistributor Structure
- GICITS: GIC Interrupt Translation Service Structure

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2021-05-25 10:20:37 +02:00
dependabot[bot]
084fdd9d10 build: Bump cc from 1.0.67 to 1.0.68
Bumps [cc](https://github.com/alexcrichton/cc-rs) from 1.0.67 to 1.0.68.
- [Release notes](https://github.com/alexcrichton/cc-rs/releases)
- [Commits](https://github.com/alexcrichton/cc-rs/compare/1.0.67...1.0.68)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-25 07:48:52 +00:00
dependabot[bot]
74c064e477 build: Bump cc from 1.0.67 to 1.0.68 in /fuzz
Bumps [cc](https://github.com/alexcrichton/cc-rs) from 1.0.67 to 1.0.68.
- [Release notes](https://github.com/alexcrichton/cc-rs/releases)
- [Commits](https://github.com/alexcrichton/cc-rs/compare/1.0.67...1.0.68)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-25 07:48:30 +00:00