summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/machdep.c38
-rw-r--r--sys/arm/arm/mem.c6
-rw-r--r--sys/arm/arm/pmu.c157
-rw-r--r--sys/arm/ti/ti_i2c.c44
-rw-r--r--sys/boot/fdt/dts/arm/am335x.dtsi5
-rw-r--r--sys/cam/scsi/scsi_da.c12
-rw-r--r--sys/conf/kern.opts.mk2
-rw-r--r--sys/dev/cxgbe/t4_main.c6
-rw-r--r--sys/dev/cxgbe/tom/t4_ddp.c30
-rw-r--r--sys/kern/kern_timeout.c4
-rw-r--r--sys/kern/subr_sglist.c3
-rw-r--r--sys/modules/Makefile9
-rw-r--r--sys/modules/iscsi/Makefile10
13 files changed, 276 insertions, 50 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 07378fdd..839da01 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -1355,8 +1355,10 @@ add_physmap_entry(uint64_t base, uint64_t length, vm_paddr_t *physmap,
/*
* Find insertion point while checking for overlap. Start off by
* assuming the new entry will be added to the end.
+ *
+ * NB: physmap_idx points to the next free slot.
*/
- insert_idx = physmap_idx + 2;
+ insert_idx = physmap_idx;
for (i = 0; i <= physmap_idx; i += 2) {
if (base < physmap[i + 1]) {
if (base + length <= physmap[i]) {
@@ -1394,7 +1396,7 @@ add_physmap_entry(uint64_t base, uint64_t length, vm_paddr_t *physmap,
* Move the last 'N' entries down to make room for the new
* entry if needed.
*/
- for (i = physmap_idx; i > insert_idx; i -= 2) {
+ for (i = (physmap_idx - 2); i > insert_idx; i -= 2) {
physmap[i] = physmap[i - 2];
physmap[i + 1] = physmap[i - 1];
}
@@ -1580,23 +1582,27 @@ getmemsize(caddr_t kmdp, u_int64_t first)
int page_counter;
bzero(physmap, sizeof(physmap));
- basemem = 0;
physmap_idx = 0;
init_ops.parse_memmap(kmdp, physmap, &physmap_idx);
+ physmap_idx -= 2;
/*
* Find the 'base memory' segment for SMP
*/
basemem = 0;
for (i = 0; i <= physmap_idx; i += 2) {
- if (physmap[i] == 0x00000000) {
+ if (physmap[i] <= 0xA0000) {
basemem = physmap[i + 1] / 1024;
break;
}
}
- if (basemem == 0)
- panic("BIOS smap did not include a basemem segment!");
+ if (basemem == 0 || basemem > 640) {
+ if (bootverbose)
+ printf(
+ "Memory map doesn't contain a basemem segment, faking it");
+ basemem = 640;
+ }
/*
* Make hole for "AP -> long mode" bootstrap code. The
@@ -1604,8 +1610,12 @@ getmemsize(caddr_t kmdp, u_int64_t first)
* is configured to support APs and APs for the system start
* in 32bit mode (e.g. SMP bare metal).
*/
- if (init_ops.mp_bootaddress)
+ if (init_ops.mp_bootaddress) {
+ if (physmap[1] >= 0x100000000)
+ panic(
+ "Basemem segment is not suitable for AP bootstrap code!");
physmap[1] = init_ops.mp_bootaddress(physmap[1] / 1024);
+ }
/*
* Maxmem isn't the "maximum memory", it's one larger than the
@@ -1657,12 +1667,14 @@ getmemsize(caddr_t kmdp, u_int64_t first)
*/
physmem_start = (vm_guest > VM_GUEST_NO ? 1 : 16) << PAGE_SHIFT;
TUNABLE_ULONG_FETCH("hw.physmem.start", &physmem_start);
- if (physmem_start < PAGE_SIZE)
- physmap[0] = PAGE_SIZE;
- else if (physmem_start >= physmap[1])
- physmap[0] = round_page(physmap[1] - PAGE_SIZE);
- else
- physmap[0] = round_page(physmem_start);
+ if (physmap[0] < physmem_start) {
+ if (physmem_start < PAGE_SIZE)
+ physmap[0] = PAGE_SIZE;
+ else if (physmem_start >= physmap[1])
+ physmap[0] = round_page(physmap[1] - PAGE_SIZE);
+ else
+ physmap[0] = round_page(physmem_start);
+ }
pa_indx = 0;
da_indx = 1;
phys_avail[pa_indx++] = physmap[0];
diff --git a/sys/arm/arm/mem.c b/sys/arm/arm/mem.c
index 30d4b1d..58b0d25 100644
--- a/sys/arm/arm/mem.c
+++ b/sys/arm/arm/mem.c
@@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$");
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/signalvar.h>
+#include <sys/sx.h>
#include <sys/systm.h>
#include <sys/uio.h>
@@ -72,6 +73,9 @@ MALLOC_DEFINE(M_MEMDESC, "memdesc", "memory range descriptors");
struct mem_range_softc mem_range_softc;
+static struct sx tmppt_lock;
+SX_SYSINIT(tmppt, &tmppt_lock, "mem4map");
+
/* ARGSUSED */
int
memrw(struct cdev *dev, struct uio *uio, int flags)
@@ -107,6 +111,7 @@ memrw(struct cdev *dev, struct uio *uio, int flags)
}
if (!address_valid)
return (EINVAL);
+ sx_xlock(&tmppt_lock);
pmap_kenter((vm_offset_t)_tmppt, v);
o = (int)uio->uio_offset & PAGE_MASK;
c = (u_int)(PAGE_SIZE - ((int)iov->iov_base & PAGE_MASK));
@@ -114,6 +119,7 @@ memrw(struct cdev *dev, struct uio *uio, int flags)
c = min(c, (u_int)iov->iov_len);
error = uiomove((caddr_t)&_tmppt[o], (int)c, uio);
pmap_qremove((vm_offset_t)_tmppt, 1);
+ sx_xunlock(&tmppt_lock);
continue;
}
else if (dev2unit(dev) == CDEV_MINOR_KMEM) {
diff --git a/sys/arm/arm/pmu.c b/sys/arm/arm/pmu.c
new file mode 100644
index 0000000..168c8b4
--- /dev/null
+++ b/sys/arm/arm/pmu.c
@@ -0,0 +1,157 @@
+/*-
+ * Copyright (c) 2015 Ruslan Bukin <br@bsdpad.com>
+ * All rights reserved.
+ *
+ * This software was developed by SRI International and the University of
+ * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
+ * ("CTSRD"), as part of the DARPA CRASH research programme.
+ *
+ * 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.
+ */
+
+/*
+ * Performance Monitoring Unit
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "opt_hwpmc_hooks.h"
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/malloc.h>
+#include <sys/rman.h>
+#include <sys/timeet.h>
+#include <sys/timetc.h>
+#include <sys/pmc.h>
+#include <sys/pmckern.h>
+
+#include <dev/fdt/fdt_common.h>
+#include <dev/ofw/openfirm.h>
+#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/ofw_bus_subr.h>
+
+#include <machine/bus.h>
+#include <machine/fdt.h>
+#include <machine/cpu.h>
+#include <machine/intr.h>
+
+struct pmu_softc {
+ struct resource *res[1];
+ device_t dev;
+ void *ih;
+};
+
+static struct ofw_compat_data compat_data[] = {
+ {"arm,cortex-a17-pmu", 1},
+ {"arm,cortex-a15-pmu", 1},
+ {"arm,cortex-a12-pmu", 1},
+ {"arm,cortex-a9-pmu", 1},
+ {"arm,cortex-a8-pmu", 1},
+ {"arm,cortex-a7-pmu", 1},
+ {"arm,cortex-a5-pmu", 1},
+ {"arm,arm11mpcore-pmu", 1},
+ {"arm,arm1176-pmu", 1},
+ {"arm,arm1136-pmu", 1},
+ {"qcom,krait-pmu", 1},
+ {NULL, 0}
+};
+
+static struct resource_spec pmu_spec[] = {
+ { SYS_RES_IRQ, 0, RF_ACTIVE },
+ { -1, 0 }
+};
+
+static int
+pmu_intr(void *arg)
+{
+ struct trapframe *tf;
+
+ tf = arg;
+
+#ifdef HWPMC_HOOKS
+ if (pmc_intr)
+ (*pmc_intr)(PCPU_GET(cpuid), tf);
+#endif
+
+ return (FILTER_HANDLED);
+}
+
+static int
+pmu_probe(device_t dev)
+{
+
+ if (!ofw_bus_status_okay(dev))
+ return (ENXIO);
+
+ if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) {
+ device_set_desc(dev, "Performance Monitoring Unit");
+ return (BUS_PROBE_DEFAULT);
+ }
+
+ return (ENXIO);
+}
+
+static int
+pmu_attach(device_t dev)
+{
+ struct pmu_softc *sc;
+ int err;
+
+ sc = device_get_softc(dev);
+ sc->dev = dev;
+
+ if (bus_alloc_resources(dev, pmu_spec, sc->res)) {
+ device_printf(dev, "could not allocate resources\n");
+ return (ENXIO);
+ }
+
+ /* Setup interrupt handler */
+ err = bus_setup_intr(dev, sc->res[0], INTR_MPSAFE | INTR_TYPE_MISC,
+ pmu_intr, NULL, NULL, &sc->ih);
+ if (err) {
+ device_printf(dev, "Unable to setup interrupt handler.\n");
+ return (ENXIO);
+ }
+
+ return (0);
+}
+
+static device_method_t pmu_methods[] = {
+ DEVMETHOD(device_probe, pmu_probe),
+ DEVMETHOD(device_attach, pmu_attach),
+ { 0, 0 }
+};
+
+static driver_t pmu_driver = {
+ "pmu",
+ pmu_methods,
+ sizeof(struct pmu_softc),
+};
+
+static devclass_t pmu_devclass;
+
+DRIVER_MODULE(pmu, simplebus, pmu_driver, pmu_devclass, 0, 0);
diff --git a/sys/arm/ti/ti_i2c.c b/sys/arm/ti/ti_i2c.c
index 0da338e..ad688f3 100644
--- a/sys/arm/ti/ti_i2c.c
+++ b/sys/arm/ti/ti_i2c.c
@@ -95,6 +95,7 @@ struct ti_i2c_softc
int sc_buffer_pos;
int sc_error;
int sc_fifo_trsh;
+ int sc_timeout;
uint16_t sc_con_reg;
uint16_t sc_rev;
@@ -442,7 +443,7 @@ ti_i2c_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs)
ti_i2c_write_2(sc, I2C_REG_CON, reg);
/* Wait for an event. */
- err = mtx_sleep(sc, &sc->sc_mtx, 0, "i2ciowait", hz);
+ err = mtx_sleep(sc, &sc->sc_mtx, 0, "i2ciowait", sc->sc_timeout);
if (err == 0)
err = sc->sc_error;
@@ -761,12 +762,10 @@ ti_i2c_deactivate(device_t dev)
static int
ti_i2c_sysctl_clk(SYSCTL_HANDLER_ARGS)
{
- device_t dev;
int clk, psc, sclh, scll;
struct ti_i2c_softc *sc;
- dev = (device_t)arg1;
- sc = device_get_softc(dev);
+ sc = arg1;
TI_I2C_LOCK(sc);
/* Get the system prescaler value. */
@@ -783,6 +782,34 @@ ti_i2c_sysctl_clk(SYSCTL_HANDLER_ARGS)
}
static int
+ti_i2c_sysctl_timeout(SYSCTL_HANDLER_ARGS)
+{
+ struct ti_i2c_softc *sc;
+ unsigned int val;
+ int err;
+
+ sc = arg1;
+
+ /*
+ * MTX_DEF lock can't be held while doing uimove in
+ * sysctl_handle_int
+ */
+ TI_I2C_LOCK(sc);
+ val = sc->sc_timeout;
+ TI_I2C_UNLOCK(sc);
+
+ err = sysctl_handle_int(oidp, &val, 0, req);
+ /* Write request? */
+ if ((err == 0) && (req->newptr != NULL)) {
+ TI_I2C_LOCK(sc);
+ sc->sc_timeout = val;
+ TI_I2C_UNLOCK(sc);
+ }
+
+ return (err);
+}
+
+static int
ti_i2c_probe(device_t dev)
{
@@ -858,12 +885,19 @@ ti_i2c_attach(device_t dev)
/* Set the FIFO threshold to 5 for now. */
sc->sc_fifo_trsh = 5;
+ /* Set I2C bus timeout */
+ sc->sc_timeout = 5*hz;
+
ctx = device_get_sysctl_ctx(dev);
tree = SYSCTL_CHILDREN(device_get_sysctl_tree(dev));
SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "i2c_clock",
- CTLFLAG_RD | CTLTYPE_UINT | CTLFLAG_MPSAFE, dev, 0,
+ CTLFLAG_RD | CTLTYPE_UINT | CTLFLAG_MPSAFE, sc, 0,
ti_i2c_sysctl_clk, "IU", "I2C bus clock");
+ SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "i2c_timeout",
+ CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_MPSAFE, sc, 0,
+ ti_i2c_sysctl_timeout, "IU", "I2C bus timeout (in ticks)");
+
/* Activate the interrupt. */
err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE,
NULL, ti_i2c_intr, sc, &sc->sc_irq_h);
diff --git a/sys/boot/fdt/dts/arm/am335x.dtsi b/sys/boot/fdt/dts/arm/am335x.dtsi
index 4f443f0..fea57e9 100644
--- a/sys/boot/fdt/dts/arm/am335x.dtsi
+++ b/sys/boot/fdt/dts/arm/am335x.dtsi
@@ -47,6 +47,11 @@
reg = < 0x48200000 0x1000 >;
};
+ pmu {
+ compatible = "arm,cortex-a8-pmu";
+ interrupts = <3>;
+ };
+
scm@44e10000 {
compatible = "ti,scm";
reg = < 0x44e10000 0x2000 >;
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 2d09d57..a65d2dc 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -1910,18 +1910,18 @@ dadeletemaxsize(struct da_softc *softc, da_delete_methods delete_method)
sectors = (off_t)ATA_DSM_RANGE_MAX * softc->trim_max_ranges;
break;
case DA_DELETE_WS16:
- sectors = (off_t)min(softc->ws_max_blks, WS16_MAX_BLKS);
+ sectors = omin(softc->ws_max_blks, WS16_MAX_BLKS);
break;
case DA_DELETE_ZERO:
case DA_DELETE_WS10:
- sectors = (off_t)min(softc->ws_max_blks, WS10_MAX_BLKS);
+ sectors = omin(softc->ws_max_blks, WS10_MAX_BLKS);
break;
default:
return 0;
}
return (off_t)softc->params.secsize *
- min(sectors, (off_t)softc->params.sectors);
+ omin(sectors, softc->params.sectors);
}
static void
@@ -2684,7 +2684,7 @@ da_delete_trim(struct cam_periph *periph, union ccb *ccb, struct bio *bp)
/* Try to extend the previous range. */
if (lba == lastlba) {
- c = min(count, ATA_DSM_RANGE_MAX - lastcount);
+ c = omin(count, ATA_DSM_RANGE_MAX - lastcount);
lastcount += c;
off = (ranges - 1) * 8;
buf[off + 6] = lastcount & 0xff;
@@ -2694,7 +2694,7 @@ da_delete_trim(struct cam_periph *periph, union ccb *ccb, struct bio *bp)
}
while (count > 0) {
- c = min(count, ATA_DSM_RANGE_MAX);
+ c = omin(count, ATA_DSM_RANGE_MAX);
off = ranges * 8;
buf[off + 0] = lba & 0xff;
@@ -2770,7 +2770,7 @@ da_delete_ws(struct cam_periph *periph, union ccb *ccb, struct bio *bp)
"%s issuing short delete %ld > %ld\n",
da_delete_method_desc[softc->delete_method],
count, ws_max_blks);
- count = min(count, ws_max_blks);
+ count = omin(count, ws_max_blks);
break;
}
bp1 = bioq_first(&softc->delete_queue);
diff --git a/sys/conf/kern.opts.mk b/sys/conf/kern.opts.mk
index 84e4e4f..81d91af 100644
--- a/sys/conf/kern.opts.mk
+++ b/sys/conf/kern.opts.mk
@@ -23,6 +23,8 @@
# src tree.
__DEFAULT_YES_OPTIONS = \
+ AUTOFS \
+ BHYVE \
BLUETOOTH \
CCD \
CDDL \
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
index dbd6334..7f59e84 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -3292,6 +3292,12 @@ cxgbe_uninit_synchronized(struct port_info *pi)
ASSERT_SYNCHRONIZED_OP(sc);
+ if (!(pi->flags & PORT_INIT_DONE)) {
+ KASSERT(!(ifp->if_drv_flags & IFF_DRV_RUNNING),
+ ("uninited port is running"));
+ return (0);
+ }
+
/*
* Disable the VI so that all its data in either direction is discarded
* by the MPS. Leave everything else (the queues, interrupts, and 1Hz
diff --git a/sys/dev/cxgbe/tom/t4_ddp.c b/sys/dev/cxgbe/tom/t4_ddp.c
index e89eb70..6908de9 100644
--- a/sys/dev/cxgbe/tom/t4_ddp.c
+++ b/sys/dev/cxgbe/tom/t4_ddp.c
@@ -852,9 +852,9 @@ handle_ddp(struct socket *so, struct uio *uio, int flags, int error)
SOCKBUF_LOCK_ASSERT(sb);
#if 0
- if (sb->sb_cc + sc->tt.ddp_thres > uio->uio_resid) {
+ if (sbused(sb) + sc->tt.ddp_thres > uio->uio_resid) {
CTR4(KTR_CXGBE, "%s: sb_cc %d, threshold %d, resid %d",
- __func__, sb->sb_cc, sc->tt.ddp_thres, uio->uio_resid);
+ __func__, sbused(sb), sc->tt.ddp_thres, uio->uio_resid);
}
#endif
@@ -1057,9 +1057,9 @@ t4_soreceive_ddp(struct socket *so, struct sockaddr **psa, struct uio *uio,
/* Prevent other readers from entering the socket. */
error = sblock(sb, SBLOCKWAIT(flags));
+ SOCKBUF_LOCK(sb);
if (error)
goto out;
- SOCKBUF_LOCK(sb);
/* Easy one, no space to copyout anything. */
if (uio->uio_resid == 0) {
@@ -1081,8 +1081,8 @@ restart:
/* uio should be just as it was at entry */
KASSERT(oresid == uio->uio_resid,
- ("%s: oresid = %d, uio_resid = %zd, sbused = %d",
- __func__, oresid, uio->uio_resid, sbused(sb)));
+ ("%s: oresid = %d, uio_resid = %zd, sbavail = %d",
+ __func__, oresid, uio->uio_resid, sbavail(sb)));
error = handle_ddp(so, uio, flags, 0);
ddp_handled = 1;
@@ -1092,7 +1092,7 @@ restart:
/* Abort if socket has reported problems. */
if (so->so_error) {
- if (sbused(sb))
+ if (sbavail(sb))
goto deliver;
if (oresid > uio->uio_resid)
goto out;
@@ -1104,32 +1104,32 @@ restart:
/* Door is closed. Deliver what is left, if any. */
if (sb->sb_state & SBS_CANTRCVMORE) {
- if (sbused(sb))
+ if (sbavail(sb))
goto deliver;
else
goto out;
}
/* Socket buffer is empty and we shall not block. */
- if (sbused(sb) == 0 &&
+ if (sbavail(sb) == 0 &&
((so->so_state & SS_NBIO) || (flags & (MSG_DONTWAIT|MSG_NBIO)))) {
error = EAGAIN;
goto out;
}
/* Socket buffer got some data that we shall deliver now. */
- if (sbused(sb) && !(flags & MSG_WAITALL) &&
+ if (sbavail(sb) > 0 && !(flags & MSG_WAITALL) &&
((so->so_state & SS_NBIO) ||
(flags & (MSG_DONTWAIT|MSG_NBIO)) ||
- sbused(sb) >= sb->sb_lowat ||
- sbused(sb) >= uio->uio_resid ||
- sbused(sb) >= sb->sb_hiwat) ) {
+ sbavail(sb) >= sb->sb_lowat ||
+ sbavail(sb) >= uio->uio_resid ||
+ sbavail(sb) >= sb->sb_hiwat) ) {
goto deliver;
}
/* On MSG_WAITALL we must wait until all data or error arrives. */
if ((flags & MSG_WAITALL) &&
- (sbused(sb) >= uio->uio_resid || sbused(sb) >= sb->sb_lowat))
+ (sbavail(sb) >= uio->uio_resid || sbavail(sb) >= sb->sb_lowat))
goto deliver;
/*
@@ -1148,7 +1148,7 @@ restart:
deliver:
SOCKBUF_LOCK_ASSERT(&so->so_rcv);
- KASSERT(sbused(sb) > 0, ("%s: sockbuf empty", __func__));
+ KASSERT(sbavail(sb) > 0, ("%s: sockbuf empty", __func__));
KASSERT(sb->sb_mb != NULL, ("%s: sb_mb == NULL", __func__));
if (sb->sb_flags & SB_DDP_INDICATE && !ddp_handled)
@@ -1159,7 +1159,7 @@ deliver:
uio->uio_td->td_ru.ru_msgrcv++;
/* Fill uio until full or current end of socket buffer is reached. */
- len = min(uio->uio_resid, sbused(sb));
+ len = min(uio->uio_resid, sbavail(sb));
if (mp0 != NULL) {
/* Dequeue as many mbufs as possible. */
if (!(flags & MSG_PEEK) && len >= sb->sb_mb->m_len) {
diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c
index 13822fd..1d5d24f 100644
--- a/sys/kern/kern_timeout.c
+++ b/sys/kern/kern_timeout.c
@@ -1096,6 +1096,10 @@ _callout_stop_safe(struct callout *c, int safe)
struct lock_class *class;
int direct, sq_locked, use_lock;
+ if (safe)
+ WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, c->c_lock,
+ "calling %s", __func__);
+
/*
* Some old subsystems don't hold Giant while running a callout_stop(),
* so just discard this check for the moment.
diff --git a/sys/kern/subr_sglist.c b/sys/kern/subr_sglist.c
index c66973a..df88a26 100644
--- a/sys/kern/subr_sglist.c
+++ b/sys/kern/subr_sglist.c
@@ -216,6 +216,9 @@ void
sglist_free(struct sglist *sg)
{
+ if (sg == NULL)
+ return;
+
if (refcount_release(&sg->sg_refs))
free(sg, M_SGLIST);
}
diff --git a/sys/modules/Makefile b/sys/modules/Makefile
index 5c74856..7498dab 100644
--- a/sys/modules/Makefile
+++ b/sys/modules/Makefile
@@ -47,7 +47,7 @@ SUBDIR= \
ata \
ath \
ath_pci \
- autofs \
+ ${_autofs} \
${_auxio} \
${_bce} \
bfe \
@@ -382,6 +382,10 @@ SUBDIR= \
${_zfs} \
zlib
+.if ${MK_AUTOFS} != "no" || defined(ALL_MODULES)
+_autofs= autofs
+.endif
+
.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
.if exists(${.CURDIR}/../opencrypto)
_crypto= crypto
@@ -620,8 +624,11 @@ _qlxge= qlxge
_qlxgb= qlxgb
_qlxgbe= qlxgbe
_sfxge= sfxge
+
+.if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
_vmm= vmm
.endif
+.endif
.if ${MACHINE_CPUARCH} == "i386"
# XXX some of these can move to the general case when de-i386'ed
diff --git a/sys/modules/iscsi/Makefile b/sys/modules/iscsi/Makefile
index d072cfb..2bff545 100644
--- a/sys/modules/iscsi/Makefile
+++ b/sys/modules/iscsi/Makefile
@@ -4,22 +4,12 @@
KMOD= iscsi
SRCS= iscsi.c
-.if defined(ICL_RDMA)
-SRCS+= icl_rdma.c
-.else
SRCS+= icl.c
-.endif
SRCS+= icl_proxy.c
SRCS+= opt_cam.h
SRCS+= bus_if.h
SRCS+= device_if.h
-# Those below are required for RDMA.
-SRCS+= vnode_if.h
-SRCS+= opt_inet.h
-SRCS+= opt_inet6.h
-
-CFLAGS+= -I${.CURDIR}/../../ofed/include
#CFLAGS+=-DICL_KERNEL_PROXY
.include <bsd.kmod.mk>
OpenPOWER on IntegriCloud