Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1993874pxk; Sat, 19 Sep 2020 08:55:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBhrCK+yWfgpoz6kRDjz+J111/cG8tZyLXUQIPN2LVgGhVID64CUHLGdiGkbeESKUMzixS X-Received: by 2002:a17:906:4755:: with SMTP id j21mr42401774ejs.228.1600530954026; Sat, 19 Sep 2020 08:55:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600530954; cv=none; d=google.com; s=arc-20160816; b=KXz0ZEvUhFsBG+JddkuITqUNVE/NxAjRc0lO0qHXq6EO62nDl4BC8sDEBjYQFfCZER vw0HOYauYLGbvernjAAYW0+MH5ICgN08BWEuTp6NZnB/d2ohCHrxwrq7l1n6ZUqislVE fRP3i4FZ4MnQ5XF94gqbLpk1LzeWQBFhVW+N2Hc/PDj++XPDO+Y7BLkRpV8uDZPd9ZSW 0FmtWT0hec7yskYvcIFIFw4seRmXdZ5si3H3NEA4CYOIyd9m47OQmOr4aj+7pH5Uz9v0 8Ec8avCw0S0377AtuVskUrPXkPRPaAy8h/rPsAr16FDlMQ0g/N6qEjI3KnXY9SVj2/kX rHXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:from:subject:dkim-signature; bh=rRF4tk9fIejtWiYVZk6Exl4Zucnt+GVESr+b7iU8Ylw=; b=oCwIb9BWrlXsh1L8d2xOGlMO/2FqdNTclocSFXpjtg5xD93kufGnWpzRWsiMtAtDPf 6LgLWIQlzdFN5raasUnDh+olBmXqxuty5+5lMdzpF0lfxw8lNuJm43yiygM5GPtsSfsj KV3j+HQYRJdEIj6+X0rjkGZJ+OvGCk4WdQkD1iB9aq/XjDU3+1lJp6L8bW+aiUkScJW+ bsyrs6mvfGyJZZDqOaAFBsftaDJgjqzRrAh9wCQRZrCnKCfTZ1VO+f03P1N0ufLVrMl2 ClNKx+J+pKaJrFawZ5RrOMFIlks7L+k7m//hIeRPXcOm3I+bOamNFTtVUlOgYwxc0svG zPdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=iijrKqWo; 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y3si4765371edr.538.2020.09.19.08.54.52; Sat, 19 Sep 2020 08:55:54 -0700 (PDT) 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=@ibm.com header.s=pp1 header.b=iijrKqWo; 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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726591AbgISPud (ORCPT + 99 others); Sat, 19 Sep 2020 11:50:33 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:41128 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726434AbgISPuc (ORCPT ); Sat, 19 Sep 2020 11:50:32 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08JF2ZZX011945; Sat, 19 Sep 2020 11:50:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=subject : from : to : cc : references : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=rRF4tk9fIejtWiYVZk6Exl4Zucnt+GVESr+b7iU8Ylw=; b=iijrKqWoxI27o8rTEXdTaqapqB7n6K87zL6fqEiOXCByl4Aqv9I2D5jF485JBTfJVkZb ESU8q68cJZ8545AvdXHZbonEUOGFcgVh13WhDQoRDrZifYQSOxpSDvPa2INHAQO44HzN IIcgEeCbxJ/n6BmPVVe1Qgbp8Hi0uz878wPsXLdc+FVlqdUtVQnovo56PuXewKP1pyE5 tSGF+d9pkEbJyRzxb1yNYJJUP6FgdMx6l6uu4akPIfYKYLSCN40ICguD2tQstaqmuWWe 2yk53CzYiFB5XhZ30xmJl6C1wQXjVKceC1LcJszEFVxnZvU4EK6VOCHTwSv+0fFzATo5 gQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 33ngh94nrq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 19 Sep 2020 11:50:32 -0400 Received: from m0098394.ppops.net (m0098394.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 08JFoV3Q008163; Sat, 19 Sep 2020 11:50:31 -0400 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com with ESMTP id 33ngh94nrh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 19 Sep 2020 11:50:31 -0400 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 08JFkoh8024589; Sat, 19 Sep 2020 15:50:31 GMT Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by ppma02dal.us.ibm.com with ESMTP id 33n9m8c3kq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 19 Sep 2020 15:50:31 +0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 08JFoTvC54264162 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 19 Sep 2020 15:50:29 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0AD1EAE05C; Sat, 19 Sep 2020 15:50:29 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A70C2AE062; Sat, 19 Sep 2020 15:50:26 +0000 (GMT) Received: from oc4221205838.ibm.com (unknown [9.211.74.107]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Sat, 19 Sep 2020 15:50:26 +0000 (GMT) Subject: Re: [PATCH 0/4] Pass zPCI hardware information via VFIO From: Matthew Rosato To: alex.williamson@redhat.com, cohuck@redhat.com, schnelle@linux.ibm.com Cc: 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 References: <1600529318-8996-1-git-send-email-mjrosato@linux.ibm.com> Message-ID: <1f47cab8-af05-494f-1cf0-7b6d126e6367@linux.ibm.com> Date: Sat, 19 Sep 2020 11:50:25 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <1600529318-8996-1-git-send-email-mjrosato@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-09-19_05:2020-09-16,2020-09-19 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 spamscore=0 mlxlogscore=999 lowpriorityscore=0 suspectscore=0 mlxscore=0 priorityscore=1501 phishscore=0 impostorscore=0 adultscore=0 malwarescore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009190131 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/19/20 11:28 AM, Matthew Rosato wrote: > This patchset provides a means by which hardware information about the > underlying PCI device can be passed up to userspace (ie, QEMU) so that > this hardware information can be used rather than previously hard-coded > assumptions. A new VFIO region type is defined which holds this > information. > > A form of these patches saw some rounds last year but has been back- > tabled for a while. The original work for this feature was done by Pierre > Morel. I'd like to refresh the discussion on this and get this finished up > so that we can move forward with better-supporting additional types of > PCI-attached devices. The proposal here presents a completely different > region mapping vs the prior approach, taking inspiration from vfio info > capability chains to provide device CLP information in a way that allows > for future expansion (new CLP features). > > This feature is toggled via the CONFIG_VFIO_PCI_ZDEV configuration entry. QEMU patchset that exploits the new region: https://lists.gnu.org/archive/html/qemu-devel/2020-09/msg07076.html > > Matthew Rosato (4): > s390/pci: stash version in the zpci_dev > s390/pci: track whether util_str is valid in the zpci_dev > vfio-pci/zdev: define the vfio_zdev header > vfio-pci/zdev: use a device region to retrieve zPCI information > > arch/s390/include/asm/pci.h | 4 +- > arch/s390/pci/pci_clp.c | 2 + > drivers/vfio/pci/Kconfig | 13 ++ > drivers/vfio/pci/Makefile | 1 + > drivers/vfio/pci/vfio_pci.c | 8 ++ > drivers/vfio/pci/vfio_pci_private.h | 10 ++ > drivers/vfio/pci/vfio_pci_zdev.c | 242 ++++++++++++++++++++++++++++++++++++ > include/uapi/linux/vfio.h | 5 + > include/uapi/linux/vfio_zdev.h | 116 +++++++++++++++++ > 9 files changed, 400 insertions(+), 1 deletion(-) > create mode 100644 drivers/vfio/pci/vfio_pci_zdev.c > create mode 100644 include/uapi/linux/vfio_zdev.h >