RE: svn commit: r308725 - in head/sys: conf dev/hyperv/pcib modules/hyperv/pcib

2016-11-17 Thread Dexuan Cui via svn-src-all
> From: Dexuan Cui [mailto:de...@microsoft.com]
> > From: Ngie Cooper [mailto:yaneurab...@gmail.com]
> > Sent: Friday, November 18, 2016 05:37
> > To: Andreas Tobler 
> > On Thu, Nov 17, 2016 at 9:46 AM, Andreas Tobler 
> > wrote:
> > > On 16.11.16 10:25, Dexuan Cui wrote:
> > >>
> > >> Author: dexuan
> > >> Date: Wed Nov 16 09:25:00 2016
> > >> New Revision: 308725
> >
> > > -dev/hyperv/pcib/pcib.c optionalhyperv
> > > +dev/hyperv/pcib/pcib.c optionalhyperv pci
> >
> > This seems to be causing Jenkins failures too:
> > Doesn't sys/modules/hyperv/vmbus/Makefile need pci_if.h now in SRCS?
> > Thanks,
> > -Ngie
> 
> Hi Ngie, Andreas,
> Thanks for the reminder!  I'll fix this ASAP.
> Now I'm testing local changes and will report back shortly.
 
Hi, I committed a patch to fix the issue just now.

Thanks,
-- Dexuan
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


RE: svn commit: r308725 - in head/sys: conf dev/hyperv/pcib modules/hyperv/pcib

2016-11-17 Thread Dexuan Cui via svn-src-all
> From: Ngie Cooper [mailto:yaneurab...@gmail.com]
> Sent: Friday, November 18, 2016 05:37
> To: Andreas Tobler 
> On Thu, Nov 17, 2016 at 9:46 AM, Andreas Tobler 
> wrote:
> > On 16.11.16 10:25, Dexuan Cui wrote:
> >>
> >> Author: dexuan
> >> Date: Wed Nov 16 09:25:00 2016
> >> New Revision: 308725
> 
> > -dev/hyperv/pcib/pcib.c optionalhyperv
> > +dev/hyperv/pcib/pcib.c optionalhyperv pci
> 
> This seems to be causing Jenkins failures too:
> Doesn't sys/modules/hyperv/vmbus/Makefile need pci_if.h now in SRCS?
> Thanks,
> -Ngie

Hi Ngie, Andreas,
Thanks for the reminder!  I'll fix this ASAP.
Now I'm testing local changes and will report back shortly.

Thanks,
-- Dexuan
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r308725 - in head/sys: conf dev/hyperv/pcib modules/hyperv/pcib

2016-11-17 Thread Ngie Cooper
On Thu, Nov 17, 2016 at 9:46 AM, Andreas Tobler  wrote:
> On 16.11.16 10:25, Dexuan Cui wrote:
>>
>> Author: dexuan
>> Date: Wed Nov 16 09:25:00 2016
>> New Revision: 308725
>> URL: https://svnweb.freebsd.org/changeset/base/308725

...

> -dev/hyperv/pcib/pcib.c optionalhyperv
> +dev/hyperv/pcib/pcib.c optionalhyperv pci

This seems to be causing Jenkins failures too:
https://jenkins.freebsd.org/job/FreeBSD_HEAD/903/ .
Doesn't sys/modules/hyperv/vmbus/Makefile need pci_if.h now in SRCS?
Thanks,
-Ngie
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r308725 - in head/sys: conf dev/hyperv/pcib modules/hyperv/pcib

2016-11-17 Thread Andreas Tobler

On 16.11.16 10:25, Dexuan Cui wrote:

Author: dexuan
Date: Wed Nov 16 09:25:00 2016
New Revision: 308725
URL: https://svnweb.freebsd.org/changeset/base/308725



Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Wed Nov 16 09:08:32 2016(r308724)
+++ head/sys/conf/files.amd64   Wed Nov 16 09:25:00 2016(r308725)
@@ -292,6 +292,7 @@ dev/hwpmc/hwpmc_uncore.coptionalhwpmc
 dev/hwpmc/hwpmc_piv.c  optionalhwpmc
 dev/hwpmc/hwpmc_tsc.c  optionalhwpmc
 dev/hwpmc/hwpmc_x86.c  optionalhwpmc
