Commit Graph

15799 Commits

Author SHA1 Message Date
John-Mark Gurney
8083f14fc2 replace the kernel's version w/ cperciva's implementation... In all
my tests, it is faster ~20%, even on an old IXP425 533MHz it is ~45%
faster...  This is partly due to loop unrolling, so the code size does
significantly increase...  I do plan on committing a version that
rolls up the loops again for smaller code size for embedded systems
where size is more important than absolute performance (it'll save ~6k
code)...

The kernel implementation is now shared w/ userland's libcrypt and
libmd...

We drop support for sha256 from sha2.c, so now sha2.c only contains
sha384 and sha512...

Reviewed by:	secteam@
2014-03-16 01:43:23 +00:00
Andrew Turner
bb6c193ec7 On armv6 access both the softfloat and, when available, the vfp to get and
set the floating-point environment.
2014-03-15 21:58:07 +00:00
Eitan Adler
cb0187afbb libusb: add libusb_log_level enum
This is documented on http://libusb.sourceforge.net/api-1.0/group__lib.html
2014-03-14 20:54:15 +00:00
Julio Merino
f5fd950e35 Make bsd.test.mk the only public mk fragment for the building of tests.
Change {atf,plain,tap}.test.mk to be internal implementation details of
bsd.test.mk.  Makefiles that build tests should now only include bsd.test.mk
and declaratively specify what they want to build, without worrying about
the internal implementation of the mk files.

The reason for this change is to permit building test programs of different
interfaces from a single directory, which is something I had a need for
while porting tests over from src/tools/regression/.

Additionally, this change makes it possible to perform some other requested
changes to bsd.test.mk in an easier manner.  Coming soon.
2014-03-14 08:56:19 +00:00
Eitan Adler
dda5b39711 multiple: Remove 3rd clause from BSD license where approved by the
regents and renumber.

This patch skips files in contrib/ and crypto/

Acked by:	imp
Discussed with:	emaste
2014-03-14 03:07:51 +00:00
Gleb Smirnoff
2c284d9395 Remove IPX support.
IPX was a network transport protocol in Novell's NetWare network operating
system from late 80s and then 90s. The NetWare itself switched to TCP/IP
as default transport in 1998. Later, in this century the Novell Open
Enterprise Server became successor of Novell NetWare. The last release
that claimed to still support IPX was OES 2 in 2007. Routing equipment
vendors (e.g. Cisco) discontinued support for IPX in 2011.

Thus, IPX won't be supported in FreeBSD 11.0-RELEASE.
2014-03-14 02:58:48 +00:00
David Xu
ddf06178e0 To avoid missing a chance to cancel thread, call _pthread_testcancel at the
beginning of _sem_timedwait.

Submitted by:	Eric van Gyzen < eric at vangyzen dot net >
MFC after:	3 days
2014-03-13 06:54:10 +00:00
Julio Merino
76a1f42f3f Make ether_line really report an error when all input is invalid.
The previous code failed to return an error condition when the whole input
was invalid due to improper handling of the sscanf return value.  Actually,
this failure was properly being caught by a test in
tools/regression/lib/libc/net/test-ether.t but was not noticed because
these tests are never run.  (On my way to fixing that ;-)

The fix applied here resembles the implementation of ether_line in NetBSD
modulo the setting of an errno value (which is not documented as an
expectation in the manpage anyway).
2014-03-12 12:27:13 +00:00
Tycho Nightingale
762fd20804 Replace the userspace atpic stub with a more functional vmm.ko model.
New ioctls VM_ISA_ASSERT_IRQ, VM_ISA_DEASSERT_IRQ and VM_ISA_PULSE_IRQ
can be used to manipulate the pic, and optionally the ioapic, pin state.

Reviewed by:	jhb, neel
Approved by:	neel (co-mentor)
2014-03-11 16:56:00 +00:00
Bryan Drewery
b36853caf1 Support Last-Modified behind proxies which return UTC instead of GMT.
The standard states that GMT must be used, but that UTC is equivalent. Still
parse UTC as otherwise this causes problems for pkg(8). It will refetch
the repository every time 'pkg update' or other remote operations
are used behind these proxies.

RFC2616: "All HTTP date/time stamps MUST be represented in Greenwich Mean
Time (GMT), without exception. For the purposes of HTTP, GMT is exactly equal
to UTC (Coordinated Universal Time).""

