Commit Graph

181752 Commits

Author SHA1 Message Date
Baptiste Daroussin
8ad6d9175c Fix a bad calloc(3) call
MFC after:	2 weeks
2013-06-08 23:48:13 +00:00
Ed Schouten
2c482d3a72 Merge the 1 and 2 byte versions of the atomic functions into one.
After pushing in my fix for the 2 byte functions, I realized that the
functions for 1 and 2 byte operations had become identical. Reduce the
code size by merging the functions for 1 and 2 byte operations together.

While there, slightly improve variable naming and comments.
2013-06-08 23:45:11 +00:00
Ed Schouten
17b945433d Add testing utility for behavior of atomic ops.
This small utility performs a sequence of atomic operations with random
parameters on an atomic variable. For every type, we also create 16
variables, to ensure that we test the correctness at different
alignments.
2013-06-08 22:44:49 +00:00
Devin Teske
d7b85d2789 Fix a bug introduced with r251190, in which a small hunk was forgotten in
the performance conversion process.

The effect of this was the following error when selecting the menu
"Startup"->"View/Edit Startup Configuration"->"Add New"->"Add From List":

[: -eq: unexpected operator

By running `bsdconfig -d' as root to enable debugging, this turns into:

DEBUG: f_getvar: var=[text] value=[
Error: Expected a number for token 4 of --menu.
Use --help to list options.] r=0
[: -eq: unexpected operator

Indicating that the fourth token for --menu which should be $height was
instead a string (the first item of $menu_list) because it was using the
old size-calculation method and $size was now null (needed to use instead
the new size variables of $height $width and $rows).
2013-06-08 21:45:32 +00:00
Devin Teske
04d380df0c Fix a bug introduced with r249751, in which a small hunk was forgotten in
the performance conversion process.

The effect of this was, when your /etc/defaults/rc.conf file changed
(based on md5(1)) and re-generating the file startup_rcconf_map.cache in
/var/run/bsdconfig/ you would get a screen-dump of its contents before the
menu would appear.
2013-06-08 21:33:09 +00:00
Devin Teske
9039c2f6f7 Fix a typo in comments. 2013-06-08 21:11:26 +00:00
Devin Teske
2d0797c6dd Don't silently ignore errors (found while
testing with `chflags schg /etc/ttys).
2013-06-08 20:47:43 +00:00
Devin Teske
f5e1223b85 Prevent getting hung-up on the following prompt (found while testing with
`chflags schg /etc/ttys'):

override rw-r--r--  root/wheel for /etc/ttys? (y/n [n])

Simply by adding `-f' flag to mv(1).
2013-06-08 20:43:13 +00:00
Devin Teske
5e66bd88c9 Fix a one-character typo. The effects of which were "Console"->"Ttys" menu
would not launch (and gave no error). This was easily diagnosed by running
`bsdconfig -d' as root and seeing the following error right after selecting
the "Ttys" sub-menu:

DEBUG: f_getvar: var=[text] value=[
Error: Expected at least 6 tokens for --menu, have 4.
Use --help to list options.] r=0

Typo was introduced by SVN r251361.
2013-06-08 20:27:16 +00:00
Adrian Chadd
82aa6e614b Add 8devices CARAMBOLA2 support.
This is based on the AR933x (Hornet) SoC from Qualcomm Atheros.

It's a much nicer board to do development on - 64MB RAM, 16MB flash.
The development board breaks out the GPIO pins, ethernet, serial (via
a USB<->RS232 chip), USB host and of course a small wifi antenna.

Everything but the wifi works thus far.
2013-06-08 20:21:17 +00:00
Adrian Chadd
70234acbb1 Add support for two new winbond SPI flash parts.
The 8devices carambola 2 board uses the 16MB part.

Here's how it looks:

spibus0: <spibus bus> on spi0
mx25l0: <M25Pxx Flash Family> at cs 0 on spibus0
mx25l0: w25q128, sector 65536 bytes, 256 sectors

Tested:

* 8devices Carambola 2 board
2013-06-08 20:12:14 +00:00
Devin Teske
9b897ae786 Add a prompt to the "Add User" and "Add Group" sub-menu items (under the
"Login Management" module): Use default values for all account details?

If you select "Yes" (the default is "No"), you'll jump past all the prompts
and jump straight to the review screen with all-default values.

Makes adding a lot of users/groups faster/easier if you don't need to
customize more than one or two different values from their defaults.
2013-06-08 19:13:49 +00:00
Sergey Kandaurov
c27b17b1f7 Minor markup. 2013-06-08 18:25:08 +00:00
Devin Teske
528318ae53 Curb another regression (this one introduced by r251545, itself trying to
fix the regression introduced by r251544; which was trying to make things
consistent w/respect to ESC versus YES versus NO in the password disable
prompt in "Login Management".

(need stronger coffee; very sorry for the churn)

With this revision, the "YES", "NO", and implied ESC options all work as-
expected. Choosing "YES" allows you to proceed and the password will be
disabled. Choosing "NO" will bring back around to enter a password for the
account. Pressing ESC will drop you out of either user or group input and
back to the usermgmt screen.
2013-06-08 18:23:41 +00:00
Sergey Kandaurov
8830b71de2 Update locking scheme, mostly transition from sched_lock. 2013-06-08 18:16:41 +00:00
Devin Teske
350db06539 Fix a regression introduced by r251544; if user chooses "NO" when being
asked if they would like to disable password authentication for the account,
loop back to prompt them for the password again.
2013-06-08 18:13:42 +00:00
Devin Teske
7ca5c4cbc6 Check for ESC as a separate choice from "NO" when asking if the operator
would like to disable password management for an account while adding either
a user or group. When being prompted to answer questions while adding a
group or user, two things are trow:

1. You can hit ENTER to blast through all the questions and in the end, the
   group or user is created with sensible defaults for all values.

2. You can press ESC during any prompt to cancel the operation as a whole.

This fix is shoring up an inconsistency in the latter (#2).
2013-06-08 18:08:17 +00:00
Devin Teske
edc6918e0b Track defaultitem in the password and account expiry menus; if the user
presses ESC or chooses Cancel/No in any of the sub-menus, we want to return
to the expiry menu with that item selected.
2013-06-08 17:46:39 +00:00
Devin Teske
3196cddc5d Fix a regression in the "Login Management" module introduced by r251242 in
which choosing to cancel the manual input of expiration time (in seconds
since the UNIX epoch) for either account expiration or password expiration
would see the original value lost.
2013-06-08 17:36:31 +00:00
Devin Teske
f82913db88 Reduce verbosity in the "Console"->"Saver" module (bsdconfig syscons_saver)
by replacing the infinitive [verb] phrase "Simply blank the screen" with a
simple description of what you get; "Blank screen".

PR:		ports/169316
2013-06-08 16:49:19 +00:00
Devin Teske
2a90fca013 Remove extraneous characters ('<<<') from `Exit' menutag in the "Security"
and "Startup"->"Misc" modules to make the menus appear more consistent with
the numerous other modules and look a little cleaner.

PR:		ports/169316
2013-06-08 16:28:08 +00:00
Ed Schouten
87dd390211 Actually make the 2-byte atomics work.
Even though I tested the 1-byte operations on arbitrarily aligned bytes,
it seems I did not do this for the 2-byte operations.

Create easy to read functions that are used to get/put bytes and
halfwords in words. To keep the compiler happy, explicitly read two
bytes into a union to obtain a 16-bit value.
2013-06-08 16:24:49 +00:00
Rui Paulo
c2c2fc4d86 Import Kevin Lo's port of urtwn(4) from OpenBSD. urtwn(4) is a driver for the
Realtek RTL8188CU/RTL8192CU USB IEEE 802.11b/g/n wireless cards.
This driver requires microcode which is available in FreeBSD ports:
net/urtwn-firmware-kmod.

Hiren ported the urtwn(4) man page from OpenBSD and Glen just commited a port
for the firmware.

TODO:
- 802.11n support
- Stability fixes - the driver can sustain lots of traffic but has trouble
coping with simultaneous iperf sessions.
- fix debugging

MFC after:	2 months
Tested by:	kevlo, hiren, gjb
2013-06-08 16:02:31 +00:00
Jilles Tjoelker
172886a93e sigaction(2): Document various non-POSIX functions as async-signal safe. 2013-06-08 13:45:43 +00:00
Gleb Smirnoff
8d1aa3c6b4 aio_mlock() added:
- Regen for r251526.
  - Bump __FreeBSD_version.
2013-06-08 13:30:13 +00:00
Gleb Smirnoff
6160e12c10 Add new system call - aio_mlock(). The name speaks for itself. It allows
to perform the mlock(2) operation, which can consume a lot of time, under
control of aio(4).

Reviewed by:	kib, jilles
Sponsored by:	Nginx, Inc.
2013-06-08 13:27:57 +00:00
Ed Schouten
e737464f59 Use improved __sync_*() intrinsics for MIPS in userspace as well.
r251524 introduced custom tailored versions for MIPS of these functions
for kernel-space code. We can just reuse them in userspace as well.
2013-06-08 13:22:53 +00:00
Ed Schouten
2e5d5dc936 Add proper __sync_*() intrinsics for MIPS.
To make <stdatomic.h> work on MIPS (and ARM) using GCC, we need to
provide implementations of the __sync_*() functions. I already added
these functions for 4 and 8 byte types to libcompiler-rt some time ago,
based on top of <machine/atomic.h>.

Unfortunately, <machine/atomic.h> only provides a subset of the features
needed to implement <stdatomic.h>. This means that in some cases we had
to do compare-and-exchange calls in loops, where a simple ll/sc would
suffice.

Also implement these functions for 1 and 2 byte types. MIPS only
provides ll/sc instructions for 4 and 8 byte types, but this is of
course no limitation. We can simply load 4 bytes and use some bitmask
tricks to modify only the bytes affected.

Discussed on:	mips, arch
Tested with:	QEMU
2013-06-08 13:19:11 +00:00
Gleb Smirnoff
995d706909 Make sys_mlock() function just a wrapper around vm_mlock() function
that does all the job.

Reviewed by:	kib, jilles
Sponsored by:	Nginx, Inc.
2013-06-08 13:13:40 +00:00
Gleb Smirnoff
f95c13db04 Separate LIO_SYNC processing into a separate function aio_process_sync(),
and rename aio_process() into aio_process_rw().

Reviewed by:	kib
Sponsored by:	Nginx, Inc.
2013-06-08 13:02:43 +00:00
Xin LI
9e43a32a5c MFV r251519:
* Illumos ZFS issue #3805 arc shouldn't cache freed blocks

Quote from the Illumos issue:

    ZFS should proactively evict freed blocks from the cache.

    Even though these freed blocks will never be used again, and thus
    will eventually be evicted, this causes us to use memory
    inefficiently for 2 reasons:

    1. A block that is freed has no chance of being accessed again, but
       will be kept in memory preferentially to a block that was accessed
       before it (and is thus older) but has not been freed and thus has
       at least some chance of being accessed again.

    2. We partition the ARC into several buckets:
       user data that has been accessed only once (MRU)
       metadata that has been accessed only once (MRU)
       user data that has been accessed more than once (MFU)
       metadata that has been accessed more than once (MFU)

    The user data vs metadata split is somewhat arbitrary, and the
    primary control on how much memory is used to cache data vs metadata
    is to simply try to keep the proportion the same as it has been in the
    past (each bucket "evicts against" itself).  The secondary control is
    to evict data before evicting metadata.

    Because of this bucketing, we may end up with one bucket mostly
    containing freed blocks that are very old, while another bucket has
    more recently accessed, still-allocated blocks.  Data in the useful
    bucket (with still-allocated blocks) may be evicted in preference to
    data in the useless bucket (with old, freed blocks).

    On dcenter, we saw that the MFU metadata bucket was 230MB, while the
    MFU data bucket was 27GB and the MRU metadata bucket was 256GB.
    However, the vast majority of data in the MRU metadata bucket (256GB)
    was freed blocks, and thus useless.  Meanwhile, the MFU metadata bucket
    (230MB) was constantly evicting useful blocks that will be soon needed.

    The problem of cache segmentation is a larger problem that needs more
    investigation.  However, if we stop caching freed blocks, it should
    reduce the impact of this more fundamental issue.

MFC after:	2 weeks
2013-06-08 09:11:20 +00:00
Xin LI
718b4c7947 Update vendor-sys/illumos/dist to illumos-gate 14041:cb4a51285eeb
Illumos ZFS issues:
  3805 arc shouldn't cache freed blocks
2013-06-08 08:51:22 +00:00
Navdeep Parhar
e0f8a7f4da cxgbe/tom: Fix bad signed/unsigned mixup in the stid allocator. This
fixes a panic when allocating a mixture of IPv6 and IPv4 stids.

MFC after:	1 week
2013-06-08 07:23:26 +00:00
Andrew Turner
864cbcb81b Merge in changes from NetBSD:
* Remove support for non-elf files.
 * Add the VFP setjmp magic numbers.
 * Add the offsets for the VFP registers within the buffer.
2013-06-08 07:16:22 +00:00
Sean Bruno
06f1884fa8 Implement foreign volume handling. Allows admins to view foreign metadata
and clear or import it for use.

PR:     kern/172091
Submitted by:   smh@freebsd.org
Reviewed by:    jhb@freebsd.org
MFC after:      2 weeks
2013-06-08 02:54:59 +00:00
Hans Petter Selasky
d5d96494f8 Fix some recent regression issues:
1) Only multi-TD isochronous transfers should use NORMAL
type after specific type as per XHCI specification.

