Commit a1effab7 authored by Linus Torvalds's avatar Linus Torvalds

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
parents a2eaf246 4928f67b
...@@ -442,16 +442,10 @@ static long mlx5vf_precopy_ioctl(struct file *filp, unsigned int cmd, ...@@ -442,16 +442,10 @@ static long mlx5vf_precopy_ioctl(struct file *filp, unsigned int cmd,
if (migf->pre_copy_initial_bytes > *pos) { if (migf->pre_copy_initial_bytes > *pos) {
info.initial_bytes = migf->pre_copy_initial_bytes - *pos; info.initial_bytes = migf->pre_copy_initial_bytes - *pos;
} else { } else {
buf = mlx5vf_get_data_buff_from_pos(migf, *pos, &end_of_data); info.dirty_bytes = migf->max_pos - *pos;
if (buf) { if (!info.dirty_bytes)
info.dirty_bytes = buf->start_pos + buf->length - *pos; end_of_data = true;
} else { info.dirty_bytes += inc_length;
if (!end_of_data) {
ret = -EINVAL;
goto err_migf_unlock;
}
info.dirty_bytes = inc_length;
}
} }
if (!end_of_data || !inc_length) { if (!end_of_data || !inc_length) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment