Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp4017760ioo; Wed, 25 May 2022 12:59:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmBQbI4ZIsADEiOZyLDQiq4tactbiFWLced4dCquuFG+p46crvvsMyeB1Xu3zPpYC5SPYs X-Received: by 2002:a17:902:a415:b0:161:74b2:c1c2 with SMTP id p21-20020a170902a41500b0016174b2c1c2mr33362120plq.2.1653508756281; Wed, 25 May 2022 12:59:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653508756; cv=none; d=google.com; s=arc-20160816; b=SzsIiGxMG6IUUK1uaou9Rj4HvwnNNDfrTmBXeIGU9g9H1v+hIOywhJRunUvkWyfyU2 ffE68CiRvWcA9oaI2VDtO81uVAl4n5QPJz+PFWQvmqeIcBefy7cSrW1RWGkIVO7pchyE QaTqFJmt6AjLZZZl3Dm6K8n3KUOTHksfnA2e0HcCJhNJJXs5xC1bAzmIoT8p1CIzQ4YH PFfqbYhtbKuerrMiZbA3IduM02izRM3yyoHiXERnxWcqqM6V72IxHQUW9vM9jhR1ThNL pQ8t/oYPYSeCKfVDkt7P9kA8eH9VXyxL64mJ0q2y79iPbqjLPhnPzylvXCUvUgrQiE36 Kc1Q== 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=YNKxER69JXj5jBUUXt1VWjKAHD2qwVJ6xYcnxsiXwLQ=; b=oeYrZAeovW7GPjsXkuhL3GxjKOLKxtjgzScBpIjiRx8rS5snx0NIi6sueioH8FzarD rT8rf3yMbp+xdoRCSo6Ez3K4YMTf+nuA9c9kTxjg125WTFT3XWtYxFaJ+StRRqkpEOcl y3aWnlC1C5XMkWCv8pzn1A9DG1ZCE/K+iGB57WV9oU43zMxau5Mv3uCe7XD6luNRuwNw vxyzv1rNmgl5oJOhsbATm6pMOthJg5bw498RTvjwZ41UDgGr3yaJkhobUFxitcEvi5+k V8u735jTf8t1B+ArhZzrl5zoA7LY/4iJPf8uGZ0SIdm9tI1qhIsBY/uabMI4i8FRugQu 8U4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=EMuUs4+e; 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 t129-20020a635f87000000b0039d3ce3030bsi19178607pgb.553.2022.05.25.12.59.04; Wed, 25 May 2022 12:59:16 -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=EMuUs4+e; 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 S240711AbiEXTCE (ORCPT + 99 others); Tue, 24 May 2022 15:02:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240894AbiEXTBH (ORCPT ); Tue, 24 May 2022 15:01:07 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B18B5BD12; Tue, 24 May 2022 12:00:34 -0700 (PDT) Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24OHoBWs006676; Tue, 24 May 2022 19:00:00 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=YNKxER69JXj5jBUUXt1VWjKAHD2qwVJ6xYcnxsiXwLQ=; b=EMuUs4+ecQO6XASLQmmnNl6Ig6M05JFVRogjKrmA5nAYazu1d0Xq++EQr6td2kysR9ls 7IqhuAEkMSnTu9nSO7o+TnseVfG8s3LxUcGCsCKvEfPcdWTXvUHRsdBcJPTz2T02vFGy msbqGKB/rB5/MTasrv8qgr9sUd1MFGWu+i2skjHcTZDeBD8tcQ22V5aNAw6On/wkOO0/ slDJ0qtsKvOOmf/J+Aj1JFQgeJnrYLvToU7D5/8j/YAwYvpcyV9Ay8LqcQe5Ati/13oO gZJf8I1XJvpscQCJrVX5F7L8eswju26vq3zb601B1OjK3NbUnZmWCSyJ6TnwRxgFtNOd QQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3g9443sb0g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 24 May 2022 19:00:00 +0000 Received: from m0098396.ppops.net (m0098396.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 24OItm4M014797; Tue, 24 May 2022 19:00:00 GMT Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3g9443sb04-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 24 May 2022 19:00:00 +0000 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 24OIsLEA018537; Tue, 24 May 2022 18:59:58 GMT Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by ppma04wdc.us.ibm.com with ESMTP id 3g93uyghq0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 24 May 2022 18:59:58 +0000 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 24OIxvA135914146 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 24 May 2022 18:59:57 GMT Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8F4ABBE054; Tue, 24 May 2022 18:59:57 +0000 (GMT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7ECF7BE056; Tue, 24 May 2022 18:59:55 +0000 (GMT) Received: from li-c92d2ccc-254b-11b2-a85c-a700b5bfb098.ibm.com.com (unknown [9.163.3.233]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 24 May 2022 18:59:55 +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 v8 19/22] vfio-pci/zdev: different maxstbl for interpreted devices Date: Tue, 24 May 2022 14:59:04 -0400 Message-Id: <20220524185907.140285-20-mjrosato@linux.ibm.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220524185907.140285-1-mjrosato@linux.ibm.com> References: <20220524185907.140285-1-mjrosato@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: gxD6-q0azg6Lhhl9SbgH8TwbHyT6t5bC X-Proofpoint-ORIG-GUID: sRfxxYqTYjZXEREqBiJir37mEJpTiMLZ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-24_09,2022-05-23_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 spamscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 adultscore=0 lowpriorityscore=0 mlxlogscore=999 mlxscore=0 bulkscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2205240090 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 183c2609eef7..1579dbed6a44 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