]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agoAdd AT_RANDOM and AT_EXECFN auxiliary vector entries which are used by
dchagin [Sun, 24 May 2015 16:24:24 +0000 (16:24 +0000)]
Add AT_RANDOM and AT_EXECFN auxiliary vector entries which are used by
glibc. At list since glibc version 2.16 using AT_RANDOM is mandatory.

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

9 years agoTeach kdump to understand both linux emulation.
dchagin [Sun, 24 May 2015 16:22:03 +0000 (16:22 +0000)]
Teach kdump to understand both linux emulation.

Differential Revision: https://reviews.freebsd.org/D1079
Reviewed by: emaste

9 years agoRegen for r283428.
dchagin [Sun, 24 May 2015 16:19:57 +0000 (16:19 +0000)]
Regen for r283428.

9 years agoChange linux faccessat syscall definition to match actual linux one.
dchagin [Sun, 24 May 2015 16:18:03 +0000 (16:18 +0000)]
Change linux faccessat syscall definition to match actual linux one.

The AT_EACCESS and AT_SYMLINK_NOFOLLOW flags are actually implemented
within the glibc wrapper function for faccessat().  If either of these
flags are specified, then the wrapper function employs fstatat() to
determine access permissions.

Differential Revision: https://reviews.freebsd.org/D1078
Reviewed by: trasz

9 years agoWhere possible we will use M_LINUX malloc(9) type.
dchagin [Sun, 24 May 2015 16:14:41 +0000 (16:14 +0000)]
Where possible we will use M_LINUX malloc(9) type.
Move M_FUTEX defines to the linux_common.ko.

Differential Revision: https://reviews.freebsd.org/D1077
Reviewed by: emaste

9 years agoAdd support for getting the memory map from EFI if it has been pased in
andrew [Sun, 24 May 2015 16:11:30 +0000 (16:11 +0000)]
Add support for getting the memory map from EFI if it has been pased in
by loader.efi.

9 years agoRegen for r283424.
dchagin [Sun, 24 May 2015 16:11:21 +0000 (16:11 +0000)]
Regen for r283424.

9 years agoAdd preliminary support for x86-64 Linux binaries.
dchagin [Sun, 24 May 2015 16:07:11 +0000 (16:07 +0000)]
Add preliminary support for x86-64 Linux binaries.

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

9 years agoMove FEATURE macros for v4l and v4l2 to the common module.
dchagin [Sun, 24 May 2015 16:00:01 +0000 (16:00 +0000)]
Move FEATURE macros for v4l and v4l2 to the common module.

Differential Revision: https://reviews.freebsd.org/D1075
Reviewed by: emaste

9 years agoRefund the proc emuldata struct for future use. For now move flags from
dchagin [Sun, 24 May 2015 15:54:58 +0000 (15:54 +0000)]
Refund the proc emuldata struct for future use. For now move flags from
thread emuldata to proc emuldata as it was originally intended.

As we can have both 64 & 32 bit Linuxulator running any eventhandler
can be called twice for us. To prevent this move eventhandlers code
from linux_emul.c to the linux_common.ko module.

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

9 years agoIntroduce a new module linux_common.ko which is intended for the
dchagin [Sun, 24 May 2015 15:51:18 +0000 (15:51 +0000)]
Introduce a new module linux_common.ko which is intended for the
following primary purposes:

1. Remove the dependency of linsysfs and linprocfs modules from linux.ko,
which will be architecture specific on amd64.

2. Incorporate into linux_common.ko general code for platforms on which
we'll support two Linuxulator modules (for both instruction set - 32 & 64 bit).

3. Move malloc(9) declaration to linux_common.ko, to enable getting memory
usage statistics properly.

Currently linux_common.ko incorporates a code from linux_mib.c and linux_util.c
and linprocfs, linsysfs and linux kernel modules depend on linux_common.ko.

Temporarily remove dtrace garbage from linux_mib.c and linux_util.c

Differential Revision: https://reviews.freebsd.org/D1072
In collaboration with: Vassilis Laganakos.

Reviewed by: trasz

9 years agoAdd newfstatat system call for 64-bit Linuxulator.
dchagin [Sun, 24 May 2015 15:48:34 +0000 (15:48 +0000)]
Add newfstatat system call for 64-bit Linuxulator.

Differential Revision: https://reviews.freebsd.org/D1071
Reviewed by: trasz

9 years agoFix compilation with -DDEBUG option.
dchagin [Sun, 24 May 2015 15:47:15 +0000 (15:47 +0000)]
Fix compilation with -DDEBUG option.

Differential Revision: https://reviews.freebsd.org/D1070
Reviewed by: trasz

9 years agoWhen only 2 bytes can be read from a 4 byte UTF-16 character in a base64
tijl [Sun, 24 May 2015 15:47:06 +0000 (15:47 +0000)]
When only 2 bytes can be read from a 4 byte UTF-16 character in a base64
encoded chunk of a UTF-7 string, treat that as an incomplete character and
return an error instead of a shift sequence and no error.

Also check that the low 2 bytes have a valid value.

MFC after: 1 week

9 years agoAdd 64 bit support to the vdso.
dchagin [Sun, 24 May 2015 15:45:36 +0000 (15:45 +0000)]
Add 64 bit support to the vdso.

Differential Revision: https://reviews.freebsd.org/D1069
Reviewed by: trasz

9 years agox86_64 Linux do not use multiplexing on ipc system calls.
dchagin [Sun, 24 May 2015 15:44:41 +0000 (15:44 +0000)]
x86_64 Linux do not use multiplexing on ipc system calls.
Move struct ipc_perm definition to the MD path as it differs for 64 and
32 bit platform.

Differential Revision: https://reviews.freebsd.org/D1068
Reviewed by: trasz

9 years agoDisable i386 call for x86-64 Linux.
dchagin [Sun, 24 May 2015 15:43:53 +0000 (15:43 +0000)]
Disable i386 call for x86-64 Linux.

Differential Revision: https://reviews.freebsd.org/D1067
Reviewed by: trasz

9 years agoPrint out proper procmap entry for 64 bit binaries.
dchagin [Sun, 24 May 2015 15:42:36 +0000 (15:42 +0000)]
Print out proper procmap entry for 64 bit binaries.

Differential Revision: https://reviews.freebsd.org/D1066
Reviewed by: trasz

9 years ago64-bit paltforms, like x86_64, do not use multiplexing on
dchagin [Sun, 24 May 2015 15:41:27 +0000 (15:41 +0000)]
64-bit paltforms, like x86_64, do not use multiplexing on
socketcall system calls.

Differential Revision: https://reviews.freebsd.org/D1065
Reviewed by: trasz

9 years agoGet ready to commit x86_64 Linux emulation.
dchagin [Sun, 24 May 2015 15:39:08 +0000 (15:39 +0000)]
Get ready to commit x86_64 Linux emulation.
All fields of type l_int in struct statfs are defined
as l_long on i386 and amd64.

Differential Revision: https://reviews.freebsd.org/D1064
Reviewed by: trasz

9 years agoRemove stale comment about a signal trampoline which
dchagin [Sun, 24 May 2015 15:32:52 +0000 (15:32 +0000)]
Remove stale comment about a signal trampoline which
is moved to the shared page at r219609.

Differential Revision: https://reviews.freebsd.org/D1063
Reviewed by: trasz

9 years agoPut linux_platform into the vdso to avoid copying it onto the stack at
dchagin [Sun, 24 May 2015 15:30:52 +0000 (15:30 +0000)]
Put linux_platform into the vdso to avoid copying it onto the stack at
every exec.

Differential Revision: https://reviews.freebsd.org/D1062
Reviewed by: trasz

9 years agoEliminate a now unused global declaration of elf_linux_sysvec.
dchagin [Sun, 24 May 2015 15:29:20 +0000 (15:29 +0000)]
Eliminate a now unused global declaration of elf_linux_sysvec.

Differential Revision: https://reviews.freebsd.org/D1061
Reviewed by: trasz

9 years agoImplement vdso - virtual dynamic shared object. Through vdso Linux
dchagin [Sun, 24 May 2015 15:28:17 +0000 (15:28 +0000)]
Implement vdso - virtual dynamic shared object. Through vdso Linux
exposes functions from kernel with proper DWARF CFI information so that
it becomes easier to unwind through them.
Using vdso is a mandatory for a thread cancelation && cleanup
on a modern glibc.

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

9 years agoFix decoding of UTF-7 when a base64 encoded chunk appears at the end of
tijl [Sun, 24 May 2015 15:27:31 +0000 (15:27 +0000)]
Fix decoding of UTF-7 when a base64 encoded chunk appears at the end of
the input buffer.

