Messages in this thread | | | Date | Fri, 27 Jul 2012 08:50:12 +0200 | From | Paolo Bonzini <> | Subject | Re: [PATCH] scsi: virtio-scsi: Fix address translation failure of HighMem pages used by sg list |
| |
Il 27/07/2012 05:12, Wang Sen ha scritto: >> > No this code is correct, though you will need to make sure to properly >> > terminate the destination sg_list. > Yes, the terminate marker in the destination list is set when initialization. > sg_set_page would not break this marker because it saved both the two > maker bits at sg_asign_page. > > Also, the allocation of destination sg list considered the total number of > the source sg_list. So, sg_set_page can work correctly. > > The value assignment method also can also work correctly, because the > termination marker in source sg_list has been set in blk_rq_map_sg(), as > the last entry of source sg_list is just copied to the the last entry > in destination > list. > > Uh, Paolo, Boaz, have you reached agreement on which method to use?
Let's use the value assignment, and document it in the commit message as follows:
Value assignment creates a well-formed scatterlist, because the termination marker in source sg_list has been set in blk_rq_map_sg(). The last entry of the source sg_list is just copied to the the last entry in destination list. Note that, for now, virtio_ring does not care about the form of the scatterlist and simply processes the first out_num + in_num consecutive elements of the sg[] array.
Paolo
| |