15551 Commits

Author SHA1 Message Date
kevlo
0320ab1784 MFC r268643:
Document that listen(2) can fail with EDESTADDRREQ.
2014-07-24 05:59:32 +00:00
emaste
aa794b38fe MFC r262528: Update LLDB snapshot to upstream r202189
Highlights include (upstream revs in parens):

  - Improvements to the remote GDB protocol client
    (r196610, r197579, r197857, r200072, and others)

  - Bug fixes for big-endian targets
    (r196808)

  - Initial support for libdispatch (GCD) queues in the debuggee
    (r197190)

  - Add "step-avoid-libraries" setting
    (r199943)

  - IO subsystem improvements (including initial work on a curses gui)
    (r200263)

  - Support hardware watchpoints on FreeBSD
    (r201706)

  - Improved unwinding through hand-written assembly functions
    (r201839)

  - Handle DW_TAG_unspecified_parameters for variadic functions
    (r202061)

  - Fix Ctrl+C interrupting a running inferior process
    (r202086, r202154)

  - Various bug fixes for memory leaks, LLDB segfaults, the C++ demangler,
    ELF core files, DWARF debug info, and others.

Sponsored by:	DARPA, AFRL
2014-07-23 19:35:02 +00:00
emaste
68543b825e MFC r261799: Add bounds check for pteindex / pdeindex to amd64 kvm_minidump 2014-07-23 14:29:28 +00:00
pfg
797038915a MFC r268928:
Const-ify a character string.

Obtained from:	Apple Inc. (Libc 997.90.3)
2014-07-23 02:55:03 +00:00
jhb
ce450da430 MFC 266424,266476,266524,266573,266595,266626,266627,266633,266641,266642,
266708,266724,266934,266935,268521:
Emulation of the "ins" and "outs" instructions.

Various fixes for translating guest linear addresses to guest physical
addresses.
2014-07-22 04:39:16 +00:00
jhb
c1fe945ebd MFC 266125:
Implement a PCI interrupt router to route PCI legacy INTx interrupts to
the legacy 8259A PICs.
2014-07-22 03:14:37 +00:00
pfg
f5657a9f1c MFC r268644:
libc/stdlib: Minor cleanups to code originating in NetBSD

Mostly ANSIfication and typos.

Obtained from:	NetBSD
2014-07-21 22:47:59 +00:00
pfg
832f667130 MFC r268642:
libc/gen: small updates to code originating at OpenBSD

arc4random.c
- CVS rev. 1.22
Change arc4random_uniform() to calculate ``2**32 % upper_bound'' as
``-upper_bound % upper_bound''. Simplifies the code and makes it the
same on both ILP32 and LP64 architectures, and also slightly faster on
LP64 architectures by using a 32-bit remainder instead of a 64-bit
remainder.
- CVS rev. 1.23
Spacing

readpassphrase.c
-CVS rev. v 1.24
most obvious unsigned char casts for ctype

Obtained from:	OpenBSD
2014-07-21 22:37:33 +00:00
jhb
e6b48465b7 MFC 264353,264509,264768,264770,264825,264846,264988,265114,265165,265365,
265941,265951,266390,266550,266910:
Various bhyve fixes:
- Don't save host's return address in 'struct vmxctx'.
- Permit non-32-bit accesses to local APIC registers.
- Factor out common ioport handler code.
- Use calloc() in favor of malloc + memset.
- Change the vlapic timer frequency to be in the ballpark of contemporary
  hardware.
- Allow the guest to read the TSC via MSR 0x10.
- A VMCS is always inactive when it exits the vmx_run() loop.  Remove
  redundant code and the misleading comment that suggest otherwise.
- Ignore writes to microcode update MSR.  This MSR is accessed by RHEL7
  guest.
  Add KTR tracepoints to annotate wrmsr and rdmsr VM exits.
- Provide an alias for the userboot console and name it 'comconsole'.
- Use EV_ADD to create an mevent and EV_ENABLE to enable it.
- abort(3) the process in response to a VMEXIT_ABORT.
- Don't include the guest memory segments in the bhyve(8) process core dump.
- Make the vmx asm code dtrace-fbt-friendly.
- Allow vmx_getdesc() and vmx_setdesc() to be called for a vcpu that is in
  the VCPU_RUNNING state.
- Enable VMX in the IA32_FEATURE_CONTROL MSR if it not enabled and the MSR
  isn't locked.
2014-07-21 19:08:02 +00:00
jhb
888f6511e3 MFC 263780,264516,265062,265101,265203,265364:
Add an ioctl to suspend a virtual machine (VM_SUSPEND).

Add logic in the HLT exit handler to detect if the guest has put all vcpus
to sleep permanently by executing a HLT with interrupts disabled.

