]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoMerge ^/head r285793 through r285923.
dim [Mon, 27 Jul 2015 22:20:28 +0000 (22:20 +0000)]
Merge ^/head r285793 through r285923.

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

8 years agoAdd missing capitalization.
trasz [Fri, 24 Jul 2015 18:13:13 +0000 (18:13 +0000)]
Add missing capitalization.

8 years agoreadelf: avoid division by zero on section entry size
emaste [Fri, 24 Jul 2015 18:00:53 +0000 (18:00 +0000)]
readelf: avoid division by zero on section entry size

ELF Tool Chain tickets #439, #444, #445, #467
Reported by: Alexander Cherepanov <cherepan@mccme.ru> (#467)
Reported by: antiAgainst (others)

Reviewed by: brooks
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2338

8 years agoar: add -U (unique) option to disable -D (deterministic) mode
emaste [Fri, 24 Jul 2015 17:46:43 +0000 (17:46 +0000)]
ar: add -U (unique) option to disable -D (deterministic) mode

This is required in order for us to support deterministic mode by
default.  If multiple -D or -U options are specified on the command
line, the final one takes precedence.  GNU ar also uses -U for this.

An equivalent change will be applied to ELF Tool Chain's version of ar.

PR: 196929
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3175

8 years ago- Since r253161, uart_intr() abuses FILTER_SCHEDULE_THREAD for signaling
marius [Fri, 24 Jul 2015 17:01:16 +0000 (17:01 +0000)]
- Since r253161, uart_intr() abuses FILTER_SCHEDULE_THREAD for signaling
  uart_bus_attach() during its test that 20 iterations weren't sufficient
  for clearing all pending interrupts, assuming this means that hardware
  is broken and doesn't deassert interrupts. However, under pressure, 20
  iterations also can be insufficient for clearing all pending interrupts,
  leading to a panic as intr_event_handle() tries to schedule an interrupt
  handler not registered. Solve this by introducing a flag that is set in
  test mode and otherwise restores pre-r253161 behavior of uart_intr(). The
  approach of additionally registering uart_intr() as handler as suggested
  in PR 194979 is not taken as that in turn would abuse special pccard and
  pccbb handling code of intr_event_handle(). [1]
- Const'ify uart_driver_name.
- Fix some minor style bugs.

PR: 194979 [1]
Reviewed by: marcel (earlier version)
MFC after: 3 days

8 years agotruss: follow pdfork()ed descendents with -f
emaste [Fri, 24 Jul 2015 16:57:13 +0000 (16:57 +0000)]
truss: follow pdfork()ed descendents with -f

PR: 201276
Reported by: David Drysdale
Reviewed by: oshogbo
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2976

8 years agoAdd RISC-V ELF machine type definition
emaste [Fri, 24 Jul 2015 16:52:21 +0000 (16:52 +0000)]
Add RISC-V ELF machine type definition

EM_RISCV is now officially registered as e_machine 243.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years ago- In mpt_send_handshake_cmd(), use bus_space_write_stream_4(9) for writing
marius [Fri, 24 Jul 2015 16:00:35 +0000 (16:00 +0000)]
- In mpt_send_handshake_cmd(), use bus_space_write_stream_4(9) for writing
  raw data to the doorbell offset in order to clarify the intent and for
  avoiding unnecessarily converting the endianess back and forth.
  Unfortunately, the same can't be done in mpt_recv_handshake_reply() as
  16-bit data needs to be read using 32-bit bus accessors.
- In mpt_recv_handshake_reply(), get rid of a redundant variable.

MFC after: 1 fortnight

8 years agoo Revert the other functional half of r239864, i. e. the merge of r134227
marius [Fri, 24 Jul 2015 15:13:21 +0000 (15:13 +0000)]
o Revert the other functional half of r239864, i. e. the merge of r134227
  from x86 to use smp_ipi_mtx spin lock not only for smp_rendezvous_cpus()
  but also for the MD cache invalidation, TLB demapping and remote register
  reading IPIs due to the following reasons:
  - The cross-IPI SMP deadlock x86 otherwise is subject to can't happen on
    sparc64. That's because on sparc64, spin locks don't disable interrupts
    completely but only raise the processor interrupt level to PIL_TICK. This
    means that IPIs still get delivered and direct dispatch IPIs such as the
    cache invalidation etc. IPIs in question are still executed.
  - In smp_rendezvous_cpus(), smp_ipi_mtx is held not only while sending an
    IPI_RENDEZVOUS, but until all CPUs have processed smp_rendezvous_action().
    Consequently, smp_ipi_mtx may be locked for an extended amount of time as
    queued IPIs (as opposed to the direct ones) such as IPI_RENDEZVOUS are
    scheduled via a soft interrupt. Moreover, given that this soft interrupt
    is only delivered at PIL_RENDEZVOUS, processing of smp_rendezvous_action()
    on a target may be interrupted by f. e. a tick interrupt at PIL_TICK, in
    turn leading to the target in question trying to send an IPI by itself
    while IPI_RENDEZVOUS isn't fully handled, yet, and, thus, resulting in a
    deadlock.
o As mentioned in the commit message of r245850, on least some sun4u platforms
  concurrent sending of IPIs by different CPUs is fatal. Therefore, hold the
  reintroduced MD ipi_mtx also while delivering cross-traps via MI helpers,
  i. e. ipi_{all_but_self,cpu,selected}().
o Akin to x86, let the last CPU to process cpu_mp_bootstrap() set smp_started
  instead of the BSP in cpu_mp_unleash(). This ensures that all APs actually
  are started, when smp_started is no longer 0.
o In all MD and MI IPI helpers, check for smp_started == 1 rather than for
  smp_cpus > 1 or nothing at all. This avoids races during boot causing IPIs
  trying to be delivered to APs that in fact aren't up and running, yet.
  While at it, move setting of the cpu_ipi_{selected,single}() pointers to
  the appropriate delivery functions from mp_init() to cpu_mp_start() where
  it's better suited and allows to get rid of the global isjbus variable.
o Given that now concurrent IPI delivery no longer is possible, also nuke
  the delays before completely disabling interrupts again in the CPU-specific
  cross-trap delivery functions, previously giving other CPUs a window for
  sending IPIs on their part. Actually, we now should be able to entirely get
  rid of completely disabling interrupts in these functions. Such a change
  needs more testing, though.
o In {s,}tick_get_timecount_mp(), make the {s,}tick variable static. While not
  necessary for correctness, this avoids page faults when accessing the stack
  of a foreign CPU as {s,}tick now is locked into the TLBs as part of static
  kernel data. Hence, {s,}tick_get_timecount_mp() always execute as fast as
  possible, avoiding jitter.

PR: 201245
MFC after: 3 days

8 years agoFix silly syntax error emacs chugged in for me.. gesh.
rrs [Fri, 24 Jul 2015 14:13:43 +0000 (14:13 +0000)]
Fix silly syntax error emacs chugged in for me.. gesh.

MFC after: 3 weeks

8 years agoFix an issue with MAC OS locking and also optimize the case
rrs [Fri, 24 Jul 2015 14:09:03 +0000 (14:09 +0000)]
Fix an issue with MAC OS locking and also optimize the case
where we are sending back a stream-reset and a sack timer is running, in
that case we should just send the SACK.

MFC after: 3 weeks

8 years agoinode should be different to actually mean mandocdb is in used
bapt [Fri, 24 Jul 2015 09:20:02 +0000 (09:20 +0000)]
inode should be different to actually mean mandocdb is in used

Sponsored by: gandi.net

8 years agoFix man -k with mandocdb
bapt [Fri, 24 Jul 2015 09:10:03 +0000 (09:10 +0000)]
Fix man -k with mandocdb

If apropos(1) and whatis(1) are not hardlinks to man(1) that means the system is
using mandocdb, then man -k should spawn apropos(1) and/or whatis(1) directly

Reported by: kevlo
Tested by: kevlo
Sponsored by: gandi.net

8 years agoImplement the basic system calls that operate on pathnames.
ed [Fri, 24 Jul 2015 07:46:02 +0000 (07:46 +0000)]
Implement the basic system calls that operate on pathnames.

Summary:
Unlike FreeBSD, CloudABI does not use null terminated strings for its
pathnames. Introduce a function called copyin_path() that can be used by
all of the filesystem system calls that use pathnames. This change
already implements the system calls that don't depend on any additional
functionality (e.g., conversion of struct stat).

Also implement the socket system calls that operate on pathnames, namely
the ones used by the C library functions bindat() and connectat(). These
don't receive a 'struct sockaddr_un', but just the pathname, meaning
they could be implemented in such a way that they don't depend on the
size of sun_path. For now, just use the existing interfaces.

Add a missing #include to cloudabi_syscalldefs.h to get this code to
build, as one of its macros depends on UINT64_C().

Test Plan:
These implementations have already been tested in the CloudABI branch on
GitHub. They pass all of the tests.

Reviewers: kib, pjd

Subscribers: imp

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

8 years agoPanic when a device is trying to recursively acquire rather than hang
imp [Fri, 24 Jul 2015 04:56:46 +0000 (04:56 +0000)]
Panic when a device is trying to recursively acquire rather than hang
indefinitely. Improve error messages from other panics.

8 years agoCall ksem_get() with initialized 'rights'.
pluknet [Thu, 23 Jul 2015 23:18:03 +0000 (23:18 +0000)]
Call ksem_get() with initialized 'rights'.

ksem_get() consumes fget(), and it's mandatory there.

Reported by: truckman
Reviewed by: mjg

8 years agoRefactor unmapped buffer address handling.
jeff [Thu, 23 Jul 2015 19:13:41 +0000 (19:13 +0000)]
Refactor unmapped buffer address handling.
 - Use pointer assignment rather than a combination of pointers and
   flags to switch buffers between unmapped and mapped.  This eliminates
   multiple flags and generally simplifies the logic.
 - Eliminate b_saveaddr since it is only used with pager bufs which have
   their b_data re-initialized on each allocation.
 - Gather up some convenience routines in the buffer cache for
   manipulating buf space and buf malloc space.
 - Add an inline, buf_mapped(), to standardize checks around unmapped
   buffers.

In collaboration with: mlaier
Reviewed by: kib
Tested by: pho (many small revisions ago)
Sponsored by: EMC / Isilon Storage Division

8 years agoRefine the PAE_TABLES entry based on feedback from kib
gjb [Thu, 23 Jul 2015 18:11:52 +0000 (18:11 +0000)]
Refine the PAE_TABLES entry based on feedback from kib
and jhb.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

8 years agoDocument the fact that tunables can be set in device.hints.
brooks [Thu, 23 Jul 2015 17:27:10 +0000 (17:27 +0000)]
Document the fact that tunables can be set in device.hints.

Reviewed by: wblock
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D3153

8 years agonvme: ensure csts.rdy bit is cleared before returning from nvme_ctrlr_disable
jimharris [Thu, 23 Jul 2015 15:50:39 +0000 (15:50 +0000)]
nvme: ensure csts.rdy bit is cleared before returning from nvme_ctrlr_disable

PR: 200458
MFC after: 3 days
Sponsored by: Intel

8 years agonvme: properly handle case where pci_alloc_msix does not alloc all vectors
jimharris [Thu, 23 Jul 2015 15:35:08 +0000 (15:35 +0000)]
nvme: properly handle case where pci_alloc_msix does not alloc all vectors

Reported by: Sean Kelly <smkelly@smkelly.org>
MFC after: 3 days
Sponsored by: Intel

8 years agoAllow us to create UNIX sockets and socketpairs in CloudABI processes.
ed [Thu, 23 Jul 2015 13:52:53 +0000 (13:52 +0000)]
Allow us to create UNIX sockets and socketpairs in CloudABI processes.

8 years agoAllow cap_rights_{set,clear,is_set} to be called with no arguments.
ed [Thu, 23 Jul 2015 11:11:01 +0000 (11:11 +0000)]
Allow cap_rights_{set,clear,is_set} to be called with no arguments.

In the CloudABI code I sometimes call into cap_rights_* without
providing any arguments. Though one could argue that this doesn't make
sense, in this specific case it's hard to avoid, as the rights that
should be tested against are forwarded by a couple of wrapper macros.

8 years ago - Don't defeat the FIFO nature of the buffer cache by eliminating the
jeff [Thu, 23 Jul 2015 02:20:41 +0000 (02:20 +0000)]
 - Don't defeat the FIFO nature of the buffer cache by eliminating the
   most recently used buffer when we are under paging pressure.  This is
   a perversion of the buffer and page replacement algorithms and recent
   improvements to the page daemon have rendered it unnecessary.  In the
   event that low-memory deadlocks become an issue it would be possible
   to make a daemon or event handler that performs a similar action on
   the oldest buffers rather than the newest.  Since the buf cache
   is analogous to the page cache and some minimum working set is desired
   another possibility is to simply shrink the minimum working set which
   has less downside now that file pages are not directly mapped.

Sponsored by: EMC / Isilon
Reviewed by: alc, kib (with some minor objection)
Tested by: pho

8 years agovt: cpu logos: Correct reversed 0/1 beastie descriptions
cem [Wed, 22 Jul 2015 23:30:54 +0000 (23:30 +0000)]
vt: cpu logos: Correct reversed 0/1 beastie descriptions

Differential Revision: https://reviews.freebsd.org/D3158
Approved by: markj (mentor)
Obtained from: Pavel Timofeev
MFC after: 1 week

8 years agovt: Change default CPU logo to Orb
cem [Wed, 22 Jul 2015 23:23:12 +0000 (23:23 +0000)]
vt: Change default CPU logo to Orb

Differential Revision: https://reviews.freebsd.org/D3156
Approved by: markj (mentor)
MFC after: 1 week

8 years agovt: Default to cpu logos off
cem [Wed, 22 Jul 2015 23:19:53 +0000 (23:19 +0000)]
vt: Default to cpu logos off

Apologies, this was how it was supposed to land. Mea culpa.

Differential Revision: https://reviews.freebsd.org/D3157
Reviewed by: gnn, hiren
Approved by: markj (mentor)
MFC after: 1 week

8 years agomount_nfs: Be more clear on nmount(2) error with errmsg unset
cem [Wed, 22 Jul 2015 22:53:40 +0000 (22:53 +0000)]
mount_nfs: Be more clear on nmount(2) error with errmsg unset

Differential Revision: https://reviews.freebsd.org/D3147
Reviewed by: rmacklem
Approved by: markj (mentor)
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoRemove an excess space accidently introduced in the output in ls(1) by r285734
allanjude [Wed, 22 Jul 2015 19:58:21 +0000 (19:58 +0000)]
Remove an excess space accidently introduced in the output in ls(1) by r285734

Spotted by: dim
Approved by: eadler (mentor)
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D3152

8 years agoMerge ^/head r285341 through r285792.
dim [Wed, 22 Jul 2015 19:55:32 +0000 (19:55 +0000)]
Merge ^/head r285341 through r285792.

8 years agovt_core.c: Use do/while to highlight missed semi-colon errors
cem [Wed, 22 Jul 2015 18:50:47 +0000 (18:50 +0000)]
vt_core.c: Use do/while to highlight missed semi-colon errors

Also, fix some nearby #define whitespace while here.

(Style cleanup for r285794.)

Suggested by: jmg

Differential Revision: https://reviews.freebsd.org/D3154
Approved by: markj (mentor)
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoCatch up with ACPICA 20150717.
jkim [Wed, 22 Jul 2015 16:26:17 +0000 (16:26 +0000)]
Catch up with ACPICA 20150717.

8 years agosfxge: added fallbacks for pre 4.2.1 firmware support
arybchik [Wed, 22 Jul 2015 16:25:18 +0000 (16:25 +0000)]
sfxge: added fallbacks for pre 4.2.1 firmware support

Driver must be able to start against older firmware that is missing
recently added MCDI calls, otherwise firmware upgrade will not be
possible.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D3145

8 years agoMerge ACPICA 20150717.
jkim [Wed, 22 Jul 2015 16:25:07 +0000 (16:25 +0000)]
Merge ACPICA 20150717.

8 years agonvmecontrol: read controller identify data before any log page operations
jimharris [Wed, 22 Jul 2015 16:10:29 +0000 (16:10 +0000)]
nvmecontrol: read controller identify data before any log page operations

MFC after: 3 days
Sponsored by: Intel

8 years agovt: Unbreak build on no-splash configurations
cem [Wed, 22 Jul 2015 15:30:10 +0000 (15:30 +0000)]
vt: Unbreak build on no-splash configurations

PR: 201751
Differential Revision: https://reviews.freebsd.org/D3151
Tested by: Andrey Fesenko
Approved by: markj (mentor)
MFC after: 1 week

8 years agoFix several problems with Stream Reset.
rrs [Wed, 22 Jul 2015 11:30:37 +0000 (11:30 +0000)]
Fix several problems with Stream Reset.
 1) We were not handling (or sending) the IN_PROGRESS case if
    the other side (or our side) was not able to reset (awaiting more data).
 2) We would improperly send a stream-reset when we should not. Not
    waiting until the TSN had been assigned when data was inqueue.