_citrus_UTF7_mbtoutf16 stored the decoder state at the beginning so it
could restore this state on an incomplete character such that the next
call would restart the decoding.  The problem was that "-" (end of base64
mode) at the end of a string was also treated as an incomplete character
but was also removed from the state buffer.  So the initial state would be
restored (with base64 mode) and the next call would no longer see the "-"
so it continued in base64 mode.

This state saving/restoring isn't needed here.  It's already handled
elsewhere (citrus_iconv_std.c:_citrus_iconv_std_iconv_convert) so just
remove it.

Also initialise *nresult.

PR: 200398
Tested by: delphij
MFC after: 1 week

9 years agoRegen for r283403.
dchagin [Sun, 24 May 2015 15:22:33 +0000 (15:22 +0000)]
Regen for r283403.

9 years agoImplement pselect6() system call.
dchagin [Sun, 24 May 2015 15:21:25 +0000 (15:21 +0000)]
Implement pselect6() system call.

Differential Revision: https://reviews.freebsd.org/D1051
Reviewed by: trasz

9 years agoRegen for r283401.
dchagin [Sun, 24 May 2015 15:19:44 +0000 (15:19 +0000)]
Regen for r283401.

9 years agoImplement prlimit64() system call.
dchagin [Sun, 24 May 2015 15:18:19 +0000 (15:18 +0000)]
Implement prlimit64() system call.

Differential Revision: https://reviews.freebsd.org/D1050
Reviewed by: emaste, trasz

9 years agoRegen for r283399.
dchagin [Sun, 24 May 2015 15:15:46 +0000 (15:15 +0000)]
Regen for r283399.

9 years agoImplement dup3() system call.
dchagin [Sun, 24 May 2015 15:14:51 +0000 (15:14 +0000)]
Implement dup3() system call.

Differential Revision: https://reviews.freebsd.org/D1049
Reviewed by: emaste

9 years agoSched_rr_get_interval returns EINVAL in case when the invalid pid
dchagin [Sun, 24 May 2015 15:13:56 +0000 (15:13 +0000)]
Sched_rr_get_interval returns EINVAL in case when the invalid pid
specified. This silence the ltp tests.

Differential Revision: https://reviews.freebsd.org/D1048
Reviewed by: trasz

9 years agoRegen for r283396.
dchagin [Sun, 24 May 2015 15:12:38 +0000 (15:12 +0000)]
Regen for r283396.

9 years agoImplement rt_sigqueueinfo() system call.
dchagin [Sun, 24 May 2015 15:11:32 +0000 (15:11 +0000)]
Implement rt_sigqueueinfo() system call.

Differential Revision: https://reviews.freebsd.org/D1047
Reviewed by: trasz

9 years agoRegen for r283394.
dchagin [Sun, 24 May 2015 15:08:25 +0000 (15:08 +0000)]
Regen for r283394.

9 years agoImplement waitid() system call.
dchagin [Sun, 24 May 2015 15:06:39 +0000 (15:06 +0000)]
Implement waitid() system call.

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

9 years agoRegen for r283392.
dchagin [Sun, 24 May 2015 15:05:22 +0000 (15:05 +0000)]
Regen for r283392.

9 years agostruct l_rusage does not defined for i386 Linuxulator due to it's nature.
dchagin [Sun, 24 May 2015 15:04:12 +0000 (15:04 +0000)]
struct l_rusage does not defined for i386 Linuxulator due to it's nature.

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

9 years agoTo reduce code duplication introduce linux_copyout_rusage() method.
dchagin [Sun, 24 May 2015 15:03:09 +0000 (15:03 +0000)]
To reduce code duplication introduce linux_copyout_rusage() method.
Use it in linux_wait4() system call and move linux_wait4() to the MI path.
While here add a prototype for the static bsd_to_linux_rusage().

Differential Revision: https://reviews.freebsd.org/D2138
Reviewed by: trasz

9 years agoAdd a function for converting wait options.
dchagin [Sun, 24 May 2015 15:00:27 +0000 (15:00 +0000)]
Add a function for converting wait options.

Differential Revision: https://reviews.freebsd.org/D1045
Reviewed by: trasz

9 years agoAdd a siginfo_t conversion function.
dchagin [Sun, 24 May 2015 14:58:30 +0000 (14:58 +0000)]
Add a siginfo_t conversion function.

Differential Revision: https://reviews.freebsd.org/D1044
Reviewed by: emaste, trasz

9 years agoRemove a now unused define.
dchagin [Sun, 24 May 2015 14:57:39 +0000 (14:57 +0000)]
Remove a now unused define.

