virt inclusion category: bugfix bugzilla: https://atomgit.com/openeuler/kernel/issues/9412 -------------------------------------------------------------------- Enabling HDBSS alongside the dirty ring leads to a guest hang after live migration. This occurs because HDBSS currently lacks support for the dirty ring data structures, preventing proper dirty page tracking and synchronization during migration. Add a check in kvm_cap_arm_enable_hdbss() to return -EINVAL if the dirty ring is already in use to prevent this conflicting and unsafe configuration. Fixes: bd6106e348d7 ("arm64/kvm: using ioctl to enable/disable the HDBSS feature") Signed-off-by: Tian Zheng <zhengtian10@huawei.com> --- arch/arm64/kvm/arm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index c05d1734ee27..9d136e221d63 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -175,6 +175,11 @@ static int kvm_cap_arm_enable_hdbss(struct kvm *kvm, return -EINVAL; } + if (kvm->dirty_ring_size) { + kvm_err("Cannot enable HDBSS when dirty ring is enabled!\n"); + return -EINVAL; + } + if (size < 0 || size > HDBSS_MAX_SIZE) { kvm_err("Invalid HDBSS buffer size: %d!\n", size); return -EINVAL; -- 2.33.0