Cornelia Huck
2019-May-27 12:00 UTC
[PATCH v2 8/8] virtio/s390: make airq summary indicators DMA
On Thu, 23 May 2019 18:22:09 +0200 Michael Mueller <mimu at linux.ibm.com> wrote:> From: Halil Pasic <pasic at linux.ibm.com> > > Hypervisor needs to interact with the summary indicators, so these > need to be DMA memory as well (at least for protected virtualization > guests). > > Signed-off-by: Halil Pasic <pasic at linux.ibm.com> > --- > drivers/s390/virtio/virtio_ccw.c | 22 +++++++++++++++------- > 1 file changed, 15 insertions(+), 7 deletions(-)(...)> @@ -1501,6 +1508,7 @@ static int __init virtio_ccw_init(void) > { > /* parse no_auto string before we do anything further */ > no_auto_parse(); > + summary_indicators = cio_dma_zalloc(MAX_AIRQ_AREAS);What happens if this fails?> return ccw_driver_register(&virtio_ccw_driver); > } > device_initcall(virtio_ccw_init);
Halil Pasic
2019-May-28 14:33 UTC
[PATCH v2 8/8] virtio/s390: make airq summary indicators DMA
On Mon, 27 May 2019 14:00:18 +0200 Cornelia Huck <cohuck at redhat.com> wrote:> On Thu, 23 May 2019 18:22:09 +0200 > Michael Mueller <mimu at linux.ibm.com> wrote: > > > From: Halil Pasic <pasic at linux.ibm.com> > > > > Hypervisor needs to interact with the summary indicators, so these > > need to be DMA memory as well (at least for protected virtualization > > guests). > > > > Signed-off-by: Halil Pasic <pasic at linux.ibm.com> > > --- > > drivers/s390/virtio/virtio_ccw.c | 22 +++++++++++++++------- > > 1 file changed, 15 insertions(+), 7 deletions(-) > > (...) > > > @@ -1501,6 +1508,7 @@ static int __init virtio_ccw_init(void) > > { > > /* parse no_auto string before we do anything further */ > > no_auto_parse(); > > + summary_indicators = cio_dma_zalloc(MAX_AIRQ_AREAS); > > What happens if this fails?Bad things could happen! How about adding if (!summary_indicators) virtio_ccw_use_airq = 0; /* fall back to classic */ ? Since it ain't very likely to happen, we could also just fail virtio_ccw_init() with -ENOMEM. Regards, Halil> > > return ccw_driver_register(&virtio_ccw_driver); > > } > > device_initcall(virtio_ccw_init); >
Cornelia Huck
2019-May-28 14:56 UTC
[PATCH v2 8/8] virtio/s390: make airq summary indicators DMA
On Tue, 28 May 2019 16:33:42 +0200 Halil Pasic <pasic at linux.ibm.com> wrote:> On Mon, 27 May 2019 14:00:18 +0200 > Cornelia Huck <cohuck at redhat.com> wrote: > > > On Thu, 23 May 2019 18:22:09 +0200 > > Michael Mueller <mimu at linux.ibm.com> wrote: > > > > > From: Halil Pasic <pasic at linux.ibm.com> > > > > > > Hypervisor needs to interact with the summary indicators, so these > > > need to be DMA memory as well (at least for protected virtualization > > > guests). > > > > > > Signed-off-by: Halil Pasic <pasic at linux.ibm.com> > > > --- > > > drivers/s390/virtio/virtio_ccw.c | 22 +++++++++++++++------- > > > 1 file changed, 15 insertions(+), 7 deletions(-) > > > > (...) > > > > > @@ -1501,6 +1508,7 @@ static int __init virtio_ccw_init(void) > > > { > > > /* parse no_auto string before we do anything further */ > > > no_auto_parse(); > > > + summary_indicators = cio_dma_zalloc(MAX_AIRQ_AREAS); > > > > What happens if this fails? > > Bad things could happen! > > How about adding > > if (!summary_indicators) > virtio_ccw_use_airq = 0; /* fall back to classic */ > > ? > > Since it ain't very likely to happen, we could also just fail > virtio_ccw_init() with -ENOMEM.How high are the chances of things working if we fail to allocate here? Returning with -ENOMEM is probably the more reasonable approach here.
Michael Mueller
2019-May-28 14:58 UTC
[PATCH v2 8/8] virtio/s390: make airq summary indicators DMA
On 28.05.19 16:33, Halil Pasic wrote:> On Mon, 27 May 2019 14:00:18 +0200 > Cornelia Huck <cohuck at redhat.com> wrote: > >> On Thu, 23 May 2019 18:22:09 +0200 >> Michael Mueller <mimu at linux.ibm.com> wrote: >> >>> From: Halil Pasic <pasic at linux.ibm.com> >>> >>> Hypervisor needs to interact with the summary indicators, so these >>> need to be DMA memory as well (at least for protected virtualization >>> guests). >>> >>> Signed-off-by: Halil Pasic <pasic at linux.ibm.com> >>> --- >>> drivers/s390/virtio/virtio_ccw.c | 22 +++++++++++++++------- >>> 1 file changed, 15 insertions(+), 7 deletions(-) >> >> (...) >> >>> @@ -1501,6 +1508,7 @@ static int __init virtio_ccw_init(void) >>> { >>> /* parse no_auto string before we do anything further */ >>> no_auto_parse(); >>> + summary_indicators = cio_dma_zalloc(MAX_AIRQ_AREAS); >> >> What happens if this fails? > > Bad things could happen! > > How about adding > > if (!summary_indicators) > virtio_ccw_use_airq = 0; /* fall back to classic */ > > ? > > Since it ain't very likely to happen, we could also just fail > virtio_ccw_init() with -ENOMEM.That is what I'm currently doing in v3.> > Regards, > Halil > > >> >>> return ccw_driver_register(&virtio_ccw_driver); >>> } >>> device_initcall(virtio_ccw_init); >> >Michael
Seemingly Similar Threads
- [PATCH v4 8/8] virtio/s390: make airq summary indicators DMA
- [PATCH v2 8/8] virtio/s390: make airq summary indicators DMA
- [PATCH v5 8/8] virtio/s390: make airq summary indicators DMA
- [PATCH v2 8/8] virtio/s390: make airq summary indicators DMA
- [PATCH v2 8/8] virtio/s390: make airq summary indicators DMA