]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agoxen: make sure xenpv bus is the last to attach
royger [Mon, 25 May 2015 09:47:16 +0000 (09:47 +0000)]
xen: make sure xenpv bus is the last to attach

This is needed so other buses have a chance of attaching a real ISA bus, if
none is found xenpv will attach it.

Sponsored by: Citrix Systems R&D

9 years agoRemove excess Giant acquisition around the dounmount() call.
kib [Mon, 25 May 2015 09:08:19 +0000 (09:08 +0000)]
Remove excess Giant acquisition around the dounmount() call.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agosfxge: add 7xxx NICs family support
arybchik [Mon, 25 May 2015 08:34:55 +0000 (08:34 +0000)]
sfxge: add 7xxx NICs family support

Support 7xxx adapters including firmware-assisted TSO and VLAN tagging:

  - Solarflare Flareon Ultra 7000 series 10/40G adapters:
    - Solarflare SFN7042Q QSFP+ Server Adapter
    - Solarflare SFN7142Q QSFP+ Server Adapter

  - Solarflare Flareon Ultra 7000 series 10G adapters:
    - Solarflare SFN7022F SFP+ Server Adapter
    - Solarflare SFN7122F SFP+ Server Adapter
    - Solarflare SFN7322F Precision Time Synchronization Server Adapter

  - Solarflare Flareon 7000 series 10G adapters:
    - Solarflare SFN7002F SFP+ Server Adapter

Support utilities to configure adapters and update firmware.

The work is done by Solarflare developers
(Andy Moreton, Andrew Lee and many others),
Artem V. Andreev <Artem.Andreev at oktetlabs.ru> and me.

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 weeks
Causually read by: gnn
Differential Revision: https://reviews.freebsd.org/D2618

9 years agoUse the correct number of arguments for the
markj [Mon, 25 May 2015 01:31:39 +0000 (01:31 +0000)]
Use the correct number of arguments for the
opencrypto:deflate:deflate_global:bad DTrace probe, which is defined to
have

MFC after: 1 week

9 years agoRemove unused references to calltrap.
markj [Mon, 25 May 2015 01:22:56 +0000 (01:22 +0000)]
Remove unused references to calltrap.

MFC after: 3 days

9 years agolockstat(1): document the -V option.
markj [Mon, 25 May 2015 01:18:46 +0000 (01:18 +0000)]
lockstat(1): document the -V option.

MFC after: 3 days

9 years agoRemove a reference to the PBDRY flag, which itself was removed in r248470.
markj [Mon, 25 May 2015 01:09:18 +0000 (01:09 +0000)]
Remove a reference to the PBDRY flag, which itself was removed in r248470.

MFC after: 3 days

9 years agoFor objcopy, use --input-target and --output-target
rodrigc [Mon, 25 May 2015 01:07:55 +0000 (01:07 +0000)]
For objcopy, use --input-target and --output-target