Approved by:	bapt (mentor)
Reviewed by:	des, peter
Sponsored by:	EMC / Isilon Storage Division
MFC after:	1 week
2014-03-11 13:47:11 +00:00
Eitan Adler
801a8f9497 libbsdstat: fix warnings, set WARNS
libbsdstat can build with WARNS=6 with a one line change.
2014-03-11 01:10:44 +00:00
Andrew Turner
2ab2eea1d9 Export _libc_arm_fpu_present as a private symbol to be used by other
system libraries, for example libm.
2014-03-11 00:21:49 +00:00
John-Mark Gurney
41f554961d various formating fixes, use NUL for NUL bytes..
drop out dated perf numbers (can't imagine people are still running
Pentium MMX 166's anymore)...

bump date...

drop max length of salt of 8 since _PASSWORD_LEN is now large, 128..
and state the max length of the salt depends upon the module,
sha-{256,512} have a max salt of 16..

recommend 8 characters of salt instead of just 2...

MFC after:	1 week
2014-03-09 07:45:59 +00:00
Eitan Adler
063aa3dfd2 libc man pages: Remove reference to non-existent FreeBSD Security
Architecture

MFC After:	3 days
2014-03-07 15:35:54 +00:00
Jilles Tjoelker
c8a17392cb fts: Don't abort if an empty pathname is given.
Make fts_open(3) treat an empty pathname like any other pathname that cannot
be lstatted because of [ENOENT].

It is rather confusing if  rm -rf file1 "" file2  does not remove file1 and
file2.

PR:		bin/187264
MFC after:	2 weeks
2014-03-06 22:47:11 +00:00
Jeremie Le Hen
dd3d4ecb61 Let __bt_put() accept the R_SETCURSOR flag, as stated in the dbopen(3) manpage.
While here, update the comment above with all the accepted flags.

Reviewed by:	silence on hackers@
MFC after:	2 weeks
2014-03-06 07:44:45 +00:00
Adrian Chadd
81bd3d89e8 Add 'libstatfoo' from Sam Leffler. 2014-03-06 04:06:36 +00:00
Xin LI
41de1082f4 Add a manual page for zopen(3) provided by our libz.so. 2014-03-06 00:25:21 +00:00
Marcel Moolenaar
8876613dc5 Replace use of ${.CURDIR} by ${LIBC_SRCTOP} and define ${LIBC_SRCTOP}
if not already defined. This allows building libc from outside of
lib/libc using a reach-over makefile.

A typical use-case is to build a standard ILP32 version and a COMPAT32
version in a single iteration by building the COMPAT32 version using a
reach-over makefile.

Obtained from:	Juniper Networks, Inc.
2014-03-04 02:19:39 +00:00
Robert Watson
09b46be1cd When querying a process's umask via sysctl in libprocstat(), don't
print a warning if EPERM is returned as this is an expected failure
mode rather than error -- similar to current handling of ESRCH.
This makes the output of 'procstat -as' vastly more palatable.

MFC after:	3 days
Sponsored by:	DARPA, AFRL
2014-03-02 13:26:08 +00:00
Xin LI
73f0a83d68 MFV r262639: ncurses 5.9 20140222 snapshot.
Requested by:	bapt
2014-03-02 08:58:21 +00:00
Tijl Coosemans
4b6e82c521 Silence the gcc warning about unsigned comparison with 0 in a different
way because mnemonic_ext_size isn't a preprocessor macro.

MFC after:	3 days
2014-03-01 13:23:52 +00:00
Xin LI
06bfebdedb MFV r262617: ncurses 5.9. 2014-02-28 23:48:13 +00:00
Dimitry Andric
e40a3fc365 Merge from head up to r262611. 2014-02-28 17:46:56 +00:00
Benjamin Kaduk
af1e239814 syncer(4) is a kernel process, not a user process
Noticed by: Geoffrey Thomas <gthomas@mokafive.com>
Approved by:	hrs (mentor)
2014-02-27 04:06:34 +00:00
Dimitry Andric
bdc74e2bc0 Merge from head up to r262536. 2014-02-26 22:26:40 +00:00
Ed Maste
6ec4f0a5fa 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-02-26 16:09:54 +00:00
Neel Natu
dc50650607 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.

The order of event injection into the guest is:
- hardware exception
- NMI
- maskable interrupt

In the Intel VT-x case, a pending NMI or interrupt will enable the interrupt
window-exiting and inject it as soon as possible after the hardware exception
is injected. Also since interrupts are inherently asynchronous, injecting
them after the hardware exception should not affect correctness from the
guest perspective.

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.

Discussed with:	grehan, jhb
Reviewed by:	jhb
2014-02-26 00:52:05 +00:00
Dimitry Andric
c3bb517174 Merge from head up to r262472. 2014-02-25 07:40:37 +00:00
Xin LI
b37cb98186 Wrap for loop in #if block testing the size is actually greater
than 0.  This silences gcc warning.

Reviewed by:	sha256(1) with clang
X-MFC-With:	r262447
2014-02-25 01:11:05 +00:00
Xin LI
882e4d2b26 Revert 262462 and 262461, they didn't solve the problem, in
fact I should actually waited the build to be finished before
committing.

A proper fix would be committed once my test build passes.

Pointy hat to:	delphij
2014-02-25 00:57:06 +00:00
Xin LI
9585cd10d4 Patch 2/2:
Reindent the code after previous change.

X-MFC-With:	r262447
2014-02-24 23:58:07 +00:00
Xin LI
5ce96980eb Patch 1/2:
Pet gcc: enclose the for loop that currently do nothing with an if.

Reviewed by:	sha256(1)
X-MFC-With:	r262447
2014-02-24 23:56:09 +00:00
Tijl Coosemans
0006340d93 Fix an array index out of bounds bug in iconv VIQR (Vietnamese) module.
PR:		185964
Submitted by:	Manuel Mausz <manuel-freebsd@mausz.at>
MFC after:	5 days
2014-02-24 14:40:28 +00:00
Tijl Coosemans
93da8bdca8 Fix Simplified Chinese character set conversions by switching around the
fields of an internal struct so it corresponds with the way variables of
this type are initialised.

PR:		185964
Submitted by:	Manuel Mausz <manuel-freebsd@mausz.at>
MFC after:	5 days
2014-02-24 13:43:11 +00:00
Tijl Coosemans
64f204f9dd Consistently pass around context information using a simple pointer. This
fixes some dereferencing bugs in Chinese character set conversions.

PR:		185964
MFC after:	5 days
2014-02-24 13:33:20 +00:00
Dimitry Andric
892620150f Merge from head up to r262415. 2014-02-23 23:33:11 +00:00
Baptiste Daroussin
fa28fc04f6 Lower the level of WARNS to fix build with gcc 2014-02-23 22:50:22 +00:00
Baptiste Daroussin
d0bfcaf83e Remove libyaml, it has been replaced by libucl 2014-02-23 22:27:14 +00:00
Baptiste Daroussin
4ca4d6a814 Branch libucl to the build 2014-02-23 21:50:11 +00:00
Baptiste Daroussin
c99fb5f907 Import libucl into head
UCL is heavily infused by nginx configuration as the example of a convenient
configuration system. However, UCL is fully compatible with JSON format and is
able to parse json files.

UCL is used by pkg(8) for its configuration file as well for the manifest format
in packages, it will be used in base for the pkg boostrap (signature checking
and configuration file parsing.)

libucl has been developped and is maintained by vsevolod@
2014-02-23 21:49:21 +00:00
Dimitry Andric
9bc21aae69 Merge from head up to r262311. 2014-02-21 22:54:35 +00:00
Dimitry Andric
6202fb7bd3 In lib/msun/ld128/s_expl.c, remove '/*' within block comment, to avoid a
warning.
2014-02-21 21:54:36 +00:00
Dimitry Andric
2882a0d33c For lib/msun, turn off warnings about unknown pragmas, since
lib/msun/src/e_sqrtl.c uses an unsupported STDC FENV_ACCESS pragma.
2014-02-21 18:49:08 +00:00
Christian Brueffer
9cba0f9670 Match the correct variable to the variable description.
PR:		121173
Submitted by:	Thomas Mueller <tmueller at sysgo.com>
MFC after:	1 week
2014-02-21 13:53:41 +00:00
Dimitry Andric
19e61966d6 In lib/libc/sparc64/sys/__sparc_utrap_setup.c, avoid an error about
passing a pointer to a const object to sysarch().
2014-02-20 23:02:42 +00:00
Dimitry Andric
137470fbfb Add Makefile glue to build the Sparc backend libraries and link them
into the clang executable.
2014-02-20 22:22:39 +00:00
Ed Maste
895c202ef7 Update LLDB bmake build for r262187
Sponsored by:	DARPA, AFRL
2014-02-18 19:58:01 +00:00
Dimitry Andric
f785676f2a Upgrade our copy of llvm/clang to 3.4 release. This version supports
all of the features in the current working draft of the upcoming C++
standard, provisionally named C++1y.

The code generator's performance is greatly increased, and the loop
auto-vectorizer is now enabled at -Os and -O2 in addition to -O3.  The
PowerPC backend has made several major improvements to code generation
quality and compile time, and the X86, SPARC, ARM32, Aarch64 and SystemZ
backends have all seen major feature work.

Release notes for llvm and clang can be found here:
<http://llvm.org/releases/3.4/docs/ReleaseNotes.html>
<http://llvm.org/releases/3.4/tools/clang/docs/ReleaseNotes.html>

MFC after:	1 month
2014-02-16 19:44:07 +00:00
Dag-Erling Smørgrav
e401beb723 Switch the hardcoded default hash function from MD5 / DES to SHA512. 2014-02-15 10:53:44 +00:00
John-Mark Gurney
ad6a53db5f document _JAIL as a possible option to set a cpuset for a jail..
MFC after:	3 days
2014-02-15 07:01:45 +00:00
Julio Merino
1a61beb054 MFV: Import atf-0.20. 2014-02-14 19:33:16 +00:00
Eitan Adler
1748334408 libutil/pw_util.3: Fix two prototypes.
Reported by:	marino
Obtained from:	DragonFlyBSD (e82b5d3dfa969bfcda5ffadceccc682b6bdcd077)
MFC After:	3 days
2014-02-13 05:13:22 +00:00
Gleb Smirnoff
9292aad4c9 Add kvm_getncpus() to obtain mp_ncpus.
Sponsored by:	Nginx, Inc.
2014-02-12 19:22:48 +00:00
Ed Maste
4842a3220d Add bounds check for pteindex / pdeindex 2014-02-12 15:57:38 +00:00
Gleb Smirnoff
19b5cffe0b While it isn't too late and kvm_read_zpcpu() function isn't yet used
outside libkvm(3), change its order of arguments, so that it is the
same as in kvm_read().

Sponsored by:	Nginx, Inc.
2014-02-12 09:41:17 +00:00
John-Mark Gurney
d5ad10055b add support for building a cross-gdb for ARM... This isn't hooked up
to xdev yet as I don't know how to make it work properly...  It also
isn't heavily tested...

Reviewed by:	silence on -arm
2014-02-12 02:08:42 +00:00
Gleb Smirnoff
345e3f4dd7 Expose real size of UMA allocations via libmemstat(3).
Sponsored by:	Nginx, Inc.
2014-02-10 20:09:10 +00:00
Pawel Jakub Dawidek
5564ef953a Fix descriptor leak. 2014-02-09 21:47:46 +00:00
Ed Maste
2cd0384caf Build libstand as a 64-bit library on ppc64
The 32-bit bootloaders now link against libstand.a in sys/boot/libstand32,
so there is no need to force /usr/lib/libstand.a to be 32-bit.

This is equivalent to r261568 for amd64.

Sponsored by:	The FreeBSD Foundation
2014-02-09 16:37:17 +00:00
Kevin Lo
71099ec509 Set errno on inet_ntop(3) failure.
Reviewed by:	glebius
2014-02-07 15:26:19 +00:00
Nathan Whitehorn
67237d47e5 Make libstand setjmp work for both 64- and 32-bit ABIs. 2014-02-07 14:24:36 +00:00
Jilles Tjoelker
5de8a0fdf4 fts: Fix double-free with conflicting concurrent modifications.
If rare conditions such as concurrent conflicting manipulation of the
filesystem occur, fts_read() frees the current FTSENT without adjusting
the pointers in the FTS accordingly. A later fts_close() then frees the
same FTSENT again.

Reported by:	pho
Tested by:	pho
MFC after:	1 week
2014-02-07 13:40:22 +00:00
Ed Maste
65823381b8 Build libstand as a 64-bit library on amd64
The 32-bit bootloaders now link against libstand.a in sys/boot/libstand32,
so there is no need to force /usr/lib/libstand.a to be 32-bit.

Sponsored by:	The FreeBSD Foundation
2014-02-06 21:57:27 +00:00
Ian Lepore
b1526b43e8 Set the malloc alignment to 64 bytes on platforms that use the U-Boot API
device drivers.  Recent versions of u-boot run with the MMU enabled, and
require DMA-based I/O to be aligned to cache line boundaries.

These changes are based on a patch originally submitted by Juergen Weiss,
but I reworked them and thus any problems are purely my fault.

Submitted by:	"Juergen Weiss" <weiss@uni-mainz.de>
Reviewed by:	imp, nwhitehorn, jhb
2014-02-05 22:53:58 +00:00
John Baldwin
00f3efe1bd Add support for FreeBSD/i386 guests under bhyve.
- Similar to the hack for bootinfo32.c in userboot, define
  _MACHINE_ELF_WANT_32BIT in the load_elf32 file handlers in userboot.
  This allows userboot to load 32-bit kernels and modules.
- Copy the SMAP generation code out of bootinfo64.c and into its own
  file so it can be shared with bootinfo32.c to pass an SMAP to the i386
  kernel.
- Use uint32_t instead of u_long when aligning module metadata in
  bootinfo32.c in userboot, as otherwise the metadata used 64-bit
  alignment which corrupted the layout.
- Populate the basemem and extmem members of the bootinfo struct passed
  to 32-bit kernels.
- Fix the 32-bit stack in userboot to start at the top of the stack
  instead of the bottom so that there is room to grow before the
  kernel switches to its own stack.
- Push a fake return address onto the 32-bit stack in addition to the
  arguments normally passed to exec() in the loader.  This return
  address is needed to convince recover_bootinfo() in the 32-bit
  locore code that it is being invoked from a "new" boot block.
- Add a routine to libvmmapi to setup a 32-bit flat mode register state
  including a GDT and TSS that is able to start the i386 kernel and
  update bhyveload to use it when booting an i386 kernel.
- Use the guest register state to determine the CPU's current instruction
  mode (32-bit vs 64-bit) and paging mode (flat, 32-bit, PAE, or long
  mode) in the instruction emulation code.  Update the gla2gpa() routine
  used when fetching instructions to handle flat mode, 32-bit paging, and
  PAE paging in addition to long mode paging.  Don't look for a REX
  prefix when the CPU is in 32-bit mode, and use the detected mode to
  enable the existing 32-bit mode code when decoding the mod r/m byte.

Reviewed by:	grehan, neel
MFC after:	1 month
2014-02-05 04:39:03 +00:00
Eitan Adler
7059326b09 libc/net: fix a portability issue
* POSIX does not require socklen_t to be  unsigned

Submitted by:	bde
MFC After:	1 week (with r261454)
2014-02-05 02:00:31 +00:00
Eitan Adler
c6c4136a0a libc/net: Fix some issues in inet6_opt_init() (from RFC 3542):
* The RFC says (in section 10.1) that only when extbuf is not NULL,
extlen shall be checked, so don't perform this check when NULL is
passed.

* socklen_t is unsigned, so checking extlen for less than zero is
not needed.

Submitted by:	swildner@dragonflybsd.org
Reviewed by:	Mark Martinec <Mark.Martinec+freebsd@ijs.si>
Reviewed by:	hrs
Obtained by:	DragonFlyBSD
2014-02-04 03:01:33 +00:00
Christian Brueffer
a578215eed Fix a typo.
MFC after:	1 week
2014-02-03 22:16:46 +00:00
Pawel Jakub Dawidek
3d34ecea9a Assert input arguments to buf_send() and buf_recv().
Submitted by:	Mariusz Zaborski <oshogbo@FreeBSD.org>
2014-02-02 19:06:00 +00:00
Pawel Jakub Dawidek
7f7fe890a5 Fix sending empty nvlist.
Submitted by:	Mariusz Zaborski <oshogbo@FreeBSD.org>
2014-02-02 19:03:52 +00:00
Konstantin Belousov
082aa03e4b In _pthread_kill(), if passed pthread is current thread, do not send
the signal second time, by adding the missed else before if statement.

While there, postpone initializing local curthread variable until
passed signal number is checked for validity.

Submitted by:	John Wolfe <jlw@xinuos.com>
PR:	threads/186309
MFC after:	1 week
2014-02-01 18:13:18 +00:00
Ulrich Spörlein
9837d07131 Merge mdocml v1.12.3 into head
MFC after:	2 weeks
2014-02-01 09:27:57 +00:00
Justin Hibbits
169dd953b0 Add hwpmc(4) support for the PowerPC 970 class processors, direct events.
This also fixes asserts on removal of the module for the mpc74xx.

The PowerPC 970 processors have two different types of events: direct events
and indirect events.  Thus far only direct events are supported.  I included
some documentation in the driver on how indirect events work, but support is
for the future.

MFC after:	1 month
2014-02-01 02:03:50 +00:00
Brooks Davis
38e233371c Merge from CheriBSD:
commit c1acf022c5
Author: Brooks Davis <brooks@one-eyed-alien.net>
Date:   Fri Jan 17 21:46:44 2014 +0000

    Add an option WITHOUT_NCURSESW to suppress building and linking to
    libncursesw.  While wide character support it useful we'd like to
    only need one ncurses library on embedded systems.

MFC after:	4 weeks
Sponsored by:	DARPA, AFRL
2014-01-30 21:08:36 +00:00
Konstantin Belousov
49d39308ba The posix_madvise(3) and posix_fadvise(2) should return error on
failure, same as posix_fallocate(2).

Noted by:	Bob Bishop <rb@gid.co.uk>
Discussed with:	bde
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2014-01-30 18:04:39 +00:00
Dag-Erling Smørgrav
4524013cd3 Bump copyright dates 2014-01-30 08:37:23 +00:00
Dimitry Andric
4f7ab58ee6 Import libc++ 3.4 release. This contains a lot of bugfixes, and some
preliminary support for C++1y.

MFC after:	3 weeks
2014-01-30 07:44:22 +00:00
John Baldwin
3cbf3585cb Enhance the support for PCI legacy INTx interrupts and enable them in
the virtio backends.
- Add a new ioctl to export the count of pins on the I/O APIC from vmm
  to the hypervisor.
- Use pins on the I/O APIC >= 16 for PCI interrupts leaving 0-15 for
  ISA interrupts.
- Populate the MP Table with I/O interrupt entries for any PCI INTx
  interrupts.
- Create a _PRT table under the PCI root bridge in ACPI to route any
  PCI INTx interrupts appropriately.
- Track which INTx interrupts are in use per-slot so that functions
  that share a slot attempt to distribute their INTx interrupts across
  the four available pins.
- Implicitly mask INTx interrupts if either MSI or MSI-X is enabled
  and when the INTx DIS bit is set in a function's PCI command register.
  Either assert or deassert the associated I/O APIC pin when the
  state of one of those conditions changes.
- Add INTx support to the virtio backends.
- Always advertise the MSI capability in the virtio backends.

Submitted by:	neel (7)
Reviewed by:	neel
MFC after:	2 weeks
2014-01-29 14:56:48 +00:00
Dag-Erling Smørgrav
9c1ca3a1dd r261230 broke the cases where the amount of data to be read is not
known in advance, or where the caller doesn't care and just keeps
reading until it hits EOF.

In fetch_read(): the socket is non-blocking, so read() will return 0
on EOF, and -1 (errno == EAGAIN) when the connection is still open but
there is no data waiting.  In the first case, we should immediately
return 0.  The EINTR case was also broken, although not in a way that
matters.

In fetch_writev(): use timersub() and timercmp() as in fetch_read().

In http_fillbuf(): set errno to a sensible value when an invalid chunk
header is encountered.

In http_readfn(): as in fetch_read(), a zero return from down the
stack indicates EOF, not an error.  Furthermore, when io->error is
EINTR, clear it (but no errno) before returning so the caller can
retry after dealing with the interrupt.

MFC after:	3 days
2014-01-29 12:48:19 +00:00
Ulrich Spörlein
d7d8b00bec mdoc: fix several uses of the Fx macro to point to actual releases.
Found by:  make manlint
2014-01-28 21:40:10 +00:00
Kai Wang
ca82a53f82 MFH@261240. 2014-01-28 19:12:31 +00:00
Dag-Erling Smørgrav
215a27f1a4 Solve http buffering issues and hangs once and for all (hopefully!) by
simply not trying to return exactly what the caller asked for - just
return whatever we got and let the caller be the judge of whether it
was enough.  If an error occurs or the connection times out after we
already received some data, return a short read, under the assumption
that the next call will fail or time out before we read anything.

As it turns out, none of the code that calls fetch_read() assumes an
all-or-nothing result anyway, except for a couple of lines where we
read the CR LF at the end of a hunk in HTTP hunked encoding, so the
changes outside of fetch_read() and http_readfn() are minimal.

While there, replace select(2) with poll(2).

MFC after:	3 days
2014-01-28 12:48:17 +00:00
Hans Petter Selasky
7766d56803 Comply to the official LibUSB v1.0 API:
"It is legal to attempt to claim an already-claimed interface."

MFC after:	1 week
2014-01-28 07:21:46 +00:00
Gregory Neil Shapiro
7d9b9991b6 Add new sendmail 8.14.8 file
MFC after:	5 days
2014-01-26 23:40:31 +00:00
Andrew Turner
a541d15cfe * Mark static inline functions with __fenv_static.
* Correctly shift the mask when masking/unmasking exceptions.
2014-01-25 18:13:43 +00:00
Andrew Turner
cd82739201 Use __fenv_static for all static inline functions. 2014-01-25 16:03:08 +00:00
Kai Wang
a36ae249b8 MFH@261151. 2014-01-25 14:02:02 +00:00
Bryan Drewery
f4b1bf3375 Add MLINK for fdclosedir.3 to directory.3 and sort fdopendir(3) entry.
Reported by:	bde
Approved by:	bapt (mentor)
2014-01-24 22:37:35 +00:00
Konstantin Belousov
2852de0489 The posix_fallocate(2) syscall should return error number on error,
without modifying errno.

Reported and tested by:	Gennady Proskurin <gpr@mail.ru>
Reviewed by:	mdf
PR:	standards/186028
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2014-01-23 17:24:26 +00:00
Sergey Kandaurov
dccae053f7 Update EINVAL description.
This matches current POSIX standards and actual FreeBSD behavior.

MFC after:	1 week
2014-01-23 09:37:03 +00:00
Jason Evans
f921d10f48 Update jemalloc to version 3.5.0. 2014-01-23 02:47:36 +00:00
Kai Wang
88d795a0a4 Bump SHLIB_MAJOR for libelf. 2014-01-21 21:13:13 +00:00
Kai Wang
be11621376 Bump SHLIB_MAJOR for libdwarf as ABI/API has changed. 2014-01-21 21:11:07 +00:00
Kai Wang
6eabfa9670 Reapply revisions r237528, r237531 and r238741 which make libelf
properly include sys/ headers from the source tree instead of the
host.

These patches are also applied to libdwarf since libdwarf requires
the same sys/ headers as libelf.
2014-01-21 20:42:15 +00:00
Kai Wang
a1abeb052e Remove INCSDIR variable which is only used in elftoolchain's own build
framework.
2014-01-21 20:23:39 +00:00
Kai Wang
945a2095f6 MFH@260917. 2014-01-20 19:38:44 +00:00
Nathan Whitehorn
0894229871 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.

Comments and suggestions by:	grehan, dteske, jilles
MFC after:	1 month
2014-01-20 18:15:06 +00:00
Dag-Erling Smørgrav
3443b2bc31 Fix format string.
Submitted by:	Jörg Sonnenberger <joerg@NetBSD.org>
MFC after:	1 week
2014-01-20 11:13:05 +00:00
Ed Schouten
37656b872b Replace LIBGCC by LIBCOMPILER_RT.
We now use libcompiler_rt on all platforms now. Instead of referring
directly to -lgcc and LIBGCC, use -lcompiler_rt and LIBCOMPILER_RT.
2014-01-18 14:22:56 +00:00
Kai Wang
fbb4c451b3 Remove the old libdwarf and bring in the new libdwarf in contrib/. 2014-01-16 21:52:09 +00:00
Marcel Moolenaar
0b6a0ca072 Handle truncation of the size returned by _kvm_kvatop(). Cores can have
segments larger than INT_MAX.
2014-01-16 06:26:03 +00:00
Kai Wang
7c4a6907ee Set CFLAGS in just one line. 2014-01-15 22:47:53 +00:00
Kai Wang
edbef29b9b Removed source code for the old libelf and build the new libelf from
contrib/ instead.
2014-01-15 22:35:55 +00:00
Jilles Tjoelker
e852d6bc48 libc/resolv: Use poll() instead of kqueue().
The resolver in libc creates a kqueue for watching a single file descriptor.
This can be done using poll() which should be lighter on the kernel and
reduce possible problems with rlimits (file descriptors, kqueues).

Reviewed by:	jhb
2014-01-14 22:05:33 +00:00
Xin LI
df48f4170e ANSI-fy prototype.
MFC after:	2 weeks
2014-01-14 01:52:34 +00:00
Marcel Moolenaar
cfe2be2b5e We don't have to worry about page sizes when working on virtual
cores (i.e. minidumps). Every segment is virtually contiguous.
2014-01-13 19:02:31 +00:00
Marcel Moolenaar
f864e2ab73 Re-apply the part of r260022 that was reverted by r260030 with
one significant difference: for LIB32 builds both TARGET_ARCH
and MACHINE_ARCH are defined. TARGET_ARCH confusingly holds the
architecture of the host (e.g. amd64), while MACHINE_ARCH holds
the architecture were trying to build (e.g. i386). With both
set and different, r260022 changed the behaviour to interpret
the condition as building a cross-amd64 libkvm on i386, when
obviously we're trying to build an i386 version on amd64. When
COMPAT_32BIT is defined, we're building LIB32 and ignore the
value of TARGET_ARCH as we did before.
2014-01-13 19:01:14 +00:00
Julio Merino
e1380b00f6 Generate and install pkg-config files for atf.
These files are required to get packages in ports to build against atf and
also to get a couple of currently-failing tests to pass.

I'm following the approach already used by the libusb pkg-config files
installed by the system regarding the location and the install rules.

MFC after:	5 days
2014-01-12 21:56:26 +00:00
Jilles Tjoelker
f6e989a6e2 fts(3): Remove stray mentions of the obsolete fts_bignum. 2014-01-12 20:47:08 +00:00
Jilles Tjoelker
54cc1f8864 fts: Stat things relative to the directory fd, if possible.
As a result, the kernel needs to process shorter pathnames if fts is not
changing directories (if fts follows symlinks (-L option to utilities), fts
cannot open "." or FTS_NOCHDIR was specified).

Side effect: If pathnames exceed PATH_MAX, [ENAMETOOLONG] is not hit at the
stat stage but later (opendir or application fts_accpath) or not at all.
2014-01-12 20:30:55 +00:00
Jilles Tjoelker
b83686c8fe Add some missing .Nm for newer syscalls in existing man pages.
MFC after:	1 week
2014-01-11 22:00:16 +00:00
John-Mark Gurney
fd9e2c6a4a use a real uint64_t instead of writing code to emulate one..
I verified w/ a:
dd if=/dev/zero bs=1m count=5000 | sha256
a33351fafd00e4c4bcdee2a1c5d019026500f8cdfeaf91a9b8dbbb2619429659

Reviewed by:	cperciva
MFC after:	1 week
2014-01-11 20:49:22 +00:00
David Chisnall
e23d53c461 Add missing C++11 typeinfos to the libcxxrt version script.
PR:		185663
MFC after:	1 week
2014-01-11 19:02:17 +00:00
Julio Merino
b17b15d8ea Fix path to the process_helpers for the libatf-c++ tests.
Because we respect the FreeBSD src tree layout under /usr/tests, and because
the layout of the tests in the atf distfile does not match the former, the
tests for atf-c++ were not able to find the process_helper binary.

Fix this by explicitly hardcoding the right path in the FreeBSD test suite.

Obtained from:	atf (git 1f0e878f7f127741a3762883ef24aef317e239d5)
MFC after:	1 week
2014-01-10 23:41:01 +00:00
Julio Merino
762c167ede Respect the original layout of the atf-{c,c++} tests.
Put test programs for internal modules into a 'detail' subdirectory of the
libatf-c and libatf-c++ test directories, just as the upstream distribution
does.  This is necessary because the tests assume such layout to find the
process_helper program, and currently fail because of this divergence.

MFC after:	1 week
2014-01-10 23:38:33 +00:00
John-Mark Gurney
4e5422a9e6 make sure that rbuf is aligned by making a union w/ the structure we
need to access...  access the struct through the union too...

PR:		185165
Submitted by:	Guy Yur
MFC after:	1 week
2014-01-07 23:01:05 +00:00
Dimitry Andric
4abd7edcbd Split the last gcc-specific flags off into CFLAGS.gcc. This also
removes the need to use -Qunused-arguments for clang throughout the
tree.

MFC after:	3 days
2014-01-05 21:03:49 +00:00
Hans Petter Selasky
03205428b8 Implement two new libusb API functions.
PR:		usb/185454
MFC after:	2 weeks
2014-01-05 10:41:43 +00:00
Michael Tuexen
1dd0c90501 Fix several bugs in sctp_bindx():
* Set errno to EAFNOSUPPORT if an address is provided which is neither
  AF_INET nor AF_INET6.
* Don't modify the arguments.
* Don't smash the stack when provided with a non-zero port.
* Handle the case correctly where the first address provided is
  an IPv6 address.

MFC after: 3 days
2014-01-04 11:39:59 +00:00
Pawel Jakub Dawidek
93b3fdba4a MFp4 @1189741:
- Add missing nvlist_destroy().
- Don't override nvlout.

Submitted by:	Mariusz Zaborski <oshogbo@FreeBSD.org>
MFC after:	3 days
2014-01-03 09:10:04 +00:00
Pawel Jakub Dawidek
3ae9762b9a MFp4 @1189711:
Fix resource leaks on nvlist_destroy().

Reported by:	Mariusz Zaborski <oshogbo@FreeBSD.org>
MFC after:	3 days
2014-01-03 09:07:03 +00:00
Xin LI
f4c8ba8370 MFV r259170:
4370 avoid transmitting holes during zfs send

4371 DMU code clean up

illumos/illumos-gate@43466aae47

NOTE: Make sure the boot code is updated if a zpool upgrade is
done on boot zpool.

MFC after:	2 weeks
2014-01-01 00:45:28 +00:00
Dimitry Andric
33fa48314f Vendor import of clang RELEASE_34/final tag r197956 (effectively, 3.4 release):
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_34/final@197956
2014-01-01 00:37:42 +00:00
Dimitry Andric
512b84fc6c Vendor import of llvm RELEASE_34/final tag r197956 (effectively, 3.4 release):
https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_34/final@197956
2014-01-01 00:36:21 +00:00
Steve Kargl
1531aa5f6a * msun/man/cosh.3:
* msun/man/sinh.3:
* msun/man/tanh.3:
  . Fix grammar.

* msun/src/e_coshl.c:
* msun/src/e_sinhl.c:
  . Fix comment.

* msun/src/s_tanhl.c:
  . Remove unused variables.
  . Fix location/indentation of comments.
  . Use comparison involving ints instead of long double.
  . Re-order polynomial evaluation on ld128 for |x| < 0.25.
    For now, retain the older order in an "#if 0 ... #else" block.
  . Use int comparison to short-circuit the |x| < 1.5 condition.

Requested by:	bde
2013-12-31 23:59:33 +00:00
Steve Kargl
36af656535 Fix a mismerge of my local doc changes to msun/man/sinh.3. 2013-12-30 17:11:36 +00:00
Steve Kargl
a48e1f224c * Makefile:
. Hook coshl, sinhl, and tanhl into libm.
  . Create symbolic links for corresponding manpages.
  . While here remove a nearby extraneous space.

* Symbol.map:
* src/math.h:
  . Move coshl, sinhl, and tanhl to their proper locations.

* man/cosh.3:
* man/sinh.3:
* man/tanh.3:
  . Update the manpages.

* src/e_cosh.c:
* src/e_sinh.c:
* src/s_tanh.c:
  . Add weak reference for LBDL_MANT_DIG==53 targets.

* src/imprecise.c:
  . Remove the coshl, sinhl, and tanhl kludge.

* src/e_coshl.c:
  . ld80 and ld128 implementation of coshl().

* src/e_sinhl.c:
  . ld80 and ld128 implementation of sinhl().

* src/s_tanhl.c:
  . ld80 and ld128 implementation of tanhl().

Obtained from:	bde (mostly), das and kargl
2013-12-30 01:06:21 +00:00
Steve Kargl
5f63fbd67f * ld80/k_expl.h:
* ld128/k_expl.h:
  . Split out a computational kernel,__k_expl(x, &hi, &lo, &k) from expl(x).
    x must be finite and not tiny or huge.  The kernel returns hi and lo
    values for extra precision and an exponent k for a 2**k scale factor.
  . Define additional kernels k_hexpl() and hexpl() that include a 1/2
    scaling and are used by the hyperbolic functions.

* ld80/s_expl.c:
* ld128/s_expl.c:
  . Use the __k_expl() kernel.

Obtained from:	bde
2013-12-30 00:51:25 +00:00
Marcel Moolenaar
71694e554d Revert part of r260022: LIB32 builds were broken by it. 2013-12-29 03:15:15 +00:00
Marcel Moolenaar
5f96573141 Add support for virtual cores (aka minidumps). To that end, refactor this
file as follows:
1.  Common ia64-specific support functions have the ia64_ prefix.
2.  Functions that work on physical cores have the phys_ prefix.
3.  Functions that work on virtual cores have the virt_ prefix.

With that:
1.  _kvm_kvatop() has been renamed to phys_kvatop() as it handles
    physical cores only.
2.  The new _kvm_kvatop() is nothing but a wrapper that calls either
    phys_kvatop() or virt_kvatop() by virtue of the kvatop function
    pointer in the vmstate structure.
3.  virt_kvatop() is nothing but a wrapper around virt_addr2off().
4.  virt_addr2off() iterates over the Phdrs to find the segment in
    which the address falls and return the file offset for it.

Now it's up to the kernel to populate the core file appropriately.
2013-12-29 02:31:40 +00:00
Marcel Moolenaar
4081b25521 Allow building a cross libkvm for ia64. 2013-12-28 23:02:48 +00:00
Marcel Moolenaar
3f6558c489 Allow building a cross libkvm by setting TARGET_ARCH. The library so
produced will be called libkvm-${ARCH} instead of libkvm. This allows
installing it alongside the native version.
For symbol lookups, use ps_pglobal_lookup() instead of __fdnlist()
when building a cross libkvm. It is assumed that the cross tool that
uses the cross libkvm also provides an implementation for this
proc_services function.

Note that this commit does not change any of the architecture-specific
code for cross-compilation.
2013-12-28 23:01:57 +00:00
Dimitry Andric
b61949dd20 In libiconv_modules, surround unused static _citrus_XXX_pack_state() and
_citrus_XXX_unpack_state() functions with #if 0, for now.

MFC after:	3 days
2013-12-28 13:49:48 +00:00
Sergey Kandaurov
d3178d7d27 - Fix EBADF description, in following the future POSIX tc and what FreeBSD
actually implements.
- Improve grammar: use more preferred "can", not "could".

Submitted by:	jilles
2013-12-27 16:57:38 +00:00
Sergey Kandaurov
4ca1cd1d63 Fix an apparent typo.
MFC after:	3 days
2013-12-26 19:18:43 +00:00
Sergey Kandaurov
e44aa9fde0 Provide the manual page for aio_fsync(2).
Reviewed by:	davidxu
MFC after:	1 week
2013-12-26 19:16:30 +00:00
Dimitry Andric
0673132dcb For libstand and sys/boot, split off gcc-only flags into CFLAGS.gcc.
MFC after:	3 days
X-MFC-With:	r259730
2013-12-26 11:32:39 +00:00
Marcel Moolenaar
8a69c4ada4 Fix "kptdir is itself virtual" error, caused by having the kptdir in PBVM.
While here improve errors by having them include addresses (either virtual
or physical).
2013-12-26 07:10:54 +00:00
Sergey Kandaurov
6a4d909530 Fix a typo. 2013-12-25 19:38:16 +00:00
Sergey Kandaurov
ef6b3fcf0f For vmcore, calculate time relative to device creation upon time_uptime.
Previously it used a clock from live kernel.

MFC after:	2 weeks
2013-12-25 17:11:49 +00:00
Sergey Kandaurov
5acf8f8325 The compile time constant limit on number of swap devices was removed in 5.2.
As such, remove the EINVAL error saying so.  Currently the vm.nswapdev sysctl
just represents the number of added swap devices.

MFC after:	1 week
2013-12-25 16:01:29 +00:00
John Baldwin
330baf58c6 Extend the support for local interrupts on the local APIC:
- Add a generic routine to trigger an LVT interrupt that supports both
  fixed and NMI delivery modes.
- Add an ioctl and bhyvectl command to trigger local interrupts inside a
  guest.  In particular, a global NMI similar to that raised by SERR# or
  PERR# can be simulated by asserting LINT1 on all vCPUs.
- Extend the LVT table in the vCPU local APIC to support CMCI.
- Flesh out the local APIC error reporting a bit to cache errors and
  report them via ESR when ESR is written to.  Add support for asserting
  the error LVT when an error occurs.  Raise illegal vector errors when
  attempting to signal an invalid vector for an interrupt or when sending
  an IPI.
- Ignore writes to reserved bits in LVT entries.
- Export table entries the MADT and MP Table advertising the stock x86
  config of LINT0 set to ExtInt and LINT1 wired to NMI.

Reviewed by:	neel (earlier version)
2013-12-23 19:29:07 +00:00
Dimitry Andric
b294993d63 To avoid having to explicitly test COMPILER_TYPE for setting
clang-specific or gcc-specific flags, introduce the following new
variables for use in Makefiles:

CFLAGS.clang
CFLAGS.gcc
CXXFLAGS.clang
CXXFLAGS.gcc

In bsd.sys.mk, these get appended to the regular CFLAGS or CXXFLAGS for
the right compiler.

MFC after:	1 week
2013-12-22 17:51:33 +00:00
Dimitry Andric
bfef399519 Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
https://llvm.org/svn/llvm-project/cfe/branches/release_34@197841
2013-12-22 00:07:40 +00:00
Dimitry Andric
f8af5cf600 Vendor import of llvm release_34 branch r197841 (effectively, 3.4 RC3):
https://llvm.org/svn/llvm-project/llvm/branches/release_34@197841
2013-12-22 00:04:03 +00:00
Marcel Moolenaar
72cad431b8 Fix readdir for the root directory on a FAT32 file system. The root
directory is like any subdirectory and as such needs to use a real
cluster number. To this end, keep a DE structure for the root in
the DOS_FS structure and populate it accordingly.

While here:
o   allow consecutive path separators by skipping them all.
o   add missing $FreeBSD$ keyword to dosfs.h.
2013-12-19 05:23:10 +00:00
Marcel Moolenaar
07fb02c0d5 Fix an inappropriate free of a non-dynamic value. While here, make the
code more naive and robust:
1.  When setting ev_value, also always set ev_flags appropriately
2.  Always check ev_value and ev_flags before calling free.

Both the value and the EV_DYNAMIC property can come directly from the
consumers of the environment functionality, so it's good to be careful.
And since this code is typically not looked at for long periods of
time, it's good to have it be a little "dumb-looking".

Trigger case for the bug:
        env_setenv("foo", 0, "1", NULL, NULL);
        env_setenv("foo", 0, "2", NULL, NULL);

Obtained from:	Juniper Networks, Inc.
2013-12-18 17:03:43 +00:00
Ruslan Ermilov
0f987f1f08 shm_open(2): Fixed the history information.
While here, sort xrefs.

Reviewed by:	jhb
2013-12-18 12:18:17 +00:00
Marcel Moolenaar
983d2efd20 Clear f_rabuf after freeing the memory it points to. This prevents a
possible double free.

Obtained from:	Juniper Networks, Inc.
2013-12-18 04:52:30 +00:00
Marcel Moolenaar
157a2d49a0 Support long filenames.
Obtained from:	Juniper Networks, Inc.
2013-12-18 04:44:38 +00:00
Neel Natu
55888cfaa2 Rename the ambiguously named 'vm_setup_msi()' and 'vm_setup_msix()' to
'vm_setup_pptdev_msi()' and 'vm_setup_pptdev_msix()' respectively.

It should now be clear that these functions operate on passthru devices.
2013-12-18 03:58:51 +00:00
Neel Natu
4f8be175d5 Add an API to deliver message signalled interrupts to vcpus. This allows
callers treat the MSI 'addr' and 'data' fields as opaque and also lets
bhyve implement multiple destination modes: physical, flat and clustered.

Submitted by:	Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)
Reviewed by:	grehan@
2013-12-16 19:59:31 +00:00
Dimitry Andric
840f097103 Enable llvm's integrated assembler for PowerPC, since it should now be
good enough for typical usage.

