]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoFixed shutdown(2) unix(4) tests for SOCK_SEQPACKET after r285910 (by ed).
pluknet [Wed, 29 Jul 2015 13:49:34 +0000 (13:49 +0000)]
Fixed shutdown(2) unix(4) tests for SOCK_SEQPACKET after r285910 (by ed).

8 years agoar: enable deterministic mode by default
emaste [Wed, 29 Jul 2015 13:36:17 +0000 (13:36 +0000)]
ar: enable deterministic mode by default

Ar cannot handle UIDs with more than 6 digits, and storing the mtime,
uid, gid and mode provides little to negative value anyhow for ar's
uses. Turn on deterministic (-D) mode by default; it can be disabled by
the user with -U.

PR: 196929
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3190

8 years agoSplit up Capsicum to CloudABI rights conversion into two separate routines.
ed [Wed, 29 Jul 2015 12:42:45 +0000 (12:42 +0000)]
Split up Capsicum to CloudABI rights conversion into two separate routines.

CloudABI's openat() ensures that files are opened with the smallest set
of relevant rights. For example, when opening a FIFO, unrelated rights
like CAP_RECV are automatically removed. To remove unrelated rights, we
can just reuse the code for this that was already present in the rights
conversion function.

8 years agoAdd quirk for ThunderX ITS device table size
zbb [Wed, 29 Jul 2015 11:22:19 +0000 (11:22 +0000)]
Add quirk for ThunderX ITS device table size

Limit the number of supported device IDs to 0x100000
in order to decrease the size of the ITS device table so
that it matches with the HW capabilities.

Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3131

8 years agoReduce overhead of ipfw's me6 opcode.
ae [Wed, 29 Jul 2015 10:53:42 +0000 (10:53 +0000)]
Reduce overhead of ipfw's me6 opcode.

Skip checks for IPv6 multicast addresses.
Use in6_localip() for global unicast.
And for IPv6 link-local addresses do search in the IPv6 addresses list.
Since LLA are stored in the kernel internal form, use
IN6_ARE_MASKED_ADDR_EQUAL() macro with lla_mask for addresses comparison.
lla_mask has zero bits in the second word, where we keep sin6_scope_id.

Obtained from: Yandex LLC
Sponsored by: Yandex LLC

8 years agoMove bufshutdown() out of the #ifdef INVARIANTS block.
kib [Wed, 29 Jul 2015 09:57:34 +0000 (09:57 +0000)]
Move bufshutdown() out of the #ifdef INVARIANTS block.

8 years agoConvert in_ifaddr_lock and in6_ifaddr_lock to rmlock.
ae [Wed, 29 Jul 2015 08:12:05 +0000 (08:12 +0000)]
Convert in_ifaddr_lock and in6_ifaddr_lock to rmlock.

Both are used to protect access to IP addresses lists and they can be
acquired for reading several times per packet. To reduce lock contention
it is better to use rmlock here.

Reviewed by: gnn (previous version)
Obtained from: Yandex LLC
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D3149

8 years agoRFC4868 section 2.3 requires that the output be half... This fixes
jmg [Wed, 29 Jul 2015 07:15:16 +0000 (07:15 +0000)]
RFC4868 section 2.3 requires that the output be half...  This fixes
problems that was introduced in r285336...  I have verified that
HMAC-SHA2-256 both ah only and w/ AES-CBC interoperate w/ a NetBSD
6.1.5 vm...

Reviewed by: gnn

8 years agopf: Always initialise pf_fragment.fr_flags
kp [Wed, 29 Jul 2015 06:35:36 +0000 (06:35 +0000)]
pf: Always initialise pf_fragment.fr_flags

When we allocate the struct pf_fragment in pf_fillup_fragment() we forgot to
initialise the fr_flags field. As a result we sometimes mistakenly thought the
fragment to not be a buffered fragment. This resulted in panics because we'd end
up freeing the pf_fragment but not removing it from V_pf_fragqueue (believing it
to be part of V_pf_cachequeue).
The next time we iterated V_pf_fragqueue we'd use a freed object and panic.

While here also fix a pf_fragment use after free in pf_normalize_ip().
pf_reassemble() frees the pf_fragment, so we can't use it any more.

PR: 201879, 201932
MFC after: 5 days

8 years agoImplement CloudABI's readdir().
ed [Wed, 29 Jul 2015 06:31:44 +0000 (06:31 +0000)]
Implement CloudABI's readdir().

Summary:
CloudABI's readdir() system call could be thought of as a mixture
between FreeBSD's getdents(2) and pread(). Instead of using the file
descriptor offset, userspace provides a 64-bit cloudabi_dircookie_t
continue reading at a given point. CLOUDABI_DIRCOOKIE_START, having
value 0, can be used to return entries at the start of the directory.

The file descriptor offset is not used to store the cookie for the
reason that in a file descriptor centric environment, it would make
sense to allow concurrent use of a single file descriptor.

The remaining space returned by the system call should be filled with a
partially truncated copy of the next entry. The advantage of doing this
is that it gracefully deals with long filenames. If the C library
provides a buffer that is too small to hold a single entry, it can still
extract the directory entry header, meaning that it can retry the read
with a larger buffer or skip it using the cookie.

Test Plan:
This implementation passes the cloudlibc unit tests at:

https://github.com/NuxiNL/cloudlibc/tree/master/src/libc/dirent

