Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4746446pxu; Thu, 10 Dec 2020 04:38:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJy9TpVsfSh8Or3lOrP6MPuDd+mijT6jR9tYuDLX7wWEKmj+Zsze9HrHXGQB3mBlz3oPkUdA X-Received: by 2002:aa7:dbca:: with SMTP id v10mr6616256edt.219.1607603894657; Thu, 10 Dec 2020 04:38:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607603894; cv=none; d=google.com; s=arc-20160816; b=og4/qInpK7tcbEyRCDiNr4WNRjQU5q9Xy9o4+qFXoHrY0fFUzEDbr7rbrJx7Sze6MX qpOtwKsX77/mc+12YDCBU1gH74CGyrbOTsgXWvr8rFF44MM1ZgPxJA/OTR8Z8F1W9sSX +s27PFHS2oybXD+zfdrHBuUOHO9JrBvRwDmT/8lRPSyLGM2mIZH9iPrtQzQ0b0xgkx9n MS7PCRR3638zfGuoKDn0nYqaIJ0TuOVfT6lxDNtmfV+ZJVoi0QYdfcENsfV6VVlZDMWx LV9E18TXV1qYuq9LiTskuxqi8vP2k5wiEos16L7lCkEq9xyo49S2Em1LyxVFrQ5Q1WBe tumQ== 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=J+KcZJva1JHnm2VE0m2PQnQTxCgdEEnkxtAmetNWcaI=; b=if+wm+4nyPJhMxJ/PO5oZGPzFOIQI2COEHCEORVmcmLafJgMFh5fE1omH2d03D6Qqt mL5czP/U9cqx2RbRz7ATSG3YfjfbNAfUIjf7uKnZh0oErmY93r8XRIvo5J4ixjsLipBt w+JTWXcJR+CtZ6Q92l8pptNJtMrSDwsT8pukvT51o38OggfV0D+c1+6ZTSJZ6cTh5MYR ObjmQoZjSzRLTJrP55vhCxkxjvB7g9jZUEmIjDFUA/5xuIKh6iZa7z2PoOvK+3fmelLc 35XzIjueewZA9b+OtL+c94Vr07BzfdgwvBB13lBOuPgJkw6hANTec1P51z0r03pdb6KV Hj9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AJolShOV; 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 h14si3251035edl.381.2020.12.10.04.37.50; Thu, 10 Dec 2020 04:38:14 -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=AJolShOV; 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 S1728631AbgLJMer (ORCPT + 99 others); Thu, 10 Dec 2020 07:34:47 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:24960 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727647AbgLJMeq (ORCPT ); Thu, 10 Dec 2020 07:34:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607603600; 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=J+KcZJva1JHnm2VE0m2PQnQTxCgdEEnkxtAmetNWcaI=; b=AJolShOVbQ1wenTSiHuQRfjDn+QCeF2xNjsRj98Ry/LhXvNg+o+ARuQoJv88WgW0/62r92 QSJUVVKYAeVgF/HeIF5AsixNlkv9x8nkX6Np/Rgmlo8SIxZW8ln0LxZHlk8JNCk1R2qXmN pExd4TqftxZrc5415/lVK4W6WyHdqxI= 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-254-SEh5N4KeNU66XMmL6OwI1g-1; Thu, 10 Dec 2020 07:33:16 -0500 X-MC-Unique: SEh5N4KeNU66XMmL6OwI1g-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2E56410A0F44; Thu, 10 Dec 2020 12:33:15 +0000 (UTC) Received: from gondolin (ovpn-112-77.ams2.redhat.com [10.36.112.77]) by smtp.corp.redhat.com (Postfix) with ESMTP id 55D316F965; Thu, 10 Dec 2020 12:33:09 +0000 (UTC) Date: Thu, 10 Dec 2020 13:33:06 +0100 From: Cornelia Huck To: Matthew Rosato Cc: alex.williamson@redhat.com, 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: [RFC 0/4] vfio-pci/zdev: Fixing s390 vfio-pci ISM support Message-ID: <20201210133306.70d1a556.cohuck@redhat.com> In-Reply-To: <1607545670-1557-1-git-send-email-mjrosato@linux.ibm.com> References: <1607545670-1557-1-git-send-email-mjrosato@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.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 9 Dec 2020 15:27:46 -0500 Matthew Rosato wrote: > Today, ISM devices are completely disallowed for vfio-pci passthrough as > QEMU will reject the device due to an (inappropriate) MSI-X check. > However, in an effort to enable ISM device passthrough, I realized that the > manner in which ISM performs block write operations is highly incompatible > with the way that QEMU s390 PCI instruction interception and > vfio_pci_bar_rw break up I/O operations into 8B and 4B operations -- ISM > devices have particular requirements in regards to the alignment, size and > order of writes performed. Furthermore, they require that legacy/non-MIO > s390 PCI instructions are used, which is also not guaranteed when the I/O > is passed through the typical userspace channels. The part about the non-MIO instructions confuses me. How can MIO instructions be generated with the current code, and why does changing the write pattern help? > > As a result, this patchset proposes a new VFIO region to allow a guest to > pass certain PCI instruction intercepts directly to the s390 host kernel > PCI layer for exeuction, pinning the guest buffer in memory briefly in > order to execute the requested PCI instruction. > > Matthew Rosato (4): > s390/pci: track alignment/length strictness for zpci_dev > vfio-pci/zdev: Pass the relaxed alignment flag > s390/pci: Get hardware-reported max store block length > vfio-pci/zdev: Introduce the zPCI I/O vfio region > > arch/s390/include/asm/pci.h | 4 +- > arch/s390/include/asm/pci_clp.h | 7 +- > arch/s390/pci/pci_clp.c | 2 + > drivers/vfio/pci/vfio_pci.c | 8 ++ > drivers/vfio/pci/vfio_pci_private.h | 6 ++ > drivers/vfio/pci/vfio_pci_zdev.c | 160 ++++++++++++++++++++++++++++++++++++ > include/uapi/linux/vfio.h | 4 + > include/uapi/linux/vfio_zdev.h | 33 ++++++++ > 8 files changed, 221 insertions(+), 3 deletions(-) >