When building with gcc 4.9 and binutils 2.25,
using '--input' and '--output' returns an error
message:
   objcopy: option `--input' is ambiguous

Reported by:  Jenkins

9 years agoRename fdt_find_child to ofw_bus_find_child. There is nothing FDT-specific
gonzo [Sun, 24 May 2015 23:53:10 +0000 (23:53 +0000)]
Rename fdt_find_child to ofw_bus_find_child. There is nothing FDT-specific
in this function.

Suggested by: andrew@

9 years agoRemove SUBDIR_DEPEND for non-existent libreadline directory
ngie [Sun, 24 May 2015 23:19:47 +0000 (23:19 +0000)]
Remove SUBDIR_DEPEND for non-existent libreadline directory

libreadline lives under gnu/lib

MFC after: 1 week

9 years agoLinux nanosleep() and clock_nanosleep() system calls always
dchagin [Sun, 24 May 2015 18:14:38 +0000 (18:14 +0000)]
Linux nanosleep() and clock_nanosleep() system calls always
writes the remaining time into the structure pointed to by rmtp
unless rmtp is NULL. The value of *rmtp can then be used to call
nanosleep() again and complete the specified pause if the previous
call was interrupted.

Note. clock_nanosleep() with an absolute time value does not write
the remaining time.

While here fix whitespaces and typo in SDT_PROBE.

9 years agoConvert SCM_TIMESTAMP in recvmsg().
dchagin [Sun, 24 May 2015 18:13:21 +0000 (18:13 +0000)]
Convert SCM_TIMESTAMP in recvmsg().

9 years agoThe latest cp tool is trying to use the btrfs clone operation that is
dchagin [Sun, 24 May 2015 18:12:04 +0000 (18:12 +0000)]
The latest cp tool is trying to use the btrfs clone operation that is
implemented via ioctl interface. First of all return ENOTSUP for this
operation as a cp fallback to usual method in that case. Secondly, do
not print out the message about unimplemented operation.

9 years agoHide vfs.pfs.trace variable if it is not used.
dchagin [Sun, 24 May 2015 18:11:22 +0000 (18:11 +0000)]
Hide vfs.pfs.trace variable if it is not used.

9 years agoFix an mbuf(9) leak in sendmsg() under failure condition and
dchagin [Sun, 24 May 2015 18:10:07 +0000 (18:10 +0000)]
Fix an mbuf(9) leak in sendmsg() under failure condition and
remove unneeded check for failed M_WAITOK allocation.

Found by: Brainy Code Scanner
Reported by: Maxime Villard

9 years agoRegen for r283492.
dchagin [Sun, 24 May 2015 18:09:01 +0000 (18:09 +0000)]
Regen for r283492.

9 years agoImplement Linux specific syncfs() system call.
dchagin [Sun, 24 May 2015 18:08:01 +0000 (18:08 +0000)]
Implement Linux specific syncfs() system call.

9 years agoProperly check tv_nsec value. The tv_nsec field can also be one
dchagin [Sun, 24 May 2015 18:06:46 +0000 (18:06 +0000)]
Properly check tv_nsec value. The tv_nsec field can also be one
of the special value UTIME_NOW or UTIME_OMIT.

9 years agoSince FreeBSD supports SOCK_CLOEXEC & SOCK_NONBLOCK options
dchagin [Sun, 24 May 2015 18:06:12 +0000 (18:06 +0000)]
Since FreeBSD supports SOCK_CLOEXEC & SOCK_NONBLOCK options
remove its emulation via fcntl call from Linuxulator.

9 years agoRegen for r283488.
dchagin [Sun, 24 May 2015 18:05:21 +0000 (18:05 +0000)]
Regen for r283488.

9 years agoImplement recvmmsg() and sendmmsg() system calls.
dchagin [Sun, 24 May 2015 18:04:04 +0000 (18:04 +0000)]
Implement recvmmsg() and sendmmsg() system calls.

9 years agoReduce duplication between MD Linux code by moving msg related
dchagin [Sun, 24 May 2015 18:03:14 +0000 (18:03 +0000)]
Reduce duplication between MD Linux code by moving msg related
struct definitions out into the compat/linux/linux_socket.h

9 years agoRegen for r283484.
dchagin [Sun, 24 May 2015 18:02:17 +0000 (18:02 +0000)]
Regen for r283484.

9 years agoImplement epoll_pwait() system call.
dchagin [Sun, 24 May 2015 18:00:14 +0000 (18:00 +0000)]
Implement epoll_pwait() system call.

9 years agoConvert signal number to native for VT_SETMODE ioctl and remove
dchagin [Sun, 24 May 2015 17:59:17 +0000 (17:59 +0000)]
Convert signal number to native for VT_SETMODE ioctl and remove
strange and invalid ISSIGVALID macro.
The code has not been tested right way but it was originally broken.

9 years agoRegen for r283480.
dchagin [Sun, 24 May 2015 17:58:24 +0000 (17:58 +0000)]
Regen for r283480.

9 years agoAdd utimensat() system call.
dchagin [Sun, 24 May 2015 17:57:07 +0000 (17:57 +0000)]
Add utimensat() system call.

The patch developed by Jilles Tjoelker and Andrew Wilcox and
adopted for lemul branch by me.

9 years agoThe kernel sends signals to the processes via ABI specific sv_sendsig method.
dchagin [Sun, 24 May 2015 17:56:02 +0000 (17:56 +0000)]
The kernel sends signals to the processes via ABI specific sv_sendsig method.
Native ABI do not need signal conversion, only emulators may want this. Usually
emulators implements its own sv_sendsig method. For now only ibcs2 emulator does
not have own sv_sendsig implementation and depends on native sendsig() method.
So, remove any extra attempts to convert signal numbers from native sendsig()
methods except from i386 where ibsc2 is living.

9 years agoSimplify linprocfs_doprocenviron(). Remove extra proc visibility checks
dchagin [Sun, 24 May 2015 17:53:48 +0000 (17:53 +0000)]
Simplify linprocfs_doprocenviron(). Remove extra proc visibility checks
and initialize pn_vis by well known procfs_candebug().

9 years agoConvert Linux signal number to the FreeBSD.
dchagin [Sun, 24 May 2015 17:49:09 +0000 (17:49 +0000)]
Convert Linux signal number to the FreeBSD.

9 years agoConvert Linux sigsets before showing.
dchagin [Sun, 24 May 2015 17:48:34 +0000 (17:48 +0000)]
Convert Linux sigsets before showing.
Linux kernel displays sigset always as 16x4 bit mask.

9 years agoRework signal code to allow using it by other modules, like linprocfs:
dchagin [Sun, 24 May 2015 17:47:20 +0000 (17:47 +0000)]
Rework signal code to allow using it by other modules, like linprocfs:

1. Linux sigset always 64 bit on all platforms. In order to move Linux
sigset code to the linux_common module define it as 64 bit int. Move
Linux sigset manipulation routines to the MI path.

2. Move Linux signal number definitions to the MI path. In general, they
are the same on all platforms except for a few signals.

3. Map Linux RT signals to the FreeBSD RT signals and hide signal conversion
tables to avoid conversion errors.

4. Emulate Linux SIGPWR signal via FreeBSD SIGRTMIN signal which is outside
of allowed on Linux signal numbers.

PR: 197216

9 years agoAdd support for /proc/<pid>/auxv.
dchagin [Sun, 24 May 2015 17:46:04 +0000 (17:46 +0000)]
Add support for /proc/<pid>/auxv.

9 years agoAdd vdso and stack names to the /proc/self/maps.
dchagin [Sun, 24 May 2015 17:44:42 +0000 (17:44 +0000)]
Add vdso and stack names to the /proc/self/maps.

9 years agoAccording to Linux man sigaltstack(3) shall return EINVAL if the ss
dchagin [Sun, 24 May 2015 17:44:08 +0000 (17:44 +0000)]
According to Linux man sigaltstack(3) shall return EINVAL if the ss
argument is not a null pointer, and the ss_flags member pointed to by ss
contains flags other than SS_DISABLE. However, in fact, Linux also
allows SS_ONSTACK flag which is simply ignored.

For buggy apps (at least mono) ignore other than SS_DISABLE
flags as a Linux do.

While here move MI part of sigaltstack code to the appropriate place.

Reported by: abi at abinet dot ru

9 years agoAdd EPOLLERR flag handling to epoll.
dchagin [Sun, 24 May 2015 17:42:45 +0000 (17:42 +0000)]
Add EPOLLERR flag handling to epoll.

Tested by: abi at abinet dot ru

9 years agoAs fo_fill_kinfo() does not check fo_fill_kinfo to NULL
dchagin [Sun, 24 May 2015 17:40:14 +0000 (17:40 +0000)]
As fo_fill_kinfo() does not check fo_fill_kinfo to NULL
add a fo_fill_kinfo op to eventfdops.

Reported by: trinity

9 years agoRegen for r283467.
dchagin [Sun, 24 May 2015 17:39:18 +0000 (17:39 +0000)]
Regen for r283467.

9 years agoCall nosys in case when the incorrect syscall number is specified.
dchagin [Sun, 24 May 2015 17:38:02 +0000 (17:38 +0000)]
Call nosys in case when the incorrect syscall number is specified.

Reported by: trinity

9 years agoRegen for r283465.
dchagin [Sun, 24 May 2015 17:35:42 +0000 (17:35 +0000)]
Regen for r283465.

9 years agoAdd preliminary fallocate system call implementation
dchagin [Sun, 24 May 2015 17:33:21 +0000 (17:33 +0000)]
Add preliminary fallocate system call implementation
to emulate posix_fallocate() function.

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

9 years agoDelete the duplicate of linux_to_native_clockid() function.
dchagin [Sun, 24 May 2015 17:30:31 +0000 (17:30 +0000)]
Delete the duplicate of linux_to_native_clockid() function.

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

9 years agoDo not use struct l_timespec without conversion. While here move
dchagin [Sun, 24 May 2015 17:29:18 +0000 (17:29 +0000)]
Do not use struct l_timespec without conversion. While here move
args->timeout handling before acquiring the futex key at FUTEX_WAIT path.

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

9 years agoAdd prototypes for static futex functions.
dchagin [Sun, 24 May 2015 17:27:59 +0000 (17:27 +0000)]
Add prototypes for static futex functions.

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

9 years agoAs for now our tmpfs is no longer being considered
dchagin [Sun, 24 May 2015 17:26:58 +0000 (17:26 +0000)]
As for now our tmpfs is no longer being considered
"highly experimental" remove /dev/shm magic commited
in r218497 and convert tmpfs type to an expected magic number.

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

9 years agoPrint out unsupported futex operation message only once for the process.
dchagin [Sun, 24 May 2015 17:25:57 +0000 (17:25 +0000)]
Print out unsupported futex operation message only once for the process.

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

9 years agoAdd some clock mappings used in glibc 2.20.
dchagin [Sun, 24 May 2015 17:23:08 +0000 (17:23 +0000)]
Add some clock mappings used in glibc 2.20.

Differential Revision: https://reviews.freebsd.org/D1465
Reviewd by: trasz

9 years agoImprove ktr(9) records in thread managment code.
dchagin [Sun, 24 May 2015 17:09:07 +0000 (17:09 +0000)]
Improve ktr(9) records in thread managment code.

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

9 years agoUse local struct proc * varable instead of dereferencing td->td_proc.
dchagin [Sun, 24 May 2015 17:08:25 +0000 (17:08 +0000)]
Use local struct proc * varable instead of dereferencing td->td_proc.

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

9 years agoAvoid unnecessary em zeroing in non-exec path
dchagin [Sun, 24 May 2015 17:07:10 +0000 (17:07 +0000)]
Avoid unnecessary em zeroing in non-exec path
as it already zeroed by malloc with M_ZERO flag
and move zeroing to the proper place in exec path.

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

9 years agoRemove the unnecessary cast.
dchagin [Sun, 24 May 2015 17:05:59 +0000 (17:05 +0000)]
Remove the unnecessary cast.

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

9 years agoRegen for r283451.
dchagin [Sun, 24 May 2015 17:00:43 +0000 (17:00 +0000)]
Regen for r283451.

9 years agoImplement ppoll() system call.
dchagin [Sun, 24 May 2015 16:59:25 +0000 (16:59 +0000)]
Implement ppoll() system call.

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

9 years agotd_sigmask of a newly created thread copied from td.
dchagin [Sun, 24 May 2015 16:56:32 +0000 (16:56 +0000)]
td_sigmask of a newly created thread copied from td.
Remove excess initialization of td_sigmask.

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

9 years agoUpdate Linux compat revision to 32.
dchagin [Sun, 24 May 2015 16:55:32 +0000 (16:55 +0000)]
Update Linux compat revision to 32.

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

9 years agoConnect linux64 module to the build.
dchagin [Sun, 24 May 2015 16:53:32 +0000 (16:53 +0000)]
Connect linux64 module to the build.

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

9 years agoFix linux_common module build with KTR option.
dchagin [Sun, 24 May 2015 16:52:45 +0000 (16:52 +0000)]
Fix linux_common module build with KTR option.

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

9 years agoInclude opt_compat.h, so that COMPAT_LINUX32 is defined, and we can
dchagin [Sun, 24 May 2015 16:51:04 +0000 (16:51 +0000)]
Include opt_compat.h, so that COMPAT_LINUX32 is defined, and we can
access to the semop structs and functions.

Submitted by: cognet@

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

9 years agoRegen for r283444.
dchagin [Sun, 24 May 2015 16:50:17 +0000 (16:50 +0000)]
Regen for r283444.

9 years agoImplement eventfd system call.
dchagin [Sun, 24 May 2015 16:49:14 +0000 (16:49 +0000)]
Implement eventfd system call.

Differential Revision: https://reviews.freebsd.org/D1094
In collaboration with: Jilles Tjoelker

9 years agoPut the correct value for the abi_nfdbits parameter of kern_select() for
dchagin [Sun, 24 May 2015 16:47:13 +0000 (16:47 +0000)]
Put the correct value for the abi_nfdbits parameter of kern_select() for
all supported Linuxulators.

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

9 years agoRegen for r283441.
dchagin [Sun, 24 May 2015 16:42:49 +0000 (16:42 +0000)]
Regen for r283441.

9 years agoImplement epoll family system calls. This is a tiny wrapper
dchagin [Sun, 24 May 2015 16:41:39 +0000 (16:41 +0000)]
Implement epoll family system calls. This is a tiny wrapper
around kqueue() to implement epoll subset of functionality.
The kqueue user data are 32bit on i386 which is not enough for
epoll user data, so we keep user data in the proc emuldata.

Initial patch developed by rdivacky@ in 2007, then extended
by Yuri Victorovich @ r255672 and finished by me
in collaboration with mjg@ and jillies@.

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

9 years agoFor future use in the Linuxulator:
dchagin [Sun, 24 May 2015 16:36:29 +0000 (16:36 +0000)]
For future use in the Linuxulator:

1. Add a kern_kqueue() counterpart for kqueue() with flags parameter.

2. Be a bit secure. To avoid a double fp lookup add a kern_kevent_fp()
counterpart for kern_kevent() with file pointer parameter instead
of file descriptor an pass the buck to it.

Suggested by: mjg [2]

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

9 years agoImplement F_DUPFD_CLOEXEC fcntl flag.
dchagin [Sun, 24 May 2015 16:34:57 +0000 (16:34 +0000)]
Implement F_DUPFD_CLOEXEC fcntl flag.

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

9 years agoAdd several fcntl flags.
dchagin [Sun, 24 May 2015 16:32:52 +0000 (16:32 +0000)]
Add several fcntl flags.

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

9 years agoTo avoid code duplication move open/fcntl definitions to the MI
dchagin [Sun, 24 May 2015 16:31:44 +0000 (16:31 +0000)]
To avoid code duplication move open/fcntl definitions to the MI
header file.

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

9 years agoUse the BSD_TO_LINUX_SIGNAL() wherever there is no need
dchagin [Sun, 24 May 2015 16:30:23 +0000 (16:30 +0000)]
Use the BSD_TO_LINUX_SIGNAL() wherever there is no need
to check the ABI as it is known.

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

9 years agoConvert Linux wait options to the FreeBSD.
dchagin [Sun, 24 May 2015 16:28:58 +0000 (16:28 +0000)]
Convert Linux wait options to the FreeBSD.
Check wait options as a Linux do.
Linux always set WEXITED option not a WUNTRACED|WNOHANG
which is a strange bug.

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

9 years agoSet WIFCONTINUED to the wait status if needed.
dchagin [Sun, 24 May 2015 16:27:38 +0000 (16:27 +0000)]
Set WIFCONTINUED to the wait status if needed.

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

9 years agoRewrite linux_recvfrom. To avoid double conversion of sockaddr use
dchagin [Sun, 24 May 2015 16:26:55 +0000 (16:26 +0000)]
Rewrite linux_recvfrom. To avoid double conversion of sockaddr use
kern_recvit() directly.
And check fromlen parameter before sockaddr copyin and conversion.

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

9 years agoBeing exported through vdso the note.Linux section used by glibc
dchagin [Sun, 24 May 2015 16:25:44 +0000 (16:25 +0000)]
Being exported through vdso the note.Linux section used by glibc
to determine the kernel version (this saves one uname call).
Temporarily disable the export of a note.Linux section until I figured
out how to change the kernel version in the note.Linux on the fly.

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

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.