Reviewers: marcel, kib

Reviewed By: kib

Subscribers: imp

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

8 years agoActually add the new code
bapt [Wed, 29 Jul 2015 06:23:06 +0000 (06:23 +0000)]
Actually add the new code

8 years agoCreate a strtounum function using the same API as strtonum
bapt [Wed, 29 Jul 2015 06:22:41 +0000 (06:22 +0000)]
Create a strtounum function using the same API as strtonum

This function returns uintmax_t
Use this function to convert to gid_t/uid_t

8 years ago - Remove some dead code copied from ffs.
jeff [Wed, 29 Jul 2015 03:06:08 +0000 (03:06 +0000)]
 - Remove some dead code copied from ffs.

8 years agoTeach sysctl about the new optional suffix after IK to specify
imp [Wed, 29 Jul 2015 02:34:25 +0000 (02:34 +0000)]
Teach sysctl about the new optional suffix after IK to specify
precision. Update input as well. Add IK to the manual (it was missing
completely).

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

8 years ago - Make 'struct buf *buf' private to vfs_bio.c. Having a global variable
jeff [Wed, 29 Jul 2015 02:26:57 +0000 (02:26 +0000)]
 - Make 'struct buf *buf' private to vfs_bio.c.  Having a global variable
   'buf' is inconvenient and has lead me to some irritating to discover
   bugs over the years.  It also makes it more challenging to refactor
   the buf allocation system.
 - Move swbuf and declare it as an extern in vfs_bio.c.  This is still
   not perfect but better than it was before.
 - Eliminate the unused ffs function that relied on knowledge of the buf
   array.
 - Move the shutdown code that iterates over the buf array into vfs_bio.c.

Reviewed by: kib
Sponsored by: EMC / Isilon Storage Division

8 years agoCompilers will complain the usage of obsolescent variable declarations.
araujo [Wed, 29 Jul 2015 02:21:35 +0000 (02:21 +0000)]
Compilers will complain the usage of obsolescent variable declarations.
Also it will fix the build problem with sparc64.

Submitted by: ed@

8 years agounlink(2): Note the possibility for ENOSPC to be returned on ZFS.
bdrewery [Tue, 28 Jul 2015 22:48:58 +0000 (22:48 +0000)]
unlink(2): Note the possibility for ENOSPC to be returned on ZFS.

PR: 154930

8 years agoReject usermod and userdel if the user concerned is not on the user database
bapt [Tue, 28 Jul 2015 21:49:38 +0000 (21:49 +0000)]
Reject usermod and userdel if the user concerned is not on the user database
supposed to be manipulated

This prevent pw usermod creating a new local user when requesting to usermod on
a username is defined in LDAP.

This issue only happens when modifying the local user database (not inpacting
commands when -V or -R are used).

PR: 187653
Submitted by: tmwalaszek@gmail.com

8 years agodrm/i915: Sort functions in i915_gem.c to match Linux 3.8's ordering
dumbbell [Tue, 28 Jul 2015 21:47:37 +0000 (21:47 +0000)]
drm/i915: Sort functions in i915_gem.c to match Linux 3.8's ordering

While here, reduce the style diff with Linux.

There is no functional change. The goal is to ease the future update to
Linux 3.8's i915 driver.

MFC after: 2 months

8 years agoFix rescue build after r284356 with STRIP= by using proper STRIPBIN per build(7).
bdrewery [Tue, 28 Jul 2015 21:39:58 +0000 (21:39 +0000)]
Fix rescue build after r284356 with STRIP= by using proper STRIPBIN per build(7).

This was causing the following error:

  rescue
  sh: rescue: not found
  *** [rescue] Error code 127

  make[1]: stopped in /usr/obj/usr/src/rescue/rescue

Sponsored by: EMC / Isilon Storage Division

8 years agoCheck uid/gid used when creating a user/group are not larger than UID_MAX/GID_MAX
bapt [Tue, 28 Jul 2015 21:10:58 +0000 (21:10 +0000)]
Check uid/gid used when creating a user/group are not larger than UID_MAX/GID_MAX

PR: 173977
Reported by: nvass@gmx.com

8 years agoFix wrong warning printed after changing or updating NIS users
bapt [Tue, 28 Jul 2015 20:52:10 +0000 (20:52 +0000)]
Fix wrong warning printed after changing or updating NIS users

PR: 37672
Submitted by: chris+freebsd@chrullrich.de

8 years ago - Eliminate the EMPTYKVA queue. It served as a cache of KVA allocations
jeff [Tue, 28 Jul 2015 20:24:09 +0000 (20:24 +0000)]
 - Eliminate the EMPTYKVA queue.  It served as a cache of KVA allocations
   attached to bufs to avoid the overhead of the vm.  This purposes is now
   better served by vmem.  Freeing the kva immediately when a buf is
   destroyed leads to lower fragmentation and a much simpler scan algorithm.

Reviewed by: kib
Sponsored by: EMC / Isilon Storage Division

8 years agoFix multiple OpenSSH vulnerabilities.
delphij [Tue, 28 Jul 2015 19:58:38 +0000 (19:58 +0000)]
Fix multiple OpenSSH vulnerabilities.

Security: CVE-2014-2653
Security: CVE-2015-5600
Security: FreeBSD-SA-15:16.openssh

