From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Tony Krowiak <akrowiak@linux.ibm.com>,
linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
kvm@vger.kernel.org
Cc: pmorel@linux.ibm.com, pasic@linux.ibm.com,
alex.williamson@redhat.com, cohuck@redhat.com,
kwankhede@nvidia.com
Subject: Re: [PATCH] s390/vfio-ap: fix unregister GISC when KVM is already gone results in OOPS
Date: Mon, 21 Sep 2020 07:48:58 +0200 [thread overview]
Message-ID: <a108cd19-8c4b-908f-844d-5717ca405559@de.ibm.com> (raw)
In-Reply-To: <20200918170234.5807-1-akrowiak@linux.ibm.com>
On 18.09.20 19:02, Tony Krowiak wrote:
> Attempting to unregister Guest Interruption Subclass (GISC) when the
> link between the matrix mdev and KVM has been removed results in the
> following:
>
> "Kernel panic -not syncing: Fatal exception: panic_on_oops"
I think the full backtrace would be better in case someone runs into this
and needs to compare this patch to its oops. This also makes it easier to
understand the fix.
>
> This patch fixes this bug by verifying the matrix mdev and KVM are still
> linked prior to unregistering the GISC.
>
> Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com>
Do we need a Fixes tag and cc stable?
> ---
> drivers/s390/crypto/vfio_ap_ops.c | 14 +++++++++-----
> 1 file changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/s390/crypto/vfio_ap_ops.c b/drivers/s390/crypto/vfio_ap_ops.c
> index e0bde8518745..847a88642644 100644
> --- a/drivers/s390/crypto/vfio_ap_ops.c
> +++ b/drivers/s390/crypto/vfio_ap_ops.c
> @@ -119,11 +119,15 @@ static void vfio_ap_wait_for_irqclear(int apqn)
> */
> static void vfio_ap_free_aqic_resources(struct vfio_ap_queue *q)
> {
> - if (q->saved_isc != VFIO_AP_ISC_INVALID && q->matrix_mdev)
So we already check for q->matrix_mdev here
> - kvm_s390_gisc_unregister(q->matrix_mdev->kvm, q->saved_isc);
> - if (q->saved_pfn && q->matrix_mdev)
and here
> - vfio_unpin_pages(mdev_dev(q->matrix_mdev->mdev),
> - &q->saved_pfn, 1);
> + if (q->matrix_mdev) {
> + if (q->saved_isc != VFIO_AP_ISC_INVALID && q->matrix_mdev->kvm)
^^^^ and this is the only
new check? Cant we just add this condition to the first if?
> + kvm_s390_gisc_unregister(q->matrix_mdev->kvm,
> + q->saved_isc);
> + if (q->saved_pfn)
> + vfio_unpin_pages(mdev_dev(q->matrix_mdev->mdev),
> + &q->saved_pfn, 1);
> + }
> +
> q->saved_pfn = 0;
> q->saved_isc = VFIO_AP_ISC_INVALID;
> }
>
next prev parent reply other threads:[~2020-09-21 5:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-18 17:02 [PATCH] s390/vfio-ap: fix unregister GISC when KVM is already gone results in OOPS Tony Krowiak
2020-09-21 5:48 ` Christian Borntraeger [this message]
2020-09-21 11:56 ` Halil Pasic
2020-09-21 8:24 ` Pierre Morel
2020-09-21 9:23 ` Cornelia Huck
2020-09-21 15:45 ` Halil Pasic
2020-09-25 22:29 ` Tony Krowiak
2020-09-26 0:56 ` Halil Pasic
2020-10-21 15:46 ` 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=a108cd19-8c4b-908f-844d-5717ca405559@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=akrowiak@linux.ibm.com \
--cc=alex.williamson@redhat.com \
--cc=cohuck@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=kwankhede@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=pasic@linux.ibm.com \
--cc=pmorel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.