]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agocrunchide: remove EOL whitespace
emaste [Tue, 12 May 2015 20:04:17 +0000 (20:04 +0000)]
crunchide: remove EOL whitespace

9 years agoRemove redundant csu subdir logic
emaste [Tue, 12 May 2015 17:53:22 +0000 (17:53 +0000)]
Remove redundant csu subdir logic

The appropriate subdirectories are handled by lib/csu/Makefile. There's
no need to duplicate this logic in Makefile.inc1 and lib/Makefile.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2523

9 years agoDo not check sequence number for QoS Null frames; set it for generated QoS Null
adrian [Tue, 12 May 2015 16:55:50 +0000 (16:55 +0000)]
Do not check sequence number for QoS Null frames; set it for generated QoS Null
frames to 0

From IEEE Std. 802.11-2012, 8.3.2.1 "Data frame format", p. 415 (513):
"The Sequence Control field for QoS (+)Null frames is ignored by the receiver
upon reception."

At this moment, any <mode>_input() function interprets them as regular QoS data
frames with TID = 0. As a result, stations, that use another TX sequence for
QoS Null frames (e.g. wpi(4), where (QoS) Null frames are generated by the
firmware), may experience significant packet loss with any other NIC in hostap
mode.

Tested:

* wpi(4) (author)
* iwn(4) - Intel 5100, STA mode (me)

PR: kern/200128
Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoApply proper locking when iterating the multicast addresses and add a
hselasky [Tue, 12 May 2015 11:52:34 +0000 (11:52 +0000)]
Apply proper locking when iterating the multicast addresses and add a
missing check for NULL from a non-blocking "kzalloc()" function call.

MFC after: 1 week
Sponsored by: Mellanox Technologies
Found by: glebius @

9 years agoTeach bits of libc about Thumb. This adds the if-then instructions needed
andrew [Tue, 12 May 2015 10:03:14 +0000 (10:03 +0000)]
Teach bits of libc about Thumb. This adds the if-then instructions needed
to handle the ARM conditional execution.

While here fix a bug found by this in the hard-float code, cc is the
opposite of cs. The former is used for 'less than' in floating-point code
and is executed when the C (carry) bit is clear, the latter is used when
greater than, equal, or unordered, and is executed when the C bit is set.

9 years agoDisable WPI in case of aml8726-m3.
ganbold [Tue, 12 May 2015 08:53:54 +0000 (08:53 +0000)]
Disable WPI in case of aml8726-m3.
The aml8726-m3 SoC is identified as a Cortex A9-r2 rev 4 CPU and
it hangs sometimes during the boot when WFI is used by the kernel.

Differential Revision:   https://reviews.freebsd.org/D2473
Submitted by:   John Wehle
Suggested by:   ian@

9 years agoEnsure that the COOKIE-ACK can be sent over UDP if the COOKIE-ECHO was
tuexen [Tue, 12 May 2015 08:08:16 +0000 (08:08 +0000)]
Ensure that the COOKIE-ACK can be sent over UDP if the COOKIE-ECHO was
received over UDP.
Thanks to Felix Weinrank for makeing me aware of the problem and to
Irene Ruengeler for providing the fix.

MFC after: 1 week

9 years agoAdd new socket ioctls SIOC[SG]TUNFIB to set FIB number of encapsulated
ae [Tue, 12 May 2015 07:37:27 +0000 (07:37 +0000)]
Add new socket ioctls SIOC[SG]TUNFIB to set FIB number of encapsulated
packets on tunnel interfaces. Add support of these ioctls to gre(4),
gif(4) and me(4) interfaces. For incoming packets M_SETFIB() should use
if_fib value from ifnet structure, use proper value in gre(4) and me(4).

Differential Revision: https://reviews.freebsd.org/D2462
No objection from: #network
MFC after: 2 weeks
Sponsored by: Yandex LLC

9 years agoRevert r282775 for now. The added dependency would cause problems for
delphij [Tue, 12 May 2015 05:42:13 +0000 (05:42 +0000)]
Revert r282775 for now.  The added dependency would cause problems for
e.g. ports-mgmt/pkg and we would like to do an exp-build.

Requested by: bdrewery

9 years agoFix a panic when VIMAGE is enabled.
hrs [Tue, 12 May 2015 03:35:45 +0000 (03:35 +0000)]
Fix a panic when VIMAGE is enabled.

Spotted by: Nikos Vassiliadis

9 years ago- Remove ND6_IFF_IGNORELOOP. This functionality was useless in practice
hrs [Tue, 12 May 2015 03:31:57 +0000 (03:31 +0000)]
- Remove ND6_IFF_IGNORELOOP.  This functionality was useless in practice
  because a link where looped back NS messages are permanently observed
  does not work with either NDP or ARP for IPv4.

- draft-ietf-6man-enhanced-dad is now RFC 7527.

Discussed with: hiren
MFC after: 3 days

