From nobody Thu Sep 19 01:51:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1721390829; cv=none; d=zohomail.com; s=zohoarc; b=M/6Nl28fYUwQwhEdz/i66Sqy+rfVUteLrTHtXwYznSXfPjrjc31LhA0ovyiNNDj9HellmSfm50qKl0uTT90V+jrSOOD9olair2vZz5hp7ns9Lic7x9yyvQhWDv+i/sEhhxUFJooxQFBQEhqbkUa/oJL2omhvY7FgWoZa8+J5MDE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721390829; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=yWVcG5pcUtAmopmRPeMx+I5CcU+oc0+nldMTfm15hTc=; b=nw85d7UegdwPweA5czvE6FOTAopdvBSCANS91/sS+6PKZfPgZdHFkowEdQCdovDZbN3bDMHS7f6oI6JY7I/LnZOx3CFzzjv/VLkbZ0CPa+ucJHR2mOsixBtcSybAB4rVPn962pU7wtREAVe0CX47bfhs7XSMW9s2putZIkqPHbA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721390829959365.7302738402966; Fri, 19 Jul 2024 05:07:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sUmNP-0002vR-Ms; Fri, 19 Jul 2024 08:06:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sUmMo-00025C-2t for qemu-devel@nongnu.org; Fri, 19 Jul 2024 08:05:48 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sUmMk-0005I5-8p for qemu-devel@nongnu.org; Fri, 19 Jul 2024 08:05:40 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46JC5YXL024688; Fri, 19 Jul 2024 12:05:34 GMT Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 40fqub8008-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 19 Jul 2024 12:05:34 +0000 (GMT) Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 46JB97F5039531; Fri, 19 Jul 2024 12:05:33 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 40dwexk3kh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 19 Jul 2024 12:05:33 +0000 Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 46JC5DMP011010; Fri, 19 Jul 2024 12:05:33 GMT Received: from joaomart-mac.nl.oracle.com (dhcp-10-175-12-11.vpn.oracle.com [10.175.12.11]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 40dwexk34j-8; Fri, 19 Jul 2024 12:05:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=corp-2023-11-20; bh=y WVcG5pcUtAmopmRPeMx+I5CcU+oc0+nldMTfm15hTc=; b=jkK2IThH20xXRDq2K 36WShyc6LarsFxS/BoF5CvFUCwf7yR6U/gTP1IIhDoefcHQUrIrWCeq+b44mJy7v 2jgCNbEdq9rE5QiQeSIWm25aeUlAQz8SPmgGCpx3YyCmJFBqpc74+fey7kwP7tJf B0UmKzHN/Vcy7phoPjTRA5J4TGxZy3QJEUqykyuUYSMJPar87NCU8QoPTEaHkZJ9 pCHi/40J7RDfFYCmWLn6yjlqnuL6itUvjBwrU2nf+RkxEpaTP2wPcrtkZMaqrJI3 AebbiPTlcb4IQoYkV3tXq2OBhI8PuQl4RwMzrik8C492UrifoNI+XpcPhddkL8JO 39Egw== From: Joao Martins To: qemu-devel@nongnu.org Cc: Yi Liu , Eric Auger , Zhenzhong Duan , Alex Williamson , Cedric Le Goater , Jason Gunthorpe , Avihai Horon , Joao Martins Subject: [PATCH v5 07/13] vfio/iommufd: Add hw_caps field to HostIOMMUDeviceCaps Date: Fri, 19 Jul 2024 13:04:55 +0100 Message-Id: <20240719120501.81279-8-joao.m.martins@oracle.com> In-Reply-To: <20240719120501.81279-1-joao.m.martins@oracle.com> References: <20240719120501.81279-1-joao.m.martins@oracle.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-19_06,2024-07-18_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=957 malwarescore=0 suspectscore=0 spamscore=0 bulkscore=0 mlxscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2407190093 X-Proofpoint-ORIG-GUID: AEc6oE35W6mmQ0K-ffKdgitTypKKBXTX X-Proofpoint-GUID: AEc6oE35W6mmQ0K-ffKdgitTypKKBXTX Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.220.177.32; envelope-from=joao.m.martins@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @oracle.com) X-ZM-MESSAGEID: 1721390831389116600 Content-Type: text/plain; charset="utf-8" Store the value of @caps returned by iommufd_backend_get_device_info() in a new field HostIOMMUDeviceCaps::hw_caps. Right now the only value is whether device IOMMU supports dirty tracking (IOMMU_HW_CAP_DIRTY_TRACKING). This is in preparation for HostIOMMUDevice::realize() being called early during attach_device(). Signed-off-by: Joao Martins --- include/sysemu/host_iommu_device.h | 4 ++++ hw/vfio/iommufd.c | 1 + 2 files changed, 5 insertions(+) diff --git a/include/sysemu/host_iommu_device.h b/include/sysemu/host_iommu= _device.h index cdeeccec7671..fd03ce766522 100644 --- a/include/sysemu/host_iommu_device.h +++ b/include/sysemu/host_iommu_device.h @@ -19,9 +19,13 @@ * struct HostIOMMUDeviceCaps - Define host IOMMU device capabilities. * * @type: host platform IOMMU type. + * + * @hw_caps: host platform IOMMU capabilities (e.g. on IOMMUFD this repres= ents + * the @out_capabilities value returned from IOMMU_GET_HW_INFO i= octl) */ typedef struct HostIOMMUDeviceCaps { uint32_t type; + uint64_t hw_caps; } HostIOMMUDeviceCaps; =20 #define TYPE_HOST_IOMMU_DEVICE "host-iommu-device" diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c index 028533bc39b9..7a10b1e90a6f 100644 --- a/hw/vfio/iommufd.c +++ b/hw/vfio/iommufd.c @@ -724,6 +724,7 @@ static bool hiod_iommufd_vfio_realize(HostIOMMUDevice *= hiod, void *opaque, =20 hiod->name =3D g_strdup(vdev->name); caps->type =3D type; + caps->hw_caps =3D hw_caps; =20 return true; } --=20 2.17.2