Commit Graph

15624 Commits

Author SHA1 Message Date
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