public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Cornelia Huck <cohuck@redhat.com>
To: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org,
	kvm@vger.kernel.org, borntraeger@de.ibm.com,
	pasic@linux.vnet.ibm.com, pmorel@linux.vnet.ibm.com
Subject: Re: [PATCH 1/2] vfio: ccw: bypass bad idaw address when fetching IDAL ccws
Date: Mon, 16 Oct 2017 11:09:37 +0200	[thread overview]
Message-ID: <20171016110937.253b0158.cohuck@redhat.com> (raw)
In-Reply-To: <20171011023822.42948-2-bjsdjshi@linux.vnet.ibm.com>

On Wed, 11 Oct 2017 04:38:21 +0200
Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com> wrote:

> We currently returns the same error code (-EFAULT) to indicate two

s/returns/return/

> different error cases:
> 1. a bug in vfio-ccw implementation has been found.
> 2. a buggy channel program has been detected.
> 
> This brings difficulty for userland program (specifically Qemu) to
> handle.
> 
> Let's use -EFAULT to only indicate the first case. For the second
> case, we simply hand over the ccws to lower level for further
> handling.
> 
> Notice:
> Once a bad idaw address is detected, the current behavior is to
> suppress the ssch. With this fix, the channel program will be
> accepted, and partial of the channel program (the part ahead of

s/partial/part/

> the bad idaw) could possibly be executed by the device before
> I/O conclusion.

That actually sounds more sensible than the current behaviour.

I'll fix up the typos when applying.

> 
> Suggested-by: Halil Pasic <pasic@linux.vnet.ibm.com>
> Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
> Signed-off-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
> ---
>  drivers/s390/cio/vfio_ccw_cp.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/s390/cio/vfio_ccw_cp.c b/drivers/s390/cio/vfio_ccw_cp.c
> index 5ccfdc80d0ec..722f8b8c7273 100644
> --- a/drivers/s390/cio/vfio_ccw_cp.c
> +++ b/drivers/s390/cio/vfio_ccw_cp.c
> @@ -569,10 +569,6 @@ static int ccwchain_fetch_idal(struct ccwchain *chain,
>  
>  	for (i = 0; i < idaw_nr; i++) {
>  		idaw_iova = *(idaws + i);
> -		if (IS_ERR_VALUE(idaw_iova)) {
> -			ret = -EFAULT;
> -			goto out_free_idaws;
> -		}
>  
>  		ret = pfn_array_alloc_pin(pat->pat_pa + i, cp->mdev,
>  					  idaw_iova, 1);

  reply	other threads:[~2017-10-16  9:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-11  2:38 [PATCH 0/2] vfio-ccw bugfix Dong Jia Shi
2017-10-11  2:38 ` [PATCH 1/2] vfio: ccw: bypass bad idaw address when fetching IDAL ccws Dong Jia Shi
2017-10-16  9:09   ` Cornelia Huck [this message]
2017-10-11  2:38 ` [PATCH 2/2] vfio: ccw: validate the count field of a ccw before pinning Dong Jia Shi
2017-10-16  9:14   ` Cornelia Huck
2017-10-16  9:37 ` [PATCH 0/2] vfio-ccw bugfix Cornelia Huck

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=20171016110937.253b0158.cohuck@redhat.com \
    --to=cohuck@redhat.com \
    --cc=bjsdjshi@linux.vnet.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=pasic@linux.vnet.ibm.com \
    --cc=pmorel@linux.vnet.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