[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180815182401.4cfa0a78.cohuck@redhat.com>
Date: Wed, 15 Aug 2018 18:24:01 +0200
From: Cornelia Huck <cohuck@...hat.com>
To: Tony Krowiak <akrowiak@...ux.vnet.ibm.com>
Cc: linux-s390@...r.kernel.org, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org, freude@...ibm.com, schwidefsky@...ibm.com,
heiko.carstens@...ibm.com, borntraeger@...ibm.com,
kwankhede@...dia.com, bjsdjshi@...ux.vnet.ibm.com,
pbonzini@...hat.com, alex.williamson@...hat.com,
pmorel@...ux.vnet.ibm.com, alifm@...ux.vnet.ibm.com,
mjrosato@...ux.vnet.ibm.com, jjherne@...ux.vnet.ibm.com,
thuth@...hat.com, pasic@...ux.vnet.ibm.com, berrange@...hat.com,
fiuczy@...ux.vnet.ibm.com, buendgen@...ibm.com,
frankja@...ux.ibm.com, Tony Krowiak <akrowiak@...ux.ibm.com>
Subject: Re: [PATCH v9 17/22] s390: vfio-ap: zeroize the AP queues.
On Mon, 13 Aug 2018 17:48:14 -0400
Tony Krowiak <akrowiak@...ux.vnet.ibm.com> wrote:
Nit: please drop the leading period in the subject.
> From: Tony Krowiak <akrowiak@...ux.ibm.com>
>
> Let's call PAPQ(ZAPQ) to zeroize a queue:
>
> * For each queue configured for a mediated matrix device
> when it is released.
>
> Zeroizing a queue resets the queue, clears all pending
> messages for the queue entries and disables adapter interruptions
> associated with the queue.
>
> Signed-off-by: Tony Krowiak <akrowiak@...ux.ibm.com>
> Reviewed-by: Halil Pasic <pasic@...ux.ibm.com>
> Tested-by: Michael Mueller <mimu@...ux.ibm.com>
> Tested-by: Farhan Ali <alifm@...ux.ibm.com>
> Signed-off-by: Christian Borntraeger <borntraeger@...ibm.com>
> ---
> drivers/s390/crypto/vfio_ap_ops.c | 25 +++++++++++++++++++++++++
> drivers/s390/crypto/vfio_ap_private.h | 25 +++++++++++++++++++++++++
> 2 files changed, 50 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/s390/crypto/vfio_ap_private.h b/drivers/s390/crypto/vfio_ap_private.h
> index 3e8534b..34f982a 100644
> --- a/drivers/s390/crypto/vfio_ap_private.h
> +++ b/drivers/s390/crypto/vfio_ap_private.h
> @@ -74,4 +74,29 @@ struct ap_matrix_mdev {
> extern int vfio_ap_mdev_register(void);
> extern void vfio_ap_mdev_unregister(void);
>
> +static inline int vfio_ap_reset_queue(unsigned int apid, unsigned int apqi,
> + unsigned int retry)
> +{
> + struct ap_queue_status status;
> +
> + do {
> + status = ap_zapq(AP_MKQID(apid, apqi));
> + switch (status.response_code) {
> + case AP_RESPONSE_NORMAL:
> + return 0;
> + case AP_RESPONSE_RESET_IN_PROGRESS:
> + case AP_RESPONSE_BUSY:
> + msleep(20);
> + break;
> + default:
> + pr_warn("%s: error zeroizing %02x.%04x: response code %d\n",
> + VFIO_AP_MODULE_NAME, apid, apqi,
> + status.response_code);
How can we end up here? Does this mean that we just don't know what to
do with this response, or is this something that should never happen?
(How much sense does it make to print an error?)
> + return -EIO;
> + }
> + } while (retry--);
> +
> + return -EBUSY;
> +}
> +
> #endif /* _VFIO_AP_PRIVATE_H_ */
Powered by blists - more mailing lists