From nobody Sun May 19 03:12:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.intel.com ARC-Seal: i=1; a=rsa-sha256; t=1696575744; cv=none; d=zohomail.com; s=zohoarc; b=XLnqJVYlGerpeLxkb7rRobCzLLzlP+tAveeht/CPTmrP6gQPrm6XxO5ar8i+XwgVncVihRzTYY1gK/TpYSLBkPLOAqs0XWooJ7Tm6f4eAO7WK2jZT+1UGHmJHrG+fRMYBG5yeoIcFbwku+Z/hJTfwkWOgTSeYzddWic/CJ2P1EU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696575744; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=IFTqGJGe54nR6hsrw1IQP+lfctTK/DVNAWGZPxoIFAQ=; b=e/KEAEb3cMD99u9dtovSj85V8VUmWeDg3eLD9G7oxtQetrO//bHvsR+8NsF75mD0VhNn0OhjLlHbek7iHCf5R4nvFTmamPP7M9zxV+ze4lDaH9hCF5t9aBNPZiH2+JcTkCeD5TgVA9E+F/gqHYdSxye4tSZRJ3KsOaSCeHaYHgQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 169657574424941.904955167759454; Fri, 6 Oct 2023 00:02:24 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-648-KPI7Bxv-OHGgkqj27fZMmw-1; Fri, 06 Oct 2023 03:02:13 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 501B381D79F; Fri, 6 Oct 2023 07:02:10 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 050E5215670B; Fri, 6 Oct 2023 07:02:10 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A42991946A51; Fri, 6 Oct 2023 07:02:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DB668194658F for ; Thu, 5 Oct 2023 23:06:45 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 895D82156711; Thu, 5 Oct 2023 23:06:45 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast09.extmail.prod.ext.rdu2.redhat.com [10.11.55.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8121A215670B for ; Thu, 5 Oct 2023 23:06:45 +0000 (UTC) Received: from us-smtp-inbound-delivery-1.mimecast.com (us-smtp-inbound-delivery-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5E3C429A9D37 for ; Thu, 5 Oct 2023 23:06:45 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-13-cRT6V6VAP1ewLVLNbBhtpw-2; Thu, 05 Oct 2023 19:06:17 -0400 Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2023 16:05:14 -0700 Received: from vivk-mobl.amr.corp.intel.com ([10.209.123.159]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2023 16:05:14 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696575742; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=IFTqGJGe54nR6hsrw1IQP+lfctTK/DVNAWGZPxoIFAQ=; b=edt+0W0hh7buS39xZ1851IuQHHncPKKEe2FB7Sz7uAJ/c1OiTAmuVcZ0zseUSmsPYjo5op 8HCeuZmMDD9OI/IdsA5++fZ02kAdqhYER+hNTfVxRdw58N++i73TN3xN0AjY2Z9y4NE14q UwO71Tj9OtmJAd5eGZo9STr0r1nTkDM= X-MC-Unique: KPI7Bxv-OHGgkqj27fZMmw-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: cRT6V6VAP1ewLVLNbBhtpw-2 X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="373991637" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="373991637" X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="745647267" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="745647267" From: Vivek Kashyap To: libvir-list@redhat.com, ciara.loftus@intel.com, vivek.kashyap@linux.intel.com Subject: [RFC: vf-token 1/5] virpci: Define vf-token Date: Thu, 5 Oct 2023 16:05:00 -0700 Message-Id: <20231005230504.16838-2-vivek.kashyap@linux.intel.com> In-Reply-To: <20231005230504.16838-1-vivek.kashyap@linux.intel.com> References: <20231005230504.16838-1-vivek.kashyap@linux.intel.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mailman-Approved-At: Fri, 06 Oct 2023 07:02:06 +0000 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linux.intel.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1696575745713100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Define the vf-token extension for PCI device Signed-off-by: Vivek Kashyap --- src/util/virpci.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/util/virpci.h b/src/util/virpci.h index faca6cf6f9..b4e9e95d88 100644 --- a/src/util/virpci.h +++ b/src/util/virpci.h @@ -50,7 +50,15 @@ struct _virZPCIDeviceAddress { /* Don't forget to update virPCIDeviceAddressCopy if needed. */ }; =20 +typedef struct _virPCIDeviceToken virPCIDeviceToken; + +struct _virPCIDeviceToken { + unsigned char uuid[VIR_UUID_BUFLEN]; + bool isSet; +}; + #define VIR_PCI_DEVICE_ADDRESS_FMT "%04x:%02x:%02x.%d" +#define VIR_PCI_DEVICE_TOKEN_FMT "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%= 02x-%02x%02x%02x%02x%02x%02x" =20 /* Represents format of PF's phys_port_name in switchdev mode: * 'p%u' or 'p%us%u'. New line checked since value is read from sysfs file. @@ -65,6 +73,7 @@ struct _virPCIDeviceAddress { virTristateSwitch multi; int extFlags; /* enum virPCIDeviceAddressExtensionFlags */ virZPCIDeviceAddress zpci; + virPCIDeviceToken token; /* Don't forget to update virPCIDeviceAddressCopy if needed. */ }; =20 @@ -269,6 +278,8 @@ int virPCIDeviceAddressParse(char *address, virPCIDevic= eAddress *bdf); =20 bool virZPCIDeviceAddressIsIncomplete(const virZPCIDeviceAddress *addr); bool virZPCIDeviceAddressIsPresent(const virZPCIDeviceAddress *addr); +bool virPCIVFIOTokenIDIsPresent(const virPCIDeviceToken *token); +bool virDeviceExtensionIsPresent(const virPCIDeviceAddress *pci); =20 int virPCIGetVirtualFunctionInfo(const char *vf_sysfs_device_path, int pfNetDevIdx, --=20 2.25.1 From nobody Sun May 19 03:12:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.intel.com ARC-Seal: i=1; a=rsa-sha256; t=1696575744; cv=none; d=zohomail.com; s=zohoarc; b=hfGKJJckif1aVPmihf1SXQQtA0Q13ekl0awARNBJ+EyhTO4hWcbV1BBGmtJ8Y6WhoPqjcNXBQYl1wqXdMoavQEHJf6RBZgu3puPaIfr+JjWr5MhlQFHRtRauxwMJlwSUt57CrI/hFiA+TlF64IkzUZAOLIMQa/CzxeON0Jwa7Dw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696575744; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=l9jI5iTTAclfd4yHWmiaC7cSCCMnC5BVbe5jg28MNDk=; b=SypnuXV923xjJGJDq+xubdCsBrC1oQCikvJo4ndfEnI30PLQtDZq3JBuFmGYsJtrdLbqJ+U/fGUzXMkZ/jL/waDdJBomgc0tg6ccsiXSIkWOmmGDEsFXmw3/MQ3quhcmLpsX6+q7GN13mVTBU4VVubygqHY0YlZESokt4INzaEw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1696575744139375.42171799626294; Fri, 6 Oct 2023 00:02:24 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-38-5W4kBvSoPnaaGBCZtAoMeQ-1; Fri, 06 Oct 2023 03:02:15 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F057D3C14788; Fri, 6 Oct 2023 07:02:08 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D4D622156711; Fri, 6 Oct 2023 07:02:08 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 42A9C19466F1; Fri, 6 Oct 2023 07:02:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id F172D194658F for ; Thu, 5 Oct 2023 23:06:25 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id C473F492B05; Thu, 5 Oct 2023 23:06:25 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast10.extmail.prod.ext.rdu2.redhat.com [10.11.55.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BC799492C37 for ; Thu, 5 Oct 2023 23:06:25 +0000 (UTC) Received: from us-smtp-inbound-delivery-1.mimecast.com (us-smtp-inbound-delivery-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9D5B41C06369 for ; Thu, 5 Oct 2023 23:06:25 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-297-ESVdlZa2MCqeoIMysCWh7g-1; Thu, 05 Oct 2023 19:06:18 -0400 Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2023 16:05:14 -0700 Received: from vivk-mobl.amr.corp.intel.com ([10.209.123.159]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2023 16:05:14 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696575742; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=l9jI5iTTAclfd4yHWmiaC7cSCCMnC5BVbe5jg28MNDk=; b=AQdvyKbcd3Xg0Z3uOPdz9fbLoMKryy3EntE3w9PgsCEIHvSDyw4TK56eadMsR2pAuUOs2E KpXccvSFKu2sOLo26HMejrt9yQivJllBHsPvSk6zy6oUY+T4GXxhV1X/grZmpUbmdl/pWW W3dQn6mqdh0oT6rEGNDlxtCVYC564d0= X-MC-Unique: 5W4kBvSoPnaaGBCZtAoMeQ-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: ESVdlZa2MCqeoIMysCWh7g-1 X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="373991639" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="373991639" X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="745647270" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="745647270" From: Vivek Kashyap To: libvir-list@redhat.com, ciara.loftus@intel.com, vivek.kashyap@linux.intel.com Subject: [RFC: vf-token 2/5] qemu: vf-token capability Date: Thu, 5 Oct 2023 16:05:01 -0700 Message-Id: <20231005230504.16838-3-vivek.kashyap@linux.intel.com> In-Reply-To: <20231005230504.16838-1-vivek.kashyap@linux.intel.com> References: <20231005230504.16838-1-vivek.kashyap@linux.intel.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mailman-Approved-At: Fri, 06 Oct 2023 07:02:06 +0000 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linux.intel.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1696575745718100002 Content-Type: text/plain; charset="utf-8"; x-default="true" Introduce qemu capability for vf-token Signed-off-by: Vivek Kashyap --- src/qemu/qemu_capabilities.c | 3 +++ src/qemu/qemu_capabilities.h | 1 + 2 files changed, 4 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 3a1bfbf74d..f84c4df8db 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -698,6 +698,7 @@ VIR_ENUM_IMPL(virQEMUCaps, /* 450 */ "run-with.async-teardown", /* QEMU_CAPS_RUN_WITH_ASYNC_TEARD= OWN */ "virtio-blk-vhost-vdpa", /* QEMU_CAPS_DEVICE_VIRTIO_BLK_VHOS= T_VDPA */ + "vf-token", /* QEMU_CAPS_VFIO_VFTOKEN */ ); =20 =20 @@ -1384,6 +1385,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[= ] =3D { { "virtio-crypto-device", QEMU_CAPS_DEVICE_VIRTIO_CRYPTO }, { "cryptodev-backend-lkcf", QEMU_CAPS_OBJECT_CRYPTO_LKCF }, { "pvpanic-pci", QEMU_CAPS_DEVICE_PANIC_PCI }, + { "vf-token", QEMU_CAPS_VFIO_VFTOKEN }, }; =20 =20 @@ -1446,6 +1448,7 @@ static struct virQEMUCapsDevicePropsFlags virQEMUCaps= DevicePropsVirtioSCSI[] =3D { }; =20 static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsVfioPCI[] = =3D { + { "vf-token", QEMU_CAPS_VFIO_VFTOKEN, NULL },=20 }; =20 static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsSCSIDisk[]= =3D { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 3c4f7f625b..f97b1c9fd5 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -677,6 +677,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ /* 450 */ QEMU_CAPS_RUN_WITH_ASYNC_TEARDOWN, /* asynchronous teardown -run-with = async-teardown=3Don|off */ QEMU_CAPS_DEVICE_VIRTIO_BLK_VHOST_VDPA, /* virtio-blk-vhost-vdpa block= driver */ + QEMU_CAPS_VFIO_VFTOKEN, /* vf-token support */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; --=20 2.25.1 From nobody Sun May 19 03:12:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.intel.com ARC-Seal: i=1; a=rsa-sha256; t=1696575742; cv=none; d=zohomail.com; s=zohoarc; b=claDOBZTamGO098CdZB7c14VCev3HgC2GWOyxTm3y8jRgLRUQ9QGS/oMs3JS1mcbi3yyQMWTK/CM+HM2DWUWe2khm7dfBQ2cjHKZrLFeyMXDUOQ9rBqH1nplQhsHakFcaippmfpuNdAsTmKHQ7vIdoMywlfnnp2i8s7O0StBTZc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696575742; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=omrplJ5DXbdVUBi7nSm2gcgPywdsIfJgLfafMqlPUr4=; b=dfzu5qjdaxgbuRTzG8/Qx+eKJKN0icPBwMIluXs+iDy0W9u3xSEe4v+ioAIzTfvsbsjplko9o3lD6uxmvrAQvcXv9388YgEfC0lAjENqdc6837uZ9xL32O2ZRPejd7c4vN73u+42yhEic4nG2l3x7w79T3+akdmWXex+cY7I0Yg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 16965757424851018.3869030083931; Fri, 6 Oct 2023 00:02:22 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-630-gWV5qGESOCmM3wu-DO36Eg-1; Fri, 06 Oct 2023 03:02:12 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8571A1C0652B; Fri, 6 Oct 2023 07:02:08 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 41DAF40C6EA8; Fri, 6 Oct 2023 07:02:08 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E14FF19465B8; Fri, 6 Oct 2023 07:02:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 21D9D19465A2 for ; Thu, 5 Oct 2023 23:06:22 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 04969111CD24; Thu, 5 Oct 2023 23:06:22 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F0869111CD23 for ; Thu, 5 Oct 2023 23:06:21 +0000 (UTC) Received: from us-smtp-inbound-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D1052101AA42 for ; Thu, 5 Oct 2023 23:06:21 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-297-cPNYiwsIMSivTAazoAiqEA-2; Thu, 05 Oct 2023 19:06:19 -0400 Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2023 16:05:14 -0700 Received: from vivk-mobl.amr.corp.intel.com ([10.209.123.159]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2023 16:05:14 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696575741; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=omrplJ5DXbdVUBi7nSm2gcgPywdsIfJgLfafMqlPUr4=; b=ZwhmsHiGY9Te1E3Cv8A+/9KdR33rpjd7izpU27Ta1fqOkbkBjp7whv6wucRbPyGyQYO05R EIlW0Hr4n84QjsSkv3EFLSu5yq258DphOwf7paId4LtaVCnp35AgAOxKwwrr+TWbVyuEEh /GTfPcblB3OldiDMcQ/zqQhhWBiv6m0= X-MC-Unique: gWV5qGESOCmM3wu-DO36Eg-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: cPNYiwsIMSivTAazoAiqEA-2 X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="373991640" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="373991640" X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="745647273" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="745647273" From: Vivek Kashyap To: libvir-list@redhat.com, ciara.loftus@intel.com, vivek.kashyap@linux.intel.com Subject: [RFC: vf-token 3/5] conf: vf-token flag Date: Thu, 5 Oct 2023 16:05:02 -0700 Message-Id: <20231005230504.16838-4-vivek.kashyap@linux.intel.com> In-Reply-To: <20231005230504.16838-1-vivek.kashyap@linux.intel.com> References: <20231005230504.16838-1-vivek.kashyap@linux.intel.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mailman-Approved-At: Fri, 06 Oct 2023 07:02:06 +0000 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linux.intel.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1696575743611100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Define PCI address extension flag for vf-token Signed-off-by: Vivek Kashyap --- src/conf/device_conf.h | 3 +++ src/conf/domain_addr.h | 1 + src/qemu/qemu_domain_address.c | 3 +++ 3 files changed, 7 insertions(+) diff --git a/src/conf/device_conf.h b/src/conf/device_conf.h index a83377417a..29e03baa99 100644 --- a/src/conf/device_conf.h +++ b/src/conf/device_conf.h @@ -188,6 +188,9 @@ bool virDeviceInfoPCIAddressExtensionIsPresent(const vi= rDomainDeviceInfo *info); int virPCIDeviceAddressParseXML(xmlNodePtr node, virPCIDeviceAddress *addr); =20 +int virPCIDeviceTokenParseXML(xmlNodePtr node, + virPCIDeviceAddress *addr); + void virPCIDeviceAddressFormat(virBuffer *buf, virPCIDeviceAddress addr, bool includeTypeInAddr); diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h index e72fb48847..bca96ee797 100644 --- a/src/conf/domain_addr.h +++ b/src/conf/domain_addr.h @@ -29,6 +29,7 @@ typedef enum { VIR_PCI_ADDRESS_EXTENSION_NONE =3D 0, /* no extension */ VIR_PCI_ADDRESS_EXTENSION_ZPCI =3D 1 << 0, /* zPCI support */ + VIR_PCI_ADDRESS_EXTENSION_VFTOKEN =3D 1 << 1, /* Token support */ } virPCIDeviceAddressExtensionFlags; =20 typedef enum { diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 099778b2a8..3be5acbc9e 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -575,6 +575,9 @@ qemuDomainDeviceCalculatePCIAddressExtensionFlags(virQE= MUCaps *qemuCaps, extFlags |=3D VIR_PCI_ADDRESS_EXTENSION_ZPCI; } =20 + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VFIO_VFTOKEN)) + extFlags |=3D VIR_PCI_ADDRESS_EXTENSION_VFTOKEN; + return extFlags; } =20 --=20 2.25.1 From nobody Sun May 19 03:12:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.intel.com ARC-Seal: i=1; a=rsa-sha256; t=1696575737; cv=none; d=zohomail.com; s=zohoarc; b=dRruW12JG5pOEtGuaNUX2pCqKx7BVFznJTuX/oVYAEiX4HZ48fuTV6/m27mcuVzeHFP4PdrSD653HZywSn/i9izKE6nL/xOt3mf5mu02EdeHD2a6xR0SU0+o0d4t963KCdCKmcoFEGvDG8foOPu7VOb4wWRqOlGVAppIQYaO0Bs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696575737; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=1JmigrwOIp2/SgiVq+pGJl2G4CM6IBEoF99t+bgZdVc=; b=luix6ZAgY2MO4a9Zjx6AWDvYFmaTVuzat8Y21ABJ1US5FKS2M/NtR/PUXHodjV+TwDQCUJC8yYjZ6Oc2VskmbFKgkb/faoSEm/1B5jbudgZpBQebTR7dA9tqSr9jl+ujuJWoN42ZaUqRK8Pqj0Wy+Z8NVnaaG6DZ92/BRHljasM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1696575737869994.6586019446002; Fri, 6 Oct 2023 00:02:17 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-674-DJ3j0T9tMy2N24TuD7s1YQ-1; Fri, 06 Oct 2023 03:02:12 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E22D53C14784; Fri, 6 Oct 2023 07:02:08 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id C47FA140E962; Fri, 6 Oct 2023 07:02:08 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 28CDC19466EB; Fri, 6 Oct 2023 07:02:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5B486194658F for ; Thu, 5 Oct 2023 23:06:27 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4F62E43532A; Thu, 5 Oct 2023 23:06:27 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast08.extmail.prod.ext.rdu2.redhat.com [10.11.55.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4772E47AD4A for ; Thu, 5 Oct 2023 23:06:27 +0000 (UTC) Received: from us-smtp-inbound-delivery-1.mimecast.com (us-smtp-inbound-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 28D663811F22 for ; Thu, 5 Oct 2023 23:06:27 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-389-7ORVwiZtMUyE5d0TSY52Bg-1; Thu, 05 Oct 2023 19:06:20 -0400 Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2023 16:05:14 -0700 Received: from vivk-mobl.amr.corp.intel.com ([10.209.123.159]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2023 16:05:14 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696575736; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=1JmigrwOIp2/SgiVq+pGJl2G4CM6IBEoF99t+bgZdVc=; b=aLY7iQoPalOgF4TJ+Wh+AVMhp/IYkbm3ucpdZ4MJJEtc9xuc0QXU022JguSWtfTzSGVvLU i8zKF1vvMqFZMRrzkdgTtY8hEM+ZSoOBcD9/XUGacE3h12K089axqSJ7+iZ9AJwZW68N92 hN36E0oCB1AvhRGWAXblyqqwsM6ACEM= X-MC-Unique: DJ3j0T9tMy2N24TuD7s1YQ-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: 7ORVwiZtMUyE5d0TSY52Bg-1 X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="373991643" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="373991643" X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="745647276" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="745647276" From: Vivek Kashyap To: libvir-list@redhat.com, ciara.loftus@intel.com, vivek.kashyap@linux.intel.com Subject: [RFC: vf-token 4/5] conf: vf-token parsing and formatting Date: Thu, 5 Oct 2023 16:05:03 -0700 Message-Id: <20231005230504.16838-5-vivek.kashyap@linux.intel.com> In-Reply-To: <20231005230504.16838-1-vivek.kashyap@linux.intel.com> References: <20231005230504.16838-1-vivek.kashyap@linux.intel.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mailman-Approved-At: Fri, 06 Oct 2023 07:02:06 +0000 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linux.intel.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1696575739563100002 Content-Type: text/plain; charset="utf-8"; x-default="true" Introduce XML parsing and formatting of vf-token attribute Signed-off-by: Vivek Kashyap --- src/conf/device_conf.c | 31 +++++++++++++++++++++++++++++-- src/conf/domain_conf.c | 5 +++++ src/conf/schemas/basictypes.rng | 11 +++++++++++ src/conf/schemas/domaincommon.rng | 1 + src/libvirt_private.syms | 1 + src/util/virpci.c | 5 +++++ 6 files changed, 52 insertions(+), 2 deletions(-) diff --git a/src/conf/device_conf.c b/src/conf/device_conf.c index f3d977f2b7..d5ed4ef452 100644 --- a/src/conf/device_conf.c +++ b/src/conf/device_conf.c @@ -188,11 +188,20 @@ virDeviceInfoPCIAddressExtensionIsWanted(const virDom= ainDeviceInfo *info) virZPCIDeviceAddressIsIncomplete(&info->addr.pci.zpci); } =20 +bool +virDeviceExtensionIsPresent(const virPCIDeviceAddress *pci) +{ + return ((pci->extFlags & VIR_PCI_ADDRESS_EXTENSION_ZPCI) && + virZPCIDeviceAddressIsPresent(&pci->zpci)) || + ((pci->extFlags & VIR_PCI_ADDRESS_EXTENSION_VFTOKEN) && + pci->token.isSet); +} + bool virDeviceInfoPCIAddressExtensionIsPresent(const virDomainDeviceInfo *info) { - return (info->addr.pci.extFlags & VIR_PCI_ADDRESS_EXTENSION_ZPCI) && - virZPCIDeviceAddressIsPresent(&info->addr.pci.zpci); + return (info->addr.pci.extFlags !=3D VIR_PCI_ADDRESS_EXTENSION_NONE) && + virDeviceExtensionIsPresent(&info->addr.pci); } =20 int @@ -200,6 +209,7 @@ virPCIDeviceAddressParseXML(xmlNodePtr node, virPCIDeviceAddress *addr) { xmlNodePtr zpci; + xmlNodePtr token; =20 memset(addr, 0, sizeof(*addr)); =20 @@ -231,6 +241,10 @@ virPCIDeviceAddressParseXML(xmlNodePtr node, return -1; } =20 + if ((token =3D virXMLNodeGetSubelement(node, "vf-token"))) + if (virPCIDeviceTokenParseXML(token, addr) < 0) + return -1; + return 0; } =20 @@ -248,6 +262,19 @@ virPCIDeviceAddressFormat(virBuffer *buf, addr.function); } =20 +int +virPCIDeviceTokenParseXML(xmlNodePtr node, + virPCIDeviceAddress *addr) +{ + if (virXMLPropUUID(node, "uuid", VIR_XML_PROP_NONE, + addr->token.uuid) < 0) + return -1; + + addr->token.isSet =3D 1; + + return 0; +} + int virCCWDeviceAddressParseXML(xmlNodePtr node, virCCWDeviceAddress *addr) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 4435ee2ad4..cceb1d3b83 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5389,6 +5389,11 @@ virDomainDeviceInfoFormat(virBuffer *buf, info->addr.pci.zpci.uid.value, info->addr.pci.zpci.fid.value); } + if (virPCIVFIOTokenIDIsPresent(&info->addr.pci.token)) { + virBufferAsprintf(&childBuf, + "\n", + info->addr.pci.token.uuid); + } break; =20 case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE: diff --git a/src/conf/schemas/basictypes.rng b/src/conf/schemas/basictypes.= rng index 26eb538077..bf2c30dd18 100644 --- a/src/conf/schemas/basictypes.rng +++ b/src/conf/schemas/basictypes.rng @@ -138,6 +138,17 @@ + + + + + + + + + + + =20 diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincom= mon.rng index a26986b5ce..b228a3ca73 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -7034,6 +7034,7 @@ + diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 4e475d5b1a..0d4866cd56 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3138,6 +3138,7 @@ virPCIHeaderTypeToString; virPCIIsVirtualFunction; virPCIStubDriverTypeFromString; virPCIStubDriverTypeToString; +virPCIVFIOTokenIDIsPresent; virPCIVirtualFunctionListFree; virZPCIDeviceAddressIsIncomplete; virZPCIDeviceAddressIsPresent; diff --git a/src/util/virpci.c b/src/util/virpci.c index 08b82708b1..dfb0f29182 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -2312,6 +2312,11 @@ virZPCIDeviceAddressIsPresent(const virZPCIDeviceAdd= ress *addr) return addr->uid.isSet || addr->fid.isSet; } =20 +bool +virPCIVFIOTokenIDIsPresent(const virPCIDeviceToken *token) +{ + return token->isSet; +} =20 void virPCIVirtualFunctionListFree(virPCIVirtualFunctionList *list) --=20 2.25.1 From nobody Sun May 19 03:12:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.intel.com ARC-Seal: i=1; a=rsa-sha256; t=1696575749; cv=none; d=zohomail.com; s=zohoarc; b=Wn787Ecb52xTogHCEeep5LBECeb94Vrg/t4DrPwNWURsVeQCtlV0CvkzQ7MfqAPr1KTeSFv18qaDXyzZrB66BRjLyAmui2BhwAfOsbTP9ma2k+WxBO1ac5awVJekgiFMA1cxl/pDTPX4hvhycbdK1sykNfHw2kO53DmEZHEZHK0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696575749; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=b06yo2qPYZiYeTUphurIRNs3/JmgI0PnkRRsNete99A=; b=F37uXacJI+Vx7LCGNZe0WgjdzjO8xFJugON612sRz2OB3j8N+lVxkbJEjc60sSPbU8H5Jkg8bKdbmBBjwdtxz9rflfmNBtA7eSOhqTZc0qTKabfCnn3wY5lDIO+CuUyamAMGZO7iDNX7N04LmfXRJq9oVncOgl5R2Ifj2RTFNz4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1696575749657406.41113986880157; Fri, 6 Oct 2023 00:02:29 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-352-p-upCllHNPSW0Ztbj3y_6A-1; Fri, 06 Oct 2023 03:02:13 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 93372381171C; Fri, 6 Oct 2023 07:02:09 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 781591005E28; Fri, 6 Oct 2023 07:02:09 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 68BF919466FF; Fri, 6 Oct 2023 07:02:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E3211194658F for ; Thu, 5 Oct 2023 23:06:32 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D3A205CC01; Thu, 5 Oct 2023 23:06:32 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CBC32170EE for ; Thu, 5 Oct 2023 23:06:32 +0000 (UTC) Received: from us-smtp-inbound-delivery-1.mimecast.com (us-smtp-inbound-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A8B67101A585 for ; Thu, 5 Oct 2023 23:06:32 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-297-cbmOWr6HPh69umTMn9y6pg-3; Thu, 05 Oct 2023 19:06:21 -0400 Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2023 16:05:14 -0700 Received: from vivk-mobl.amr.corp.intel.com ([10.209.123.159]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2023 16:05:14 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696575748; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=b06yo2qPYZiYeTUphurIRNs3/JmgI0PnkRRsNete99A=; b=UitDAfB3rTCuDOmI5B1ziiZob0W0jb2SLD4800tWCBiT6gXvVDAM3pVf9fVnPGxPWSqOkM x/VSOA++wXBlgkShjVAwdDcKUXQ2/DY2aD3EgfRecJCmgZ4HUig5zsxt/yqZcBjsyJt7a+ VKiilaMBS9HBukzXPbELP2T4llUDPi0= X-MC-Unique: p-upCllHNPSW0Ztbj3y_6A-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: cbmOWr6HPh69umTMn9y6pg-3 X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="373991645" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="373991645" X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="745647279" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="745647279" From: Vivek Kashyap To: libvir-list@redhat.com, ciara.loftus@intel.com, vivek.kashyap@linux.intel.com Subject: [RFC: vf-token 5/5] qemu: validate and generate vf-token on command line Date: Thu, 5 Oct 2023 16:05:04 -0700 Message-Id: <20231005230504.16838-6-vivek.kashyap@linux.intel.com> In-Reply-To: <20231005230504.16838-1-vivek.kashyap@linux.intel.com> References: <20231005230504.16838-1-vivek.kashyap@linux.intel.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mailman-Approved-At: Fri, 06 Oct 2023 07:02:06 +0000 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linux.intel.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1696575751928100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Introduce a validation function for vf-token support in qemu and generate vf-token device attribute in qmeu command line. Signed-off-by: Vivek Kashyap --- src/qemu/qemu_command.c | 27 ++++++++++++++++++++++++--- src/qemu/qemu_validate.c | 19 +++++++++++++++++++ 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 8a7b80719f..91d7836f5c 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1979,7 +1979,6 @@ qemuBuildZPCIDevProps(virDomainDeviceInfo *dev) return props; } =20 - static int qemuCommandAddExtDevice(virCommand *cmd, virDomainDeviceInfo *dev, @@ -4729,6 +4728,8 @@ qemuBuildPCIHostdevDevProps(const virDomainDef *def, pcisrc->addr.slot, pcisrc->addr.function); const char *failover_pair_id =3D NULL; + g_autofree char *token =3D NULL; + int ret =3D 0; =20 /* caller has to assign proper passthrough backend type */ switch (pcisrc->backend) { @@ -4755,13 +4756,33 @@ qemuBuildPCIHostdevDevProps(const virDomainDef *def, teaming->persistent) failover_pair_id =3D teaming->persistent; =20 - if (virJSONValueObjectAdd(&props, + if ((dev->info->pciAddrExtFlags & VIR_PCI_ADDRESS_EXTENSION_VFTOKEN) && + pcisrc->addr.token.isSet) { + const unsigned char *uuid =3D pcisrc->addr.token.uuid; + + token =3D g_strdup_printf(VIR_PCI_DEVICE_TOKEN_FMT, + uuid[0], uuid[1], uuid[2], uuid[3], + uuid[4], uuid[5], uuid[6], uuid[7], + uuid[8], uuid[9], uuid[10], uuid[11], + uuid[12], uuid[13], uuid[14], uuid[15]); + + ret =3D virJSONValueObjectAdd(&props, "s:driver", "vfio-pci", "s:host", host, + "s:vf-token", token, "s:id", dev->info->alias, "p:bootindex", dev->info->effectiveBootIndex, "S:failover_pair_id", failover_pair_id, - NULL) < 0) + NULL); + } else=20 + ret =3D virJSONValueObjectAdd(&props, + "s:driver", "vfio-pci", + "s:host", host, + "s:id", dev->info->alias, + "p:bootindex", dev->info->effectiveBootIndex, + "S:failover_pair_id", failover_pair_id, + NULL); + if (ret < 0) return NULL; =20 if (qemuBuildDeviceAddressProps(props, def, dev->info) < 0) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 93df9e4c8e..d628949597 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1363,6 +1363,23 @@ qemuValidateDomainDeviceDefZPCIAddress(virDomainDevi= ceInfo *info, return 0; } =20 +static int +qemuValidateDomainDeviceDefVFTokenId(virDomainDeviceInfo *info, + virQEMUCaps *qemuCaps) +{ + virPCIDeviceToken *vftoken =3D &info->addr.pci.token; + + if (virPCIVFIOTokenIDIsPresent(vftoken) && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VFIO_VFTOKEN)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", + _("This QEMU binary doesn't support vf token ids")); + return -1; + } + + return 0; +} + =20 static int qemuValidateDomainDeviceDefAddressDrive(virDomainDeviceInfo *info, @@ -1483,6 +1500,8 @@ qemuValidateDomainDeviceDefAddress(const virDomainDev= iceDef *dev, case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI: if (qemuValidateDomainDeviceDefZPCIAddress(info, qemuCaps) < 0) return -1; + if (qemuValidateDomainDeviceDefVFTokenId(info, qemuCaps) < 0) + return -1; break; =20 case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE: --=20 2.25.1