9 years agoAvoid polluting the filesystem when not necessary.
gjb [Tue, 12 May 2015 01:27:58 +0000 (01:27 +0000)]
Avoid polluting the filesystem when not necessary.

Sponsored by: The FreeBSD Foundation

9 years agoAfter the last influx of commits, and a REALLY BIG WARNING
gjb [Tue, 12 May 2015 01:20:27 +0000 (01:20 +0000)]
After the last influx of commits, and a REALLY BIG WARNING
to the top of the file.

Sponsored by: The FreeBSD Foundation

9 years agoFix more paths to the actual files.
gjb [Tue, 12 May 2015 01:14:21 +0000 (01:14 +0000)]
Fix more paths to the actual files.

Sponsored by: The FreeBSD Foundation

9 years agoFix more path variables.
gjb [Tue, 12 May 2015 01:04:02 +0000 (01:04 +0000)]
Fix more path variables.

Sponsored by: The FreeBSD Foundation

9 years agoProvide the correct path to the checksum file.
gjb [Tue, 12 May 2015 00:58:17 +0000 (00:58 +0000)]
Provide the correct path to the checksum file.

Sponsored by: The FreeBSD Foundation

9 years agoAlso symlink the CHECKSUM.{SHA256,MD5} files.
gjb [Tue, 12 May 2015 00:55:28 +0000 (00:55 +0000)]
Also symlink the CHECKSUM.{SHA256,MD5} files.

Sponsored by: The FreeBSD Foundation

9 years agoAlso copy CHECKSUM.{SHA256,MD5} files.
gjb [Tue, 12 May 2015 00:46:32 +0000 (00:46 +0000)]
Also copy CHECKSUM.{SHA256,MD5} files.

Sponsored by: The FreeBSD Foundation

9 years agoFix a few incorrect variables and/or hard-coded paths.
gjb [Tue, 12 May 2015 00:39:01 +0000 (00:39 +0000)]
Fix a few incorrect variables and/or hard-coded paths.

Sponsored by: The FreeBSD Foundation

9 years agoSigh. Fix more syntax errors introduced by the last commit.
gjb [Tue, 12 May 2015 00:33:18 +0000 (00:33 +0000)]
Sigh.  Fix more syntax errors introduced by the last commit.

Sponsored by: The FreeBSD Foundation

9 years agoFix a make(1) syntax error.
gjb [Tue, 12 May 2015 00:32:28 +0000 (00:32 +0000)]
Fix a make(1) syntax error.

Sponsored by: The FreeBSD Foundation

9 years agoTemporarily 'rm -rf $FTPDIR' during additional testing.
gjb [Tue, 12 May 2015 00:30:56 +0000 (00:30 +0000)]
Temporarily 'rm -rf $FTPDIR' during additional testing.

Sponsored by: The FreeBSD Foundation

9 years agoAllow configuration of the sector size advertised to the guest.
neel [Tue, 12 May 2015 00:30:39 +0000 (00:30 +0000)]
Allow configuration of the sector size advertised to the guest.

The default behavior is to infer the logical and physical sector sizes from
the block device backend. However older versions of Windows only work with
specific logical/physical combinations:
- Vista and Windows 7: 512/512
- Windows 7 SP1: 512/512 or 512/4096

For this reason allow the sector size to be specified using the following
block device option: sectorsize=logical[/physical]

Reported by: Leon Dang (ldang@nahannisys.com)
Reviewed by: grehan
MFC after: 2 weeks

9 years agoAlways use the 'make install' directory as the source for images.
gjb [Tue, 12 May 2015 00:27:52 +0000 (00:27 +0000)]
Always use the 'make install' directory as the source for images.
For RE purposes, we use the default (/R within the chroot), so
this helps avoid copying files multiple times and xz(1)-compressing
additional times when not needed.

Again, this Makefile is not for general consumption.

Sponsored by: The FreeBSD Foundation

9 years agoAdd a new file, Makefile.mirrors, which is intended to replace
gjb [Mon, 11 May 2015 22:14:03 +0000 (22:14 +0000)]
Add a new file, Makefile.mirrors, which is intended to replace
a 474-line kludge of a shell script to pre-create the directory
hierarchy on ftp-master.

This is not in any way connected to the build, and there is no
intention to do so.  This only intent here is to try to make
things a little bit easier for me.  But I've probably just made
things worse.

Sponsored by: The FreeBSD Foundation

9 years agoHandling indirect descriptors is a capability of the host and
grehan [Mon, 11 May 2015 21:24:10 +0000 (21:24 +0000)]
Handling indirect descriptors is a capability of the host and
not one that needs to be negotiated. Use the host capabilities
field and not the negotiated field when verifying that indirect
descriptors are supported.

Found with the Redhat Windows viostor driver, which clears
the indirect capability in the negotiated caps and then starts
using them.

Reported and tested by: Leon Dang (ldang@nahannisys.com)
MFC after:   2 weeks

