Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3038977pxb; Tue, 19 Jan 2021 12:05:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJxGeXp3IbWd1dALu1cy/LAe0KcveD0plOAl7/qaGdq3umoV0eZdP6HhGLq/jJYFZFnu43XL X-Received: by 2002:a17:906:7215:: with SMTP id m21mr3974160ejk.248.1611086718831; Tue, 19 Jan 2021 12:05:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611086718; cv=none; d=google.com; s=arc-20160816; b=o5YgFmcvhZDmkMbDpKzrmKWycbCGwA9i0sYc4B5pb1beK/yAnfvDi81I4bKU/4BpCc bPsCuF5/WFv9ikGpqN+ZZnfniZWUbGljslDx/nm06RM3IO9d75aE4dKIRCxG/5okzMWi zcuy4bgnyt8XNCwtkTsdRvwF8jQS/eEJci/xOkk22OH4tusomzp3JWgarR1kY7xb1GL3 +yr+cN0oTABuymyT5qZwyUYLdCnY6H0p599vMZfVPKRx7VAWiHXlmVrwa8U8txWox5zy 9P16x05GyURqiwSHiITTJc6Jc2iiDJ/9/fdiRYRDvPlwfmOkzCnywj+dfd5+qbgV8rFK ZYug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=RNAgxCZ6LPLzPrY2Z1vCKZGyclLScwFuVytng/DHOrI=; b=i/ag5zB2hEuu360Qs6Ca9atara4eP2SG2AbcluZtqm6waZZ+73MPclNrCF05BbQLAO fxfRZmer3KZwtanvjNp6XUpsTlXYHMVzoYfH2sg3ym112kDjWuShn8eVZ0VDvi2DRGwc MrlOiohIvfZZCIb5egnV69V89yx7XeZpmW8rHX7IuT0nfPtiX3pFUJlJD179Nrnb39E0 Mthh3iTmoopc3ncHq5SxGs9CIYr1pVnbHnQBQZPyrPp6LRUR83s3Qu6ZaycOv5uUanD1 9fldgqsnH7JE65dYbPdaJ2u1amxQ8kyeEWnyw+dX1fCQrvuTVvA5xMKMBi5NQ0tal4gi QC0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=rie9I8LG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y17si10121190edi.83.2021.01.19.12.04.54; Tue, 19 Jan 2021 12:05:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=rie9I8LG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729960AbhASUDt (ORCPT + 99 others); Tue, 19 Jan 2021 15:03:49 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:61966 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729548AbhASUDY (ORCPT ); Tue, 19 Jan 2021 15:03:24 -0500 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 10JK2Kfa178336; Tue, 19 Jan 2021 15:02:43 -0500 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; s=pp1; bh=RNAgxCZ6LPLzPrY2Z1vCKZGyclLScwFuVytng/DHOrI=; b=rie9I8LGhJ4ToZKylnItpHBD0ukeNZ95UOfU2ytWOdSZEURz4bH8gYVOMpIHFal+prkE CZ2I2HnaOm1VLNMRGjyMYGnttGPMBwRdJlNzt7eVkJTtlN/1nOjpz1bhB6BzLS2Af7T9 lHliANrF4R3+j04gd2/8eG55FT/F4v1WqZ4ZctLo+X++Ob+QuifLPbQZunjL+ssiP7mR ZCcJsrD9nt90I/PAzn/CsDjd+JTuKDIESTWaN864+/LKr0WG6n+amYz5uH5pRP508qRa yHSDZeZi3VjzJnqlWwGn1DnnboSHjFegaLgfsKXn7sUHOeiq2Up/A8F/0s+PRZ0RmXe1 Rw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 36643wk6gs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Jan 2021 15:02:43 -0500 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 10JK2gOU180554; Tue, 19 Jan 2021 15:02:42 -0500 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com with ESMTP id 36643wk6ge-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Jan 2021 15:02:42 -0500 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 10JK2Rti023177; Tue, 19 Jan 2021 20:02:41 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma01dal.us.ibm.com with ESMTP id 363qs9pwtp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Jan 2021 20:02:41 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 10JK2dwb43778360 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Jan 2021 20:02:39 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D4EABAC059; Tue, 19 Jan 2021 20:02:39 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C4C79AC05B; Tue, 19 Jan 2021 20:02:37 +0000 (GMT) Received: from oc4221205838.ibm.com (unknown [9.211.56.144]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 19 Jan 2021 20:02:37 +0000 (GMT) From: Matthew Rosato To: alex.williamson@redhat.com, cohuck@redhat.com, schnelle@linux.ibm.com Cc: pmorel@linux.ibm.com, borntraeger@de.ibm.com, hca@linux.ibm.com, gor@linux.ibm.com, gerald.schaefer@linux.ibm.com, linux-s390@vger.kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] vfio-pci/zdev: Pass the relaxed alignment flag Date: Tue, 19 Jan 2021 15:02:28 -0500 Message-Id: <1611086550-32765-3-git-send-email-mjrosato@linux.ibm.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1611086550-32765-1-git-send-email-mjrosato@linux.ibm.com> References: <1611086550-32765-1-git-send-email-mjrosato@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.343,18.0.737 definitions=2021-01-19_09:2021-01-18,2021-01-19 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxlogscore=999 clxscore=1015 impostorscore=0 phishscore=0 priorityscore=1501 lowpriorityscore=0 malwarescore=0 suspectscore=0 adultscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101190106 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use an additional bit of the VFIO_DEVICE_INFO_CAP_ZPCI_GROUP flags field to pass whether or not the associated device supports relaxed length and alignment for some I/O operations. Signed-off-by: Matthew Rosato Acked-by: Niklas Schnelle Reviewed-by: Pierre Morel --- drivers/vfio/pci/vfio_pci_zdev.c | 2 ++ include/uapi/linux/vfio_zdev.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/vfio/pci/vfio_pci_zdev.c b/drivers/vfio/pci/vfio_pci_zdev.c index 2296856..57e19ff 100644 --- a/drivers/vfio/pci/vfio_pci_zdev.c +++ b/drivers/vfio/pci/vfio_pci_zdev.c @@ -60,6 +60,8 @@ static int zpci_group_cap(struct zpci_dev *zdev, struct vfio_pci_device *vdev, .version = zdev->version }; + if (zdev->relaxed_align) + cap.flags |= VFIO_DEVICE_INFO_ZPCI_FLAG_RELAXED; 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 b430939..b0b6596 100644 --- a/include/uapi/linux/vfio_zdev.h +++ b/include/uapi/linux/vfio_zdev.h @@ -43,6 +43,7 @@ struct vfio_device_info_cap_zpci_group { __u64 msi_addr; /* MSI address */ __u64 flags; #define VFIO_DEVICE_INFO_ZPCI_FLAG_REFRESH 1 /* Program-specified TLB refresh */ +#define VFIO_DEVICE_INFO_ZPCI_FLAG_RELAXED 2 /* Relaxed Length and Alignment */ __u16 mui; /* Measurement Block Update Interval */ __u16 noi; /* Maximum number of MSIs */ __u16 maxstbl; /* Maximum Store Block Length */ -- 1.8.3.1