From bcdac101496c5b99023f033e5196aecc5fc8b69f Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Wed, 15 Sep 2021 15:55:15 +0200 Subject: [PATCH] deps: Bump kvm-bindings to v0.5.0 Update the kvm-bindings dependency so that Cloud Hypervisor now depends on the version 0.5.0, which is based on Linux kernel v5.13.0. We still have to rely on a forked version to be able to serialize all the KVM structures we need. Signed-off-by: Sebastien Boeuf --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- fuzz/Cargo.lock | 4 ++-- fuzz/Cargo.toml | 2 +- hypervisor/Cargo.toml | 2 +- hypervisor/src/kvm/mod.rs | 7 ++++--- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3f0490d56..5d0e890e8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -448,8 +448,8 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "kvm-bindings" -version = "0.4.0" -source = "git+https://github.com/cloud-hypervisor/kvm-bindings?branch=ch-v0.4.0#1a68725639283e622f4bb64584885b30bfe8be44" +version = "0.5.0" +source = "git+https://github.com/cloud-hypervisor/kvm-bindings?branch=ch-v0.5.0#9c497710ba9968d8efe15dbae03991b16cf82e23" dependencies = [ "serde", "serde_derive", diff --git a/Cargo.toml b/Cargo.toml index 7b308e689..991eb4e94 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,7 +35,7 @@ clap = { version = "2.33.3", features = ["wrap_help"] } # List of patched crates [patch.crates-io] -kvm-bindings = { git = "https://github.com/cloud-hypervisor/kvm-bindings", branch = "ch-v0.4.0", features = ["with-serde", "fam-wrappers"] } +kvm-bindings = { git = "https://github.com/cloud-hypervisor/kvm-bindings", branch = "ch-v0.5.0", features = ["with-serde", "fam-wrappers"] } versionize_derive = { git = "https://github.com/cloud-hypervisor/versionize_derive", branch = "ch" } [dev-dependencies] diff --git a/fuzz/Cargo.lock b/fuzz/Cargo.lock index 7e5fac7e7..bd4db46da 100644 --- a/fuzz/Cargo.lock +++ b/fuzz/Cargo.lock @@ -310,8 +310,8 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "kvm-bindings" -version = "0.4.0" -source = "git+https://github.com/cloud-hypervisor/kvm-bindings?branch=ch-v0.4.0#1a68725639283e622f4bb64584885b30bfe8be44" +version = "0.5.0" +source = "git+https://github.com/cloud-hypervisor/kvm-bindings?branch=ch-v0.5.0#9c497710ba9968d8efe15dbae03991b16cf82e23" dependencies = [ "serde", "serde_derive", diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index c65a77bb3..7cfc8780e 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -24,7 +24,7 @@ vm-memory = "0.6.0" path = ".." [patch.crates-io] -kvm-bindings = { git = "https://github.com/cloud-hypervisor/kvm-bindings", branch = "ch-v0.4.0", features = ["with-serde", "fam-wrappers"] } +kvm-bindings = { git = "https://github.com/cloud-hypervisor/kvm-bindings", branch = "ch-v0.5.0", features = ["with-serde", "fam-wrappers"] } vm-memory = { git = "https://github.com/rust-vmm/vm-memory", rev = "5bd7138758183a73ac0da27ce40c004d95f1a7e9"} versionize_derive = { git = "https://github.com/cloud-hypervisor/versionize_derive", branch = "ch" } diff --git a/hypervisor/Cargo.toml b/hypervisor/Cargo.toml index ac689757e..211acaadb 100644 --- a/hypervisor/Cargo.toml +++ b/hypervisor/Cargo.toml @@ -17,7 +17,7 @@ thiserror = "1.0.29" libc = "0.2.101" log = "0.4.14" kvm-ioctls = { version = "0.9.0", optional = true } -kvm-bindings = { git = "https://github.com/cloud-hypervisor/kvm-bindings", branch = "ch-v0.4.0", features = ["with-serde", "fam-wrappers"], optional = true } +kvm-bindings = { git = "https://github.com/cloud-hypervisor/kvm-bindings", branch = "ch-v0.5.0", features = ["with-serde", "fam-wrappers"], optional = true } mshv-bindings = {git = "https://github.com/rust-vmm/mshv", branch = "main", features = ["with-serde", "fam-wrappers"], optional = true } mshv-ioctls = { git = "https://github.com/rust-vmm/mshv", branch = "main", optional = true} serde = { version = "1.0.130", features = ["rc"] } diff --git a/hypervisor/src/kvm/mod.rs b/hypervisor/src/kvm/mod.rs index bd39f9018..ed8fe5cc7 100644 --- a/hypervisor/src/kvm/mod.rs +++ b/hypervisor/src/kvm/mod.rs @@ -1153,10 +1153,11 @@ impl cpu::Vcpu for KvmVcpu { // https://elixir.free-electrons.com/linux/v4.9.62/source/arch/arm64/include/uapi/asm/kvm.h#L53 let mut off = offset__of!(kvm_regs, fp_regs) + offset__of!(user_fpsimd_state, vregs); for i in 0..32 { - state.fp_regs.vregs[i][0] = self + state.fp_regs.vregs[i] = self .fd .get_one_reg(arm64_core_reg_id!(KVM_REG_SIZE_U128, off)) - .map_err(|e| cpu::HypervisorCpuError::GetCoreRegister(e.into()))?; + .map_err(|e| cpu::HypervisorCpuError::GetCoreRegister(e.into()))? + .into(); off += mem::size_of::(); } @@ -1233,7 +1234,7 @@ impl cpu::Vcpu for KvmVcpu { self.fd .set_one_reg( arm64_core_reg_id!(KVM_REG_SIZE_U128, off), - state.fp_regs.vregs[i][0], + state.fp_regs.vregs[i] as u64, ) .map_err(|e| cpu::HypervisorCpuError::SetCoreRegister(e.into()))?; off += mem::size_of::();