From owner-svn-src-stable@freebsd.org Wed Jun 14 13:23:42 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 365FED8DC3A; Wed, 14 Jun 2017 13:23:42 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF6F12E1E; Wed, 14 Jun 2017 13:23:41 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5EDNfjO090558; Wed, 14 Jun 2017 13:23:41 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5EDNf8W090557; Wed, 14 Jun 2017 13:23:41 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201706141323.v5EDNf8W090557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexuan set sender to dexuan@FreeBSD.org using -f From: Dexuan Cui Date: Wed, 14 Jun 2017 13:23:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r319941 - stable/10/sys/dev/hyperv/pcib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jun 2017 13:23:42 -0000 Author: dexuan Date: Wed Jun 14 13:23:40 2017 New Revision: 319941 URL: https://svnweb.freebsd.org/changeset/base/319941 Log: MFC: 319690 r319690 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 Sponsored by: Microsoft Modified: stable/10/sys/dev/hyperv/pcib/vmbus_pcib.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/pcib/vmbus_pcib.c ============================================================================== --- stable/10/sys/dev/hyperv/pcib/vmbus_pcib.c Wed Jun 14 08:01:53 2017 (r319940) +++ stable/10/sys/dev/hyperv/pcib/vmbus_pcib.c Wed Jun 14 13:23:40 2017 (r319941) @@ -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);