9 years agoAdd a PCI bridge for the Freescale PCIe Root Complex
jhibbits [Mon, 11 May 2015 20:58:05 +0000 (20:58 +0000)]
Add a PCI bridge for the Freescale PCIe Root Complex

Summary:
The Freescale PCIe Root Complex shows up as a Processor class device, PowerPC
subclass, so the generic PCI code ignores it for a bridge.  This adds support
for it.

As part of this, update the Freescale PCI hostbridge driver, to allow probing
beyond the root complex, instead of only allowing "proper" PCI-PCI bridges.

Reviewers: #powerpc, marcel, nwhitehorn

Reviewed By: nwhitehorn

Subscribers: imp

Differential Revision: https://reviews.freebsd.org/D2442

Relnotes: yes

9 years agoUse the GOT_* macros to help simplify the code, these work with both pic
andrew [Mon, 11 May 2015 20:33:46 +0000 (20:33 +0000)]
Use the GOT_* macros to help simplify the code, these work with both pic
and non-pic code, and to build for Thumb.

9 years agoRetire pmap_lazyfix(). This function only existed in the new armv6 pmap
alc [Mon, 11 May 2015 19:55:01 +0000 (19:55 +0000)]
Retire pmap_lazyfix().  This function only existed in the new armv6 pmap
because the i386 pmap on which the new armv6 pmap is based had it, and in
r281707 pmap_lazyfix() was removed from the i386 pmap.

Discussed with: kib
Submitted by: Michal Meloun (via Svatopluk Kraus)

9 years agoAdd the kernel support for Thumb-2. It is only supported on ARMv7 as the
andrew [Mon, 11 May 2015 19:20:30 +0000 (19:20 +0000)]
Add the kernel support for Thumb-2. It is only supported on ARMv7 as the
main ARMv6 target, the Raspberry Pi, doesn't support Thumb-2.

This as been tested with a Thumb-2 userland, however building one is
currently unsupported as there are known toolchain issues breaking some
binaries. Further work will also be needed to decide on the method of
selecting which instruction set to build for, and to benchmark both to
find how building everything as Thumb-2 will affect performance.

Relnotes: yes

9 years agoMark thumb entry points as such when building for thumb, otherwise mark
andrew [Mon, 11 May 2015 19:04:32 +0000 (19:04 +0000)]
Mark thumb entry points as such when building for thumb, otherwise mark
them as arm.

9 years agoUse the Thumb compliant version of the add instruction. We can only use
andrew [Mon, 11 May 2015 19:00:02 +0000 (19:00 +0000)]
Use the Thumb compliant version of the add instruction. We can only use
"add Rd, Rn, Rm" from within an IT (if-then) block.

9 years agoList both registers to use in the 64-bit atomic instructions. We will need
andrew [Mon, 11 May 2015 18:52:06 +0000 (18:52 +0000)]
List both registers to use in the 64-bit atomic instructions. We will need
these to build for Thumb-2.

9 years agoRevert r281372, it's no longer needed after r282726 (fix for PR 199119) as the
delphij [Mon, 11 May 2015 17:49:07 +0000 (17:49 +0000)]
Revert r281372, it's no longer needed after r282726 (fix for PR 199119) as the
symbol conflict between libmd and libcrypto have been solved.

9 years agoUnbreak MIPS build following rev. 282726
thomas [Mon, 11 May 2015 16:45:33 +0000 (16:45 +0000)]
Unbreak MIPS build following rev. 282726

Introduce further adjustments to the renaming of libmd
symbols: make sure that we do not generate dangling weak
aliases, as this causes build failures on MIPS.

Tested by: sbruno

9 years agoAdd the ofw_bus_subr.h change missed in r282770.
andrew [Mon, 11 May 2015 15:47:55 +0000 (15:47 +0000)]
Add the ofw_bus_subr.h change missed in r282770.

9 years agoFix virtual machine disk format creating by passing VMFORMAT
gjb [Mon, 11 May 2015 14:53:07 +0000 (14:53 +0000)]
Fix virtual machine disk format creating by passing VMFORMAT
to mkimg(1)

PR: 200068
Submitted by: Jeremy Norris
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

9 years agoHide code only used on i386 and amd64.
andrew [Mon, 11 May 2015 14:36:34 +0000 (14:36 +0000)]
Hide code only used on i386 and amd64.

9 years agoAdd ofw_bus_find_compatible to find a compatible ofw node. This will be
andrew [Mon, 11 May 2015 14:10:54 +0000 (14:10 +0000)]
Add ofw_bus_find_compatible to find a compatible ofw node. This will be
used on ARM to help find the correct node to use to start secondary CPUs
as this happens before device enumeration.

9 years agocpu-v6.h should only be used in the kernel, add an error to enforce this.
andrew [Mon, 11 May 2015 12:44:02 +0000 (12:44 +0000)]
cpu-v6.h should only be used in the kernel, add an error to enforce this.