2) BEI bit is only available in NORMAL and ISOCHRONOUS
TRB types. Don't use this bit for other types to avoid
hardware asserts. Reserved bits should be don't care
though ...

MFC after:	1 week
PR:		usb/179342
2013-06-07 22:35:58 +00:00
Andrew Turner
8e03dd5926 Finish pulling in the NetBSD setjmp/longjmp updates on ARM.
Store/restore the VFP registers in setjmp/longjmp on ARM EABI if VFP is
enabled in the kernel. It checks the hw.floatingpoint sysctl to see if
floating-point is available and uses this to determine if it should store
them. If it does it uses a different magic value so longjmp is able to know
if it should load them.
2013-06-07 22:01:06 +00:00
Ed Maste
e9f843e2f6 Add WITH_DEBUG_FILES
makeman currently generates a src.conf that claims every option also
enforces WITHOUT_BIND_UTILS, so I applied this section by hand.
2013-06-07 21:51:10 +00:00
Ed Maste
42f8c5b580 Add a new knob WITH_DEBUG_FILES to control the building of standalone
debug files for userland programs and libraries.  The "-g" debug flag
is automatically applied when WITH_DEBUG_FILES is set.

The debug files are now named ${prog}.debug and ${shlib}.debug for
consistency with other systems and documentation.  In addition they are
installed under /usr/lib/debug, to simplify the process of installing
them if needed after a crash.  Users of bsd.{prog,lib}.mk outside of the
base system place the standalone debug files in a .debug subdirectory.
GDB automatically searches both of these directories for standalone
debug files.

