All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Andy Lutomirski <luto@kernel.org>,
	Sebastian Ott <sebott@linux.vnet.ibm.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Christoph Hellwig <hch@lst.de>,
	benh@kernel.crashing.org, KVM <kvm@vger.kernel.org>,
	dwmw2@infradead.org, Joerg Roedel <jroedel@suse.de>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	linux-s390 <linux-s390@vger.kernel.org>
Subject: Re: [PATCH 4/4] s390/virtio: use noop dma ops
Date: Fri, 30 Oct 2015 13:26:09 +0100	[thread overview]
Message-ID: <563361E1.2040605@de.ibm.com> (raw)
In-Reply-To: <20151030131746.49f6b129.cornelia.huck@de.ibm.com>

Am 30.10.2015 um 13:17 schrieb Cornelia Huck:
> On Tue, 27 Oct 2015 23:48:51 +0100
> Christian Borntraeger <borntraeger@de.ibm.com> wrote:
> 
>> With all infrastructure in place, lets provide dma_ops for virtio
>> devices on s390.
>>
>> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
>> ---
>>  drivers/s390/virtio/kvm_virtio.c | 2 ++
>>  drivers/s390/virtio/virtio_ccw.c | 2 ++
>>  2 files changed, 4 insertions(+)
>>
>> diff --git a/drivers/s390/virtio/kvm_virtio.c b/drivers/s390/virtio/kvm_virtio.c
>> index 53fb975..05adaa9 100644
>> --- a/drivers/s390/virtio/kvm_virtio.c
>> +++ b/drivers/s390/virtio/kvm_virtio.c
>> @@ -13,6 +13,7 @@
>>  #include <linux/kernel_stat.h>
>>  #include <linux/init.h>
>>  #include <linux/bootmem.h>
>> +#include <linux/dma-mapping.h>
>>  #include <linux/err.h>
>>  #include <linux/virtio.h>
>>  #include <linux/virtio_config.h>
>> @@ -318,6 +319,7 @@ static void add_kvm_device(struct kvm_device_desc *d, unsigned int offset)
>>  		return;
>>  	}
>>
>> +	kdev->vdev.dev.archdata.dma_ops = &dma_noop_ops;
> 
> This provides dma_ops for the vdev, while Andy's virtio code looks for
> dma_ops in the vdev's parent (in the ccw and pci cases, the proxy
> device; in this case, it would be our root device).
> 
> With
> 
> diff --git a/drivers/s390/virtio/kvm_virtio.c b/drivers/s390/virtio/kvm_virtio.c
> index 05adaa9..5f79c52 100644
> --- a/drivers/s390/virtio/kvm_virtio.c
> +++ b/drivers/s390/virtio/kvm_virtio.c
> @@ -319,7 +319,6 @@ static void add_kvm_device(struct kvm_device_desc *d, unsigned int offset)
>  		return;
>  	}
> 
> -	kdev->vdev.dev.archdata.dma_ops = &dma_noop_ops;
>  	kdev->vdev.dev.parent = kvm_root;
>  	kdev->vdev.id.device = d->type;
>  	kdev->vdev.config = &kvm_vq_configspace_ops;
> @@ -473,6 +472,7 @@ static int __init kvm_devices_init(void)
>  		vmem_remove_mapping(total_memory_size, PAGE_SIZE);
>  		return rc;
>  	}
> +	kvm_root->archdata.dma_ops = &dma_noop_ops;
> 
>  	INIT_WORK(&hotplug_work, hotplug_devices);
> 
> applied (and the endianness fix in the virtio code), I can boot a
> s390-virtio guest as well.

I am currently reworking this to 

 static inline struct dma_map_ops *get_dma_ops(struct device *dev)
 {
	if (dev && dev->archdata.dma_ops)
		return dev->archdata.dma_ops;
	return &dma_noop_ops;
 }


Which uses the dma_noop_ops for everything unless the device overrides (PCI does)

  reply	other threads:[~2015-10-30 12:26 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-27 22:48 [PATCH/RFC 0/4] dma ops and virtio Christian Borntraeger
2015-10-27 22:48 ` [PATCH 1/4] Provide simple noop dma ops Christian Borntraeger
2015-10-28  0:41   ` Joerg Roedel
2015-10-30 12:55     ` Christian Borntraeger
2015-10-30 14:45       ` Joerg Roedel
2015-10-27 22:48 ` [PATCH 2/4] alpha: use common " Christian Borntraeger
2015-10-27 22:48 ` [PATCH 3/4] s390/dma: Allow per device " Christian Borntraeger
2015-10-27 22:48 ` [PATCH 4/4] s390/virtio: use noop " Christian Borntraeger
2015-10-28  0:43   ` Joerg Roedel
2015-10-28  8:44     ` Cornelia Huck
2015-10-30 12:56     ` Christian Borntraeger
2015-10-30 12:17   ` Cornelia Huck
2015-10-30 12:26     ` Christian Borntraeger [this message]
2015-10-30 12:32       ` Cornelia Huck
2015-10-28  0:45 ` [PATCH/RFC 0/4] dma ops and virtio Joerg Roedel
2015-10-28 22:22 ` Andy Lutomirski
2015-10-29  0:04   ` Christian Borntraeger
2015-10-29 22:50     ` Andy Lutomirski
2015-10-30  8:25       ` Cornelia Huck
2015-10-30 20:33         ` Andy Lutomirski
2015-11-02 11:16           ` Cornelia Huck
2015-11-02 20:23             ` Andy Lutomirski
2015-11-03  8:14               ` Christian Borntraeger
2015-11-03 17:54                 ` Andy Lutomirski
2015-11-03 17:59               ` Cornelia Huck
2015-11-03 18:45                 ` Andy Lutomirski
2015-11-04 14:29                   ` Cornelia Huck
2015-11-04 17:52                     ` Cornelia Huck
2015-11-04 18:14                       ` Andy Lutomirski
2015-11-05  8:11                         ` Cornelia Huck
2015-11-12  7:56                           ` Cornelia Huck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=563361E1.2040605@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=cornelia.huck@de.ibm.com \
    --cc=dwmw2@infradead.org \
    --cc=hch@lst.de \
    --cc=jroedel@suse.de \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=schwidefsky@de.ibm.com \
    --cc=sebott@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.