8 years agoFix shell injection vulnerability in patch(1) and drop SCCS
delphij [Tue, 28 Jul 2015 19:58:36 +0000 (19:58 +0000)]
Fix shell injection vulnerability in patch(1) and drop SCCS
support by replacing system() with execve().

Future revisions may remove the functionality completely.

Obtained from: Bitrig
Security: CVE-2015-1416

8 years ago- Avoid lock contention in the if_transmit callback by using trylock and
davidcs [Tue, 28 Jul 2015 19:15:44 +0000 (19:15 +0000)]
- Avoid lock contention in the if_transmit callback by using trylock and
 enqueueing the frames when it fails. This way there is some latency
 removed from the transmitting path.
- If IFF_DRV_OACTIVE is set (and also if IFF_DRV_RUNNING is not) just
 enqueue the desired frames and return successful transmit. This way we
 avoid to return errors on transmit side and resulting in
 possible out-of-order frames. Please note that IFF_DRV_OACTIVE is set
 everytime we get the threshold ring hit, so this can be happening quite
 often.

Submitted by: Attilio.Rao@isilon.com
MFC after:5 days

8 years agoMFV r285970:
bdrewery [Tue, 28 Jul 2015 18:41:28 +0000 (18:41 +0000)]
MFV r285970:

  Apply upstream changeset bf4f6ec64e:

  Fix issue 356: properly skip a sparse file entry in a tar file.

PR: 201506
MFC after: 3 days
Relnotes: yes

8 years agoApply upstream changeset bf4f6ec64e:
bdrewery [Tue, 28 Jul 2015 17:48:34 +0000 (17:48 +0000)]
Apply upstream changeset bf4f6ec64e:

Fix issue 356: properly skip a sparse file entry in a tar file.

8 years agoApply upstream changeset fa9e61:
bdrewery [Tue, 28 Jul 2015 17:20:35 +0000 (17:20 +0000)]
Apply upstream changeset fa9e61:

Fix --one-file-system to include the directory encountered rather than
excluding it.

8 years agoSimplify logic added in r285945 as suggested by glebius
garga [Tue, 28 Jul 2015 14:59:29 +0000 (14:59 +0000)]
Simplify logic added in r285945 as suggested by glebius

Approved by: glebius
MFC after: 3 days
Sponsored by: Netgate

8 years agoImport Annapurna Labs Alpine HAL to sys/contrib/
zbb [Tue, 28 Jul 2015 14:20:33 +0000 (14:20 +0000)]
Import Annapurna Labs Alpine HAL to sys/contrib/

Import from vendor-sys/alpine-hal/2.7
SVN rev.: 285432
HAL version: 2.7

Obtained from:  Semihalf
Sponsored by:   Annapurna Labs

8 years agoFix the r272906 description.
glebius [Tue, 28 Jul 2015 13:48:19 +0000 (13:48 +0000)]
Fix the r272906 description.

8 years agoLimit ofw_cpu_early_foreach() to CPUs only
zbb [Tue, 28 Jul 2015 13:16:08 +0000 (13:16 +0000)]
Limit ofw_cpu_early_foreach() to CPUs only

On some platforms, the /cpus node contains cpu-to-cluster
map which deffinitely is not a CPU node. Its presence was
causing incrementing of "id" variable and reporting more
CPUs available than it should.
To make "id" valid, increment it only when an entry really
is a CPU device.

Reviewed by:   andrew
Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3216

8 years agoRemove claim that the OS is Darwin from lldb(1)
emaste [Tue, 28 Jul 2015 13:09:16 +0000 (13:09 +0000)]
Remove claim that the OS is Darwin from lldb(1)

Reported by: bapt

8 years agoImplement file attribute modification system calls for CloudABI.
ed [Tue, 28 Jul 2015 12:57:19 +0000 (12:57 +0000)]
Implement file attribute modification system calls for CloudABI.

CloudABI uses a system call interface to modify file attributes that is
more similar to KPI's/FUSE, namely where a stat structure is passed back
to the kernel, together with a bitmask of attributes that should be
changed. This would allow us to update any set of attributes atomically.

That said, I'd rather not go as far as to actually implement it that
way, as it would require us to duplicate more code than strictly needed.
Let's just stick to the combinations that are actually used by
cloudlibc.

Obtained from: https://github.com/NuxiNL/freebsd

8 years agowhen -n is passed to any pw subcommand it is always expected to be considered as
bapt [Tue, 28 Jul 2015 12:20:57 +0000 (12:20 +0000)]
when -n is passed to any pw subcommand it is always expected to be considered as
a name so do not try to convert it to an id if it is a numeric value

PR: 31933
Reported by: ted@impulse.net
Sponsored by: gandi.net

8 years agoCorrect typo in UPDATING message
smh [Tue, 28 Jul 2015 11:21:33 +0000 (11:21 +0000)]
Correct typo in UPDATING message

MFC after: 3 days
Sponsored by: Multiplay

8 years agoAdd warning about low KSTACK_PAGES for ZFS use
smh [Tue, 28 Jul 2015 11:19:38 +0000 (11:19 +0000)]
Add warning about low KSTACK_PAGES for ZFS use

As ZFS requires a more kernel stack pages than is the default on some
architectures e.g. i386, warn if KSTACK_PAGES is less than
ZFS_MIN_KSTACK_PAGES (which is 4 at the time of writing).

