#
1f2915bf |
| 03-Jul-2021 |
Wei Liu <liuwe@microsoft.com> |
vmm: hypervisor: split set_user_memory_region to two functions
Previously the same function was used to both create and remove regions. This worked on KVM because it uses size 0 to indicate removal.
vmm: hypervisor: split set_user_memory_region to two functions
Previously the same function was used to both create and remove regions. This worked on KVM because it uses size 0 to indicate removal.
MSHV has two calls -- one for creation and one for removal. It also requires having the size field available because it is not slot based.
Split set_user_memory_region to {create/remove}_user_memory_region. For KVM they still use set_user_memory_region underneath, but for MSHV they map to different functions.
This fixes user memory region removal on MSHV.
Signed-off-by: Wei Liu <liuwe@microsoft.com>
show more ...
|
#
5825ab2d |
| 23-Jun-2021 |
Bo Chen <chen.bo@intel.com> |
clippy: Address the issue 'needless-borrow'
Issue from beta verion of clippy:
Error: --> vm-virtio/src/queue.rs:700:59 | 700 | if let Some(used_event) = self.get_used_event(&mem)
clippy: Address the issue 'needless-borrow'
Issue from beta verion of clippy:
Error: --> vm-virtio/src/queue.rs:700:59 | 700 | if let Some(used_event) = self.get_used_event(&mem) { | ^^^^ help: change this to: `mem` | = note: `-D clippy::needless-borrow` implied by `-D warnings` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Signed-off-by: Bo Chen <chen.bo@intel.com>
show more ...
|
#
2fe3586e |
| 09-Jun-2021 |
Henry Wang <Henry.Wang@arm.com> |
hypervisor: support AArch64 `get_host_ipa_limit`
Not all AArch64 platforms support IPAs up to 40 bits. Since the kvm-ioctl crate now supports `get_host_ipa_limit` for AArch64, when creating the VM,
hypervisor: support AArch64 `get_host_ipa_limit`
Not all AArch64 platforms support IPAs up to 40 bits. Since the kvm-ioctl crate now supports `get_host_ipa_limit` for AArch64, when creating the VM, it is better to get the IPA size from the host and use that to create the VM.
Signed-off-by: Henry Wang <Henry.Wang@arm.com>
show more ...
|
#
805cb303 |
| 09-Jun-2021 |
Henry Wang <Henry.Wang@arm.com> |
hypervisor: Add `get_host_ipa_limit` for AArch64
This commit adds a helper `get_host_ipa_limit` to the AArch64 `KvmHypervisor` struct. This helper can be used to get the `Host_IPA_Limit`, which is t
hypervisor: Add `get_host_ipa_limit` for AArch64
This commit adds a helper `get_host_ipa_limit` to the AArch64 `KvmHypervisor` struct. This helper can be used to get the `Host_IPA_Limit`, which is the maximum possible value for IPA_Bits on the host and is dependent on the CPU capability and the kernel configuration.
Signed-off-by: Henry Wang <Henry.Wang@arm.com>
show more ...
|
#
9f5325fd |
| 01-Jun-2021 |
Rob Bradford <robert.bradford@intel.com> |
hypervisor: tdx: Unconditionally enable TDX debug
For now enable the TDX attribute for TDX debug.
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
|
#
84454f14 |
| 19-May-2021 |
Rob Bradford <robert.bradford@intel.com> |
hypervisor: Remove panic from Hypervisor::check_required_extensions()
Remove the panic by replacing the .expect() with a cleaner error handling.
Signed-off-by: Rob Bradford <robert.bradford@intel.c
hypervisor: Remove panic from Hypervisor::check_required_extensions()
Remove the panic by replacing the .expect() with a cleaner error handling.
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
show more ...
|
#
24396257 |
| 19-May-2021 |
Rob Bradford <robert.bradford@intel.com> |
hypervisor: Cleanup unused Hypervisor trait members
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
|
#
3c6dfd77 |
| 25-Mar-2021 |
Rob Bradford <robert.bradford@intel.com> |
tdx: Address Rust 1.51.0 clippy issue (upper_case_acroynms)
error: name `FinalizeTDX` contains a capitalized acronym --> vmm/src/vm.rs:274:5 | 274 | FinalizeTDX(hypervisor::HypervisorVmEr
tdx: Address Rust 1.51.0 clippy issue (upper_case_acroynms)
error: name `FinalizeTDX` contains a capitalized acronym --> vmm/src/vm.rs:274:5 | 274 | FinalizeTDX(hypervisor::HypervisorVmError), | ^^^^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `FinalizeTdx` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
show more ...
|
#
0c27f69f |
| 25-Mar-2021 |
Rob Bradford <robert.bradford@intel.com> |
hypervisor: Address Rust 1.51.0 clippy issue (upper_case_acroynms)
warning: name `TranslateGVA` contains a capitalized acronym --> hypervisor/src/arch/emulator/mod.rs:51:5 | 51 | TranslateG
hypervisor: Address Rust 1.51.0 clippy issue (upper_case_acroynms)
warning: name `TranslateGVA` contains a capitalized acronym --> hypervisor/src/arch/emulator/mod.rs:51:5 | 51 | TranslateGVA(#[source] anyhow::Error), | ^^^^^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `TranslateGva` | = note: `#[warn(clippy::upper_case_acronyms)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
show more ...
|
#
7fad74cb |
| 10-Mar-2021 |
Vineeth Pillai <viremana@linux.microsoft.com> |
hypervisor: refactor vec_with_array_field function
refactor vec_with_array_field to common hypervisor code so that mshv can also make use of it.
Signed-off-by: Vineeth Pillai <viremana@linux.micros
hypervisor: refactor vec_with_array_field function
refactor vec_with_array_field to common hypervisor code so that mshv can also make use of it.
Signed-off-by: Vineeth Pillai <viremana@linux.microsoft.com>
show more ...
|
#
afc83582 |
| 14-Mar-2021 |
Michael Zhao <michael.zhao@arm.com> |
aarch64: Enable IRQ routing for legacy devices
On AArch64, interrupt controller (GIC) is emulated by KVM. VMM need to set IRQ routing for devices, including legacy ones.
Before this commit, IRQ rou
aarch64: Enable IRQ routing for legacy devices
On AArch64, interrupt controller (GIC) is emulated by KVM. VMM need to set IRQ routing for devices, including legacy ones.
Before this commit, IRQ routing was only set for MSI. Legacy routing entries of type KVM_IRQ_ROUTING_IRQCHIP were missing. That is way legacy devices (like serial device ttyS0) does not work.
The setting of X86 IRQ routing entries are not impacted.
Signed-off-by: Michael Zhao <michael.zhao@arm.com>
show more ...
|
#
1c54fc3a |
| 23-Feb-2021 |
Rob Bradford <robert.bradford@intel.com> |
hypervisor: Support creating a VM of a specified KVM type
This is necessary to support creating a TD VM.
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
|
#
f282cc00 |
| 12-Feb-2021 |
Rob Bradford <robert.bradford@intel.com> |
tdx: Add abstraction to call TDX ioctls to hypervisor
Add API to the hypervisor interface and implement for KVM to allow the special TDX KVM ioctls on the VM and vCPU FDs.
Signed-off-by: Rob Bradfo
tdx: Add abstraction to call TDX ioctls to hypervisor
Add API to the hypervisor interface and implement for KVM to allow the special TDX KVM ioctls on the VM and vCPU FDs.
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
show more ...
|
#
f8875ace |
| 25-Feb-2021 |
Rob Bradford <robert.bradford@intel.com> |
misc: Bulk upgrade dependencies
In particular update for the vmm-sys-util upgrade and all the other dependent packages. This requires an updated forked version of kvm-bindings (due to updated vfio-i
misc: Bulk upgrade dependencies
In particular update for the vmm-sys-util upgrade and all the other dependent packages. This requires an updated forked version of kvm-bindings (due to updated vfio-ioctls) but allowed the removal of our forked version of kvm-ioctls.
The changes to the API from kvm-ioctls and vmm-sys-util required some other minor changes to the code.
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
show more ...
|
#
07a09eda |
| 08-Feb-2021 |
Rob Bradford <robert.bradford@intel.com> |
hypervisor: kvm: Remove whitespace from use statements
This allows cargo fmt to correctly order the statements.
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
|
#
a6b839b3 |
| 08-Feb-2021 |
Rob Bradford <robert.bradford@intel.com> |
build: Update to latest kvm-ioctls
Update the version of the fork pointed to which has been rebased on the latest upstream.
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
|
#
184baff3 |
| 03-Jan-2021 |
Rob Bradford <robert.bradford@intel.com> |
hypervisor: kvm: aarch64: Use struct initialisation
error: field assignment outside of initializer for an instance created with Default::default() Error: --> hypervisor/src/kvm/mod.rs:1239:9
hypervisor: kvm: aarch64: Use struct initialisation
error: field assignment outside of initializer for an instance created with Default::default() Error: --> hypervisor/src/kvm/mod.rs:1239:9 | 1239 | state.mp_state = self.get_mp_state()?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `-D clippy::field-reassign-with-default` implied by `-D warnings` note: consider initializing the variable with `kvm::aarch64::VcpuKvmState { mp_state: self.get_mp_state()?, ..Default::default() }` and removing relevant reassignments --> hypervisor/src/kvm/mod.rs:1237:9 | 1237 | let mut state = CpuState::default(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
show more ...
|
#
f452fe74 |
| 02-Jan-2021 |
Rob Bradford <robert.bradford@intel.com> |
hypervisor: kvm: Use struct initialiser where possible
error: field assignment outside of initializer for an instance created with Default::default() --> hypervisor/src/kvm/mod.rs:318:9 | 318
hypervisor: kvm: Use struct initialiser where possible
error: field assignment outside of initializer for an instance created with Default::default() --> hypervisor/src/kvm/mod.rs:318:9 | 318 | cap.cap = KVM_CAP_SPLIT_IRQCHIP; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `-D clippy::field-reassign-with-default` implied by `-D warnings` note: consider initializing the variable with `kvm_bindings::kvm_enable_cap { cap: KVM_CAP_SPLIT_IRQCHIP, ..Default::default() }` and removing relevant reassignments --> hypervisor/src/kvm/mod.rs:317:9 | 317 | let mut cap: kvm_enable_cap = Default::default(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
show more ...
|
#
ffaab469 |
| 01-Dec-2020 |
Rob Bradford <robert.bradford@intel.com> |
misc: Use a more relaxed memory model when possible
When a total ordering between multiple atomic variables is not required then use Ordering::Acquire with atomic loads and Ordering::Release with at
misc: Use a more relaxed memory model when possible
When a total ordering between multiple atomic variables is not required then use Ordering::Acquire with atomic loads and Ordering::Release with atomic stores.
This will improve performance as this does not require a memory fence on x86_64 which Ordering::SeqCst will use.
Add a comment to the code in the vCPU handling code where it operates on multiple atomics to explain why Ordering::SeqCst is required.
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
show more ...
|
#
0fec3265 |
| 18-Nov-2020 |
Rob Bradford <robert.bradford@intel.com> |
hypervisor, vmm: Remove shared ownership of VmmOps
This interface is used by the vCPU thread to delegate responsibility for handling MMIO/PIO operations and to support different approaches than a VM
hypervisor, vmm: Remove shared ownership of VmmOps
This interface is used by the vCPU thread to delegate responsibility for handling MMIO/PIO operations and to support different approaches than a VM exit.
During profiling I found that we were spending 13.75% of the boot CPU uage acquiring access to the object holding the VmmOps via ArcSwap::load_full()
13.75% 6.02% vcpu0 cloud-hypervisor [.] arc_swap::ArcSwapAny<T,S>::load_full | ---arc_swap::ArcSwapAny<T,S>::load_full | --13.43%--<hypervisor::kvm::KvmVcpu as hypervisor::cpu::Vcpu>::run std::sys_common::backtrace::__rust_begin_short_backtrace core::ops::function::FnOnce::call_once{{vtable-shim}} std::sys::unix::thread::Thread::new::thread_start
However since the object implementing VmmOps does not need to be mutable and it is only used from the vCPU side we can change the ownership to being a simple Arc<> that is passed in when calling create_vcpu().
This completely removes the above CPU usage from subsequent profiles.
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
show more ...
|
#
041724a7 |
| 11-Nov-2020 |
Rob Bradford <robert.bradford@intel.com> |
hypervisor: Add ability to get dirty logged pages
Return a bitmap of pages that have been dirtied (written to) since it was last called.
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
|
#
8baa244e |
| 11-Nov-2020 |
Rob Bradford <robert.bradford@intel.com> |
hypervisor: Add control for dirty page logging
When creating a userspace mapping provide a control for enabling the logging of dirty pages.
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
|
#
46e73697 |
| 16-Nov-2020 |
Rob Bradford <robert.bradford@intel.com> |
hypervisor: kvm: Correctly share VmmOps between Kvm{Vm,Vcpu}
Cloning the ArcSwapOption (like the ArcSwap) does not act like a .clone() on an Arc, instead an entirely new ArcSwap is created with the
hypervisor: kvm: Correctly share VmmOps between Kvm{Vm,Vcpu}
Cloning the ArcSwapOption (like the ArcSwap) does not act like a .clone() on an Arc, instead an entirely new ArcSwap is created with the same contents. To correctly share the ArcSwap needs to be placed inside an Arc.
See: https://github.com/vorner/arc-swap/commit/2433d5719be341dc520a8bb93d9d3ce7f141a80d#diff-6c6d94533c44c19bd1416ef17bad1a878e63dca6e98d59181228fbe8f967c62bR6
Due to this being wrongly used ::clone() was removed from ArcSwap/ArcSwapOption in 1.0.0.
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
show more ...
|
#
093a581e |
| 30-Oct-2020 |
Michael Zhao <michael.zhao@arm.com> |
vmm: Implement VM rebooting on AArch64
The logic to handle AArch64 system event was: SHUTDOWN and RESET were all treated as RESET.
Now we handle them differently: - RESET event will trigger Vmm::vm
vmm: Implement VM rebooting on AArch64
The logic to handle AArch64 system event was: SHUTDOWN and RESET were all treated as RESET.
Now we handle them differently: - RESET event will trigger Vmm::vm_reboot(), - SHUTDOWN event will trigger Vmm::vm_shutdown().
Signed-off-by: Michael Zhao <michael.zhao@arm.com>
show more ...
|
#
28e12e9f |
| 16-Oct-2020 |
Sebastien Boeuf <sebastien.boeuf@intel.com> |
vmm, hypervisor: Fix snapshot/restore for Windows guest
The snasphot/restore feature is not working because some CPU states are not properly saved, which means they can't be restored later on.
Firs
vmm, hypervisor: Fix snapshot/restore for Windows guest
The snasphot/restore feature is not working because some CPU states are not properly saved, which means they can't be restored later on.
First thing, we ensure the CPUID is stored so that it can be properly restored later. The code is simplified and pushed down to the hypervisor crate.
Second thing, we identify for each vCPU if the Hyper-V SynIC device is emulated or not. In case it is, that means some specific MSRs will be set by the guest. These MSRs must be saved in order to properly restore the VM.
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
show more ...
|