Skip to content

Commit a1effab

Browse files
committed
Merge tag 'vfio-v6.3-rc4' of https://github.com/awilliam/linux-vfio
Pull VFIO fix from Alex Williamson: - Fix dirty size reporting for pre-copy in mlx5 variant driver (Yishai Hadas) * tag 'vfio-v6.3-rc4' of https://github.com/awilliam/linux-vfio: vfio/mlx5: Fix the report of dirty_bytes upon pre-copy
2 parents a2eaf24 + 4928f67 commit a1effab

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

drivers/vfio/pci/mlx5/main.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -442,16 +442,10 @@ static long mlx5vf_precopy_ioctl(struct file *filp, unsigned int cmd,
442442
if (migf->pre_copy_initial_bytes > *pos) {
443443
info.initial_bytes = migf->pre_copy_initial_bytes - *pos;
444444
} else {
445-
buf = mlx5vf_get_data_buff_from_pos(migf, *pos, &end_of_data);
446-
if (buf) {
447-
info.dirty_bytes = buf->start_pos + buf->length - *pos;
448-
} else {
449-
if (!end_of_data) {
450-
ret = -EINVAL;
451-
goto err_migf_unlock;
452-
}
453-
info.dirty_bytes = inc_length;
454-
}
445+
info.dirty_bytes = migf->max_pos - *pos;
446+
if (!info.dirty_bytes)
447+
end_of_data = true;
448+
info.dirty_bytes += inc_length;
455449
}
456450

457451
if (!end_of_data || !inc_length) {

0 commit comments

Comments
 (0)