lkml.org 
[lkml]   [2020]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 11/12] KVM: arm64: Support disable hw dirty log after enable
Date
We should clear DBM bit of all PTEs and flush TLB, then sync dirty log,
which promise we won't miss any dirty status set by hardware.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
---
arch/arm64/kvm/arm.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
index 92f0b40a30fa..76cab4c0b5a6 100644
--- a/arch/arm64/kvm/arm.c
+++ b/arch/arm64/kvm/arm.c
@@ -93,6 +93,12 @@ int kvm_vm_ioctl_enable_cap(struct kvm *kvm,
r = -EINVAL;
} else {
r = 0;
+ if (kvm->arch.hw_dirty_log && !cap->args[0]) {
+ mutex_lock(&kvm->slots_lock);
+ kvm_mmu_clear_dbm_all(kvm);
+ kvm_mmu_sync_dirty_log_all(kvm);
+ mutex_unlock(&kvm->slots_lock);
+ }
kvm->arch.hw_dirty_log = cap->args[0];
}
break;
--
2.19.1
\
 
 \ /
  Last update: 2020-06-16 11:37    [W:0.162 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site