Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vhost: vdpa: Provide custom set_vring_addr() implementation #165

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

likebreath
Copy link
Contributor

@likebreath likebreath commented Jun 2, 2023

Summary of the PR

Unlike other vhost backends (e.g. vhost-net and vhost-vsock), vDPA
backends can not work with host virtual address (HVA), instead they
expect I/O virtual address (IOVA). The IOVA can be mapped 1:1 with
guest physical address (GPA) when no IOMMU is involved. This is why
the default implementation of set_vring_addr() from Trait
VhostBackend is no longer working with vDPA backends. To solve this
issue, this patch provides a custom set_vring_addr() implementation
for Trait VhostKernVdpa.

Fixes: #164

Requirements

Before submitting your PR, please make sure you addressed the following
requirements:

  • All commits in this PR are signed (with git commit -s), and the commit
    message has max 60 characters for the summary and max 75 characters for each
    description line.
  • All added/changed functionality has a corresponding unit/integration
    test.
  • All added/changed public-facing functionality has entries in the "Upcoming
    Release" section of CHANGELOG.md (if no such section exists, please create one).
  • Any newly added unsafe code is properly documented.

sboeuf
sboeuf previously approved these changes Jun 2, 2023
Copy link
Member

@stefano-garzarella stefano-garzarella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just minor comments to avoid confusion in the future, the code LGTM.

crates/vhost/CHANGELOG.md Outdated Show resolved Hide resolved
crates/vhost/src/vhost_kern/vdpa.rs Outdated Show resolved Hide resolved
Unlike other vhost backends (e.g. vhost-net and vhost-vsock), vDPA
backends can not work with host virtual address (HVA), instead they
expect I/O virtual address (IOVA). The IOVA can be mapped 1:1 with
guest physical address (GPA) when no IOMMU is involved. This is why
the default implementation of `set_vring_addr()` from Trait
`VhostBackend` is no longer working with vDPA backends. To solve this
issue, this patch provides a custom `set_vring_addr()` implementation
for Trait `VhostKernVdpa`.

Fixes: rust-vmm#164

Signed-off-by: Bo Chen <chen.bo@intel.com>
@stefano-garzarella stefano-garzarella merged commit bdc6f2a into rust-vmm:main Jun 6, 2023
23 checks passed
likebreath added a commit to likebreath/cloud-hypervisor that referenced this pull request Jun 7, 2023
The latest vhost release v0.7.0 has a vDPA regression [1]. It has been
fixed in the vhost upstream [2], but no new releases are available [3].
To unblock the bulk upgrades on rust-vmm depdencies, let's use the
upstream vhost for now.

[1] rust-vmm/vhost#164
[2] rust-vmm/vhost#165
[3] rust-vmm/vhost#166

Signed-off-by: Bo Chen <chen.bo@intel.com>
rbradford pushed a commit to cloud-hypervisor/cloud-hypervisor that referenced this pull request Jun 8, 2023
The latest vhost release v0.7.0 has a vDPA regression [1]. It has been
fixed in the vhost upstream [2], but no new releases are available [3].
To unblock the bulk upgrades on rust-vmm depdencies, let's use the
upstream vhost for now.

[1] rust-vmm/vhost#164
[2] rust-vmm/vhost#165
[3] rust-vmm/vhost#166

Signed-off-by: Bo Chen <chen.bo@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Potential regression for vDPA support
3 participants