In r297602, which included a __FreeBSD_version bump to 1100105, we changed
sed 'i' and 'a' from discarding whitespaces to conform with what GNU and
sysvish sed do.
There are arguments in favor of keeping the old behavior but the new
behavior is also useful for migration purposes. It seems important to at
least consider the case of developers depending on the previous behavior
so add a CFLAG to enable the old behavior.
dim [Wed, 9 Nov 2016 08:08:02 +0000 (08:08 +0000)]
MFC r308375:
Pull in r278002 from upstream llvm trunk (by Silviu Baranga):
[AArch64] PR28877: Don't assume we're running after legalization when
creating vcvtfp2fxs
Summary:
The DAG combine transformation that was generating the
aarch64_neon_vcvtfp2fxs node was assuming that all inputs where legal
and wasn't accounting that the input could be a v4f64 if we're trying
to do the transformation before legalization. We now bail out in this
case.
All illegal types besides v4f64 were already rejected.
rmacklem [Tue, 8 Nov 2016 21:15:50 +0000 (21:15 +0000)]
MFC: r307891
Fix the man page to reflect the change done by r307890 to mountd.c
so that the "-n" option uses the sysctl for the new NFS server.
This is a content change.
rmacklem [Tue, 8 Nov 2016 21:09:48 +0000 (21:09 +0000)]
MFC: r307890
mountd(8) was erroneously setting the sysctl for the old NFS server
when the new/default NFS server was running, for the "-n" option.
This patch fixes the problem for head and stable/11. For stable/10 the
patch will need to be modified when MFC'd, since the stable/10 mountd.c
handles both old and new NFS servers.
Since the new NFS server uses vfs.nfsd.nfs_privport == 0 by default,
there wouldn't have been many users affected by the code not setting
it to 0 when the "-n" option was specified.
lidl [Tue, 8 Nov 2016 20:12:13 +0000 (20:12 +0000)]
MFC r308175: Revisit blacklistd support in ftpd
Enhance blacklistd support to not log anything by default,
unless blacklistd support is enabled on the command line.
Document new flag in man page, cleanup patches to be less
intrusive in code.
jch [Mon, 7 Nov 2016 18:29:21 +0000 (18:29 +0000)]
MFC r307966:
Remove an extraneous call to soisconnected() in syncache_socket(),
introduced with r261242. The useful and expected soisconnected()
call is done in tcp_do_segment().
Has been found as part of unrelated PR:212920 investigation.
Improve slightly (~2%) the maximum number of TCP accept per second.
kib [Mon, 7 Nov 2016 12:10:17 +0000 (12:10 +0000)]
Merge bde improvements for ddb on x86, mostly for single-stepping and
vm86 mode.
MFC r304085 (by bde):
Fix the variables $esp, $ds, $es, $fs, $gs and $ss in vm86 mode. Fix
PC_REGS() so that printing of instructions works in some useful cases.
MFC r304962 (by bde):
Expand error messages: print symbol names, parentheses and shift tokens,
and negative shift counts. Fix error messages.
MFC r305612 (by bde):
Fix single-stepping of instructions emulated by vm86.
MFC r305661 (by bde):
Give the full syntax of the 'count' arg for all commmands that support
it. Give the full syntax of the 'addr' arg for these commands and some
others. Rename it from 'address' for the generic command. Fix
description of how 'count' is supposed to work for the 'break'
command.
Don't (mis)describe the syntax of the comma for the 'step' command.
Expand the description for the generic command.
Give the full syntax for the 'examine' command. It was also missing
the possible values for the modifier.
MFC r305663 (by bde):
Fix stopping when the specified breakpoint count is reached.
MFC r305665 (by bde):
Pass the trap type and code down from db_trap() to db_stop_at_pc() so
that the latter can easily determine what the trap type actually is
after callers are fixed to encode the type unambigously.
MFC r305807 (by bde):
Use the MI macro TRAPF_USERMODE() instead of open-coded checks for
SEL_UPL and sometimes PSL_VM. Fix logic errors in treating vm86
bioscall mode as kernel mode. The main place checked all the
necessary flags, but put the necessary parentheses for the PSL_VM and
PCB_VM86CALL checks in the wrong place.
MFC r305811 (by bz):
Try to fix LINT builds after r305807.
MFC r305840 (by bde):
Abort single stepping in ddb if the trap is not for single-stepping.
MFC r305862 (by bde):
Ifdef the new dr6 variable for KDB.
MFC r305864 (by bde):
Statically initialize the run mode to the one that will become current
on first entry. Don't reset to the run mode to STEP_NONE when
stopping, and remove STEP_NONE.
MFC r305865 (by bde):
Fix decoding of tf_rsp on amd64, and move TF_HAS_STACKREGS() to the
i386-only section, and fix a comment about the amd64 kernel trapframe
not having stackregs.
MFC r306311 (by bde):
Determine the operand/address size of %cs in a new function
db_segsize(). Use db_segsize() to set the default operand/address
size for disassembling.
Fix db_print_loc_and_inst() to ask for the normal format and not the
alternate in normal operation. Use db_segsize() to avoid trying to
print a garbage stack trace if %cs is 16 bits.
hselasky [Mon, 7 Nov 2016 08:36:06 +0000 (08:36 +0000)]
MFC r307518:
Fix device delete child function.
When detaching device trees parent devices must be detached prior to
detaching its children. This is because parent devices can have
pointers to the child devices in their softcs which are not
invalidated by device_delete_child(). This can cause use after free
issues and panic().
Device drivers implementing trees, must ensure its detach function
detaches or deletes all its children before returning.
While at it remove now redundant device_detach() calls before
device_delete_child() and device_delete_children(), mostly in
the USB controller drivers.
Tested by: Jan Henrik Sylvester <me@janh.de>
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D8070
gonzo [Sun, 6 Nov 2016 21:41:26 +0000 (21:41 +0000)]
MFC r307804-r307805
r307804:
EVDEV: Add shortcut functions for event types
Add wrappers around generic evdev_push_event for specific event types:
EV_KEY/EV_REL/EV_ABS etc...
Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
r307805:
EVDEV: ums evdev support improvements: locking and event reporting
- Use ums lock as evdev lock
- Do not cap axes values to sysmouse limits for evdev reports
- Do not map T-axis events to buttons for evdev reports
- Use shortcuts for event reporting
Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
MFC after: 1 week
gonzo [Sun, 6 Nov 2016 18:40:12 +0000 (18:40 +0000)]
MFC r306899, r307059, r307151
r306899:
Fix release MSI method for ARM GIC
r307059:
INTRNG - fix MSI/MSIX release path
Use isrc in attached MSI data structure instead of using map's
isrc directly. map's isrc is set to NULL on IRQ deactivation
which happens prior to pci_release_msi so MSI_RELEASE_MSI
receives array of NULLs
alc [Sun, 6 Nov 2016 17:17:52 +0000 (17:17 +0000)]
MFC r308174, r308261
Move and revise a comment about the relation between the object's paging-
in-progress count and the vnode. Prior to r188331, we always acquired
the vnode lock before incrementing the object's paging-in-progress count.
Now, we increment it before attempting to acquire the vnode lock with
LK_NOWAIT, but we never sleep acquiring the vnode lock while we have the
count incremented.
In vm_fault()'s loop over the shadow chain, move a comment describing our
invariants to a better place. Also, add two comments concerning the
relationship between the map and vnode locks.
mmel [Sun, 6 Nov 2016 15:25:46 +0000 (15:25 +0000)]
MFC r306551,r307557:
r306551:
TEGRA: Fix bindings for cpufreq and coretemp drivers, it was broken in
r306477. Correct a description for coretemp driver.
r307557:
TEGRA: Attach cpufreq and coretemp drivers only on tegra124 SoC. It's
needed by GENERIC kernel.
jhibbits [Sun, 6 Nov 2016 15:12:05 +0000 (15:12 +0000)]
MFC r304970:
Check all compatible strings on uart devices in powerpc
Summary:
Some device trees put "fsl,ns16650" first in the compatible list. This causes
the probe code to choke, even though the device is compatible with ns16650, and
has it listed later in the tree.
alc [Sun, 6 Nov 2016 05:57:44 +0000 (05:57 +0000)]
MFC r308096, r308098, r308112
With one exception, "hardfault" is used like a "bool". Change that
exception and make it a "bool".
The "lookup_still_valid" field is used as a "bool". Make it one.
Convert vm_fault_hold()'s Boolean variables that are only used
internally to "bool". Add a comment describing why the one
remaining "boolean_t" was not converted.
Merge and sort vm_fault_hold()'s "int" variable definitions.
Sources from the "current" build tree and generated sources in the
object tree should be used instead of sources and headers from the
already installed source tree on the build host.
This was noticed while addressing issues in the upcoming amd update.
r307801:
Align whitespace.
r307801 is related to r307800 however it was a separate commit to
HEAD in order to maintain a separation between the functional change
and a correction of style.
mmel [Sat, 5 Nov 2016 11:00:19 +0000 (11:00 +0000)]
MFC r307556,r307637:
r307556:
TEGRA: Really implement early printf. The original version was cut&pasted
from another SoC.
r307637:
TEGRA: Raise minimum voltage for CPU, original 0.9 V was too optimistic.
While I'm in, remove duplicated line from CPU frequency table.
mmel [Sat, 5 Nov 2016 10:56:32 +0000 (10:56 +0000)]
MFC r306447,r306477:
r306447:
TEGRA: Rename (cut & pasted) genahci to tegra_ahci. Make device class
definition static.
r306477:
TEGRA: Prepare Tegra subtree for inclusion into ARM generic kernel.
- use DEFINE_CLASS_0() for driver classes - unify driver names - cleanup
driver definitions and bindings
mmel [Sat, 5 Nov 2016 10:23:02 +0000 (10:23 +0000)]
MFC r304459,r305527:
r304459:
INTRNG: Rework handling with resources. Partially revert r301453.
- Read interrupt properties at bus enumeration time and store
it into global mapping table.
- At bus_activate_resource() time, given mapping entry is resolved and
connected to real interrupt source. A copy of mapping entry is attached
to given resource.
- At bus_setup_intr() time, mapping entry stored in resource is used
for delivery of requested interrupt configuration.
- For MSI/MSIX interrupts, mapping entry is created within
pci_alloc_msi()/pci_alloc_msix() call.
- For legacy PCI interrupts, mapping entry must be created within
pcib_route_interrupt() by pcib driver itself.
r305527:
Fix MIPS INTRNG (both FDT and non-FDT) behaviour broken by r304459
This commit is from John Marino in dragonfly with the following commit log:
====
This was a CTYPE encoding error involving consecutive points of the same
ctype. It was reported by myself to Illumos over a year ago but I was
unsure if it was only happening on BSD. Given the cause, the bug is also
present on Illumos.
Basically, if consecutive points were of the exact same ctype, they would
be defined as a range regardless. For example, all of these would be
considered equivalent:
<A> ... <C>, <H> (converts to <A> .. <H>)
<A>, <B>, <H> (converts to <A> .. <H>)
<A>, <J> ... <H> (converts to <A> .. <H>)
So all the points that shouldn't have been defined got "bridged" by the
extreme points.
The effects were recently reported to FreeBSD on PR 213013. There are
countless places were the ctype flags are misdefined, so this is a major
fix that has to be MFC'd.
====
This reveals a bad change I did on the testsuite: while 0x07FF is a valid
unicode it is not used yet (reserved for future use)
original commit log:
=====
I had originally suspected the parsing of ctype definition files as being
the source of the ctype flag mis-definitions, but it wasn't. In the
process, I simplified the cc_list parsing so I'm committing the no-impact
improvement separately. It removes some parsing redundancies and
won't parse partial range definitions anymore.
====
mmel [Sat, 5 Nov 2016 04:17:32 +0000 (04:17 +0000)]
MFC r302523,r302528:
r302523:
Add clk_get_by_ofw_node_index, which is like clk_get_by_ofw_index but
operates on a specific OF node instead of the pass in device's OF node.
r302528:
EXTRES: Add OF node as argument to all <foo>_get_by_ofw_<bar>() functions.
In some cases, the driver must handle given properties located in specific
OF subnode. Instead of creating duplicate set of function, add 'node' as
argument to existing functions, defaulting it to device OF node.
manu [Fri, 4 Nov 2016 01:56:29 +0000 (01:56 +0000)]
MFC r305689:
a10_mmc: Remove completly the PIO code now all access is done by DMA.
Rename registers as in the manual.
Do a hard reset of the controller before a soft one.
Since DMA is always used remove dependancy on allwinner_soc_family, it was used
to differentiate SoC as the fdt compatible string were the same.
manu [Fri, 4 Nov 2016 01:50:59 +0000 (01:50 +0000)]
MFC r302522, r302591-r302592 (by jmcneill)
r302522:
Align descriptors and data buffers to 32 bits. This restriction is
described in the A20 (and later) user manuals.
r302591:
Add support for arm64. The allwinner_soc_family() function is not available
on arm64 and all SoCs using the old FIFO register location are 32-bit only,
so unconditionally use the new location for arm64.
Reviewed by: andrew, manu
r302592:
Return early from bus_dmamap_load callback if the error indicator is set.
manu [Fri, 4 Nov 2016 01:06:14 +0000 (01:06 +0000)]
MFC r304710:
Allwinner: Add thermal sensor driver for A10/A20
The thermal sensor lives in the touch screen controller. Touch screen part
isn't done for now.
Temperature is read every ~2 seconds and exposed via sysctl.
manu [Fri, 4 Nov 2016 00:43:12 +0000 (00:43 +0000)]
MFC r304316:
Rename kernel config A10 into ALLWINNER_UP as it is intend to work with all
Allwinner Uniprocessor SoC.
As of now it works with A10 and A13 (and possibly R8 as it is the same as the A13).
Move files.a10 into a1o subdirectory as it should be.
Rename std.a10 into std.allwinner_up
trasz [Thu, 3 Nov 2016 14:58:26 +0000 (14:58 +0000)]
MFC r304570:
Add the "-n" flag to cron(8), to prevent it from daemonizing.
This makes it possible to use it with external supervisors.
The "-n" flag name is compatible with Linux, NetBSD, and OpenBSD.
rmacklem [Thu, 3 Nov 2016 00:50:20 +0000 (00:50 +0000)]
MFC: r307694
A problem w.r.t. interoperation between the FreeBSD NFSv4.1 server with
delegations enabled and the Linux NFSv4.1 client was reported in
reviews.freebsd.org/D7891.
I believe that the FreeBSD server behaviour conforms to the RFC and that
the Linux client has a bug. Therefore, I do not think the proposed patch
is appropriate. When nfsrv_writedelegifpos is non-zero, the FreeBSD
server will issue a write delegation for a read open if possible.
The Linux client then erroneously assumes that the credentials used for
the read open can write the file.
This patch reverses the default value for nfsrv_writedelegifpos to 0 so
that the default behaviour is Linux compatible and adds a sysctl that can
be used to set nfsrv_writedelegifpos.
This change should only affect users that are mounting a FreeBSD server
with delegations enabled (they are not enabled by default) with a Linux
NFSv4.1 client mount.
sbruno [Mon, 31 Oct 2016 15:46:06 +0000 (15:46 +0000)]
MFC r308038:
The buffer address is always overwritten in the extended descriptor format,
we have to refresh it ... always. This fixes problems reported in NetMap
with em(4) devices after conversion to extended descriptor format in
svn r293331.
mav [Mon, 31 Oct 2016 07:21:07 +0000 (07:21 +0000)]
MFC r307523: Make pass driver better support CAM_CDB_POINTER flag.
Previously pass driver just ignored the flag, making random kernel code
access user-space pointer, sometime causing crashes even for correctly
written applications if user-level context was switched or swapped out.
This patch tries to copyin the CDB into kernel space to avoid it.
alc [Sun, 30 Oct 2016 18:33:57 +0000 (18:33 +0000)]
MFC r306712
Make the page daemon's notion of what kind of pass is being performed
by vm_pageout_scan() local to vm_pageout_worker(). There is no reason
to store the pass in the NUMA domain structure.
alc [Sun, 30 Oct 2016 18:11:35 +0000 (18:11 +0000)]
MFC r306706
Change vm_pageout_scan() to return a value indicating whether the free page
target was met.
Previously, vm_pageout_worker() itself checked the length of the free page
queues to determine whether vm_pageout_scan(pass >= 1)'s inactive queue scan
freed enough pages to meet the free page target. Specifically,
vm_pageout_worker() used vm_paging_needed(). The trouble with
vm_paging_needed() is that it compares the length of the free page queues to
the wakeup threshold for the page daemon, which is much lower than the free
page target. Consequently, vm_pageout_worker() could conclude that the
inactive queue scan succeeded in meeting its free page target when in fact
it did not; and rather than immediately triggering an all-out laundering
pass over the inactive queue, vm_pageout_worker() would go back to sleep
waiting for the free page count to fall below the page daemon wakeup
threshold again, at which point it will perform another limited (pass == 1)
scan over the inactive queue.
Changing vm_pageout_worker() to use vm_page_count_target() instead of
vm_paging_needed() won't work because any page allocations that happen
concurrently with the inactive queue scan will result in the free page count
being below the target at the end of a successful scan. Instead, having
vm_pageout_scan() return a value indicating success or failure is the most
straightforward fix.
ed [Sat, 29 Oct 2016 14:41:22 +0000 (14:41 +0000)]
MFC r307227 and r307343:
Improve typing of POSIX search tree functions.
Back in 2015 when I reimplemented these functions to use an AVL tree, I
was annoyed by the weakness of the typing of these functions. Both tree
nodes and keys are represented by 'void *', meaning that things like the
documentation for these functions are an absolute train wreck.
To make things worse, users of these functions need to cast the return
value of tfind()/tsearch() from 'void *' to 'type_of_key **' in order to
access the key. Technically speaking such casts violate aliasing rules.
I've observed actual breakages as a result of this by enabling features
like LTO.
I've filed a bug report at the Austin Group. Looking at the way the bug
got resolved, they made a pretty good step in the right direction. A new
type 'posix_tnode' has been added to correspond to tree nodes. It is
still defined as 'void' for source-level compatibility, but in the very
far future it could be replaced by a proper structure type containing a
key pointer.
Until we can resolve the numerous hole_birth bugs that have cropped up
recently, and come up with a way going forwards to protect users from
corruption, we should disable the hole_birth feature. Using a tunable
allows those who are confident that their data is correct to continue to
take advantage of the feature.
Closes #188
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Author: Paul Dagnelie <pcd@delphix.com>
dsl_dataset_space is looking at the ds_bp's fill count while
dmu_objset_write_ready() is concurrently modifying it. This fix adds an
rrwlock to protect the ds_bp.
Closes #180
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Author: Paul Dagnelie <pcd@delphix.com>
mav [Sat, 29 Oct 2016 08:47:23 +0000 (08:47 +0000)]
MFC r307507, r307509, r307515:
Consider device as clean even if SYNCHRONIZE CACHE failed.
If device reservation was preempted by other initiator, our sync request
will always fail. Without this change CAM tried to sync cache on every
following device close, including numerous GEOM tasting opens/closes,
causing lots of useless noise in logs.
mav [Sat, 29 Oct 2016 08:43:34 +0000 (08:43 +0000)]
MFC r307350: Add LUN options to limit UNMAP and WRITE SAME sizes.
CTL itself has no limits on on UNMAP and WRITE SAME sizes. But depending
on backends large requests may take too much time. To avoid that new
configuration options allow to hint initiator maximal sizes it should not
exceed.