MFC after: 3 days
Sponsored by: Multiplay

8 years agoRespect pf rule log option before log dropped packets with IP options or
garga [Tue, 28 Jul 2015 10:31:34 +0000 (10:31 +0000)]
Respect pf rule log option before log dropped packets with IP options or
dangerous v6 headers

Reviewed by: gnn, eri
Approved by: gnn
Obtained from: pfSense
MFC after: 3 days
Sponsored by: Netgate
Differential Revision: https://reviews.freebsd.org/D3222

8 years agoFix a typo in r280169. Of course we are interested in deleting nsn only
glebius [Tue, 28 Jul 2015 09:36:26 +0000 (09:36 +0000)]
Fix a typo in r280169. Of course we are interested in deleting nsn only
if we have just created it and we were the last reference.

Submitted by: dhartmei

8 years agoFix a typo reported by Erik Cederstrand.
tuexen [Tue, 28 Jul 2015 08:50:13 +0000 (08:50 +0000)]
Fix a typo reported by Erik Cederstrand.

MFC after:  1 week

8 years agoOptimise the DWC OTG host mode driver's receive path:
hselasky [Tue, 28 Jul 2015 07:30:07 +0000 (07:30 +0000)]
Optimise the DWC OTG host mode driver's receive path:

Remove NAKing limit and pause IN and OUT transactions for 125us in
case of NAK response for BULK and CONTROL endpoints. This gets the
receive latency down and improves USB network throughput at the cost
of some CPU usage.

MFC after: 1 month

8 years agoRemove full barrier from the amd64 atomic_load_acq_*(). Strong
kib [Tue, 28 Jul 2015 07:04:51 +0000 (07:04 +0000)]
Remove full barrier from the amd64 atomic_load_acq_*().  Strong
ordering semantic of x86 CPUs makes only the compiler barrier
neccessary to give the acquire behaviour.

Existing implementation ensured sequentially consistent semantic for
load_acq, making much stronger guarantee than required by standard's
definition of the load acquire.  Consumers which depend on the barrier
are believed to be identified and already fixed to use proper
operations.

Noted by: alc (long time ago)
Reviewed by: alc, bde
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoRemove useless acquire semantic from the atomic_add operation before
kib [Tue, 28 Jul 2015 06:58:10 +0000 (06:58 +0000)]
Remove useless acquire semantic from the atomic_add operation before
sosend().  The only release on the xp_snt_cnt is done after sosend(),
with an intent to synchronize with load_acq in svc_vc_ack().

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

8 years agoAdd bit names for the IA32_MISC_ENABLE msr.
kib [Tue, 28 Jul 2015 06:55:08 +0000 (06:55 +0000)]
Add bit names for the IA32_MISC_ENABLE msr.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoImplement directory and FIFO creation.
ed [Tue, 28 Jul 2015 06:50:47 +0000 (06:50 +0000)]
Implement directory and FIFO creation.

The file_create() system call can be used to create files of a given
type. Right now it can only be used to create directories and FIFOs. As
CloudABI does not expose filesystem permissions, this system call lacks
a mode argument. Simply use 0777 or 0666 depending on the file type.

8 years agoMake fstat() and friends work.
ed [Tue, 28 Jul 2015 06:36:49 +0000 (06:36 +0000)]
Make fstat() and friends work.

Summary:
CloudABI provides access to two different stat structures:

- fdstat, containing file descriptor level status: oflags, file
  descriptor type and Capsicum rights, used by cap_rights_get(),
  fcntl(F_GETFL), getsockopt(SO_TYPE).
- filestat, containing your regular file status: timestamps, inode
  number, used by fstat().

Unlike FreeBSD's stat::st_mode, CloudABI file descriptor types don't
have overloaded meanings (e.g., returning S_ISCHR() for kqueues). Add a
utility function to extract the type of a file descriptor accurately.

CloudABI does not work with O_ACCMODEs. File descriptors have two sets
of Capsicum-style rights: rights that apply to the file descriptor
itself ('base') and rights that apply to any new file descriptors
yielded through openat() ('inheriting'). Though not perfect, we can
pretty safely decompose Capsicum rights to such a pair. This is done in
convert_capabilities().

Test Plan: Tests for these system calls are fairly extensive in cloudlibc.

Reviewers: jonathan, mjg, #manpages

Reviewed By: mjg

Subscribers: imp

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

8 years agoCheck the sync operation.
marcel [Tue, 28 Jul 2015 04:54:05 +0000 (04:54 +0000)]
Check the sync operation.

8 years agoStaticfy and constify some variables and clean up the code a bit to make it
araujo [Tue, 28 Jul 2015 02:32:40 +0000 (02:32 +0000)]
Staticfy and constify some variables and clean up the code a bit to make it
more readable. No functional change.

Differential Revision: D3166
Reviewed by: kib
Sponsored by: gandi.net

8 years agoProvide consistent error causes whenever an ABORT chunk is sent.
tuexen [Mon, 27 Jul 2015 22:35:54 +0000 (22:35 +0000)]
Provide consistent error causes whenever an ABORT chunk is sent.

MFC after: 1 week

8 years agoRewrite scan procedure with a FSM. This improves code readability by
delphij [Mon, 27 Jul 2015 19:21:23 +0000 (19:21 +0000)]
Rewrite scan procedure with a FSM.  This improves code readability by
making clear transits between different states, and avoids bug with
handling repeated $'s.

Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D3221