9 years agozfs ioctls: use fget_write / fget_read instead of getf wrapper for fget
avg [Mon, 11 May 2015 10:07:31 +0000 (10:07 +0000)]
zfs ioctls: use fget_write / fget_read instead of getf wrapper for fget

This allows to ensure that we do not write to a file that was opened
for reading only or vice versa.

Also, use the correct capability in in zfs_ioc_send_new().

Differential Revision: https://reviews.freebsd.org/D2382
Reviewed by: delphij
MFC after: 17 days
Sponsored by: ClusterHQ

9 years agoMove to use __ARM_ARCH in more places in the kernel.
andrew [Mon, 11 May 2015 08:57:23 +0000 (08:57 +0000)]
Move to use __ARM_ARCH in more places in the kernel.

9 years agoUse the ACLE spelling of _ARM_ARCH_6: "__ARM_ARCH >= 6"
andrew [Mon, 11 May 2015 08:51:24 +0000 (08:51 +0000)]
Use the ACLE spelling of _ARM_ARCH_6: "__ARM_ARCH >= 6"

9 years agoUse MIN from sys/param.h instead of handrolling the macro
ngie [Mon, 11 May 2015 04:54:56 +0000 (04:54 +0000)]
Use MIN from sys/param.h instead of handrolling the macro

Replace sys/types.h with sys/param.h per-style(9)

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

9 years agoRevert r282672.
delphij [Mon, 11 May 2015 00:16:32 +0000 (00:16 +0000)]
Revert r282672.

tr is in /usr and not available at the time hostid is run (must be run
before FILESYSTEMS).

Reported by: def

9 years agoRemove some commented-out upstream code for handling traps from usermode
markj [Sun, 10 May 2015 22:27:48 +0000 (22:27 +0000)]
Remove some commented-out upstream code for handling traps from usermode
DTrace probes. This handling is already done in trap() on i386 and amd64.

9 years agomsecs_to_jiffies() is implemented using tvtohz(9), which always returns a
markj [Sun, 10 May 2015 22:21:00 +0000 (22:21 +0000)]
msecs_to_jiffies() is implemented using tvtohz(9), which always returns a
positive value since it adds the current tick to its result. This differs
from the behaviour in Linux, whose implementation does not add the extra
tick, so subtract the extra tick in the OFED compat layer implementation.
This addresses some incorrect handling of IB MAD timeouts, since some IB
code depends on msecs_to_jiffies(0) returning 0.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

9 years agoPrepare for supporting driver-overridden curchan when submitting scan
adrian [Sun, 10 May 2015 22:07:53 +0000 (22:07 +0000)]
Prepare for supporting driver-overridden curchan when submitting scan
results.

Right now the scan infrastructure assumes the channel is under net80211
control, and that when receiving beacon frames for scanning, the
current channel is indeed what ic_curchan is set to.

But firmware NICs with firmware scan support need more than this -
they can do background scans whilst hiding the off-channel behaviour
from net80211.  Ie, net80211 still thinks everything is associated
and on the main channel, but it's getting scan results from all the
background traffic.

However sta_add() pays attention to ic_curchan and discards scan
results that aren't on the right channel.  CCK beacon frames can be
decoded from adjacent channels so the receive path and sta_add
discard these as appropriate.  This is fine for software scanning
like for ath(4), but not for firmware NICs.  So with those, the
whole concept of background firmware scanning won't work without
major hacks (eg, overriding ic_curchan before calling the beacon
input / scan add.)

As part of my scan overhaul, modify sta_add() and the scan_add()
APIs to take an explicit current channel.  The normal RX path
will set it to ic_curchan so it's a no-op.  However, drivers may
decide to (eventually!) override the scan method to set the
"right" current channel based on what the firmware reports the
scan state is.

So for example, iwn, rsu and other NICs will eventually do this:

* driver issues scan start firmware command;
* firmware sends a "scan start on channel X" notify;
* firmware sends a bunch of beacon RX's as part of
  the scan results;
* .. and the driver will replace scan_add() curchan with channel X,
  so scan results are correct.
* firmware sends a "scan start on channel Y" notify;
* firmware sends more beacons...
* .. the driver replaces scan_add() curchan with channel Y.

Note:

* Eventually, net80211 should eventually grow the idea of a per-packet
  current channel.  It's possible in various modes (eg WAVE, P2P, etc)
  that individual frames can come in from different channels and that
  is under firmware control rather than driver/net80211 control, so
  we should support that.

9 years agofind_next_bit() and find_next_zero_bit(): if the caller-specified offset
markj [Sun, 10 May 2015 22:04:42 +0000 (22:04 +0000)]
find_next_bit() and find_next_zero_bit(): if the caller-specified offset
lies within the last block of the bit set and no bits are set beyond the
offset, terminate the search immediately instead of continuing as though
there are further blocks in the set and subsequently returning an incorrect
result.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

9 years agoMerge bmake-20150505 improve detection of malformed conditionals.
sjg [Sun, 10 May 2015 22:03:59 +0000 (22:03 +0000)]
Merge bmake-20150505 improve detection of malformed conditionals.