Requested by:	rdivacky
MFC after:	1 week
2013-12-16 18:45:21 +00:00
Pawel Jakub Dawidek
518eeaeeca MFp4 @1189139:
Get rid of the msg_peek() function, which has a problem.  If there was less
data in the socket buffer than requested by the caller, the function would busy
loop, as select(2) will always return immediately.

We can just receive nvlhdr now, because some time ago we splitted receive of
data from the receive of descriptors.

MFC after:	1 week
2013-12-15 22:58:09 +00:00
Nathan Whitehorn
021c5b6dd0 Bump libcam shared library version forgotten in r259397.
Submitted by:	kib
2013-12-15 15:51:05 +00:00
Eitan Adler
0603b75a7a getopt_long.3: wording quibbles
- Make wording more clear: "is expect" vs "is expected" [1]
- Remove extraneous trailing period..

Reported by:	dim [1]
2013-12-13 21:50:03 +00:00
Hiroki Sato
a204967a65 Replace Sun RPC license with a 3-clause BSD license. This license change
was approved in 2010 by Wim Coekaerts, Senior Vice President, Linux and
Virtualization at Oracle Corporation.
2013-12-09 05:01:38 +00:00
Konstantin Belousov
a7afea4382 Do not force to run atexit handlers, which text comes from a dso
owning the handle passed to __cxa_finalize() but which are registered
by other dso, when the process is inside exit(3).

