Skip to contentSkip to conversation

Dirty page rate and dirty page limit 20240617 patches

GIT PULL Applied Hyman Huang 2 participants 3 messages Jun 17, 2024

lore
Share & tools
lore
#1 lore raw

[PULL 1/1] migration/dirtyrate: Fix segmentation fault

In reply to Hyman Huang

From: Masato Imai <[email protected]>

Since the kvm_dirty_ring_enabled function accesses a null kvm_state pointer when the KVM acceleration parameter is not specified, running calc_dirty_rate with the -r or -b option causes a segmentation fault.

Message-ID: <[email protected]>

[Assert kvm_state when kvm_dirty_ring_enabled was called to fix it. - Hyman]
---
 accel/kvm/kvm-all.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
accel/kvm/kvm-all.c +1 -1
index 009b49de44..854cb86b22 100644
@@ -2329,7 +2329,7 @@ bool kvm_vcpu_id_is_valid(int vcpu_id)
 
 bool kvm_dirty_ring_enabled(void)
 {
-    return kvm_state->kvm_dirty_ring_size ? true : false;
+    return kvm_state && kvm_state->kvm_dirty_ring_size;
 }
 
 static void query_stats_cb(StatsResultList **result, StatsTarget target,
Signature · 1 line
2.39.1
#0 lore raw

The following changes since commit 05ad1440b8428b0ade9b8e5c01469adb8fbf83e3:

Merge tag 'virtio-grants-v8-tag' of https://gitlab.com/sstabellini/qemu into staging (2024-06-15 20:13:06 -0700)

are available in the Git repository at:

https://github.com/newfriday/qemu.git tags/dirtylimit-dirtyrate-pull-request-20240617

for you to fetch changes up to e65152d5483b2c847ec7a947ed52650152cfdcc0:

migration/dirtyrate: Fix segmentation fault (2024-06-17 23:29:21 +0800)

----------------------------------------------------------------
dirtylimit-dirtyrate-pull-request-20240617: Fix a segmentation fault

Please apply, thanks, Yong.

----------------------------------------------------------------
Masato Imai (1):
migration/dirtyrate: Fix segmentation fault

 accel/kvm/kvm-all.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.39.1
#2 lore raw
Quoted 11 lines · Hyman Huang

The following changes since commit 05ad1440b8428b0ade9b8e5c01469adb8fbf83e3:

   Merge tag 'virtio-grants-v8-tag' ofhttps://gitlab.com/sstabellini/qemu  into staging (2024-06-15 20:13:06 -0700)

are available in the Git repository at:

https://github.com/newfriday/qemu.git tags/dirtylimit-dirtyrate-pull-request-20240617

for you to fetch changes up to e65152d5483b2c847ec7a947ed52650152cfdcc0:

   migration/dirtyrate: Fix segmentation fault (2024-06-17 23:29:21 +0800)

Applied, thanks. Please update https://wiki.qemu.org/ChangeLog/9.1 as appropriate.

r~