Commit Graph

5365 Commits

Author SHA1 Message Date
Sebastien Boeuf
3fea5f5396 vmm: Add support for hotplugging a vDPA device
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-03-18 12:28:40 +01:00
Sebastien Boeuf
c73c6039c3 vmm: Enable vDPA support
Based on the newly added Vdpa device along with the new vdpa parameter,
this patch enables the support for vDPA devices.

It's important to note this the only virtio device for which we provide
an ExternalDmaMapping instance. This will allow for the right DMA ranges
to be mapped/unmapped.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-03-18 12:28:40 +01:00
Sebastien Boeuf
72169686fe vmm: Add a vDPA device parameter
Introduce a new --vdpa parameter associated with a VdpaConfig for the
future creation of a Vdpa device.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-03-18 12:28:40 +01:00
Sebastien Boeuf
be7c389120 virtio-devices: Add Vdpa device
vDPA is a kernel framework introduced fairly recently in order to handle
devices complying with virtio specification on their datapath, while the
control path is vendor specific. For the datapath, that means the
virtqueues are handled through DMA directly between the hardware and the
guest, while the control path goes through the vDPA framework,
eventually exposed through a vhost-vdpa device.

vDPA, like VFIO, aims at achieving baremetal performance for devices
that are passed into a VM. But unlike VFIO, it provides a simpler/better
framework for achieving migration. Because the DMA accesses between the
device and the guest are going through virtio queues, migration can be
achieved way more easily, and doesn't require each device driver to
implement the migration support. In the VFIO case, each vendor is
expected to provide an implementation of the VFIO migration framework,
which makes things harder as it must be done for each and every device.

So to summarize the point is to support migration for hardware devices
through which we can achieve baremetal performances.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-03-18 12:28:40 +01:00
Sebastien Boeuf
2dc9cfaf01 docs: Update virtio-fs documentation
Update the content of the documentation to clarify how the cache option
from virtiofsd has an impact on the host page cache, while the dax
option for the filesystem in the guest has an impact on the guest page
cache.

The document is also updated to not have lines exceeding 80 characters.