+dev/hyperv/pcib/pcib.c optionalhyperv


I'd say, for both, files.amd64 and files.i386

-dev/hyperv/pcib/pcib.c optionalhyperv
+dev/hyperv/pcib/pcib.c optionalhyperv pci

Fixes the build on trunk.

Andreas
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308725 - in head/sys: conf dev/hyperv/pcib modules/hyperv/pcib

2016-11-16 Thread Dexuan Cui
Author: dexuan
Date: Wed Nov 16 09:25:00 2016
New Revision: 308725
URL: https://svnweb.freebsd.org/changeset/base/308725

Log:
  hyperv/pcib: enable PCIe pass-through (a.k.a. Discrete Device Assignment)
  
  The feature enables us to pass through physical PCIe devices to FreeBSD VM
  running on Hyper-V (Windows Server 2016) to get near-native performance with
  low CPU utilization.
  
  The patch implements a PCI bridge driver to support the feature:
  
  1) The pcib driver talks to the host to discover device(s) and presents
  the device(s) to FreeBSD's pci driver via PCI configuration space (note:
  to access the configuration space, we don't use the standard I/O port
  0xCF8/CFC method; instead, we use an MMIO-based method supplied by Hyper-V,
  which is very similar to the 0xCF8/CFC method).
  
  2) The pcib driver allocates resources for the device(s) and initialize
  the related BARs, when the device driver's attach method is invoked;
  
  3) The pcib driver talks to the host to create MSI/MSI-X interrupt
  remapping between the guest and the host;
  
  4) The pcib driver supports device hot add/remove.
  
  Reviewed by:  sephe
  Approved by:  sephe (mentor)
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D8332

Added:
  head/sys/dev/hyperv/pcib/
  head/sys/dev/hyperv/pcib/pcib.c   (contents, props changed)
  head/sys/modules/hyperv/pcib/
  head/sys/modules/hyperv/pcib/Makefile   (contents, props changed)
Modified:
  head/sys/conf/files.amd64
  head/sys/conf/files.i386

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Wed Nov 16 09:08:32 2016(r308724)
+++ head/sys/conf/files.amd64   Wed Nov 16 09:25:00 2016(r308725)
@@ -292,6 +292,7 @@ dev/hwpmc/hwpmc_uncore.coptionalhwpmc
 dev/hwpmc/hwpmc_piv.c  optionalhwpmc
 dev/hwpmc/hwpmc_tsc.c  optionalhwpmc
 dev/hwpmc/hwpmc_x86.c  optionalhwpmc
+dev/hyperv/pcib/pcib.c optionalhyperv
 dev/hyperv/netvsc/hn_nvs.c optionalhyperv
 dev/hyperv/netvsc/hn_rndis.c   optionalhyperv
 dev/hyperv/netvsc/if_hn.c  optionalhyperv

Modified: head/sys/conf/files.i386
==
--- head/sys/conf/files.i386Wed Nov 16 09:08:32 2016(r308724)
+++ head/sys/conf/files.i386Wed Nov 16 09:25:00 2016(r308725)
@@ -249,6 +249,7 @@ dev/hwpmc/hwpmc_piv.c   optional hwpmc
 dev/hwpmc/hwpmc_ppro.c optional hwpmc
 dev/hwpmc/hwpmc_tsc.c  optional hwpmc
 dev/hwpmc/hwpmc_x86.c  optional hwpmc
+dev/hyperv/pcib/pcib.c optionalhyperv
 dev/hyperv/netvsc/hn_nvs.c optionalhyperv
 dev/hyperv/netvsc/hn_rndis.c   optionalhyperv
 dev/hyperv/netvsc/if_hn.c  optionalhyperv

Added: head/sys/dev/hyperv/pcib/pcib.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/hyperv/pcib/pcib.c Wed Nov 16 09:25:00 2016
(r308725)
@@ -0,0 +1,1790 @@
+/*-
+ * Copyright (c) 2016 Microsoft Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include