From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6662606A322 for ; Wed, 2 Dec 2026 12:27:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=e/1FZRE9; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=sJaEU144 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xYjQT-0004Fc-WF; Wed, 02 Dec 2026 07:27:10 -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 1xYjQR-0004F9-PT for qemu-devel@nongnu.org; Wed, 02 Dec 2026 07:27:08 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xYjQQ-0001gO-1S for qemu-devel@nongnu.org; Wed, 02 Dec 2026 07:27:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796214423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=S7A+dMqgojeeXw3MReUkclFw21ACMKxPic8/hafbOzE=; b=e/1FZRE9xywlbhm9qtY+Oe1KRAMpf+0ZDsGPlJiK61cRmDF2/MRDSXpugyMnZXBGbeyRJM 8udMtZ7nnHMQRCmyA3X+tXM8JOnof2PMd9HWkxq6TSoi3yTyviFZBLULQzk4FnS6Jzej7s JmnaViz43CjR6QoImtEx44V09iZmROw= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-39-bptUABtWN8qzux-r6qoGOQ-1; Wed, 2 Dec 2026 12:27:01 +0000 X-MC-Unique: bptUABtWN8qzux-r6qoGOQ-1 X-Mimecast-MFC-AGG-ID: bptUABtWN8qzux-r6qoGOQ_1796214420 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4a359c7f47bso109213935e9.2 for ; Wed, 02 Dec 2026 04:27:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1796214420; x=1796819220; darn=nongnu.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=S7A+dMqgojeeXw3MReUkclFw21ACMKxPic8/hafbOzE=; b=sJaEU144fs4s3WR8S3MznoBsKHh/TqjBsY76tBDdLcpmKPeG911FUZDDeBJpRop0s5 ZciZx9rsZQavk6RHNwCXTSASP8y8SVd0KOVLDAGvX/ty6Tzseub8i+MQUpjd0Cpgv7YV ndPdfBmyESb89DSx9SqQhv5U+ZOBRiuIcWJtNEeaAEP1jR0egJ5UxkmuMAbfnL5T23UI OPsaJNG10l4MwKDlpd9ooryVzPaOPuDQXe2uJuA9MP4n9GPEiZkRJs2ERum3rlfaGxWo BZ3QbK9EGnMwp9Hduco2fCO1Zf7VHxamGhfgtP8TRlfARuxkzy+kNZ8Fj8X7TBYQJszl pjGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796214420; x=1796819220; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=S7A+dMqgojeeXw3MReUkclFw21ACMKxPic8/hafbOzE=; b=cDdfBsG3LNpUNMKQ/JtW+jw3JQljr9C5YCqcb8pBTHigKw2MO5EgsXvkdUk8umpvyP TgGpa11inewx/AvSfBoSmBO3ANXciECO0rsAT3YcPhoDbaECjpsfJ4h7H5MmIg0S18Tt cfleqefrVDLbBLAQAg/unX6WeUQYTRC5yQYO3S+RuzthUfQlm5bQwYP6TgnpOcDF8bsV i+OU23crqT2AaMLHM8e3RfG+pfJUDVmQR7U5wMWkka7ft2GdOK+n71K46ce+r3knqBEk 2ToR712lY7hSLerLs3AgmdZq+DVem+BdIgp/0eWSqPWTAD9pEeELsVPPFSnbRrH9+f1l TLeA== X-Gm-Message-State: APuU4Z97Tx6DspQsi9OneYEGFZwWgQ43C4GDcRj/QWal0Zo+Ay/kL6RU 1drmz6Wm2fbk63J3mFr4vTeiy0xtoxD2VclV6NBtpWahxkc/042f5XtkCsPDzJouhvynzzn0pkI 1XYEr86okBOnyEI4LY2KkLfqXPClB2c3X0fqdUr+6NoPSlutO46y86sDR X-Gm-Gg: AZFdTZe3hMRUMNi4oV/OtFuG54D0CLwO9FmRiifjh2m4U7MYAORL2oB1HMUg2DBUPus 3EGmrIOazOgU8RJk7IErSR7iQHZgCHo1tHkDPFZA44Ygjdnpo/5l/klgVCtY2bch8ONoS3l90J9 rH5MLlP63v1Hkb/oYBpyHsQ9/k+HNNhrLZIsJ1Pf5fsrzkvvJec+9aPvP/k33CpqLtXVIWXbF5/ 2cHKZnxUrHMpsEHy1J+o4/7VWIMdPf+O9/Nf4tsDPWteJTQoNym/vbJOWB38H99mF681gBq1egC 22N23L6DCqPKT04DTGcIFKtoGkCyfs5TlLIuHrf1/QyvqJds32uFbKJnr9jY1MrYCfwBs5qmVv3 iMtITTbVIukpnScbVkayG20vikGdYZZ7Fyhl0MZewRA== X-Received: by 2002:a05:600c:3509:b0:4bb:76f6:d23a with SMTP id 5b1f17b1804b1-4bb88814d16mr827027495e9.21.1796214420331; Wed, 02 Dec 2026 04:27:00 -0800 (PST) X-Received: by 2002:a05:600c:3509:b0:4bb:76f6:d23a with SMTP id 5b1f17b1804b1-4bb88814d16mr827026885e9.21.1796214419709; Wed, 02 Dec 2026 04:26:59 -0800 (PST) Received: from redhat.com ([2a0d:6fc0:153a:4c00:6468:7acf:febf:a046]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb9067a0e6sm593203025e9.4.2026.12.02.04.26.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 04:26:59 -0800 (PST) Date: Wed, 2 Dec 2026 07:26:56 -0500 From: "Michael S. Tsirkin" To: Alex Fishman Cc: qemu-devel@nongnu.org Subject: Re: [PATCH] virtio-pci: add a PCIe Device Serial Number (DSN) Message-ID: <20261202072459-mutt-send-email-mst@kernel.org> References: <20261202104935.29518-1-afishman@redhat.com> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261202104935.29518-1-afishman@redhat.com> Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.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_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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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: qemu development List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Wed, Dec 02, 2026 at 12:49:35PM +0200, Alex Fishman wrote: > 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 If it's designed for actual users, it can not start with x- - these are not guaranteed to be stable across releases. > --- > 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, Error **errp) > proxy->last_pcie_cap_offset += PCI_EXT_CAP_ATS_SIZEOF; > } > > + if (proxy->dsn) { > + pcie_dev_ser_num_init(pci_dev, proxy->last_pcie_cap_offset, > + proxy->dsn); > + proxy->last_pcie_cap_offset += PCI_EXT_CAP_DSN_SIZEOF; > + } > + Need to make sure users do not set this with non pcie devices. > /* Set Function Level Reset capability bit */ > pcie_cap_flr_init(pci_dev); > } else { > @@ -2415,6 +2421,7 @@ static const Property virtio_pci_properties[] = { > 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), > }; > > 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]; > > -- > 2.54.0 (Apple Git-157)