]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoRemove platform_mp_probe as it's almost identical on most ARM SoCs, and
andrew [Fri, 26 Feb 2016 15:54:34 +0000 (15:54 +0000)]
Remove platform_mp_probe as it's almost identical on most ARM SoCs, and
slightly wrong on the others. We should just check if mp_ncpus is set to
more than one CPU as we may wish to run on a single core even when SMP is
available.

Reviewed by: ian
Sponsored by: ABT Systems Ltd
Differential Revision: https://reviews.freebsd.org/D5458

8 years agoCheck that the userboot version is at least 3, rather than
marcel [Fri, 26 Feb 2016 15:52:55 +0000 (15:52 +0000)]
Check that the userboot version is at least 3, rather than
3 exactly. The structure may be of a newer version and as
long as it is backward compatible with 3, we can work with
it.

While here: whitespace nits.

8 years agoInstall elftoolchain elfcopy(1) as objcopy(1) by default
emaste [Fri, 26 Feb 2016 15:46:14 +0000 (15:46 +0000)]
Install elftoolchain elfcopy(1) as objcopy(1) by default

As of r295661 elfcopy supports PE format for EFI boot binaries and is a
viable objcopy implementation for the base system and ports.

The (temporary) src.conf knob WITHOUT_ELFCOPY_AS_OBJCOPY knob may be set
to obtain the GNU version if necessary.

PR: 207091 [exp-run]
Relnotes: Yes
Sponsored by: The FreeBSD Foundation

8 years agorpc: fix failure to clear string by passing the wrong size to memset.
pfg [Fri, 26 Feb 2016 14:39:39 +0000 (14:39 +0000)]
rpc: fix failure to clear string by passing the wrong size to memset.

Noted by NetBSD's PR/21014

Obtained from: NetBSD (CVS Rev. 1.24, 1.25)
MFC after: 1 month

8 years agoo Use uint64_t for page number as it doesn't fit uint32_t.
br [Fri, 26 Feb 2016 14:04:00 +0000 (14:04 +0000)]
o Use uint64_t for page number as it doesn't fit uint32_t.
o Implement growkernel bits for L1 level of pagetables.

This allows us to boot with 128GB of physical memory.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

8 years agoAdd the start of support for the Allwinner A31 clocks. It only adds
andrew [Fri, 26 Feb 2016 13:53:09 +0000 (13:53 +0000)]
Add the start of support for the Allwinner A31 clocks. It only adds
support for the i2c, mmc, and gmac clocks. Further clocks can be added as
needed.

Submitted by: Emmanuel Vadot <manu@bidouilliste.com>
Reviewed by: jmcneill
Differential Revision: https://reviews.freebsd.org/D5339

8 years agoRemove the errno argument from unp_drop().
ed [Fri, 26 Feb 2016 12:46:34 +0000 (12:46 +0000)]
Remove the errno argument from unp_drop().

While there, add a comment to clarify that ECONNRESET should always be
returned for POSIX conformance.

Suggested by: Steven Hartland

8 years agoRestore ThunderX Pass1.1 PCI changes removed by r295962
wma [Fri, 26 Feb 2016 12:16:11 +0000 (12:16 +0000)]
Restore ThunderX Pass1.1 PCI changes removed by r295962

    If Enhanced Allocation is not used, we can't allocate any random
    range. All internal devices have hardcoded place where they can
    be located within PCI address space. Fortunately, we can read
    this value from BAR.

Obtained from:         Semihalf
Sponsored by:          Cavium
Approved by:           cognet (mentor)
Reviewed by:           zbb
Differential revision: https://reviews.freebsd.org/D5455

8 years agoChange format string in pciconf EA to jx
wma [Fri, 26 Feb 2016 10:24:24 +0000 (10:24 +0000)]
Change format string in pciconf EA to jx

    Fix compilation error introduced by r296081

8 years agohyperv/hn: Make transmission path channel aware
sephe [Fri, 26 Feb 2016 09:50:35 +0000 (09:50 +0000)]
hyperv/hn: Make transmission path channel aware

Chimney sending buffer still needs conversion, which will be done
along with the upcoming vRSS support.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5457

8 years agohyperv/hn: Remove the useless num_outstanding_sends
sephe [Fri, 26 Feb 2016 09:45:48 +0000 (09:45 +0000)]
hyperv/hn: Remove the useless num_outstanding_sends

We rely on taskqueue draining now.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5456

8 years agohyperv/hn: Associate TX/RX ring with channel
sephe [Fri, 26 Feb 2016 09:41:00 +0000 (09:41 +0000)]
hyperv/hn: Associate TX/RX ring with channel

This fixes the TX/RX ring selection for TX/RX done.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5454

8 years agohyperv/hn: Pass channel to TX/RX done
sephe [Fri, 26 Feb 2016 09:35:45 +0000 (09:35 +0000)]
hyperv/hn: Pass channel to TX/RX done

This is preamble to associate the TX/RX rings to their channel.

While I'm here, revoke unused netvsc_recv_rollup.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5453

8 years agohyperv/hn: Pass channel as the channel callback argument
sephe [Fri, 26 Feb 2016 09:29:50 +0000 (09:29 +0000)]
hyperv/hn: Pass channel as the channel callback argument

This is the preamble to pass channel back to hn(4) upon TX/RX done.