Running them makes the destruction order wrong, and there is hope that
such destructors would not call dlclose(3), since it is pointless at
this stage of the process existence.

The change effectively disables the r211706 after the exit(3) is
called.

Reported and tested by:	Michael Gmelin <freebsd@grem.de>
Analyzed by:	dim
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2013-12-06 21:26:57 +00:00
Joel Dahl
2727e97436 mdoc: remove EOL whitespace. 2013-12-06 21:22:33 +00:00
Ed Maste
04c171520d lldb: Threaded inferior support for FreeBSD
This is in the process of being submitted to the upstream LLDB
repository.  The thread list functionality is modelled in part on
GDBRemoteCommunicationClient.

LLDB bug pr16696 and code review D2267

Sponsored by:	DARPA, AFRL
2013-12-03 21:29:45 +00:00
John Baldwin
d4e3c0a2d7 Various updates and tweaks to the wait(2) manpage.
PR:		docs/183904
Submitted by:	Michael Galassi <michaelgalassi@gmail.com>
Reviewed by:	kib, wblock (earlier version)
2013-12-03 21:00:13 +00:00
Ed Maste
b952cd584f Update LLDB to upstream r196259 snapshot
Sponsored by:	DARPA, AFRL
2013-12-03 19:23:54 +00:00
Pawel Jakub Dawidek
fecba05b97 Fix comparisons in assertions.
Reported by:	Coverity
Coverity CID:	1130048
2013-12-03 13:26:37 +00:00
Pawel Jakub Dawidek
0f984a9260 Both libcasper and libcapsicum libraries have to be installed in /lib/,
as they are used by /sbin/casperd.
2013-12-02 17:07:22 +00:00
Pawel Jakub Dawidek
05af64096c Forgot to 'svn add' lib/libcasper/ directory.
Reported by:	glebius
2013-12-02 10:18:25 +00:00
Pawel Jakub Dawidek
42a8595256 Please welcome casperd daemon. It (and its services) will be responsible for
giving access to functionality that is not available in capability mode
sandbox. The functionality can be precisely restricted.

