On Tue, 27 Oct 2015 10:47:56 +0200
"Michael S. Tsirkin" wrote:
> virtio_map_sg currently fails if one of the entries it's mapping is
> contigious in GPA but not HVA address space. Introduce virtio_map which
> handles this by splitting sg entries.
>
> This new API generally turns out to be a goo
On Tue, 27 Oct 2015 10:47:56 +0200
"Michael S. Tsirkin" wrote:
> virtio_map_sg currently fails if one of the entries it's mapping is
> contigious in GPA but not HVA address space. Introduce virtio_map which
> handles this by splitting sg entries.
>
> This new API generally turns out to be a goo
On Tue, Oct 27, 2015 at 08:34:32PM +0200, Michael S. Tsirkin wrote:
> On Tue, Oct 27, 2015 at 04:19:54PM +, Stefan Hajnoczi wrote:
> > On Tue, Oct 27, 2015 at 10:47:56AM +0200, Michael S. Tsirkin wrote:
> > > This will still fail if there's no space left in the sg, but luckily max
> > > queue s
On Tue, Oct 27, 2015 at 04:13:12PM +, Stefan Hajnoczi wrote:
> On Tue, Oct 27, 2015 at 10:47:56AM +0200, Michael S. Tsirkin wrote:
> > +for (i = 0; i < *num_sg; i++) {
> > len = sg[i].iov_len;
> > sg[i].iov_base = cpu_physical_memory_map(addr[i], &len, is_write);
> > -
On Tue, Oct 27, 2015 at 04:19:54PM +, Stefan Hajnoczi wrote:
> On Tue, Oct 27, 2015 at 10:47:56AM +0200, Michael S. Tsirkin wrote:
> > This will still fail if there's no space left in the sg, but luckily max
> > queue size in use is currently 256, while max sg size is 1024, so we
> > should be
On Tue, Oct 27, 2015 at 10:47:56AM +0200, Michael S. Tsirkin wrote:
> This will still fail if there's no space left in the sg, but luckily max
> queue size in use is currently 256, while max sg size is 1024, so we
> should be OK even is all entries happen to cross a single DIMM boundary.
Don't for
On Tue, Oct 27, 2015 at 10:47:56AM +0200, Michael S. Tsirkin wrote:
> +for (i = 0; i < *num_sg; i++) {
> len = sg[i].iov_len;
> sg[i].iov_base = cpu_physical_memory_map(addr[i], &len, is_write);
> -if (sg[i].iov_base == NULL || len != sg[i].iov_len) {
> +if (!s
virtio_map_sg currently fails if one of the entries it's mapping is
contigious in GPA but not HVA address space. Introduce virtio_map which
handles this by splitting sg entries.
This new API generally turns out to be a good idea since it's harder to
misuse: at least in one case the existing one w