Reviewed by: Hongjiang Zhang <honzhan microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5452

8 years agohyperv: Always set device for channels
sephe [Fri, 26 Feb 2016 09:23:17 +0000 (09:23 +0000)]
hyperv: Always set device for channels

And unregister hv_device only for primary channels, who own the hv_device.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5451

8 years agohyperv: Remove useless channel inbound_lock
sephe [Fri, 26 Feb 2016 09:17:31 +0000 (09:17 +0000)]
hyperv: Remove useless channel inbound_lock

It serves no purpose.

Reviewed by: Hongjiang Zhang <honzhan microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5450

8 years agoAdd ns16550a compatible string in UART 8250 driver
wma [Fri, 26 Feb 2016 08:43:36 +0000 (08:43 +0000)]
Add ns16550a compatible string in UART 8250 driver

Obtained from:         Semihalf
Submitted by:          Michal Stanek <mst@semihalf.com>
Sponsored by:          Annapurna Labs
Approved by:           cognet (mentor)
Reviewed by:           imp, wma
Differential revision: https://reviews.freebsd.org/D5404

8 years agoAdd support for Enhanced Allocation in pciconf
wma [Fri, 26 Feb 2016 08:35:04 +0000 (08:35 +0000)]
Add support for Enhanced Allocation in pciconf

 * Modified pciconf to print EA capability structure
 * Added register description to pcireg.h

Obtained from:         Semihalf
Sponsored by:          Cavium
Approved by:           cognet (mentor)
Reviewed by:           jhb
Differential revision: https://reviews.freebsd.org/D5440

8 years agoSo far bsd.stand.mk wasn't included in the following files:
sgalabov [Fri, 26 Feb 2016 08:16:44 +0000 (08:16 +0000)]
So far bsd.stand.mk wasn't included in the following files:
sys/boot/fdt/Makefile
sys/boot/uboot/fdt/Makefile
sys/boot/uboot/lib/Makefile

This causes compilation issues on MIPS due to trying to link PIC with non-PIC
code. This revision includes bsd.stand.mk in the above files.

Reviewed by: imp
Approved by: adrian (mentor)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D5311

8 years agoCurrently BERI's loader is including the 32-bit version of the FICL MIPS sysdep.h...
sgalabov [Fri, 26 Feb 2016 08:06:25 +0000 (08:06 +0000)]
Currently BERI's loader is including the 32-bit version of the FICL MIPS sysdep.h (sys/boot/ficl/mips/sysdep.h) instead of the 64-bit version (sys/boot/ficl/mips64/sysdep.h).

Although this may not be an issue in practice, it would be more correct if the 64-bit version was used. Also, using the 64-bit version would make it easier to add support for 64-bit ubldr on MIPS.

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D5310

8 years agoAdd modules support for the bhnd code.
adrian [Fri, 26 Feb 2016 03:34:32 +0000 (03:34 +0000)]
Add modules support for the bhnd code.

Submitted by: Landon Fuller <landonf@landonf.org>
Obtained from: https://github.com/landonf/freebsd/compare/user/landonf/bcm4331-CURRENT

8 years agoBring over the initial rewrite of the broadcom bus support found in their
adrian [Fri, 26 Feb 2016 03:34:08 +0000 (03:34 +0000)]
Bring over the initial rewrite of the broadcom bus support found in their
SoCs and various chips (including, famously, their wifi chips.)

This is "just" (all 20,000 lines of it) code to enumerate the various
versions of busses inside these devices, including the PCI bridge and
the direct SIBA bridge found in MIPS chips.

It also includes shared code for some bus operations (suspend, resume, etc);
EEPROM/SROM/etc parsing and other things that are shared between chips.

Eventually this'll replace the code that bwi/bwn uses for the internal
bus, as well as some apparently upcoming mips74k broadcom SoC support
which uses bwn!

Thanks to Landon Fuller <landonf@landonf.org> for all this work!

Obtained from: https://github.com/landonf/freebsd/compare/user/landonf/bcm4331-CURRENT

8 years agohyperv: Use atomic_fetchadd_int to get GPADL id.
sephe [Fri, 26 Feb 2016 02:26:19 +0000 (02:26 +0000)]
hyperv: Use atomic_fetchadd_int to get GPADL id.

Reviewed by: Hongjiang Zhang <honzhan microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5439

8 years agoLet CLEANDEPENDFILES actually be set before bsd.dep.mk.
bdrewery [Fri, 26 Feb 2016 01:52:33 +0000 (01:52 +0000)]
Let CLEANDEPENDFILES actually be set before bsd.dep.mk.

This fixes 'cleandepend' for kmods after r295983.

Pointyhat to: bdrewery
Sponsored by: EMC / Isilon Storage Division

8 years agoUpgrade the firmware carried in driver and loaded during hardware
davidcs [Thu, 25 Feb 2016 22:44:00 +0000 (22:44 +0000)]
Upgrade the firmware carried in driver and loaded during hardware
initialization (a.k.a STORM firmware) to version 7.13.1 (latest version)

8 years agoFix a mistake that crept in when moving between git and svn, pic_ipi_send
andrew [Thu, 25 Feb 2016 22:13:43 +0000 (22:13 +0000)]
Fix a mistake that crept in when moving between git and svn, pic_ipi_send
should not be called from platform_mp_init_secondary.

