Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3612646pxb; Mon, 25 Jan 2021 23:26:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxoQnLfHOFMAxzzGrhtUl6lrjEdqYyOkagwoWR9SPsdN51+sIBEYxF18c7rRVFTV8G1mhGJ X-Received: by 2002:a05:6402:4389:: with SMTP id o9mr3559443edc.164.1611645980738; Mon, 25 Jan 2021 23:26:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611645980; cv=none; d=google.com; s=arc-20160816; b=Q3Ki0KLt3RHz37eRYGL9GFdNCu48nEO/HDcJVvY5Zg/fA9mj5YN8yCb4/1XsR2oIrB dUNC+PqSZJdLQNtvwLV2J25LJW3LzXmwS10ty0vxZKxwCXSbNdOLZMnygYUYYkdPSQjJ 5kuVtFy2fayfOASxN9dR2r8oKh3Enxv7vQK1MeZpuCPcHZepKHOAU5Hkl4oTAj2v/hSt 8sghgAr1LyA4xb2gIhZXEa78wWPBmoK540s6yTFQ4rCgEa8nEi1JjfPZ5d2Z5oJj6dsh qvVm6zV+kMtQhLAAM5x9lcGErfubpCUaB093QihPeBC1mw9dL2nOG8MlqWuImtBj57lu +RuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=TwUrudT149MlYBAjlrkqwTg7VCY0+Yq9+gSFRKaR80s=; b=ocpovnPgp8wQErLqLn4L20E1Gc3t9ucK+lDg6X49ymRukvbG9dkwaHxZnIQICMY6Ne 0O76YIz7BFTmpqRvYcxJKH/IQYgSsJ6Pernz/tsth5CeIwdXcKRE+3yZQb7EWq9CC0eq pCQj28CinAOZGhKsuV6KvCbQk8D1BoutUavbQKmk9SZyotidyes+8zCWndh4/18PlO8c PC5hsLzBbZAEZGGy0YLydkE+JkedjZ0pF4+w/rC9BExmgx1Fp1xEHIqdt29Zas13D2m8 BQ73f3kqiM36Ww0nFsxvP951c2S0P2q+UZ/PoPswT52v+uwnlmALXFEjXSFQLzpz21dV KTOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="TxT/UvEA"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bx21si8088046edb.354.2021.01.25.23.25.56; Mon, 25 Jan 2021 23:26:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="TxT/UvEA"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389540AbhAZHUw (ORCPT + 99 others); Tue, 26 Jan 2021 02:20:52 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:42288 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730332AbhAYPok (ORCPT ); Mon, 25 Jan 2021 10:44:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611589380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TwUrudT149MlYBAjlrkqwTg7VCY0+Yq9+gSFRKaR80s=; b=TxT/UvEAK43OHQieTVUkcYnHR7UTgGNZnrNJxgFZr9apuHfIiWbIBZdak26JwBGmkkO2e3 pvl/fkrnER5Stt046wBDsUPiLolqgaT7Z/9hDPGo9N+LDeKU5o8KX4JU7Xr77ubfc5IMR9 2nz63zDq89ocL64y7agTiEWgNJVi+Us= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-27-wFt5wxUKNkKXGw7gDZYURA-1; Mon, 25 Jan 2021 10:42:58 -0500 X-MC-Unique: wFt5wxUKNkKXGw7gDZYURA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C1765809DC9; Mon, 25 Jan 2021 15:42:56 +0000 (UTC) Received: from gondolin (ovpn-113-161.ams2.redhat.com [10.36.113.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9017D5E1A4; Mon, 25 Jan 2021 15:42:54 +0000 (UTC) Date: Mon, 25 Jan 2021 16:42:52 +0100 From: Cornelia Huck To: Matthew Rosato Cc: Alex Williamson , schnelle@linux.ibm.com, pmorel@linux.ibm.com, borntraeger@de.ibm.com, hca@linux.ibm.com, gor@linux.ibm.com, gerald.schaefer@linux.ibm.com, linux-s390@vger.kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/4] vfio-pci/zdev: Introduce the zPCI I/O vfio region Message-ID: <20210125164252.1d1af6cd.cohuck@redhat.com> In-Reply-To: <9c363ff5-b76c-d697-98e2-cf091a404d15@linux.ibm.com> References: <1611086550-32765-1-git-send-email-mjrosato@linux.ibm.com> <1611086550-32765-5-git-send-email-mjrosato@linux.ibm.com> <20210122164843.269f806c@omen.home.shazbot.org> <9c363ff5-b76c-d697-98e2-cf091a404d15@linux.ibm.com> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 25 Jan 2021 09:40:38 -0500 Matthew Rosato wrote: > On 1/22/21 6:48 PM, Alex Williamson wrote: > > On Tue, 19 Jan 2021 15:02:30 -0500 > > Matthew Rosato wrote: > > > >> Some s390 PCI devices (e.g. ISM) perform I/O operations that have very > >> specific requirements in terms of alignment as well as the patterns in > >> which the data is read/written. Allowing these to proceed through the > >> typical vfio_pci_bar_rw path will cause them to be broken in up in such a > >> way that these requirements can't be guaranteed. In addition, ISM devices > >> do not support the MIO codepaths that might be triggered on vfio I/O coming > >> from userspace; we must be able to ensure that these devices use the > >> non-MIO instructions. To facilitate this, provide a new vfio region by > >> which non-MIO instructions can be passed directly to the host kernel s390 > >> PCI layer, to be reliably issued as non-MIO instructions. > >> > >> This patch introduces the new vfio VFIO_REGION_SUBTYPE_IBM_ZPCI_IO region > >> and implements the ability to pass PCISTB and PCILG instructions over it, > >> as these are what is required for ISM devices. > > > > There have been various discussions about splitting vfio-pci to allow > > more device specific drivers rather adding duct tape and bailing wire > > for various device specific features to extend vfio-pci. The latest > > iteration is here[1]. Is it possible that such a solution could simply > > provide the standard BAR region indexes, but with an implementation that > > works on s390, rather than creating new device specific regions to > > perform the same task? Thanks, > > > > Alex > > > > [1]https://lore.kernel.org/lkml/20210117181534.65724-1-mgurtovoy@nvidia.com/ > > > > Thanks for the pointer, I'll have to keep an eye on this. An approach > like this could solve some issues, but I think a main issue that still > remains with relying on the standard BAR region indexes (whether using > the current vfio-pci driver or a device-specific driver) is that QEMU > writes to said BAR memory region are happening in, at most, 8B chunks > (which then, in the current general-purpose vfio-pci code get further > split up into 4B iowrite operations). The alternate approach I'm > proposing here is allowing for the whole payload (4K) in a single > operation, which is significantly faster. So, I suspect even with a > device specific driver we'd want this sort of a region anyhow.. I'm also wondering about device specific vs architecture/platform specific handling. If we're trying to support ISM devices, that's device specific handling; but if we're trying to add more generic things like the large payload support, that's not necessarily tied to a device, is it? For example, could a device support large payload if plugged into a z, but not if plugged into another machine?