Reviewed by: tuexen

8 years agoRegenerate system call table.
ed [Wed, 22 Jul 2015 10:05:46 +0000 (10:05 +0000)]
Regenerate system call table.

8 years agoImport upstream changes to the system call definitions.
ed [Wed, 22 Jul 2015 10:04:53 +0000 (10:04 +0000)]
Import upstream changes to the system call definitions.

Support has been added for providing the scope of a futex operation,
whether the futex is local to the process or shared between processes.

8 years agoIntroduce support for MSI-X interrupts in AHCI
zbb [Wed, 22 Jul 2015 09:46:22 +0000 (09:46 +0000)]
Introduce support for MSI-X interrupts in AHCI

- Allocate resources for MSI-X table and PBA if necessary
- Add function ahci_free_mem() to free all resources

Reviewed by:   jhb, mav
Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3009

8 years agoFix inverted logic bug that David Wolfskill found (thanks David!)
rrs [Wed, 22 Jul 2015 09:29:50 +0000 (09:29 +0000)]
Fix inverted logic bug that David Wolfskill found (thanks David!)

MFC after: 3 Weeks

8 years agoRemove duplicate and useless declarations.
kib [Wed, 22 Jul 2015 09:12:40 +0000 (09:12 +0000)]
Remove duplicate and useless declarations.

