From: Eric Farman <farman@linux.ibm.com>
To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org
Cc: Halil Pasic <pasic@linux.ibm.com>,
Jason Herne <jjherne@linux.ibm.com>,
Eric Farman <farman@linux.ibm.com>,
Cornelia Huck <cohuck@redhat.com>,
Jared Rossi <jrossi@linux.ibm.com>
Subject: [PATCH v3 4/7] vfio-ccw: Add support for the crw region
Date: Fri, 17 Apr 2020 04:34:37 +0200 [thread overview]
Message-ID: <20200417023440.70514-5-farman@linux.ibm.com> (raw)
In-Reply-To: <20200417023440.70514-1-farman@linux.ibm.com>
From: Farhan Ali <alifm@linux.ibm.com>
The crw region can be used to obtain information about
Channel Report Words (CRW) from vfio-ccw driver.
Currently only channel path related CRWs are passed to
QEMU from vfio-ccw driver.
Signed-off-by: Farhan Ali <alifm@linux.ibm.com>
Signed-off-by: Eric Farman <farman@linux.ibm.com>
---
Notes:
v0->v1: [EF]
- Fixed copy/paste error in error message (s/schib/CRW)
hw/vfio/ccw.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c
index 8aa224bf43..db565b6f38 100644
--- a/hw/vfio/ccw.c
+++ b/hw/vfio/ccw.c
@@ -44,6 +44,9 @@ struct VFIOCCWDevice {
uint64_t schib_region_size;
uint64_t schib_region_offset;
struct ccw_schib_region *schib_region;
+ uint64_t crw_region_size;
+ uint64_t crw_region_offset;
+ struct ccw_crw_region *crw_region;
EventNotifier io_notifier;
bool force_orb_pfch;
bool warned_orb_pfch;
@@ -449,10 +452,24 @@ static void vfio_ccw_get_region(VFIOCCWDevice *vcdev, Error **errp)
vcdev->schib_region = g_malloc(info->size);
}
+ ret = vfio_get_dev_region_info(vdev, VFIO_REGION_TYPE_CCW,
+ VFIO_REGION_SUBTYPE_CCW_CRW, &info);
+
+ if (!ret) {
+ vcdev->crw_region_size = info->size;
+ if (sizeof(*vcdev->crw_region) != vcdev->crw_region_size) {
+ error_setg(errp, "vfio: Unexpected size of the CRW region");
+ goto out_err;
+ }
+ vcdev->crw_region_offset = info->offset;
+ vcdev->crw_region = g_malloc(info->size);
+ }
+
g_free(info);
return;
out_err:
+ g_free(vcdev->crw_region);
g_free(vcdev->schib_region);
g_free(vcdev->async_cmd_region);
g_free(vcdev->io_region);
@@ -462,6 +479,7 @@ out_err:
static void vfio_ccw_put_region(VFIOCCWDevice *vcdev)
{
+ g_free(vcdev->crw_region);
g_free(vcdev->schib_region);
g_free(vcdev->async_cmd_region);
g_free(vcdev->io_region);
--
2.17.1
next prev parent reply other threads:[~2020-04-17 2:37 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-17 2:34 [PATCH v3 0/7] s390x/vfio-ccw: Channel Path Handling [QEMU] Eric Farman
2020-04-17 2:34 ` [PATCH v3 1/7] linux-headers: update Eric Farman
2020-04-17 2:34 ` [PATCH v3 2/7] vfio-ccw: Refactor cleanup of regions Eric Farman
2020-04-17 2:34 ` [PATCH v3 3/7] vfio-ccw: Add support for the schib region Eric Farman
2020-04-22 11:36 ` Cornelia Huck
2020-04-22 12:17 ` Eric Farman
2020-04-17 2:34 ` Eric Farman [this message]
2020-04-21 12:21 ` [PATCH v3 4/7] vfio-ccw: Add support for the crw region Cornelia Huck
2020-04-21 12:57 ` Eric Farman
2020-04-17 2:34 ` [PATCH v3 5/7] vfio-ccw: Refactor ccw irq handler Eric Farman
2020-04-17 2:34 ` [PATCH v3 6/7] s390x/css: Refactor the css_queue_crw() routine Eric Farman
2020-04-21 12:28 ` Cornelia Huck
2020-04-21 13:04 ` Eric Farman
2020-04-17 2:34 ` [PATCH v3 7/7] vfio-ccw: Add support for the CRW irq Eric Farman
2020-04-22 10:38 ` Cornelia Huck
2020-04-17 3:25 ` [PATCH v3 0/7] s390x/vfio-ccw: Channel Path Handling [QEMU] no-reply
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=20200417023440.70514-5-farman@linux.ibm.com \
--to=farman@linux.ibm.com \
--cc=cohuck@redhat.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).