From owner-svn-src-stable@freebsd.org Wed Jun 14 13:44:33 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 E3FCBD8E2D6; Wed, 14 Jun 2017 13:44:33 +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 B37163974; Wed, 14 Jun 2017 13:44:33 +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 v5EDiW0c098773; Wed, 14 Jun 2017 13:44:32 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5EDiWjT098772; Wed, 14 Jun 2017 13:44:32 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201706141344.v5EDiWjT098772@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:44:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r319943 - stable/11/sys/dev/hyperv/pcib X-SVN-Group: stable-11 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:44:34 -0000 Author: dexuan Date: Wed Jun 14 13:44:32 2017 New Revision: 319943 URL: https://svnweb.freebsd.org/changeset/base/319943 Log: MFC: 319690 Approved by: re (marius) 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/11/sys/dev/hyperv/pcib/vmbus_pcib.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/pcib/vmbus_pcib.c ============================================================================== --- stable/11/sys/dev/hyperv/pcib/vmbus_pcib.c Wed Jun 14 13:34:09 2017 (r319942) +++ stable/11/sys/dev/hyperv/pcib/vmbus_pcib.c Wed Jun 14 13:44:32 2017 (r319943) @@ -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);