Fixes #3826

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-03-18 11:25:10 +01:00
dependabot[bot]
86f8fb1c70 build: bump quote from 1.0.15 to 1.0.16
Bumps [quote](https://github.com/dtolnay/quote) from 1.0.15 to 1.0.16.
- [Release notes](https://github.com/dtolnay/quote/releases)
- [Commits](https://github.com/dtolnay/quote/compare/1.0.15...1.0.16)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-18 01:58:28 +00:00
dependabot[bot]
c0f2991e33 build: bump dirs-sys from 0.3.6 to 0.3.7
Bumps [dirs-sys](https://github.com/dirs-dev/dirs-sys-rs) from 0.3.6 to 0.3.7.
- [Release notes](https://github.com/dirs-dev/dirs-sys-rs/releases)
- [Commits](https://github.com/dirs-dev/dirs-sys-rs/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-18 01:12:58 +00:00
dependabot[bot]
3a1db02212 build: bump redox_users from 0.4.0 to 0.4.2
Bumps redox_users from 0.4.0 to 0.4.2.

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-18 00:14:33 +00:00
dependabot[bot]
13514e1951 build: bump quote from 1.0.15 to 1.0.16 in /fuzz
Bumps [quote](https://github.com/dtolnay/quote) from 1.0.15 to 1.0.16.
- [Release notes](https://github.com/dtolnay/quote/releases)
- [Commits](https://github.com/dtolnay/quote/compare/1.0.15...1.0.16)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-17 23:44:32 +00:00
Sebastien Boeuf
cfc6e6e8eb docs: Add balloon documentation
Document the reason why someone might need to use the balloon device and
detail the different parameters associated with it.

Fixes #3807

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-03-17 17:01:07 +01:00
Rob Bradford
7324b0e514 vmm: cpu: Only include hotplug/unplug related AML code if dynamic
This will significantly reduce the size of the DSDT and the effort
required to parse them if there is no requirement to support
hotplug/unplug.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-17 13:46:21 +00:00
Rob Bradford
188078467d vmm: cpu: Deny resizing if CpuManager is not dynamic
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-17 13:46:21 +00:00
Rob Bradford
e5cb13588b vmm: cpu: Add concept of making CpuManager dynamic
If the CpuManager is dynamic it devices CPUs can be
hotplugged/unplugged.

Since TDX does not support CPU hotplug this is currently the only
determinator as to whether the CpuManager is dynamic.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-17 13:46:21 +00:00
Yi Wang
9bfbc93044 docs: api: Add documentation for vm.snapshot/restore
vm.snapshot/restore is missed, add this part.

Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
2022-03-17 11:44:07 +00:00
dependabot[bot]
c5c0795854 build: bump openssl-src from 111.17.0+1.1.1m to 111.18.0+1.1.1n
Bumps [openssl-src](https://github.com/alexcrichton/openssl-src-rs) from 111.17.0+1.1.1m to 111.18.0+1.1.1n.
- [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>
2022-03-17 07:08:03 +00:00
dependabot[bot]
86430bfb3d build: bump syn from 1.0.88 to 1.0.89
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.88 to 1.0.89.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.88...1.0.89)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-17 00:29:16 +00:00
dependabot[bot]
33ec61345e build: bump syn from 1.0.88 to 1.0.89 in /fuzz
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.88 to 1.0.89.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.88...1.0.89)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-16 23:42:56 +00:00
Rob Bradford
65bebabd70 build: Move Jenkins workers to focal
hirsute is EOLed and focal is receiving kernel updates on Azure.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-16 14:15:18 +01:00
dependabot[bot]
bf7f7f515e build: bump syn from 1.0.87 to 1.0.88
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.87 to 1.0.88.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.87...1.0.88)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-16 00:10:01 +00:00
dependabot[bot]
c42742a58f build: bump syn from 1.0.87 to 1.0.88 in /fuzz
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.87 to 1.0.88.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.87...1.0.88)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-15 23:37:25 +00:00
Rob Bradford
b9aeaf6634 net_util: Remove unnecessary return value from CtrlQueue::process()
Since the code has been adapted to support VIRTIO_F_EVENT_IDX we use
Queue::needs_notification() to determine whether to signal the guest so
it is no longer necessary to check if there are any used descriptors. If
the feature is not negotiated then Queue::needs_notification() will
return true triggering an interrupt of the guest. Theoretically this
could be a spurious interrupt of the guest if there were no used used
descriptors but this is unlikely as we only generate used descriptors
for the control queue as a result of an interrupt of the VMM by the
guest.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-15 16:08:29 +00:00
Rob Bradford
aa3ef70ea6 virtio-devices: Use NetCtrlEpollHandler in vhost-user-net
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-15 16:08:29 +00:00
Rob Bradford
21a9ae3459 virtio-devices: net: Signal control queue was used if necessary
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-15 16:08:29 +00:00
Rob Bradford
c5afea5b85 virtio-devices: net: Be more consistent with error messages
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-15 16:08:29 +00:00
Rob Bradford
1fc3fef642 net_util: Use value returned from Queue::enable_notification()
This indicates if anything has been added to the available queue since
it was last iterated through. If it returns true then it is necessary to
iterate through the queue again otherwise it is appropriate to break out
from the loop.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-15 16:08:29 +00:00
Rob Bradford
2ed0338da8 virtio-devices: net: Use consistent nomenclature for control queue
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-15 16:08:29 +00:00
Rob Bradford
b4eddce090 virtio-devices: net: Use "num_queues" for number of queues
This improves consistency with other parts of the code.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-15 16:08:29 +00:00
Rob Bradford
bbcf69c58c virtio-devices: seccomp: Add pread64/pwrite64 sycalls for virtio-fs
These syscalls are explicitly used in the code:

3593055e77/virtio-devices/src/vhost_user/fs.rs (L237)

Fixes: #3843

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-15 16:58:15 +01:00
dependabot[bot]
18f1306d0c build: bump syn from 1.0.86 to 1.0.87
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.86 to 1.0.87.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.86...1.0.87)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-15 01:05:48 +00:00
dependabot[bot]
9c3f8cf2f5 build: bump libc from 0.2.119 to 0.2.120
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.119 to 0.2.120.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.119...0.2.120)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-15 00:21:58 +00:00
dependabot[bot]
673121b828 build: bump syn from 1.0.86 to 1.0.87 in /fuzz
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.86 to 1.0.87.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.86...1.0.87)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-15 00:07:48 +00:00
dependabot[bot]
b762fe4c2e build: bump libc from 0.2.119 to 0.2.120 in /fuzz
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.119 to 0.2.120.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.119...0.2.120)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-14 23:36:07 +00:00
Rob Bradford
c922bf23f6 performance-metrics: Use non-zero exit code on report file issues
This removes the need to wrap an error that is never used.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-14 16:53:49 +01:00
Rob Bradford
f99c09fab7 performance-metrics: Successful output should be on stdout not stderr
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-14 16:53:49 +01:00
Rob Bradford
a6d86b9496 performance-metrics: Use Write::write_all() for report
Write::write() is not guaranteed to write all the contents.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-14 16:53:49 +01:00
Rob Bradford
1004f870e1 performance-metrics: Refactor report file opening code
It should be closer to the use of the opened file.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-14 16:53:49 +01:00
Rob Bradford
d3be855b4b performance-metrics: Exit binary with non-zero exit code on test failure
This ensures that partial reports are not generated.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-14 16:53:49 +01:00
Rob Bradford
0cbdbc8122 performance-metrics: Remove unnecessary prelude on --list-tests
The user knows they have requested the list of tests.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-14 16:53:49 +01:00
Rob Bradford
959be92189 performance-metrics: Fix typo in function name
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-14 16:53:49 +01:00
Rob Bradford
5934319953 performance-metrics: Remove obsolete TODO
We upload from the file written to disk.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-14 16:53:49 +01:00
Bo Chen
8bef32d389 docs: Add a documentation for performance metrics
Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-03-14 09:41:51 +00:00
LiHui
b0be5ff8ad API: fix http hang for vmm.ping/vm.create/vm.info/vmm.shutdown
vmm.ping/vm.info will hang for PUT method, vm.create/vmm.shutdonw hang for GET method.
Because these four APIs do not write the response body when the HTTP method does not match.

Signed-off-by: LiHui <andrewli@kubesphere.io>
2022-03-11 11:56:14 +00:00
Sebastien Boeuf
9d46890dc0 vmm: device_manager: Make virtio DMA mapping conditional on vIOMMU
In case the virtio device which requires DMA mapping is placed behind a
virtual IOMMU, we shouldn't map/unmap any region manually. Instead, we
provide the DMA handler to the virtio-iommu device so that it can
trigger the proper mappings.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-03-11 12:37:17 +01:00
Sebastien Boeuf
a4f742277b vmm: device_manager: Handle DMA mapping for virtio devices
If a virtio device is associated with a DMA handler, the DMA mapping and
unmapping is performed from the device manager through the handler.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-03-11 12:37:17 +01:00
Sebastien Boeuf
86bc313f38 virtio-devices, vmm: Register a DMA handler to VirtioPciDevice
Given that some virtio device might need some DMA handling, we provide a
way to store this through the VirtioPciDevice layer, so that it can be
accessed when the PCI device is removed.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-03-11 12:37:17 +01:00
Sebastien Boeuf
54d63e774c vmm: device_manager: Extend MetaVirtioDevice with a DMA handler
In anticipation for handling potential DMA mapping/unmapping operations for a
virtio device, we extend the MetaVirtioDevice with an additional field
that holds an optional DMA handler.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-03-11 12:37:17 +01:00
Sebastien Boeuf
f801b0fc72 vmm: device_manager: Factorize virtio device tuple into structure
The tuple of information related to each virtio device is too big, and
it's better to factorize it through a dedicated structure.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-03-11 12:37:17 +01:00
Sebastien Boeuf
80296b9497 vmm: device_manager: Remove typedef VirtioDeviceArc
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-03-11 12:37:17 +01:00
Rob Bradford
71d911b3aa tests: Add test for virtio-net control queue
Use ethtool to trigger an event on the control queue.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-10 11:27:35 +00:00
Rob Bradford
223d0cf787 virtio-devices: Enable F_EVENT_IDX on control queue if negotiated
With the VIRTIO_F_EVENT_IDX handling now conducted inside the
virtio-queue crate it is necessary to activate the functionality on
every queue if it is negotiatated. Otherwise this leads to a failure of
the guest to signal to the host that there is something in the available
queue as the queue's internal state has not been configured correctly.

Fixes: #3829

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-10 11:27:35 +00:00