search for: dma_pool_zalloc

Displaying 19 results from an estimated 19 matches for "dma_pool_zalloc".

Did you mean: dma_pool_alloc
2019 Jun 11
2
[PATCH v4 4/8] s390/airq: use DMA memory for adapter interrupts
...n value of airq_init() was > ignored in do_initcall_level(). So I was like ignoring it seems to be > consistent with previous state. > > But, ouch, there is a big difference! While kmem_cache_zalloc() seems > to tolerate the first argument (pointer to kmem_cache) being NULL the > dma_pool_zalloc() does not. Yeah. While previously continuing with a failed allocation simply was not very workable, now we actually would end up with crashes :( > > IMHO the cleanest thing to do at this stage is to check if the > airq_iv_cache is NULL and fail the allocation if it is (to preserve >...
2019 Jun 11
2
[PATCH v4 4/8] s390/airq: use DMA memory for adapter interrupts
...n value of airq_init() was > ignored in do_initcall_level(). So I was like ignoring it seems to be > consistent with previous state. > > But, ouch, there is a big difference! While kmem_cache_zalloc() seems > to tolerate the first argument (pointer to kmem_cache) being NULL the > dma_pool_zalloc() does not. Yeah. While previously continuing with a failed allocation simply was not very workable, now we actually would end up with crashes :( > > IMHO the cleanest thing to do at this stage is to check if the > airq_iv_cache is NULL and fail the allocation if it is (to preserve >...
2019 Jun 12
0
[PATCH v4 4/8] s390/airq: use DMA memory for adapter interrupts
...; > ignored in do_initcall_level(). So I was like ignoring it seems to be > > consistent with previous state. > > > > But, ouch, there is a big difference! While kmem_cache_zalloc() seems > > to tolerate the first argument (pointer to kmem_cache) being NULL the > > dma_pool_zalloc() does not. > > Yeah. While previously continuing with a failed allocation simply was > not very workable, now we actually would end up with crashes :( > Nod. > > > > IMHO the cleanest thing to do at this stage is to check if the > > airq_iv_cache is NULL and fail...
2019 Jun 11
2
[PATCH v4 4/8] s390/airq: use DMA memory for adapter interrupts
On Thu, 6 Jun 2019 13:51:23 +0200 Halil Pasic <pasic at linux.ibm.com> wrote: > Protected virtualization guests have to use shared pages for airq > notifier bit vectors, because hypervisor needs to write these bits. > > Let us make sure we allocate DMA memory for the notifier bit vectors by > replacing the kmem_cache with a dma_cache and kalloc() with > cio_dma_zalloc().
2019 Jun 11
2
[PATCH v4 4/8] s390/airq: use DMA memory for adapter interrupts
On Thu, 6 Jun 2019 13:51:23 +0200 Halil Pasic <pasic at linux.ibm.com> wrote: > Protected virtualization guests have to use shared pages for airq > notifier bit vectors, because hypervisor needs to write these bits. > > Let us make sure we allocate DMA memory for the notifier bit vectors by > replacing the kmem_cache with a dma_cache and kalloc() with > cio_dma_zalloc().
2019 Jun 11
0
[PATCH v4 4/8] s390/airq: use DMA memory for adapter interrupts
...r circumstances, and the return value of airq_init() was ignored in do_initcall_level(). So I was like ignoring it seems to be consistent with previous state. But, ouch, there is a big difference! While kmem_cache_zalloc() seems to tolerate the first argument (pointer to kmem_cache) being NULL the dma_pool_zalloc() does not. IMHO the cleanest thing to do at this stage is to check if the airq_iv_cache is NULL and fail the allocation if it is (to preserve previous behavior). I would prefer having a separate discussion on eventually changing the behavior (e.g. fail css initialization). Connie, would that wo...
2019 Jun 12
1
[PATCH v5 4/8] s390/airq: use DMA memory for adapter interrupts
...((cache_line_size() * BITS_PER_BYTE) < bits > + || !airq_iv_cache) I still think squashing this into the same if statement is a bit ugly, but not really an issue. > goto out_free; > > - iv->vector = kmem_cache_zalloc(airq_iv_cache, GFP_KERNEL); > + iv->vector = dma_pool_zalloc(airq_iv_cache, GFP_KERNEL, > + &iv->vector_dma); > if (!iv->vector) > goto out_free; > } else { > - iv->vector = kzalloc(size, GFP_KERNEL); > + iv->vector = cio_dma_zalloc(size); > if (!iv->vector) > goto out_free; > } (......
2019 May 23
0
[PATCH v2 4/8] s390/airq: use DMA memory for adapter interrupts
...iv->flags = flags; - size = BITS_TO_LONGS(bits) * sizeof(unsigned long); + size = iv_size(bits); if (flags & AIRQ_IV_CACHELINE) { if ((cache_line_size() * BITS_PER_BYTE) < bits) goto out_free; - iv->vector = kmem_cache_zalloc(airq_iv_cache, GFP_KERNEL); + iv->vector = dma_pool_zalloc(airq_iv_cache, GFP_KERNEL, + &iv->vector_dma); if (!iv->vector) goto out_free; } else { - iv->vector = kzalloc(size, GFP_KERNEL); + iv->vector = cio_dma_zalloc(size); if (!iv->vector) goto out_free; } @@ -179,9 +187,9 @@ struct airq_iv *airq_iv_create...
2019 Jun 06
0
[PATCH v4 4/8] s390/airq: use DMA memory for adapter interrupts
...iv->flags = flags; - size = BITS_TO_LONGS(bits) * sizeof(unsigned long); + size = iv_size(bits); if (flags & AIRQ_IV_CACHELINE) { if ((cache_line_size() * BITS_PER_BYTE) < bits) goto out_free; - iv->vector = kmem_cache_zalloc(airq_iv_cache, GFP_KERNEL); + iv->vector = dma_pool_zalloc(airq_iv_cache, GFP_KERNEL, + &iv->vector_dma); if (!iv->vector) goto out_free; } else { - iv->vector = kzalloc(size, GFP_KERNEL); + iv->vector = cio_dma_zalloc(size); if (!iv->vector) goto out_free; } @@ -179,9 +187,9 @@ struct airq_iv *airq_iv_create...
2019 Jun 12
0
[PATCH v5 4/8] s390/airq: use DMA memory for adapter interrupts
...size = iv_size(bits); if (flags & AIRQ_IV_CACHELINE) { - if ((cache_line_size() * BITS_PER_BYTE) < bits) + if ((cache_line_size() * BITS_PER_BYTE) < bits + || !airq_iv_cache) goto out_free; - iv->vector = kmem_cache_zalloc(airq_iv_cache, GFP_KERNEL); + iv->vector = dma_pool_zalloc(airq_iv_cache, GFP_KERNEL, + &iv->vector_dma); if (!iv->vector) goto out_free; } else { - iv->vector = kzalloc(size, GFP_KERNEL); + iv->vector = cio_dma_zalloc(size); if (!iv->vector) goto out_free; } @@ -178,10 +187,10 @@ struct airq_iv *airq_iv_crea...
2019 May 29
0
[PATCH v3 4/8] s390/airq: use DMA memory for adapter interrupts
...iv->flags = flags; - size = BITS_TO_LONGS(bits) * sizeof(unsigned long); + size = iv_size(bits); if (flags & AIRQ_IV_CACHELINE) { if ((cache_line_size() * BITS_PER_BYTE) < bits) goto out_free; - iv->vector = kmem_cache_zalloc(airq_iv_cache, GFP_KERNEL); + iv->vector = dma_pool_zalloc(airq_iv_cache, GFP_KERNEL, + &iv->vector_dma); if (!iv->vector) goto out_free; } else { - iv->vector = kzalloc(size, GFP_KERNEL); + iv->vector = cio_dma_zalloc(size); if (!iv->vector) goto out_free; } @@ -179,9 +187,9 @@ struct airq_iv *airq_iv_create...
2019 Jun 12
2
[PATCH v4 4/8] s390/airq: use DMA memory for adapter interrupts
...; bits > + || !airq_iv_cache) It's perhaps a bit more readable if you keep checking for airq_iv_cache on a separate if statement, but that's a matter of taste, I guess. > goto out_free; > > iv->vector = dma_pool_zalloc(airq_iv_cache, GFP_KERNEL, > @@ -186,7 +187,7 @@ struct airq_iv *airq_iv_create(unsigned long bits, unsigned long flags) > kfree(iv->ptr); > kfree(iv->bitlock); > kfree(iv->avail); > - if (iv->flags & AIRQ_IV_CACHELINE) > + if (i...
2019 Jun 12
2
[PATCH v4 4/8] s390/airq: use DMA memory for adapter interrupts
...; bits > + || !airq_iv_cache) It's perhaps a bit more readable if you keep checking for airq_iv_cache on a separate if statement, but that's a matter of taste, I guess. > goto out_free; > > iv->vector = dma_pool_zalloc(airq_iv_cache, GFP_KERNEL, > @@ -186,7 +187,7 @@ struct airq_iv *airq_iv_create(unsigned long bits, unsigned long flags) > kfree(iv->ptr); > kfree(iv->bitlock); > kfree(iv->avail); > - if (iv->flags & AIRQ_IV_CACHELINE) > + if (i...
2019 Jun 12
21
[PATCH v5 0/8] s390: virtio: support protected virtualization
Enhanced virtualization protection technology may require the use of bounce buffers for I/O. While support for this was built into the virtio core, virtio-ccw wasn't changed accordingly. Some background on technology (not part of this series) and the terminology used. * Protected Virtualization (PV): Protected Virtualization guarantees, that non-shared memory of a guest that operates in PV
2019 Jun 12
21
[PATCH v5 0/8] s390: virtio: support protected virtualization
Enhanced virtualization protection technology may require the use of bounce buffers for I/O. While support for this was built into the virtio core, virtio-ccw wasn't changed accordingly. Some background on technology (not part of this series) and the terminology used. * Protected Virtualization (PV): Protected Virtualization guarantees, that non-shared memory of a guest that operates in PV
2019 Jun 06
15
[PATCH v4 0/8] s390: virtio: support protected virtualization
Enhanced virtualization protection technology may require the use of bounce buffers for I/O. While support for this was built into the virtio core, virtio-ccw wasn't changed accordingly. Some background on technology (not part of this series) and the terminology used. * Protected Virtualization (PV): Protected Virtualization guarantees, that non-shared memory of a guest that operates in PV
2019 Jun 06
15
[PATCH v4 0/8] s390: virtio: support protected virtualization
Enhanced virtualization protection technology may require the use of bounce buffers for I/O. While support for this was built into the virtio core, virtio-ccw wasn't changed accordingly. Some background on technology (not part of this series) and the terminology used. * Protected Virtualization (PV): Protected Virtualization guarantees, that non-shared memory of a guest that operates in PV
2019 May 29
16
[PATCH v3 0/8] s390: virtio: support protected virtualization
Enhanced virtualization protection technology may require the use of bounce buffers for I/O. While support for this was built into the virtio core, virtio-ccw wasn't changed accordingly. Some background on technology (not part of this series) and the terminology used. * Protected Virtualization (PV): Protected Virtualization guarantees, that non-shared memory of a guest that operates in PV
2019 May 23
18
[PATCH v2 0/8] s390: virtio: support protected virtualization
Enhanced virtualization protection technology may require the use of bounce buffers for I/O. While support for this was built into the virtio core, virtio-ccw wasn't changed accordingly. Some background on technology (not part of this series) and the terminology used. * Protected Virtualization (PV): Protected Virtualization guarantees, that non-shared memory of a guest that operates in PV