Sponsored by: ABT Systems Ltd

8 years agoRemove realall references from initial NetBSD import in r219019.
bdrewery [Thu, 25 Feb 2016 21:05:04 +0000 (21:05 +0000)]
Remove realall references from initial NetBSD import in r219019.

We've never had a realall.

Sponsored by: EMC / Isilon Storage Division

8 years agoSlightly lessen the amount of job target output for SUBDIR_PARALLEL.
bdrewery [Thu, 25 Feb 2016 21:04:52 +0000 (21:04 +0000)]
Slightly lessen the amount of job target output for SUBDIR_PARALLEL.

Sponsored by: EMC / Isilon Storage Division

8 years agoRemove platform_ipi_send, it's an unneeded as all implementations are
andrew [Thu, 25 Feb 2016 20:48:23 +0000 (20:48 +0000)]
Remove platform_ipi_send, it's an unneeded as all implementations are
identical.

Sponsored by:  ABT Systems Ltd

8 years agoAdd Allwinner A20 HDMI support.
jmcneill [Thu, 25 Feb 2016 20:17:18 +0000 (20:17 +0000)]
Add Allwinner A20 HDMI support.

The HDMI driver will attach a framebuffer device when a display is
connected. If the EDID can be read and contains a preferred mode, it
will be used. Otherwise the framebuffer will default to 800x600.

In addition, if the EDID contains a CEA-861 extension block and the
"basic audio" flag is set, audio playback at 48kHz 16-bit stereo is
enabled on the controller.

Reviewed by: andrew
Approved by: gonzo (mentor)
Differential Revision: https://reviews.freebsd.org/D5383

8 years agoLock the NDP default router list and count defrouter references.
markj [Thu, 25 Feb 2016 20:12:05 +0000 (20:12 +0000)]
Lock the NDP default router list and count defrouter references.

This addresses a number of race conditions that can cause crashes as a
result of unsynchronized access to the list.

PR: 206904
Tested by: Larry Rosenman <ler@lerctr.org>,
Kevin Bowling <kevin.bowling@kev009.com>
MFC after: 2 months
Differential Revision: https://reviews.freebsd.org/D5315

8 years agoFix build without FAST_DEPEND and without running 'make depend' after r295985.
bdrewery [Thu, 25 Feb 2016 20:02:42 +0000 (20:02 +0000)]
Fix build without FAST_DEPEND and without running 'make depend' after r295985.

The OBJS_DEPEND_GUESS mechanism required moving the bsd.dep.mk inclusion
to after the checks, but left DEPENDFILE not-yet-set.  Move it to
bsd.own.mk to resolve this.

Pointyhat to: bdrewery
Reported by: antoine (ports failures)
Sponsored by: EMC / Isilon Storage Division

8 years agoImprove error handling for posix_fallocate(2) and posix_fadvise(2).
markj [Thu, 25 Feb 2016 19:58:23 +0000 (19:58 +0000)]
Improve error handling for posix_fallocate(2) and posix_fadvise(2).

- Set td_errno so that ktrace and dtrace can obtain the syscall error
  number in the usual way.
- Pass negative error numbers directly to the syscall layer, as they're
  not intended to be returned to userland.

Reviewed by: kib
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D5425

8 years agoAdd myself as src committer
sgalabov [Thu, 25 Feb 2016 19:29:55 +0000 (19:29 +0000)]
Add myself as src committer

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D5438

M    committers-src.dot

8 years agopass -fPIC to the assembler, not linker
emaste [Thu, 25 Feb 2016 19:26:14 +0000 (19:26 +0000)]
pass -fPIC to the assembler, not linker

-fPIC has no effect on linking although it seems to be ignored by
GNU ld.bfd.  However, it causes ld.lld to terminate with an invalid
argument error.

Reviewed by: dchagin, kib
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5444

8 years agotalk(1): Replace select(2) with poll(2)
pfg [Thu, 25 Feb 2016 19:06:44 +0000 (19:06 +0000)]
talk(1): Replace select(2) with poll(2)

Hinted by: OpenBSD and NetBSD

8 years agoConvert casperd(8) daemon to the libcasper.
oshogbo [Thu, 25 Feb 2016 18:23:40 +0000 (18:23 +0000)]
Convert casperd(8) daemon to the libcasper.
After calling the cap_init(3) function Casper will fork from it's original
process, using pdfork(2). Forking from a process has a lot of advantages:
1. We have the same cwd as the original process.
2. The same uid, gid and groups.
3. The same MAC labels.
4. The same descriptor table.
5. The same routing table.
6. The same umask.
7. The same cpuset(1).
From now services are also in form of libraries.
We also removed libcapsicum at all and converts existing program using Casper
to new architecture.

Discussed with: pjd, jonathan, ed, drysdale@google.com, emaste
Partially reviewed by: drysdale@google.com, bdrewery
Approved by: pjd (mentor)
Differential Revision: https://reviews.freebsd.org/D4277

8 years agoAdd simple support for CloudABI processes to kdump(1).
jhb [Thu, 25 Feb 2016 17:43:32 +0000 (17:43 +0000)]
Add simple support for CloudABI processes to kdump(1).

This does not decode arguments to system calls but should properly
decode system call names and error return values.