When this condition is detected the guest with be suspended with a reason of
VM_SUSPEND_HALT and the bhyve(8) process will exit.

This logic can be disabled via the tunable 'hw.vmm.halt_detection'.
2014-07-21 02:39:17 +00:00
bapt
d4cd64d84a MFC: r267376
Add a zlib pkg-config file (more and more ports requires it)

Approved by:	delphij
2014-07-20 00:32:22 +00:00
bapt
63350d40ce MFC: r267131, r267132, r267133, r268493, r268671
Use NULL instead of 0 (Patch by Sascha Wildner <saw at online.de> for Dragonfly)
Remove unnecessary semicolons (Patch by Sascha Wildner <saw at online.de> for Dragonfly)
Add support for arbitrary http requests [1]
Support EAGAIN in fetch_writev

Submitted by:	Alex Hornung <alex at alexhornung.com> [1]
Reviewed by:	des
2014-07-20 00:29:41 +00:00
bapt
6f718e3669 MFC: r263648, r264789, r266636
This brings:
- schema validation
- xpath-like interface for ucl objects

Adapt pkg(7) to the new libucl API
2014-07-19 23:44:57 +00:00
jhb
3da9c304ee MFC 259942,262274,263035,263054,263211,263744,264179,264324,264468,264631,
264648,264650,264651,266572,267558:
Flesh out the AT PIC and 8254 PIT emulations and move them into the kernel.
2014-07-19 22:06:46 +00:00
pfg
c62a7a5557 MFC r268569:
strfmon: reduce unnecessary snprintf.

No need for the snprintf/asprintf dance; use fixed width formats.

Obtained from:	NetBSD (CVS rev. 1.8)
2014-07-19 15:12:38 +00:00
pfg
30eedb40f8 MFC r268502:
Sync some (mostly cosmetical) changes from NetBSD

Makefile,v 1.37
tc1.c v 1.3
Rename TEST/test.c tc1.c

common.c,v 1.23
pass lint on _LP64.

emacs.c,v 1.22
pass lint on _LP64.

filecomplete.h,v 1.8
mv NetBSD ID back from 1.9 as we don't
have the widecharacter support.

prompt.c,v 1.14
prompt.h,v 1.9
term.h,v 1.20
read.h,v 1.6
Update NetBSD version strings

sys.h,v 1.12
Misc sun stuff.

tty.c 1.31
handle EINTR in the termios operations
Allow a single process to control multiple ttys (for pthreads using _REENTRANT)
using multiple EditLine objects.
pass lint on _LP64.
Don't depend on side effects inside an assert

Obtained from:	NetBSD
2014-07-17 02:14:25 +00:00
dim
082dc1af3f MFC r268463:
In libproc, avoid calling __cxa_demangle(), and thus depending on either
libcxxrt or libsupc++, if WITHOUT_CXX is defined. [1]

Noticed by:	sbruno

[1] However, on stable/10 this is more accurately described by
WITHOUT_GNUCXX, so I've changed the test to that instead.
2014-07-16 21:04:31 +00:00
kib
369fe04016 MFC r268467:
Implement sysconf(_SC_GETGR_R_SIZE_MAX) and sysconf(_SC_GETPW_R_SIZE_MAX).
2014-07-16 08:52:44 +00:00
wblock
f454bd908f MFC r267618:
Fix syntax error.
2014-07-15 22:44:10 +00:00
pfg
8bbbab8fb3 MFC r268272:
minor perf enhancement for UTF-8

Reduce some duplicate code.

Reference:
https://www.illumos.org/issues/628

Obtained from:	Illumos
2014-07-12 17:39:13 +00:00
delphij
a8fc83ae7c MFC r267897: MFV r267843:
Update file/libmagic to 5.19.
2014-07-11 00:00:00 +00:00
kib
8674b3c2aa MFC r268212:
Note that most errors are possible for all syscalls from utimes(2)
family.  Minor wording corrections.
2014-07-10 09:09:37 +00:00
pluknet
48775398f2 MFC r268393: [mdoc] Fix previous. 2014-07-08 13:16:03 +00:00
ache
51242982da MFC 267756:
Merge intermediate OpenBSD v1.25 changes (almost identical to ours)
to reduce diff and bump OpenBSD patch level to v1.26.
2014-07-07 05:31:50 +00:00
pfg
19e2403cf6 MFC r267745, r268268:
getopt(3): recognize option:: as GNU extension for "optional options".

Also ANSIfy a function declaration.

While here update the OpenBSD patch level in getopt_long.c as we
already have the corresponding change.