Thanks to everyone who contributed changes, review, and testing during
development.
2013-06-07 21:40:02 +00:00
Andrew Turner
0a79452954 Reduce the difference to NetBSD.
* Stop pretending we support anything other than ELF by removing code
   surrounded by #ifdef __ELF__ ... #endif.
 * Remove _JB_MAGIC_SETJMP and _JB_MAGIC__SETJMP, they are defined in
   setjmp.h, which is able to be included from asm.
 * Fix the spelling of dependent.
 * Rename END _END and add END and ASEND to complement ENTRY and ASENTRY
   respectively
 * Add macros to simplify accessing the Global Offset Table, some of these
   will be used in the upcoming update to the setjmp functions.
2013-06-07 21:23:11 +00:00
Andrew Turner
4e75169f43 Include machine/setjmp.h to get the definition of _JB_MAGIC__SETJMP. This
allows us to remove it from the ARM copy of machine/asm.h.
2013-06-07 21:13:28 +00:00
Andrew Turner
4ce3ba179a Remove an extra copy of _setjmp from libstand. We have used the libc version
of this function since r183876.
2013-06-07 21:06:19 +00:00
Xin LI
410bcf7cc7 Make 'portsnap alfred' overwrite ports tree if it's not created by a
portsnap.

Discussed with:	alfred
Reviewed by:	cperciva
2013-06-07 20:21:30 +00:00
Simon J. Gerraty
d58b075701 Override bmake's default MAKEFILE_PREFERENCE 2013-06-07 19:45:04 +00:00
Alan Cox
f50b6721e1 Add missing VM object unlocks in an error case.
Reviewed by:	kib
2013-06-07 19:42:00 +00:00
Bruce M Simpson
c91950082d Disable IGMPv3 link timers on a transition to IGMPv2.
Submitted by:	Alan Smithee
2013-06-07 17:12:08 +00:00
Sergey Kandaurov
39405eaa44 FreeBSD 8.4 added. 2013-06-07 17:06:08 +00:00
Hans Petter Selasky
97d729cf33 Add support for polling the XHCI interrupt handler when
the regular interrupt handler is not working properly or
in case of MSI interrupts which are not yet supported.
Remove interrupt setup code for FreeBSD versions older
than 700031.

MFC after:	1 week
PR:		usb/179342
2013-06-07 14:30:06 +00:00
Ed Maste
a9205626a7 Add libusb_get_port_numbers
libusbx deprecated libusb_get_port_path and replaced it with
libusb_get_port_numbers.  The latter omits an extra parameter which was
unused in the FreeBSD implementation anyway.
2013-06-07 13:45:58 +00:00
Mikolaj Golub
f8afe33795 Properly set curvnet context in lagg_port_setlladdr() task handler.
Reported by:	Nikos Vassiliadis <nvass gmx.com>
Submitted by:	zec
Tested by:	Nikos Vassiliadis <nvass gmx.com>
MFC after:	1 week
2013-06-07 10:27:50 +00:00