From nobody Tue Nov 26 08:28:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=ixsystems.com ARC-Seal: i=1; a=rsa-sha256; t=1582353724; cv=none; d=zohomail.com; s=zohoarc; b=KHXiRu3G0q6Ww9ovyT5qyxnIVAhXNBztHza32khxh4DZYiif6cStLjvEvQXcgDrQurqj+5vWio3U5bcxHL3egdNQ4zIKiglw+mMR1yIPd5A8JzJ252yqQCh4q84J0hVWN1XO2ls6CrbG6jWbghLbfmU+QTMCgwWtoVtrR3RkrSA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582353724; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yd29tU3zoaHnkt6wmasRl7FXCqrJQaiJd1komoxu/xw=; b=L0B6IB2pdzVgzFA5Bz3gSWPdHUDiYo4TXDkrFf8285yXQSTa4or73Gv3qP61WPuzRtQL5TZuoY6uCQtalPHX1E3buyNTPmffXUg2gLWksy0GRKP4YmqEXuY5472tD+XYWPKFKkUTvLfX43IlkiQHckvYrt7eaRI3K8SQrASWvOE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1582353724756256.60886030323104; Fri, 21 Feb 2020 22:42:04 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-27-nN0wQH-DMLifmRnEY70smg-1; Sat, 22 Feb 2020 01:41:30 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AF5A8107ACCD; Sat, 22 Feb 2020 06:41:24 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 82A2E60BE0; Sat, 22 Feb 2020 06:41:24 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 33CE6860CD; Sat, 22 Feb 2020 06:41:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01M6eEHU021866 for ; Sat, 22 Feb 2020 01:40:14 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5080B1032547; Sat, 22 Feb 2020 06:40:14 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 493FE1032523 for ; Sat, 22 Feb 2020 06:40:11 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A017F8007C9 for ; Sat, 22 Feb 2020 06:40:11 +0000 (UTC) Received: from mail-yw1-f48.google.com (mail-yw1-f48.google.com [209.85.161.48]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-107-IUlEnnffOG6fcnMjjP5CmA-1; Sat, 22 Feb 2020 01:40:09 -0500 Received: by mail-yw1-f48.google.com with SMTP id 192so2654745ywy.0 for ; Fri, 21 Feb 2020 22:40:09 -0800 (PST) Received: from xeon-freebsd.freqlabs.com. (69-228-200-148.lightspeed.knvltn.sbcglobal.net. [69.228.200.148]) by smtp.gmail.com with ESMTPSA id c84sm2482131ywa.1.2020.02.21.22.40.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Feb 2020 22:40:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582353722; 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=yd29tU3zoaHnkt6wmasRl7FXCqrJQaiJd1komoxu/xw=; b=X91s6htxXqVAkmdeQYrW5FObdmASIBAA+F5i4jJO2AzFaFLQx/JNxkfkHMEnxXUS4IEmfo G7arad4mMq4sworhTD/Jf2M9v/A5im6Yz71U4Ql7YPS//KRKZglnT/d84/HOXSj083G1pT 6B/GE4lPFwgpRcMdhTuIB3CAYyw0aaA= X-MC-Unique: nN0wQH-DMLifmRnEY70smg-1 X-MC-Unique: IUlEnnffOG6fcnMjjP5CmA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FF+CsBuGwhA1c8jVXzSEy0rRgRKjEoIZHVFOoi7U5TQ=; b=hH9Hq4Hyj7LB6TCDgiU3rOcrfXxcykNjEUURn/yfRJXFTW86uoffo849w8R0DCfTFX dzSEVZstuxQ4jzER1MsYquNgEhK6tGbFLvL+3QN4pTqXEvKgOIUNtdwm+nOCDVWH4Yo9 WaBb3L5FlvrkmC7KHoqpFwGWJgE4Xex3qKWlF2G6X5oJVm89rheUmvsqe3W5zMFY8ESK vkushTPMIFYBIS1B4AayFm2dNDgQJCubGbVozlAp5g2K2EzrvJXVqQxX7b+cB3MJ47/h KfDYQT2tRCqOQ5PqHB9jG82tfQpiLfComiPKBNk0caVgBdTSYXpSHZMDEde8uSkgIyO5 ONsA== X-Gm-Message-State: APjAAAXWjPr8qR12Ztj32OOknRZ7EW99GlrNbuRkooWJCv7ICAkq3tjm UPQxSFnHfjMQxAppQIghHcSZut5Mo7SZBOGc4IFbb8lypZE9Bqy/unBp80HT3vED3mcXYa5kuhl xXVk6riknE4KCTu4chAEU1Oni9Lpr5/z0JusITjSacFOoLy6anoAXQ9t3upFDgI0zaQU= X-Google-Smtp-Source: APXvYqz3hMCO8MdxIQw37zFwB+BhQr/w3dZz1Ly8IgX9tL2X35Xkurym4dr++jJuyJXZv80uVBn4fw== X-Received: by 2002:a25:fc27:: with SMTP id v39mr11542974ybd.473.1582353608223; Fri, 21 Feb 2020 22:40:08 -0800 (PST) From: Ryan Moeller X-Google-Original-From: Ryan Moeller To: libvir-list@redhat.com Subject: [PATCH 16/16] Allow PCI functions up to 255 for PCI ARI Date: Sat, 22 Feb 2020 01:38:55 -0500 Message-Id: <20200222063855.89637-17-ryan@iXsystems.com> In-Reply-To: <20200222063855.89637-1-ryan@iXsystems.com> References: <20200222063855.89637-1-ryan@iXsystems.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 01M6eEHU021866 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" PCI Alternative Routing-ID Interpretation (ARI) capable devices use an implied Device Number of 0 and repurpose those bits to allow for 256 Function Numbers instead of 8. An example of such a device is the Chelsio T580-LP-CR, which uses the additional function numbers to provide Virtual Function (VF) features. Below is an excerpt from the `pciconf -lvc` output for this device when a few VFs are configured: ppt7@pci0:5:0:21: class=3D0x020000 card=3D0x00001425 chip=3D0x5810142= 5 rev=3D0x00 hdr=3D0x00 vendor =3D 'Chelsio Communications Inc' device =3D 'T580-LP-CR Unified Wire Ethernet Controller [VF]' class =3D network subclass =3D ethernet cap 10[70] =3D PCI-Express 2 endpoint max data 256(2048) FLR NS link x0(x8) speed 0.0(8.0) ASPM disabled(L0s/L1) cap 11[b0] =3D MSI-X supports 8 messages Table in map 0x20[0x0], PBA in map 0x20[0x8000] cap 05[50] =3D MSI supports 32 messages, 64 bit, vector masks ecap 0001[100] =3D AER 2 0 fatal 0 non-fatal 0 corrected ecap 000e[140] =3D ARI 1 ecap 0017[150] =3D TPH Requester 1 Of note: the Bus/Device/Function 5/0/21 and the ARI ecap. Attempting to pass this through to a VM as a PCI device produces a validation error due to the function number being out of range. To enable use of devices that use ARI, relax the schema and validity check for PCI addresses to permit function numbers up to 255. Update a few tests to give coverage. Ref: https://pcisig.com/sites/default/files/specification_documents/ECN-alt= -rid-interpretation-070604.pdf Signed-off-by: Ryan Moeller --- docs/schemas/basictypes.rng | 10 +--------- src/util/virpci.c | 4 ++-- tests/bhyveargv2xmldata/bhyveargv2xml-passthru.args | 2 +- tests/bhyveargv2xmldata/bhyveargv2xml-passthru.xml | 2 +- tests/bhyvexml2argvdata/bhyvexml2argv-passthru.args | 2 +- tests/bhyvexml2argvdata/bhyvexml2argv-passthru.xml | 2 +- tests/bhyvexml2xmloutdata/bhyvexml2xmlout-passthru.xml | 2 +- 7 files changed, 8 insertions(+), 16 deletions(-) diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng index 81465273c8..03ce3f3be3 100644 --- a/docs/schemas/basictypes.rng +++ b/docs/schemas/basictypes.rng @@ -341,15 +341,7 @@ - - - (0x)?[0-7] - - - 0 - 7 - - + =20 diff --git a/src/util/virpci.c b/src/util/virpci.c index 0b1222373e..d60cf5eff7 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -1302,11 +1302,11 @@ virPCIDeviceAddressIsValid(virPCIDeviceAddressPtr a= ddr, addr->slot); return false; } - if (addr->function > 7) { + if (addr->function > 255) { if (report) virReportError(VIR_ERR_XML_ERROR, _("Invalid PCI address function=3D0x%x, " - "must be <=3D 7"), + "must be <=3D 255"), addr->function); return false; } diff --git a/tests/bhyveargv2xmldata/bhyveargv2xml-passthru.args b/tests/bh= yveargv2xmldata/bhyveargv2xml-passthru.args index 697bafd642..726dade59e 100644 --- a/tests/bhyveargv2xmldata/bhyveargv2xml-passthru.args +++ b/tests/bhyveargv2xmldata/bhyveargv2xml-passthru.args @@ -5,4 +5,4 @@ -P \ -S \ -s 0:0,hostbridge \ --s 0:1:0,passthru,5/0/7 bhyve +-s 0:1:0,passthru,5/0/9 bhyve diff --git a/tests/bhyveargv2xmldata/bhyveargv2xml-passthru.xml b/tests/bhy= veargv2xmldata/bhyveargv2xml-passthru.xml index af99279448..a8d7a574af 100644 --- a/tests/bhyveargv2xmldata/bhyveargv2xml-passthru.xml +++ b/tests/bhyveargv2xmldata/bhyveargv2xml-passthru.xml @@ -18,7 +18,7 @@ -
+
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-passthru.args b/tests/bh= yvexml2argvdata/bhyvexml2argv-passthru.args index c268da957c..afa99344af 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-passthru.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-passthru.args @@ -7,5 +7,5 @@ -P \ -s 0:0,hostbridge \ -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE-devel.fd \ --s 0:3:0,passthru,5/0/7 \ +-s 0:3:0,passthru,5/0/9 \ -s 1,lpc bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-passthru.xml b/tests/bhy= vexml2argvdata/bhyvexml2argv-passthru.xml index ba0744f35d..e8b3a4064f 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-passthru.xml +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-passthru.xml @@ -14,7 +14,7 @@ -
+
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-passthru.xml b/tests= /bhyvexml2xmloutdata/bhyvexml2xmlout-passthru.xml index 0313fa0dfa..7f96831df9 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-passthru.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-passthru.xml @@ -21,7 +21,7 @@ -
+
--=20 2.24.1