8 years ago- Move the remainder of host controller capability registers reading from
marius [Mon, 27 Jul 2015 15:26:50 +0000 (15:26 +0000)]
- Move the remainder of host controller capability registers reading from
  xhci_start_controller() to xhci_init(). These values don't change at run-
  time so there's no point of acquiring them on every USB_HW_POWER_RESUME
  instead of only once during initialization. In r276717, reading the first
  couple of registers in question already had been moved as a prerequisite
  for the changes in that revision.
- Identify ASMedia ASM1042A controllers.
- Use NULL instead of 0 for pointers.

MFC after: 3 days

8 years ago- Fix compilation after r285909 with USB_DEBUG defined.
marius [Mon, 27 Jul 2015 14:43:14 +0000 (14:43 +0000)]
- Fix compilation after r285909 with USB_DEBUG defined.
- Regenerate usb.conf.

8 years ago- Use __FBSDID().
marius [Mon, 27 Jul 2015 14:34:32 +0000 (14:34 +0000)]
- Use __FBSDID().
- Const'ify cons_to_vga_colors.
- Fix line wrapping.

MFC after: 3 days

8 years ago- Nuke dupe $FreeBSD$.
marius [Mon, 27 Jul 2015 14:03:34 +0000 (14:03 +0000)]
- Nuke dupe $FreeBSD$.
- Fix whitespace.

MFC after: 3 days

8 years agoMake shutdown() return ENOTCONN as required by POSIX, part deux.
ed [Mon, 27 Jul 2015 13:17:57 +0000 (13:17 +0000)]
Make shutdown() return ENOTCONN as required by POSIX, part deux.

Summary:
Back in 2005, maxim@ attempted to fix shutdown() to return ENOTCONN in case the socket was not connected (r150152). This had to be rolled back (r150155), as it broke some of the existing programs that depend on this behavior. I reapplied this change on my system and indeed, syslogd failed to start up. I fixed this back in February (279016) and MFC'ed it to the supported stable branches. Apart from that, things seem to work out all right.

Since at least Linux and Mac OS X do the right thing, I'd like to go ahead and give this another try. To keep old copies of syslogd working, only start returning ENOTCONN for recent binaries.

I took a look at the XNU sources and they seem to test against both SS_ISCONNECTED, SS_ISCONNECTING and SS_ISDISCONNECTING, instead of just SS_ISCONNECTED. That seams reasonable, so let's do the same.

Test Plan:
This issue was uncovered while writing tests for shutdown() in CloudABI:

https://github.com/NuxiNL/cloudlibc/blob/master/src/libc/sys/socket/shutdown_test.c#L26

Reviewers: glebius, rwatson, #manpages, gnn, #network

Reviewed By: gnn, #network

Subscribers: bms, mjg, imp

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

8 years ago- Probe UICLASS_CDC/UISUBCLASS_ABSTRACT_CONTROL_MODEL/0xff again. This
marius [Mon, 27 Jul 2015 12:14:14 +0000 (12:14 +0000)]
- Probe UICLASS_CDC/UISUBCLASS_ABSTRACT_CONTROL_MODEL/0xff again. This
  variant of Microsoft RNDIS, i. e. their unofficial version of CDC ACM,
  has been disabled in r261544 for resolving a conflict with umodem(4).
  Eventually, in r275790 that problem was dealt with in the right way.
  However, r275790 failed to put probing of RNDIS devices in question
  back.
- Initialize the device prior to querying it, as required by the RNDIS
  specification. Otherwise already determining the MAC address may fail
  rightfully.
- On detach, halt the device again.
- Use UCDC_SEND_ENCAPSULATED_{COMMAND,RESPONSE}. While these macros are
  resolving to the same values as UR_{CLEAR_FEATURE,GET_STATUS}, the
  former set is way more appropriate in this context.
- Report unknown - rather: unimplemented - events unconditionally and
  not just in debug mode. This ensures that we'll get some hint of what
  is going wrong instead of the driver silently failing.
- Deal with the Microsoft ActiveSync requirement of using an input buffer
  the size of the expected reply or larger - except for variably sized
  replies - when querying a device.
- Fix some pointless NULL checks, style bugs etc.

This changes allow urndis(4) to communicate with a Microsoft-certified
USB RNDIS test token.

MFC after: 3 days
Sponsored by: genua mbh

8 years agoAdd a futex implementation for CloudABI.
ed [Mon, 27 Jul 2015 10:07:29 +0000 (10:07 +0000)]
Add a futex implementation for CloudABI.

Summary:
CloudABI provides two different types of futex objects: read-write locks
and condition variables. There is no need to provide separate support
for once objects and thread joining, as these are efficiently simulated
by blocking on a read-write lock. Mutexes simply use read-write locks.

Condition variables always have a lock object associated to them. They
always know to which lock a thread needs to be migrated if woken up.
This allows us to implement requeueing. A broadcast on a condition
variable will never cause multiple threads to be woken up at once. They
will be woken up iteratively.

This implementation still has lots of room for improvement. Locking is
coarse and right now we use linked lists to store all of the locks and
condition variables, instead of using a hash table. The primary goal of
this implementation was to behave correctly. Performance will be
improved as we go.

