jilles [Sun, 27 Oct 2013 21:49:52 +0000 (21:49 +0000)]
MFC r243731,r255303: libc: Allow setting close-on-exec in fopen/freopen/
fdopen.
This commit adds a new mode option 'e'.
For freopen() with a non-NULL path argument and fopen(), the close-on-exec
flag is set iff the 'e' mode option is specified. For freopen() with a NULL
path argument and fdopen(), the close-on-exec flag is turned on if the 'e'
mode option is specified and remains unchanged otherwise.
Although the same behaviour for fopen() can be obtained by open(O_CLOEXEC)
and fdopen(), this needlessly complicates the calling code.
delphij [Sat, 26 Oct 2013 19:54:28 +0000 (19:54 +0000)]
MFC r256646, r256767, r257038:
When installing updates, install new directories first and remove old
directories last.
Allow ~ in file names so libtool droppings in contrib don't break updates.
It has happened twice now, and is likely to happen again.
Be more selective when filtering for lib*.so.N files. These are deleted
at the end of the upgrade process, after warning users to upgrade any
3rd party software (e.g., from the ports tree) which might link to the
libraries being removed.
dim [Sat, 26 Oct 2013 11:56:51 +0000 (11:56 +0000)]
MFC r256157:
Now our binutils's assembler supports the Intel Random Number Generator
extensions, we can change the .byte directives in sys/dev/random/ivy.c
to plain 'rdrand' mnemonics. This already worked for clang users, but
now it will also work for gcc users.
kib [Fri, 25 Oct 2013 17:15:57 +0000 (17:15 +0000)]
MFC r256504:
Add a sysctl kern.disallow_high_osrel which disables executing the
images compiled on the world with higher major version number than the
high version number of the booted kernel. Default to disable.
kib [Fri, 25 Oct 2013 17:04:46 +0000 (17:04 +0000)]
MFC r256502:
Similar to debug.iosize_max_clamp sysctl, introduce
devfs_iosize_max_clamp sysctl, which allows/disables SSIZE_MAX-sized
i/o requests on the devfs files.
delphij [Fri, 25 Oct 2013 15:43:59 +0000 (15:43 +0000)]
MFC r253816: MFV r253780:
To quote Illumos #3875:
The problem here is that if we ever end up in the error
path, we drop the locks protecting access to the zfsvfs_t
prior to forcibly unmounting the filesystem. Because z_os
is NULL, any thread that had already picked up the zfsvfs_t
and was sitting in ZFS_ENTER() when we dropped our locks
in zfs_resume_fs() will now acquire the lock, attempt to
use z_os, and panic.
Illumos ZFS issues:
3875 panic in zfs_root() after failed rollback
hselasky [Fri, 25 Oct 2013 06:48:57 +0000 (06:48 +0000)]
MFC r256750:
Improve XHCI stability. When a command timeout happens, the command
should be aborted else the command queue can stop. Refer to section
"4.6.1.2" of the XHCI specification.
bdrewery [Thu, 24 Oct 2013 10:53:35 +0000 (10:53 +0000)]
MFC r256842:
Fix 'make delete-old-libs' and 'make check-libs' to delete .debug
files created by WITH_DEBUG_FILES. Also cleanup .symbols files from
the period between r244236 when .symbols were supported and r251512
when they were renamed to .debug.
Only propose to delete a .debug file if the corresponding library
itself was deleted already.
mav [Thu, 24 Oct 2013 10:31:53 +0000 (10:31 +0000)]
MFC r256533:
Unhide "Serial Number" lines from bootverbose. That information may
be useful for system administration to have in hard copy (in logs) if
one of several devices suddenly dies.
hselasky [Thu, 24 Oct 2013 06:06:17 +0000 (06:06 +0000)]
MFC r241082:
Inherit USB mode from RootHUB port where the USB device is connected.
Only RootHUB ports can be dual mode. Disallow OTG ports on external HUBs.
This simplifies some checks in the USB controller drivers.
mav [Wed, 23 Oct 2013 17:08:50 +0000 (17:08 +0000)]
MFC r256188:
Close the race on path ID allocation in xpt_bus_register() if two buses are
registered simultaneously. Due to topology unlock between the ID allocation
and the bus registration there is a chance that two buses may get the
same IDs. That is supposed reason of lock assertion panic in CAM during
initial bus scanning after new iscsid initiates two sessions same time.
glebius [Tue, 22 Oct 2013 09:58:31 +0000 (09:58 +0000)]
Merge r255143 from head:
Merge 1.12 of pf_lb.c from OpenBSD, with some changes. Original commit:
date: 2010/02/04 14:10:12; author: sthen; state: Exp; lines: +24 -19;
pf_get_sport() picks a random port from the port range specified in a
nat rule. It should check to see if it's in-use (i.e. matches an existing
PF state), if it is, it cycles sequentially through other ports until
it finds a free one. However the check was being done with the state
keys the wrong way round so it was never actually finding the state
to be in-use.
- switch the keys to correct this, avoiding random state collisions
with nat. Fixes PR 6300 and problems reported by robert@ and viq.
- check pf_get_sport() return code in pf_test(); if port allocation
fails the packet should be dropped rather than sent out untranslated.
Help/ok claudio@.
Some additional changes to 1.12:
- We also need to bzero() the key to zero padding, otherwise key
won't match.
- Collapse two if blocks into one with ||, since both conditions
lead to the same processing.
- Only naddr changes in the cycle, so move initialization of other
fields above the cycle.
- s/u_intXX_t/uintXX_t/g
emaste [Mon, 21 Oct 2013 18:25:36 +0000 (18:25 +0000)]
MFC r251667: Handle DW_TAG_unspecified_type
2011-11-14 Jim Ingham <jingham@apple.com>
* dwarf2read.c (read_type_die): Handle DW_TAG_unspecified_type.
(read_tag_unspecified_type): New function, add a type for the
DW_TAG_unspecified_type die.
dim [Mon, 14 Oct 2013 15:06:47 +0000 (15:06 +0000)]
MFC r247012 (by jmg):
add support for AES and PCLMULQDQ instructions to binutils...
Thanks to Mike Belopuhov for the pointer to the OpenBSD patch, though
OpenBSD's gcc is very different that it only helped w/ where to modify,
not how... Thanks to jhb for some early reviews...
Reviewed by: imp, kib
MFC r247117 (by jmg):
reorder so all the flags are together and make the PCLMUL flag unique..
This fixes the problem on amd64 miscompiling mpboot.s causing boot
issues... We are still using gas for a few files in the kernel...
Submitted by: kib
MFC r255192 (by jhb):
Add support for the 'invpcid' instruction to binutils and DDB's
disassembler on amd64.
MFC r256112:
Add support for assembling and disassembling Intel Random Number
Generator extensions (e.g. the 'rdrand' mnemonic) to our copy of
binutils.
Create a separate script to generate osreldate.h rather than sourcing
newvers.sh into a temporary subshell with inline make rules.
Fixes PR 160646.
Allow the path to the system source directory to be passed in to
newvers.sh. Pass it in from include/Makefile. If it isn't passed in,
fall back to the old logic of using dirname $0. Fixes PR 174422.
dim [Sat, 12 Oct 2013 16:11:57 +0000 (16:11 +0000)]
MFC r255931:
Fix a bug in ld, where indirect symbols are not handled properly during
linking of a shared library, leading to corrupt indexes in the dynamic
symbol table. This should fix the multimedia/ffmpegthumbnailer port.
jhb [Thu, 10 Oct 2013 14:34:01 +0000 (14:34 +0000)]
MFC 253450:
Properly handle I/O windows in bridges with the ISA enable bit set. These
beasts still exist unfortunately. More details can be found in other
references, but the short version is that bridges with this bit set ignore
I/O port ranges that alias to valid ISA I/O port ranges. In the driver
this requires not allocating these alias regions from the parent device
(so they are free to be acquired by ISA devices), and ensuring no child
devices use resources from these alias regions.
bdrewery [Thu, 10 Oct 2013 12:46:26 +0000 (12:46 +0000)]
MFC r255944:
Use MK_SSP=no after including bsd.own.mk to disable SSP instead of user-knob
WITH[OUT]_SSP to avoid hitting an error if user has WITH_SSP in their
make.conf. Ports now use this knob.
make[7]: "/usr/src/share/mk/bsd.own.mk" line 466: WITH_SSP and
WITHOUT_SSP can't both be set.
Even though it doesn't really make sense in the context of a CONNECT
request, RFC 2616 14.23 mandates the presence of the Host: header in
all HTTP 1.1 requests.
PR: kern/181445
Submitted by: Kimo <kimor79@yahoo.com>
MFC after: 3 days
gjb [Wed, 9 Oct 2013 19:34:11 +0000 (19:34 +0000)]
MFC r228541, r256022:
r228541 (by pjd):
- Put one file into one line. This makes keeping local changes and
merging with FreeBSD easier for vendors.
- For optional files use variables starting with underscore
r256022:
- Do not install bluetooth rc(8) scripts if MK_BLUETOOTH = no.
mav [Wed, 9 Oct 2013 19:28:07 +0000 (19:28 +0000)]
MFC r255309:
Make SES driver adequately react on simple enclosure devices -- read Short
Enclosure status to enclosure status field, clear previous state and exit.
mav [Wed, 9 Oct 2013 19:22:01 +0000 (19:22 +0000)]
MFC r254058:
Remove droping topology mutex after iterating 100 periphs in CAMGETPASSTHRU.
That is not so slow and so often operation to handle unneeded otherwise
xsoftc.xpt_generation and respective locking complications.
mav [Wed, 9 Oct 2013 19:16:54 +0000 (19:16 +0000)]
MFC r253958:
Change CCB queue resize logic to be able safely handle overallocations:
- (re)allocate queue space in power of 2 chunks with 64 elements minimum
and never shrink it; with only 4/8 bytes per element size is insignificant.
- automatically reallocate the queue to double size if it is overflowed.
- if queue reallocation failed, store extra CCBs in unsorted TAILQ,
fetching them back as soon as some queue element is freed.
To free space in CCB for TAILQ linking, change highpowerq from keeping
high-power CCBs to keeping devices frozen due to high-power CCBs.
This encloses all pieces of queue resize logic inside of cam_queue.[ch],
removing some not obvious duties from xpt_release_ccb().
mav [Wed, 9 Oct 2013 18:58:28 +0000 (18:58 +0000)]
MFC r249466, r249481, r250025:
Remove multilevel freezing mechanism, implemented to handle specifics of
the ATA/SATA error recovery, when post-reset recovery commands should be
allocated when queues are already full of payload requests. Instead of
removing frozen CCBs with specified range of priorities from the queue
to provide free openings, use simple hack, allowing explicit CCBs over-
allocation for requests with priority higher (numerically lower) then
CAM_PRIORITY_OOB threshold.
Simplify CCB allocation logic by removing SIM-level allocation queue.
After that SIM-level queue manages only CCBs execution, while allocation
logic is localized within each single device.
mav [Wed, 9 Oct 2013 18:44:05 +0000 (18:44 +0000)]
MFC r249102 (by trasz):
Since the CTL version in FreeBSD does not support High Availability,
ctl_is_single should always be set to 1. Make it so. Previously
it was always 0, because ctl_isc_start() never got to run.
mav [Wed, 9 Oct 2013 18:29:06 +0000 (18:29 +0000)]
MFC r255363:
Micro-optimize cpu_search(), allowing compiler to use more efficient inline
ffsl() implementation, when it is available, instead of homegrown iteration.
On dual-E5645 amd64 system (2x6x2 cores) under heavy I/O load that reduces
time spent inside cpu_search() from 19% to 13%, while IOPS increased by 5%.
mav [Wed, 9 Oct 2013 18:14:28 +0000 (18:14 +0000)]
MFC r250395 (by attilio / jeff):
Generalize the bitset operations, present in cpuset and offer a KPI to
redefine such operations for different consumers.
This will be used when NUMA support will be finished and numaset
will need to be used.
dim [Sun, 6 Oct 2013 12:39:12 +0000 (12:39 +0000)]
MFC r256024:
Pull in r186338 from upstream llvm trunk:
Remove invalid assert in DAGTypeLegalizer::RemapValue
There is a comment at the top of DAGTypeLegalizer::PerformExpensiveChecks
which, in part, says:
// Note that these invariants may not hold momentarily when processing a node:
// the node being processed may be put in a map before being marked Processed.
Unfortunately, this assert would be valid only if the above-mentioned invariant
held unconditionally. This was causing llc to assert when, in fact,
everything was fine.
Thanks to Richard Sandiford for investigating this issue!
Fixes PR16562.
This fixes assertions which could occur in the multimedia/ffmpeg1 and
multimedia/ffmpeg2 ports.
kib [Sun, 6 Oct 2013 06:09:43 +0000 (06:09 +0000)]
MFC r255941:
Increase the chance of the buffer write from the bufdaemon helper
context to succeed. If the locked vnode which owns the buffer to be
written is shared locked, try the non-blocking upgrade of the lock to
exclusive.
dim [Fri, 4 Oct 2013 19:57:47 +0000 (19:57 +0000)]
MFC r255978:
Pull in r191711 from upstream llvm trunk:
The X86FixupLEAs pass for Intel Atom must not call
convertToThreeAddress on ADD16rr opcodes, if src1 != src, since that
would cause convertToThreeAddress to try to create a virtual register.
This is not permitted after register allocation, which is when the
X86FixupLEAs pass runs.
This patch fixes PR16785.
Pull in r191715 from upstream llvm trunk:
Forgot to add a break statement.
This should enable building the x11-toolskits/libXaw port with
CPUTYPE=atom.
trociny [Thu, 3 Oct 2013 18:52:04 +0000 (18:52 +0000)]
MFC r255714, r255716, r255717:
r255714:
Use cv_broadcast() instead of cv_signal() when waking up threads
waiting on an empty queue as the queue may have several consumers.
Before the fix the following scenario was possible: 2 threads are
waiting on empty queue, 2 threads are inserting simultaneously. The
first inserting thread detects that the queue is empty and is going to
send the signal, but before it sends the second thread inserts
too. When the first sends the signal only one of the waiting threads
receive it while the other one may wait forever.
The scenario above is is believed to be the cause of the observed
cases, when ggate_recv_thread() was getting stuck on taking free
request, while the free queue was not empty.
When updating the map of dirty extents, most recently used extents are
kept dirty to reduce the number of on-disk metadata updates. The
sequence of operations is:
1) acquire the activemap lock;
2) update in-memory map;
3) if the list of keepdirty extents is changed, update on-disk metadata;
4) release the lock.
On-disk updates are not frequent in comparison with in-memory updates,
while require much more time. So situations are possible when one
thread is updating on-disk metadata and another one is waiting for the
activemap lock just to update the in-memory map.
Improve this by introducing additional, on-disk map lock: when
in-memory map is updated and it is detected that the on-disk map needs
update too, the on-disk map lock is acquired and the on-memory lock is
released before flushing the map.
trociny [Thu, 3 Oct 2013 18:48:43 +0000 (18:48 +0000)]
MFC r255521, r255526, r255707:
r255521 (jmg):
add support for writing the pid of the daemon program to a pid file so
that daemon can be used w/ rc.subr and ports can use the additional
functionality, such as keeping the ldap daemon up and running, and have
the proper program to signal to exit..
PR: bin/181341
Submitted by: feld
r255526 (joel):
mdoc: remove EOL whitespace.
r255707:
1. Properly clean pid files in the case of the error.
2. Write the supervisor pid before the restart loop, so we don't
uselessly rewrite it after every child restart.
3. Remove duplicate ppfh and pfh initialization.
rene [Thu, 3 Oct 2013 12:28:51 +0000 (12:28 +0000)]
MFC r250198 (edwin, 2013-05-03):
On 30 April 2013 queen Beatrix resigned and crownprince Willem
Alexander became the new king. King's day is on 27 April.
MFC r255956 (rene, 2013-09-30):
Update the Dutch calendar entries:
- prince Johan Friso passed away in 2013
- correct status of queen Maxima and crown princess Catharina-Amalia
- language fixes
jhb [Wed, 2 Oct 2013 19:20:15 +0000 (19:20 +0000)]
MFC 233422,233680,233681,237619,239904,249373,252346,252379,252423:
Sync locking(9) with HEAD. The only change not merged is that 9 still
supports !MPSAFE filesystems.
pfg [Wed, 2 Oct 2013 19:18:00 +0000 (19:18 +0000)]
MFC r249426;
Merge change from illumos:
3519 DTrace fails to resolve const types from fbt
3520 dtrace internal error -- token type 316 is not a valid D
compilation token
3521 clean up dtrace unit tests