qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
To: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>,
	kvm@vger.kernel.org, linux-s390@vger.kernel.org,
	qemu-devel@nongnu.org, borntraeger@de.ibm.com, agraf@suse.com,
	alex.williamson@redhat.com, eric.auger@redhat.com,
	Xiao Feng Ren <renxiaof@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH v7 04/13] s390x/css: realize css_sch_build_schib
Date: Mon, 8 May 2017 11:07:43 +0800	[thread overview]
Message-ID: <20170508030743.GB15974@bjsdjshi@linux.vnet.ibm.com> (raw)
In-Reply-To: <20170505140420.097febf7.cornelia.huck@de.ibm.com>

* Cornelia Huck <cornelia.huck@de.ibm.com> [2017-05-05 14:04:20 +0200]:

> On Fri,  5 May 2017 04:03:43 +0200
> Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com> wrote:
> 
> > From: Xiao Feng Ren <renxiaof@linux.vnet.ibm.com>
> > 
> > The S390 virtual css support already has a mechanism to build virtual
> > Sub-Channel Information Block and provide virtual subchannels to the
> 
> "to build a virtual subchannel information block (schib) and provide..."
> 
Ok.

> > guest. However, to pass-through subchannels to a guest, we need to
> > introduce a new mechanism to build its schib according to the real
> > device information. Thus we realize a new css_sch_build_schib function
> > to extract the path_masks, chpids, chpid type from sysfs. To reuse
> > the existing code, we refactor css_add_virtual_chpid to css_add_chpid.
> > 
> > Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
> > Signed-off-by: Xiao Feng Ren <renxiaof@linux.vnet.ibm.com>
> > Signed-off-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
> > ---
> >  hw/s390x/css.c         | 153 ++++++++++++++++++++++++++++++++++++++++++++++++-
> >  include/hw/s390x/css.h |  36 ++++++------
> >  2 files changed, 169 insertions(+), 20 deletions(-)
> > 
> 
> > +/*
> > + * We currently retrieve the real device information from sysfs to build the
> > + * guest subchannel information block without considering the migration feature.
> > + * If migrate, it won't be sure to use the real device information directly,
> > + * this point will be handled in the future.
> 
> Let's make the second sentence: "We need to revisit this problem when
> we want to add migration support."
> 
Ok.

> > + */
> > +int css_sch_build_schib(SubchDev *sch, CssDevId *dev_id)
> > +{
> > +    CssImage *css = channel_subsys.css[sch->cssid];
> > +    PMCW *p = &sch->curr_status.pmcw;
> > +    SCSW *s = &sch->curr_status.scsw;
> > +    uint32_t type;
> > +    int i, ret;
> > +
> > +    /* We are dealing with I/O subchannels only. */
> 
> Let's move this comment directly before setting dnv; it's a bit
> confusing here.
> 
Ok. I will move it to ...

> > +    assert(css != NULL);
> > +    memset(p, 0, sizeof(PMCW));
> > +    p->flags |= PMCW_FLAGS_MASK_DNV;
... here.

> > +    p->devno = sch->devno;
> > +
> > +    /* Grab path mask from sysfs. */
> > +    ret = css_sch_get_path_masks(sch, dev_id);
> > +    if (ret) {
> > +        return ret;
> > +    }
> > +
> > +    /* Grab chpids from sysfs. */
> > +    ret = css_sch_get_chpids(sch, dev_id);
> > +    if (ret) {
> > +        return ret;
> > +    }
> > +
> > +   /* Build chpid type. */
> > +    for (i = 0; i < ARRAY_SIZE(p->chpid); i++) {
> > +        if (p->chpid[i] && !css->chpids[p->chpid[i]].in_use) {
> > +            ret = css_sch_get_chpid_type(p->chpid[i], &type, dev_id);
> > +            if (ret) {
> > +                return ret;
> > +            }
> > +            css_add_chpid(sch->cssid, p->chpid[i], type, false);
> > +        }
> > +    }
> > +
> > +    memset(s, 0, sizeof(SCSW));
> > +    sch->curr_status.mba = 0;
> > +    for (i = 0; i < ARRAY_SIZE(sch->curr_status.mda); i++) {
> > +        sch->curr_status.mda[i] = 0;
> > +    }
> > +
> > +    return 0;
> > +}
[...]