Submitted by: bde

8 years agoAdd Makefiles for CloudABI kernel modules.
ed [Wed, 22 Jul 2015 07:32:49 +0000 (07:32 +0000)]
Add Makefiles for CloudABI kernel modules.

Place all of the machine/pointer size independent code in a kernel
module called 'cloudabi'. All of the 64-bit specific code goes in a
separate module called 'cloudabi64'. The latter is only enabled on
amd64, as it is the only architecture supported.

8 years agoDo not enable UDP checksum offloading when running on the Hyper-V on
whu [Wed, 22 Jul 2015 05:05:01 +0000 (05:05 +0000)]
Do not enable UDP checksum offloading when running on the Hyper-V on
Windows Server 2012 and earlier hosts.

Submitted by: whu
Reviewed by: royger
Approved by: royger
MFC after: 3 days
Relnotes: No
Sponsored by: Microsoft OSTC
Differential Revision:  https://reviews.freebsd.org/D3086

8 years agoCosmetic change. When printing the child's mapped pins, use the plural
loos [Wed, 22 Jul 2015 04:18:33 +0000 (04:18 +0000)]
Cosmetic change.  When printing the child's mapped pins, use the plural
only when necessary.

Reported by: Daniel O'Connor <darius@dons.net.au>,
Sulev-Madis Silber (ketas)

