@@ -175,6 +175,8 @@ struct kvm_s2_mmu {
struct kvm_mmu_memory_cache split_page_cache;
uint64_t split_page_chunk_size;
+ bool hwdbm_enabled; /* KVM_CAP_ARM_HW_DBM enabled */
+
struct kvm_arch *arch;
};
@@ -115,6 +115,16 @@ int kvm_vm_ioctl_enable_cap(struct kvm *kvm,
}
mutex_unlock(&kvm->slots_lock);
break;
+ case KVM_CAP_ARM_HW_DBM:
+ mutex_lock(&kvm->slots_lock);
+ if (!system_supports_hw_dbm()) {
+ r = -EINVAL;
+ } else {
+ r = 0;
+ kvm->arch.mmu.hwdbm_enabled = true;
+ }
+ mutex_unlock(&kvm->slots_lock);
+ break;
default:
r = -EINVAL;
break;
@@ -316,6 +326,9 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
case KVM_CAP_ARM_SUPPORTED_BLOCK_SIZES:
r = kvm_supported_block_sizes();
break;
+ case KVM_CAP_ARM_HW_DBM:
+ r = system_supports_hw_dbm();
+ break;
default:
r = 0;
}
@@ -1192,6 +1192,7 @@ struct kvm_ppc_resize_hpt {
#define KVM_CAP_COUNTER_OFFSET 227
#define KVM_CAP_ARM_EAGER_SPLIT_CHUNK_SIZE 228
#define KVM_CAP_ARM_SUPPORTED_BLOCK_SIZES 229
+#define KVM_CAP_ARM_HW_DBM 230
#ifdef KVM_CAP_IRQ_ROUTING
Add a capability for userspace to enable hardware DBM support for live migration. ToDo: Update documentation. Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com> --- arch/arm64/include/asm/kvm_host.h | 2 ++ arch/arm64/kvm/arm.c | 13 +++++++++++++ include/uapi/linux/kvm.h | 1 + 3 files changed, 16 insertions(+)