Commit Graph

3792 Commits

Author SHA1 Message Date
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
dependabot[bot]
14f27e4219 build: Bump arc-swap from 1.2.0 to 1.3.0
Bumps [arc-swap](https://github.com/vorner/arc-swap) from 1.2.0 to 1.3.0.
- [Release notes](https://github.com/vorner/arc-swap/releases)
- [Changelog](https://github.com/vorner/arc-swap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vorner/arc-swap/compare/v1.2.0...v1.3.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-24 09:43:06 +00:00
dependabot[bot]
9a8ff68bc1 build: Bump thiserror from 1.0.24 to 1.0.25 in /fuzz
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.24 to 1.0.25.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.24...1.0.25)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-24 09:20:09 +00:00
dependabot[bot]
b461200211 build: Bump arc-swap from 1.2.0 to 1.3.0 in /fuzz
Bumps [arc-swap](https://github.com/vorner/arc-swap) from 1.2.0 to 1.3.0.
- [Release notes](https://github.com/vorner/arc-swap/releases)
- [Changelog](https://github.com/vorner/arc-swap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vorner/arc-swap/compare/v1.2.0...v1.3.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-24 08:44:19 +00:00
dependabot[bot]
aba2513322 build: Bump vcpkg from 0.2.12 to 0.2.13
Bumps [vcpkg](https://github.com/mcgoo/vcpkg-rs) from 0.2.12 to 0.2.13.
- [Release notes](https://github.com/mcgoo/vcpkg-rs/releases)
- [Changelog](https://github.com/mcgoo/vcpkg-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mcgoo/vcpkg-rs/compare/vcpkg-rs-0.2.12...vcpkg-rs-0.2.13)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-24 08:44:12 +00:00
dependabot[bot]
cb8fc4dc9f build: Bump thiserror from 1.0.24 to 1.0.25
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.24 to 1.0.25.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.24...1.0.25)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-24 08:44:06 +00:00
Sebastien Boeuf
47be87c7cc virtio-devices: vhost_user: Don't set features before ACK from guest
The VIRTIO features should not be set before they are acked from the
guest. This code was only present to overcome a vhost crate limitation
that was expecting the VIRTIO features to be set before we could fetch
and set the protocol features.

The vhost crate has been recently fixed by removing the limitation,
therefore there's no need for this workaround in the Cloud Hypervisor
codebase anymore.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-24 00:34:46 +02:00
dependabot[bot]
66d52199a7 build: Bump vhost from f338330 to e4ba734
Bumps [vhost](https://github.com/rust-vmm/vhost) from `f338330` to `e4ba734`.
- [Release notes](https://github.com/rust-vmm/vhost/releases)
- [Commits](f338330bd7...e4ba734144)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-21 15:58:27 +00:00
Rob Bradford
f840327ffb vmm: Version MemoryManager state
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-21 15:29:52 +02:00
Rob Bradford
719e36049b block_util: Remove unrequired serde usage from block_util
These structs are now versioned instead.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-21 15:12:23 +02:00
Sebastien Boeuf
f583f993ee virtio-devices: Remove the need for net_util in the crate
Everything that was shared in the net_util.rs file has been now moved to
the net_util crate. The only remaining bit was only used by the
virtio-net implementation, that is why this commit moves this code to
virtio-net, and since there's nothing left in net_util.rs, it can be
removed.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-21 14:39:56 +02:00
Sebastien Boeuf
bcb1dfb86f virtio-devices: net: Rely on net_util crate for control queue
Since the net_util crate contains the common code needed for processing
the control queue, let's use it and remove the duplicate from inside the
virtio-devices crate.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-21 14:39:56 +02:00
Sebastien Boeuf
d7a69f8aa1 net_util: Move virtio-net helpers to net_util crate
Moving helpers to the net_util crate since we don't want virtio-net
common code to be split between two places. The net_util crate should be
the only place to host virtio-net common code.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-21 14:39:56 +02:00
Sebastien Boeuf
f36b5f3e3c virtio-devices: vhost_user: Factorize features negotiation
Factorize the virtio features and vhost-user protocol features
negotiation through a common function that blk, fs and net
implementations can directly rely on.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-21 12:03:54 +02:00
Sebastien Boeuf
cdaa4d3ad7 virtio-devices: vhost_user: Set features once acknowledged by guest
Make sure the virtio features are set upon device activation. At the
time the device is activated, we know the guest acknowledged the
features, which mean it's safe to set them back to the backend.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-21 12:03:54 +02:00
Sebastien Boeuf
8c73af048a virtio-devices: vhost_user: fs: Cleanup device creation
Prepare the device creation so that it can be factorized in a follow up
commit.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-21 12:03:54 +02:00
Sebastien Boeuf
e2121c5d75 virtio-devices: vhost_user: net: Cleanup device creation
Prepare the device creation so that it can be factorized in a follow up
commit.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-21 12:03:54 +02:00
Sebastien Boeuf
9a7199a116 virtio-devices: vhost_user: blk: Cleanup device creation
Prepare the device creation so that it can be factorized in a follow up
commit.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-21 12:03:54 +02:00
Sebastien Boeuf
c549bbd72a vhost_user_net: Extend list of supported virtio features
Extend the current list of available virtio features in order to make it
work correctly with the VMM side.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-21 12:03:54 +02:00
Sebastien Boeuf
c39d43dee1 vhost_user_blk: Extend list of supported virtio features
Extend the current list of available virtio features in order to make it
work correctly with the VMM side.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-21 12:03:54 +02:00
dependabot[bot]
b76e0b358f build: Bump arbitrary from 1.0.0 to 1.0.1 in /fuzz
Bumps [arbitrary](https://github.com/rust-fuzz/arbitrary) from 1.0.0 to 1.0.1.
- [Release notes](https://github.com/rust-fuzz/arbitrary/releases)
- [Changelog](https://github.com/rust-fuzz/arbitrary/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-fuzz/arbitrary/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-21 07:21:28 +00:00
dependabot[bot]
9bc309b416 build: Bump getrandom from 0.2.2 to 0.2.3
Bumps [getrandom](https://github.com/rust-random/getrandom) from 0.2.2 to 0.2.3.
- [Release notes](https://github.com/rust-random/getrandom/releases)
- [Changelog](https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/getrandom/compare/v0.2.2...v0.2.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-21 07:21:22 +00:00
renlei4
65a39f43cb vmm: support restore KVM clock in migration
In migration, vm object is created by new_from_migration with
NULL kvm clock. so vm.set_clock will not be called during vm resume.
If the guest using kvm-clock, the ticks will be stopped after migration.

As clock was already saved to snapshot, add a method to restore it before
vm resume in migration. after that, guest's kvm-clock works well.

Signed-off-by: Ren Lei <ren.lei4@zte.com.cn>
2021-05-20 14:32:49 +01:00
ren lei
324c924ca4 vmm: fix KVM clock lost during restore form snapshot
Connecting a restored KVM clock vm will take long time, as clock
is NOT restored immediately after vm resume from snapshot.

this is because 9ce6c3b incorrectly remove vm_snapshot.clock, and
always pass None to new_from_memory_manager, which will result to
kvm_set_clock() never be called during restore from snapshot.

Fixes: 9ce6c3b
Signed-off-by: Ren Lei <ren.lei4@zte.com.cn>
2021-05-20 11:31:01 +02:00
dependabot[bot]
75ad89670b build: Bump proc-macro2 from 1.0.26 to 1.0.27 in /fuzz
Bumps [proc-macro2](https://github.com/alexcrichton/proc-macro2) from 1.0.26 to 1.0.27.
- [Release notes](https://github.com/alexcrichton/proc-macro2/releases)
- [Commits](https://github.com/alexcrichton/proc-macro2/compare/1.0.26...1.0.27)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-20 09:44:25 +02:00
dependabot[bot]
d4f01bdb43 build: Bump proc-macro2 from 1.0.26 to 1.0.27
Bumps [proc-macro2](https://github.com/alexcrichton/proc-macro2) from 1.0.26 to 1.0.27.
- [Release notes](https://github.com/alexcrichton/proc-macro2/releases)
- [Commits](https://github.com/alexcrichton/proc-macro2/compare/1.0.26...1.0.27)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-20 09:44:11 +02:00
Michael Zhao
e1c9a956da scripts: Fix an obsolete sha1sam
Updated the sha1sum of bionic-server-cloudimg-arm64.qcow2.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2021-05-20 13:42:34 +08:00
Sebastien Boeuf
c2137e33a0 vhost_user_backend: Don't discard events when queue is not enabled
The vhost crate does not support the need_reply flag yet, meaning we
can't be sure the backend is properly setup before the guest goes on.

One can run in a race condition where the VMM enables the vring, but
never gets any acknowledgement, meaning it assumes everything went well
and finalize the virtio device activation. Once the device is seen as
ready by the guest, it keeps going by sending some messages through the
virtqueues. Problem is, if it took some time for the backend to enable
the queue, one of the backend thread might receive a kick from the guest
while the corresponding queue is not enabled. This leads to the loss of
the event as it is discarded because the queue is not enabled.

Until vhost crate allows for requests with ACK, the way to mitigate this
issue is by ignoring an event coming up on a queue that has not been
enabled.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-19 18:21:47 +02:00
Rob Bradford
c05010887f virtio-devices: seccomp: Cleanup unused seccomp filter entries
The threads in question are no longer created and so no longer need
seccomp rules for them.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-19 18:21:47 +02:00
Sebastien Boeuf
334aa8c941 virtio-devices: vhost_user: Don't set features twice
The virtio features are negotiated and set at the time the device is
created, hence there's no need to set the features again while going
through the vhost-user setup that is performed upon queue activation.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-19 18:21:47 +02:00
Sebastien Boeuf
5d2df70a79 virtio-devices: vhost_user: net: Remove control queue
Now that the control queue is correctly handled by the backend, there's
no need to handle it as well from the VMM.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-19 18:21:47 +02:00
Sebastien Boeuf
af88ff1c49 vhost_user_net: Handle control queue
The virtio-net control queue must be handled by the backend, the same
way all other queues already are.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-19 18:21:47 +02:00
Sebastien Boeuf
40dc3e7c10 net_util: Introduce virtio-net control queue handling code
This code is ported from the net_util.rs in virtio-devices. The point
being to move it to the net_util crate so that it can later be reused
from vhost-user-net backend.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-19 18:21:47 +02:00
Anatol Belski
56b9149325 tests: Pull common code into a separate method
Yet another small refactoring step for WindowsGuest
after f56471566b.

For this particular case - there's currently neither overloading nor
default argument support in Rust (except a macro or other tricky stuff),
so keep the timeout and other options default for now.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2021-05-19 16:41:08 +01:00
Rob Bradford
7ae631e0c1 vmm: Hypervisor::check_required_extensions() is not x86_64 only
This function is implemented for aarch64 so should be called on it.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-19 17:11:30 +02:00
Rob Bradford
84454f142d hypervisor: Remove panic from Hypervisor::check_required_extensions()
Remove the panic by replacing the .expect() with a cleaner error
handling.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-19 17:11:30 +02:00
Rob Bradford
a335cbb8d5 hypervisor: Unconditional build Hypervisor::create_vm_with_type()
Mark it as unreachable for now in the default implementation as this is
currently only used on tdx code path which is KVM only.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-19 17:11:30 +02:00
Rob Bradford
0cf9218d3f hypervisor, vmm: Add default Hypervisor::check_required_extensions()
This allows the removal of KVM specific compile time checks on this
function.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-19 17:11:30 +02:00
Rob Bradford
2439625785 hypervisor: Cleanup unused Hypervisor trait members
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-19 17:11:30 +02:00
Anatol Belski
01e2826f26 tests: Implement disk hotplug test
Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2021-05-19 10:39:46 +02:00
Michael Zhao
01acea3102 acpi: Refactor create_acpi_tables()
Split the code of create_acpi_tables() into multiple functions for
easy extension in future.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2021-05-19 09:59:59 +02:00
dependabot[bot]
5ae04349da build: Bump vhost from e5b930b to f338330
Bumps [vhost](https://github.com/rust-vmm/vhost) from `e5b930b` to `f338330`.
- [Release notes](https://github.com/rust-vmm/vhost/releases)
- [Commits](e5b930b73a...f338330bd7)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-19 09:53:49 +02:00
Michael Zhao
aca6fdbd0e scripts: Test ACPI build on AArch64
Added a step to verify ACPI build.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2021-05-18 23:24:09 +02:00