Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp864947iof; Mon, 6 Jun 2022 14:10:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPSMsikRfBcNESq2+S375RrOJsmdvLZEgIOxvLJy73vsYLYgnpS7rAWjNza8h/yzBuX85P X-Received: by 2002:a63:e450:0:b0:3fd:3a3e:6f94 with SMTP id i16-20020a63e450000000b003fd3a3e6f94mr14488431pgk.117.1654549823697; Mon, 06 Jun 2022 14:10:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654549823; cv=none; d=google.com; s=arc-20160816; b=bWb5i8OaQAyWsPhC8HZ6OeJmAq/ZCAcCQPuuEZJE6bE9qCEo0vGF9e6c7x3Hs+/nVL 6vlTEfo4qFxvGJ15QFodpGRPXQJm2QS9J7s0tRmpnMSZDz+7OXKTONZLuxKHDEGwrg4k o8rRvBt/Di2YreprPaPFvXYTsF+BZigzBPHSKL+TxuqLz1nSrx4lNQ9CkidIyR0uNPbC RB50xpphBqvJyCWRHjwsMmPRjl5Gr+P+aitasax2gIUuP1W3+fY9+pnoZ2zMj46jRlay CMxtWV4Baz+3exmgr029Zy/nbQOejROXJXBlEXr6sjSDfB90ssrLrWpwIR/JQFVSiPuA 0ecg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QriI4TTRP9fK3Tn15zlo8unRCJ7u26TTCNXrMUxCZZg=; b=NDifAOD8w3TJYKcxTuV6yDRQcQG0RyMhwz1ew5ru3nsO/wwDVgBv9z5OU9DBWN2ClB r2uieqg8MA0ZqqWjqsNUYlg1dfWlK5ni0SXHbhWP4+q8AZl+JxT2Ypp0KW8Ta28ucqO4 lrVd34E+Fzr13tbDo7LalPnmNEsXAfUwt94f+ylA9OuaLkyt4Lexa1n4sBmX4VlD8YyW FBnaIwdAYGyT5LPWkdpYWbzivW0q8hQFrg0ZfhUgex5Yktwk9Lp+a3Cbyb+C9YIhF2HY nsBPhOWQC9LG3jGdU7Y4/8hCiQNDxLsx+T6vKb4hmHvQyH0L42yaluU5AvyQ24YetvbU 6bng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=GK05VZNg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 81-20020a630154000000b003fdaf261a31si5585023pgb.781.2022.06.06.14.10.10; Mon, 06 Jun 2022 14:10:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=GK05VZNg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S234196AbiFFUij (ORCPT + 99 others); Mon, 6 Jun 2022 16:38:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234109AbiFFUh6 (ORCPT ); Mon, 6 Jun 2022 16:37:58 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C966BAF303; Mon, 6 Jun 2022 13:35:40 -0700 (PDT) Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 256KUtCr038489; Mon, 6 Jun 2022 20:35:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=QriI4TTRP9fK3Tn15zlo8unRCJ7u26TTCNXrMUxCZZg=; b=GK05VZNgfQmTsB6hveG4Vw2vfoPtcREpz4WCoeYL5reX2xQeKMzrls2azuyPgplqLPvO D+12f7uWnV3fPaFwb59+wgSpPjPoi8eL71gwdjdPqzlX2370w2JQB6MDbYWfrHFwQm6h XKWZqSpHUvBlVPax+0W5YzCj5yLSIMMJ66QC+7ELbMGbgpsCBFo+EkZQ2MV4hav3LGjT 0jEIN7XVp3meUcNN8xRK9VorDPFXjorC/SlIbtTS0nflxrdwZyvtcIw4tqcuG21dJ11i JAKxKvdSrT7fhK/eSgqnijoYRJNkTvQUpAUB7OX9CuEbNsvlVAItm/eavcx8gvzkATj5 BQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ghqs61447-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Jun 2022 20:35:37 +0000 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 256KXXgk005024; Mon, 6 Jun 2022 20:35:37 GMT Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ghqs6143y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Jun 2022 20:35:37 +0000 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 256KLI5D007267; Mon, 6 Jun 2022 20:35:36 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 3gfy1abrht-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Jun 2022 20:35:36 +0000 Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 256KZZ9338273308 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 Jun 2022 20:35:35 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6CC5828059; Mon, 6 Jun 2022 20:35:35 +0000 (GMT) Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CB45728058; Mon, 6 Jun 2022 20:35:29 +0000 (GMT) Received: from li-c92d2ccc-254b-11b2-a85c-a700b5bfb098.ibm.com.com (unknown [9.163.20.188]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 6 Jun 2022 20:35:29 +0000 (GMT) From: Matthew Rosato To: linux-s390@vger.kernel.org Cc: alex.williamson@redhat.com, cohuck@redhat.com, schnelle@linux.ibm.com, farman@linux.ibm.com, pmorel@linux.ibm.com, borntraeger@linux.ibm.com, hca@linux.ibm.com, gor@linux.ibm.com, gerald.schaefer@linux.ibm.com, agordeev@linux.ibm.com, svens@linux.ibm.com, frankja@linux.ibm.com, david@redhat.com, imbrenda@linux.ibm.com, vneethv@linux.ibm.com, oberpar@linux.ibm.com, freude@linux.ibm.com, thuth@redhat.com, pasic@linux.ibm.com, pbonzini@redhat.com, corbet@lwn.net, jgg@nvidia.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: [PATCH v9 19/21] vfio-pci/zdev: different maxstbl for interpreted devices Date: Mon, 6 Jun 2022 16:33:23 -0400 Message-Id: <20220606203325.110625-20-mjrosato@linux.ibm.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220606203325.110625-1-mjrosato@linux.ibm.com> References: <20220606203325.110625-1-mjrosato@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 8I7jOc5f2PXsjjOwEmS8vnB3Q9hgNpgQ X-Proofpoint-GUID: OvLcE1cavrpp5BLjlFbWZIuN093SWxR_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-06-06_06,2022-06-03_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 lowpriorityscore=0 malwarescore=0 mlxlogscore=999 impostorscore=0 priorityscore=1501 clxscore=1015 spamscore=0 mlxscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206060081 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When doing load/store interpretation, the maximum store block length is determined by the underlying firmware, not the host kernel API. Reflect that in the associated Query PCI Function Group clp capability and let userspace decide which is appropriate to present to the guest. Reviewed-by: Pierre Morel Signed-off-by: Matthew Rosato --- drivers/vfio/pci/vfio_pci_zdev.c | 6 ++++-- include/uapi/linux/vfio_zdev.h | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci_zdev.c b/drivers/vfio/pci/vfio_pci_zdev.c index 4f28cdd7ecd1..e163aa9f6144 100644 --- a/drivers/vfio/pci/vfio_pci_zdev.c +++ b/drivers/vfio/pci/vfio_pci_zdev.c @@ -45,14 +45,16 @@ static int zpci_group_cap(struct zpci_dev *zdev, struct vfio_info_cap *caps) { struct vfio_device_info_cap_zpci_group cap = { .header.id = VFIO_DEVICE_INFO_CAP_ZPCI_GROUP, - .header.version = 1, + .header.version = 2, .dasm = zdev->dma_mask, .msi_addr = zdev->msi_addr, .flags = VFIO_DEVICE_INFO_ZPCI_FLAG_REFRESH, .mui = zdev->fmb_update, .noi = zdev->max_msi, .maxstbl = ZPCI_MAX_WRITE_SIZE, - .version = zdev->version + .version = zdev->version, + .reserved = 0, + .imaxstbl = zdev->maxstbl }; return vfio_info_add_capability(caps, &cap.header, sizeof(cap)); diff --git a/include/uapi/linux/vfio_zdev.h b/include/uapi/linux/vfio_zdev.h index 78c022af3d29..77f2aff1f27e 100644 --- a/include/uapi/linux/vfio_zdev.h +++ b/include/uapi/linux/vfio_zdev.h @@ -50,6 +50,10 @@ struct vfio_device_info_cap_zpci_group { __u16 noi; /* Maximum number of MSIs */ __u16 maxstbl; /* Maximum Store Block Length */ __u8 version; /* Supported PCI Version */ + /* End of version 1 */ + __u8 reserved; + __u16 imaxstbl; /* Maximum Interpreted Store Block Length */ + /* End of version 2 */ }; /** -- 2.27.0