dim [Mon, 29 Oct 2012 21:11:37 +0000 (21:11 +0000)]
MFC r241909:
Allow building libc++ with any custom -std=xxx flag. Note that using
-std=gnu++98 will give a lot of warnings with clang, so please use
-std=c++0x or higher, or use NO_WERROR.
davide [Sat, 27 Oct 2012 23:30:46 +0000 (23:30 +0000)]
MFCr238925:
Until now KTR_ENTRIES, which defines the size of circular buffer used in
ktr(4), was constrained to be a power of two. Remove this constraint and
update sys/conf/NOTES accordingly.
eadler [Sat, 27 Oct 2012 01:20:48 +0000 (01:20 +0000)]
MFC r241848:
Check the return error of set[e][ug]id. While this can never fail in the
current version of FreeBSD, this isn't guarenteed by the API.
Custom security modules, or future implementations of the setuid and
setgid may fail.
obrien [Fri, 26 Oct 2012 18:06:49 +0000 (18:06 +0000)]
MFC: r240336:
Simply things so that "#REQUIRE: FILESYSTEMS" means the file
systems are fully "ready to go".
'FILESYSTEMS' states: "This is a dummy dependency, for services which
require file systems to be mounted before starting." However, we have
'var' which is was run after 'FILESYSTEMS' and can mount /var if it
already isn't mounted. Furthermore, several scripts cannot use /var
until 'cleanvar' has done its thing. Thus "FILESYSTEMS" hasn't really
meant all critical file systems are fully usable.
delphij [Fri, 26 Oct 2012 00:28:29 +0000 (00:28 +0000)]
MFC r240210:
It seems that what the code really meant is that when a write is completed,
do a BUS_DMASYNC_POSTWRITE over the DMA map. The way it currently is would
only do POSTREAD for read transactions.
gavin [Wed, 24 Oct 2012 19:22:43 +0000 (19:22 +0000)]
Merge r240680 from head:
Align the PCI Express #defines with the style used for the PCI-X
#defines. This has the advantage that it makes the names more
compact, and also allows us to correct the non-uniform naming of
the PCIM_LINK_* defines, making them all consistent amongst themselves.
This is a mostly mechanical rename:
s/PCIR_EXPRESS_/PCIER_/g
s/PCIM_EXP_/PCIEM_/g
s/PCIM_LINK_/PCIEM_LINK_/g
In this MFC, #defines have been added for the old names to assist
out-of-tree drivers.
gavin [Wed, 24 Oct 2012 19:04:17 +0000 (19:04 +0000)]
Merge r240680 from head:
Align the PCI Express #defines with the style used for the PCI-X
#defines. This has the advantage that it makes the names more
compact, and also allows us to correct the non-uniform naming of
the PCIM_LINK_* defines, making them all consistent amongst themselves.
This is a mostly mechanical rename:
s/PCIR_EXPRESS_/PCIER_/g
s/PCIM_EXP_/PCIEM_/g
s/PCIM_LINK_/PCIEM_LINK_/g
In this MFC, #defines have been added for the old names to assist
out-of-tree drivers.
glebius [Wed, 24 Oct 2012 10:32:39 +0000 (10:32 +0000)]
Merge r240385 from head:
Describe in detail required conditions for receiving the SCM_CREDS
control message and suggest to use LOCAL_CREDS setsockopt() for
reliability.
glebius [Wed, 24 Oct 2012 10:28:12 +0000 (10:28 +0000)]
Merge r240234, r240271, r240734 from head:
r240234:
The first part of check_priv() function, that attempts to obtain creds
from the control message, actually never worked. This means check_priv()
didn't work for local dgram sockets.
The SCM_CREDS control messages is received only in two cases:
1) If we did setsockopt(LOCAL_CREDS) on our socket, and in this case
the message is struct sockcred.
2) If sender did supplied SCM_CREDS control message in his sendmsg()
syscall. In this case the message is struct cmsgcred.
We can't rely on 2), so we will use 1) for dgram sockets. For stream
sockets it is more reliable to obtain accept-time credentials, since
SCM_CREDS control message is attached only on first read. Thus:
o Do setsockopt(LOCAL_CREDS) on local dgram sockets.
o Split check_priv() into check_priv_stream() and check_priv_dgram(),
and call them from recv_stream() and recv_dgram() respectively.
o Don't provide space for SCM_CREDS control message in recv_stream().
o Provide space for SCM_CREDS control message in recv_dgram(), but there
is no need to initialize anything in it.
o In recv_dgram() do not blindly expect that first message is SCM_CREDS,
instead use correct search cycle through control messages.
r240271:
For UDP transport set IP_RECVDSTADDR sockopt on the socket, and provide
IP_SENDSRCADDR control with datagram message we reply with. This makes
bsnmpd reply from exactly same address that request was sent to, thus
successfully bypassing stateful firewalls or other kinds of strict checking.
r240734:
Re-do r240271:
- Set IP_RECVDSTADDR sockopt on the socket only in case if
it is INADDR_ANY bound.
- Supply IP_SENDSRCADDR control message only if we did receive
IP_RECVDSTADDR control message.
This fixes operation of snmpd bound to a specific local IP address.
glebius [Wed, 24 Oct 2012 09:53:34 +0000 (09:53 +0000)]
Merge 240073 from head:
Provide a sysctl switch that allows to install ARP entries
with multicast bit set. FreeBSD refuses to install such
entries since 9.0, and this broke installations running
Microsoft NLB, which are violating standards.
mav [Tue, 23 Oct 2012 15:37:57 +0000 (15:37 +0000)]
MFC r241536:
Add explicit check for not set time inside cam_periph_freeze_after_event().
System time is set later on boot process then initial bus scan by CAM.
Until that moment microtime() is equal to microuptime(), and if system
boots quickly, the value can be close to zero. That causes settle time
waiting even for buses that don't use reset during probe.
On my test system this reduces boot time by 1 second if USB enabled, or
by 4 seconds if USB disabled. CAM waited for ctl2cam0 bus "settle".
mav [Tue, 23 Oct 2012 15:36:23 +0000 (15:36 +0000)]
MFC r241510:
Don't exclude XPT SIM from locking in xpt_create_path_unlocked().
We don't want xpt periph, device, target or bus disappeared because of
incorrect reference counting.
mav [Tue, 23 Oct 2012 15:31:50 +0000 (15:31 +0000)]
MFC r241504:
Fix XPT_DEBUG paths operations locking:
- Extend the lock to cover xpt_path_release() for the new path.
- While xpt_action() is called while holding right SIM lock for the new
bus, the old path release may require different SIM lock. So we have
to temporary drop the new lock and get the old one.
mav [Tue, 23 Oct 2012 15:25:19 +0000 (15:25 +0000)]
MFC r241456:
Use separate malloc buckets for CAM devices, CCBs and paths. This will
make it easier to track down the source of any use after free problems.
mav [Tue, 23 Oct 2012 15:20:59 +0000 (15:20 +0000)]
MFC r241410:
There are SCSI conditions that are not an errors. In those cases cderror()
returns zero while request status is not CAM_REQ_CMP. That could cause
partial device attach or other unexpected results.
mav [Tue, 23 Oct 2012 15:18:16 +0000 (15:18 +0000)]
MFC r241405:
Really handle xpt_compile_path() error in xpt_bus_register() instead of
print error message and probably crash just after it on NULL dereference.
mav [Tue, 23 Oct 2012 15:16:50 +0000 (15:16 +0000)]
MFC r241404:
Remove 'periph == NULL' check from bunch of periph drivers.
This condition can never be true as functions are called from single place
and the checks just pollute the code and confuse Clang Static Analyzer.
mav [Tue, 23 Oct 2012 15:15:16 +0000 (15:15 +0000)]
MFC r241028:
Change queue overflow checks from DIAGNOSTIC+panic() to KASSERT() to make
them enabled on HEAD by default. It is probably better to do single compare
then hunt for unexpected memory corruption.
jhb [Tue, 23 Oct 2012 12:37:02 +0000 (12:37 +0000)]
MFC 228157:
- Fix segmentation fault when running "+command" when run with -jX -n due
to Compat_RunCommand() being called with `cmd' that is not on the
node->commands list
- Make ellipsis ("..." command) handling consistent: check for "..." command
in job make after variables expansion to match compat make behavior
- Fix empty command handling (after variables expansion and @+- modifiers
are processed): now empty commands are ignored in compat make and are not
printed in job make case
marius [Mon, 22 Oct 2012 11:07:59 +0000 (11:07 +0000)]
MFC: r241734
Let SCHED_ULE give affinity to the CPU the tick interrupt triggered on
when running tick_process(), similarly to what the x86 equivalents of
this function do, however employing the less racy sequence also used in
intr_event_handle().
marius [Sun, 21 Oct 2012 11:43:43 +0000 (11:43 +0000)]
MFC: r241679
It turns out that as documented, PCF8563_R_SECOND_VL (i.e. battery low)
doesn't automatically clear when VDD rises above Vlow again and needs to be
cleared manually. However, apparently this needs all of the time registers
to be set, i.e. pcf8563_settime(), and not just PCF8563_R_SECOND in order
for PCF8563_R_SECOND_VL to stick. Thus, we just issue a warning during
pcf8563_attach() rather than failing with ENXIO in case it is set.