svn commit: r308723 - head/sys/dev/hyperv/vmbus

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

Log:
  hyperv/vmbus: add a new method to get vcpu_id
  
  vcpu_id is host's representation of guest CPU.
  We get the mapping between vcpu_id and FreeBSD kernel's cpu id when VMBus
  driver is loaded. Later, when a driver, like the coming pcib driver, talks
  to the host and needs to refer to a guest CPU, the driver must use the
  vcpu_id.
  
  Reviewed by:  jhb, sephe
  Approved by:  sephe (mentor)
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D8410

Modified:
  head/sys/dev/hyperv/vmbus/vmbus.c
  head/sys/dev/hyperv/vmbus/vmbus_if.m

Modified: head/sys/dev/hyperv/vmbus/vmbus.c
==
--- head/sys/dev/hyperv/vmbus/vmbus.c   Wed Nov 16 07:05:42 2016
(r308722)
+++ head/sys/dev/hyperv/vmbus/vmbus.c   Wed Nov 16 09:02:17 2016
(r308723)
@@ -77,6 +77,8 @@ static intvmbus_child_pnpinfo_str(dev
 static uint32_tvmbus_get_version_method(device_t, 
device_t);
 static int vmbus_probe_guid_method(device_t, device_t,
const struct hyperv_guid *);
+static uint32_tvmbus_get_vcpu_id_method(device_t bus,
+   device_t dev, int cpu);
 
 static int vmbus_init(struct vmbus_softc *);
 static int vmbus_connect(struct vmbus_softc *, uint32_t);
@@ -135,6 +137,7 @@ static device_method_t vmbus_methods[] =
/* Vmbus interface */
DEVMETHOD(vmbus_get_version,vmbus_get_version_method),
DEVMETHOD(vmbus_probe_guid, vmbus_probe_guid_method),
+   DEVMETHOD(vmbus_get_vcpu_id,vmbus_get_vcpu_id_method),
 
DEVMETHOD_END
 };
@@ -991,6 +994,14 @@ vmbus_probe_guid_method(device_t bus, de
return ENXIO;
 }
 