Differential Revision: https://reviews.freebsd.org/D1043
Reviewed by: trasz

9 years agoIntroduce LINUX_VERSION_STR, LINUX_VERSION_CODE macro for use instead
dchagin [Sun, 24 May 2015 14:56:21 +0000 (14:56 +0000)]
Introduce LINUX_VERSION_STR, LINUX_VERSION_CODE macro for use instead
of harcoded pr_osrelease, pr_osrel values. This will be used later in
the VDSO.

Differential Revision: https://reviews.freebsd.org/D1042
Reviewed by: trasz

9 years agoSome style(9) && whitespaces fixes. No functional changes.
dchagin [Sun, 24 May 2015 14:55:12 +0000 (14:55 +0000)]
Some style(9) && whitespaces fixes. No functional changes.

Differential Revision: https://reviews.freebsd.org/D1041
Reviewed by: emaste

9 years agopthread_join() caller do futex_wait on child_clear_tid. As a results
dchagin [Sun, 24 May 2015 14:54:12 +0000 (14:54 +0000)]
pthread_join() caller do futex_wait on child_clear_tid. As a results
of multiple simultaneous calls to pthread_join() specifying the same
target thread are undefined wake up the one thread.

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

9 years agoSwitch linuxulator to use the native 1:1 threads.
dchagin [Sun, 24 May 2015 14:53:16 +0000 (14:53 +0000)]
Switch linuxulator to use the native 1:1 threads.

The reasons:
1. Get rid of the stubs/quirks with process dethreading,
   process reparent when the process group leader exits and close
   to this problems on wait(), waitpid(), etc.
2. Reuse our kernel code instead of writing excessive thread
   managment routines in Linuxulator.

Implementation details:

1. The thread is created via kern_thr_new() in the clone() call with
   the CLONE_THREAD parameter. Thus, everything else is a process.
2. The test that the process has a threads is done via P_HADTHREADS
   bit p_flag of struct proc.
3. Per thread emulator state data structure is now located in the
   struct thread and freed in the thread_dtor() hook.
   Mandatory holdig of the p_mtx required when referencing emuldata
   from the other threads.
4. PID mangling has changed. Now Linux pid is the native tid
   and Linux tgid is the native pid, with the exception of the first
   thread in the process where tid and pid are one and the same.

Ugliness:

   In case when the Linux thread is the initial thread in the thread
   group thread id is equal to the process id. Glibc depends on this
   magic (assert in pthread_getattr_np.c). So for system calls that
   take thread id as a parameter we should use the special method
   to reference struct thread.

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

9 years agoIn preparation for switching linuxulator to the use the native 1:1
dchagin [Sun, 24 May 2015 14:51:29 +0000 (14:51 +0000)]
In preparation for switching linuxulator to the use the native 1:1
threads add a hook for cleaning thread resources before the thread die.

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

9 years agoIn preparation for switching linuxulator to the use the native 1:1
dchagin [Sun, 24 May 2015 14:49:21 +0000 (14:49 +0000)]
In preparation for switching linuxulator to the use the native 1:1
threads add per thread emulator state data.

Differential Revision: https://reviews.freebsd.org/D1037
Reviewed by: trasz

9 years agoRegen for r283379.
dchagin [Sun, 24 May 2015 14:47:00 +0000 (14:47 +0000)]
Regen for r283379.

9 years agoImplement a Linux version of sched_getparam() && sched_setparam().
dchagin [Sun, 24 May 2015 14:45:57 +0000 (14:45 +0000)]
Implement a Linux version of sched_getparam() && sched_setparam().
Temporarily use the first thread in proc.

Differential Revision: https://reviews.freebsd.org/D1036
Reviewed by: trasz

9 years agoRemove a now unused include.
dchagin [Sun, 24 May 2015 14:44:57 +0000 (14:44 +0000)]
Remove a now unused include.

Differential Revision: https://reviews.freebsd.org/D1035
Reviewed by: trasz

9 years agoIn preparation for switching linuxulator to the use the native 1:1
dchagin [Sun, 24 May 2015 14:44:06 +0000 (14:44 +0000)]
In preparation for switching linuxulator to the use the native 1:1
threads split sys_sched_getparam(), sys_sched_setparam(),
sys_sched_getscheduler(), sys_sched_setscheduler() to their kern_*
counterparts and add targettd parameter to allow specify the target
thread directly by callee.

Differential Revision: https://reviews.freebsd.org/D1034
Reviewed by: trasz

