qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: Alexander Graf <agraf@suse.de>
Cc: linux-s390 <linux-s390@vger.kernel.org>,
	Anthony Liguori <aliguori@us.ibm.com>, KVM <kvm@vger.kernel.org>,
	Gleb Natapov <gleb@redhat.com>, Carsten Otte <cotte@de.ibm.com>,
	Sebastian Ott <sebott@linux.vnet.ibm.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: Re: [Qemu-devel] [PATCH 2/8] s390: Channel I/O basic defintions.
Date: Tue, 11 Dec 2012 13:48:10 +0100	[thread overview]
Message-ID: <20121211134810.1a36d4b5@BR9GNB5Z> (raw)
In-Reply-To: <B18B4650-430D-4E1A-AA3A-186383886D39@suse.de>

On Tue, 11 Dec 2012 11:27:05 +0100
Alexander Graf <agraf@suse.de> wrote:

> 
> On 10.12.2012, at 11:18, Cornelia Huck wrote:
> 
> > On Mon, 10 Dec 2012 09:07:57 +0100
> > Alexander Graf <agraf@suse.de> wrote:
> > 
> >> 
> >> On 07.12.2012, at 13:50, Cornelia Huck wrote:
> >> 
> >>> Basic channel I/O structures and helper function.
> >>> 
> >>> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
> >>> ---
> >>> target-s390x/Makefile.objs |   2 +-
> >>> target-s390x/ioinst.c      |  46 ++++++++++
> >>> target-s390x/ioinst.h      | 207 +++++++++++++++++++++++++++++++++++++++++++++
> >>> 3 files changed, 254 insertions(+), 1 deletion(-)
> >>> create mode 100644 target-s390x/ioinst.c
> >>> create mode 100644 target-s390x/ioinst.h
> >>> 
> >>> diff --git a/target-s390x/Makefile.objs b/target-s390x/Makefile.objs
> >>> index e728abf..3afb0b7 100644
> >>> --- a/target-s390x/Makefile.objs
> >>> +++ b/target-s390x/Makefile.objs
> >>> @@ -1,4 +1,4 @@
> >>> obj-y += translate.o helper.o cpu.o interrupt.o
> >>> obj-y += int_helper.o fpu_helper.o cc_helper.o mem_helper.o misc_helper.o
> >>> -obj-$(CONFIG_SOFTMMU) += machine.o
> >>> +obj-$(CONFIG_SOFTMMU) += machine.o ioinst.o
> >>> obj-$(CONFIG_KVM) += kvm.o
> >>> diff --git a/target-s390x/ioinst.c b/target-s390x/ioinst.c
> >>> new file mode 100644
> >>> index 0000000..8577b2c
> >>> --- /dev/null
> >>> +++ b/target-s390x/ioinst.c
> >>> @@ -0,0 +1,46 @@
> >>> +/*
> >>> + * I/O instructions for S/390
> >>> + *
> >>> + * Copyright 2012 IBM Corp.
> >>> + * Author(s): Cornelia Huck <cornelia.huck@de.ibm.com>
> >>> + *
> >>> + * This work is licensed under the terms of the GNU GPL, version 2 or (at
> >>> + * your option) any later version. See the COPYING file in the top-level
> >>> + * directory.
> >>> + */
> >>> +
> >>> +#include <sys/types.h>
> >>> +#include <sys/ioctl.h>
> >>> +#include <sys/mman.h>
> >>> +
> >>> +#include "cpu.h"
> >>> +#include "ioinst.h"
> >>> +
> >>> +#ifdef DEBUG_IOINST
> >>> +#define dprintf(fmt, ...) \
> >>> +    do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
> >>> +#else
> >>> +#define dprintf(fmt, ...) \
> >>> +    do { } while (0)
> >>> +#endif
> >>> +
> >>> +int ioinst_disassemble_sch_ident(uint32_t value, int *m, int *cssid, int *ssid,
> >>> +                                 int *schid)
> >>> +{
> >>> +    if (!(value & IOINST_SCHID_ONE)) {
> >>> +        return -EINVAL;
> >>> +    }
> >>> +    if (!(value & IOINST_SCHID_M)) {
> >>> +        if (value & IOINST_SCHID_CSSID) {
> >>> +            return -EINVAL;
> >>> +        }
> >>> +        *cssid = 0;
> >>> +        *m = 0;
> >>> +    } else {
> >>> +        *cssid = (value & IOINST_SCHID_CSSID) >> 24;
> >> 
> >> (value & IOINST_SCHID_CSSID_MASK) >> IOINST_SCHID_CSSID_SHIFT
> > 
> > I think that actually decreases readability.
> 
> I'm fine with doing it Jocelyn-style too:
> 
> #define IOINST_SCHID_CSSID(x) ((x & 0x...) >> 24)
> 
> if you prefer that for readability :)

It's worth a try.

  reply	other threads:[~2012-12-11 12:48 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-07 12:50 [Qemu-devel] [RFC PATCH v4 0/8] s390: channel I/O support in qemu Cornelia Huck
2012-12-07 12:50 ` [Qemu-devel] [PATCH 1/8] Update linux headers Cornelia Huck
2012-12-07 13:01   ` Peter Maydell
2012-12-07 14:08     ` Cornelia Huck
2012-12-07 12:50 ` [Qemu-devel] [PATCH 2/8] s390: Channel I/O basic defintions Cornelia Huck
2012-12-10  8:07   ` Alexander Graf
2012-12-10 10:18     ` Cornelia Huck
2012-12-11 10:27       ` Alexander Graf
2012-12-11 12:48         ` Cornelia Huck [this message]
2012-12-07 12:50 ` [Qemu-devel] [PATCH 3/8] s390: I/O interrupt and machine check injection Cornelia Huck
2012-12-10  8:20   ` Alexander Graf
2012-12-10 10:27     ` Cornelia Huck
2012-12-11  0:26       ` Rob Landley
2012-12-11 12:17         ` Cornelia Huck
2012-12-11 10:29       ` Alexander Graf
2012-12-11 12:50         ` Cornelia Huck
2012-12-07 12:50 ` [Qemu-devel] [PATCH 4/8] s390: Add channel I/O instructions Cornelia Huck
2012-12-10  9:00   ` Alexander Graf
2012-12-10  9:18     ` Cornelia Huck
2012-12-11 10:18       ` Alexander Graf
2012-12-11 12:53         ` Cornelia Huck
2012-12-07 12:50 ` [Qemu-devel] [PATCH 5/8] s390: Virtual channel subsystem support Cornelia Huck
2012-12-07 12:50 ` [Qemu-devel] [PATCH 6/8] s390: Wire up channel I/O in kvm Cornelia Huck
2012-12-10  9:40   ` Alexander Graf
2012-12-10 10:29     ` Cornelia Huck
2012-12-07 12:50 ` [Qemu-devel] [PATCH 7/8] s390-virtio: Factor out some initialization code Cornelia Huck
2012-12-07 12:50 ` [Qemu-devel] [PATCH 8/8] s390: Add new channel I/O based virtio transport Cornelia Huck
2012-12-11 10:53   ` Alexander Graf
2012-12-11 12:06     ` Christian Borntraeger
2012-12-12  0:38       ` Alexander Graf
2012-12-11 13:03     ` Cornelia Huck
2012-12-12  0:39       ` Alexander Graf
2013-01-16 13:24   ` Alexander Graf
2013-01-16 13:53     ` Alexander Graf
2013-01-16 13:58       ` Cornelia Huck
2013-01-16 16:46     ` Richard Henderson
2013-01-16 17:05       ` Alexander Graf
2012-12-10  8:02 ` [Qemu-devel] [RFC PATCH v4 0/8] s390: channel I/O support in qemu Alexander Graf
2012-12-10 10:34   ` 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=20121211134810.1a36d4b5@BR9GNB5Z \
    --to=cornelia.huck@de.ibm.com \
    --cc=agraf@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=borntraeger@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=qemu-devel@nongnu.org \
    --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).