Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp911762pxb; Fri, 22 Apr 2022 14:07:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyj2mH6wUGV+9rI60VsZ8Oxh4zXJb7g6Lcig/zPUtAZu4ZohVxYcKtBfAhze9+AMP5iJCm9 X-Received: by 2002:a05:6a00:2a5:b0:50c:ed40:642d with SMTP id q5-20020a056a0002a500b0050ced40642dmr4874523pfs.8.1650661626804; Fri, 22 Apr 2022 14:07:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650661626; cv=none; d=google.com; s=arc-20160816; b=HLSw/fOJHDiVw2Y5OdFpGCGcfT7QF8PeRtx080tZ2nnaBHZyxCWYgKfll6FOjXqpoB +wmHxTqAkCKG7VBK7uekGOR7Bvysna/fwMEH2uPNFvFdqsbTBPNTQA99PPS7V3OPlrpS fb3ZU5cn0+w5d+vVCZSRBVzWCPXu+4d8xemQVzYy4QmHhpkQl+8FgVbntTdYuiEzHd5v coQCCDYOuWjjco8M8fwjCELb+BRZACTKLAOTudBd5VyDlcO/17SXzRra+Ph9zFZYIV8U jTCCSwYJaxFnp3Ir5/L+dE8DDR8Lot6cQTgTSwAIv/DcULV2DgDDoOZYGSufmzHa9of8 bfRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=XEOti7R01r9+X9g9SumuO2qSLV9aBc3CWZyGnBUxQh4=; b=vCtZFKfBUOiFNfPphddlUJEe8M3xidJOmLiAaYZoLM0HSPWevybGd0jXPhcqExNozt qLeyhT4z4+GEuDf9q6x2G97EQ2JaqlmIjT65nEiLUXOMghXrlF8JU9jUlREAoGyZ3OeA 0YKhhJxz3uxkhtMmwQgnb/00mBwiHONtwBsUgyBu5Ega9D8FCG8uuneTC8XD9Fp0nL1H 0iG3TXyw1x1y1CwB31Ihyz7YGl2AREEvszhtam8wLGxTQHMpgpg6JGkKDI/+G11cWhN9 xgf+AqYQUIyvfSVewEe9doMNsaPAYSXK2McCToeG/+8S6OXnJCgppauU9TW4d4hl88wy Er9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=XqWe7iz1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c18-20020a63ea12000000b003aa67dc6efesi9292759pgi.688.2022.04.22.14.07.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 14:07:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=XqWe7iz1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1EBEB24357A; Fri, 22 Apr 2022 13:04:33 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350390AbiDSJlV (ORCPT + 99 others); Tue, 19 Apr 2022 05:41:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236482AbiDSJlU (ORCPT ); Tue, 19 Apr 2022 05:41:20 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D42D1FA78; Tue, 19 Apr 2022 02:38:37 -0700 (PDT) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 23J8KMuP024662; Tue, 19 Apr 2022 09:38:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=XEOti7R01r9+X9g9SumuO2qSLV9aBc3CWZyGnBUxQh4=; b=XqWe7iz1muV9InL39BBI1Kz5xkFhfmwH8PwT5rkHKR6vhVPnoGKbjQxKf0ckcpwBXtJo 4iPnXO67BE44/LHuVu9aQ4TuYrb/Dc5WbyW4Eh3NiPDoF3L9HZJFOQT9uRs4e+G0Y5P3 Y+qaUjc3R5pFQaoA6OW9Fc3pMUw6BDzjLrSEQEU+cMqgR4qhJP/pg2tXkZ+QycaMO0xM LVeeLV4R3HLfcNULnZYFzeLsIgci4dcfvY4YXZhh2o1EIpa/lc4uGKoBwtTOralw0AF3 XwPHw0KzaERdgXq/sJ4xNXf5cZfj6/+PUY9OUa5PqjcMYFG515iS8cuUkQ348P2eKBRH wQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3fg75qbd7b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Apr 2022 09:38:36 +0000 Received: from m0098419.ppops.net (m0098419.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 23J9X9bj025861; Tue, 19 Apr 2022 09:38:35 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 3fg75qbd6t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Apr 2022 09:38:35 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 23J9D9Kg016292; Tue, 19 Apr 2022 09:38:33 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma03ams.nl.ibm.com with ESMTP id 3ffne8m3gp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Apr 2022 09:38:33 +0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 23J9cUuT26935572 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Apr 2022 09:38:30 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3B27842047; Tue, 19 Apr 2022 09:38:30 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 11BA442045; Tue, 19 Apr 2022 09:38:29 +0000 (GMT) Received: from [9.171.88.57] (unknown [9.171.88.57]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 19 Apr 2022 09:38:28 +0000 (GMT) Message-ID: <7c63e8fd-33ad-506c-c62f-fd42d0bb2833@linux.ibm.com> Date: Tue, 19 Apr 2022 11:41:46 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH v5 18/21] vfio-pci/zdev: different maxstbl for interpreted devices Content-Language: en-US To: Matthew Rosato , linux-s390@vger.kernel.org Cc: alex.williamson@redhat.com, cohuck@redhat.com, schnelle@linux.ibm.com, farman@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, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org References: <20220404174349.58530-1-mjrosato@linux.ibm.com> <20220404174349.58530-19-mjrosato@linux.ibm.com> From: Pierre Morel In-Reply-To: <20220404174349.58530-19-mjrosato@linux.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: wfTaQHu0p41pqeYVxiHNkI-ObJkmVBaf X-Proofpoint-GUID: N1yjHkAYMmRkHB6CpMiZNu7UH5_7U5ZD X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-04-19_03,2022-04-15_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 phishscore=0 mlxlogscore=999 spamscore=0 suspectscore=0 impostorscore=0 mlxscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204190052 X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable 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 On 4/4/22 19:43, Matthew Rosato wrote: > 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. > > Signed-off-by: Matthew Rosato Reviewed-by: Pierre Morel > --- > 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 4a653ce480c7..d3ca58d9d8ec 100644 > --- a/drivers/vfio/pci/vfio_pci_zdev.c > +++ b/drivers/vfio/pci/vfio_pci_zdev.c > @@ -44,14 +44,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 */ > }; > > /** > -- Pierre Morel IBM Lab Boeblingen