From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Alexander Graf <agraf@suse.de>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Gleb Natapov <gleb@redhat.com>, KVM <kvm@vger.kernel.org>,
linux-s390 <linux-s390@vger.kernel.org>,
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/4] KVM: s390: Add a channel I/O based virtio transport driver.
Date: Wed, 12 Dec 2012 21:12:26 +0100 [thread overview]
Message-ID: <50C8E52A.1@de.ibm.com> (raw)
In-Reply-To: <50C8CD8F.2000909@suse.de>
On 12/12/12 19:31, Alexander Graf wrote:
+static inline long do_kvm_notify(struct subchannel_id schid,
>> + unsigned long queue_index)
>> +{
>> + register unsigned long __nr asm("1") = KVM_S390_VIRTIO_CCW_NOTIFY;
>> + register struct subchannel_id __schid asm("2") = schid;
>
> How does the compiler know that the struct fits within a register?
>
Well it knows that sizeof struct subchannel_id is 4.
then we have
"ELF Application Binary Interface Supplement Linux on zSeries"
[...]
Parameter passing
[...]
- Structures with a size of 1, 2, 4, or 8 bytes are passed as integral values. <=============
- All other structures are passed by reference. If needed, the called function makes
a copy of the value.
[...]
while not being a perfect match it gives a good indication that this will work.
Furthermore, we know it is working at least since
commit 94c12cc7d196bab34aaa98d38521549fa1e5ef76
Author: Martin Schwidefsky <schwidefsky@de.ibm.com>
Date: Thu Sep 28 16:56:43 2006 +0200
[S390] Inline assembly cleanup.
in
drivers/s390/cio/ioasm.h
[...]
94c12cc7 (Martin Schwidefsky 2006-09-28 16:56:43 +0200 30) register struct subchannel_id reg1 asm ("1") = schid;
94c12cc7 (Martin Schwidefsky 2006-09-28 16:56:43 +0200 31) int ccode = -EIO;
fb6958a5 (Cornelia Huck 2006-01-06 00:19:25 -0800 32)
94c12cc7 (Martin Schwidefsky 2006-09-28 16:56:43 +0200 33) asm volatile(
[...]
So this complies with the coding style of the s390 maintainer :-)
Christian
next prev parent reply other threads:[~2012-12-12 20:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-12 16:36 [PATCH v4 0/4] s390: Guest support for virtio-ccw Cornelia Huck
2012-12-12 16:36 ` [PATCH 1/4] KVM: s390: Handle hosts not supporting s390-virtio Cornelia Huck
2012-12-12 16:36 ` [PATCH 2/4] s390: Move css limits from drivers/s390/cio/ to include/asm/ Cornelia Huck
2012-12-12 16:36 ` [PATCH 3/4] s390: Add a mechanism to get the subchannel id Cornelia Huck
2012-12-12 16:36 ` [PATCH 4/4] KVM: s390: Add a channel I/O based virtio transport driver Cornelia Huck
2012-12-12 18:31 ` Alexander Graf
2012-12-12 20:12 ` Christian Borntraeger [this message]
2012-12-13 11:06 ` Alexander Graf
2012-12-13 11:13 ` Christian Borntraeger
2012-12-13 11:19 ` Alexander Graf
2012-12-13 16:08 ` Christian Borntraeger
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=50C8E52A.1@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=agraf@suse.de \
--cc=cornelia.huck@de.ibm.com \
--cc=cotte@de.ibm.com \
--cc=gleb@redhat.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).