Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp897918pxp; Wed, 16 Mar 2022 20:33:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4KDVI0/DzuQNswAvMxJ9JGbFpIUJ7GoNk3hb/Lhwut3bFyylZIhV74EOYtFuEty2un2kS X-Received: by 2002:a17:902:7141:b0:153:8050:4357 with SMTP id u1-20020a170902714100b0015380504357mr2973657plm.166.1647488038788; Wed, 16 Mar 2022 20:33:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647488038; cv=none; d=google.com; s=arc-20160816; b=HVn7sLetdJe3+yulzEhZNsE13FbL7P0Oylf07fdYHa2XMZcMXibxNwtGQNjXxMjkl9 5mGmyfE28dT3H06nBHUsrqYFcXBuv7AUc1aEH6spelyJ6sEbOj2dFq3+jPKb9osTpuqO 2StsHb2d0xH3MGXiBTzCmSaMklrEFdYuvEbHyFCDUPOAM9vmNnmaq+/89B3/GPfzAQMt oJS5+7XWKtbwmLMyw0F7cvQgxkx1EAQjqGP5pS2rqHaWG0I7QV9y5URHYBQlIrqFhrck NL4Bpj8TYaoo7odASlwgOfqQ2KBi8Xq68ihwTUK21qfx621M2E6QQh+wv3be/V05uIM9 8h3g== 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=0JqSqWbwpvY3vV8DEXGuT4nLzp1JbsR0s/621Oc4Ou8=; b=iwhCWyPGoUEra2CwIBetZWqelUzJ7e4Lq5M1H1jLfFhWWEUz7HFGVxCrxpOWKuj3zZ eouUpvWFHeUCHV+uw8nEJTiRQ2iwVvbipAd0dMld8tSU4UZwaWKPiKWQs3l6PNEkvlUt eNjzCZgKTCSfPhbLtGwv8zmi8MhmGVputU1Rs9QQ+/DLvKMXP99J6AU0ouSBJIUGFZDx 4y+Wuk77RqwbzWt/vEoKk82mPThxv6eubU40j9BIR62/OTwvQEWUkQUMWKuHhDRzJ1FH ORauc/917gCHJKGCGA1bpdGs1LeQoxUdpjLmSeuDkShtzzhl9c0lo0D7YRRdM/D3cdpJ gIaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=afRBzSL6; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id j18-20020a634a52000000b0038201b8ba7esi936594pgl.35.2022.03.16.20.33.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 20:33:58 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=afRBzSL6; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 D5D3D3DA72; Wed, 16 Mar 2022 20:29:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244634AbiCNTwG (ORCPT + 99 others); Mon, 14 Mar 2022 15:52:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244644AbiCNTwF (ORCPT ); Mon, 14 Mar 2022 15:52:05 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37268CD0; Mon, 14 Mar 2022 12:50:38 -0700 (PDT) Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 22EJlVR0004992; Mon, 14 Mar 2022 19:49:54 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=0JqSqWbwpvY3vV8DEXGuT4nLzp1JbsR0s/621Oc4Ou8=; b=afRBzSL68askdbPpez+SLbQg4YAYnZFvCMWfx97HmryzqmqD5f3+gpqcpYQZFxxY39Ht YUNtY0HRWKDTysOiKYP1ckRbb7zHOiUZES2qtR+VJCRGVflztAhywbdwSUXeTFh/Ne7O 27EmL2S52QbORNUSLbNMsJ6IVShB2OZaqzXJwKf2xtxtVMvZ5SC+tJIqmBJ/ndCiEDPT IFRTgI5z3Xfe/IfIBGnpR6QEnm8Obg4LwFzaIDn+1RlTr578aETzWHoE2IsWiwSiNmvw H0909vHvluTJV5ZjSdRws9laJFstVTNSj34tgWMv1nutP49YGE5ToDdFwiekOfjKDC8m Pw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3et6af0wpc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Mar 2022 19:49:54 +0000 Received: from m0098394.ppops.net (m0098394.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 22EJms1Q012077; Mon, 14 Mar 2022 19:49:53 GMT Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0a-001b2d01.pphosted.com with ESMTP id 3et6af0wp1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Mar 2022 19:49:53 +0000 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 22EJlB1m005387; Mon, 14 Mar 2022 19:49:52 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma01wdc.us.ibm.com with ESMTP id 3erk5989hh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Mar 2022 19:49:52 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 22EJnogE3802068 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Mar 2022 19:49:50 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BCB90112071; Mon, 14 Mar 2022 19:49:50 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 303BB112067; Mon, 14 Mar 2022 19:49:42 +0000 (GMT) Received: from li-c92d2ccc-254b-11b2-a85c-a700b5bfb098.ibm.com.com (unknown [9.211.32.184]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 14 Mar 2022 19:49:41 +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, joro@8bytes.org, will@kernel.org, pbonzini@redhat.com, corbet@lwn.net, jgg@nvidia.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, linux-doc@vger.kernel.org Subject: [PATCH v4 29/32] vfio-pci/zdev: add DTSM to clp group capability Date: Mon, 14 Mar 2022 15:44:48 -0400 Message-Id: <20220314194451.58266-30-mjrosato@linux.ibm.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220314194451.58266-1-mjrosato@linux.ibm.com> References: <20220314194451.58266-1-mjrosato@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: GRwQeuVCT5F-vCDI6_JY93A5evlZh8F3 X-Proofpoint-ORIG-GUID: SMVsEWAAPSVZ1Cczp3DF2PXStnn78aV5 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.850,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-14_13,2022-03-14_02,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 clxscore=1015 lowpriorityscore=0 malwarescore=0 phishscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 mlxscore=0 impostorscore=0 priorityscore=1501 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203140116 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 The DTSM, or designation type supported mask, indicates what IOAT formats are available to the guest. For an interpreted device, userspace will not know what format(s) the IOAT assist supports, so pass it via the capability chain. Since the value belongs to the Query PCI Function Group clp, let's extend the existing capability with a new version. Reviewed-by: Pierre Morel Signed-off-by: Matthew Rosato --- drivers/vfio/pci/vfio_pci_zdev.c | 12 ++++++++++-- include/uapi/linux/vfio_zdev.h | 3 +++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci_zdev.c b/drivers/vfio/pci/vfio_pci_zdev.c index 4a653ce480c7..aadd2b58b822 100644 --- a/drivers/vfio/pci/vfio_pci_zdev.c +++ b/drivers/vfio/pci/vfio_pci_zdev.c @@ -13,6 +13,7 @@ #include #include #include +#include #include @@ -44,16 +45,23 @@ 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, + .dtsm = 0 }; + /* Some values are different for interpreted devices */ + if (zdev->kzdev) { + cap.maxstbl = zdev->maxstbl; + cap.dtsm = kvm_s390_pci_get_dtsm(zdev); + } + 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..29351687e914 100644 --- a/include/uapi/linux/vfio_zdev.h +++ b/include/uapi/linux/vfio_zdev.h @@ -50,6 +50,9 @@ 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 dtsm; /* Supported IOAT Designations */ + /* End of version 2 */ }; /** -- 2.27.0