Reviewed by: ed
Differential Revision: https://reviews.freebsd.org/D5412

8 years agoAdd support for the Allwinner A31 watchdog to the existing A10 watchdog
andrew [Thu, 25 Feb 2016 16:50:36 +0000 (16:50 +0000)]
Add support for the Allwinner A31 watchdog to the existing A10 watchdog
driver. This mostly involves selecting the register offsets to use at
runtime based on the hardware we are talking to.

Submitted by: Emmanuel Vadot <manu@bidouilliste.com>
Differential Revision: https://reviews.freebsd.org/D5327

8 years agoIntroduce HW TSO support for VNIC
zbb [Thu, 25 Feb 2016 14:29:57 +0000 (14:29 +0000)]
Introduce HW TSO support for VNIC

This feature was added in Pass2.0.
Significantly improves VNIC's TCP performance on Tx.

Reviewed by:   wma
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5424

8 years agoEnable CQ count threshold interrupt on VNIC Pass2.0
zbb [Thu, 25 Feb 2016 14:28:10 +0000 (14:28 +0000)]
Enable CQ count threshold interrupt on VNIC Pass2.0

On Pass2.0 can trigger interrupt on both timer and CQ count.

Reviewed by:   wma
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5423

8 years agoFix VNIC support for Pass2.0 ThunderX chips
zbb [Thu, 25 Feb 2016 14:26:13 +0000 (14:26 +0000)]
Fix VNIC support for Pass2.0 ThunderX chips

- Check chip revision using pass1_silicon() routine.
- Configure CPI correctly for Pass2.0

Reviewed by:   wma
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5422

8 years agoRemove soft reset from the VNIC's PF driver
zbb [Thu, 25 Feb 2016 14:24:32 +0000 (14:24 +0000)]
Remove soft reset from the VNIC's PF driver

This is not needed and causes revid register of the PCI
configuration space to clear on Pass2.0.

Reviewed by:   wma
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5421

8 years agoImprove VNIC performance on Tx path by immediate packet transmission
zbb [Thu, 25 Feb 2016 14:23:02 +0000 (14:23 +0000)]
Improve VNIC performance on Tx path by immediate packet transmission

Don't postpone Tx if the Tx lock can be acquired now.
This gives 3x better performance on egress.

Reviewed by:   wma
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5325

8 years agoClean-up network interface settings for VNIC
zbb [Thu, 25 Feb 2016 14:21:04 +0000 (14:21 +0000)]
Clean-up network interface settings for VNIC

- Remove unrelevant bits
- Remove redundant code
- Reset variables and then set given bits

Reviewed by:   wma
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5324

8 years agoEnable HWSTATS capability for VNIC
zbb [Thu, 25 Feb 2016 14:19:02 +0000 (14:19 +0000)]
Enable HWSTATS capability for VNIC

VNIC manages counters in hardware hence it is desired to have this
option enabled to avoid redundant stats update in ether_input_internal().

Reviewed by:   wma
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5323

8 years agoPrefetch next CQ descriptor in Completion Queue handling loop of VNIC
zbb [Thu, 25 Feb 2016 14:17:13 +0000 (14:17 +0000)]
Prefetch next CQ descriptor in Completion Queue handling loop of VNIC

Reviewed by:   wma
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5322

8 years agoEnable LRO support for VNIC driver
zbb [Thu, 25 Feb 2016 14:14:46 +0000 (14:14 +0000)]
Enable LRO support for VNIC driver

Support for software LRO when enabled in the capabilities

Reviewed by:   wma
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5321

8 years agoAdd support for hardware Tx and Rx checksums to VNIC driver
zbb [Thu, 25 Feb 2016 14:12:51 +0000 (14:12 +0000)]
Add support for hardware Tx and Rx checksums to VNIC driver

- The network controller verifies Rx TCP/UDP/SCTP checksums by default.
  Communicate this to the stack when the packet is not marked as erroneous
  to avoid redundant checksum calculation in kernel.
- It is not uncommon to get the mbuf with m_len that is less than
  the minimal size for the IP, TCP, UDP, etc. when HW checsumming
  is enabled. To avoid data corruption performed by the HW that is
  intended to write IP and TCP/UDP/SCTP checksums to the data segment,
  the mbuf needs to be pulled up by the required number of bytes.
- Make sure that one can modify the mbufs that require checsum calculation
  rather than check for NULL mbuf on each transmission.

Reviewed by:   wma
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5320

8 years agoAdd the Allwinner A31 and A31s padconf support. It's currently unused, but
andrew [Thu, 25 Feb 2016 12:17:41 +0000 (12:17 +0000)]
Add the Allwinner A31 and A31s padconf support. It's currently unused, but
will be needed when we bring in further support for these SoCs.

Submitted by: Emmanuel Vadot <manu@bidouilliste.com>
Differential Revision: https://reviews.freebsd.org/D5340

8 years agohyperv: Wait 5 seconds for hyperv result, instead of 500ms
sephe [Thu, 25 Feb 2016 09:27:50 +0000 (09:27 +0000)]
hyperv: Wait 5 seconds for hyperv result, instead of 500ms

This addresses various devices (network, stoarge) attach failure.

Reported by: Hongxiong Xian <v-hoxian microsoft com>
Tested by: Hongxiong Xian <v-hoxian microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5435

