From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cornelia Huck Subject: Re: [PATCH v4 4/8] s390/airq: use DMA memory for adapter interrupts Date: Tue, 11 Jun 2019 12:17:21 +0200 Message-ID: <20190611121721.61bf09b4.cohuck@redhat.com> References: <20190606115127.55519-1-pasic@linux.ibm.com> <20190606115127.55519-5-pasic@linux.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20190606115127.55519-5-pasic@linux.ibm.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Halil Pasic Cc: Vasily Gorbik , linux-s390@vger.kernel.org, Thomas Huth , Claudio Imbrenda , kvm@vger.kernel.org, Sebastian Ott , "Michael S. Tsirkin" , Farhan Ali , Heiko Carstens , Eric Farman , virtualization@lists.linux-foundation.org, Christoph Hellwig , Christian Borntraeger , "Jason J. Herne" , Michael Mueller , Viktor Mihajlovski , Janosch Frank List-Id: virtualization@lists.linuxfoundation.org On Thu, 6 Jun 2019 13:51:23 +0200 Halil Pasic 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(). > > Signed-off-by: Halil Pasic > Reviewed-by: Sebastian Ott > --- > arch/s390/include/asm/airq.h | 2 ++ > drivers/s390/cio/airq.c | 32 ++++++++++++++++++++------------ > drivers/s390/cio/cio.h | 2 ++ > drivers/s390/cio/css.c | 1 + > 4 files changed, 25 insertions(+), 12 deletions(-) > (...) > @@ -295,12 +303,12 @@ unsigned long airq_iv_scan(struct airq_iv *iv, unsigned long start, > } > EXPORT_SYMBOL(airq_iv_scan); > > -static int __init airq_init(void) > +int __init airq_init(void) > { > - airq_iv_cache = kmem_cache_create("airq_iv_cache", cache_line_size(), > - cache_line_size(), 0, NULL); > + airq_iv_cache = dma_pool_create("airq_iv_cache", cio_get_dma_css_dev(), > + cache_line_size(), > + cache_line_size(), PAGE_SIZE); > if (!airq_iv_cache) > return -ENOMEM; Sorry about not noticing that in the last iteration; but you may return an error here if airq_iv_cache could not be allocated... > return 0; > } > -subsys_initcall(airq_init); (...) > diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c > index 6fc91d534af1..7901c8ed3597 100644 > --- a/drivers/s390/cio/css.c > +++ b/drivers/s390/cio/css.c > @@ -1182,6 +1182,7 @@ static int __init css_bus_init(void) > ret = cio_dma_pool_init(); > if (ret) > goto out_unregister_pmn; > + airq_init(); ...but don't check the return code here. Probably a pathological case, but shouldn't you handle that error as well? > css_init_done = 1; > > /* Enable default isc for I/O subchannels. */