Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp489036pxb; Thu, 21 Apr 2022 04:16:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfVtvirH0aCkH8R/jEO7s4mFp/l3QH7R7L+CGsDBOzbj3EdEFc8J/q58CpX3G2btSMtov0 X-Received: by 2002:a63:8b4c:0:b0:3aa:7bac:75e with SMTP id j73-20020a638b4c000000b003aa7bac075emr4818685pge.567.1650539804708; Thu, 21 Apr 2022 04:16:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650539804; cv=none; d=google.com; s=arc-20160816; b=z8v3yh20uh8yDMQPL0n/Bj2Pm/YRfIKC1vlSdYhNbFpDtN2GW1qn6IwPNLz4PwSnGf edfu6LpdQQBR8vKNBHmB+KRS5MSQMwGr0YbDtobSk8ubpm2S5ETWOeONQCB81jKFM9H9 jVrUWakFgpHSC0tKSeCL+MeFVribu0D7Vvuqbdf9LTDKaMzjKIYK7MYZAznqGwpYcxoj 4ncGWH03ZG4k+SUaugsSISz6FK/j+OuLuoonRdHSb8uiGLwqdaY9P7XbxdXmu1dCjrxN QlDapmSujomqLMjiRMqCxh/JvuTm6PofXO96wUHF5JaOMZCrbrMxHcAiOK2HHjjjYF9/ b9qg== 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=kBchHFFddx0ubwxodE+mu25lyI4qY8zeK88Z1KjjO5E=; b=roUeDYnn3cdEi7gbYr7pJDNADS5mNDOTGDlLDdahnrNJFjEnyrBVLefMT8FcU/USJj 7GHrzxazHQCLNRF/TfU/jGMVVVvJU5vpwnkxX+IKDvleZI+XcSVpND1KmvWI9BrabnMt hc/sTDVWUXDyGDXJxtGICtHdqPVlI7TR/xdIcAEJBjvRH5uR/pmR2c4fOCza2CnjfqKX XzNOE/X2o7OlM7qvCLVLQdoALFCORrah9ZG0VC/Na9/LQZJy3QYonRdMVfLEZj4rFRps f0B5iMt1VS0tGfZjE4s+NCMpJh4HGT5vdU8Mc0D619TBbfEKdyRuCMe7vXDTa4XGVdrK LzsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=AfCcDkW6; 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 d125-20020a636883000000b003aa91344e53si1246484pgc.362.2022.04.21.04.16.30; Thu, 21 Apr 2022 04:16:44 -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=AfCcDkW6; 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 S1350382AbiDSJju (ORCPT + 99 others); Tue, 19 Apr 2022 05:39:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344701AbiDSJjt (ORCPT ); Tue, 19 Apr 2022 05:39:49 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9009F1FA78; Tue, 19 Apr 2022 02:37:06 -0700 (PDT) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 23J6v9q2027973; Tue, 19 Apr 2022 09:37:06 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=kBchHFFddx0ubwxodE+mu25lyI4qY8zeK88Z1KjjO5E=; b=AfCcDkW6ubzEwNdUAED35Cov2h+AzCdIWLiVakm+WS5An3bnSh2JygSE82SE/3rmMAwY ClaY98doMiXu51R2+fOIW1uwNs3hQdNqxVjO3ukI8gztImL/rhiLW2SaSGapblqK9Woh AzhQmILX2Jmd3t4pCz/y1PSCZx7cjKMYFsIYZ8YUIgU3Rhb2wbMf5pnh9r7Blg1f8lag 8KZYafCKXAEnOKGHvGPHmq7ba30S5ud74TeVLkmPzifcPDL0TTnBe6+dxoKxtCpXhHXC uDiPqu1ERsKbCqSZIQL2/4yKSswDjswiTDYX9dvCPQSIzk56CK1hDr5PjOirYecPCvGS 5Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3fg7ct31tb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Apr 2022 09:37:06 +0000 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 23J96vRo003352; Tue, 19 Apr 2022 09:37:05 GMT Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0a-001b2d01.pphosted.com with ESMTP id 3fg7ct31su-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Apr 2022 09:37:05 +0000 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 23J9DKaF016307; Tue, 19 Apr 2022 09:37:03 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma02fra.de.ibm.com with ESMTP id 3fgu6u1r4f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Apr 2022 09:37:02 +0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 23J9axms50331922 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Apr 2022 09:36:59 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BA8B642042; Tue, 19 Apr 2022 09:36:59 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9CEBD42041; Tue, 19 Apr 2022 09:36:58 +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:36:58 +0000 (GMT) Message-ID: Date: Tue, 19 Apr 2022 11:40:16 +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 17/21] vfio-pci/zdev: add function handle to clp base capability 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-18-mjrosato@linux.ibm.com> From: Pierre Morel In-Reply-To: <20220404174349.58530-18-mjrosato@linux.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: T8WIBnjWM6MvBX3_tNqyT9jVtqXKwptw X-Proofpoint-ORIG-GUID: 84tc4MUnk6hV2oqiXeAO9Vyy9JqnvAwG 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 priorityscore=1501 bulkscore=0 phishscore=0 adultscore=0 lowpriorityscore=0 clxscore=1015 impostorscore=0 mlxscore=0 malwarescore=0 mlxlogscore=999 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204190052 X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,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 On 4/4/22 19:43, Matthew Rosato wrote: > The function handle is a system-wide unique identifier for a zPCI > device. It is used as input for various zPCI operations. The comment is a little too much obvious. May be add something like. " With the legacy instruction interception the PCI instructions used to be executed by the host. With PCI instruction interpretation, the guest needs to use the real function handle. Let's give it to the guest. " Or something like that. With a better comment: Reviewed-by: Pierre Morel > > Signed-off-by: Matthew Rosato > --- > drivers/vfio/pci/vfio_pci_zdev.c | 5 +++-- > include/uapi/linux/vfio_zdev.h | 3 +++ > 2 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/vfio/pci/vfio_pci_zdev.c b/drivers/vfio/pci/vfio_pci_zdev.c > index ea4c0d2b0663..4a653ce480c7 100644 > --- a/drivers/vfio/pci/vfio_pci_zdev.c > +++ b/drivers/vfio/pci/vfio_pci_zdev.c > @@ -23,14 +23,15 @@ static int zpci_base_cap(struct zpci_dev *zdev, struct vfio_info_cap *caps) > { > struct vfio_device_info_cap_zpci_base cap = { > .header.id = VFIO_DEVICE_INFO_CAP_ZPCI_BASE, > - .header.version = 1, > + .header.version = 2, > .start_dma = zdev->start_dma, > .end_dma = zdev->end_dma, > .pchid = zdev->pchid, > .vfn = zdev->vfn, > .fmb_length = zdev->fmb_length, > .pft = zdev->pft, > - .gid = zdev->pfgid > + .gid = zdev->pfgid, > + .fh = zdev->fh > }; > > 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 b4309397b6b2..78c022af3d29 100644 > --- a/include/uapi/linux/vfio_zdev.h > +++ b/include/uapi/linux/vfio_zdev.h > @@ -29,6 +29,9 @@ struct vfio_device_info_cap_zpci_base { > __u16 fmb_length; /* Measurement Block Length (in bytes) */ > __u8 pft; /* PCI Function Type */ > __u8 gid; /* PCI function group ID */ > + /* End of version 1 */ > + __u32 fh; /* PCI function handle */ > + /* End of version 2 */ > }; > > /** > -- Pierre Morel IBM Lab Boeblingen