8 years agopf: Fix possible out-of-bounds write
kp [Thu, 25 Feb 2016 07:33:59 +0000 (07:33 +0000)]
pf: Fix possible out-of-bounds write

In the DIOCRSETADDRS ioctl() handler we allocate a table for struct pfr_addrs,
which is processed in pfr_set_addrs(). At the users request we also provide
feedback on the deleted addresses, by storing them after the new list
('bcopy(&ad, addr + size + i, sizeof(ad));' in pfr_set_addrs()).

This means we write outside the bounds of the buffer we've just allocated.
We need to look at pfrio_size2 instead (i.e. the size the user reserved for our
feedback). That'd allow a malicious user to specify a smaller pfrio_size2 than
pfrio_size though, in which case we'd still read outside of the allocated
buffer. Instead we allocate the largest of the two values.

Reported By: Paul J Murphy <paul@inetstat.net>
PR: 207463
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D5426

8 years agohyperv/hn: Hold the TX ring lock then drain TX desc buf_ring
sephe [Thu, 25 Feb 2016 07:03:10 +0000 (07:03 +0000)]
hyperv/hn: Hold the TX ring lock then drain TX desc buf_ring

Reported by: Hongxiong Xian <v-hoxian microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC

8 years agoFix the build.
jhibbits [Thu, 25 Feb 2016 04:32:17 +0000 (04:32 +0000)]
Fix the build.

Pointy-hat to: jhibbits
Spotted by: bde

8 years agohyperv/hn: Implement ifnet.if_transmit method
sephe [Thu, 25 Feb 2016 03:21:25 +0000 (03:21 +0000)]
hyperv/hn: Implement ifnet.if_transmit method

It will be turned on by default later.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5415

8 years agoRemoved unused label and fix mutex_exit order
smh [Thu, 25 Feb 2016 03:01:24 +0000 (03:01 +0000)]
Removed unused label and fix mutex_exit order

Remove unused done label from zfs_setacl fixing PVS-Studio V729.

Fix mutex_exit order to mirror the mutex_enter order.

MFC after: 1 week
Sponsored by: Multiplay

8 years agoFix NULL pointer dereferences
smh [Thu, 25 Feb 2016 02:46:47 +0000 (02:46 +0000)]
Fix NULL pointer dereferences

Fix NULL pointer dereferences identified as V522 by PVS-Studio.

MFC after: 1 week
Sponsored by: Multiplay

8 years agoFix dedicated DMA transfers.
jmcneill [Thu, 25 Feb 2016 01:24:02 +0000 (01:24 +0000)]
Fix dedicated DMA transfers.

For sources and destinations marked "noincr", the previous code was
incorrectly programming the dedicated DMA channel control register
using bit definitions for normal DMA channels. This code path is not
currently used, but will be used by the HDMI audio driver in review.

Reviewed by: andrew
Approved by: gonzo (mentor)
Differential Revision: https://reviews.freebsd.org/D5382

8 years agocxgbe(4): Add a sysctl to retrieve the maximum speed/bandwidth supported by a
np [Thu, 25 Feb 2016 01:10:56 +0000 (01:10 +0000)]
cxgbe(4): Add a sysctl to retrieve the maximum speed/bandwidth supported by a
port.

dev.cxgbe.<n>.max_speed
dev.cxl.<n>.max_speed

Sponsored by: Chelsio Communications

8 years agoAdd myself as src committer.
jmcneill [Thu, 25 Feb 2016 01:03:34 +0000 (01:03 +0000)]
Add myself as src committer.

Approved by: gonzo (mentor)

8 years agoAdd order for installworld/installkernel.
bdrewery [Wed, 24 Feb 2016 22:27:25 +0000 (22:27 +0000)]
Add order for installworld/installkernel.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd more STANDALONE_SUBDIR_TARGETS.
bdrewery [Wed, 24 Feb 2016 22:27:22 +0000 (22:27 +0000)]
Add more STANDALONE_SUBDIR_TARGETS.

Sponsored by: EMC / Isilon Storage Division

8 years agoOBJS and POBJS have not been used since r215127.
bdrewery [Wed, 24 Feb 2016 22:27:18 +0000 (22:27 +0000)]
OBJS and POBJS have not been used since r215127.

r215127 disabled building of libgcc.a.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoIn bpf_getdltlist(), do not call copyout(9) while holding bpf lock.
kib [Wed, 24 Feb 2016 22:00:35 +0000 (22:00 +0000)]
In bpf_getdltlist(), do not call copyout(9) while holding bpf lock.
Copy the data into temprorary malloced buffer and drop the lock for
copyout.

Reported, reviewed and tested by: cem
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoDon't hide AR command as bsd.lib.mk's r283925 changed as well.
bdrewery [Wed, 24 Feb 2016 21:19:44 +0000 (21:19 +0000)]
Don't hide AR command as bsd.lib.mk's r283925 changed as well.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoFix year.
kib [Wed, 24 Feb 2016 20:32:24 +0000 (20:32 +0000)]
Fix year.

Noted by: bdrewery
MFC after: 2 weeks