9 years agoRegen for r283375.
dchagin [Sun, 24 May 2015 14:43:06 +0000 (14:43 +0000)]
Regen for r283375.

9 years agoIn preparation for switching linuxulator to the use the native 1:1
dchagin [Sun, 24 May 2015 14:40:41 +0000 (14:40 +0000)]
In preparation for switching linuxulator to the use the native 1:1
threads use MI linux_sched_rr_get_interval() in i386.

Differential Revision: https://reviews.freebsd.org/D1033
Reviewed by: trasz

9 years agoIn preparation for switching linuxulator to the use the native 1:1
dchagin [Sun, 24 May 2015 14:39:26 +0000 (14:39 +0000)]
In preparation for switching linuxulator to the use the native 1:1
threads refactor kern_sched_rr_get_interval() and sys_sched_rr_get_interval().
Add a kern_sched_rr_get_interval() counterpart which takes a targettd
parameter to allow specify target thread directly by callee (new Linuxulator).

Linuxulator temporarily uses first thread in proc.

Move linux_sched_rr_get_interval() to the MI part.

Differential Revision: https://reviews.freebsd.org/D1032
Reviewed by: trasz

9 years agoIn preparation for switching linuxulator to the use the native 1:1
dchagin [Sun, 24 May 2015 14:37:45 +0000 (14:37 +0000)]
In preparation for switching linuxulator to the use the native 1:1
threads introduce kern_thr_alloc() which will be used later in the
linux_clone().

Differential Revision: https://reviews.freebsd.org/D1029
Reviewed by: trasz

9 years agoIn preparation for switching linuxulator to the use the native 1:1
dchagin [Sun, 24 May 2015 14:36:33 +0000 (14:36 +0000)]
In preparation for switching linuxulator to the use the native 1:1
threads split sys_thr_exit() up into sys_thr_exit() and kern_thr_exit().
Move
Where the second will be used in linux_exit() system call later.

Differential Revision: https://reviews.freebsd.org/D1028
Reviewed by: trasz

9 years agoRegen for r283370.
dchagin [Sun, 24 May 2015 14:34:46 +0000 (14:34 +0000)]
Regen for r283370.

9 years agoIn preparation for switching linuxulator to the use the native 1:1
dchagin [Sun, 24 May 2015 14:33:19 +0000 (14:33 +0000)]
In preparation for switching linuxulator to the use the native 1:1
threads introduce linux_exit() stub instead of sys_exit() call
(which terminates process).
In the new linuxulator exit() system call terminates the calling
thread (not a whole process).

Differential Revision: https://reviews.freebsd.org/D1027
Reviewed by: trasz

9 years agoIn preparation for switching linuxulator to the use the native 1:1
dchagin [Sun, 24 May 2015 14:29:35 +0000 (14:29 +0000)]
In preparation for switching linuxulator to the use the native 1:1
threads print the thread id in addition to the pid in debug messages.

9 years agoEnable SMP on the qemu virt platform. We use the device tree to find which
andrew [Sun, 24 May 2015 12:33:12 +0000 (12:33 +0000)]
Enable SMP on the qemu virt platform. We use the device tree to find which
cpus to enable, and PSCI to start them.

9 years agoRemove trailing whitespace from sys/arm/arm
andrew [Sun, 24 May 2015 12:20:11 +0000 (12:20 +0000)]
Remove trailing whitespace from sys/arm/arm

9 years agoAdd more cp15_ functions, and use them in cpufunc.c where possible.
andrew [Sun, 24 May 2015 12:12:01 +0000 (12:12 +0000)]
Add more cp15_ functions, and use them in cpufunc.c where possible.

9 years agoFix SIOCGI2C structure requirement.
melifaro [Sun, 24 May 2015 11:24:14 +0000 (11:24 +0000)]
Fix SIOCGI2C structure requirement.

In reality, SIOCGI2C ioctl requires struct ifreq as many other
ioctls. Doing copyin() on (significantly) larger struct ifstat sometimes
triggered EFAULT.

Reported by: Olivier Cochard-LabbĂ© <olivier at cochard.me>
MFC after: 1 week

9 years agoRework the PSCI cpu on code to allow it to work before device drivers have
andrew [Sun, 24 May 2015 11:08:06 +0000 (11:08 +0000)]
Rework the PSCI cpu on code to allow it to work before device drivers have
started. This allows this functions to be used with the regular ARM SMP
initialisation sequence.