Obtained from:	NetBSD
MFC after:	2 weeks
2014-07-07 02:47:41 +00:00
pluknet
0d8378f52b MFC r267909: Document EINVAL.
PR:		191382
2014-07-03 17:35:01 +00:00
ume
e6568c7ce0 MFC r267912, r267915:
- Exclude loopback address rather than loopback interface.
- style(9)

Spotted by:	melifaro
2014-07-03 15:56:30 +00:00
ume
1af4339c2a MFC r267800:
Exclude IPv4 address from doing longest match.
It prevented DNS based load balancing.
2014-06-30 16:53:12 +00:00
delphij
ab99acf70d MFC r267378:
Fix path for zlib examples, this have no runtime effect and was
overlooked when I was doing zlib update.
2014-06-30 16:31:28 +00:00
pfg
99efb6c39e MFC r267627:
strptime: add support for %t and %n

Posix strptime() requires support for %t and %n, which were added
to the illumos port.  Curiously we were skipping white spaces by
default in most other cases making %t meaningless.

We now skip spaces in the case of the %e specifier as strftime(3)
explicitly adds a space for the single digit case.

Reference:
http://pubs.opengroup.org/onlinepubs/009695399/functions/strptime.html

PR:		173421
Obtained from:	Illumos (Rev. a11c1571b6942161b0186d0588609448066892c2)
2014-06-30 14:52:40 +00:00
pluknet
b39fb82c62 MFC r261140:
Add MLINK for fdclosedir.3 to directory.3 and sort fdopendir(3) entry.
2014-06-27 09:11:24 +00:00
kib
15d33955d2 MFC r267630:
Add MAP_EXCL flag for mmap(2).
2014-06-26 08:30:08 +00:00
kib
b371ec04aa MFC r267629:
Tidy up code of the wrapper.
2014-06-26 08:27:01 +00:00
ume
ec8b74659a MFC r267616, 267640:
Retooling addrconfig() to exclude addresses on loopback interfaces
when looking for configured addresses.
This change is based upon the code from the submitter, and made
following changes:
- Exclude addresses assigned on interfaces which are down, like NetBSD
  does.
- Exclude addresses assigned on interfaces which are ifdisabled.

Use SOCK_CLOEXEC.

PR:		190824
Submitted by:	Justin McOmie
2014-06-25 17:10:26 +00:00
pfg
f1ff231dba MFC r267601:
stdtime: style(9) fixes.

Obtained from:	illumos
2014-06-23 15:03:51 +00:00
pfg
fac80b6943 MFC r267544:
Update license to strptime(3) implementation.

Our strptime(3) implementation was the base for the illumos
implementation and after contacting the author, Kevin Rudy
stated the code is under a 2-Clause BSD License [1]

After reviewing our local changes to the file in question,
the FreeBSD Foundation has agreed that their contributions
to this file are not required to carry clause 3 or 4 so
the file can be relicensed as in Illumos [2].

References:

[1] https://www.illumos.org/issues/357
[2] Illumos Revision:		13222:02526851ba75

Approved:	core (jhb)
Approved:	FreeBSD Foundation (emaste)
2014-06-20 15:43:58 +00:00
tijl
de4e2206d5 MFC r267436-267439:
- Replace malloc+memset with calloc.
- iconv_open(3): initialise ci_ilseq_invalid field of _citrus_iconv_shared
  struct after allocation with malloc.
- iconvlist(3): reduce a memory leak by copying strings only once.
- iconv(1):
  - Make invalids variable local to do_conv such that it prints the number
    of invalid characters of the current file instead of an accumulated
    value.
  - Make do_conv return an error when invalid characters have been found.
    Return EXIT_FAILURE from main if any file contained invalid characters.
    This matches the behaviour of GNU iconv.
  - Mark usage with __dead2 attribute.
  - Make the long_options array const.

Tested by:	Pavel Timofeev <timp87@gmail.com>
2014-06-20 07:32:03 +00:00
kib
adb3a0aab0 MFC r267062:
Disable existing uncore hwpmc code for Nehalem and Westmere EX.
2014-06-18 05:35:09 +00:00
dim
7e5254e136 MFC r267335:
In some scenarios, when generating llvm/clang .inc.h files, multiple
source files could be passed to tblgen or clang-tblgen, leading to a
"Too many positional arguments specified" error message.  Fix this by
replacing the too-generic ${.ALLSRC} sources with explicit paths.

Reported by:	rysto32@gmail.com, rodrigc
2014-06-14 11:20:41 +00:00
pfg
b890481de0 MFC r266865;
Fix strcasecmp_l() and strncasecmp_l() POSIX 2008 compliance.

POSIX.1-2008 specifies that those two functions should be declared by
including <strings.h>, not <string.h> (the latter only has strcoll_l()
and strxfrm_l()):

http://pubs.opengroup.org/onlinepubs/9699919799/functions/strcasecmp.html