8 years agoPROGS: Only the main process will install INCS.
bdrewery [Wed, 24 Feb 2016 20:28:48 +0000 (20:28 +0000)]
PROGS: Only the main process will install INCS.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoFAST_DEPEND: Still need to remove DEPENDFILE when rebuilding.
bdrewery [Wed, 24 Feb 2016 20:28:45 +0000 (20:28 +0000)]
FAST_DEPEND: Still need to remove DEPENDFILE when rebuilding.

This avoids _EXTRADEPEND adding duplicate entries.

Sponsored by: EMC / Isilon Storage Division

8 years agoRemove references to Giant in the description of vrele(9). Add notes
kib [Wed, 24 Feb 2016 20:04:41 +0000 (20:04 +0000)]
Remove references to Giant in the description of vrele(9).  Add notes
about vnode lock and sleeping.

Reported by: julian
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoRemove hack from r2408 that is no longer needed.
bdrewery [Wed, 24 Feb 2016 20:02:58 +0000 (20:02 +0000)]
Remove hack from r2408 that is no longer needed.

Sponsored by: EMC / Isilon Storage Division

8 years agoRegenerate
bdrewery [Wed, 24 Feb 2016 19:19:25 +0000 (19:19 +0000)]
Regenerate

8 years agoBDECFLAGS has not been available since r82604 removed /etc/defaults/make.conf.
bdrewery [Wed, 24 Feb 2016 19:07:35 +0000 (19:07 +0000)]
BDECFLAGS has not been available since r82604 removed /etc/defaults/make.conf.

WARNS=6 has provided BDECFLAGS since r94332 as well.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoPROGS: Remove the 'build one' optimization since it breaks 'build multiple'
bdrewery [Wed, 24 Feb 2016 17:20:34 +0000 (17:20 +0000)]
PROGS: Remove the 'build one' optimization since it breaks 'build multiple'

Given PROG1 PROG2, 'make PROG1' would work but 'make PROG1 PROG2' would not.
Just build them as normal in a sub-make to avoid any issues.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoShow full DIRPRFX in subdir parallel target name.
bdrewery [Wed, 24 Feb 2016 17:20:31 +0000 (17:20 +0000)]
Show full DIRPRFX in subdir parallel target name.

For example when building, from buildworld, lib/atf/libatf-c++/tests/detail:
    --- all_subdir_atf ---
is now:
    --- all_subdir_lib/atf/libatf-c++/tests/detail ---

Sponsored by: EMC / Isilon Storage Division

8 years agoDIRDEPS_BUILD: Allow destroy-(arch|host|stage) from top-level.
bdrewery [Wed, 24 Feb 2016 17:20:28 +0000 (17:20 +0000)]
DIRDEPS_BUILD: Allow destroy-(arch|host|stage) from top-level.

Sponsored by: EMC / Isilon Storage Division

8 years agoDIRDEPS_BUILD: Allow 'make destroy*' to work from top-level.
bdrewery [Wed, 24 Feb 2016 17:20:25 +0000 (17:20 +0000)]
DIRDEPS_BUILD: Allow 'make destroy*' to work from top-level.

Sponsored by: EMC / Isilon Storage Division

8 years agoFAST_DEPEND: Skip 'make depend' for buildworld and kernel since it is auto-ran now.
bdrewery [Wed, 24 Feb 2016 17:20:22 +0000 (17:20 +0000)]
FAST_DEPEND: Skip 'make depend' for buildworld and kernel since it is auto-ran now.

Sponsored by: EMC / Isilon Storage Division

8 years agoDIRDEPS_BUILD: Regenerate without local dependencies.
bdrewery [Wed, 24 Feb 2016 17:20:11 +0000 (17:20 +0000)]
DIRDEPS_BUILD: Regenerate without local dependencies.

These are no longer needed after the recent 'beforebuild: depend' changes
and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports
skipping 'make depend'.

Sponsored by: EMC / Isilon Storage Division

8 years agoFAST_DEPEND: Always run depend via beforebuild which removes many hacks.
bdrewery [Wed, 24 Feb 2016 17:19:18 +0000 (17:19 +0000)]
FAST_DEPEND: Always run depend via beforebuild which removes many hacks.

This will generate dependencies rather than depending on the previous behavior
of depending on the guessed OBJS: *.h dependecies or a user running
'make depend'.

Experimentation showed that depending only on headers was not enough and
prone to .ORDER errors.  Downstream users may also have added
dependencies into beforedepend or afterdepend targets.  The safest way to
ensure dependencies are generated before build is to run 'make depend'
beforehand rather than just depending on DPSRCS+SRCS.

Note that the OBJS_DEPEND_GUESS mechanism (a.k.a .if !exists(.depend) then
foo.o: *.h) is still useful as it improves incremental builds with missing
.depend.* files and allows 'make foo.o' to usually work, while this
'beforebuild: depend' ensures that the build will always find all dependencies.
The 'make foo.o' case has no means of a 'beforebuild' hook.

This also removes several hacks in the DIRDEPS_BUILD:
- NO_INSTALL_INCLUDES is no longer needed as it mostly was to work around
  .ORDER problems with building the needed headers early.
