From nobody Sun Nov 24 05:46:55 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=1725990120; cv=none; d=zohomail.com; s=zohoarc; b=nobdRDZfc4/oYcPfMcUUrnt4K7jhDgwyGZyNiOkjwfBgyJo7JML8CEsYDmYSpw13EUQdCMljqpM5MdmutidTu90AH8uiRJfNzGDWwk6kKstEJQRTKaG5r7HlzH/B01KsRX6RnZUvoU1V2o8V5wx5tmd/0KsodDdlT5Pri1vpIpM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725990120; h=Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wp5fR0Hvu5Pg4Js2UfJnh38iG7sgPD+EZT7TLkdyAhI=; b=m8ZOt73TdTrRKw8UFLmKn0Nzi6azk2SScPYjdR/8NMarqCqZqQR8dLniGPyfyyKs52VoarR8bo+0+ne1rdfB2ydt0bV2IwY2dZB7Dt2PKcGZSGOdtZby8Hm1FwKe9pafmHALjRtrXjlLLeTh6rHjQESYEQx8xWA5zPlvUs1xpIY= 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 1725990120371133.4920900851057; Tue, 10 Sep 2024 10:42:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1so4rP-0004p7-Rr; Tue, 10 Sep 2024 13:41:08 -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 1so4qs-0003Aj-OG for qemu-devel@nongnu.org; Tue, 10 Sep 2024 13:40:30 -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 1so4qq-0004sa-GP for qemu-devel@nongnu.org; Tue, 10 Sep 2024 13:40:30 -0400 Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48AHNa8L023332; Tue, 10 Sep 2024 17:40:23 GMT Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41gevcp8nd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Sep 2024 17:40:23 +0000 (GMT) Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 48AHcbu2040856; Tue, 10 Sep 2024 17:40:22 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 41gd9ac5y2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Sep 2024 17:40:22 +0000 Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 48AHeLZN003903; Tue, 10 Sep 2024 17:40:21 GMT Received: from ca-dev63.us.oracle.com (ca-dev63.us.oracle.com [10.211.8.221]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 41gd9ac5xp-1; Tue, 10 Sep 2024 17:40:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id; s=corp-2023-11-20; bh=wp5fR0 Hvu5Pg4Js2UfJnh38iG7sgPD+EZT7TLkdyAhI=; b=clYRs8jiKC+7Y1n0OCBhi2 X2fJK3PtswRDszdnLsFn2fhIgIoi6otdHvU1mHIPRgsS1RRdc9THww+KSk1o/mdB T//epPgwnXeSh+eaIZuVyO9Qp4jPX4LSIyY/28I/yb/5LjQU2pmYKXB88IJz18bg ldxJg9fxUOk6/0THE9Mjypam8uHmcrvEQ8MWcIOVkvyX9e2W6haehtHpljfh4rnd 5RL6ouiZDrpujWz6tKcf87gdYEhCTWSer73Zr4UBBKVsdD+AdZfRhXa2YAFn1tdm V68UAlpLCobhpTSrKVEZIhqPMBlM5flwLg8aqn0y1QxkBfXghgRjrp8zt6VXbbRQ == From: Steve Sistare To: qemu-devel@nongnu.org Cc: Alex Williamson , Cedric Le Goater , Steve Sistare Subject: [PATCH] vfio/iommufd: no hw_info for mediated devices Date: Tue, 10 Sep 2024 10:40:21 -0700 Message-Id: <1725990021-107183-1-git-send-email-steven.sistare@oracle.com> X-Mailer: git-send-email 1.8.3.1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-10_06,2024-09-09_02,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409100131 X-Proofpoint-ORIG-GUID: 0fJXsU_43uVZdn06Oa3D7NVXP8PVhW2H X-Proofpoint-GUID: 0fJXsU_43uVZdn06Oa3D7NVXP8PVhW2H 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=steven.sistare@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: 1725990122002116600 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" IOMMU_GET_HW_INFO fails for a vfio mediated device (aka mdev), because the devid is associated with kernel type IOMMUFD_OBJ_ACCESS, not IOMMUFD_OBJ_DEVICE. Assume IOMMU_HW_INFO_TYPE_NONE and proceed. Signed-off-by: Steve Sistare --- hw/vfio/iommufd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c index cb7257b..d8928d4 100644 --- a/hw/vfio/iommufd.c +++ b/hw/vfio/iommufd.c @@ -635,6 +635,7 @@ static void vfio_iommu_iommufd_class_init(ObjectClass *= klass, void *data) static bool hiod_iommufd_vfio_realize(HostIOMMUDevice *hiod, void *opaque, Error **errp) { + Error *err =3D NULL; VFIODevice *vdev =3D opaque; HostIOMMUDeviceCaps *caps =3D &hiod->caps; enum iommu_hw_info_type type; @@ -645,8 +646,9 @@ static bool hiod_iommufd_vfio_realize(HostIOMMUDevice *= hiod, void *opaque, hiod->agent =3D opaque; =20 if (!iommufd_backend_get_device_info(vdev->iommufd, vdev->devid, - &type, &data, sizeof(data), errp)= ) { - return false; + &type, &data, sizeof(data), &err)= ) { + warn_report_err(err); + type =3D IOMMU_HW_INFO_TYPE_NONE; } =20 hiod->name =3D g_strdup(vdev->name); --=20 1.8.3.1