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

Add MSI capability support for VFIO devices #191

Merged
merged 10 commits into from
Dec 15, 2024
247 changes: 239 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ assert_matches = "1"
proc-macro2 = "1"
syn = { version = "2", features = ["full"] }
quote = { version = "1" }
rstest = "0.23"

[profile.release]
lto = true
Expand Down
1 change: 1 addition & 0 deletions alioth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ io-uring = "0.7"

[dev-dependencies]
assert_matches.workspace = true
rstest.workspace = true
3 changes: 1 addition & 2 deletions alioth/src/hv/kvm/vmexit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ impl KvmVcpu {
#[cfg(target_endian = "little")]
pub(super) fn handle_mmio(&mut self) -> Result<VmExit, Error> {
let kvm_mmio = unsafe { &self.kvm_run.exit.mmio };
let data = u64::from_ne_bytes(kvm_mmio.data) & u64::MAX >> (64 - (kvm_mmio.len << 3));
let exit = VmExit::Mmio {
addr: kvm_mmio.phys_addr,
write: if kvm_mmio.is_write > 0 {
Some(data)
Some(u64::from_ne_bytes(kvm_mmio.data))
} else {
None
},
Expand Down
Loading
Loading