public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Harald Freudenberger <freude@linux.ibm.com>
To: Tony Krowiak <akrowiak@linux.ibm.com>
Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org, jjherne@linux.ibm.com, pasic@linux.ibm.com,
	borntraeger@linux.ibm.com, frankja@linux.ibm.com,
	imbrenda@linux.ibm.com, david@redhat.com, mjrosato@linux.ibm.com
Subject: Re: [PATCH v3 2/3] s390/vfio-ap: set status response code to 06 on gisc registration failure
Date: Fri, 27 Oct 2023 10:25:54 +0200	[thread overview]
Message-ID: <b1ef49cb13547f9c51e47534d3f18e2a@linux.ibm.com> (raw)
In-Reply-To: <20231026183250.254432-3-akrowiak@linux.ibm.com>

On 2023-10-26 20:32, Tony Krowiak wrote:
> From: Anthony Krowiak <akrowiak@linux.ibm.com>
> 
> The interception handler for the PQAP(AQIC) command calls the
> kvm_s390_gisc_register function to register the guest ISC with the 
> channel
> subsystem. If that call fails, the status response code 08 - indicating
> Invalid ZONE/GISA designation - is returned to the guest. This response
> code does not make sense because the non-zero return code from the
> kvm_s390_gisc_register function can be due one of two things: Either 
> the
> ISC passed as a parameter by the guest to the PQAP(AQIC) command is 
> greater
> than the maximum ISC value allowed, or the guest is not using a GISA.
> 
> Since this scenario is very unlikely to happen and there is no status
> response code to indicate an invalid ISC value, let's set the
> response code to 06 indicating 'Invalid address of AP-queue 
> notification
> byte'. While this is not entirely accurate, it is better than 
> indicating
> that the ZONE/GISA designation is invalid which is something the guest
> can do nothing about since those values are set by the hypervisor.
> 
> Signed-off-by: Anthony Krowiak <akrowiak@linux.ibm.com>
> Suggested-by: Halil Pasic <pasic@linux.ibm.com>
> ---
>  drivers/s390/crypto/vfio_ap_ops.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/s390/crypto/vfio_ap_ops.c
> b/drivers/s390/crypto/vfio_ap_ops.c
> index 9cb28978c186..25d7ce2094f8 100644
> --- a/drivers/s390/crypto/vfio_ap_ops.c
> +++ b/drivers/s390/crypto/vfio_ap_ops.c
> @@ -393,8 +393,8 @@ static int ensure_nib_shared(unsigned long addr,
> struct gmap *gmap)
>   * Register the guest ISC to GIB interface and retrieve the
>   * host ISC to issue the host side PQAP/AQIC
>   *
> - * Response.status may be set to AP_RESPONSE_INVALID_ADDRESS in case 
> the
> - * vfio_pin_pages failed.
> + * status.response_code may be set to AP_RESPONSE_INVALID_ADDRESS in 
> case the
> + * vfio_pin_pages or kvm_s390_gisc_register failed.
>   *
>   * Otherwise return the ap_queue_status returned by the ap_aqic(),
>   * all retry handling will be done by the guest.
> @@ -458,7 +458,7 @@ static struct ap_queue_status
> vfio_ap_irq_enable(struct vfio_ap_queue *q,
>  				 __func__, nisc, isc, q->apqn);
> 
>  		vfio_unpin_pages(&q->matrix_mdev->vdev, nib, 1);
> -		status.response_code = AP_RESPONSE_INVALID_GISA;
> +		status.response_code = AP_RESPONSE_INVALID_ADDRESS;
>  		return status;
>  	}

Interesting ... The INVALID_GISA is handled in the default arm of the 
switch
in ap_queue.c but the INVALID_ADDRESS is handled as irq enablement 
failed.
So this change fits more to the current AP bus code. Thanks

Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>

  reply	other threads:[~2023-10-27  8:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-26 18:32 [PATCH v3 0/3] a couple of corrections to the IRQ enablement function Tony Krowiak
2023-10-26 18:32 ` [PATCH v3 1/3] s390/vfio-ap: unpin pages on gisc registration failure Tony Krowiak
2023-10-26 18:32 ` [PATCH v3 2/3] s390/vfio-ap: set status response code to 06 " Tony Krowiak
2023-10-27  8:25   ` Harald Freudenberger [this message]
2023-10-27 11:19   ` Halil Pasic
2023-10-26 18:32 ` [PATCH v3 3/3] s390/vfio-ap: improve reaction to response code 07 from PQAP(AQIC) command Tony Krowiak
  -- strict thread matches above, loose matches on Subject: below --
2023-11-09 16:44 [PATCH v3 0/3] s390/vfio-ap: a couple of corrections to the IRQ enablement function Tony Krowiak
2023-11-09 16:44 ` [PATCH v3 2/3] s390/vfio-ap: set status response code to 06 on gisc registration failure Tony Krowiak

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=b1ef49cb13547f9c51e47534d3f18e2a@linux.ibm.com \
    --to=freude@linux.ibm.com \
    --cc=akrowiak@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=jjherne@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mjrosato@linux.ibm.com \
    --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