Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Jun 2017 12:11:30 +0000 (UTC)
From:      Dexuan Cui <dexuan@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r319690 - head/sys/dev/hyperv/pcib
Message-ID:  <201706081211.v58CBUXr064784@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dexuan
Date: Thu Jun  8 12:11:30 2017
New Revision: 319690
URL: https://svnweb.freebsd.org/changeset/base/319690

Log:
  hyperv/pcib: use the device serial number as PCI domain
  
  Currently the PCI domain is initialized with the instance GUID in
  vmbus_pcib_attach(). It turns out the GUID can change across VM reboot,
  while some users want a persistent value for PCI domain. The solution is
  that we can change to use the device serial number, which starts with 1
  and is unique within a VM.
  
  Obtained from:	Haiyang Zhang
  MFC after:	1 day
  Sponsored by:	Microsoft

Modified:
  head/sys/dev/hyperv/pcib/vmbus_pcib.c

Modified: head/sys/dev/hyperv/pcib/vmbus_pcib.c
==============================================================================
--- head/sys/dev/hyperv/pcib/vmbus_pcib.c	Thu Jun  8 08:10:57 2017	(r319689)
+++ head/sys/dev/hyperv/pcib/vmbus_pcib.c	Thu Jun  8 12:11:30 2017	(r319690)
@@ -574,6 +574,8 @@ new_pcichild_device(struct hv_pcibus *hbus, struct pci
 	hpdev->desc = *desc;
 
 	mtx_lock(&hbus->device_list_lock);
+	if (TAILQ_EMPTY(&hbus->children))
+		hbus->pci_domain = desc->ser & 0xFFFF;
 	TAILQ_INSERT_TAIL(&hbus->children, hpdev, link);
 	mtx_unlock(&hbus->device_list_lock);
 	return (hpdev);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706081211.v58CBUXr064784>