Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

vdpa_sim: use kvmalloc to allocate vdpasim->buffer

The next patch will make the buffer size configurable from each
device.
Since the buffer could be larger than a page, we use kvmalloc()
instead of kmalloc().

Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://lore.kernel.org/r/20201215144256.155342-16-sgarzare@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

authored by

Stefano Garzarella and committed by
Michael S. Tsirkin
165be1f8 b240491b

+2 -2
+2 -2
drivers/vdpa/vdpa_sim/vdpa_sim.c
··· 418 418 if (!vdpasim->iommu) 419 419 goto err_iommu; 420 420 421 - vdpasim->buffer = kmalloc(PAGE_SIZE, GFP_KERNEL); 421 + vdpasim->buffer = kvmalloc(PAGE_SIZE, GFP_KERNEL); 422 422 if (!vdpasim->buffer) 423 423 goto err_iommu; 424 424 ··· 707 707 struct vdpasim *vdpasim = vdpa_to_sim(vdpa); 708 708 709 709 cancel_work_sync(&vdpasim->work); 710 - kfree(vdpasim->buffer); 710 + kvfree(vdpasim->buffer); 711 711 if (vdpasim->iommu) 712 712 vhost_iotlb_free(vdpasim->iommu); 713 713 kfree(vdpasim->vqs);