Re: [PATCH 12/14] swiotlb: move global variables into a new io_tlb_mem structure

2021-03-17 Thread Konrad Rzeszutek Wilk
On Wed, Mar 17, 2021 at 06:57:42PM +0100, Christoph Hellwig wrote: > On Wed, Mar 17, 2021 at 01:51:56PM -0400, Konrad Rzeszutek Wilk wrote: > > On Wed, Mar 17, 2021 at 02:53:27PM +0100, Christoph Hellwig wrote: > > > On Wed, Mar 17, 2021 at 01:42:07PM +, Konrad Rzeszutek Wilk wrote: > > > > > -

Re: [PATCH 12/14] swiotlb: move global variables into a new io_tlb_mem structure

2021-03-17 Thread Christoph Hellwig
On Wed, Mar 17, 2021 at 01:51:56PM -0400, Konrad Rzeszutek Wilk wrote: > On Wed, Mar 17, 2021 at 02:53:27PM +0100, Christoph Hellwig wrote: > > On Wed, Mar 17, 2021 at 01:42:07PM +, Konrad Rzeszutek Wilk wrote: > > > > - alloc_size = PAGE_ALIGN(io_tlb_nslabs * sizeof(size_t)); > > > > -

Re: [PATCH 12/14] swiotlb: move global variables into a new io_tlb_mem structure

2021-03-17 Thread Konrad Rzeszutek Wilk
On Wed, Mar 17, 2021 at 02:53:27PM +0100, Christoph Hellwig wrote: > On Wed, Mar 17, 2021 at 01:42:07PM +, Konrad Rzeszutek Wilk wrote: > > > - alloc_size = PAGE_ALIGN(io_tlb_nslabs * sizeof(size_t)); > > > - io_tlb_alloc_size = memblock_alloc(alloc_size, PAGE_SIZE); > > > - if (!io_tlb_alloc_s

Re: [PATCH 12/14] swiotlb: move global variables into a new io_tlb_mem structure

2021-03-17 Thread Christoph Hellwig
On Wed, Mar 17, 2021 at 01:42:07PM +, Konrad Rzeszutek Wilk wrote: > > - alloc_size = PAGE_ALIGN(io_tlb_nslabs * sizeof(size_t)); > > - io_tlb_alloc_size = memblock_alloc(alloc_size, PAGE_SIZE); > > - if (!io_tlb_alloc_size) > > - panic("%s: Failed to allocate %zu bytes align=0x

Re: [PATCH 12/14] swiotlb: move global variables into a new io_tlb_mem structure

2021-03-17 Thread Konrad Rzeszutek Wilk
..snip.. > int __init swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int > verbose) > { ..snip.. > /* >* Allocate and initialize the free list array. This array is used >* to find contiguous free memory regions of size up to IO_TLB_SEGSIZE > - * between io_tlb

[PATCH 12/14] swiotlb: move global variables into a new io_tlb_mem structure

2021-02-28 Thread Christoph Hellwig
From: Claire Chang Added a new struct, io_tlb_mem, as the IO TLB memory pool descriptor and moved relevant global variables into that struct. This will be useful later to allow for restricted DMA pool. Signed-off-by: Claire Chang [hch: rebased] Signed-off-by: Christoph Hellwig --- drivers/xen