8 years agoVarious changes to the registers displayed in DDB for x86.
jhb [Wed, 22 Jul 2015 01:09:02 +0000 (01:09 +0000)]
Various changes to the registers displayed in DDB for x86.
- Fix segment registers to only display the low 16 bits.
- Remove unused handlers and entries for the debug registers.
- Display xcr0 (if valid) in 'show sysregs'.
- Add '0x' prefix to MSR values to match other values in 'show sysregs'.
- MFamd64: Display various MSRs in 'show sysregs'.
- Add a 'show dbregs' to display the value of debug registers.
- Dynamically size the column width for register values to properly
  align columns on 64-bit platforms.
- Display %gs for i386 in 'show registers'.

Differential Revision: https://reviews.freebsd.org/D2784
Reviewed by: kib, markj
MFC after: 2 weeks

8 years agoFix counter reads on platforms where sizeof(uint64_t) != sizeof(uint64_t *).
markj [Tue, 21 Jul 2015 23:57:38 +0000 (23:57 +0000)]
Fix counter reads on platforms where sizeof(uint64_t) != sizeof(uint64_t *).

In the kernel, structs such as tcpstat are manipulated as an array of
counter_u64_t (uint64_t *), but made visible to userland as an array of
uint64_t. kread_counters() was previously copying the counter array into
user space and sequentially overwriting each counter with its value. This
mostly affects IPsec counters, as other counters are exported via sysctl.