Test Plan:
This futex implementation has been in use for the last couple of months
and seems to work pretty well. All of the cloudlibc and libc++ unit
tests seem to pass.

Reviewers: dchagin, kib, vangyzen

Subscribers: imp

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

8 years agoRegenerate system call table.
ed [Mon, 27 Jul 2015 10:04:28 +0000 (10:04 +0000)]
Regenerate system call table.

8 years agoSync in latest upstream system call definitions.
ed [Mon, 27 Jul 2015 10:04:06 +0000 (10:04 +0000)]
Sync in latest upstream system call definitions.

Futex object scopes have been renamed from using their own constants to
simply reusing the existing CLOUDABI_MAP_{PRIVATE,SHARED} flags, as they
are more accurate in this context.

8 years agoChange the dev argument from a full path to just the device
marcel [Sun, 26 Jul 2015 21:37:31 +0000 (21:37 +0000)]
Change the dev argument from a full path to just the device
identification (e.g. isa:0x3f0 or pci0:2:1:0). In libbus,
the device is turned into a path name. For bus_space_map(),
the resource is now specified in a second argument.
Before:
bus.map('/dev/proto/pci0:2:1:0/pcicfg')
busdma.tag_create('/dev/proto/pci0:2:1:0/busdma', ...)
Now:
bus.map('pci0:2:1:0', 'pcicfg')
busdma.tag_create('pci0:2:1:0', ...)

8 years agoDocument r285557, bsdinstall aligns zfs partitions on 1Mb boundaries.
gjb [Sun, 26 Jul 2015 19:47:08 +0000 (19:47 +0000)]
Document r285557, bsdinstall aligns zfs partitions on 1Mb boundaries.

Sponsored by: The FreeBSD Foundation

8 years agoDocument r285642, ssh(1) hostname canonicalization before looking
gjb [Sun, 26 Jul 2015 19:47:05 +0000 (19:47 +0000)]
Document r285642, ssh(1) hostname canonicalization before looking
for the host in known_hosts.
Add Dell, Inc. to sponsors.ent.

Sponsored by: The FreeBSD Foundation

8 years agoDocument r285679, bsdinstall(8) updates to workaround various
gjb [Sun, 26 Jul 2015 19:47:02 +0000 (19:47 +0000)]
Document r285679, bsdinstall(8) updates to workaround various
problematic BIOSes when booting from GPT, and partition scheme
selection in the UFS partition menu.

Sponsored by: The FreeBSD Foundation

8 years agoFurther refine the PAE_TABLES entry, based on feedback from
gjb [Sun, 26 Jul 2015 17:57:35 +0000 (17:57 +0000)]
Further refine the PAE_TABLES entry, based on feedback from
alc.

Sponsored by: The FreeBSD Foundation

8 years agoRemove debugging output. We should have tracing instead.
marcel [Sun, 26 Jul 2015 16:40:51 +0000 (16:40 +0000)]
Remove debugging output. We should have tracing instead.

8 years agoo make sure the boundary is a power of 2, when not zero.
marcel [Sun, 26 Jul 2015 16:39:37 +0000 (16:39 +0000)]
o   make sure the boundary is a power of 2, when not zero.
o   don't convert 0 to ~0 just so that we can use MIN. ~0 is not a
    valid boundary. Introduce BNDRY_MIN that deals with 0 values
    that mean no boundary.

8 years agoPass unsigned long argument to ioctl().
rodrigc [Sun, 26 Jul 2015 14:46:42 +0000 (14:46 +0000)]
Pass unsigned long argument to ioctl().

Eliminates "ioctl sign-extension" warnings.

PR: 200896

8 years agoReplace GNU RCS ident with a BSD license ident
bapt [Sun, 26 Jul 2015 11:21:36 +0000 (11:21 +0000)]
Replace GNU RCS ident with a BSD license ident

Rationale: ident(1) is useful out of RCS, lot of scripts are using ident(1) and
failing when base is built WITHOUT_RCS.

This version is:
- fully compatible with RCS 5.7 ident.
- fully compatible with RCS 5.9 ident.
- passes all ident test from GNU RCS 5.9 test suite

