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 8A640606A323 for ; Wed, 2 Dec 2026 12:39:08 +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=Gf3pcRlF; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=rpnOfdWJ Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xYjbU-0006Zc-2Y; Wed, 02 Dec 2026 07:38:32 -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 1xYjb0-0006MM-UD for qemu-devel@nongnu.org; Wed, 02 Dec 2026 07:38:04 -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 1xYjaz-0005ux-73 for qemu-devel@nongnu.org; Wed, 02 Dec 2026 07:38:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796215079; 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=6mb193ZJRGm0yJdPEy0yls1UtvyAXlYz8AADlch9TXA=; b=Gf3pcRlFj68pSVuIHC1yqasrIx3dwgr72YmlKuGYeconhKzUnYdrE3Q0pTlgGXxMM3gKFy hIsJCFeQT+Yp53auAe6bavuQmRvbfBZT9/4Cl5O1Mj/8wi43wEqwKQXPZlh8zsbXVHWAF0 hs5GbXTO4O3pbzBSk0H4CWHUxgGSYqM= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-253-QCEXzNa5PSS76yDBxoEjjA-1; Wed, 2 Dec 2026 12:37:57 +0000 X-MC-Unique: QCEXzNa5PSS76yDBxoEjjA-1 X-Mimecast-MFC-AGG-ID: QCEXzNa5PSS76yDBxoEjjA_1796215076 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-48c6a1d4034so7922597f8f.0 for ; Wed, 02 Dec 2026 04:37:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1796215076; x=1796819876; 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=6mb193ZJRGm0yJdPEy0yls1UtvyAXlYz8AADlch9TXA=; b=rpnOfdWJg66DzOs/26TeXUfk63wtd+nGz0VCInuiQFX25Eo6IPXlT856/EgrOfwb7q xGp13qWbmJ7tZM9+9MuOatJZjFHQPsNk6X8RnP4NysKA+lPuOT1pjb5JTIEb18UG5yWA 1GfnswLavIed+1yvZGTy4snYT2ga4YxbR5hqALTywPLAWhMe6ML9yqUXddOAxAGeu158 XgoH6wjp2bN8GH/K0h49q+4Bu2Pm65Np6pS7jer3/v5S6rxNRhNY8SKvEI6+PtOkMGeV xBGdPQrFczE3r7gFpoqpgF2HtXJbw6skFN2mCBUnIqvx+jjSMY0gydzr0EzB3NzHZlev qlYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796215076; x=1796819876; 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=6mb193ZJRGm0yJdPEy0yls1UtvyAXlYz8AADlch9TXA=; b=mahLVhJupD2H4JOr4EbCWxc2JBHNpImTIOmNdbupgndxhelxTO3kBnRszJ3/h9f11d 8bo+uSDAlTEkwb4HLaSDd+e9p/y1LaOwlt3AXf5Dl/+fiD99hkwNZgC1jobx6VQxCsTb cHFjup7Nbu/4g/rgLVTVxfc2pctqHsD8cgRWuUcLJYYV+dNKVrzwiuDtyYbwbFEDW340 /2PeIv0pOSxWj5inI/8fTT7NKvQvB/CsZEKrEvgYTwVR2wfJTeOVpuDRCng8z3m03mjO GgagkOJxWAC4g+PJ1b49MHYvvnxrD3iuReYMGaYrVxoz42IWGWuNTnePaF6dZJlfY+wz 7t2g== X-Gm-Message-State: APuU4Z9bPCD6ZK4vv9OFXSGTWxwZ8v7H18Np+a/9rS9ZgxHT+SIhubN8 yCKIbWVxlXlpH2fqObMfQxSmvZyI/xyMY9QX3T1PJfjAnjki3cmyzGMVRAG3lBoI0Kp+UpdKYOT e+o+gSQMZu7rHo0ecX0TZwSYCsf5y8RJj3oJlZrSzF/WjDMOLk7lcVcTO X-Gm-Gg: AZFdTZcQO2HFSMSdFlIuuJB3M4/kIiwtN/MyhFskgv6CVETTx1nEjVu155e+bz6GFyV U3q5Ac7p0uF5SJjJm75St5wsqCTQS27zxCA+A060EvCclZkdV2epym5xNx7SK5lVs4EtQEcKAIu 2hcoxkYTke8NLs+Tfu9HeIC2QTJy8yQhXidR8XmBWU2o0nYgrqntOnj1fVxII3h4Ln0A+kub/R1 lIf0LqWrCjB5nU+mosm4VzRFgJQS9AS6dzbKqDGG7o9cggJvqlX85GN/gw/P+2sU0Z4YKZLueLk lTYtaqsSkGy/tb38vBZBNXMrJ9TSDRyEMd3LDdwQuAXej6n9a7OxzAuIyu+0YI2J0ShHSN0E+Yc R2uKDv8gKUTCea/gEjmbMkRpi1SlzeNQ8F/6g414yXA== X-Received: by 2002:a05:6000:4284:b0:4c9:3c6e:1a0e with SMTP id ffacd0b85a97d-4c93c6e3755mr11226540f8f.50.1796215076029; Wed, 02 Dec 2026 04:37:56 -0800 (PST) X-Received: by 2002:a05:6000:4284:b0:4c9:3c6e:1a0e with SMTP id ffacd0b85a97d-4c93c6e3755mr11226493f8f.50.1796215075466; Wed, 02 Dec 2026 04:37:55 -0800 (PST) Received: from redhat.com ([2a0d:6fc0:153a:4c00:6468:7acf:febf:a046]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4bef07f9e0dsm27271098f8f.53.2026.12.02.04.37.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 04:37:54 -0800 (PST) Date: Wed, 2 Dec 2026 07:37:52 -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: <20261202073654-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 > --- > 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; > + } > + > /* 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), maybe "dns"? And maybe, UI64_NULL? > }; > > 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; why here, in the middle of the virtio transport implementation? > uint32_t guest_features[VIRTIO_FEATURES_NU32S]; > VirtIOPCIQueue vqs[VIRTIO_QUEUE_MAX]; > > -- > 2.54.0 (Apple Git-157)