manu [Sat, 21 Oct 2017 15:47:40 +0000 (15:47 +0000)]
dts: Update our device tree sources file fomr Linux 4.13
manu [Sat, 21 Oct 2017 15:18:20 +0000 (15:18 +0000)]
dts: Update the Device Tree Sources to Linux 4.13
mmel [Sat, 21 Oct 2017 12:16:21 +0000 (12:16 +0000)]
Fullify implementation of AT_HWCAP and AT_HWCAP2 for ARMv6,7.
This makes elf_aux_info(3) useable for ARM ports.
MFC after: 1 month
mmel [Sat, 21 Oct 2017 12:15:12 +0000 (12:15 +0000)]
Add C++ decoration to auxv.v forgotten in r324815.
MFC after: 1 month
mmel [Sat, 21 Oct 2017 12:06:18 +0000 (12:06 +0000)]
Make elf_aux_info() as public libc function.
- Teach elf aux vector functions about newly added AT_HWCAP and AT_HWCAP2
vectors.
- Export _elf_aux_info() as new public libc function elf_aux_info(3)
The elf_aux_info(3) should be considered as FreeBSD counterpart of glibc
getauxval() with more robust interface.
Note:
We cannot name this new function as getauxval(), with glibc compatible
interface. Some ports autodetect its existence and then expects that all
Linux specific AT_<*> vectors are defined and implemented.
MFC after: 1 month
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D12743
mmel [Sat, 21 Oct 2017 12:05:01 +0000 (12:05 +0000)]
Add AT_HWCAP2 ELF auxiliary vector.
- allocate value for new AT_HWCAP2 auxiliary vector on all platforms.
- expand 'struct sysentvec' by new 'u_long *sv_hwcap2', in exactly
same way as for AT_HWCAP.
MFC after: 1 month
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D12699
rlibby [Sat, 21 Oct 2017 07:23:45 +0000 (07:23 +0000)]
pms/freebsd: fix compiler warnings
- A number of unused variable warnings,
- a missing prototype warning (actually a dead function),
- and a potential use of an uninitialized variable.
Reviewed by: pfg
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12683
bz [Fri, 20 Oct 2017 21:40:59 +0000 (21:40 +0000)]
With r181803 on 2008-08-17 23:27:27Z the first VIMAGE commit went into
HEAD. Enable VIMAGE in GENERIC kernels and some others (where GENERIC does
not exist) on HEAD.
Disable building LINT-VIMAGE with VIMAGE being default.
This should give it a lot more exposure in the run-up to 12 to help
us evaluate whether to keep it on by default or not.
We are also hoping to get better performance testing.
The feature can be disabled using nooptions.
Requested by: many
Reviewed by: kristof, emaste, hiren
X-MFC after: never
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D12639
markj [Fri, 20 Oct 2017 21:13:19 +0000 (21:13 +0000)]
Free the right address range if kmem_back() fails in memguard_alloc().
MFC after: 1 week
Sponsored by: Dell EMC Isilon
mjg [Fri, 20 Oct 2017 18:58:11 +0000 (18:58 +0000)]
amd64: plug missed dt_lock in cpu_fork
kib [Fri, 20 Oct 2017 18:40:29 +0000 (18:40 +0000)]
Take the vm object lock in read mode in vnode_generic_putpages().
Only upgrade it to write mode if we need to clear dirty bits of the
partially valid page after EOF.
Suggested and reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks
asomers [Fri, 20 Oct 2017 15:29:28 +0000 (15:29 +0000)]
Use the .Fx macro consistently.
Sponsored by: Spectra Logic Corp
asomers [Fri, 20 Oct 2017 15:24:28 +0000 (15:24 +0000)]
Fix the mps(4) HISTORY section.
Looks like a copy/paste error from r302673.
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
markj [Fri, 20 Oct 2017 14:56:13 +0000 (14:56 +0000)]
Avoid the nbp lookup in the final loop iteration in flushbuflist().
The end of the loop must re-lookup the next buf since the bufobj lock
is dropped in the loop body. If the lookup fails, the loop is restarted.
This mechanism non-obviously also terminates the loop when the end of
the buf list is reached. Split up the two loops termination cases to
make the code a bit less fragile. No functional change intended.
Reviewed by: kib
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12730
mjg [Fri, 20 Oct 2017 14:04:01 +0000 (14:04 +0000)]
mtx: fix up UP build after r324778
Reported by: Michael Butler
kib [Fri, 20 Oct 2017 09:10:49 +0000 (09:10 +0000)]
Move swapout code into vm/vm_swapout.c.
There is no NO_SWAPPING #ifdef left in the code.
Requested by: alc
Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks
Differential revision: https://reviews.freebsd.org/D12663
kib [Fri, 20 Oct 2017 08:32:37 +0000 (08:32 +0000)]
Do not overwrite clean blocks on pageout.
If filesystem block size is less than the page size, it is possible
that the page-out run contains partially clean pages. E.g., the chunk
of the page might be bdwrite()-ed, or some thread performed bwrite()
on a buffer which references a chunk of the paged out page. As
result, the assertion added in r319975, which checked that all pages
in the run are dirty, does not hold on such filesystems.
One solution is to remove the assert, but it is undesirable, because
we do overwrite the valid on-disk content. I cannot provide a scenario
where such write would corrupt the file data, but I do not like it on
principle. Another, in my opinion proper, solution is to only write
parts of the pages still marked dirty. The patch implements this, it
skips clean blocks and only writes the dirty block runs.
Note that due to clustering, write one page might clean other pages in
the run, so the next write range must be calculated only after the
current range is written out.
More, due to a possible invalidation, and the fact that the object
lock is dropped and reacquired before the checks, it is possible that
the whole page-out pages run appears to consist of only clean pages.
For this reason, it is impossible to assert that there is some work
for the pageout method to do (i.e. assert that there is at least one
dirty page in the run). But such clearing can only occur due to
invalidation, and not due to a parallel write, because we own the
vnode lock exclusive.
Reported by: fsu
In collaboration with: pho
Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks
Differential revision: https://reviews.freebsd.org/D12668
kib [Fri, 20 Oct 2017 08:25:49 +0000 (08:25 +0000)]
In vm_page_free_phys_pglist(), do not take vm_page_queue_free_mtx if
there is nothing to do.
Suggested by: mjg
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
hselasky [Fri, 20 Oct 2017 08:20:15 +0000 (08:20 +0000)]
The remote DMA TCP portspace selector, RDMA_PS_TCP, is used for both
iWarp and RoCE in ibcore. The selection of RDMA_PS_TCP can not be used
to indicate iWarp protocol use. Backport the proper IB device
capabilities from Linux upstream to distinguish between iWarp and
RoCE. Only allocate the additional socket required for iWarp for RDMA
IDs when at least one iWarp device present. This resolves
interopability issues between iWarp and RoCE in ibcore
Reviewed by: np @
Differential Revision: https://reviews.freebsd.org/D12563
Sponsored by: Mellanox Technologies
MFC after: 3 days
mjg [Fri, 20 Oct 2017 04:02:53 +0000 (04:02 +0000)]
Mark kdb_active as __read_frequently and switch to bool to eat less space.
mjg [Fri, 20 Oct 2017 03:38:58 +0000 (03:38 +0000)]
amd64: __exclusive_cache_line pv_chunks_mutex and pv_list_locks
Note that pv_list_locks is an array and currently it fits 2 locks per line.
Resizing it and/or putting more locks in different lines requires several tests.
MFC after: 1 week
mjg [Fri, 20 Oct 2017 03:32:42 +0000 (03:32 +0000)]
rwlock: reduce lockstat branches in the slowpath
MFC after: 1 week
jhibbits [Fri, 20 Oct 2017 03:31:23 +0000 (03:31 +0000)]
Expand the TLB nest level mask to 3 bits to match the 32-bit mask
This really doesn't change anything right now, because BOOKE_TLB_MAXNEST is only
3, which fits into the 2 bits currently used.
mjg [Fri, 20 Oct 2017 03:30:02 +0000 (03:30 +0000)]
amd64: avoid acquiring dt lock if possible (which is the common case)
Discussed with: kib
MFC after: 1 week
jhibbits [Fri, 20 Oct 2017 03:13:31 +0000 (03:13 +0000)]
No need to check for AIM here
This block is already in a #ifdef AIM block.
jhibbits [Fri, 20 Oct 2017 03:03:04 +0000 (03:03 +0000)]
Book-E debug trace fixes
* Book-E can have Altivec exceptions, so move it out of the AIM-only block.
* Print the right DSI trap mode (read vs write) for Book-E
While here, fix some whitespace found while reviewing other diffs.
mjg [Fri, 20 Oct 2017 00:34:25 +0000 (00:34 +0000)]
mtx: stop testing SCHEDULER_STOPPED in kabi funcs for spin mutexes
There is nothing panic-breaking to do in the unlock case and the lock
case will fallback to the slow path doing the check already.
MFC after: 1 week
mjg [Fri, 20 Oct 2017 00:30:35 +0000 (00:30 +0000)]
mtx: clean up locking spin mutexes
1) shorten the fast path by pushing the lockstat probe to the slow path
2) test for kernel panic only after it turns out we will have to spin,
in particular test only after we know we are not recursing
MFC after: 1 week
marius [Thu, 19 Oct 2017 21:57:14 +0000 (21:57 +0000)]
Correct an inverted conditional for determining the multiplier of
the user data area size.
manu [Thu, 19 Oct 2017 21:34:53 +0000 (21:34 +0000)]
Allwinner: Fix compilation
Forgot an #endif in r324773, sorry for the breakage.
wulf [Thu, 19 Oct 2017 21:07:28 +0000 (21:07 +0000)]
psm(4): Add sanity checks to Synaptics touchpad driver resolution parser.
This fixes "Kernel has only x or y resolution, not both" libinput error.
Reported by: Ivan <bsd@abinet.ru>
Tested by: Ivan <bsd@abinet.ru>
Approved by: gonzo (mentor)
MFC after: 2 weeks
manu [Thu, 19 Oct 2017 20:56:30 +0000 (20:56 +0000)]
Allwinner: Add EARLY_PRINTF function
EARLY_PRINTF can help debugging early problems.
Add it for Allwinner SoCs.
Tested On: OrangePi One (H3)
wulf [Thu, 19 Oct 2017 20:54:55 +0000 (20:54 +0000)]
ums(4): Unreverse evdev Tilt-axis reporting to match Linux.
sysmouse tilt to button mapping remained unchanged.
Reviewed by: hselasky
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12671
manu [Thu, 19 Oct 2017 20:52:17 +0000 (20:52 +0000)]
tegra: Do not define early printf function
Since tegra is now in GENERIC, do not enable the early printf
function as it can conflict with others.
wulf [Thu, 19 Oct 2017 20:42:46 +0000 (20:42 +0000)]
bthidd: Fix leds on multireport keyboards broken after r297217
Reviewed by: emax, gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12214
glebius [Thu, 19 Oct 2017 18:04:16 +0000 (18:04 +0000)]
Hide struct sockbuf from userland.
PR: 222917 (exp-run)
fsu [Thu, 19 Oct 2017 16:42:03 +0000 (16:42 +0000)]
Fix unused variable + style(9) fixes inside the ext4_ext_find_extent()
Approved by: pfg (mentor)
Reported by: Coverity
CID: 1381754
MFC after: 6 months
emaste [Thu, 19 Oct 2017 16:40:17 +0000 (16:40 +0000)]
psci: change bootverbose string to 'PSCI 0.2 compatible'
Prior to r324754 we treated PSCI 0.2 and 1.0 as identical, and r324754
extended that to include all PSCI 1.x revisions. Change the string
emitted under bootverbose to reference '0.2 compatible' to avoid
confusion when the system includes a later PSCI rev.
Discussed with: andrew
Sponsored by: The FreeBSD Foundation
avg [Thu, 19 Oct 2017 16:36:07 +0000 (16:36 +0000)]
remove spa_sync_on assert from spa_async_thread_vd
Unlike spa_async_thread that can get started only from spa_sync()
spa_async_thread_vd can get started from other contexts.
Additionally, spa_async_thread_vd does not really depend on
spa sync being enabled.
The incorrect assert could be triggered by importing a pool in the
read-only mode and then disconnecting one of its disks.
In this case spa_sync_on was false because the pool was read-only
and spa_async_thread_vd was started to handle SPA_ASYNC_REMOVE event.
Note: spa_async_thread_vd() currently exists only in FreeBSD, it was
split out of spa_async_thread() in r253990.
Discussed with: mav
MFC after: 2 weeks
andrew [Thu, 19 Oct 2017 13:22:52 +0000 (13:22 +0000)]
Allow later PSCI revisions to also work. The latest ARM Trusted Firmware
reports version 1.1 so the check was failing. As thjis is a minor change
from 1.0, and future 1.x revisions are also expected to be backwards
compatible just ignore the minor revision in the init handler.
Sponsored by: DARPA, AFRL
emaste [Thu, 19 Oct 2017 12:55:11 +0000 (12:55 +0000)]
msdosfs: fix build with MSDOSFS_DEBUG
Inspired by a patch submission by longwitz@incore.de with many changes
for ino64 in HEAD.
PR: 199152
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
mav [Thu, 19 Oct 2017 09:01:15 +0000 (09:01 +0000)]
Relax per-ifnet cif_vrs list double locking in carp(4).
In all cases where cif_vrs list is modified, two locks are held: per-ifnet
CIF_LOCK and global carp_sx. It means to read that list only one of them
is enough to be held, so we can skip CIF_LOCK when we already have carp_sx.
This fixes kernel panic, caused by attempts of copyout() to sleep while
holding non-sleepable CIF_LOCK mutex.
Discussed with: glebius
MFC after: 2 weeks
Sponsored by: iXsystems, Inc.
alc [Thu, 19 Oct 2017 04:13:47 +0000 (04:13 +0000)]
Batch atomic updates to the number of active, inactive, and laundry
pages by vm_object_terminate_pages(). For example, for a "buildworld"
workload, this batching reduces vm_object_terminate_pages()'s average
execution time by 12%. (The total savings were about 11.7 billion
processor cycles.)
Reviewed by: kib
MFC after: 1 week
jhibbits [Thu, 19 Oct 2017 03:38:53 +0000 (03:38 +0000)]
Add some more devices to the MPC85XX-based configs
These devices bring the configs closer to a desktop-like (GENERIC) kernel
config.
* The Freescale DIU support was added to the config in r306358.
Without keyboard support video support is nearly pointless, so add ukbd and
ums.
* The AmigaOne X5000, and P1022 devboard, both use a variant of the ds1307 RTC
* cpufreq scaling is currently supported by the p1022. More SoCs will be added
eventually.
cy [Thu, 19 Oct 2017 03:17:50 +0000 (03:17 +0000)]
Anticongestion refinements for ntpd rc script. This reverts r324681
and checks if ntp leapfile needs fetching before entering into the
anticongestion sleep.
Unfortunately some ports still use their own sleeps so, this commit
doesn't address the complete problem which is compounded by every
port that uses its own anticongestion mechanism.
Discussed with: asomers
jhibbits [Thu, 19 Oct 2017 02:14:39 +0000 (02:14 +0000)]
Remove some unnecessary includes
mjg [Thu, 19 Oct 2017 01:38:31 +0000 (01:38 +0000)]
sysctl: only take mem lock if oldlen is > 4 * PAGE_SIZE
The previous limit of just one page is hit by ps.
The entire mechanism should be reworked, if not whacked. It seems the intent
is to reduce kernel dos-ability - some handlers wire the amount of memory
passed here. Handlers should probably stop wiring in the first place or in
the worst case indicate they are doing so so that the check is done only if
necessary. It should also probably be a counter, not a lock.
MFC after: 1 week
mjg [Thu, 19 Oct 2017 00:46:15 +0000 (00:46 +0000)]
execve: avoid one proc lock/unlock trip unless PTRACE_EXEC is set
MFC after: 1 week
mjg [Thu, 19 Oct 2017 00:38:14 +0000 (00:38 +0000)]
Tidy up pmc support at execve.
The proc-specific check is inherently racy, so the code can just unlock
beforehand.
MFC after: 1 week
mjg [Thu, 19 Oct 2017 00:31:00 +0000 (00:31 +0000)]
sysvsem: check if semu_list has anything on it before grabbing the lock
This should get a process-specific support instead.
MFC after: 1 week
bjk [Wed, 18 Oct 2017 22:56:46 +0000 (22:56 +0000)]
Adopt jail.8 to our brave new bsdinstall world
Submitted by: Steve Kargl
MFC after: 3 days
mjg [Wed, 18 Oct 2017 22:00:44 +0000 (22:00 +0000)]
Don't take Giant for SMP status and cpu topology sysctls.
Not only this lock doesn't play any role here, dirtying it slows down
other things a little bit as giant-held checks (e.g. DROP_GIANT) are
spread all over the kernel.
MFC after: 1 week
tuexen [Wed, 18 Oct 2017 21:08:35 +0000 (21:08 +0000)]
Fix a signed/unsigned warning.
MFC after: 1 week
tuexen [Wed, 18 Oct 2017 20:17:44 +0000 (20:17 +0000)]
Abort an SCTP association, when a DATA chunk is followed by an unknown
chunk with a length smaller than the minimum length.
Thanks to Felix Weinrank for making me aware of the problem.
MFC after: 3 days
rlibby [Wed, 18 Oct 2017 19:28:28 +0000 (19:28 +0000)]
ql*_def.h: fix QL_ALIGN parenthesization
QL_ALIGN is a set of copies of roundup2, but it was missing an outer set
of parentheses, which began to matter with r324538. Now, fully copy the
parenthesization of roundup2.
Reviewed by: davidcs
Differential Revision: https://reviews.freebsd.org/D12673
ed [Wed, 18 Oct 2017 19:22:53 +0000 (19:22 +0000)]
Import the latest CloudABI definitions, version 0.16.
The most important change in this release is the removal of the
poll_fd() system call; CloudABI's equivalent of kevent(). Though I think
that kqueue is a lot saner than many of its alternatives, our
experience is that emulating this system call on other systems
accurately isn't easy. It has become a complex API, even though I'm not
convinced this complexity is needed. This is why we've decided to take a
different approach, by looking one layer up.
We're currently adding an event loop to CloudABI's C library that is API
compatible with libuv (except when incompatible with Capsicum).
Initially, this event loop will be built on top of plain inefficient
poll() calls. Only after this is finished, we'll work our way backwards
and design a new set of system calls to optimize it.
Interesting challenges will include integrating asynchronous I/O into
such a system call API. libuv currently doesn't aio(4) on Linux/BSD, due
to it being unreliable and having undesired semantics.
Obtained from: https://github.com/NuxiNL/cloudabi
tuexen [Wed, 18 Oct 2017 18:59:35 +0000 (18:59 +0000)]
Revert change which got in accidently.
tuexen [Wed, 18 Oct 2017 18:56:56 +0000 (18:56 +0000)]
Fix a bug introduced in r324638.
Thanks to Felix Weinrank for making me aware of this.
MFC after: 3 days
jhb [Wed, 18 Oct 2017 17:23:16 +0000 (17:23 +0000)]
Remove CPU_HAVEFPU.
Instead, use a runtime decision to handle COP1 traps. If floating point
support is present in the current CPU, enable saving of the floating point
state. If support is not present, fail with SIGILL.
Reviewed by: imp, br
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D12707
brd [Wed, 18 Oct 2017 15:48:26 +0000 (15:48 +0000)]
Teach beinstall to use and prefer svnlite, with a fallback to svn.
Approved by: will
markj [Wed, 18 Oct 2017 15:38:05 +0000 (15:38 +0000)]
Move kernel dump offset tracking into MI code.
All of the kernel dump implementations keep track of the current offset
("dumplo") within the dump device. However, except for textdumps, they
all write the dump sequentially, so we can reduce code duplication by
having the MI code keep track of the current offset. The new
dump_append() API can be used to write at the current offset.
This is needed to implement support for kernel dump compression in the
MI kernel dump code.
Also simplify dump_encrypted_write() somewhat: use dump_write() instead
of duplicating its bounds checks, and get rid of the redundant offset
tracking.
Reviewed by: cem
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D11722
se [Wed, 18 Oct 2017 13:25:44 +0000 (13:25 +0000)]
Add references to sysrc(8).
Reported by: Kurt Jaeger (lists at opsec.eu)
tsoome [Wed, 18 Oct 2017 08:06:05 +0000 (08:06 +0000)]
libsa/ip: stop read loop on bad fragments
Lets try to clear out from case of overlapping etc fragments and stop read.
Reported by: Dan McDonald
tsoome [Wed, 18 Oct 2017 07:39:21 +0000 (07:39 +0000)]
libsa/ip.c: misplaced comment, ip_v is half char, not ip_p
The comment should be at previous line.
Reported by: Dan McDonald
kib [Wed, 18 Oct 2017 07:27:43 +0000 (07:27 +0000)]
Do not report reduction of swap zone if it was not.
After r324600 we see the actual reservation.
Reported by: jkim
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
rlibby [Wed, 18 Oct 2017 00:41:23 +0000 (00:41 +0000)]
ext2: delete redundant decl of ext2_fserr
Fix gcc build after r324706.
Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D12709
jonathan [Wed, 18 Oct 2017 00:33:20 +0000 (00:33 +0000)]
Improve computation of {BC,LL}OBJS.
Now that OBJS has grown an OBJS_SRCS_FILTER variable, use this variable
in the computation of BCOBJS and LLOBJS too. Also move BCOBJS and LLOBJS
computation to be next to the OBJS computation: this should both make
the parallel structure clearer and serve to remind people changing OBJS
that parallel changes are required in BCOBJS and LLOBJS.
A side effect of this change is that BCOBJS and LLOBJS will be available
even when LLVM_LINK has not been defined, but that seems like a positive
change: there's no reason we can't ask "what bitcode files would you
generate" just because we can't link those files together into a
complete bitcode representation of a binary or library.
Reviewed by: sjg
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D12701
jonathan [Wed, 18 Oct 2017 00:30:15 +0000 (00:30 +0000)]
Improve logic of CLEANFILES+=${PROG_FULL}.{bc,ll}.
The build rule describing how to create ${PROG_FULL}.{bc,ll} is only
dependent on LLVM_LINK being defined, not on MK_DEBUG_FILES being "yes".
Move the addition of ${PROG_FULL}.{bc,ll} out of the conditional block
under `.if ${MK_DEBUG_FILES} != "no"` and up next to where the build
rules for ${PROG_FULL}.{bc,ll} are defined.
Reviewed by: emaste
MFC after: 1 week
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D12703
brooks [Wed, 18 Oct 2017 00:18:03 +0000 (00:18 +0000)]
Remove mbpool(9) now that it has no consumers.
mbpool existed to support NICs with memory interfaces and all remaining
comsumers were removed earlier this year with NATM.
Reviewed by: jhb
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D10513
imp [Tue, 17 Oct 2017 23:38:27 +0000 (23:38 +0000)]
Revert "Unify boot1 with loader" change r324646
Back out the unification commit to boot1. There's some issues on the
arm and arm64 platforms that need to be addressed with code
changes. There's also a discussion on arch@ about the future of
boot1.efi vs just using loader.efi that needs to play out. So take a
pause on these changes until the arm issues can be fixed and it's
clear boot1.efi will survive into FreeBSD 12.
OK'd by: Eric@meatspace
emaste [Tue, 17 Oct 2017 21:13:26 +0000 (21:13 +0000)]
embed_mfs: add error handling, usage
Ensure that we are called with two arguments, and that the output file
is writable. Also, if we cannot find the mfs section report the output
file name rather than "kernel", as this script may be used with other
than kernels.
Sponsored by: The FreeBSD Foundation
fsu [Tue, 17 Oct 2017 20:45:44 +0000 (20:45 +0000)]
Add inital extents read-write support.
Approved by: pfg (mentor)
MFC after: 6 months
RelNotes: Yes
Differential Revision: https://reviews.freebsd.org/D12087
rlibby [Tue, 17 Oct 2017 20:37:31 +0000 (20:37 +0000)]
cxgbe: delete now-redundant vnet decls
r324539 gathered some vnet decls into netinet/tcp_var.h, so that they
are now redundant in dev/cxgbe/tom/{t4_cpl_io.c,t4_ddp.c}. This triggers
gcc -Wredundant-decls.
Reviewed by: np
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12674
markj [Tue, 17 Oct 2017 19:41:45 +0000 (19:41 +0000)]
Fix a racy VI_DOOMED check in MNT_VNODE_FOREACH_ALL().
MNT_VNODE_FOREACH_ALL() is supposed to avoid returning doomed vnodes,
but the VI_DOOMED check it used was done without the vnode interlock
held, so it could race with a concurrent vgone().
Submitted by: Don Morris <don.morris@isilon.com>
Reviewed by: kib, mckusick
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12704
emaste [Tue, 17 Oct 2017 19:11:29 +0000 (19:11 +0000)]
loader.mk: clean md.o even if MD_IMAGE_SIZE not defined
We don't normally provide special handling for optionally-included src
files, but md.o depends on both md.c and the value of ${MD_IMAGE_SIZE}.
Previously if one built with MD_IMAGE_SIZE, executed "make clean", and
then built with a different MD_IMAGE_SIZE md.o would not be rebuilt.
Reported by: Zakary Nafziger
Sponsored by: The FreeBSD Foundation
imp [Tue, 17 Oct 2017 19:11:19 +0000 (19:11 +0000)]
We need to include disk.o in libuboot.a when we're building with
support for disk access.
Sponsored by: Netflix
bdrewery [Tue, 17 Oct 2017 19:01:01 +0000 (19:01 +0000)]
Add a test for r324671 along with some other masked tests.
MFC after: 1 week
Sponsored by: Dell EMC Isilon
emaste [Tue, 17 Oct 2017 18:00:01 +0000 (18:00 +0000)]
loader: initialize dv_cleanup in md.c to eliminate clang warning
Submitted by: Zakary Nafziger <worldofzak@gmail.com>
Sponsored by: The FreeBSD Foundation
gordon [Tue, 17 Oct 2017 17:22:36 +0000 (17:22 +0000)]
Update wpa_supplicant/hostapd for 2017-01 vulnerability release.
hostapd: Avoid key reinstallation in FT handshake
Prevent reinstallation of an already in-use group key
Extend protection of GTK/IGTK reinstallation of WNM-Sleep Mode cases
Fix TK configuration to the driver in EAPOL-Key 3/4 retry case
Prevent installation of an all-zero TK
Fix PTK rekeying to generate a new ANonce
TDLS: Reject TPK-TK reconfiguration
WNM: Ignore Key Data in WNM Sleep Mode Response frame if no PMF in use
WNM: Ignore WNM-Sleep Mode Response if WNM-Sleep Mode has not been used
WNM: Ignore WNM-Sleep Mode Response without pending request
FT: Do not allow multiple Reassociation Response frames
TDLS: Ignore incoming TDLS Setup Response retries
Submitted by: jhb
Obtained from: https://w1.fi/security/2017-01/ (against later version)
Security: FreeBSD-SA-17:07
Security: CERT VU#228519
Security: CVE-2017-13077
Security: CVE-2017-13078
Security: CVE-2017-13079
Security: CVE-2017-13080
Security: CVE-2017-13081
Security: CVE-2017-13082
Security: CVE-2017-13086
Security: CVE-2017-13087
Security: CVE-2017-13088
Differential Revision: https://reviews.freebsd.org/D12693
jonathan [Tue, 17 Oct 2017 16:29:50 +0000 (16:29 +0000)]
Add LLVM IR libraries to CLEANFILES.
We previously taught the build system how to create files like libfoo.bc,
but neglected to teach it about cleaning such files up. Rectify this now.
MFC after: 1 week
Sponsored by: DARPA, AFRL
avg [Tue, 17 Oct 2017 16:03:59 +0000 (16:03 +0000)]
never retry oustanding requests when terminating iscsi session
CAM_REQ_ABORTED sounds natural for aborting outstanding requests when
tearing down a session, but that status actually causes eligible
requests to be tried again. That's completely useless, so let's use
CAM_DEV_NOT_THERE instead. Perhaps there is a better status, but this
should be good enough. The change should affect only the session
termination.
Tested by: Ben RUBSON <ben.rubson@gmail.com>
Reviewed by: mav, trasz
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12653
avg [Tue, 17 Oct 2017 15:39:38 +0000 (15:39 +0000)]
iscsi: do not hold the global lock while tearing down a session
It should be sufficient to hold the lock just for removing the session
from the session list. Everything else should be covered by the session
specific lock.
On top of that, at present we can get a deadlock caused by waiting on
the CAM SIM reference count while holding the global lock. A specific
scenario involving ZFS is this:
- concurrent termination of two sessions, S1 and S2
- session S1 completed all I/Os and sleeps in CAM waiting for device
close by ZFS;
- session S2 is also dead now, but can not forcefully complete
outstanding requests by calling iscsi_session_cleanup() from
iscsi_maintenance_thread_terminate(), since it can't get the same
global sc_lock;
- as soon as there are unfinished requests, ZFS can not do
spa_config_enter() as writer, and so can not close the device for
session S1;
- deadlock.
Reported by: Ben RUBSON <ben.rubson@gmail.com>
Tested by: Ben RUBSON <ben.rubson@gmail.com>
Reviewed by: mav, trasz
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12652
maxim [Tue, 17 Oct 2017 14:37:12 +0000 (14:37 +0000)]
DragonFly 5.0.0 release added.
emaste [Tue, 17 Oct 2017 02:53:42 +0000 (02:53 +0000)]
Remove lib/libstand again, accidentally readded in r324683
emaste [Tue, 17 Oct 2017 02:51:45 +0000 (02:51 +0000)]
write.2: correct maximum nbytes size for EINVAL error
In FreeBSD 11 and later debug.iosize_max_clamp defaults to 0, and the
maximum nbytes count for write(2) is SSIZE_MAX. Update the man page to
document this, and mention the sysctl that can be set to obtain the
previous behaviour.
PR: 196666
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
cy [Tue, 17 Oct 2017 01:15:55 +0000 (01:15 +0000)]
Style. Replace 8 spaces with a tab.
MFC after: 2 weeks (with prior commit to this file)
cy [Tue, 17 Oct 2017 01:15:13 +0000 (01:15 +0000)]
Provide an option to run the anticongestion ntpd leapfile fetch in
the background.
Original patch submitted by feld@. I added the "optional" bit.
Submitted by: feld (original patch)
MFC after: 2 weeks
rlibby [Tue, 17 Oct 2017 01:12:17 +0000 (01:12 +0000)]
gdb kernel server: fixup Search:memory style
This is a NFC patch to move around the Search:memory implementation so
that it doesn't exceed the standard column width and doesn't take so
much vertical space in gdb_trap.
Submitted by: Daniel O'Connor <darius@dons.net.au>
Reviewed by: cem, jhb
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12684
rmacklem [Mon, 16 Oct 2017 23:28:12 +0000 (23:28 +0000)]
Use taskqueue(9) to do writes/commits to mirrored DSs concurrently.
When the NFSv4.1 pNFS client is using a Flexible File Layout specifying
mirrored Data Servers, it must do the writes and commits to all mirrors.
This patch modifies the client to use a taskqueue to perform these writes
and commits concurrently.
The number of threads can't be changed for taskqueue(9), so it is set
to 4 * mp_ncpus by default, but this can be overridden by setting the
sysctl vfs.nfs.pnfsiothreads.
Differential Revision: https://reviews.freebsd.org/D12632
avos [Mon, 16 Oct 2017 21:46:11 +0000 (21:46 +0000)]
mbuf(9): unbreak m_fragment()
- Fix it by replacing m_cat() with m_prev->m_next = m_new
(m_cat() will try to append data - as a result, there will be no
fragmentation).
- Move some constants out of the loop.
Was previously tested with D4077.
Differential Revision: https://reviews.freebsd.org/D4090
avos [Mon, 16 Oct 2017 21:21:31 +0000 (21:21 +0000)]
ifnet(9): split ifc_alloc_unit() (should simplify code flow)
Allocate smallest unit number from pool via ifc_alloc_unit_next()
and exact unit number (if available) via ifc_alloc_unit_specific().
While here, address possible deadlock (mentioned in PR).
PR: 217401
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D12551
kib [Mon, 16 Oct 2017 20:21:51 +0000 (20:21 +0000)]
Re-evaluate thread' signal mask after ptracestop().
The stop drops process lock, which allows the signal mask to be
changed and our selected signal might become blocked, i.e. should be
returned to the process queue instead of delivery.
Also, for the existing check of the process no longer having an
attached debugger, we should not loose the signal, but requeue it.
Reported and tested by: bdrewery
Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
kib [Mon, 16 Oct 2017 20:15:19 +0000 (20:15 +0000)]
Improve assertion that an ignored or blocked signal is not delivered.
Split two conditions into separate asserts. Print additional details,
like the signal number and action value.
Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
kib [Mon, 16 Oct 2017 20:11:29 +0000 (20:11 +0000)]
Style.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
bdrewery [Mon, 16 Oct 2017 20:06:24 +0000 (20:06 +0000)]
This child is expected to exit on SIGTRAP, don't leave a core behind.
MFC after: 1 week
Sponsored by: Dell EMC Isilon
romain [Mon, 16 Oct 2017 17:21:52 +0000 (17:21 +0000)]
Add a quick description of the geom_getxml(3), geom_xml2tree(3),
geom_gettree(3) and geom_deletetree(3) functions provided by libgeom and are
not documented in libgeom(3).
Reviewed by: mav, bjk, allanjude
Approved by: allanjude
Differential Revision: https://reviews.freebsd.org/D12679
mjoras [Mon, 16 Oct 2017 16:14:50 +0000 (16:14 +0000)]
Properly reset the fields in clean_unrhdr.
In r324542 I neglected to reset the first and last fields of struct
unrhdr. This causes a tmpfs to fail the unr(9) consistency checks with
DIAGNOSTIC on. Fix this by resetting the fields by calling init_unrhdr.
While here, change a loop to use TAILQ_FOREACH_SAFE since it is more
readable and equally fast.
Reported by: David Wolfskill <david@catwhisker.org>
Approved by: rstone (mentor)
Sponsored by: Dell EMC Isilon
kib [Mon, 16 Oct 2017 15:16:24 +0000 (15:16 +0000)]
Fix the pv_chunks pc_lru tailq handling in reclaim_pv_chunk().
For processing, reclaim_pv_chunk() removes the pv_chunk from the lru
list, which makes pc_lru linkage invalid. Then the pmap lock is
released, which allows for other thread to free the last pv entry
allocated from the chunk and call free_pv_chunk(), which tries to
modify the invalid linkage.
Similarly, the chunk is inserted into the private tailq new_tail
temporary. Again, free_pv_chunk() might be run and corrupt the
linkage for the new_tail after the pmap lock is dropped.
This is a consequence of r299788 elimination of pvh_global_lock, which
allowed for reclaim to run in parallel with other pmap calls which
free pv chunks.
As a fix, do not remove the chunk from pc_lru queue, use a marker to
remember the position in the queue iteration. We can safely operate
on the chunks after the chunk's pmap is locked, we fetched the chunk
after the marker, and we checked that chunk pmap is same as we have
locked, because chunk removal from pc_lru requires both pv_chunk_mutex
and the pmap mutex owned.
Note that the fix lost an optimization which was present in the
previous algorithm. Namely, new_tail requeueing rotated the pv chunks
list so that reclaim didn't scan the same pv chunks that couldn't be
freed (because they contained a wired and/or superpage mapping) on
every invocation. An additional change is planned which would improve
this.
Reported and tested by: pho
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
kp [Mon, 16 Oct 2017 15:05:32 +0000 (15:05 +0000)]
pf tests: Use pft_set_rules everywhere
We now have a utility function to set pf rules in the jail. Use it
whenever we need to set the pf rules in the test jail.
kp [Mon, 16 Oct 2017 15:03:45 +0000 (15:03 +0000)]
pf tests: Basic IPv6 forwarding tests
Pass/block packets in the forwarding path with pf.
Introduce the pft_set_rules() helper function, because we need to
remember to flush states between individual tests. If not we can get
packets passing despite rules blocking them because they match states
created in a previous test.
Extend pft_ping.py to be able to send IPv6 echo requests.