From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751382AbdJPJJn (ORCPT ); Mon, 16 Oct 2017 05:09:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33652 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751410AbdJPJJm (ORCPT ); Mon, 16 Oct 2017 05:09:42 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1F43E81DF0 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com Date: Mon, 16 Oct 2017 11:09:37 +0200 From: Cornelia Huck To: Dong Jia Shi 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 Message-ID: <20171016110937.253b0158.cohuck@redhat.com> In-Reply-To: <20171011023822.42948-2-bjsdjshi@linux.vnet.ibm.com> References: <20171011023822.42948-1-bjsdjshi@linux.vnet.ibm.com> <20171011023822.42948-2-bjsdjshi@linux.vnet.ibm.com> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 16 Oct 2017 09:09:42 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 11 Oct 2017 04:38:21 +0200 Dong Jia Shi 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 > Reviewed-by: Pierre Morel > Signed-off-by: Dong Jia Shi > --- > 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);