Bump __FreeBSD_version for ports that may be using the non-standard
reference.

Obtained from:	DragonFlyBSD
Reviewed by:	theraven
2014-06-14 02:57:40 +00:00
hselasky
3eab83e1a2 MFC r263191:
Add libusb_log_level enum.
2014-06-13 07:33:43 +00:00
jhb
3e1f2ae835 MFC 261638,262144,262506,266765:
Add virtualized XSAVE support to bhyve which permits guests to use XSAVE and
XSAVE-enabled features like AVX.
- Store a per-cpu guest xcr0 register and handle xsetbv VM exits by emulating
  the instruction.
- Only expose XSAVE to guests if XSAVE is enabled in the host.  Only expose
  a subset of XSAVE features currently supported by the guest and for which
  the proper emulation of xsetbv is known.  Currently this includes X87, SSE,
  AVX, AVX-512, and Intel MPX.
- Add support for injecting hardware exceptions into the guest and use this
  to trigger exceptions in the guest for invalid xsetbv operations instead
  of potentially faulting in the host.
- Queue pending exceptions in the 'struct vcpu' instead of directly updating
  the processor-specific VMCS or VMCB. The pending exception will be delivered
  right before entering the guest.
- Rename the unused ioctl VM_INJECT_EVENT to VM_INJECT_EXCEPTION and restrict
  it to only deliver x86 hardware exceptions. This new ioctl is now used to
  inject a protection fault when the guest accesses an unimplemented MSR.
- Expose a subset of known-safe features from leaf 0 of the structured
  extended features to guests if they are supported on the host including
  RDFSBASE/RDGSBASE, BMI1/2, AVX2, AVX-512, HLE, ERMS, and RTM.  Aside
  from AVX-512, these features are all new instructions available for use
  in ring 3 with no additional hypervisor changes needed.
2014-06-12 19:58:12 +00:00
jhb
fa121e2a05 MFC 261504:
Add support for FreeBSD/i386 guests under bhyve.
2014-06-12 15:20:59 +00:00
jhb
835cb387cc MFC 260239,261268,265058:
Expand the support for PCI INTx interrupts including providing interrupt
routing information for INTx interrupts to I/O APIC pins and enabling
INTx interrupts in the virtio and AHCI backends.
2014-06-12 13:13:15 +00:00
nwhitehorn
dc45432cd4 MFC r260913,266895:
Add a new flag to /etc/ttys: onifconsole. This is equivalent to "on" if the
device is an active kernel console and "off" otherwise. This is designed to
allow serial-booting x86 systems to provide a login prompt on the serial line
by default without providing one on all systems by default. Set this flag
on x86 systems for ttyu0.

Comments and suggestions by:	grehan, dteske, jilles
2014-06-08 17:50:07 +00:00
kib
8d9dc2de3a MFC r266609:
Change the _rtld_atfork() to lock the bind lock in write mode.
2014-06-07 02:45:24 +00:00
jilles
83925746a3 MFC r264417: realpath(): Properly fail "." or ".." components after
non-directories.

If realpath() is called on pathnames like "/dev/null/." or "/dev/null/..",
it should fail with [ENOTDIR]. Pathnames like "/dev/null/" already failed as
they should.

Also, put the check for non-directories after lstatting the previous
component instead of when the empty component (consecutive or trailing
slashes) is detected, saving an lstat() call and some lines of code.

PR:		82980
2014-06-06 13:37:40 +00:00
ume
6f5c5395e9 MFH r266813: Don't break the legacy applications which set
just 2 bytes to salt.
2014-06-05 15:16:44 +00:00
hselasky
105e4e05fc MFC r266664:
Add empty LIBUSB_CALL macro, to be compatible to the libusb 1.0-API
from sourceforge.

PR:		usb/190204
2014-06-04 10:40:43 +00:00
bjk
5eb02565b3 MFC r266285,266866:
------------------------------------------------------------------------
    r266285 | bjk | 2014-05-16 23:05:52 -0400 (Fri, 16 May 2014) | 9 lines

    Correct documentation of the limit on how much memory can be mlock()ed

    vm.max_wired is a system-wide limit, not per-process.  Reword the
    section to make this more clear.

    PR:             docs/189214
    Submitted by:   Lawrence Chen (original text)
    Approved by:    hrs (mentor)

    ------------------------------------------------------------------------
    r266866 | bjk | 2014-05-29 22:16:28 -0400 (Thu, 29 May 2014) | 5 lines

    Minor mdoc fix

    Submitted by:   hrs
    Approved by:    hrs (mentor, implicit)

    ------------------------------------------------------------------------

PR:		docs/189214
Approved by:	hrs (mentor)
2014-06-01 18:41:33 +00:00