Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp550560imm; Wed, 23 May 2018 01:19:54 -0700 (PDT) X-Google-Smtp-Source: AB8JxZotnCgfSEDvBilihTBPIHUspA5lzImrp6e1UIzJ8b1wuyZ7RkqGERnHiAxoYHYZHjMFn7EO X-Received: by 2002:a62:cc08:: with SMTP id a8-v6mr1870800pfg.219.1527063594200; Wed, 23 May 2018 01:19:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527063594; cv=none; d=google.com; s=arc-20160816; b=xcVftb2aLmr4lzMd69CVY9xEVUKhChLjL2Yu/8S9NNYeimg4Bje5aFS5A1S5VNUUSY ly2yeL24acsy0+8qCPixCVaYloEY4X+0DZXwUshZSErnfJVDiqbek0SOil1EJYFxEu81 Khdk3Q7jTgH19G/SevBFL4+ETapTqPputVbdMx3uRCv0foaXfyshTPq8iFGd5gx+NcuN t13fxnqdmPooNy9CdSO0lCBWCbbQbP9eklW+COuLDRcwgIYwyCWK6SV66R6vlYfKFqxJ l0a8Gm1z1CSHCr0YBnkbFjNDp8qC6VnYp5bxx1yj+huxnaeYI5rw9MUjay5DPls4vPQ5 8Irg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :from:references:cc:to:subject:reply-to:arc-authentication-results; bh=7r6Macw4ee8PhAbrazRn8RrbX21x1+8BZNFrS7P1EM8=; b=Bf9CV1GlK1eX8GMEjmtH9zdRmvX8fiJnpG3bdGyM+QbpDgKH1lB7Ktn5+lhxCOzuza RuDDQO0PIQMM7qWvbkY6uOGHw7OKtrb9h8bRggFaN/FD07p6mYPf25nMnjZ+cjt6kjun 157GXXSz6IpcmiEJqZk9JkENUpirb8MVMa/FbdvtHabQ0ek0A8KgF6PUaShj3dU7caNy 4TiQruC/XCUB65F6JeoKmUERjS5IFGjmzu9k0Lsg8foKeRSmgGFa1eRJlrTTDk3ct/jS sgNc344Rr+Tq1IDXtnPjG5BQXXwFOImAPd+kSQ/VICAuoL/mOLo0PEy7v40KlhXVc8wV DFZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k137-v6si14219825pgc.137.2018.05.23.01.19.39; Wed, 23 May 2018 01:19:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932162AbeEWIT2 (ORCPT + 99 others); Wed, 23 May 2018 04:19:28 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:46638 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754153AbeEWITY (ORCPT ); Wed, 23 May 2018 04:19:24 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4N8F5Vb040940 for ; Wed, 23 May 2018 04:19:24 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 2j54m6r6q2-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 23 May 2018 04:19:23 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 23 May 2018 09:19:21 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 23 May 2018 09:19:19 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4N8JJX753608492; Wed, 23 May 2018 08:19:19 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BC04A4C052; Wed, 23 May 2018 09:10:59 +0100 (BST) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7BCA74C04E; Wed, 23 May 2018 09:10:59 +0100 (BST) Received: from [9.152.224.33] (unknown [9.152.224.33]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 23 May 2018 09:10:59 +0100 (BST) Reply-To: pmorel@linux.ibm.com Subject: Re: [PATCH 04/10] vfio: ccw: replace IO_REQ event with SSCH_REQ event To: Cornelia Huck , Pierre Morel Cc: pasic@linux.vnet.ibm.com, bjsdjshi@linux.vnet.ibm.com, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org References: <1524149293-12658-1-git-send-email-pmorel@linux.vnet.ibm.com> <1524149293-12658-5-git-send-email-pmorel@linux.vnet.ibm.com> <20180425104138.1337aff5.cohuck@redhat.com> <24f638e4-2f7e-00e1-1efb-ff3fe524bca0@linux.vnet.ibm.com> <20180430173028.0dca976c.cohuck@redhat.com> <3c5a0677-4ed2-9bde-e6d8-d02ab69e0c2c@linux.vnet.ibm.com> <20180522173831.08f3b481.cohuck@redhat.com> From: Pierre Morel Date: Wed, 23 May 2018 10:19:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180522173831.08f3b481.cohuck@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 18052308-0020-0000-0000-000004204EFA X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18052308-0021-0000-0000-000042B58C60 Message-Id: <3746e8a0-415f-3ba7-d7dc-be7835adc42f@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-23_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805230082 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/05/2018 17:38, Cornelia Huck wrote: > [still backlog processing...] > > On Thu, 3 May 2018 14:06:51 +0200 > Pierre Morel wrote: > >> On 30/04/2018 17:30, Cornelia Huck wrote: >>> On Wed, 25 Apr 2018 15:52:19 +0200 >>> Pierre Morel wrote: >>> >>>> On 25/04/2018 10:41, Cornelia Huck wrote: >>>>> On Thu, 19 Apr 2018 16:48:07 +0200 >>>>> Pierre Morel wrote: >>>>>> diff --git a/drivers/s390/cio/vfio_ccw_private.h b/drivers/s390/cio/vfio_ccw_private.h >>>>>> index 3284e64..93aab87 100644 >>>>>> --- a/drivers/s390/cio/vfio_ccw_private.h >>>>>> +++ b/drivers/s390/cio/vfio_ccw_private.h >>>>>> @@ -76,7 +76,7 @@ enum vfio_ccw_state { >>>>>> */ >>>>>> enum vfio_ccw_event { >>>>>> VFIO_CCW_EVENT_NOT_OPER, >>>>>> - VFIO_CCW_EVENT_IO_REQ, >>>>>> + VFIO_CCW_EVENT_SSCH_REQ, >>>>>> VFIO_CCW_EVENT_INTERRUPT, >>>>>> VFIO_CCW_EVENT_SCH_EVENT, >>>>>> /* last element! */ >>>>> I don't think we should separate the ssch handling. The major >>>>> difference to halt/clear is that it needs channel program translation. >>>>> Everything else (issuing the instruction and processing the interrupt) >>>>> are basically the same. If we just throw everything at the hardware >>>>> and let the host's channel subsystem figure it out, we already should >>>>> be fine with regard to most of the races. >>>> We must test at a moment or another the kind of request we do, >>>> cancel, halt and clear only need the subchannel id in register 1 and as >>>> you said are much more direct to implement. >>>> >>>> If we do not separate them here, we need a switch in the "do_io_request" >>>> function. >>>> Is it what you mean? >>> Yes. Most of the handling should be the same for any function. >> I really don't know, the 4 functions are quite different. >> >> - SSCH uses an ORB, and has a quite long kernel execution time for VFIO >> - there is a race between SSCH and the others instructions >> - XSCH makes subchannel no longer start pending, also reset the busy >> indications >> - CSCH cancels both SSCH and HSCH instruction, and perform path management >> - HSCH has different busy (entry) conditions > Roughly speaking, we have two categories: An asynchronous function is > performed (SSCH, HSCH, CSCH) or not (XSCH). So I would split out XSCH > in any case. > > SSCH, HSCH, CSCH all perform path management. I see them as kind of > escalating (i.e. CSCH 'beats' HSCH which 'beats' SSCH). I think they > are all similar enough, though, as we can call through to the real > hardware and have it sorted out there. > > Looking through the channel I/O instructions: > - RSCH should be handled with SSCH (as a special case). > - MSCH should also be handled in the long run, STSCH as well. > - SCHM is interesting, as it's not per-subchannel. We have some basic > handling of the instruction in QEMU, but it only emulates some ssch > counters and completely lacks support for the other fields. > - IIRC, there's also a CHSC command dealing with channel monitoring. We > currently fence off any CHSC that is not needed for Linux to run, but > there are some that might be useful for the guest (path handling > etc.) Hard to come to a conclusion here without access to the > documentation. > - I don't think we need to care about TSCH (other than keeping the > schib up to date, which we also need to do for STSCH). > - Likewise, TPI should be handled via emulation. > > Coming back to the original issue, I think we can easily handle SSCH > (and RSCH), HSCH and CSCH together (with the actual hardware doing the > heavy lifting anyway). For other instructions, we need separate > states/processing. > OK, I make the next version with this in mind. Thanks Pierre -- Pierre Morel Linux/KVM/QEMU in Böblingen - Germany