- DIRDEPS_BUILD: It is no longer necesarry to track "local dependencies" in
  Makefile.depend.

  These were only in Makefile.depend for 'clean builds' since nothing would
  generate the files due to skipping 'make depend' and early dependency
  bugs that have been fixed, such as adding headers into SRCS for the
  OBJS_DEPEND_GUESS mechanism.  Normally if a .depend file does not exist then
  a dependency is added by bsd.lib.mk/bsd.prog.mk from OBJS: *.h.  However,
  meta.autodep.mk creates a .depend file from created meta files and inserts
  that into Makefile.depend.  It also only tracks *.[ch] files though which can
  miss some dependencies that are hooked into 'make depend'.  This .depend
  that is created then breaks incremental builds due to the !exists(.depend)
  checks for OBJS_DEPEND_GUESS.  The goal was to skip 'make depend' yet it only
  really works the first time.  After that files are not generated as expected,
  which r288966 tried to address but was using buildfiles: rather than
  beforebuild: and was reverted in r291725.  As noted previously,
  depending only on headers in beforebuild: would create .ORDER errors
  in some cases.

  meta.autodep.mk is still used to generate Makefile.depend though via:
    gendirdeps: Makefile.depend
    .END: gendirdeps

  This commit allows removing all of the "local dependencies" in
  Makefile.depend which cuts down on churn and removes some of the
  arch-dependent Makefile.depend files.

  The "local dependencies" were also problematic for bootstrapping.

Sponsored by: EMC / Isilon Storage Division

8 years agoHook the meta/nofilemon build into using FAST_DEPEND.
bdrewery [Wed, 24 Feb 2016 17:19:13 +0000 (17:19 +0000)]
Hook the meta/nofilemon build into using FAST_DEPEND.

FAST_DEPEND is intended to be the "skip 'make depend' and mkdep"
feature.  Since DIRDEPS_BUILD does this already with some of its own
hacks, and filemon doesn't need this, and nofilemon does, teach it how
to handle each of these cases.

In meta+filemon mode filemon will handle dependencies itself via the
meta mode logic in bmake.  We still want to set MK_FAST_DEPEND=yes to
enable some logic that indicates that 'make depend' is skipped in the
traditional sense.  The actual .depend.* files will be skipped.

When nofilemon is set though we still need to track and generate dependencies.

Sponsored by: EMC / Isilon Storage Division

8 years agoFAST_DEPEND: Don't waste time generating an empty .depend file.
bdrewery [Wed, 24 Feb 2016 17:19:09 +0000 (17:19 +0000)]
FAST_DEPEND: Don't waste time generating an empty .depend file.

The .depend file will still be generated if _EXTRADEPEND is used.  The target
is kept with a dependency on DPSRCS though so that 'make depend' will generate
all files.

Sponsored by: EMC / Isilon Storage Division

8 years agoFAST_DEPEND: Rework how guessed dependencies are handled.
bdrewery [Wed, 24 Feb 2016 17:19:05 +0000 (17:19 +0000)]
FAST_DEPEND: Rework how guessed dependencies are handled.

Rather than depend on .depend not existing, check the actual
.depend.OBJ file that will be used for that object.  If it doesn't
exist then use the guessed dependencies.

FAST_DEPEND may never have a .depend file.  Not having one means all of the
previous logic would over-depend all object files on all headers which is not
what we wanted.  It also means that if a .depend is generated before a build
is done for _EXTRADEPEND (such as for PROG or LIB) then all of these
dependencies would not be used since the .depend wasn't generated from mkdep
and the real .depend.* files are not generated until the build.

Sponsored by: EMC / Isilon Storage Division

8 years agoSupport beforebuild in the kernel.
bdrewery [Wed, 24 Feb 2016 17:19:02 +0000 (17:19 +0000)]
Support beforebuild in the kernel.

Sponsored by: EMC / Isilon Storage Division

8 years agoRemove ilinks in cleandepend directly via CLEANDEPENDFILES.
bdrewery [Wed, 24 Feb 2016 17:18:58 +0000 (17:18 +0000)]
Remove ilinks in cleandepend directly via CLEANDEPENDFILES.

The 'cleanilinks' target is kept since it may still be useful as added in
r200178, though never documented.

Sponsored by: EMC / Isilon Storage Division

8 years agoFollow-up r295667 with fixes for SRCS defined.
bdrewery [Wed, 24 Feb 2016 17:18:55 +0000 (17:18 +0000)]
Follow-up r295667 with fixes for SRCS defined.

cleandepend should always remove CLEANDEPEND* if they are not empty,
but bsd.dep.mk should not add the tags entries unless SRCS is defined
as it did before.  The .depend file itself it still always removed
to avoid accidentally keeping a stale one around as done in r295666.

Sponsored by: EMC / Isilon Storage Division

8 years agoConvert to LIBADD.
bdrewery [Wed, 24 Feb 2016 17:18:52 +0000 (17:18 +0000)]
Convert to LIBADD.

Sponsored by: EMC / Isilon Storage Division

8 years agoSupport a WANT_MAKE_VERSION.
bdrewery [Wed, 24 Feb 2016 17:18:49 +0000 (17:18 +0000)]
Support a WANT_MAKE_VERSION.

This will be used soon for .dinclude support in FAST_DEPEND.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoDIRDEPS_BUILD: Add some missing build dependencies for kerberos5.
bdrewery [Wed, 24 Feb 2016 17:18:43 +0000 (17:18 +0000)]
DIRDEPS_BUILD: Add some missing build dependencies for kerberos5.

Sponsored by: EMC / Isilon Storage Division