PR: 201700
Tested by: Jason Unovitch
MFC after: 1 week

8 years agoRemove checks for a NULL return value from M_WAITOK allocations.
markj [Tue, 21 Jul 2015 23:44:36 +0000 (23:44 +0000)]
Remove checks for a NULL return value from M_WAITOK allocations.

8 years agoFix resource exhaustion due to sessions stuck in LAST_ACK state.
delphij [Tue, 21 Jul 2015 23:42:15 +0000 (23:42 +0000)]
Fix resource exhaustion due to sessions stuck in LAST_ACK state.

Submitted by: Jonathan Looney (Juniper SIRT)
Reviewed by: lstewart
Security: CVE-2015-5358
Security: SA-15:13.tcp

8 years agoLet the unwinder handle faults during function prologues or epilogues.
markj [Tue, 21 Jul 2015 23:22:23 +0000 (23:22 +0000)]
Let the unwinder handle faults during function prologues or epilogues.

The i386 and amd64 DDB stack unwinders contain code to detect and handle
the case where the first frame is not completely set up or torn down. This
code was accidentally unused however, since db_backtrace() was never called
with a non-NULL trap frame. This change fixes that.

Also remove get_rsp() from the amd64 code. It appears to have come from
i386, which needs to take into account whether the exception triggered a
CPL switch, since SS:ESP is only pushed onto the stack if so. On amd64,
SS:RSP is pushed regardless, so get_rsp() was doing the wrong thing for
kernel-mode exceptions. As a result, we can also remove custom print
functions for these registers.

Reviewed by: jhb
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D2881