9 years agoInclude the ofw cpu driver. This allows us to get a list of cpus enabled
andrew [Sun, 24 May 2015 11:04:45 +0000 (11:04 +0000)]
Include the ofw cpu driver. This allows us to get a list of cpus enabled
by qemu, however we may not be running on them.

9 years agoAdd kernel config and dts files for an aml8726-m3
ganbold [Sun, 24 May 2015 08:45:19 +0000 (08:45 +0000)]
Add kernel config and dts files for an aml8726-m3
based device.
Following u-boot commands allow FreeBSD boot on
Yiyate Android TV Box (aml8726-m3):

tv open 480p
mmc rescan 0
fatload mmc 0 0x80100000 kernel.bin
go 0x80100000

The current FreeBSD driver doesn't program the video
clocks so the u-boot tv command is necessary in order
for the frame buffer to be useful (otherwise it can
be skipped).

The SD card for the Yiyate Android TV Box doesn't need
anything special beyond creating a FAT16 and a UFS
filesystem.

Differential Revision: https://reviews.freebsd.org/D2636
Submitted by: John Wehle

9 years agoThis implements default-state support as described in:
ganbold [Sun, 24 May 2015 07:45:42 +0000 (07:45 +0000)]
This implements default-state support as described in:

https://www.kernel.org/doc/Documentation/devicetree/bindings/leds/leds-gpio.txt

Without this booting the VSATV102 causes the blue "working" led to turn
off when the kernel starts up. With this the led (which is turned on by
the firmware) stays on since that's the default state specified in the FDT.

Expanded the meaning of the led_create_state state parameter in order
to implement support for "keep". The original values were:

== 0             Off
!= 0             On

The new values are:

== -1            don't change / keep current setting
== 0             Off
!= -1 && != 0    On

This should have no effect on acpi_asus_attach which only calls
led_create_state with state set to 1. Updated acpi_ibm_attach
in order to avoid surprises.

Differential Revision: https://reviews.freebsd.org/D2615
Submitted by: John Wehle
Reviewed by: gonzo, loos

9 years agoRemove directory for test that has been integrated in under tests/sys/...
ngie [Sun, 24 May 2015 07:21:30 +0000 (07:21 +0000)]
Remove directory for test that has been integrated in under tests/sys/...

X-MFC with: r282067
MFC after: 1 week

9 years agoEnable leds for VSATV102 in dts.
ganbold [Sun, 24 May 2015 07:09:16 +0000 (07:09 +0000)]
Enable leds for VSATV102 in dts.

Differential Revision:  https://reviews.freebsd.org/D2614
Submitted by: John Wehle

9 years agoFix a lock up where we enter swapper() with interrupts disabled.
andrew [Sat, 23 May 2015 23:08:16 +0000 (23:08 +0000)]
Fix a lock up where we enter swapper() with interrupts disabled.

In smp_rendezvous_cpus we expect to wait for all cpus to enter
smp_rendezvous_action. If we call this holding a proc lock swapper may
attempt to also lock it, however as interrupts are disabled the cpu never
handles the ipi. Because smp_rendezvous_action waits for all signaled
cpus before contining it may get caught waiting for the cpu running swapper
as the proc mutex will be unlocked after smp_rendezvous_cpus finishes.

The fix is to enable interrupts in the configure stage as we should be
doing.

MFC after: 1 week

9 years agoUse the wait-for-event instruction to put the core we have just enabled
andrew [Sat, 23 May 2015 22:28:59 +0000 (22:28 +0000)]
Use the wait-for-event instruction to put the core we have just enabled
to sleep while it waits to start scheduling. The boot core can then use
the send-event instruction to wake the cores when they should enter the
scheduler.

MFC after: 1 week

9 years agoThe NFS client generated directory block(s) with d_fileno == 0
rmacklem [Sat, 23 May 2015 21:58:41 +0000 (21:58 +0000)]
The NFS client generated directory block(s) with d_fileno == 0
so that it would not return less data than requested.
Since returning less directory data than requested is not a problem
for FreeBSD and even UFS no longer returns directory structures
with d_fileno == 0, this patch stops the client from doing this.
Although entries with d_fileno == 0 should not be a problem,
the man pages no longer document that these entries should be
ignored, so there was a concern that these entries might be an
issue in the future.

Suggested by: trasz
Tested by: trasz
MFC after: 2 weeks

9 years agoUpdate P_TOTAL_STOP commentary.
pluknet [Sat, 23 May 2015 21:04:15 +0000 (21:04 +0000)]
Update P_TOTAL_STOP commentary.

