From: Cornelia Huck <cohuck@redhat.com>
To: Eric Farman <farman@linux.ibm.com>
Cc: Halil Pasic <pasic@linux.ibm.com>,
Jason Herne <jjherne@linux.ibm.com>,
qemu-s390x@nongnu.org, qemu-devel@nongnu.org,
Jared Rossi <jrossi@linux.ibm.com>
Subject: Re: [PATCH v4 3/6] vfio-ccw: Add support for the schib region
Date: Wed, 6 May 2020 17:56:56 +0200 [thread overview]
Message-ID: <20200506175656.53f60dc1.cohuck@redhat.com> (raw)
In-Reply-To: <20200505125757.98209-4-farman@linux.ibm.com>
On Tue, 5 May 2020 14:57:54 +0200
Eric Farman <farman@linux.ibm.com> wrote:
> From: Farhan Ali <alifm@linux.ibm.com>
>
> The schib region can be used to obtain the latest SCHIB from the host
> passthrough subchannel. Since the guest SCHIB is virtualized,
> we currently only update the path related information so that the
> guest is aware of any path related changes when it issues the
> 'stsch' instruction.
>
> Signed-off-by: Farhan Ali <alifm@linux.ibm.com>
> Signed-off-by: Eric Farman <farman@linux.ibm.com>
> ---
>
> Notes:
> v1->v2:
> - Remove silly variable intialization, and add a block comment,
> to css_do_stsch() [CH]
> - Add a TODO statement to s390_ccw_store(), for myself to sort
> out while we go over kernel code more closely [CH/EF]
> - In vfio_ccw_handle_store(),
> - Set schib pointer once region is determined to be non-NULL [CH]
> - Return cc=0 if pread() fails, and log an error [CH]
>
> v0->v1: [EF]
> - Change various incarnations of "update chp status" to
> "handle_store", to reflect the STSCH instruction that will
> drive this code
> - Remove temporary variable for casting/testing purposes in
> s390_ccw_store(), and add a block comment of WHY its there.
> - Add a few comments to vfio_ccw_handle_store()
>
> hw/s390x/css.c | 13 ++++++--
> hw/s390x/s390-ccw.c | 21 +++++++++++++
> hw/vfio/ccw.c | 63 +++++++++++++++++++++++++++++++++++++
> include/hw/s390x/css.h | 3 +-
> include/hw/s390x/s390-ccw.h | 1 +
> target/s390x/ioinst.c | 3 +-
> 6 files changed, 99 insertions(+), 5 deletions(-)
>
(...)
>
> +static IOInstEnding vfio_ccw_handle_store(SubchDev *sch)
> +{
> + S390CCWDevice *cdev = sch->driver_data;
> + VFIOCCWDevice *vcdev = DO_UPCAST(VFIOCCWDevice, cdev, cdev);
> + SCHIB *schib = &sch->curr_status;
> + struct ccw_schib_region *region = vcdev->schib_region;
> + SCHIB *s;
> + int ret;
> +
> + /* schib region not available so nothing else to do */
> + if (!region) {
> + return IOINST_CC_EXPECTED;
> + }
> +
> + memset(region, 0, sizeof(*region));
> + ret = pread(vcdev->vdev.fd, region, vcdev->schib_region_size,
> + vcdev->schib_region_offset);
> +
> + if (ret == -1) {
> + /*
> + * Device is probably damaged, but store subchannel does not
> + * have a nonzero cc defined for this scenario. Log an error,
> + * and presume things are otherwise fine.
One thing we might do is set the device number valid bit to 0 in our
local copy and inject a (subchannel) crw. Maybe as a patch on top later.
> + */
> + error_report("vfio-ccw: store region read failed with errno=%d", errno);
> + return IOINST_CC_EXPECTED;
> + }
> +
> + /*
> + * Selectively copy path-related bits of the SCHIB,
> + * rather than copying the entire struct.
> + */
> + s = (SCHIB *)region->schib_area;
> + schib->pmcw.pnom = s->pmcw.pnom;
> + schib->pmcw.lpum = s->pmcw.lpum;
> + schib->pmcw.pam = s->pmcw.pam;
> + schib->pmcw.pom = s->pmcw.pom;
> +
> + if (s->scsw.flags & SCSW_FLAGS_MASK_PNO) {
> + schib->scsw.flags |= SCSW_FLAGS_MASK_PNO;
> + }
> +
> + return IOINST_CC_EXPECTED;
> +}
> +
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
next prev parent reply other threads:[~2020-05-06 15:58 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-05 12:57 [PATCH v4 0/6] s390x/vfio-ccw: Channel Path Handling [QEMU] Eric Farman
2020-05-05 12:57 ` [PATCH v4 1/6] linux-headers: update Eric Farman
2020-05-05 12:57 ` [PATCH v4 2/6] vfio-ccw: Refactor cleanup of regions Eric Farman
2020-05-05 12:57 ` [PATCH v4 3/6] vfio-ccw: Add support for the schib region Eric Farman
2020-05-06 15:56 ` Cornelia Huck [this message]
2020-05-05 12:57 ` [PATCH v4 4/6] vfio-ccw: Refactor ccw irq handler Eric Farman
2020-05-05 12:57 ` [PATCH v4 5/6] s390x/css: Refactor the css_queue_crw() routine Eric Farman
2020-05-06 15:58 ` Cornelia Huck
2020-05-05 12:57 ` [PATCH v4 6/6] vfio-ccw: Add support for the CRW region and IRQ Eric Farman
2020-05-06 16:01 ` Cornelia Huck
2020-05-06 16:03 ` [PATCH v4 0/6] s390x/vfio-ccw: Channel Path Handling [QEMU] Cornelia Huck
2020-06-16 17:01 ` 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=20200506175656.53f60dc1.cohuck@redhat.com \
--to=cohuck@redhat.com \
--cc=farman@linux.ibm.com \
--cc=jjherne@linux.ibm.com \
--cc=jrossi@linux.ibm.com \
--cc=pasic@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
/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).