Commit Graph

208857 Commits

Author SHA1 Message Date
Mariusz Zaborski
c501d73c7e 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
2016-02-25 18:23:40 +00:00
John Baldwin
6fb8946b7f 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
2016-02-25 17:43:32 +00:00
Andrew Turner
7ea3f5b654 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
2016-02-25 16:50:36 +00:00
Zbigniew Bodek
af8fe8f169 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
2016-02-25 14:29:57 +00:00
Zbigniew Bodek
3bdcfead19 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
2016-02-25 14:28:10 +00:00
Zbigniew Bodek
3ad422a9d3 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
2016-02-25 14:26:13 +00:00
Zbigniew Bodek
73f8bb5343 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
2016-02-25 14:24:32 +00:00
Zbigniew Bodek
332c869727 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
2016-02-25 14:23:02 +00:00
Zbigniew Bodek
6dc234599f 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
2016-02-25 14:21:04 +00:00
Zbigniew Bodek
44f2eb96bd 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
2016-02-25 14:19:02 +00:00
Zbigniew Bodek
44dd269352 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
2016-02-25 14:17:13 +00:00
Zbigniew Bodek
053f3d0e7e 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
2016-02-25 14:14:46 +00:00
Zbigniew Bodek
856dce91c0 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
2016-02-25 14:12:51 +00:00
Andrew Turner
ccf8caad14 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
2016-02-25 12:17:41 +00:00
Sepherosa Ziehau
f7d33dfef2 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
2016-02-25 09:27:50 +00:00
Kristof Provost
14b5e85b18 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
2016-02-25 07:33:59 +00:00
Sepherosa Ziehau
fd458696b3 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
2016-02-25 07:03:10 +00:00
Justin Hibbits
a4965cf07b Fix the build.
Pointy-hat to:	jhibbits
Spotted by:	bde
2016-02-25 04:32:17 +00:00
Sepherosa Ziehau
ea134429d0 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
2016-02-25 03:21:25 +00:00
Steven Hartland
e283644b87 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
2016-02-25 03:01:24 +00:00
Steven Hartland
5bae00d6b4 Fix NULL pointer dereferences
Fix NULL pointer dereferences identified as V522 by PVS-Studio.

MFC after:	1 week
Sponsored by:	Multiplay
2016-02-25 02:46:47 +00:00
Jared McNeill
6da9071523 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
2016-02-25 01:24:02 +00:00
Navdeep Parhar
e8c6ba7265 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
2016-02-25 01:10:56 +00:00
Jared McNeill
fa104e4174 Add myself as src committer.
Approved by:	gonzo (mentor)
2016-02-25 01:03:34 +00:00
Bryan Drewery
89660f21db Add order for installworld/installkernel.
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-02-24 22:27:25 +00:00
Bryan Drewery
b9c6f31681 Add more STANDALONE_SUBDIR_TARGETS.
Sponsored by:	EMC / Isilon Storage Division
2016-02-24 22:27:22 +00:00
Bryan Drewery
90a2d98448 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
2016-02-24 22:27:18 +00:00
Konstantin Belousov
70209aca16 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
2016-02-24 22:00:35 +00:00
Bryan Drewery
6607cb5de8 Don't hide AR command as bsd.lib.mk's r283925 changed as well.
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-02-24 21:19:44 +00:00
Konstantin Belousov
c83559c31f Fix year.
Noted by:	bdrewery
MFC after:	2 weeks
2016-02-24 20:32:24 +00:00
Bryan Drewery
1fdc8e0e39 PROGS: Only the main process will install INCS.
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-02-24 20:28:48 +00:00
Bryan Drewery
80f9a973ef FAST_DEPEND: Still need to remove DEPENDFILE when rebuilding.
This avoids _EXTRADEPEND adding duplicate entries.

Sponsored by:	EMC / Isilon Storage Division
2016-02-24 20:28:45 +00:00
Konstantin Belousov
4b515c03a6 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
2016-02-24 20:04:41 +00:00
Bryan Drewery
cba0af0aeb Remove hack from r2408 that is no longer needed.
Sponsored by:	EMC / Isilon Storage Division
2016-02-24 20:02:58 +00:00
Bryan Drewery
5977355f52 Regenerate 2016-02-24 19:19:25 +00:00
Bryan Drewery
91e57fa446 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
2016-02-24 19:07:35 +00:00
Bryan Drewery
62d89d81bf 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
2016-02-24 17:20:34 +00:00
Bryan Drewery
a540ec75d7 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
2016-02-24 17:20:31 +00:00
Bryan Drewery
76e72d4ab1 DIRDEPS_BUILD: Allow destroy-(arch|host|stage) from top-level.
Sponsored by:	EMC / Isilon Storage Division
2016-02-24 17:20:28 +00:00
Bryan Drewery
b0db667602 DIRDEPS_BUILD: Allow 'make destroy*' to work from top-level.
Sponsored by:	EMC / Isilon Storage Division
2016-02-24 17:20:25 +00:00
Bryan Drewery
f4d0f67fc9 FAST_DEPEND: Skip 'make depend' for buildworld and kernel since it is auto-ran now.
Sponsored by:	EMC / Isilon Storage Division
2016-02-24 17:20:22 +00:00
Bryan Drewery
bd18fd57db 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
2016-02-24 17:20:11 +00:00
Bryan Drewery
b9cd412e7b 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
2016-02-24 17:19:18 +00:00
Bryan Drewery
70ca9ec4b9 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
2016-02-24 17:19:13 +00:00
Bryan Drewery
68add21344 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
2016-02-24 17:19:09 +00:00
Bryan Drewery
d7beff082b 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
2016-02-24 17:19:05 +00:00
Bryan Drewery
cc66670114 Support beforebuild in the kernel.
Sponsored by:	EMC / Isilon Storage Division
2016-02-24 17:19:02 +00:00
Bryan Drewery
de1a3bd97e 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
2016-02-24 17:18:58 +00:00
Bryan Drewery
3d437ee23f 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
2016-02-24 17:18:55 +00:00
Bryan Drewery
32ffd5bf46 Convert to LIBADD.
Sponsored by:	EMC / Isilon Storage Division
2016-02-24 17:18:52 +00:00