9 years agoIf thread requested to not stop on non-boundary, then not only
kib [Sat, 23 May 2015 19:09:04 +0000 (19:09 +0000)]
If thread requested to not stop on non-boundary, then not only
stopping signals should obey, but also all forms of single-threading.
Otherwise, thread might sleep interruptible while owning some
resources, and single-threading thread could try to access them.
An example is owning vnode lock while dumping core.

Submitted by: Conrad Meyer
Review: https://reviews.freebsd.org/D2612
Tested by: pho
MFC after: 1 week

9 years agoSimplify the allocation of page table pages for mips64. Specifically,
alc [Sat, 23 May 2015 16:54:46 +0000 (16:54 +0000)]
Simplify the allocation of page table pages for mips64.  Specifically,
when allocation fails, it suffices to perform VM_WAIT.  The direct map
covers the entirely of physical memory, so unlike 32-bit mips any
physical page can be used as a page table page.

9 years agoddb: de-register
pfg [Sat, 23 May 2015 14:59:27 +0000 (14:59 +0000)]
ddb:  de-register

9 years agoRemove an unused header.
andrew [Sat, 23 May 2015 14:48:03 +0000 (14:48 +0000)]
Remove an unused header.

9 years agoProperly update TX statistics for wlan(4).
ae [Sat, 23 May 2015 09:49:40 +0000 (09:49 +0000)]
Properly update TX statistics for wlan(4).
ieee80211_pwrsave() can fail due to queue overflow, check its return code
and increment oerrors counter when it fails. Also handle more error cases
and update oerrors counter when we don't send mbuf due to some errors.
Return ENETDOWN when parent interface isn't ready. Update obytes and omcasts
counters in corresponding places.

PR: 184626
Differential Revision: https://reviews.freebsd.org/D2621
Reviewed by: adrian
MFC after: 1 week

9 years agoAdd support for the tuning cap for Hornet/AR9331 boards.
adrian [Sat, 23 May 2015 08:02:54 +0000 (08:02 +0000)]
Add support for the tuning cap for Hornet/AR9331 boards.

This dramatically improves RX sensitivity and behaviour on the
AR9331 hardware I have, including the Carambola 2.

Tested:

* AR9331, Carambola 2 board

Submitted by: Zilvinas Valinskas <zilvinas.valinskas@gmail.com>

9 years agoExceptions don't deliver an error code in real mode.
neel [Sat, 23 May 2015 01:17:50 +0000 (01:17 +0000)]
Exceptions don't deliver an error code in real mode.

MFC after: 1 week

9 years agoUse mkimg(1) to create the i386 memstick images, similar to
gjb [Sat, 23 May 2015 00:32:58 +0000 (00:32 +0000)]
Use mkimg(1) to create the i386 memstick images, similar to
how is done for amd64.  The exception here is there is no
EFI partition for i386.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

9 years agoConvert to use libxo. Document use of libxo as well.
marcel [Fri, 22 May 2015 23:07:55 +0000 (23:07 +0000)]
Convert to use libxo. Document use of libxo as well.

Obtained from:  Phil Shafer <phil@juniper.net>
Sponsored by:   Juniper Networks, Inc.

9 years agoFix staging virtual machine images for ftp propagation.
gjb [Fri, 22 May 2015 21:38:11 +0000 (21:38 +0000)]
Fix staging virtual machine images for ftp propagation.

MFC after: 3 days
X-MFC-Note: needs all previous changes
Sponsored by: The FreeBSD Foundation

9 years agoAdjust default argument construction for -c to be getopt compliant for
peter [Fri, 22 May 2015 21:33:13 +0000 (21:33 +0000)]
Adjust default argument construction for -c to be getopt compliant for
consistency, even though unbound understood it.

9 years agoFix typo in symbol name. It helps to hit save in all your buffers
imp [Fri, 22 May 2015 21:10:14 +0000 (21:10 +0000)]
Fix typo in symbol name. It helps to hit save in all your buffers
before committing.

9 years agoRemove the verification of instruction length after instruction decode. The
neel [Fri, 22 May 2015 21:09:11 +0000 (21:09 +0000)]
Remove the verification of instruction length after instruction decode. The
check has been bogus since r273375.

MFC after: 1 week

9 years agoFix a number of logic and/or naming problems in Makefile.mirrors.
gjb [Fri, 22 May 2015 21:04:42 +0000 (21:04 +0000)]
Fix a number of logic and/or naming problems in Makefile.mirrors.
Reduce a number of duplicated logic.

