kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: Alexander Graf <agraf@suse.de>
Cc: Avi Kivity <avi@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>, KVM <kvm@vger.kernel.org>,
	linux-s390 <linux-s390@vger.kernel.org>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Carsten Otte <cotte@de.ibm.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Sebastian Ott <sebott@linux.vnet.ibm.com>
Subject: Re: [PATCH 4/5] KVM: s390: Add a channel I/O based virtio transport driver.
Date: Mon, 29 Oct 2012 19:34:47 +0100	[thread overview]
Message-ID: <20121029193447.05dad97b@BR9GNB5Z> (raw)
In-Reply-To: <D3058F7E-EB72-4749-AD52-485A1777CE17@suse.de>

On Mon, 29 Oct 2012 19:12:54 +0100
Alexander Graf <agraf@suse.de> wrote:

> 
> On 29.10.2012, at 14:07, Cornelia Huck wrote:

> > +static void virtio_ccw_kvm_notify(struct virtqueue *vq)
> > +{
> > +	struct virtio_ccw_vq_info *info = vq->priv;
> > +	struct virtio_ccw_device *vcdev;
> > +	struct subchannel_id schid;
> > +	__u32 reg2;
> > +
> > +	vcdev = to_vc_device(info->vq->vdev);
> > +	ccw_device_get_schid(vcdev->cdev, &schid);
> > +	reg2 = *(__u32 *)&schid;
> 
> That cast looks quite ugly. Can't you just access the field in there you need? Or if it's multiple fields do a union over them? Or assemble them by hand in C?

I think the cast looks less ugly than using a union to morph it around.
I want the schid with all fields filled out anyway, since this is what
identifies the subchannel.

> 
> > +	kvm_hypercall2(3 /* CCW_NOTIFY */, reg2, info->queue_index);
> 
> This wants to be a #define :)

Probably :)

> 
> > +}
> > +
> > +static int virtio_ccw_read_vq_conf(struct virtio_ccw_device *vcdev, int index)
> > +{
> > +	vcdev->config_block->index = index;
> > +	vcdev->ccw->cmd_code = CCW_CMD_READ_VQ_CONF;
> > +	vcdev->ccw->flags = 0;
> > +	vcdev->ccw->count = sizeof(struct vq_config_block);
> > +	vcdev->ccw->cda = (__u32)(unsigned long)(vcdev->config_block);
> 
> Is this casting a pointer to a u32? What if this is in highmem? Ah, I just saw the comment that ccw memory needs to be <2GB. Phew. Any plans to get rid of that limitation?

Well, we could do full-blown IDAW handling to get to 64bit addresses -
which would need a lot of extra code in the host. I doubt whether it
would be worth it.

(Well, we'll probably want IDAWs sometime in the future - I just think
it's overkill for those tiny snippets.)


  reply	other threads:[~2012-10-29 18:34 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-29 13:07 [PATCH 0/5] s390: Guest support for virtio-ccw Cornelia Huck
2012-10-29 13:07 ` [PATCH 1/5] KVM: s390: Handle hosts not supporting s390-virtio Cornelia Huck
2012-10-29 13:07 ` [PATCH 2/5] s390: Move css limits from drivers/s390/cio/ to include/asm/ Cornelia Huck
2012-10-29 13:07 ` [PATCH 3/5] s390: Add a mechanism to get the subchannel id Cornelia Huck
2012-10-29 13:07 ` [PATCH 4/5] KVM: s390: Add a channel I/O based virtio transport driver Cornelia Huck
2012-10-29 18:12   ` Alexander Graf
2012-10-29 18:34     ` Cornelia Huck [this message]
2012-10-29 18:37       ` Alexander Graf
2012-10-30 13:03         ` Cornelia Huck
2012-10-30 13:41           ` Alexander Graf
2012-10-30 14:00             ` Cornelia Huck
2012-10-30 14:05               ` Alexander Graf
2012-10-30 14:35                 ` Cornelia Huck
2012-10-30 15:11                   ` Alexander Graf
2012-10-29 13:07 ` [PATCH 5/5] KVM: s390: Split out early console code Cornelia Huck
2012-10-29 18:14   ` Alexander Graf
2012-10-30 12:59     ` Cornelia Huck
2012-10-30 13:43       ` Alexander Graf
2012-10-30 14:29         ` Cornelia Huck
2012-10-30 15:12           ` Alexander Graf
2012-10-30 15:35             ` Cornelia Huck
2012-10-30 15:42               ` Alexander Graf
2012-10-29 17:55 ` [PATCH 0/5] s390: Guest support for virtio-ccw Alexander Graf
2012-10-29 18:15   ` Cornelia Huck
2012-10-29 18:33     ` Alexander Graf
2012-10-30 13:04       ` Cornelia Huck
2012-10-30 13:43         ` Alexander Graf
  -- strict thread matches above, loose matches on Subject: below --
2012-12-07 12:29 [PATCH v3 " Cornelia Huck
2012-12-07 12:29 ` [PATCH 4/5] KVM: s390: Add a channel I/O based virtio transport driver 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=20121029193447.05dad97b@BR9GNB5Z \
    --to=cornelia.huck@de.ibm.com \
    --cc=agraf@suse.de \
    --cc=avi@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cotte@de.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mtosatti@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).