8 years agoDIRDEPS_BUILD: Update dependencies.
bdrewery [Wed, 24 Feb 2016 17:18:35 +0000 (17:18 +0000)]
DIRDEPS_BUILD: Update dependencies.

Sponsored by: EMC / Isilon Storage Division

8 years agoProperly fix these builds by adding NO_WMISSING_VARIABLE_DECLARATIONS from r249657.
bdrewery [Wed, 24 Feb 2016 17:18:31 +0000 (17:18 +0000)]
Properly fix these builds by adding NO_WMISSING_VARIABLE_DECLARATIONS from r249657.

This reverts r284374.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoPROGS: Only recurse on called targets like done for SUBDIR in r291635.
bdrewery [Wed, 24 Feb 2016 17:18:28 +0000 (17:18 +0000)]
PROGS: Only recurse on called targets like done for SUBDIR in r291635.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agodb(3): Fix aliasing warnings from modern GCC.
pfg [Wed, 24 Feb 2016 17:14:11 +0000 (17:14 +0000)]
db(3): Fix aliasing warnings from modern GCC.

While here also drop a malloc cast.

Obtained from: NetBSD (CVS Rev. 1.18 - 1.20)

8 years agoMake asynchronous connection failures on UNIX sockets fail with ECONNRESET.
ed [Wed, 24 Feb 2016 17:10:32 +0000 (17:10 +0000)]
Make asynchronous connection failures on UNIX sockets fail with ECONNRESET.

While making CloudABI work well on Linux, I discovered that I had a
FreeBSD-ism in one of my unit tests. The test did the following:

- Create UNIX socket 1, bind it, make it listen.
- Create UNIX socket 2, connect it to UNIX socket 1.
- Close UNIX socket 1.
- Obtain SO_ERROR from socket 2.

On FreeBSD this returns ECONNABORTED, while on Linux it returns
ECONNRESET. I dug through some of the relevant specifications[1] and it
looks like Linux is all right here. ECONNABORTED should only be returned
when the local connection (socket 2) is aborted; not the peer (socket 1).

It is of course slightly misleading: the function in which we set this
error is called uipc_abort(), but keep in mind that we're aborting the
peer, thus resetting the local socket.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/connect.html

Reviewed by: cem
Sponsored by: Nuxi, the Netherlands
Differential Revision: https://reviews.freebsd.org/D5419

8 years agodb(3): Fix aliasing warnings from modern GCC.
pfg [Wed, 24 Feb 2016 16:52:03 +0000 (16:52 +0000)]
db(3): Fix aliasing warnings from modern GCC.

Obtained from: NetBSD (CVS Rev. 1.20)

8 years agoAdd support for symmetric multiprocessing (SMP).
br [Wed, 24 Feb 2016 16:50:34 +0000 (16:50 +0000)]
Add support for symmetric multiprocessing (SMP).

Tested on Spike simulator with 2 and 16 cores (tlb enabled),
so set MAXCPU to 16 at this time.

This uses FDT data to get information about CPUs
(code based on arm64 mp_machdep).

Invalidate entire TLB cache as it is the only way yet.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

8 years agoProvide more correct sizing of the KVA consumed by a vnode, used by
kib [Wed, 24 Feb 2016 15:15:46 +0000 (15:15 +0000)]
Provide more correct sizing of the KVA consumed by a vnode, used by
the virtvnodes calculation.  Include the size of fs-specific v_data as
the nfs nclnode inline, the NFS nclnode is bigger than either ZFS
znode or UFS inode.  Include the size of namecache_ts and short cache
path element, multiplied by the name cache population factor, again
inline.

Inline defines are used to avoid pollution of the vnode.h with the
subsystem-private objects.  Non-significant unsynchronized changes of
the definitions are fine, we do not care about that precision, and
e.g. ZFS consumes much malloced memory per vnode for reasons
unaccounted in the formula.

Lower the partition of kmem dedicated to vnodes, from 1/7 to 1/10.

The measures reduce vnode cache pressure on kmem and bring the vnode
cache memory use below some apparent thresholds that were exceeded by
r291244 due to more robust vnode reuse.

Reported and tested by: marius (i386, previous version)
Reviewed by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoFix bug in filling and handling ipfw's O_DSCP opcode.
ae [Wed, 24 Feb 2016 13:16:03 +0000 (13:16 +0000)]
Fix bug in filling and handling ipfw's O_DSCP opcode.
Due to integer overflow CS4 token was handled as BE.

PR: 207459
MFC after: 1 week

8 years agoFix useless check. m_pkthdr.len should be equal to orglen.
ae [Wed, 24 Feb 2016 12:28:49 +0000 (12:28 +0000)]
Fix useless check. m_pkthdr.len should be equal to orglen.

MFC after: 2 weeks

8 years agoReturn dst as the result from memcpy(9) on amd64.
kib [Wed, 24 Feb 2016 11:58:15 +0000 (11:58 +0000)]
Return dst as the result from memcpy(9) on amd64.

PR: 207422
MFC after: 1 week

8 years agoCall cap_rights_init() properly.
ed [Wed, 24 Feb 2016 10:54:26 +0000 (10:54 +0000)]
Call cap_rights_init() properly.

Even though or'ing the individual rights works in this specific case, it
may not work in general. Pass them in as varargs.