This version has support for: svn extension for the Keyword id (double colon and
# before last $)

DiffĂ©rences with GNU RCS ident:
- no long options as found in GNU RCS 5.9 (but not commented there).
- '-V' reports nothing but has been added for compatibility.

Differential Revision: https://reviews.freebsd.org/D3200
Reviewed by: pfg

8 years agoReport the scheme and provider names in warning message about unaligned
ae [Sun, 26 Jul 2015 11:16:48 +0000 (11:16 +0000)]
Report the scheme and provider names in warning message about unaligned
partition.

PR: 201873
MFC after: 1 week

8 years agoBuild debug version of rmlock's methods only when LOCK_DEBUG > 0.
ae [Sun, 26 Jul 2015 10:53:32 +0000 (10:53 +0000)]
Build debug version of rmlock's methods only when LOCK_DEBUG > 0.

Currently LOCK_DEBUG is always defined in sys/lock.h (0 or 1).
This means that debugging code always built. In addition the kernel
modules have always defined LOCK_DEBUG as 1. So, debugging rmlock code
is always used by kernel modules.

MFC after: 1 week

8 years agoImprove locking on Mac OS X. This does not change the functionality
tuexen [Sun, 26 Jul 2015 10:37:40 +0000 (10:37 +0000)]
Improve locking on Mac OS X. This does not change the functionality
on FreeBSD.

Reviewed by: rrs
MFC after: 1 week

8 years agoFix and improve a debug message. The SID was reported as an SSN.
tuexen [Sun, 26 Jul 2015 10:17:17 +0000 (10:17 +0000)]
Fix and improve a debug message. The SID was reported as an SSN.

MFC after: 1 week

8 years agoIn tmpfs_chtimes(), remove checks on the nanosecond level when
brueffer [Sun, 26 Jul 2015 08:33:46 +0000 (08:33 +0000)]
In tmpfs_chtimes(), remove checks on the nanosecond level when
determining whether a node changed.

Other filesystems, e.g., UFS, only check on seconds, when determining
whether something changed.

This also corrects the birthtime case, where we checked tv_nsec
twice, instead of tv_sec and tv_nsec (PR).

PR: 201284
Submitted by: David Binderman
Patch suggested by: kib
Reviewed by: kib
MFC after: 2 weeks
Committed from: Essen FreeBSD Hackathon

8 years agoBump GCC max-inline-insns-single in libiconv_modules and grep
pfg [Sun, 26 Jul 2015 00:11:04 +0000 (00:11 +0000)]
Bump GCC max-inline-insns-single in libiconv_modules and grep

This is required by our FORTIFY_SOURCE implementation as it
does more inlining. As a rule of thumb, FORTIFY_SOURCE doubles
the number  of inlines except that in grep inlining
blows up for some reason.

8 years agoisl(4), driver for Intersil I2C ISL29018 Digital Ambient Light Sensor
grembo [Sat, 25 Jul 2015 20:17:19 +0000 (20:17 +0000)]
isl(4), driver for Intersil I2C ISL29018 Digital Ambient Light Sensor

Differential Revision: https://reviews.freebsd.org/D2811
Reviewed by: adrian, wblock
Approved by: adrian, wblock
Relnotes: yes

8 years agoUse consistent spacing.
trasz [Sat, 25 Jul 2015 20:17:19 +0000 (20:17 +0000)]
Use consistent spacing.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoAdd md_root example to defaults/loader.conf.
trasz [Sat, 25 Jul 2015 20:15:29 +0000 (20:15 +0000)]
Add md_root example to defaults/loader.conf.

Note that this doesn't quite work yet - the preloaded image
gets loaded twice for some reason.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoRemove unused txd_saved.
sbruno [Sat, 25 Jul 2015 19:24:33 +0000 (19:24 +0000)]
Remove unused txd_saved.

Intialize txd_upper, txd_lower and txd_used at declaration.

Differential Revision: D3174
Reviewed by: erj hiren
MFC after: 2 weeks
Sponsored by: Limelight Networks

8 years agoRevert r173708's modifications to vm_object_page_remove().
kib [Sat, 25 Jul 2015 18:29:06 +0000 (18:29 +0000)]
Revert r173708's modifications to vm_object_page_remove().

Assume that a vnode is mapped shared and mlocked(), and then the vnode
is truncated, or truncated and then again extended past the mapping
point EOF.  Truncation removes the pages past the truncation point,
and if pages are later created at this range, they are not properly
mapped into the mlocked region, and their wiring count is wrong.

The revert leaves the invalidated but wired pages on the object queue,
which means that the pages are found by vm_object_unwire() when the
mapped range is munlock()ed, and reused by the buffer cache when the
vnode is extended again.

The changes in r173708 were required since then vm_map_unwire() looked
at the page tables to find the page to unwire.  This is no longer
needed with the vm_object_unwire() introduction, which follows the
objects shadow chain.

Also eliminate OBJPR_NOTWIRED flag for vm_object_page_remove(), which
is now redundand, we do not remove wired pages.

Reported by: trasz, Dmitry Sivachenko <trtrmitya@gmail.com>
Suggested and reviewed by: alc
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoMove including netinet/icmp6.h around to avoid a problem when including
tuexen [Sat, 25 Jul 2015 18:26:09 +0000 (18:26 +0000)]
Move including netinet/icmp6.h around to avoid a problem when including
netinet/icmp6.h and net/netmap.h. Both use ni_flags...
This allows to build multistack with SCTP support.

MFC after: 1 week

8 years agocyapa(4), driver for the Cypress APA I2C trackpad
grembo [Sat, 25 Jul 2015 18:14:35 +0000 (18:14 +0000)]
cyapa(4), driver for the Cypress APA I2C trackpad

Differential Revision: https://reviews.freebsd.org/D3068
Reviewed by: kib, wblock
Approved by: kib
Relnotes: yes

8 years agoUse double newlines consistently.
trasz [Sat, 25 Jul 2015 16:20:04 +0000 (16:20 +0000)]
Use double newlines consistently.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoRemove stale comment.
kp [Sat, 25 Jul 2015 16:14:55 +0000 (16:14 +0000)]
Remove stale comment.

The IPv6 pseudo header checksum was added by bz in r235961.

Sponsored by: Essen FreeBSD Hackathon

8 years agoUpdate Capsicum and Mandatory Access Control manual pages
trasz [Sat, 25 Jul 2015 15:56:49 +0000 (15:56 +0000)]
Update Capsicum and Mandatory Access Control manual pages
to no longer claim they are experimental.

Reviewed by: rwatson@, wblock@
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2985

8 years agoWith the removal of b_saveaddr in the r285819, b_data must be reset to
kib [Sat, 25 Jul 2015 15:00:14 +0000 (15:00 +0000)]
With the removal of b_saveaddr in the r285819, b_data must be reset to
b_kvabase when the buffer is reclaimed.  Otherwise, if b_data for the
mapped buffer was adjusted with the page-offset portion of b_offset,
nothing would re-adjust the b_data, which breaks buffer management
code which expects page-aligned b_data (see e.g. bpman_qenter(), which
skips partial pages).

Fix a minor issue with the GB_KVAALLOC requests, which could result in
returning the mapped buffer if the reused buffer is mapped and have
the right amount of KVA reserved.

Improve assertion in the vfs_buf_check_mapped() to catch unmapped
buffers which have their b_data incorrectly adjusted with offset.

Reported and tested by: pho (previous version)
Reviewed by: jeff (previous version)
Sponsored by: The FreeBSD Foundation

8 years agoPf can reassemble IPv6 fragments now.
kp [Sat, 25 Jul 2015 14:06:32 +0000 (14:06 +0000)]
Pf can reassemble IPv6 fragments now.

Obtained from: bluhm (OpenBSD)
Sponsored by: Essen FreeBSD Hackathon

8 years agoDocument md_root in loader(8). The md(4) manual page mentions it,
trasz [Sat, 25 Jul 2015 13:02:41 +0000 (13:02 +0000)]
Document md_root in loader(8). The md(4) manual page mentions it,
but it's hard to find and easy to miss.

Reviewed by: wblock@
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3183

8 years agoFix transposed words in man page.
dru [Sat, 25 Jul 2015 11:10:49 +0000 (11:10 +0000)]
Fix transposed words in man page.

PR: 201752
Reviewed by: bcr
MFC after: 3 days
Sponsored by: Essen FreeBSD Hackathon

8 years agoFix color mapping for TDA19988. Values for VIP_CNTRL_1 and VIP_CNTRL_2
gonzo [Sat, 25 Jul 2015 03:19:02 +0000 (03:19 +0000)]
Fix color mapping for TDA19988. Values for VIP_CNTRL_1 and VIP_CNTRL_2
registers were mixed up

8 years agoSynchronize PIN input/output modes with gnu/dts/include/dt-bindings/pinctrl/am33xx.h
gonzo [Sat, 25 Jul 2015 03:03:32 +0000 (03:03 +0000)]
Synchronize PIN input/output modes with gnu/dts/include/dt-bindings/pinctrl/am33xx.h
gpio driver requires exact value to match SoC pin mode with GPIO pin direction

8 years agoIf there is panel info in DTB do not wait for HDMI event and setup
gonzo [Sat, 25 Jul 2015 02:59:45 +0000 (02:59 +0000)]
If there is panel info in DTB do not wait for HDMI event and setup
framebuffer immediately

8 years agoOF_getencprop_alloc shouldn't be used to get string value. If string
gonzo [Sat, 25 Jul 2015 00:58:50 +0000 (00:58 +0000)]
OF_getencprop_alloc shouldn't be used to get string value. If string
length + 1 is not divisible by 4 this function returns NULL property
value. Otherwise - string with each 4 letters inverted

8 years agoDocument the fact that system(3) can easily be misused due to shell meta
delphij [Sat, 25 Jul 2015 00:21:29 +0000 (00:21 +0000)]
Document the fact that system(3) can easily be misused due to shell meta
characters are honored.  While I'm there also mention posix_spawn in the
SEE ALSO section.

MFC after: 2 weeks

8 years agoFix a typo in comment.
delphij [Fri, 24 Jul 2015 22:13:39 +0000 (22:13 +0000)]
Fix a typo in comment.

Submitted by: Yanhui Shen via twitter
MFC after: 3 days

8 years agoAuto-generate hardware notes for pms(4).
brueffer [Fri, 24 Jul 2015 21:55:16 +0000 (21:55 +0000)]
Auto-generate hardware notes for pms(4).

MFC after: 1 week
Committed from: Essen FreeBSD Hackathon

8 years agoAdd a basic manpage for the pms driver.
brueffer [Fri, 24 Jul 2015 21:48:53 +0000 (21:48 +0000)]
Add a basic manpage for the pms driver.

MFC after: 1 week
Committed from: Essen FreeBSD Hackathon

8 years agoCast uid and gid to the correct type for display to solve segfault in ls(1) on 32bit...
allanjude [Fri, 24 Jul 2015 20:20:59 +0000 (20:20 +0000)]
Cast uid and gid to the correct type for display to solve segfault in ls(1) on 32bit arches

Correctly escape literal % for display

This fixes segfaults in 32bit arches caused by r285734

Reviewed by: ngie
Approved by: dim
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D3191

8 years agoAdd a comment discussing the appropriate use of the atomic_*() functions
alc [Fri, 24 Jul 2015 19:43:18 +0000 (19:43 +0000)]
Add a comment discussing the appropriate use of the atomic_*() functions
with acquire and release semantics versus the *mb() functions on amd64
processors.

Reviewed by: bde (an earlier version), kib
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd missing SIGUSR1 description.
trasz [Fri, 24 Jul 2015 18:14:57 +0000 (18:14 +0000)]
Add missing SIGUSR1 description.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation