From: Anthony Krowiak <akrowiak@linux.ibm.com>
To: "Jason J. Herne" <jjherne@linux.ibm.com>, linux-s390@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, pasic@linux.ibm.com
Subject: Re: [PATCH 2/3] s390/vfio-ap: Add sysfs attr, queue_configuration, to export mdev state
Date: Mon, 29 Jan 2024 10:30:24 -0500 [thread overview]
Message-ID: <b6baa132-7a32-4ce5-bb30-1b0773d801ae@linux.ibm.com> (raw)
In-Reply-To: <20240126143533.14043-3-jjherne@linux.ibm.com>
Reviewed-by: Anthony Krowiak <akrowiak@linux.ibm.com>
On 1/26/24 9:35 AM, Jason J. Herne wrote:
> Add ap_config sysfs attribute. This will provide the means for
> setting or displaying the adapters, domains and control domains assigned
> to the vfio-ap mediated device in a single operation. This sysfs
> attribute is comprised of three masks: One for adapters, one for domains,
> and one for control domains.
>
> This attribute is intended to be used by mdevctl to query a vfio-ap
> mediated device's state.
>
> Signed-off-by: Jason J. Herne <jjherne@linux.ibm.com>
> ---
> drivers/s390/crypto/vfio_ap_ops.c | 27 +++++++++++++++++++++++++++
> 1 file changed, 27 insertions(+)
>
> diff --git a/drivers/s390/crypto/vfio_ap_ops.c b/drivers/s390/crypto/vfio_ap_ops.c
> index 243d252bc631..96293683b939 100644
> --- a/drivers/s390/crypto/vfio_ap_ops.c
> +++ b/drivers/s390/crypto/vfio_ap_ops.c
> @@ -1508,6 +1508,32 @@ static ssize_t guest_matrix_show(struct device *dev,
> }
> static DEVICE_ATTR_RO(guest_matrix);
>
> +static ssize_t write_ap_bitmap(unsigned long *bitmap, char *buf, int offset, char sep)
> +{
> + return sysfs_emit_at(buf, offset, "0x%016lx%016lx%016lx%016lx%c",
> + bitmap[0], bitmap[1], bitmap[2], bitmap[3], sep);
> +}
> +
> +static ssize_t ap_config_show(struct device *dev, struct device_attribute *attr,
> + char *buf)
> +{
> + struct ap_matrix_mdev *matrix_mdev = dev_get_drvdata(dev);
> + int idx = 0;
> +
> + idx += write_ap_bitmap(matrix_mdev->matrix.apm, buf, idx, ',');
> + idx += write_ap_bitmap(matrix_mdev->matrix.aqm, buf, idx, ',');
> + idx += write_ap_bitmap(matrix_mdev->matrix.adm, buf, idx, '\n');
> +
> + return idx;
> +}
> +
> +static ssize_t ap_config_store(struct device *dev, struct device_attribute *attr,
> + const char *buf, size_t count)
> +{
> + return count;
> +}
> +static DEVICE_ATTR_RW(ap_config);
> +
> static struct attribute *vfio_ap_mdev_attrs[] = {
> &dev_attr_assign_adapter.attr,
> &dev_attr_unassign_adapter.attr,
> @@ -1515,6 +1541,7 @@ static struct attribute *vfio_ap_mdev_attrs[] = {
> &dev_attr_unassign_domain.attr,
> &dev_attr_assign_control_domain.attr,
> &dev_attr_unassign_control_domain.attr,
> + &dev_attr_ap_config.attr,
> &dev_attr_control_domains.attr,
> &dev_attr_matrix.attr,
> &dev_attr_guest_matrix.attr,
next prev parent reply other threads:[~2024-01-29 15:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-26 14:35 [PATCH 0/3] s390/vfio-ap: queue_configuration sysfs attribute for mdevctl automation Jason J. Herne
2024-01-26 14:35 ` [PATCH 1/3] s390/ap: Externalize AP bus specific bitmap reading function Jason J. Herne
2024-01-26 14:35 ` [PATCH 2/3] s390/vfio-ap: Add sysfs attr, queue_configuration, to export mdev state Jason J. Herne
2024-01-29 15:30 ` Anthony Krowiak [this message]
2024-01-26 14:35 ` [PATCH 3/3] s390/vfio-ap: Add write support to sysfs attr ap_config Jason J. Herne
2024-01-28 14:02 ` kernel test robot
2024-01-29 21:43 ` Anthony Krowiak
2024-03-05 20:41 ` Jason J. Herne
2024-01-29 16:53 ` [PATCH 0/3] s390/vfio-ap: queue_configuration sysfs attribute for mdevctl automation Anthony Krowiak
2024-01-29 20:23 ` Matthew Rosato
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=b6baa132-7a32-4ce5-bb30-1b0773d801ae@linux.ibm.com \
--to=akrowiak@linux.ibm.com \
--cc=jjherne@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=pasic@linux.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