As of this commit, this file does exactly what it is needed to do.

MFC after: 3 days
X-MFC-Note: needs all previous changes
Sponsored by: The FreeBSD Foundation

9 years agoExport the eflags field from the elf header. This allows better
imp [Fri, 22 May 2015 20:50:35 +0000 (20:50 +0000)]
Export the eflags field from the elf header. This allows better
discrimination between different subarch binaries, at least for mips
and arm. Arm is implemented, mips is still tbd, so not currently
exported. aarch64 does not export this because aarch64 binaries use
different tags and flags than arm.

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

9 years agoddb: Use NULL for pointers
pfg [Fri, 22 May 2015 19:04:06 +0000 (19:04 +0000)]
ddb:  Use NULL for pointers

Hinted by: DragonflyBSD

9 years agoipf(1): Use strchr(3) instead of deprecated index(3)
emaste [Fri, 22 May 2015 18:31:26 +0000 (18:31 +0000)]
ipf(1): Use strchr(3) instead of deprecated index(3)

Reviewed by: cy
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2607

9 years agoDon't rely on the 'VM-exit instruction length' field in the VMCS to always
neel [Fri, 22 May 2015 17:34:22 +0000 (17:34 +0000)]
Don't rely on the 'VM-exit instruction length' field in the VMCS to always
have an accurate length on an EPT violation. This is not needed by the
instruction decoding code because it also has to work with AMD/SVM that
does not provide a valid instruction length on a Nested Page Fault.

In collaboration with: Leon Dang (ldang@nahannisys.com)
Discussed with: grehan
MFC after: 1 week

9 years agoCALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than ten
jkim [Fri, 22 May 2015 17:05:21 +0000 (17:05 +0000)]
CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than ten
years for head.  However, it is continuously misused as the mpsafe argument
for callout_init(9).  Deprecate the flag and clean up callout_init() calls
to make them more consistent.

Differential Revision: https://reviews.freebsd.org/D2613
Reviewed by: jhb
MFC after: 2 weeks

9 years agoBump rx_overruns when indicated by the ICR mask.
sbruno [Fri, 22 May 2015 17:01:43 +0000 (17:01 +0000)]
Bump rx_overruns when indicated by the ICR mask.

PR: 199716
MFC after: 3 days
Sponsored by: Limelight Networks

9 years agoFix a syntax error in bsdinstall/zfsboot
allanjude [Fri, 22 May 2015 15:57:42 +0000 (15:57 +0000)]
Fix a syntax error in bsdinstall/zfsboot

Differential Revision: https://reviews.freebsd.org/D2571
Submitted by: Michael Dexter
Approved by: dteske
MFC after: 1 week
X-MFC-With: r283023, r282443
Sponsored by: ScaleEngine Inc.

9 years agoAdd a miibus_statchg and use it to enable Gigabit mode when appropriate.
andrew [Fri, 22 May 2015 14:25:23 +0000 (14:25 +0000)]
Add a miibus_statchg and use it to enable Gigabit mode when appropriate.

MFC after: 1 week

9 years agoStart documenting ctl(4) sysctls.
trasz [Fri, 22 May 2015 12:01:29 +0000 (12:01 +0000)]
Start documenting ctl(4) sysctls.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

9 years agoAdvertise ctlstat(8) a little better.
trasz [Fri, 22 May 2015 11:59:37 +0000 (11:59 +0000)]
Advertise ctlstat(8) a little better.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

9 years agoExpand ktr_mask to be a 64-bit unsigned integer.
jhb [Fri, 22 May 2015 11:09:41 +0000 (11:09 +0000)]
Expand ktr_mask to be a 64-bit unsigned integer.

The mask does not really need to be updated with atomic operations and
the downside of losing races during transitions is not great (it is
not marked volatile, so those races are pretty wide open as it is).

Differential Revision: https://reviews.freebsd.org/D2595
Reviewed by: emaste, neel, rpaulo
MFC after: 2 weeks

9 years agoOnly reparent a traced process to its old parent if the tracing process is
jhb [Fri, 22 May 2015 11:04:54 +0000 (11:04 +0000)]
Only reparent a traced process to its old parent if the tracing process is
not the old parent. Otherwise, proc_reap() will leave the zombie in place
resulting in the process' status being returned twice to its parent.

Add test cases for PT_TRACE_ME and PT_ATTACH which are fixed by
this change.

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