9 years agoctf_add_type(): when looking up an integer or floating point type in the
markj [Sun, 10 May 2015 21:39:24 +0000 (21:39 +0000)]
ctf_add_type(): when looking up an integer or floating point type in the
list of pending dynamic type definitions, a match on the type name is not
sufficient - we need to compare the type encodings as well. For example,
bitfields have their own distinct type definitions which share the name of
the underlying integer type, and these types aren't generally
interchangeable.

This bug was causing the following libdtrace error when attempting to trace
the th_flags member of a struct tcphdr:
  cg: bad field: off 104 type <32877> bits 539620016

Reported by: rwatson
MFC after: 3 weeks

9 years agoUnbreak build following rev. 282726
thomas [Sun, 10 May 2015 21:21:52 +0000 (21:21 +0000)]
Unbreak build following rev. 282726

(Makefile.inc1): add dependency of xinstall on libmd to
avoid failure of parallel bootstrap.

(lib/libmd/*.h): do not redefine symbols if already
defined as macros (libcrypt uses the same sources internally,
redefining symbols with a prefix of its own).

Fixes build failures caused by previous change to libmd.

Reported by: ian
Pointy hat to: thomas

9 years agoFix typo introduced in previous commit.
adrian [Sun, 10 May 2015 21:05:32 +0000 (21:05 +0000)]
Fix typo introduced in previous commit.

PR: kern/199632
Submitted by: Andriy Voskoboinyk <s3erios@gmail.com>

9 years agosynaptics: more support for semi-MT trackpads.
rpaulo [Sun, 10 May 2015 20:36:57 +0000 (20:36 +0000)]
synaptics: more support for semi-MT trackpads.

Several improvements to the Synaptics driver to support
semi-multitouch trackpads and some other fixes:

- Two finger scrolling support for "semi-MT" touchpads. Those include
many of the older Synaptics touchpads before "true" multitouch support
(indicated by capMultiFinger). Semi-MT touchpads can report a second
finger position, but the X or Y coordinate may be swapped with some
coordinate of the first finger. This is a result of how the hardware
works internally. Therefore, all that can be reliably extracted is the
bounding box of the two finger positions. Semi-MT touchpads can be
recognized by the capAdvancedGestures capability bit. After setting the
mode byte, advanced gestures mode has to be enabled. Then, data packets
compatible with the capMultiFinger format are sent, so the same two
finger scrolling code can be leveraged. Enabling advanced gestures mode
on true multitouch touchpads should be harmless. Linux seems to always
enable advanced gestures mode.

- Put mode setting logic into own functions synaptics_preferred_mode()
and synaptics_set_mode() to have this in one place.
synaptics_passthrough_on() and synaptics_passthrough_off() currently
always use 0xc1 as the mode byte, which may be wrong for touchpads that
don't have capExtended.

- Expose X and Y resolution of touchpad to userland. Also expose minimum
and maximum X and Y coordinates. This is useful for programs in
userspace that read raw PSM packets (with PSM_LEVEL_NATIVE enabled) and
need to interpret the coordinates.

- Also send "extended w mode" packets (see section 3.2.9 of
511-000275-01_RevB.pdf) to userspace if PSM_LEVEL_NATIVE is enabled.
This is useful for userspace programs/drivers such as
xf86-input-synaptics that can handle these packets.

- Fix parsing of nExtendedQueries, and request extended/continued
capability bits depending on this value.

- capReportsMax, capClearPad, capAdvancedGestures and capCoveredPad must
be extracted from status[0] and not status[2], I think.

Submitted by: Jan Kokemüller jan.kokemueller at gmail.com

9 years agoTag bmake-20150505
sjg [Sun, 10 May 2015 20:02:26 +0000 (20:02 +0000)]
Tag bmake-20150505

9 years agoImport bmake-20150505 detect typo's in .if variable references.
sjg [Sun, 10 May 2015 20:01:54 +0000 (20:01 +0000)]
Import bmake-20150505 detect typo's in .if variable references.

9 years agoCreate a relocatable instance of ubldr for ARM. The original ubldr,
ian [Sun, 10 May 2015 19:14:28 +0000 (19:14 +0000)]
Create a relocatable instance of ubldr for ARM.  The original ubldr,
static-linked to run at a fixed position, is still installed to maintain
compatibility with existing configurations.  The makefile now also creates
and installs ubldr.bin, a stripped binary (no elf headers) with an entry
point offset of 0 that can be loaded by u-boot at any address and launched
with "go ${loadaddr}".

To use ubldr.bin, U-Boot must still be built with the CONFIG_API option,
but no longer needs the CONFIG_ELF option.

9 years agoEnsure the result from signed subtraction under modulus does not
hselasky [Sun, 10 May 2015 17:11:04 +0000 (17:11 +0000)]
Ensure the result from signed subtraction under modulus does not
become negative.

Submitted by: Oliver Pinter <oliver.pinter@hardenedbsd.org>
MFC after: 3 days

9 years agorecv(),send(): Directly call interposing entry instead of going through PLT.
jilles [Sun, 10 May 2015 14:50:50 +0000 (14:50 +0000)]
recv(),send(): Directly call interposing entry instead of going through PLT.

recv() and send()'s calls to recvfrom() and sendto() are much like
waitpid()'s call to wait4(), and likewise need not allow PLT interposing on
the called function.

9 years agoDon't check the return value from self_reloc(), it can't fail and doesn't
ian [Sun, 10 May 2015 13:30:21 +0000 (13:30 +0000)]
Don't check the return value from self_reloc(), it can't fail and doesn't
return a value.

Despite what I said in my prior commit, it turns out this one platform
was checking the return value from the old self-reloc code (which returned
a hard-coded 0).

9 years agoThe self-relocation code is not efi-specific, move it to boot/common.
ian [Sun, 10 May 2015 13:24:26 +0000 (13:24 +0000)]
The self-relocation code is not efi-specific, move it to boot/common.

The function was defined as taking 4 parameters and returning EFI_STATUS,
but all existing callers (in asm code) passed only two parameters and don't
use the return value. The function signature now matches that usage, and
doesn't refer to efi-specific types.

Parameters and variables now use the cannonical typenames set up by elf.h
(Elf_Word, Elf_Addr, etc) instead of raw C types. Hopefully this will
prevent suprises as new platforms come along and use this code.

The function was renamed from _reloc() to self_reloc() to emphasize its
difference from the other elf relocation code found in boot/common.

Differential Revision: https://reviews.freebsd.org/D2490

9 years agoEnsure libmd symbols do not clash with libcrypto
thomas [Sun, 10 May 2015 13:21:36 +0000 (13:21 +0000)]
Ensure libmd symbols do not clash with libcrypto

Add a prefix to all symbols in libmd to avoid incompatibilites
with same-named, but not binary compatible, symbols from libcrypto.

Also introduce Weak aliases to avoid the need to rebuild dependent
binaries and a major version bump.

PR: 199119
Differential Revision: D2216
Reviewed by: roberto, delphij
MFC after: 2 weeks

9 years agoPut recycle pointer in own memory area which is not mmap'able.
hselasky [Sun, 10 May 2015 12:45:21 +0000 (12:45 +0000)]
Put recycle pointer in own memory area which is not mmap'able.

9 years agoUse the new gic option on all configs that need it.
andrew [Sun, 10 May 2015 12:13:27 +0000 (12:13 +0000)]
Use the new gic option on all configs that need it.

9 years agoFor half and reverse line feeds, recognize both SUSv2-style escape-digit
bapt [Sun, 10 May 2015 11:41:38 +0000 (11:41 +0000)]
For half and reverse line feeds, recognize both SUSv2-style escape-digit
and BSD-style escape-control-char sequences in the input stream.

Submitted by: schwarze at OpenBSD
Discussed with: schwarze at OpenBSD
Obtained from: OpenBSD

9 years agoRemove extendline definition
bapt [Sun, 10 May 2015 11:24:16 +0000 (11:24 +0000)]
Remove extendline definition
Remove now unused PWBUFSZ define

9 years agoUse calloc(3) instead of malloc(3) + memset(3)
bapt [Sun, 10 May 2015 11:18:01 +0000 (11:18 +0000)]
Use calloc(3) instead of malloc(3) + memset(3)
While here check the return of calloc(3)

9 years agoThe initial logic for allocating the new string was wrong, the conversion
bapt [Sun, 10 May 2015 10:15:36 +0000 (10:15 +0000)]
The initial logic for allocating the new string was wrong, the conversion
to strndup(3) duplicated the same mistake, actually strdup(3) is good enough
to allocate the new string.

9 years agoUse strndup(3) instead of malloc(3) + memcpy(3)
bapt [Sun, 10 May 2015 10:02:09 +0000 (10:02 +0000)]
Use strndup(3) instead of malloc(3) + memcpy(3)
Check the return of strndup

9 years agoUse the new gic option. While here remove extra whitespace from the ned of
andrew [Sun, 10 May 2015 09:37:54 +0000 (09:37 +0000)]
Use the new gic option. While here remove extra whitespace from the ned of
a few lines.

9 years agoRemove useless call to extendarray
bapt [Sun, 10 May 2015 09:33:15 +0000 (09:33 +0000)]
Remove useless call to extendarray

9 years agoAdd the gic to files.arm under "device gic" and use it with the
andrew [Sun, 10 May 2015 09:33:03 +0000 (09:33 +0000)]
Add the gic to files.arm under "device gic" and use it with the
CUBIEBOARD2 config. This is common across a few SoCs so should be a common
option.

9 years agoFirst pass clenup over the Marvell db-88f6xxx kernel configs.
andrew [Sun, 10 May 2015 09:23:49 +0000 (09:23 +0000)]
First pass clenup over the Marvell db-88f6xxx kernel configs.

9 years agoThe pwdb function is only used once to check the database rename it
bapt [Sun, 10 May 2015 09:23:03 +0000 (09:23 +0000)]
The pwdb function is only used once to check the database rename it
pwdb_check and simplify it accordingly

9 years agoif the check of the pw db fails return the failed value
bapt [Sun, 10 May 2015 09:11:12 +0000 (09:11 +0000)]
if the check of the pw db fails return the failed value

9 years agoInitialize pcids array for the proc0 pmap.
kib [Sun, 10 May 2015 09:09:07 +0000 (09:09 +0000)]
Initialize pcids array for the proc0 pmap.

Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

9 years agoTweak assert to also print the thread address.
kib [Sun, 10 May 2015 09:05:57 +0000 (09:05 +0000)]
Tweak assert to also print the thread address.

Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

9 years agoSome style(9) fixes
bapt [Sun, 10 May 2015 09:02:15 +0000 (09:02 +0000)]
Some style(9) fixes

9 years agoOn exec, single-threading must be enforced before arguments space is
kib [Sun, 10 May 2015 09:00:40 +0000 (09:00 +0000)]
On exec, single-threading must be enforced before arguments space is
allocated from exec_map.  If many threads try to perform execve(2) in
parallel, the exec map is exhausted and some threads sleep
uninterruptible waiting for the map space.  Then, the thread which won
the race for the space allocation, cannot single-thread the process,
causing deadlock.

Reported and tested by: pho (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoClean up the style to use "options<space><tab>".
andrew [Sun, 10 May 2015 08:48:00 +0000 (08:48 +0000)]
Clean up the style to use "options<space><tab>".

9 years agoSatisfy vm_object uma zone destructor requirements after r282660 when
kib [Sun, 10 May 2015 08:21:03 +0000 (08:21 +0000)]
Satisfy vm_object uma zone destructor requirements after r282660 when
vnode object creation raced.

Reported by: pho
Reviewed by: alc
Sponsored by: The FreeBSD Foundation

9 years agoTurn ieee80211_start_scan_locked() into a swscan module private method.
adrian [Sun, 10 May 2015 06:59:34 +0000 (06:59 +0000)]
Turn ieee80211_start_scan_locked() into a swscan module private method.

It turns out that ieee80211_start_scan_locked() is only ever called by
the swscan code and it won't likely be required by firmware scanning
implementations.

So, don't bother keeping it in ieee80211_scan.c and it likely won't
become an API call.

Tested:

* Intel 5100, STA mode
* AR5416, STA mode

9 years agoAttempt to address Bug #176201 - don't advertise what the AP announced
adrian [Sun, 10 May 2015 06:57:53 +0000 (06:57 +0000)]
Attempt to address Bug #176201 - don't advertise what the AP announced
to us. Instead, advertise what we can do based on what the AP says and what
we're capped at by the VAP settings.

For non-STA modes we still advertise what our VAP settings are.

It may be that I've over-complicated this and instead of capping things
we can just always announce what we're capable of.  But this should at least
stop the blatantly wrong handling of A-MPDU parameters.

(I'll happily simplify things if someone can dig up a replacement, better
compliant behaviour.)

PR: kern/176201

9 years agoFix a couple bugs in 64-bit powerpc fasttrap argument retrieval.
jhibbits [Sun, 10 May 2015 04:33:01 +0000 (04:33 +0000)]
Fix a couple bugs in 64-bit powerpc fasttrap argument retrieval.

Found by code inspection.

9 years agoRemove unnecessary code and make use of generic implementations for
loos [Sun, 10 May 2015 02:19:27 +0000 (02:19 +0000)]
Remove unnecessary code and make use of generic implementations for
bus_alloc_resource(), bus_release_resource() and bus_set_resource()
(bus_generic_rl_alloc_resource(), bus_generic_rl_release_resource() and
bus_generic_rl_set_resource() respectively).

Do not print the resources for nomatch devices.

Use the inherited method for bus_get_resource_list() on ofw_iicbus.c.

Submitted by: jhb and Michal Meloun (D2033)

9 years agoReplace sprintf(3) with snprintf(3)
bapt [Sat, 9 May 2015 22:48:48 +0000 (22:48 +0000)]
Replace sprintf(3) with snprintf(3)

9 years agoUse snprintf(3) instead of sprintf(3)
bapt [Sat, 9 May 2015 22:43:44 +0000 (22:43 +0000)]
Use snprintf(3) instead of sprintf(3)
Remove useless "else"

9 years agoRemove now unused LNBUFSZ buffer size
bapt [Sat, 9 May 2015 22:08:30 +0000 (22:08 +0000)]
Remove now unused LNBUFSZ buffer size

9 years agoReturn from the function as early as possible
bapt [Sat, 9 May 2015 21:53:33 +0000 (21:53 +0000)]
Return from the function as early as possible

This reduces the depth of the if statements and improves clarity of the code

9 years agoCorrect the assertion. We should compare the pmap' curcpu pcid value
kib [Sat, 9 May 2015 21:36:44 +0000 (21:36 +0000)]
Correct the assertion.  We should compare the pmap' curcpu pcid value
against 0, not the pmap.

Noted by: Oliver Pinter <oliver.pinter@hardenedbsd.org>
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

9 years agoPass over the at91 kernels to reduce the diff between them.
andrew [Sat, 9 May 2015 21:24:55 +0000 (21:24 +0000)]
Pass over the at91 kernels to reduce the diff between them.

9 years agoMerge ^/projects/release-arm-redux into ^/head.
gjb [Sat, 9 May 2015 21:08:12 +0000 (21:08 +0000)]
Merge ^/projects/release-arm-redux into ^/head.

Of note:

- This commit adds native FreeBSD/arm release build support without
  requiring out-of-tree utilities.

- Part of this merge removes the WANDBOARD-{SOLO,DUAL,QUAD} kernel
  configuration files, for which the IMX6 kernel configuration file
  should be used instead.

- The resulting images have a 'freebsd' user (password 'freebsd'),
  to allow ssh(1) access when console access is not available (VGA
  or serial).  The default 'root' user password is set to 'root'.

- The /etc/ttys file for arm images now enable both ttyv0 and ttyu0
  by default.

Help from: many (boot testing, feedback, etc.)
Sponsored by: The FreeBSD Foundation

9 years agoThe vmem callback to reclaim kmem arena address space on low or
kib [Sat, 9 May 2015 20:08:36 +0000 (20:08 +0000)]
The vmem callback to reclaim kmem arena address space on low or
fragmented conditions currently just wakes up the pagedaemon.  The
kmem arena is significantly smaller then the total available physical
memory, which means that there are loads where kmem arena space could
be exhausted, while there is a lot of pages available still.  The
woken up pagedaemon sees vm_pages_needed != 0, verifies the condition
vm_paging_needed() which is false, clears the pass and returns back to
sleep, not calling neither uma_reclaim() nor lowmem handler.

To handle low kmem arena conditions, create additional pagedaemon
thread which calls uma_reclaim() directly.  The thread sleeps on the
dedicated channel and kmem_reclaim() wakes the thread in addition to
the pagedaemon.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoRemove some uneeded headers
bapt [Sat, 9 May 2015 19:29:55 +0000 (19:29 +0000)]
Remove some uneeded headers

9 years agoRemove unneeded headers
bapt [Sat, 9 May 2015 19:22:33 +0000 (19:22 +0000)]
Remove unneeded headers

9 years agoReplace malloc(3) + strcpy(3) + strcat(3) by asprintf(3)
bapt [Sat, 9 May 2015 19:12:16 +0000 (19:12 +0000)]
Replace malloc(3) + strcpy(3) + strcat(3) by asprintf(3)

9 years agoRewrite amd64 PCID implementation to follow an algorithm described in
kib [Sat, 9 May 2015 19:11:01 +0000 (19:11 +0000)]
Rewrite amd64 PCID implementation to follow an algorithm described in
the Vahalia' "Unix Internals" section 15.12 "Other TLB Consistency
Algorithms".  The same algorithm is already utilized by the MIPS pmap
to handle ASIDs.

The PCID for the address space is now allocated per-cpu during context
switch to the thread using pmap, when no PCID on the cpu was ever
allocated, or the current PCID is invalidated.  If the PCID is reused,
bit 63 of %cr3 can be set to avoid TLB flush.

Each cpu has PCID' algorithm generation count, which is saved in the
pmap pcpu block when pcpu PCID is allocated.  On invalidation, the
pmap generation count is zeroed, which signals the context switch code
that already allocated PCID is no longer valid.  The implication is
the TLB shootdown for the given cpu/address space, due to the
allocation of new PCID.

The pm_save mask is no longer has to be tracked, which (significantly)
reduces the targets of the TLB shootdown IPIs.  Previously, pm_save
was reset only on pmap_invalidate_all(), which made it accumulate the
cpuids of all processors on which the thread was scheduled between
full TLB shootdowns.

Besides reducing the amount of TLB shootdowns and removing atomics to
update pm_saves in the context switch code, the algorithm is much
simpler than the maintanence of pm_save and selection of the right
address space in the shootdown IPI handler.

Reviewed by: alc
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

9 years agoUse snprintf(3) instead of strcpy(3) + strncat(3)
bapt [Sat, 9 May 2015 19:09:34 +0000 (19:09 +0000)]
Use snprintf(3) instead of strcpy(3) + strncat(3)

9 years agoUse sbuf(9) instead of homebrewed buffered string
bapt [Sat, 9 May 2015 19:00:16 +0000 (19:00 +0000)]
Use sbuf(9) instead of homebrewed buffered string

9 years agoRemove unused define.
kib [Sat, 9 May 2015 18:38:35 +0000 (18:38 +0000)]
Remove unused define.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days