-- 
Dong Jia Shi

  reply	other threads:[~2017-05-08  3:07 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-05  2:03 [Qemu-devel] [PATCH v7 00/13] basic channel IO passthrough infrastructure based on vfio Dong Jia Shi
2017-05-05  2:03 ` [Qemu-devel] [PATCH v7 01/13] update-linux-headers: update for vfio-ccw Dong Jia Shi
2017-05-05  2:03 ` [Qemu-devel] [PATCH v7 02/13] vfio: linux-headers " Dong Jia Shi
2017-05-05  2:03 ` [Qemu-devel] [PATCH v7 03/13] s390x/css: add s390-squash-mcss machine option Dong Jia Shi
2017-05-05  2:03 ` [Qemu-devel] [PATCH v7 04/13] s390x/css: realize css_sch_build_schib Dong Jia Shi
2017-05-05 12:04   ` Cornelia Huck
2017-05-08  3:07     ` Dong Jia Shi [this message]
2017-05-05  2:03 ` [Qemu-devel] [PATCH v7 05/13] s390x/css: realize css_create_sch Dong Jia Shi
2017-05-05 12:11   ` Cornelia Huck
2017-05-08  5:18     ` Dong Jia Shi
2017-05-08 10:50       ` Cornelia Huck
2017-05-09  1:38         ` Dong Jia Shi
2017-05-05  2:03 ` [Qemu-devel] [PATCH v7 06/13] s390x/css: device support for s390-ccw passthrough Dong Jia Shi
2017-05-09  8:18   ` Auger Eric
2017-05-11 21:13   ` Alex Williamson
2017-05-15  2:22     ` Dong Jia Shi
2017-05-05  2:03 ` [Qemu-devel] [PATCH v7 07/13] vfio/ccw: vfio based subchannel passthrough driver Dong Jia Shi
2017-05-09  8:19   ` Auger Eric
2017-05-11 21:48   ` Alex Williamson
2017-05-05  2:03 ` [Qemu-devel] [PATCH v7 08/13] vfio/ccw: get io region info Dong Jia Shi
2017-05-09  8:20   ` Auger Eric
2017-05-11 21:48   ` Alex Williamson
2017-05-05  2:03 ` [Qemu-devel] [PATCH v7 09/13] vfio/ccw: get irqs info and set the eventfd fd Dong Jia Shi
2017-05-09  8:21   ` Auger Eric
2017-05-09  8:35     ` Dong Jia Shi
2017-05-11 21:49   ` Alex Williamson
2017-05-15  2:31     ` Dong Jia Shi
2017-05-15  2:35       ` Dong Jia Shi
2017-05-05  2:03 ` [Qemu-devel] [PATCH v7 10/13] s390x/css: introduce and realize ccw-request callback Dong Jia Shi
2017-05-11 21:49   ` Alex Williamson
2017-05-05  2:03 ` [Qemu-devel] [PATCH v7 11/13] s390x/css: ccw translation infrastructure Dong Jia Shi
2017-05-05  2:03 ` [Qemu-devel] [PATCH v7 12/13] vfio/ccw: update sense data if a unit check is pending Dong Jia Shi
2017-05-11 21:49   ` Alex Williamson
2017-05-05  2:03 ` [Qemu-devel] [PATCH v7 13/13] MAINTAINERS: Add vfio-ccw maintainer Dong Jia Shi
2017-05-05 12:20   ` Cornelia Huck
2017-05-08  5:29     ` Dong Jia Shi
2017-05-08  9:09       ` Cornelia Huck
2017-05-09  1:41         ` Dong Jia Shi
2017-05-09  7:33           ` Cornelia Huck
2017-05-11 21:49   ` Alex Williamson
2017-05-05 12:22 ` [Qemu-devel] [PATCH v7 00/13] basic channel IO passthrough infrastructure based on vfio Cornelia Huck
2017-05-08  5:31   ` Dong Jia Shi

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=20170508030743.GB15974@bjsdjshi@linux.vnet.ibm.com \
    --to=bjsdjshi@linux.vnet.ibm.com \
    --cc=agraf@suse.com \
    --cc=alex.williamson@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=eric.auger@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    --cc=renxiaof@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).