Start with the following services:
- system.dns - provides API compatible to:
	- gethostbyname(3),
	- gethostbyname2(3),
	- gethostbyaddr(3),
	- getaddrinfo(3),
	- getnameinfo(3),
- system.grp - provides getgrent(3)-compatible API,
- system.pwd - provides getpwent(3)-compatible API,
- system.random - allows to obtain entropy from /dev/random,
- system.sysctl - provides sysctlbyname(3-compatible API.

Sponsored by:	The FreeBSD Foundation
2013-12-02 08:21:28 +00:00
Jilles Tjoelker
b865f8ef40 chmod(2): Document S_ISVTX following SUSv3/SUSv4.
S_ISTXT is non-standard.

While here, also update fchmodat() standards entry to POSIX.1-2008.
2013-12-01 12:24:57 +00:00
Jilles Tjoelker
09466daf8c waitid(2): Do not tell userland programmers to include <sys/signal.h>.
Userland should get these definitions by including <signal.h>.
2013-12-01 11:59:37 +00:00
Pawel Jakub Dawidek
2f02600abf Move my simple logging API to a separate library. It is now already used
by hastctl(8), hastd(8) and auditdistd(8) and will soon be also used
by casperd(8) and its services. There is no documentation and pjdlog.h
header file is not installed in /usr/include/ to keep it private.
Unfortunately we don't have /lib/private/ at this point, only
/usr/lib/private/, so the library is installed in /lib/.

Sponsored by:	The FreeBSD Foundation
2013-12-01 09:41:06 +00:00
Eitan Adler
7a22215c53 Fix undefined behavior: (1 << 31) is not defined as 1 is an int and this
shifts into the sign bit.  Instead use (1U << 31) which gets the
expected result.

This fix is not ideal as it assumes a 32 bit int, but does fix the issue
for most cases.

A similar change was made in OpenBSD.

Discussed with:	-arch, rdivacky
Reviewed by:	cperciva
2013-11-30 22:17:27 +00:00
Pawel Jakub Dawidek
f2b525e6b9 Make process descriptors standard part of the kernel. rwhod(8) already
requires process descriptors to work and having PROCDESC in GENERIC
seems not enough, especially that we hope to have more and more consumers
in the base.

MFC after:	3 days
2013-11-30 15:08:35 +00:00
Ed Maste
2d4be999bc Note that libstand is 32-bit on amd64 and powerpc64
Sponsored by:	The FreeBSD Foundation
2013-11-29 15:05:49 +00:00
Gleb Smirnoff
4131c351c3 Fix some misinformation in netgraph manual pages.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov gmail.com>
2013-11-28 06:45:30 +00:00
Pawel Jakub Dawidek
a9554102f9 Fix double free().
Reported by:	Coverity
Coverity CID:	1130048
2013-11-25 20:45:30 +00:00
Peter Wemm
db2af39373 Move the iconv wrapper source from libc_nonshared to libc/iconv so that
it is all in the one place again.  Rename libc/iconv/iconv.c to
bsd_iconv.c. Compile the wrappers into libc.a so that WITHOUT_DYNAMICROOT
works again.

Discussed with:	kib (and partly stolen from his patch)
2013-11-25 20:17:55 +00:00
Hiroki Sato
33888c08dd There is no file under SISSL after license replacement in r258581. 2013-11-25 19:24:15 +00:00
Hiroki Sato
44443e425f Replace Sun Industry Standards Source License for Sun RPC code with a
3-clause BSD license as specified by Oracle America, Inc. in 2010.
This license change was approved by Wim Coekaerts, Senior Vice
President, Linux and Virtualization at Oracle Corporation.
2013-11-25 19:08:38 +00:00
Neel Natu
08e3ff329a Add HPET device emulation to bhyve.
bhyve supports a single timer block with 8 timers. The timers are all 32-bit
and capable of being operated in periodic mode. All timers support interrupt
delivery using MSI. Timers 0 and 1 also support legacy interrupt routing.

At the moment the timers are not connected to any ioapic pins but that will
be addressed in a subsequent commit.

This change is based on a patch from Tycho Nightingale (tycho.nightingale@pluribusnetworks.com).
2013-11-25 19:04:51 +00:00
Hiroki Sato
2e322d3796 Replace Sun RPC license in TI-RPC library with a 3-clause BSD license,
with the explicit permission of Sun Microsystems in 2009.
2013-11-25 19:04:36 +00:00
Ryan Stone
9b605dd32e pmc(3) does not document a dependency on <sys/types.h> but <pmc.h>
requires it, so include it explicitly from <pmc.h>.

MFC after:	1 month
2013-11-25 18:31:13 +00:00
Hiroki Sato
7c5b23111c Add ICONV_{GET,SET}_ILSEQ_INVALID iconvctl. GNU iconv returns EILSEQ
when there is an invalid character in the output codeset while it is
valid in the input.  However, POSIX requires iconv() to perform an
implementation-defined conversion on the character.  So, Citrus iconv converts
such a character to a special character which means it is invalid in the
output codeset.

This is not a problem in most cases but some software like libxml2 depends
on GNU's behavior to determine if a character is output as-is or another form
such as a character entity (&#NNN;).
2013-11-25 01:26:06 +00:00
Andreas Tobler
f9cc6b5558 Get rid of the CONCAT macro. 2013-11-23 18:50:43 +00:00
Konstantin Belousov
0a9655a082 If check_deferred_signal() execution needs binding of PLT symbol,
unlocking the rtld bind lock results in the processing of ast and
recursing into the check_deferred_signal().  Nested execution of
check_deferred_signal() delivers the signal to user code and clears
si_signo.  On return, top-level check_deferred_signal() frame
continues delivering the same signal one more time, but now with zero
si_signo.

Fix this by adding a flag to indicate that deferred delivery is
running, so check_deferred_signal() should avoid doing anything. Since
user signal handler is allowed to modify the passed machine context to
make return from the signal handler to cause arbitrary jump, or do
longjmp(). For this case, also clear the flag in thr_sighandler(),
since kernel signal delivery means that nested delivery code should
not run right now.

Reported by:	Vitaly Magerya <vmagerya@gmail.com>
Reviewed by:	davidxu, jilles
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2013-11-23 15:48:17 +00:00
Neel Natu
ac7304a758 Add an ioctl to assert and deassert an ioapic pin atomically. This will be used
to inject edge triggered legacy interrupts into the guest.

Start using the new API in device models that use edge triggered interrupts:
viz. the 8254 timer and the LPC/uart device emulation.

Submitted by:	Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)
2013-11-23 03:56:03 +00:00
Andreas Tobler
646c5b4840 Replace the WEAK_ALIAS() alias with the WEAK_REFERENCE() alias. Use it and
get rid of the __CONCAT and CNAME macros.

Reviewed by:	bde, kib
2013-11-21 22:31:18 +00:00
Andreas Tobler
d2ef321a59 Introduce a WEAK_REFERENCE() alias and use it. Get rid of the CNAME and the
CONCAT macros in SYS.h.

Reviewed by:	bde, kib
2013-11-21 21:25:58 +00:00
Sergey Kandaurov
481da845ce Catch up with OpenPAM Nummularia.
This fixes libpam for build32 target to dlopen() pam libraries in /usr/lib32.

Reviewed by:	des (a while ago)
MFC after:	1 week
2013-11-21 20:43:43 +00:00
Andriy Gapon
4f662c9721 2583 Add -p (parsable) option to zfs list
illumos/illumos-gate@43d68d68c1
2013-11-20 11:06:57 +00:00
Andriy Gapon
12ad6bef9b 4161 deadlock between zfs_read() and zfs_putpage()
illumos/illumos-gate@b3d32f0ceb
2013-11-20 11:05:07 +00:00
Andriy Gapon
7df1fb6a6e 4251 libdtrace leaks open file handles
4250 libdtrace should use "F" specifier on fopen()

illumos/illumos-gate@93ed8d0d4b
2013-11-20 11:04:14 +00:00
Andriy Gapon
dd120f9e9d 4248 dtrace(1M) should never create DOF with empty probes section
4249 Only probes from the first DTrace object file will be included

illumos/illumos-gate@54a20ab41a
2013-11-20 11:02:18 +00:00
Andriy Gapon
a1d7a45c43 4171 clean up spa_feature_*() interfaces
4172 implement extensible_dataset feature for use by other zpool
features

illumos/illumos-gate@2acef22db7
2013-11-20 10:54:06 +00:00
Andriy Gapon
6cbd36185c 3933 contract adoption can race
illumos/illumos-gate@a81df0a5d7

Note we now reference illumos commits in the github repository as the
mercurial mirror seems to be neglected.

For connectivity:
r255255 referenced 14164:dceb17481b99 which is
illumos/illumos-gate@69962b5647

r255258 referenced 14176:15e9457c12ec which is
illumos/illumos-gate@cf746768a8
2013-11-20 10:12:47 +00:00
Bryan Drewery
5313966ea6 Fix build with GCC
SSL_set_tlsext_host_name(3) internally does not modify the host buffer
pased to it. So it is safe to DECONST the struct url* here.

Reported by:	gjb
Approved by:	bapt (implicit)
MFC after:	1 week
X-MFC-With:	r258347
2013-11-19 16:11:03 +00:00
Bryan Drewery
4cb272a079 Support SNI in libfetch
SNI is Server Name Indentification which is a protocol for TLS that
indicates the host that is being connected to at the start of the
handshake. It allows to use Virtual Hosts on HTTPS.

Submitted by:	sbz
Submitted by:	Michael Gmelin <freebsd@grem.de> [1]
PR:		kern/183583 [1]
Reviewed by:	des
Approved by:	bapt
MFC after:	1 week
2013-11-19 15:35:26 +00:00
Tijl Coosemans
204957ef5e Bug fixes in iconv(3) UTF-7 support.
- Add ' to the list of directly encoded characters and * to the list of
  optionally directly encoded characters as per RFC 2152.

- In _citrus_UTF7_mbtoutf16 on end of input when the next output character
  has only been partially decoded, save a copy of the buffer of input
  characters (not just its length).  On the next call with more input
  characters this buffer is reprocessed together with the new input to
  form a fully decoded output character.

- At the end of a base64 encoded sequence fully discard '-' (BASE64_OUT)
  by decrementing psenc->chlen and i.  This is needed to make room in
  psenc->ch (input buffer) in case the next input character starts a new
  base64 encoded sequence.  And also, if this is the end of input and no
  output character can be returned, this brings the encoder in the initial
  state as indicated by _citrus_UTF7_stdenc_get_state_desc_generic which
  is used by the caller to distinguish between no output and partial
  output.

- In _citrus_UTF7_mbrtowc_priv pass the s parameter (input pointer)
  directly to _citrus_UTF7_mbtoutf16 instead of a copy (s0).  This way s
  is updated correctly in case of errors.

- In _citrus_UTF7_mbrtowc_priv when called with psenc->surrogate set
  (previous call did not have enough input), retrieve the previously
  decoded UTF-16 character from (psenc->cache >> psenc->bits) instead of
  (psenc->cache >> 2).

MFC after:	5 days
2013-11-18 18:14:23 +00:00
Julio Merino
a18eacbefd MFV: Import atf-0.18.
Approved by:	rpaulo (mentor)
2013-11-17 23:51:19 +00:00
Julio Merino
615dc002b8 Fix the build of some ATF tests.
When building various programs from a single Makefile, program-specific
variables are of the form <VAR>.<PROG>, not <VAR>_<PROG>.  Fix this
obvious typo to fix the build when WITH_TESTS=yes.

I am not sure how this ever worked before given that manual inspection
of bsd.progs.mk clearly shows that the expected character between the
two components is a dot and not an underscore... but I suspect the
changes in r258095 exposed this oddity.

Approved by:	rpaulo (mentor)
2013-11-17 23:12:55 +00:00
Peter Wemm
091b8336ae Attempt to move the POSIX iconv* symbols out of runtime linker space.
FreeBSD systems usually implemented this as a third party module and
our implementation hasn't played as nicely with the old way as it could
have.

To that end:
* Rename the iconv* symbols in libc.so.7 to have a __bsd_ prefix.
* Provide .symver compatability with existing 10.x+ binaries that
  referenced the iconv symbols. All existing binaries should work.
* Like on Linux/glibc systems, add a libc_nonshared.a to the ldscript
  at /usr/lib/libc.so.
* Move the "iconv*" wrapper symbols to libc_nonshared.a

This should solve the runtime ambiguity about which symbols resolve
to where.  If you compile against the iconv in libc, your runtime
dependencies will be unambiguous.

Old 9.x libraries and binaries will always resolve against their
libiconv.so.3 like they did on 9.x.  They won't resolve against libc.

Old 10.x binaries will be satisified by the .symver helpers.

This should allow ports to selectively compile against the libiconv
port if needed and it should behave without ambiguity now.

Discussed with:	 kib
2013-11-17 22:52:17 +00:00