+static uint32_t
+vmbus_get_vcpu_id_method(device_t bus, device_t dev, int cpu)
+{
+   const struct vmbus_softc *sc = device_get_softc(bus);
+
+   return (VMBUS_PCPU_GET(sc, vcpuid, cpu));
+}
+
 static int
 vmbus_probe(device_t dev)
 {

Modified: head/sys/dev/hyperv/vmbus/vmbus_if.m
==
--- head/sys/dev/hyperv/vmbus/vmbus_if.mWed Nov 16 07:05:42 2016
(r308722)
+++ head/sys/dev/hyperv/vmbus/vmbus_if.mWed Nov 16 09:02:17 2016
(r308723)
@@ -45,3 +45,9 @@ METHOD int probe_guid {
device_t dev;
const struct hyperv_guid *guid;
 };
+
+METHOD uint32_t get_vcpu_id {
+   device_t bus;
+   device_t dev;
+   int cpu;
+};
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r308724 - head/sys/dev/hyperv/vmbus

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

Log:
  hyperv/vmbus: add new vmbus methods to support PCIe pass-through
  
  The new methods will be used by the coming pcib driver.
  
  Reviewed by:  sephe
  Approved by:  sephe (mentor)
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D8409

Modified:
  head/sys/dev/hyperv/vmbus/vmbus.c
  head/sys/dev/hyperv/vmbus/vmbus_var.h

Modified: head/sys/dev/hyperv/vmbus/vmbus.c
==
--- head/sys/dev/hyperv/vmbus/vmbus.c   Wed Nov 16 09:02:17 2016
(r308723)
+++ head/sys/dev/hyperv/vmbus/vmbus.c   Wed Nov 16 09:08:32 2016
(r308724)
@@ -44,10 +44,13 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
 #include 
+#include 
 #include 
 
 #include 
+#include 
 
 #include 
 #include 
@@ -58,6 +61,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include "acpi_if.h"
+#include "pcib_if.h"
 #include "vmbus_if.h"
 
 #define VMBUS_GPADL_START  0xe1e10
@@ -74,6 +78,20 @@ static int   vmbus_read_ivar(device_t, d
uintptr_t *);
 static int vmbus_child_pnpinfo_str(device_t, device_t,
char *, size_t);
+static struct resource *vmbus_alloc_resource(device_t dev,
+   device_t child, int type, int *rid,
+   rman_res_t start, rman_res_t end,
+   rman_res_t count, u_int flags);
+static int vmbus_alloc_msi(device_t bus, device_t dev,
+   int count, int maxcount, int *irqs);
+static int vmbus_release_msi(device_t bus, device_t dev,
+   int count, int *irqs);
+static int vmbus_alloc_msix(device_t bus, device_t dev,
+   int *irq);
+static int vmbus_release_msix(device_t bus, device_t dev,
+   int irq);
+static int vmbus_map_msi(device_t bus, device_t dev,
+   int irq, uint64_t *addr, uint32_t *data);
 static uint32_tvmbus_get_version_method(device_t, 
device_t);
 static int vmbus_probe_guid_method(device_t, device_t,
const struct hyperv_guid *);
@@ -133,6 +151,22 @@ static device_method_t vmbus_methods[] =
DEVMETHOD(bus_print_child,  bus_generic_print_child),
DEVMETHOD(bus_read_ivar,vmbus_read_ivar),
DEVMETHOD(bus_child_pnpinfo_str,vmbus_child_pnpinfo_str),
+   DEVMETHOD(bus_alloc_resource,   vmbus_alloc_resource),
+   DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+   DEVMETHOD(bus_activate_resource,bus_generic_activate_resource),
+   DEVMETHOD(bus_deactivate_resource,  
bus_generic_deactivate_resource),
+   DEVMETHOD(bus_setup_intr,   bus_generic_setup_intr),
+   DEVMETHOD(bus_teardown_intr,bus_generic_teardown_intr),
+#if __FreeBSD_version >= 110
+   DEVMETHOD(bus_get_cpus, bus_generic_get_cpus),
+#endif
+
+   /* pcib interface */
+   DEVMETHOD(pcib_alloc_msi,   vmbus_alloc_msi),
+   DEVMETHOD(pcib_release_msi, vmbus_release_msi),
+   DEVMETHOD(pcib_alloc_msix,  vmbus_alloc_msix),
+   DEVMETHOD(pcib_release_msix,vmbus_release_msix),
+   DEVMETHOD(pcib_map_msi, vmbus_map_msi),
 
/* Vmbus interface */
DEVMETHOD(vmbus_get_version,vmbus_get_version_method),
@@ -975,6 +1009,69 @@ vmbus_sysctl_version(SYSCTL_HANDLER_ARGS
return sysctl_handle_string(oidp, verstr, sizeof(verstr), req);
 }
 
+/*
+ * We need the function to make sure the MMIO resource is allocated from the
+ * ranges found in _CRS.
+ *
+ * For the release function, we can use bus_generic_release_resource().
+ */
+static struct resource *
+vmbus_alloc_resource(device_t dev, device_t child, int type, int *rid,
+rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
+{
+   struct vmbus_softc *sc = device_get_softc(dev);
+   device_t parent = device_get_parent(dev);
+   struct resource *res;
+
+   if (type != SYS_RES_MEMORY)
+   res = BUS_ALLOC_RESOURCE(parent, child, type, rid, start,
+   end, count, flags);
+   else
+   res = pcib_host_res_alloc(&sc->vmbus_mmio_res, child, type,
+   rid, start, end, count, flags);
+
+   return (res);
+}
+
+static device_t
+get_nexus(device_t vmbus)
+{
+   device_t acpi = device_get_parent(vmbus);
+   device_t nexus = device_get_par

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 
+#i

svn commit: r308726 - head/sys/arm/broadcom/bcm2835

2016-11-16 Thread Andrew Turner
Author: andrew
Date: Wed Nov 16 11:31:53 2016
New Revision: 308726
URL: https://svnweb.freebsd.org/changeset/base/308726

Log:
  Use the correct OF_getencprop to get the height.
  
  Reported by:  jmcneill
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_fb.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_fb.c  Wed Nov 16 09:25:00 2016
(r308725)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_fb.c  Wed Nov 16 11:31:53 2016
(r308726)
@@ -479,7 +479,7 @@ bcmfb_configure(int flags)
}
 
if (sc->height == 0) {
-   if ((OF_getprop(display, "broadcom,height", 
+   if ((OF_getencprop(display, "broadcom,height", 
&cell, sizeof(cell))) > 0)
sc->height = cell;
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r308727 - head/sys/arm64/conf

2016-11-16 Thread Andrew Turner
Author: andrew
Date: Wed Nov 16 11:37:43 2016
New Revision: 308727
URL: https://svnweb.freebsd.org/changeset/base/308727

Log:
  Include the SMSC LAN91C111 driver, this is found in some of the ARM models.

Modified:
  head/sys/arm64/conf/GENERIC

Modified: head/sys/arm64/conf/GENERIC
==
--- head/sys/arm64/conf/GENERIC Wed Nov 16 11:31:53 2016(r308726)
+++ head/sys/arm64/conf/GENERIC Wed Nov 16 11:37:43 2016(r308727)
@@ -121,6 +121,7 @@ device  em  # Intel PRO/1000 
Gigabit Eth
 device igb # Intel PRO/1000 PCIE Server Gigabit Family
 device ix  # Intel 10Gb Ethernet Family
 device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet
+device smc # SMSC LAN91C111
 device vnic# Cavium ThunderX NIC
 device al_eth  # Annapurna Alpine Ethernet NIC
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r308728 - head/share/man/man4

2016-11-16 Thread Christian Brueffer
Author: brueffer
Date: Wed Nov 16 13:22:57 2016
New Revision: 308728
URL: https://svnweb.freebsd.org/changeset/base/308728

Log:
  Various minor cleanups.

Modified:
  head/share/man/man4/bnxt.4

Modified: head/share/man/man4/bnxt.4
==
--- head/share/man/man4/bnxt.4  Wed Nov 16 11:37:43 2016(r308727)
+++ head/share/man/man4/bnxt.4  Wed Nov 16 13:22:57 2016(r308728)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 12, 2016
+.Dd November 16, 2016
 .Dt BNXT 4
 .Os
 .Sh NAME
@@ -89,7 +89,7 @@ Broadcom BCM57304 NetXtreme-C Virtual Fu
 Broadcom BCM57404 NetXtreme-E Virtual Function
 .El
 .Sh SYSCTL VARIABLES
-These variables must be set before loading the driver, either via 
+These variables must be set before loading the driver, either via
 .Xr loader.conf 5
 or through the use of
 .Xr kenv 1 .
@@ -165,11 +165,12 @@ variables are read-only:
 .Bl -tag -width indent
 .It Va dev.bnxt.X.if_name
 Current interface name of the device.
-This will normally be 
+This will normally be
 .Va bnxtX ,
 but this can be changed using
 .Cm ifconfig name .
-This sysctl allows correlating an interface with a child of dev.bnxt.
+This sysctl allows correlating an interface with a child of
+.Va dev.bnxt .
 .It Va dev.bnxt.X.nvram.*
 Information about the NVRAM device which contains the device firmware.
 .It Va dev.bnxt.X.ver.*
@@ -191,10 +192,10 @@ reasons to ignore Ethernet frames.
 .It "bnxt%d: %s command returned %s error."
 Device firmware rejected a command from the driver.
 There might be a driver/firmware HWRM API mismatch.
-.It "bnxt%d: Timeout sending %s (timeout: %d) seq %d\n"
+.It "bnxt%d: Timeout sending %s (timeout: %d) seq %d"
 Device firmware unresponsive.
 A PCI device reset is likely needed.
-.It "bnxt%d: Timeout sending %s (timeout: %d) msg {0x%x 0x%x} len:%d v: %d\n"
+.It "bnxt%d: Timeout sending %s (timeout: %d) msg {0x%x 0x%x} len:%d v: %d"
 Partial firmware response.
 A PCI device reset is likely needed.
 .Pp
@@ -203,20 +204,21 @@ As of this writing, the system must be r
 .Sh SEE ALSO
 .Xr altq 4 ,
 .Xr arp 4 ,
+.Xr iflib 4 ,
 .Xr netintro 4 ,
 .Xr ng_ether 4 ,
 .Xr vlan 4 ,
-.Xr ifconfig 8 ,
-.Xr iflib 4
+.Xr ifconfig 8
 .Sh HISTORY
 The
 .Nm
 device driver first appeared in
 .Fx 12.0 .
 .Sh AUTHORS
+.An -nosplit
 The
 .Nm
 driver was written by
-.An Jack Vogel Aq Mt jfvo...@gmail.com .
+.An Jack Vogel Aq Mt jfvo...@gmail.com ,
 and is currently maintained by
 .An Stephen Hurd Aq Mt stephen.h...@broadcom.com .
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r308729 - head/release/doc/en_US.ISO8859-1/hardware

2016-11-16 Thread Christian Brueffer
Author: brueffer
Date: Wed Nov 16 13:27:39 2016
New Revision: 308729
URL: https://svnweb.freebsd.org/changeset/base/308729

Log:
  Add bnxt(4) to the hardware notes.

Modified:
  head/release/doc/en_US.ISO8859-1/hardware/article.xml

Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml
==
--- head/release/doc/en_US.ISO8859-1/hardware/article.xml   Wed Nov 16 
13:22:57 2016(r308728)
+++ head/release/doc/en_US.ISO8859-1/hardware/article.xml   Wed Nov 16 
13:27:39 2016(r308729)
@@ -800,6 +800,8 @@
 
   &hwlist.bge;
 
+  &hwlist.bnxt;
+
   &hwlist.bxe;
 
   &hwlist.cas;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r308691 - in head/sys: cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs fs/tmpfs kern vm

2016-11-16 Thread Ruslan Bukin
I have a panic with this on RISC-V. Any ideas ?

  
  
r   vv
  
rr
rr
rr
  vv  
r   vv
rrvv  
rr  rr
  vv  
rr  vv  rr
  vv  
rr  vv  rr
  vv  
rr  vv  rr
  vv  
rr  rr
  
rr  rr

   INSTRUCTION SETS WANT TO BE FREE
KDB: debugger backends: ddb
KDB: current backend: ddb
Found 2 CPUs in the device tree
Copyright (c) 1992-2016 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 12.0-CURRENT #4 0a3288b(br-riscv-isa-update)-dirty: Wed Nov 16 13:28:11 
UTC 2016

rb...@vica.cl.cam.ac.uk:/home/rb743/obj/riscv.riscv64/home/rb743/dev/freebsd-riscv/sys/SPIKE
 riscv
gcc version 6.1.0 (GCC) 
Preloaded elf64 kernel "kernel" at 0xffc0026be360.
CPU(0): Unknown Implementer Unknown Processor
Starting CPU 1 (0)
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
ULE: setup cpu 0
ULE: setup cpu 1
random: entropy device external interface
crypto: 
mem: 
openfirm: 
null: 
nfslock: pseudo-device
random: harvesting attach, 8 bytes (4 bits) from nexus0
ofwbus0: 
simplebus0:  on ofwbus0
random: harvesting attach, 8 bytes (4 bits) from simplebus0
random: harvesting attach, 8 bytes (4 bits) from ofwbus0
timer0:  mem 0x4000-0x4007,0x4008-0x40001007 irq 5 on 
simplebus0
Timecounter "RISC-V Timecounter" frequency 100 Hz quality 1000
Event timer "RISC-V Eventtimer" frequency 100 Hz quality 1000
random: harvesting attach, 8 bytes (4 bits) from timer0
cpulist0:  on ofwbus0
cpu0:  on cpulist0
cpu0: missing 'clock-frequency' property
riscv64_cpu0: register <0>
random: harvesting attach, 8 bytes (4 bits) from riscv64_cpu0
random: harvesting attach, 8 bytes (4 bits) from cpu0
cpu1:  on cpulist0
cpu1: missing 'clock-frequency' property
riscv64_cpu1: register <0>
random: harvesting attach, 8 bytes (4 bits) from riscv64_cpu1
random: harvesting attach, 8 bytes (4 bits) from cpu1
random: harvesting attach, 8 bytes (4 bits) from cpulist0
simplebus0:  compat riscv,pic (no driver attached)
rcons0:  irq 1 on simplebus0
random: harvesting attach, 8 bytes (4 bits) from rcons0
cryptosoft0: 
crypto: assign cryptosoft0 driver id 0, flags 100663296
crypto: cryptosoft0 registers alg 1 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 2 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 3 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 4 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 5 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 16 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 6 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 7 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 18 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 19 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 20 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 8 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 15 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 9 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 10 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 13 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 14 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 11 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 22 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 23 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 25 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 24 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 26 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 27 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 28 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 21 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 17 flags 0 maxoplen 0
random: harvesting attach, 8 bytes (4 bits) from cryptosoft0
Device configuration finished.
procfs registered
Timecounters tick every 1.000 msec
lo0: bpf attached
vlan: initialized, using hash tables with chaining
tcp_init: net.inet.tcp.tcbhashsize auto tuned to 8192
IPsec: Initialized Security Association Processing.
t[0] == 0xffc00265bf50
t[1] == 0xffc00016494c
t[2] == 0x00

Re: svn commit: r308691 - in head/sys: cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs fs/tmpfs kern vm

2016-11-16 Thread Ruslan Bukin
Forgot to mention that we are using 32mb mdroot.
Removing mdroot from kernel config makes it more happy:

crypto: cryptosoft0 registers alg 26 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 27 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 28 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 21 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 17 flags 0 maxoplen 0
random: harvesting attach, 8 bytes (4 bits) from cryptosoft0
Device configuration finished.
procfs registered
Timecounters tick every 1.000 msec
lo0: bpf attached
vlan: initialized, using hash tables with chaining
tcp_init: net.inet.tcp.tcbhashsize auto tuned to 8192
IPsec: Initialized Security Association Processing.
Release APs
CPU(1): Unknown Implementer Unknown Processor
Trying to mount root from ufs:/dev/md0 []...
mountroot: waiting for device /dev/md0...
Mounting from ufs:/dev/md0 failed with error 19.

Loader variables:

Manual root filesystem specification:
  : [options]
  Mount  using filesystem 
  and with the specified (optional) option list.

eg. ufs:/dev/da0s1a
zfs:tank
cd9660:/dev/cd0 ro
  (which is equivalent to: mount -t cd9660 -o ro /dev/cd0 /)

  ?   List valid disk boot devices
  .   Yield 1 second (for background tasks)
  Abort manual input

mountroot> 

Ruslan

On Wed, Nov 16, 2016 at 01:37:18PM +, Ruslan Bukin wrote:
> I have a panic with this on RISC-V. Any ideas ?
> 
>   
>   
> r   vv
>   
> rr
> rr
> rr
>   vv  
> r   vv
> rrvv  
> rr  rr
>   vv  
> rr  vv  rr
>   vv  
> rr  vv  rr
>   vv  
> rr  vv  rr
>   vv  
> rr  rr
>   
> rr  rr
> 
>INSTRUCTION SETS WANT TO BE FREE
> KDB: debugger backends: ddb
> KDB: current backend: ddb
> Found 2 CPUs in the device tree
> Copyright (c) 1992-2016 The FreeBSD Project.
> Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
>   The Regents of the University of California. All rights reserved.
> FreeBSD is a registered trademark of The FreeBSD Foundation.
> FreeBSD 12.0-CURRENT #4 0a3288b(br-riscv-isa-update)-dirty: Wed Nov 16 
> 13:28:11 UTC 2016
> 
> rb...@vica.cl.cam.ac.uk:/home/rb743/obj/riscv.riscv64/home/rb743/dev/freebsd-riscv/sys/SPIKE
>  riscv
> gcc version 6.1.0 (GCC) 
> Preloaded elf64 kernel "kernel" at 0xffc0026be360.
> CPU(0): Unknown Implementer Unknown Processor
> Starting CPU 1 (0)
> FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
> ULE: setup cpu 0
> ULE: setup cpu 1
> random: entropy device external interface
> crypto: 
> mem: 
> openfirm: 
> null: 
> nfslock: pseudo-device
> random: harvesting attach, 8 bytes (4 bits) from nexus0
> ofwbus0: 
> simplebus0:  on ofwbus0
> random: harvesting attach, 8 bytes (4 bits) from simplebus0
> random: harvesting attach, 8 bytes (4 bits) from ofwbus0
> timer0:  mem 0x4000-0x4007,0x4008-0x40001007 irq 5 
> on simplebus0
> Timecounter "RISC-V Timecounter" frequency 100 Hz quality 1000
> Event timer "RISC-V Eventtimer" frequency 100 Hz quality 1000
> random: harvesting attach, 8 bytes (4 bits) from timer0
> cpulist0:  on ofwbus0
> cpu0:  on cpulist0
> cpu0: missing 'clock-frequency' property
> riscv64_cpu0: register <0>
> random: harvesting attach, 8 bytes (4 bits) from riscv64_cpu0
> random: harvesting attach, 8 bytes (4 bits) from cpu0
> cpu1:  on cpulist0
> cpu1: missing 'clock-frequency' property
> riscv64_cpu1: register <0>
> random: harvesting attach, 8 bytes (4 bits) from riscv64_cpu1
> random: harvesting attach, 8 bytes (4 bits) from cpu1
> random: harvesting attach, 8 bytes (4 bits) from cpulist0
> simplebus0:  compat riscv,pic (no driver attached)
> rcons0:  irq 1 on simplebus0
> random: harvesting attach, 8 bytes (4 bits) from rcons0
> cryptosoft0: 
> crypto: assign cryptosoft0 driver id 0, flags 100663296
> crypto: cryptosoft0 registers alg 1 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 2 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 3 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 4 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 5 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 16 flags 0 ma

Re: svn commit: r308691 - in head/sys: cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs fs/tmpfs kern vm

2016-11-16 Thread Ruslan Bukin
BTW single core kernel works fine:

  
  
r   vv
  
rr
rr
rr
  vv  
r   vv
rrvv  
rr  rr
  vv  
rr  vv  rr
  vv  
rr  vv  rr
  vv  
rr  vv  rr
  vv  
rr  rr
  
rr  rr

   INSTRUCTION SETS WANT TO BE FREE
KDB: debugger backends: ddb
KDB: current backend: ddb
Found 1 CPUs in the device tree
Copyright (c) 1992-2016 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 12.0-CURRENT #8 8e49d4e(br-riscv-isa-update)-dirty: Wed Nov 16 14:08:14 
UTC 2016

rb...@vica.cl.cam.ac.uk:/home/rb743/obj/riscv.riscv64/home/rb743/dev/freebsd-riscv/sys/SPIKE
 riscv
gcc version 6.1.0 (GCC) 
Preloaded elf64 kernel "kernel" at 0xffc0026be2e0.
CPU(0): Unknown Implementer Unknown Processor
ULE: setup cpu 0
random: entropy device external interface
crypto: 
mem: 
openfirm: 
null: 
nfslock: pseudo-device
random: harvesting attach, 8 bytes (4 bits) from nexus0
ofwbus0: 
simplebus0:  on ofwbus0
random: harvesting attach, 8 bytes (4 bits) from simplebus0
random: harvesting attach, 8 bytes (4 bits) from ofwbus0
timer0:  mem 0x4000-0x4007,0x4008-0x40001007 irq 5 on 
simplebus0
Timecounter "RISC-V Timecounter" frequency 100 Hz quality 1000
Event timer "RISC-V Eventtimer" frequency 100 Hz quality 1000
random: harvesting attach, 8 bytes (4 bits) from timer0
cpulist0:  on ofwbus0
cpu0:  on cpulist0
cpu0: missing 'clock-frequency' property
riscv64_cpu0: register <0>
random: harvesting attach, 8 bytes (4 bits) from riscv64_cpu0
random: harvesting attach, 8 bytes (4 bits) from cpu0
random: harvesting attach, 8 bytes (4 bits) from cpulist0
simplebus0:  compat riscv,pic (no driver attached)
rcons0:  irq 1 on simplebus0
random: harvesting attach, 8 bytes (4 bits) from rcons0
cryptosoft0: 
crypto: assign cryptosoft0 driver id 0, flags 100663296
crypto: cryptosoft0 registers alg 1 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 2 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 3 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 4 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 5 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 16 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 6 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 7 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 18 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 19 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 20 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 8 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 15 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 9 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 10 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 13 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 14 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 11 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 22 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 23 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 25 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 24 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 26 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 27 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 28 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 21 flags 0 maxoplen 0
crypto: cryptosoft0 registers alg 17 flags 0 maxoplen 0
random: harvesting attach, 8 bytes (4 bits) from cryptosoft0
Device configuration finished.
procfs registered
Timecounters tick every 1.000 msec
lo0: bpf attached
vlan: initialized, using hash tables with chaining
tcp_init: net.inet.tcp.tcbhashsize auto tuned to 8192
IPsec: Initialized Security Association Processing.
Trying to mount root from ufs:/dev/md0 []...
md0: Embedded image 33554432 bytes at 0xffc0006598c0
warning: no time-of-day clock registered, system time will not be set accurately
start_init: trying /sbin/init
Nov 16 12:32:13 init: login_getclass: unknown class 'daemon'
sh: cannot open /etc/rc: No such file or directory
Enter full pathname of shell or RETURN for /bin/s

svn commit: r308730 - head/sys/dev/usb/net

2016-11-16 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Nov 16 14:39:03 2016
New Revision: 308730
URL: https://svnweb.freebsd.org/changeset/base/308730

Log:
  Make sure MAC address is reprogrammed when if_init() callback is
  invoked. Else promiscious mode must be used to pass traffic. While at
  it fix a debug print macro.
  
  MFC after:1 week

Modified:
  head/sys/dev/usb/net/if_smsc.c

Modified: head/sys/dev/usb/net/if_smsc.c
==
--- head/sys/dev/usb/net/if_smsc.c  Wed Nov 16 13:27:39 2016
(r308729)
+++ head/sys/dev/usb/net/if_smsc.c  Wed Nov 16 14:39:03 2016
(r308730)
@@ -152,7 +152,7 @@ static const struct usb_device_id smsc_d
device_printf((sc)->sc_ue.ue_dev, "debug: " fmt, 
##args); \
} while(0)
 #else
-#define smsc_dbg_printf(sc, fmt, args...)
+#define smsc_dbg_printf(sc, fmt, args...) do { } while (0)
 #endif
 
 #define smsc_warn_printf(sc, fmt, args...) \
@@ -822,7 +822,6 @@ static int smsc_sethwcsum(struct smsc_so
return (0);
 }
 
-
 /**
  * smsc_setmacaddress - Sets the mac address in the device
  * @sc: driver soft context
@@ -905,6 +904,9 @@ smsc_init(struct usb_ether *ue)
 
SMSC_LOCK_ASSERT(sc, MA_OWNED);
 
+   if (smsc_setmacaddress(sc, IF_LLADDR(ifp)))
+   smsc_dbg_printf(sc, "setting MAC address failed\n");
+
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
return;
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r308731 - in head: . gnu/usr.bin/cc lib/libc lib/libc/riscv lib/libc/riscv/gen lib/libc/riscv/softfloat lib/libc/softfloat lib/libcompiler_rt lib/msun/riscv share/mk sys/conf sys/module...

2016-11-16 Thread Ruslan Bukin
Author: br
Date: Wed Nov 16 15:21:32 2016
New Revision: 308731
URL: https://svnweb.freebsd.org/changeset/base/308731

Log:
  Add full softfloat and hardfloat support for RISC-V.
  
  Hardfloat is now default (use riscv64sf as TARGET_ARCH
  for softfloat).
  
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D8529

Added:
  head/lib/libc/riscv/softfloat/
  head/lib/libc/riscv/softfloat/milieu.h   (contents, props changed)
  head/lib/libc/riscv/softfloat/riscv-gcc.h   (contents, props changed)
  head/lib/libc/riscv/softfloat/softfloat.h   (contents, props changed)
  head/lib/msun/riscv/Symbol.map   (contents, props changed)
  head/sys/riscv/include/fpe.h   (contents, props changed)
Modified:
  head/Makefile
  head/Makefile.inc1
  head/gnu/usr.bin/cc/Makefile.tgt
  head/lib/libc/Makefile
  head/lib/libc/riscv/Makefile.inc
  head/lib/libc/riscv/Symbol.map
  head/lib/libc/riscv/gen/_setjmp.S
  head/lib/libc/riscv/gen/flt_rounds.c
  head/lib/libc/riscv/gen/setjmp.S
  head/lib/libc/softfloat/Makefile.inc
  head/lib/libcompiler_rt/Makefile.inc
  head/lib/msun/riscv/Makefile.inc
  head/lib/msun/riscv/fenv.c
  head/lib/msun/riscv/fenv.h
  head/share/mk/bsd.cpu.mk
  head/share/mk/local.meta.sys.mk
  head/share/mk/src.opts.mk
  head/share/mk/sys.mk
  head/sys/conf/options.riscv
  head/sys/modules/dtrace/dtrace/Makefile
  head/sys/riscv/conf/GENERIC
  head/sys/riscv/include/pcb.h
  head/sys/riscv/include/reg.h
  head/sys/riscv/include/riscvreg.h
  head/sys/riscv/riscv/genassym.c
  head/sys/riscv/riscv/machdep.c
  head/sys/riscv/riscv/mp_machdep.c
  head/sys/riscv/riscv/swtch.S
  head/sys/riscv/riscv/trap.c
  head/sys/riscv/riscv/vm_machdep.c

Modified: head/Makefile
==
--- head/Makefile   Wed Nov 16 14:39:03 2016(r308730)
+++ head/Makefile   Wed Nov 16 15:21:32 2016(r308731)
@@ -239,7 +239,7 @@ _MAKE+= MK_META_MODE=no
 _TARGET_ARCH=  ${TARGET:S/pc98/i386/:S/arm64/aarch64/}
 .elif !defined(TARGET) && defined(TARGET_ARCH) && \
 ${TARGET_ARCH} != ${MACHINE_ARCH}
-_TARGET=   
${TARGET_ARCH:C/mips(n32|64)?(el)?(hf)?/mips/:C/arm(v6)?(eb)?/arm/:C/aarch64/arm64/:C/powerpc64/powerpc/:C/powerpcspe/powerpc/:C/riscv64/riscv/}
+_TARGET=   
${TARGET_ARCH:C/mips(n32|64)?(el)?(hf)?/mips/:C/arm(v6)?(eb)?/arm/:C/aarch64/arm64/:C/powerpc64/powerpc/:C/powerpcspe/powerpc/:C/riscv64(sf)?/riscv/}
 .endif
 .if defined(TARGET) && !defined(_TARGET)
 _TARGET=${TARGET}

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Wed Nov 16 14:39:03 2016(r308730)
+++ head/Makefile.inc1  Wed Nov 16 15:21:32 2016(r308731)
@@ -364,6 +364,7 @@ KNOWN_ARCHES?=  aarch64/arm64 \
powerpc64/powerpc \
powerpcspe/powerpc \
riscv64/riscv \
+   riscv64sf/riscv \
sparc64
 
 .if ${TARGET} == ${TARGET_ARCH}

Modified: head/gnu/usr.bin/cc/Makefile.tgt
==
--- head/gnu/usr.bin/cc/Makefile.tgtWed Nov 16 14:39:03 2016
(r308730)
+++ head/gnu/usr.bin/cc/Makefile.tgtWed Nov 16 15:21:32 2016
(r308731)
@@ -4,7 +4,7 @@
 # MACHINE_CPUARCH, but there's no easy way to export make functions...
 
 .if defined(TARGET_ARCH)
-TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?(hf)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc(64|spe)/powerpc/}
+TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?(hf)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc(64|spe)/powerpc/:C/riscv64(sf)?/riscv64/}
 .else
 TARGET_CPUARCH=${MACHINE_CPUARCH}
 .endif

Modified: head/lib/libc/Makefile
==
--- head/lib/libc/Makefile  Wed Nov 16 14:39:03 2016(r308730)
+++ head/lib/libc/Makefile  Wed Nov 16 15:21:32 2016(r308731)
@@ -111,7 +111,8 @@ NOASM=
 .include "${LIBC_SRCTOP}/xdr/Makefile.inc"
 .if (${LIBC_ARCH} == "arm" && \
(${MACHINE_ARCH:Marmv6*} == "" || (defined(CPUTYPE) && 
${CPUTYPE:M*soft*}))) || \
- (${LIBC_ARCH} == "mips" && ${MACHINE_ARCH:Mmips*hf} == "")
+(${LIBC_ARCH} == "mips" && ${MACHINE_ARCH:Mmips*hf} == "") || \
+(${LIBC_ARCH} == "riscv" && ${MACHINE_ARCH:Mriscv*sf} != "")
 .include "${LIBC_SRCTOP}/softfloat/Makefile.inc"
 .endif
 .if ${LIBC_ARCH} == "i386" || ${LIBC_ARCH} == "amd64"

Modified: head/lib/libc/riscv/Makefile.inc
==
--- head/lib/libc/riscv/Makefile.incWed Nov 16 14:39:03 2016
(r308730)
+++ head/lib/libc/riscv/Makefile.incWed Nov 16 15:21:32 2016
(r308731)
@@ -3,6 +3,10 @@
 # Machine dependent definitions for the RISC-V architecture.
 #
 
+.if ${MACHINE_ARCH:Mriscv*sf} != ""
+CFLAGS+=-DSOFTFLOAT
+.endif
+
 # Long double is quad precision
 GDTOASRCS+=strtorQ

svn commit: r308733 - head/sys/vm

2016-11-16 Thread Konstantin Belousov
Author: kib
Date: Wed Nov 16 16:34:17 2016
New Revision: 308733
URL: https://svnweb.freebsd.org/changeset/base/308733

Log:
  Move the fast fault path into the separate function.
  
  Reviewed by:  alc
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/vm/vm_fault.c

Modified: head/sys/vm/vm_fault.c
==
--- head/sys/vm/vm_fault.c  Wed Nov 16 16:14:01 2016(r308732)
+++ head/sys/vm/vm_fault.c  Wed Nov 16 16:34:17 2016(r308733)
@@ -246,6 +246,48 @@ vm_fault_dirty(vm_map_entry_t entry, vm_
vm_pager_page_unswapped(m);
 }
 
+static void
+vm_fault_fill_hold(vm_page_t *m_hold, vm_page_t m)
+{
+
+   if (m_hold != NULL) {
+   *m_hold = m;
+   vm_page_lock(m);
+   vm_page_hold(m);
+   vm_page_unlock(m);
+   }
+}
+
+/*
+ * Unlocks fs.first_object and fs.map on success.
+ */
+static int
+vm_fault_soft_fast(struct faultstate *fs, vm_offset_t vaddr, vm_prot_t prot,
+int fault_type, int fault_flags, boolean_t wired, vm_page_t *m_hold)
+{
+   vm_page_t m;
+   int rv;
+
+   MPASS(fs->vp == NULL);
+   m = vm_page_lookup(fs->first_object, fs->first_pindex);
+   /* A busy page can be mapped for read|execute access. */
+   if (m == NULL || ((prot & VM_PROT_WRITE) != 0 &&
+   vm_page_busied(m)) || m->valid != VM_PAGE_BITS_ALL)
+   return (KERN_FAILURE);
+   rv = pmap_enter(fs->map->pmap, vaddr, m, prot, fault_type |
+   PMAP_ENTER_NOSLEEP | (wired ? PMAP_ENTER_WIRED : 0), 0);
+   if (rv != KERN_SUCCESS)
+   return (rv);
+   vm_fault_fill_hold(m_hold, m);
+   vm_fault_dirty(fs->entry, m, prot, fault_type, fault_flags, false);
+   VM_OBJECT_RUNLOCK(fs->first_object);
+   if (!wired)
+   vm_fault_prefault(fs, vaddr, PFBAK, PFFOR);
+   vm_map_lookup_done(fs->map, fs->entry);
+   curthread->td_ru.ru_minflt++;
+   return (KERN_SUCCESS);
+}
+
 /*
  * vm_fault:
  *
@@ -294,7 +336,6 @@ vm_fault_hold(vm_map_t map, vm_offset_t 
struct vnode *vp;
vm_object_t next_object, retry_object;
vm_offset_t e_end, e_start;
-   vm_page_t m;
vm_pindex_t retry_pindex;
vm_prot_t prot, retry_prot;
int ahead, alloc_req, behind, cluster_offset, error, era, faultcount;
@@ -376,36 +417,15 @@ RetryFault:;
(fs.first_object->flags & OBJ_TMPFS_NODE) == 0) ||
(fs.first_object->flags & OBJ_MIGHTBEDIRTY) != 0)) {
VM_OBJECT_RLOCK(fs.first_object);
-   if ((prot & VM_PROT_WRITE) != 0 &&
-   (fs.first_object->type == OBJT_VNODE ||
-   (fs.first_object->flags & OBJ_TMPFS_NODE) != 0) &&
-   (fs.first_object->flags & OBJ_MIGHTBEDIRTY) == 0)
-   goto fast_failed;
-   m = vm_page_lookup(fs.first_object, fs.first_pindex);
-   /* A busy page can be mapped for read|execute access. */
-   if (m == NULL || ((prot & VM_PROT_WRITE) != 0 &&
-   vm_page_busied(m)) || m->valid != VM_PAGE_BITS_ALL)
-   goto fast_failed;
-   result = pmap_enter(fs.map->pmap, vaddr, m, prot,
-  fault_type | PMAP_ENTER_NOSLEEP | (wired ? PMAP_ENTER_WIRED :
-  0), 0);
-   if (result != KERN_SUCCESS)
-   goto fast_failed;
-   if (m_hold != NULL) {
-   *m_hold = m;
-   vm_page_lock(m);
-   vm_page_hold(m);
-   vm_page_unlock(m);
-   }
-   vm_fault_dirty(fs.entry, m, prot, fault_type, fault_flags,
-   false);
-   VM_OBJECT_RUNLOCK(fs.first_object);
-   if (!wired)
-   vm_fault_prefault(&fs, vaddr, PFBAK, PFFOR);
-   vm_map_lookup_done(fs.map, fs.entry);
-   curthread->td_ru.ru_minflt++;
-   return (KERN_SUCCESS);
-fast_failed:
+   if ((prot & VM_PROT_WRITE) == 0 ||
+   (fs.first_object->type != OBJT_VNODE &&
+   (fs.first_object->flags & OBJ_TMPFS_NODE) == 0) ||
+   (fs.first_object->flags & OBJ_MIGHTBEDIRTY) != 0) {
+   rv = vm_fault_soft_fast(&fs, vaddr, prot, fault_type,
+   fault_flags, wired, m_hold);
+   if (rv == KERN_SUCCESS)
+   return (rv);
+   }
if (!VM_OBJECT_TRYUPGRADE(fs.first_object)) {
VM_OBJECT_RUNLOCK(fs.first_object);
VM_OBJECT_WLOCK(fs.first_object);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn

svn commit: r308734 - head/usr.sbin/crunch/crunchide

2016-11-16 Thread Ed Maste
Author: emaste
Date: Wed Nov 16 16:39:51 2016
New Revision: 308734
URL: https://svnweb.freebsd.org/changeset/base/308734

Log:
  crunchide: remove obsolete a.out header and comment
  
  crunchide(1) gained ELF support in r39172, and lost the unused a.out
  and non-functional ECOFF suport in r281655.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/crunch/crunchide/crunchide.c

Modified: head/usr.sbin/crunch/crunchide/crunchide.c
==
--- head/usr.sbin/crunch/crunchide/crunchide.c  Wed Nov 16 16:34:17 2016
(r308733)
+++ head/usr.sbin/crunch/crunchide/crunchide.c  Wed Nov 16 16:39:51 2016
(r308734)
@@ -26,7 +26,7 @@
  *University of Maryland at College Park
  */
 /*
- * crunchide.c - tiptoes through an a.out symbol table, hiding all defined
+ * crunchide.c - tiptoes through a symbol table, hiding all defined
  * global symbols.  Allows the user to supply a "keep list" of symbols
  * that are not to be hidden.  This program relies on the use of the
  * linker's -dc flag to actually put global bss data into the file's
@@ -73,7 +73,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 
 #include "extern.h"
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r308735 - in head/tools/tools/nanobsd: . pcengines

2016-11-16 Thread Warner Losh
Author: imp
Date: Wed Nov 16 16:49:21 2016
New Revision: 308735
URL: https://svnweb.freebsd.org/changeset/base/308735

Log:
  Start to move the old interface into a legacy file.

Added:
  head/tools/tools/nanobsd/legacy.sh   (contents, props changed)
Modified:
  head/tools/tools/nanobsd/defaults.sh
  head/tools/tools/nanobsd/nanobsd.sh
  head/tools/tools/nanobsd/pcengines/common.conf

Modified: head/tools/tools/nanobsd/defaults.sh
==
--- head/tools/tools/nanobsd/defaults.shWed Nov 16 16:39:51 2016
(r308734)
+++ head/tools/tools/nanobsd/defaults.shWed Nov 16 16:49:21 2016
(r308735)
@@ -132,10 +132,6 @@ NANO_RAM_ETCSIZE=10240
 # Size of the /tmp+/var ramdisk in 512 bytes sectors
 NANO_RAM_TMPVARSIZE=10240
 
-# Media geometry, only relevant if bios doesn't understand LBA.
-NANO_SECTS=63
-NANO_HEADS=16
-
 # boot0 flags/options and configuration
 NANO_BOOT0CFG="-o packet -s 1 -m 3"
 NANO_BOOTLOADER="boot/boot0sio"
@@ -652,173 +648,6 @@ populate_data_slice ( ) (
populate_slice "$1" "$2" "$3" "$4"
 )
 
-create_diskimage ( ) (
-   pprint 2 "build diskimage"
-   pprint 3 "log: ${NANO_LOG}/_.di"
-
-   (
-   echo $NANO_MEDIASIZE $NANO_IMAGES \
-   $NANO_SECTS $NANO_HEADS \
-   $NANO_CODESIZE $NANO_CONFSIZE $NANO_DATASIZE |
-   awk '
-   {
-   printf "# %s\n", $0
-
-   # size of cylinder in sectors
-   cs = $3 * $4
-
-   # number of full cylinders on media
-   cyl = int ($1 / cs)
-
-   # output fdisk geometry spec, truncate cyls to 1023
-   if (cyl <= 1023)
-   print "g c" cyl " h" $4 " s" $3
-   else
-   print "g c" 1023 " h" $4 " s" $3
-
-   if ($7 > 0) {
-   # size of data partition in full cylinders
-   dsl = int (($7 + cs - 1) / cs)
-   } else {
-   dsl = 0;
-   }
-
-   # size of config partition in full cylinders
-   csl = int (($6 + cs - 1) / cs)
-
-   if ($5 == 0) {
-   # size of image partition(s) in full cylinders
-   isl = int ((cyl - dsl - csl) / $2)
-   } else {
-   isl = int (($5 + cs - 1) / cs)
-   }
-
-   # First image partition start at second track
-   print "p 1 165 " $3, isl * cs - $3
-   c = isl * cs;
-
-   # Second image partition (if any) also starts offset one
-   # track to keep them identical.
-   if ($2 > 1) {
-   print "p 2 165 " $3 + c, isl * cs - $3
-   c += isl * cs;
-   }
-
-   # Config partition starts at cylinder boundary.
-   print "p 3 165 " c, csl * cs
-   c += csl * cs
-
-   # Data partition (if any) starts at cylinder boundary.
-   if ($7 > 0) {
-   print "p 4 165 " c, dsl * cs
-   } else if ($7 < 0 && $1 > c) {
-   print "p 4 165 " c, $1 - c
-   } else if ($1 < c) {
-   print "Disk space overcommitted by", \
-   c - $1, "sectors" > "/dev/stderr"
-   exit 2
-   }
-
-   # Force slice 1 to be marked active. This is necessary
-   # for booting the image from a USB device to work.
-   print "a 1"
-   }
-   ' > ${NANO_LOG}/_.fdisk
-
-   IMG=${NANO_DISKIMGDIR}/${NANO_IMGNAME}
-   MNT=${NANO_OBJ}/_.mnt
-   mkdir -p ${MNT}
-
-   if [ "${NANO_MD_BACKING}" = "swap" ] ; then
-   MD=`mdconfig -a -t swap -s ${NANO_MEDIASIZE} -x ${NANO_SECTS} \
-   -y ${NANO_HEADS}`
-   else
-   echo "Creating md backing file..."
-   rm -f ${IMG}
-   dd if=/dev/zero of=${IMG} seek=${NANO_MEDIASIZE} count=0
-   MD=`mdconfig -a -t vnode -f ${IMG} -x ${NANO_SECTS} \
-   -y ${NANO_HEADS}`
-   fi
-
-   trap "echo 'Running exit trap code' ; df -i ${MNT} ; nano_umount ${MNT} 
|| true ; mdconfig -d -u $MD" 1 2 15 EXIT
-
-   fdisk -i -f ${NANO_LOG}/_.fdisk ${MD}
-   fdisk ${MD}
-   # XXX: params
-   # XXX: pick up cached boot* files, they may not be in image anymore.
-   if [ -f ${NANO_WORLDDIR}/${NANO_BOOTLOADER} ]; then
-   boot0cfg -B -b ${NANO_WORLDDIR}/${NANO_BOOTLOADER} 
${NANO_BOOT0CFG} ${MD}
-   fi
-   if [ -f ${NANO_WORLDDIR}/boot/boot ]; then
-   bsdlabel -w -B -b ${NANO_WORLDDIR}/boot/boot 
${MD}${NANO_SLICE_ROOT}
-   else
-   bsdlabel -w ${MD}${NANO_SLICE_ROOT}
-   fi
-   bsdlabel ${MD}${NANO_SLICE_ROOT}
-
-   # Create first image
-

Re: svn commit: r308691 - in head/sys: cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs fs/tmpfs kern vm

2016-11-16 Thread Konstantin Belousov
On Wed, Nov 16, 2016 at 01:37:18PM +, Ruslan Bukin wrote:
> I have a panic with this on RISC-V. Any ideas ?
How did you checked that the revision you replied to, makes the problem ?
Note that the backtrace below is not reasonable.

> 
>   
>   
> r   vv
>   
> rr
> rr
> rr
>   vv  
> r   vv
> rrvv  
> rr  rr
>   vv  
> rr  vv  rr
>   vv  
> rr  vv  rr
>   vv  
> rr  vv  rr
>   vv  
> rr  rr
>   
> rr  rr
> 
>INSTRUCTION SETS WANT TO BE FREE
> KDB: debugger backends: ddb
> KDB: current backend: ddb
> Found 2 CPUs in the device tree
> Copyright (c) 1992-2016 The FreeBSD Project.
> Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
>   The Regents of the University of California. All rights reserved.
> FreeBSD is a registered trademark of The FreeBSD Foundation.
> FreeBSD 12.0-CURRENT #4 0a3288b(br-riscv-isa-update)-dirty: Wed Nov 16 
> 13:28:11 UTC 2016
> 
> rb...@vica.cl.cam.ac.uk:/home/rb743/obj/riscv.riscv64/home/rb743/dev/freebsd-riscv/sys/SPIKE
>  riscv
> gcc version 6.1.0 (GCC) 
> Preloaded elf64 kernel "kernel" at 0xffc0026be360.
> CPU(0): Unknown Implementer Unknown Processor
> Starting CPU 1 (0)
> FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
> ULE: setup cpu 0
> ULE: setup cpu 1
> random: entropy device external interface
> crypto: 
> mem: 
> openfirm: 
> null: 
> nfslock: pseudo-device
> random: harvesting attach, 8 bytes (4 bits) from nexus0
> ofwbus0: 
> simplebus0:  on ofwbus0
> random: harvesting attach, 8 bytes (4 bits) from simplebus0
> random: harvesting attach, 8 bytes (4 bits) from ofwbus0
> timer0:  mem 0x4000-0x4007,0x4008-0x40001007 irq 5 
> on simplebus0
> Timecounter "RISC-V Timecounter" frequency 100 Hz quality 1000
> Event timer "RISC-V Eventtimer" frequency 100 Hz quality 1000
> random: harvesting attach, 8 bytes (4 bits) from timer0
> cpulist0:  on ofwbus0
> cpu0:  on cpulist0
> cpu0: missing 'clock-frequency' property
> riscv64_cpu0: register <0>
> random: harvesting attach, 8 bytes (4 bits) from riscv64_cpu0
> random: harvesting attach, 8 bytes (4 bits) from cpu0
> cpu1:  on cpulist0
> cpu1: missing 'clock-frequency' property
> riscv64_cpu1: register <0>
> random: harvesting attach, 8 bytes (4 bits) from riscv64_cpu1
> random: harvesting attach, 8 bytes (4 bits) from cpu1
> random: harvesting attach, 8 bytes (4 bits) from cpulist0
> simplebus0:  compat riscv,pic (no driver attached)
> rcons0:  irq 1 on simplebus0
> random: harvesting attach, 8 bytes (4 bits) from rcons0
> cryptosoft0: 
> crypto: assign cryptosoft0 driver id 0, flags 100663296
> crypto: cryptosoft0 registers alg 1 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 2 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 3 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 4 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 5 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 16 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 6 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 7 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 18 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 19 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 20 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 8 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 15 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 9 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 10 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 13 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 14 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 11 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 22 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 23 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 25 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 24 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 26 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 27 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 28 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 21 flags 0 maxoplen 0
> crypto: cryptosoft0 registers alg 17 flags 0 maxoplen 

Re: svn commit: r308691 - in head/sys: cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs fs/tmpfs kern vm

2016-11-16 Thread Ruslan Bukin
On Wed, Nov 16, 2016 at 06:53:43PM +0200, Konstantin Belousov wrote:
> On Wed, Nov 16, 2016 at 01:37:18PM +, Ruslan Bukin wrote:
> > I have a panic with this on RISC-V. Any ideas ?
> How did you checked that the revision you replied to, makes the problem ?
> Note that the backtrace below is not reasonable.

I reverted this commit like that and rebuilt kernel:
git show 2fa36073055134deb2df39c7ca46264cfc313d77 | patch -p1 -R

So the problem is reproducible on dual-core with 32mb mdroot.

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


svn commit: r308736 - head/tools/tools/nanobsd

2016-11-16 Thread Warner Losh
Author: imp
Date: Wed Nov 16 17:11:05 2016
New Revision: 308736
URL: https://svnweb.freebsd.org/changeset/base/308736

Log:
  Allow installworld to be skipped as well as installkernel with -W.
  Allow -B to mean -K -W.
  
  There are times when fixing non-base elementes of the build that you
  don't want to wait to get a completely clean world install. This
  allows that at the cost of a little danger.
  
  Submitted by: gallatin@
  Sponsored by: Netflix, Inc

Modified:
  head/tools/tools/nanobsd/nanobsd.sh

Modified: head/tools/tools/nanobsd/nanobsd.sh
==
--- head/tools/tools/nanobsd/nanobsd.sh Wed Nov 16 16:49:21 2016
(r308735)
+++ head/tools/tools/nanobsd/nanobsd.sh Wed Nov 16 17:11:05 2016
(r308736)
@@ -40,6 +40,7 @@ do_clean=true
 do_kernel=true
 do_installkernel=true
 do_world=true
+do_installworld=true
 do_image=true
 do_copyout_partition=true
 do_native_xtools=false
@@ -48,7 +49,7 @@ do_native_xtools=false
 do_legacy=false
 
 set +e
-args=`getopt KXbc:fhiknqvw $*`
+args=`getopt BKXWbc:fhiknqvw $*`
 if [ $? -ne 0 ] ; then
usage
exit 2
@@ -60,6 +61,11 @@ for i
 do
case "$i"
in
+   -B)
+   do_installworld=false
+   do_installkernel=false
+   shift
+   ;;
-K)
do_installkernel=false
shift
@@ -68,6 +74,10 @@ do
do_native_xtools=true
shift
;;
+   -W)
+   do_installworld=false
+   shift
+   ;;
-b)
do_world=false
do_kernel=false
@@ -174,10 +184,15 @@ else
pprint 2 "Skipping buildkernel (as instructed)"
 fi
 
-clean_world
-make_conf_install
-install_world
-install_etc
+if $do_installworld ; then
+clean_world
+make_conf_install
+install_world
+install_etc
+else
+pprint 2 "Skipping installworld (as instructed)"
+fi
+
 if $do_native_xtools ; then
native_xtools
 fi
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r308691 - in head/sys: cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs fs/tmpfs kern vm

2016-11-16 Thread Ruslan Bukin
On Wed, Nov 16, 2016 at 04:59:39PM +, Ruslan Bukin wrote:
> On Wed, Nov 16, 2016 at 06:53:43PM +0200, Konstantin Belousov wrote:
> > On Wed, Nov 16, 2016 at 01:37:18PM +, Ruslan Bukin wrote:
> > > I have a panic with this on RISC-V. Any ideas ?
> > How did you checked that the revision you replied to, makes the problem ?
> > Note that the backtrace below is not reasonable.
> 
> I reverted this commit like that and rebuilt kernel:
> git show 2fa36073055134deb2df39c7ca46264cfc313d77 | patch -p1 -R
> 
> So the problem is reproducible on dual-core with 32mb mdroot.
> 

I just found another interesting behavior:
depending on amount of physical memory :
700m - panic
800m - works fine
1024m - panic

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


Re: svn commit: r308691 - in head/sys: cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs fs/tmpfs kern vm

2016-11-16 Thread Alan Cox
On 11/16/2016 10:59, Ruslan Bukin wrote:
> On Wed, Nov 16, 2016 at 06:53:43PM +0200, Konstantin Belousov wrote:
>> On Wed, Nov 16, 2016 at 01:37:18PM +, Ruslan Bukin wrote:
>>> I have a panic with this on RISC-V. Any ideas ?
>> How did you checked that the revision you replied to, makes the problem ?
>> Note that the backtrace below is not reasonable.
> I reverted this commit like that and rebuilt kernel:
> git show 2fa36073055134deb2df39c7ca46264cfc313d77 | patch -p1 -R
>
> So the problem is reproducible on dual-core with 32mb mdroot.

This change amounted to dead code removal, so I'm not sure how it could
have an effect.  There were only a couple places where the changes were
other than mechanical in nature.  Also, that the number of cores matters
is no less puzzling.

Can you send Kostik and me the output of "sysctl vm.stats.vm" from
shortly after boot on the kernel with the patch reverted?


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


svn commit: r308737 - head/release

2016-11-16 Thread Glen Barber
Author: gjb
Date: Wed Nov 16 18:08:50 2016
New Revision: 308737
URL: https://svnweb.freebsd.org/changeset/base/308737

Log:
  Pass SWAPSIZE in env(1) when invoking mk-vmimage.sh, otherwise
  mkimg(1) does not create the second partition after r307008.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/Makefile.vm

Modified: head/release/Makefile.vm
==
--- head/release/Makefile.vmWed Nov 16 17:11:05 2016(r308736)
+++ head/release/Makefile.vmWed Nov 16 18:08:50 2016(r308737)
@@ -55,7 +55,7 @@ ${_CW:tu}CONF?=   ${.CURDIR}/tools/${_CW:t
 
 cw-${_CW:tl}:
mkdir -p ${.OBJDIR}/${.TARGET}
-   env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
+   env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} SWAPSIZE=${SWAPSIZE} \
${.CURDIR}/scripts/mk-vmimage.sh \
-C ${.CURDIR}/tools/vmimage.subr -d ${.OBJDIR}/${.TARGET} \
-i ${.OBJDIR}/${_CW:tl}.img -s ${VMSIZE} -f ${${_CW}_FORMAT} \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r308691 - in head/sys: cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs fs/tmpfs kern vm

2016-11-16 Thread Ruslan Bukin
On Wed, Nov 16, 2016 at 11:53:55AM -0600, Alan Cox wrote:
> On 11/16/2016 10:59, Ruslan Bukin wrote:
> > On Wed, Nov 16, 2016 at 06:53:43PM +0200, Konstantin Belousov wrote:
> >> On Wed, Nov 16, 2016 at 01:37:18PM +, Ruslan Bukin wrote:
> >>> I have a panic with this on RISC-V. Any ideas ?
> >> How did you checked that the revision you replied to, makes the problem ?
> >> Note that the backtrace below is not reasonable.
> > I reverted this commit like that and rebuilt kernel:
> > git show 2fa36073055134deb2df39c7ca46264cfc313d77 | patch -p1 -R
> >
> > So the problem is reproducible on dual-core with 32mb mdroot.
> 
> This change amounted to dead code removal, so I'm not sure how it could
> have an effect.  There were only a couple places where the changes were
> other than mechanical in nature.  Also, that the number of cores matters
> is no less puzzling.
> 
> Can you send Kostik and me the output of "sysctl vm.stats.vm" from
> shortly after boot on the kernel with the patch reverted?
> 

Here is result with patch reverted:
# sysctl vm.stats.vm
vm.stats.vm.v_vm_faults: 1578
vm.stats.vm.v_io_faults: 213
vm.stats.vm.v_cow_faults: 135
vm.stats.vm.v_cow_optim: 0
vm.stats.vm.v_zfod: 360
vm.stats.vm.v_ozfod: 0
vm.stats.vm.v_swapin: 0
vm.stats.vm.v_swapout: 0
vm.stats.vm.v_swappgsin: 0
vm.stats.vm.v_swappgsout: 0
vm.stats.vm.v_vnodein: 0
vm.stats.vm.v_vnodeout: 0
vm.stats.vm.v_vnodepgsin: 0
vm.stats.vm.v_vnodepgsout: 0
vm.stats.vm.v_intrans: 0
vm.stats.vm.v_reactivated: 0
vm.stats.vm.v_pdwakeups: 0
vm.stats.vm.v_pdpages: 2
vm.stats.vm.v_pdshortfalls: 0
vm.stats.vm.v_tcached: 0
vm.stats.vm.v_dfree: 0
vm.stats.vm.v_pfree: 142
vm.stats.vm.v_tfree: 340
vm.stats.vm.v_page_size: 4096
vm.stats.vm.v_page_count: 235637
vm.stats.vm.v_free_reserved: 356
vm.stats.vm.v_free_target: 5064
vm.stats.vm.v_free_min: 1533
vm.stats.vm.v_free_count: 231577
vm.stats.vm.v_wire_count: 3779
vm.stats.vm.v_active_count: 251
vm.stats.vm.v_inactive_target: 7596
vm.stats.vm.v_inactive_count: 29
vm.stats.vm.v_laundry_count: 0
vm.stats.vm.v_cache_count: 0
vm.stats.vm.v_pageout_free_min: 34
vm.stats.vm.v_interrupt_free_min: 2
vm.stats.vm.v_forks: 4
vm.stats.vm.v_vforks: 0
vm.stats.vm.v_rforks: 0
vm.stats.vm.v_kthreads: 20
vm.stats.vm.v_forkpages: 132
vm.stats.vm.v_vforkpages: 0
vm.stats.vm.v_rforkpages: 0
vm.stats.vm.v_kthreadpages: 0
# 

And here is patch not reverted, but 800m of physical memory:
# sysctl sysctl vm.stats.vm
vm.stats.vm.v_vm_faults: 1580
vm.stats.vm.v_io_faults: 213
vm.stats.vm.v_cow_faults: 135
vm.stats.vm.v_cow_optim: 0
vm.stats.vm.v_zfod: 362
vm.stats.vm.v_ozfod: 0
vm.stats.vm.v_swapin: 0
vm.stats.vm.v_swapout: 0
vm.stats.vm.v_swappgsin: 0
vm.stats.vm.v_swappgsout: 0
vm.stats.vm.v_vnodein: 0
vm.stats.vm.v_vnodeout: 0
vm.stats.vm.v_vnodepgsin: 0
vm.stats.vm.v_vnodepgsout: 0
vm.stats.vm.v_intrans: 0
vm.stats.vm.v_reactivated: 0
vm.stats.vm.v_pdwakeups: 0
vm.stats.vm.v_pdpages: 4
vm.stats.vm.v_pdshortfalls: 0
vm.stats.vm.v_tcached: 0
vm.stats.vm.v_dfree: 0
vm.stats.vm.v_pfree: 142
vm.stats.vm.v_tfree: 340
vm.stats.vm.v_page_size: 4096
vm.stats.vm.v_page_count: 179753
vm.stats.vm.v_free_reserved: 284
vm.stats.vm.v_free_target: 3872
vm.stats.vm.v_free_min: 1181
vm.stats.vm.v_free_count: 176074
vm.stats.vm.v_wire_count: 3396
vm.stats.vm.v_active_count: 253
vm.stats.vm.v_inactive_target: 5808
vm.stats.vm.v_inactive_count: 29
vm.stats.vm.v_laundry_count: 0
vm.stats.vm.v_cache_count: 0
vm.stats.vm.v_pageout_free_min: 34
vm.stats.vm.v_interrupt_free_min: 2
vm.stats.vm.v_forks: 4
vm.stats.vm.v_vforks: 0
vm.stats.vm.v_rforks: 0
vm.stats.vm.v_kthreads: 20
vm.stats.vm.v_forkpages: 132
vm.stats.vm.v_vforkpages: 0
vm.stats.vm.v_rforkpages: 0
vm.stats.vm.v_kthreadpages: 0
# 

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


Re: svn commit: r308664 - in head: contrib/hyperv/tools etc/devd etc/mtree include share/man/man4 sys/conf sys/dev/hyperv/utilities sys/modules/hyperv/utilities usr.sbin/hyperv usr.sbin/hyperv/tools u

2016-11-16 Thread Mark Johnston
On Tue, Nov 15, 2016 at 02:36:12AM +, Sepherosa Ziehau wrote:
> Author: sephe
> Date: Tue Nov 15 02:36:12 2016
> New Revision: 308664
> URL: https://svnweb.freebsd.org/changeset/base/308664
> 
> Log:
>   hyperv/vss: Add driver and tools for VSS
>   
>   VSS stands for "Volume Shadow Copy Service".  Unlike virtual machine
>   snapshot, it only takes snapshot for the virtual disks, so both
>   filesystem and applications have to aware of it, and cooperate the
>   whole VSS process.
>   
>   This driver exposes two device files to the userland:
>   
>   /dev/hv_fsvss_dev
>   
>   Normally userland programs should _not_ mess with this device file.
>   It is currently used by the hv_vss_daemon(8), which freezes and
>   thaws the filesystem.  NOTE: currently only UFS is supported, if
>   the system mounts _any_ other filesystems, the hv_vss_daemon(8)
>   will veto the VSS process.
>   
>   If hv_vss_daemon(8) was disabled, then this device file must be
>   opened, and proper ioctls must be issued to keep the VSS working.
>   
>   /dev/hv_appvss_dev
>   
>   Userland application can opened this device file to receive the
>   VSS freeze notification, hold the VSS for a while (mainly to flush
>   application data to filesystem), release the VSS process, and
>   receive the VSS thaw notification i.e. applications can run again.
>   
>   The VSS will still work, even if this device file is not opened.
>   However, only filesystem consistency is promised, if this device
>   file is not opened or is not operated properly.
>   
>   hv_vss_daemon(8) is started by devd(8) by default.  It can be disabled
>   by editting /etc/devd/hyperv.conf.
>   
>   Submitted by:   Hongjiang Zhang 
>   Reviewed by:kib, mckusick
>   MFC after:  3 weeks
>   Sponsored by:   Microsoft
>   Differential Revision:  https://reviews.freebsd.org/D8224
> 
> Added:
>   head/contrib/hyperv/tools/hv_vss_daemon.8
>   head/contrib/hyperv/tools/hv_vss_daemon.c
>   head/share/man/man4/hv_vss.4   (contents, props changed)
>   head/sys/dev/hyperv/utilities/hv_snapshot.c   (contents, props changed)
>   head/sys/dev/hyperv/utilities/hv_snapshot.h   (contents, props changed)
>   head/usr.sbin/hyperv/tools/kvp/
>   head/usr.sbin/hyperv/tools/kvp/Makefile
>  - copied, changed from r308663, head/usr.sbin/hyperv/tools/Makefile
>   head/usr.sbin/hyperv/tools/kvp/Makefile.depend
>  - copied unchanged from r308663, 
> head/usr.sbin/hyperv/tools/Makefile.depend
>   head/usr.sbin/hyperv/tools/vss/
>   head/usr.sbin/hyperv/tools/vss/Makefile   (contents, props changed)
>   head/usr.sbin/hyperv/tools/vss/Makefile.depend   (contents, props changed)
> Deleted:
>   head/usr.sbin/hyperv/tools/Makefile
>   head/usr.sbin/hyperv/tools/Makefile.depend
> Modified:
>   head/etc/devd/hyperv.conf
>   head/etc/mtree/BSD.include.dist
>   head/include/Makefile
>   head/share/man/man4/Makefile
>   head/sys/conf/files.amd64
>   head/sys/conf/files.i386
>   head/sys/modules/hyperv/utilities/Makefile
>   head/usr.sbin/hyperv/Makefile

This appears to install hv_kvp_daemon and hv_vss_daemon to / instead of
/usr/sbin, and breaks the -DNO_ROOT build. I think a Makefile.inc is
needed in usr.sbin/hyperv/tools in order to preserve BINDIR from
usr.sbin/Makefile.inc. I fixed the problem in my tree with the diff
below, but am not sure if this is the right way to do it. For some
reason, doing this resulted in unused var warnings compiling
hv_vss_daemon.c.

diff --git a/contrib/hyperv/tools/hv_vss_daemon.c 
b/contrib/hyperv/tools/hv_vss_daemon.c
index 8b58bc9..a1ba98d 100644
--- a/contrib/hyperv/tools/hv_vss_daemon.c
+++ b/contrib/hyperv/tools/hv_vss_daemon.c
@@ -158,10 +158,9 @@ main(int argc, char* argv[])
 
struct pollfd hv_vss_poll_fd[1];
uint32_t op;
-   int ch, r, len, error;
+   int ch, r, error;
int hv_vss_dev_fd;
 
-   int freeze_thaw = UNDEF_FREEZE_THAW;
while ((ch = getopt(argc, argv, "dnh")) != -1) {
switch (ch) {
case 'n':
diff --git a/usr.sbin/hyperv/Makefile.inc b/usr.sbin/hyperv/tools/Makefile.inc
similarity index 60%
rename from usr.sbin/hyperv/Makefile.inc
rename to usr.sbin/hyperv/tools/Makefile.inc
index edb0129..7e09f32 100644
--- a/usr.sbin/hyperv/Makefile.inc
+++ b/usr.sbin/hyperv/tools/Makefile.inc
@@ -1,4 +1,4 @@
 # $FreeBSD$
 
 CFLAGS.gcc+= -Wno-uninitialized
-.include "../Makefile.inc"
+.include "../../Makefile.inc"
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r308741 - head

2016-11-16 Thread Bryan Drewery
Author: bdrewery
Date: Thu Nov 17 00:21:55 2016
New Revision: 308741
URL: https://svnweb.freebsd.org/changeset/base/308741

Log:
  Fix grammar nit

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Wed Nov 16 22:28:46 2016(r308740)
+++ head/UPDATING   Thu Nov 17 00:21:55 2016(r308741)
@@ -130,7 +130,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12
 
 20160527:
CAM will now strip leading spaces from SCSI disks' serial numbers.
-   This will effect users who create UFS filesystems on SCSI disks using
+   This will affect users who create UFS filesystems on SCSI disks using
those disk's diskid device nodes.  For example, if /etc/fstab
previously contained a line like
"/dev/diskid/DISK-%20%20%20%20%20%20%20ABCDEFG0123456", you should
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r308664 - in head: contrib/hyperv/tools etc/devd etc/mtree include share/man/man4 sys/conf sys/dev/hyperv/utilities sys/modules/hyperv/utilities usr.sbin/hyperv usr.sbin/hyperv/tools u

2016-11-16 Thread Ngie Cooper
On Wed, Nov 16, 2016 at 2:14 PM, Mark Johnston  wrote:
...
> This appears to install hv_kvp_daemon and hv_vss_daemon to / instead of
> /usr/sbin, and breaks the -DNO_ROOT build. I think a Makefile.inc is
> needed in usr.sbin/hyperv/tools in order to preserve BINDIR from
> usr.sbin/Makefile.inc. I fixed the problem in my tree with the diff
> below, but am not sure if this is the right way to do it. For some
> reason, doing this resulted in unused var warnings compiling
> hv_vss_daemon.c.

The -Wunused warnings you're seeing are because you're now it's
setting WARNS by .include'ing usr.bin/Makefile.inc ; it used to be set
(I verified that), but then got unset between a few weeks ago and now
on the directory:

$ make -V.CURDIR -VWARNS
/usr/src/usr.sbin/hyperv/tools

$

Cheers,
-Ngie

PS -Wno-uninitialized is only set for gcc...? Really...???
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r308664 - in head: contrib/hyperv/tools etc/devd etc/mtree include share/man/man4 sys/conf sys/dev/hyperv/utilities sys/modules/hyperv/utilities usr.sbin/hyperv usr.sbin/hyperv/tools u

2016-11-16 Thread Sepherosa Ziehau
On Thu, Nov 17, 2016 at 6:14 AM, Mark Johnston  wrote:
> On Tue, Nov 15, 2016 at 02:36:12AM +, Sepherosa Ziehau wrote:
>> Author: sephe
>> Date: Tue Nov 15 02:36:12 2016
>> New Revision: 308664
>> URL: https://svnweb.freebsd.org/changeset/base/308664
>>
>> Log:
>>   hyperv/vss: Add driver and tools for VSS
>>
>>   VSS stands for "Volume Shadow Copy Service".  Unlike virtual machine
>>   snapshot, it only takes snapshot for the virtual disks, so both
>>   filesystem and applications have to aware of it, and cooperate the
>>   whole VSS process.
>>
>>   This driver exposes two device files to the userland:
>>
>>   /dev/hv_fsvss_dev
>>
>>   Normally userland programs should _not_ mess with this device file.
>>   It is currently used by the hv_vss_daemon(8), which freezes and
>>   thaws the filesystem.  NOTE: currently only UFS is supported, if
>>   the system mounts _any_ other filesystems, the hv_vss_daemon(8)
>>   will veto the VSS process.
>>
>>   If hv_vss_daemon(8) was disabled, then this device file must be
>>   opened, and proper ioctls must be issued to keep the VSS working.
>>
>>   /dev/hv_appvss_dev
>>
>>   Userland application can opened this device file to receive the
>>   VSS freeze notification, hold the VSS for a while (mainly to flush
>>   application data to filesystem), release the VSS process, and
>>   receive the VSS thaw notification i.e. applications can run again.
>>
>>   The VSS will still work, even if this device file is not opened.
>>   However, only filesystem consistency is promised, if this device
>>   file is not opened or is not operated properly.
>>
>>   hv_vss_daemon(8) is started by devd(8) by default.  It can be disabled
>>   by editting /etc/devd/hyperv.conf.
>>
>>   Submitted by:   Hongjiang Zhang 
>>   Reviewed by:kib, mckusick
>>   MFC after:  3 weeks
>>   Sponsored by:   Microsoft
>>   Differential Revision:  https://reviews.freebsd.org/D8224
>>
>> Added:
>>   head/contrib/hyperv/tools/hv_vss_daemon.8
>>   head/contrib/hyperv/tools/hv_vss_daemon.c
>>   head/share/man/man4/hv_vss.4   (contents, props changed)
>>   head/sys/dev/hyperv/utilities/hv_snapshot.c   (contents, props changed)
>>   head/sys/dev/hyperv/utilities/hv_snapshot.h   (contents, props changed)
>>   head/usr.sbin/hyperv/tools/kvp/
>>   head/usr.sbin/hyperv/tools/kvp/Makefile
>>  - copied, changed from r308663, head/usr.sbin/hyperv/tools/Makefile
>>   head/usr.sbin/hyperv/tools/kvp/Makefile.depend
>>  - copied unchanged from r308663, 
>> head/usr.sbin/hyperv/tools/Makefile.depend
>>   head/usr.sbin/hyperv/tools/vss/
>>   head/usr.sbin/hyperv/tools/vss/Makefile   (contents, props changed)
>>   head/usr.sbin/hyperv/tools/vss/Makefile.depend   (contents, props changed)
>> Deleted:
>>   head/usr.sbin/hyperv/tools/Makefile
>>   head/usr.sbin/hyperv/tools/Makefile.depend
>> Modified:
>>   head/etc/devd/hyperv.conf
>>   head/etc/mtree/BSD.include.dist
>>   head/include/Makefile
>>   head/share/man/man4/Makefile
>>   head/sys/conf/files.amd64
>>   head/sys/conf/files.i386
>>   head/sys/modules/hyperv/utilities/Makefile
>>   head/usr.sbin/hyperv/Makefile
>
> This appears to install hv_kvp_daemon and hv_vss_daemon to / instead of
> /usr/sbin, and breaks the -DNO_ROOT build. I think a Makefile.inc is
> needed in usr.sbin/hyperv/tools in order to preserve BINDIR from
> usr.sbin/Makefile.inc. I fixed the problem in my tree with the diff
> below, but am not sure if this is the right way to do it. For some
> reason, doing this resulted in unused var warnings compiling
> hv_vss_daemon.c.
>
> diff --git a/contrib/hyperv/tools/hv_vss_daemon.c 
> b/contrib/hyperv/tools/hv_vss_daemon.c
> index 8b58bc9..a1ba98d 100644
> --- a/contrib/hyperv/tools/hv_vss_daemon.c
> +++ b/contrib/hyperv/tools/hv_vss_daemon.c
> @@ -158,10 +158,9 @@ main(int argc, char* argv[])
>
> struct pollfd hv_vss_poll_fd[1];
> uint32_t op;
> -   int ch, r, len, error;
> +   int ch, r, error;
> int hv_vss_dev_fd;
>
> -   int freeze_thaw = UNDEF_FREEZE_THAW;
> while ((ch = getopt(argc, argv, "dnh")) != -1) {
> switch (ch) {
> case 'n':
> diff --git a/usr.sbin/hyperv/Makefile.inc b/usr.sbin/hyperv/tools/Makefile.inc
> similarity index 60%
> rename from usr.sbin/hyperv/Makefile.inc
> rename to usr.sbin/hyperv/tools/Makefile.inc
> index edb0129..7e09f32 100644
> --- a/usr.sbin/hyperv/Makefile.inc
> +++ b/usr.sbin/hyperv/tools/Makefile.inc
> @@ -1,4 +1,4 @@
>  # $FreeBSD$
>
>  CFLAGS.gcc+= -Wno-uninitialized
> -.include "../Makefile.inc"
> +.include "../../Makefile.inc"

Thank you for the patch!  I will handle it today!

-- 
Tomorrow Will Never Die
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r308742 - head/contrib/hyperv/tools

2016-11-16 Thread Sepherosa Ziehau
Author: sephe
Date: Thu Nov 17 03:00:56 2016
New Revision: 308742
URL: https://svnweb.freebsd.org/changeset/base/308742

Log:
  hyperv/vss: Nuke unused variables.
  
  Submitted by: markj
  Reported by:  markj
  MFC after:3 weeks
  Sponsored by: Microsoft

Modified:
  head/contrib/hyperv/tools/hv_vss_daemon.c

Modified: head/contrib/hyperv/tools/hv_vss_daemon.c
==
--- head/contrib/hyperv/tools/hv_vss_daemon.c   Thu Nov 17 00:21:55 2016
(r308741)
+++ head/contrib/hyperv/tools/hv_vss_daemon.c   Thu Nov 17 03:00:56 2016
(r308742)
@@ -158,10 +158,9 @@ main(int argc, char* argv[])
 
struct pollfd hv_vss_poll_fd[1];
uint32_t op;
-   int ch, r, len, error;
+   int ch, r, error;
int hv_vss_dev_fd;
 
-   int freeze_thaw = UNDEF_FREEZE_THAW;
while ((ch = getopt(argc, argv, "dnh")) != -1) {
switch (ch) {
case 'n':
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r308743 - head/usr.sbin/hyperv/tools

2016-11-16 Thread Sepherosa Ziehau
Author: sephe
Date: Thu Nov 17 03:02:35 2016
New Revision: 308743
URL: https://svnweb.freebsd.org/changeset/base/308743

Log:
  hyperv/vss: Install the userland daemon to /usr/sbin instead of /
  
  Submitted by: markj
  Reported by:  markj
  MFC after:3 weeks
  Sponsored by: Microsoft

Added:
  head/usr.sbin/hyperv/tools/Makefile.inc   (contents, props changed)

Added: head/usr.sbin/hyperv/tools/Makefile.inc
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.sbin/hyperv/tools/Makefile.inc Thu Nov 17 03:02:35 2016
(r308743)
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+CFLAGS.gcc+= -Wno-uninitialized
+.include "../../Makefile.inc"
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r308664 - in head: contrib/hyperv/tools etc/devd etc/mtree include share/man/man4 sys/conf sys/dev/hyperv/utilities sys/modules/hyperv/utilities usr.sbin/hyperv usr.sbin/hyperv/tools u

2016-11-16 Thread Sepherosa Ziehau
On Thu, Nov 17, 2016 at 6:14 AM, Mark Johnston  wrote:
> On Tue, Nov 15, 2016 at 02:36:12AM +, Sepherosa Ziehau wrote:
>> Author: sephe
>> Date: Tue Nov 15 02:36:12 2016
>> New Revision: 308664
>> URL: https://svnweb.freebsd.org/changeset/base/308664
>>
>> Log:
>>   hyperv/vss: Add driver and tools for VSS
>
> This appears to install hv_kvp_daemon and hv_vss_daemon to / instead of
> /usr/sbin, and breaks the -DNO_ROOT build. I think a Makefile.inc is
> needed in usr.sbin/hyperv/tools in order to preserve BINDIR from
> usr.sbin/Makefile.inc. I fixed the problem in my tree with the diff
> below, but am not sure if this is the right way to do it. For some
> reason, doing this resulted in unused var warnings compiling
> hv_vss_daemon.c.
>
> diff --git a/contrib/hyperv/tools/hv_vss_daemon.c 
> b/contrib/hyperv/tools/hv_vss_daemon.c
> index 8b58bc9..a1ba98d 100644
> --- a/contrib/hyperv/tools/hv_vss_daemon.c
> +++ b/contrib/hyperv/tools/hv_vss_daemon.c
> @@ -158,10 +158,9 @@ main(int argc, char* argv[])
>
> struct pollfd hv_vss_poll_fd[1];
> uint32_t op;
> -   int ch, r, len, error;
> +   int ch, r, error;
> int hv_vss_dev_fd;
>
> -   int freeze_thaw = UNDEF_FREEZE_THAW;
> while ((ch = getopt(argc, argv, "dnh")) != -1) {
> switch (ch) {
> case 'n':
> diff --git a/usr.sbin/hyperv/Makefile.inc b/usr.sbin/hyperv/tools/Makefile.inc
> similarity index 60%
> rename from usr.sbin/hyperv/Makefile.inc
> rename to usr.sbin/hyperv/tools/Makefile.inc
> index edb0129..7e09f32 100644
> --- a/usr.sbin/hyperv/Makefile.inc
> +++ b/usr.sbin/hyperv/tools/Makefile.inc
> @@ -1,4 +1,4 @@
>  # $FreeBSD$
>
>  CFLAGS.gcc+= -Wno-uninitialized
> -.include "../Makefile.inc"
> +.include "../../Makefile.inc"

Committed!  Thank you for the submission!

-- 
Tomorrow Will Never Die
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r308744 - head/sys/dev/etherswitch/infineon

2016-11-16 Thread Michael Zhilin
Author: mizhka
Date: Thu Nov 17 07:33:37 2016
New Revision: 308744
URL: https://svnweb.freebsd.org/changeset/base/308744

Log:
  [etherswitch] add infineon adm6996fc support on etherswitch
  
  This is Infineon ADM6996FC/M/MX driver code on etherswitch framework.
  Support PORT and DOT1Q VLAN.
  This code suppose ADM6996FC SDC/SDIO connect to SOC network interface
  MDC/MDIO.
  This code tested on Netgear WGR614Cv7.
  
  Submitted by: Hiroki Mori 
  Reviewed by:  adrian, mizhka
  Approved by:  adrian(mentor)
  Differential Revision:https://reviews.freebsd.org/D8495

Added:
  head/sys/dev/etherswitch/infineon/
  head/sys/dev/etherswitch/infineon/adm6996fc.c   (contents, props changed)

Added: head/sys/dev/etherswitch/infineon/adm6996fc.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/etherswitch/infineon/adm6996fc.c   Thu Nov 17 07:33:37 
2016(r308744)
@@ -0,0 +1,858 @@
+/*-
+ * Copyright (c) 2016 Hiroki Mori
+ * Copyright (c) 2013 Luiz Otavio O Souza.
+ * Copyright (c) 2011-2012 Stefan Bethke.
+ * Copyright (c) 2012 Adrian Chadd.
+ * 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.
+ *
+ * $FreeBSD$
+ */
+
+/*
+ * This is Infineon ADM6996FC/M/MX driver code on etherswitch framework.
+ * Support PORT and DOT1Q VLAN.
+ * This code suppose ADM6996FC SDC/SDIO connect to SOC network interface
+ * MDC/MDIO.
+ * This code development on Netgear WGR614Cv7.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include "mdio_if.h"
+#include "miibus_if.h"
+#include "etherswitch_if.h"
+
+#defineADM6996FC_PRODUCT_CODE  0x7102
+
+#defineADM6996FC_SC3   0x11
+#defineADM6996FC_VF0L  0x40
+#defineADM6996FC_VF0H  0x41
+#defineADM6996FC_CI0   0xa0
+#defineADM6996FC_CI1   0xa1
+#defineADM6996FC_PHY_C00x200
+
+#defineADM6996FC_PC_SHIFT  4
+#defineADM6996FC_TBV_SHIFT 5
+#defineADM6996FC_PVID_SHIFT10
+#defineADM6996FC_OPTE_SHIFT4
+#defineADM6996FC_VV_SHIFT  15
+
+#defineADM6996FC_PHY_SIZE  0x20
+
+MALLOC_DECLARE(M_ADM6996FC);
+MALLOC_DEFINE(M_ADM6996FC, "adm6996fc", "adm6996fc data structures");
+
+struct adm6996fc_softc {
+   struct mtx  sc_mtx; /* serialize access to softc */
+   device_tsc_dev;
+   int vlan_mode;
+   int media;  /* cpu port media */
+   int cpuport;/* which PHY is connected to the CPU */
+   int phymask;/* PHYs we manage */
+   int numports;   /* number of ports */
+   int ifpport[MII_NPHY];
+   int *portphy;
+   char**ifname;
+   device_t**miibus;
+   struct ifnet**ifp;
+   struct callout  callout_tick;
+   etherswitch_info_t  info;
+};
+
+#defineADM6996FC_LOCK(_sc) \
+   mtx_lock(&(_sc)->sc_mtx)
+#defineADM6996FC_UNLOCK(_sc)   \
+   mtx_unlock(&(_sc)->sc_mtx)
+#defineADM6996FC_LOCK_ASSERT(_sc, _what)   \
+   mtx_assert(&(_sc)->sc_mtx, (_what))
+#defineADM6996FC_TRYLOCK(_sc)  \
+   mtx_trylock(&(_sc)->sc_mtx)
+
+#if defined(DEBUG)
+#defineDPRINTF(dev, args...) device_printf(dev, args)
+#else
+#define