From nobody Sun Dec 6 20:46:08 2026 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1796208675; cv=none; d=zohomail.com; s=zohoarc; b=NbTNtG1R3kyAWxjHJbTP6YsGBUWzbrRTfjthFV4UGyLPmBxXcYYhb07f3N0/QXDPFShICBSWZQb+jbo8ctZmQgwz3+zRo/2hgUtUANFlfqbG59/K99bY5REVvhJZa0P83PLaHBg8tLwQqvKNg6sjrGRqPWGQAr7POK5OJj+Ujz4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1796208675; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ipBKcilfqSgUHi84eLhjUwttbn9EOiE3pGQLOpvmzao=; b=fxCrT+dY8aGlHtWGxWbJvwZx2AxGE4YM/E3yaOl9CPlaITI3VVj/S0VO8JnRbuz01qBdo6NPXd4qFSGsTE89FX1KlXXXb5ySecVSgSLKLNXrHzNbXRChx+dPDm2ZFRpwVIsLhWzYlY6XGNxm6SQdNq7QOPqSLSBEpmavcyNprGg= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1796208675417682.9093240217197; Wed, 2 Dec 2026 02:51:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xYhvZ-00019f-5W; Wed, 02 Dec 2026 05:51:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xYhvX-00019R-Gi for qemu-devel@nongnu.org; Wed, 02 Dec 2026 05:51:07 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xYhvV-00071t-KQ for qemu-devel@nongnu.org; Wed, 02 Dec 2026 05:51:07 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-241-3l0J-gt-NHGN8FejmCe0Ww-1; Wed, 2 Dec 2026 10:49:54 +0000 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3721F1933E10 for ; Wed, 2 Dec 2026 10:49:53 +0000 (UTC) Received: from Alexs-MacBook-Air.redhat.corp (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EE88018088B6; Wed, 2 Dec 2026 10:49:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796208665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ipBKcilfqSgUHi84eLhjUwttbn9EOiE3pGQLOpvmzao=; b=QImPmwBicfgr3wqPg5q6ZUfiYNbsBd43CpiVW+lSl1XISK9qQLyrv4AR2Cw1QKo52qssVq QR5HxfeeH9sUFFjyg2Vjm00OQUta6bI8+IyPDBOmH98/7u3oc77KRKmdlWzWBQElcmJFHd dHViyCiLkDS/jVR+ThVDAtDdHuB87KY= X-MC-Unique: 3l0J-gt-NHGN8FejmCe0Ww-1 X-Mimecast-MFC-AGG-ID: 3l0J-gt-NHGN8FejmCe0Ww_1796208593 From: Alex Fishman To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" Subject: [PATCH] virtio-pci: add a PCIe Device Serial Number (DSN) Date: Wed, 2 Dec 2026 12:49:35 +0200 Message-ID: <20261202104935.29518-1-afishman@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=afishman@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @redhat.com) X-ZM-MESSAGEID: 1796208677238158500 Content-Type: text/plain; charset="utf-8" Add a 64-bit x-pcie-dsn property to the shared virtio-pci transport. This lets a user supply a stable PCIe identity for endpoints such as virtio-blk devices and virtio-scsi controllers. When Windows processes the PCIe DSN capability, it can use the DSN to construct a PnP instance ID that remains stable across PCI topology changes. Signed-off-by: Alex Fishman --- hw/virtio/virtio-pci.c | 7 +++++++ include/hw/virtio/virtio-pci.h | 1 + 2 files changed, 8 insertions(+) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 9ff8b63..f2f6cb6 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -2306,6 +2306,12 @@ static void virtio_pci_realize(PCIDevice *pci_dev, E= rror **errp) proxy->last_pcie_cap_offset +=3D PCI_EXT_CAP_ATS_SIZEOF; } =20 + if (proxy->dsn) { + pcie_dev_ser_num_init(pci_dev, proxy->last_pcie_cap_offset, + proxy->dsn); + proxy->last_pcie_cap_offset +=3D PCI_EXT_CAP_DSN_SIZEOF; + } + /* Set Function Level Reset capability bit */ pcie_cap_flr_init(pci_dev); } else { @@ -2415,6 +2421,7 @@ static const Property virtio_pci_properties[] =3D { VIRTIO_PCI_FLAG_PM_NO_SOFT_RESET_BIT, false), DEFINE_PROP_BIT("aer", VirtIOPCIProxy, flags, VIRTIO_PCI_FLAG_AER_BIT, false), + DEFINE_PROP_UINT64("x-pcie-dsn", VirtIOPCIProxy, dsn, 0), }; =20 static void virtio_pci_dc_realize(DeviceState *qdev, Error **errp) diff --git a/include/hw/virtio/virtio-pci.h b/include/hw/virtio/virtio-pci.h index b2738ce..d4f3ba7 100644 --- a/include/hw/virtio/virtio-pci.h +++ b/include/hw/virtio/virtio-pci.h @@ -141,6 +141,7 @@ struct VirtIOPCIProxy { uint32_t nvectors; uint32_t dfselect; uint32_t gfselect; + uint64_t dsn; uint32_t guest_features[VIRTIO_FEATURES_NU32S]; VirtIOPCIQueue vqs[VIRTIO_QUEUE_MAX]; =20 --=20 2.54.0 (Apple Git-157)