Re: [PATCH v2 1/2] s390/cio: Convert ccw_io_region to pointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 21 Sep 2018 22:40:12 +0200
Eric Farman <farman@xxxxxxxxxxxxx> wrote:

> In the event that we want to change the layout of the ccw_io_region in the
> future[1], it might be easier to work with it as a pointer within the
> vfio_ccw_private struct rather than an embedded struct.
> 
> [1] https://patchwork.kernel.org/comment/22228541/
> 
> Signed-off-by: Eric Farman <farman@xxxxxxxxxxxxx>
> ---
>  drivers/s390/cio/vfio_ccw_drv.c     | 12 +++++++++++-
>  drivers/s390/cio/vfio_ccw_fsm.c     |  6 +++---
>  drivers/s390/cio/vfio_ccw_ops.c     |  4 ++--
>  drivers/s390/cio/vfio_ccw_private.h |  2 +-
>  4 files changed, 17 insertions(+), 7 deletions(-)
> 

> @@ -114,6 +114,14 @@ static int vfio_ccw_sch_probe(struct subchannel *sch)
>  	private = kzalloc(sizeof(*private), GFP_KERNEL | GFP_DMA);
>  	if (!private)
>  		return -ENOMEM;
> +
> +	private->io_region = kzalloc(sizeof(*private->io_region),
> +				     GFP_KERNEL | GFP_DMA);

Any particular reason for this to be under 2G? Looking through the
code, I did not spot a place where we feed things in there directly to
an interface that is 2G sensitive.

I'm inclined to just keep it for now (as the structure it was taken
from was also allocated below 2G), but this might be a remainder of the
original implementation that was not using idals (and we might be able
to get rid of GFP_DMA here).

But maybe I'm just missing coffee :)

> +	if (!private->io_region) {
> +		kfree(private);
> +		return -ENOMEM;
> +	}
> +
>  	private->sch = sch;
>  	dev_set_drvdata(&sch->dev, private);
>  



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux