vhost: vdpa: Provide custom set_vring_addr() implementation

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

Signed-off-by: Bo Chen <[email protected]>
2 files changed
tree: 62e224e5286b7be34a9ca1f90b758b038a0f6573
  1. .buildkite/
  2. .cargo/
  3. .github/
  4. crates/
  5. .gitignore
  6. .gitmodules
  7. Cargo.toml
  8. CODEOWNERS
  9. coverage_config_aarch64.json
  10. coverage_config_x86_64.json
  11. LICENSE
  12. LICENSE-BSD-3-Clause
  13. README.md
README.md

vhost

The vhost workspace hosts libraries related to the vhost and vhost-user protocols. It currently consists of the following crates:

  • vhost -> A pure rust library for vDPA, vhost and vhost-user.
  • vhost-user-backend -> It provides a framework to implement vhost-user backend services.