Commit Graph

19579 Commits

Author SHA1 Message Date
wiz e92fdad11f fifo -> FIFO. Sort errors. 2019-06-20 06:59:32 +00:00
kamil 177438b064 Add mkfifo{,at}(2) mode in mknod{,at}(2) as requested by POSIX
mknod with mode & S_IFIFO and dev=0 shall behave like mkfifo.

Update the documentation to reflect this state.

Add ATF tests.

This is an in-kernel implementation as typically user-space programs use
mkfifo(2) directly, however whenever there is need to bypass libc (like in
valgrind) then portable POSIX software calls the mknod syscall.

Noted on tech-kern@ by Greg Troxel.
2019-06-20 03:31:53 +00:00
uwe b84ea9c460 Small markup fixes. 2019-06-19 20:20:52 +00:00
kamil a04979c2ea Fix warning message for mknod symbol linkage
The correct reference for mknod(2) is in <sys/stat.h>
2019-06-18 14:25:04 +00:00
wiz f525fbd105 Fix typo. 2019-06-12 12:32:54 +00:00
kamil 3fa4aee840 Try to make posix_spawn(3) note in ptrace(2) less confusing 2019-06-12 12:30:42 +00:00
kamil 212f28ad56 Rephrase sentence about vfork+exec in posix_spawn(3)
Try to make it less confusing.

Requested by <joerg>
2019-06-12 12:26:24 +00:00
wiz 10cd7be093 Use Xr. 2019-06-12 10:09:26 +00:00
kamil a2bdb35ead Document that posix_spawn(3) uses a dedicated syscall
vfork+exec operations are done in one go. This is important information for
programs that wrap posix_spawn(3).
2019-06-12 00:05:48 +00:00
kamil b57d087b4c Document PTRACE_POSIX_SPAWN in man-page 2019-06-11 23:27:46 +00:00
wiz afa9490a07 Quote the name "Ed" to avoid confusion with the macro "Ed". 2019-06-11 12:49:21 +00:00
kamil 93e6f7a330 Correct outdated note that posix_spawn(3) is implemented with vfork(2)
The original FreeBSD libc code uses vfork(2), it's not the case for NetBSD
as there is a dedicated kernel syscall.
2019-06-11 12:47:34 +00:00
blymn febeea01e0 Fix typo for unknown key keyname return. 2019-06-11 10:17:24 +00:00
blymn 2a780e62ed Rework previous fix for getch cursor position when cursor is moved
without refresh.  If the window is not dirty but the window cursor
position does not match curscr then move the cursor.  This fixes
the issues seen in PR lib/54263.
2019-06-09 07:40:14 +00:00
maxv d1002cd7eb Change the NVMM API to reduce data movements. Sent to tech-kern@. 2019-06-08 07:27:44 +00:00
christos 037284caf7 PR/54281: Jonathan Perkins: NUL terminate rl_line_buffer on modification
to avoid completion leak.
2019-06-07 15:21:48 +00:00
christos 72dd3db662 PR/54280: rl_completer_quote_characters should be const for readline compat 2019-06-07 15:19:29 +00:00
christos b8c4664f83 PR/54279: Jonathan Perkins: Ignore adjacent start/end prompt ignore. 2019-06-07 15:18:20 +00:00
hannken 6f60c4f99e Move the basic part of XDR to common/include/rpc and common/lib/libc/rpc.
No functional change intended.
2019-06-04 15:07:55 +00:00
hannken 25da6a6235 Implement xdrmem_control(), used as xdr_control(xdr, XDR_GET_BYTES_AVAIL ...
and bump libc minor number.

Final goal is to remove the unmaintained XDR implementation
at external/cddl/osnet/dist/uts/common/rpc.
2019-06-04 08:44:08 +00:00
mlelstv 8137552a24 Fix key loading logic and add log message when rejecting an unencrypted key. 2019-06-01 07:15:39 +00:00
msaitoh a582b4ae9f Fix typo(s/suppport/support/) in comment. From FreeBSD. 2019-05-29 02:30:42 +00:00
christos 2f3bda949c Add GLOB_TILDE_CHECK (from GNU) 2019-05-29 01:21:33 +00:00
abhinav e1cf3640ab Fix typo: s/then/the 2019-05-26 06:18:13 +00:00
kamil 7be13601f3 Update the ptrace(2) documentation
Document that TRAP_EXEC can be returned for PT_SYSCALL.
Document truncated byte transfers.
2019-05-25 04:25:14 +00:00
blymn e2cfd49c61 Back out incorrect fix for PR 53617 and fix it in a different way.
Keep track of the cursor location, if getch is called without a refresh
and without pending updates (dirty windows) then move the cursor to the
correct location directly.  Doing this prevents unnecessary refreshes.
2019-05-20 22:17:41 +00:00
tpaul 0b7d2ee43d Prevent Lua from crashing if clear_bindings() is called on a statement
that failed to prepare().

ok mbalmer@
2019-05-16 12:42:35 +00:00
blymn 652cdcd214 Fix _cursesi_addwchar so that it performs line wrap. SUSv2 says
add_wch line wraps and updates position.  Since wrap is done we are
not past EOL.
2019-05-12 02:29:00 +00:00
blymn d63c9d29fb Add more debug to _wnoutrefresh 2019-05-12 02:19:23 +00:00
maxv c32e3374f1 Replace "VMM" by "emulator", clearer. 2019-05-11 07:44:00 +00:00
maxv 113821f1a2 Sync with reality. 2019-05-11 07:40:38 +00:00
maxv bfb4017486 Rework the machine configuration interface.
Provide three ranges in the conf space: <libnvmm:0-100>, <MI:100-200> and
<MD:200-...>. Remove nvmm_callbacks_register(), and replace it by the conf
op NVMM_MACH_CONF_CALLBACKS, handled by libnvmm. The callbacks are now
per-machine, and the emulators should now do:

-	nvmm_callbacks_register(&cbs);
+	nvmm_machine_configure(&mach, NVMM_MACH_CONF_CALLBACKS, &cbs);

This provides more granularity, for example if the process runs two VMs
and wants different callbacks for each.
2019-05-11 07:31:56 +00:00
nakayama 063ec26a98 Don't build compat LLVM PIC libraries since it is unused if MKCOMPATX11 == "no". 2019-05-10 09:42:46 +00:00
wiz 220b9b32b9 Remove trailing whitespace. 2019-05-09 09:09:38 +00:00
bad a057d46c24 Clarify that strunvisx() and strnunvisx() take the same flags as unvis().
Document VIS_NOESCAPE for unvis().
Bump date.
2019-05-08 15:37:41 +00:00
christos 9beb52efed mention truncation of the result if the size in optlen is less that the
size of the option to be returned in optval.
2019-05-08 14:10:42 +00:00
maya 07975b2231 Make CLEANFILES actually work. .TARGET is not defined when not in a target
rule.

Thanks xtos for the heads up.
2019-05-07 18:45:37 +00:00
maya 53af5ae4cc Replace the link command for libpthread.a so that we create a single section
with all the libpthread symbols in it.
This makes -lpthread behave like to -Wl,--whole-archive -lpthread.

This avoids a situation where threaded static binaries use some libc thread
stubs, which are racy.

Fixes PR lib/54001: call_once2_32, call_once2_static test cases failing on
amd64 since gcc7 import.

Suggested by Jonathan Wakely, thanks!
2019-05-07 18:12:53 +00:00
wiz fd62bcefca Remove extra word. 2019-05-06 06:56:36 +00:00
christos 0e2d77f8ff document the EINVAL caused by a large nfds. 2019-05-06 00:50:26 +00:00
scole 5b44457805 add stop (;;) to elimate WAW dependency compiler warning 2019-05-04 22:55:32 +00:00
mgorny c1c809ed5e Explicitly indicate that nexttowardl() is identical to nextafterl().
Requested by kamil.
2019-05-02 15:08:35 +00:00
maxv 0d954de6fa Use the comm page to inject events, rather than ioctls, and commit them in
vcpu_run. This saves a few syscalls and copyins.

For example on Windows 10, moving the mouse from the left to right sides of
the screen generates ~500 events, which now don't result in syscalls.

The error handling is done in vcpu_run and it is less precise, but this
doesn't matter a lot, and will be solved with future NVMM error codes.
2019-05-01 09:20:21 +00:00
kamil 45dae6038c Avoid incompatible function pointer casts in thrd_create(3)
Use an intermediate function trampoline to workaround different function
pointer prototypes.

While there, correct scenario returning thrd_nomem from thrd_create(3).
In practice ENOMEM is rarely returned from pthread(3).

Older code worked on tested ports, but was depending on unneeded UB.
2019-04-29 20:11:43 +00:00
maxv 6c51ea96f5 sync with reality 2019-04-29 19:03:17 +00:00
maxv 250161fe1f Stop taking care of the INT/NMI windows in the kernel, the emulator is
supposed to do that itself.
2019-04-29 18:54:25 +00:00
maxv c49a183c64 Remove useless calls to nvmm_init(). 2019-04-29 17:27:57 +00:00
kre 63e182f423 snprintb(3) says that, in the new(?) Torek format, all fields specs end with \0
The F spec is one of those, it should be terminated with \0 just like all
the others (irrelevant that it has no extra data to delimit).

Fix <sys/mman.h> to define the snprintb() format string correctly (include
the missing \0's).   Fix the copy of that definition included into
snprintb(3) to match the updated mman.h version (ride the date bump
from the day before yesterday .. this is the same change, just corrected).

Undo the previous snprintb.c change ("off by one" fix) which was an
attempt to make the broken mman.h usage work (and did, but not the way
it should be done).   Also, after using the new * format (instead of only
when something has already matched) skip the associated data so we don't
attempt to interpret it as more field specifiers.  This func needs lots of TLC!

Fix the ATF tests for snprintb() to not assume that F format is really
exactly like f format, and has data after the field specifier.  It doesn't.
Add several more tests (including testing the '*' field operator
recently added).
2019-04-29 07:55:38 +00:00
maxv f973734497 Modify the communication layer between the kernel NVMM driver and libnvmm:
introduce a bidirectionnal "comm page", a page of memory shared between
the kernel and userland, and used to transfer data in and out in a more
performant manner than ioctls.

The comm page contains the VCPU state, plus three flags:

 - "wanted": the states the kernel must get/set when requested via ioctls
 - "cached": the states that are in the comm page
 - "commit": the states the kernel must set in vcpu_run

The idea is to avoid performing expensive syscalls, by using the VCPU
state cached, either explicitly or speculatively, in the comm page. For
example, if the state is cached we do a direct 1->5 with no syscall:

          +---------------------------------------------+
          |                    Qemu                     |
          +---------------------------------------------+
               |                                   ^
               | (0) nvmm_vcpu_getstate            | (6) Done
               |                                   |
               V                                   |
             +---------------------------------------+
             |                libnvmm                |
             +---------------------------------------+
                  |   ^          |               ^
        (1) State |   | (2) No   | (3) Ioctl:    | (5) Ok, state
        cached?   |   |          | "please cache | fetched
                  |   |          |  the state"   |
                  V   |          |               |
              +-----------+      |               |
              | Comm Page |------+---------------+
              +-----------+      |
                       ^         |
          (4) "Alright |         V
               babe"   |     +--------+
                       +-----| Kernel |
                             +--------+

The main changes in behavior are:

 - nvmm_vcpu_getstate(): won't emit a syscall if the state is already
   cached in the comm page, will just fetch from the comm page directly
 - nvmm_vcpu_setstate(): won't emit a syscall at all, will just cache
   the wanted state in the comm page
 - nvmm_vcpu_run(): will commit the to-be-set state in the comm page,
   as previously requested by nvmm_vcpu_setstate()

In addition to this, the kernel NVMM driver is changed to speculatively
cache certain states known to be of interest, so that the future
nvmm_vcpu_getstate() calls libnvmm or the emulator will perform will use
the comm page rather than expensive syscalls. For example, if an I/O
VMEXIT occurs, the I/O Assist in libnvmm will want GPRS+SEGS+CRS+MSRS,
and now the kernel caches all of that in the comm page before returning
to userland.

Overall, in a normal run of Windows 10, this saves several millions of
syscalls. Eg on a 4CPU Intel with 4VCPUs, booting the Win10 install ISO
goes from taking 1min35 to taking 1min16.

The libnvmm API is not changed, but the ABI is. If we changed the API it
would be possible to save expensive memcpys on libnvmm's side. This will
be avoided in a future version. The comm page can also be extended to
implement future services.
2019-04-28 14:22:13 +00:00
wiz 6d61444732 Remove undefined \*H 2019-04-28 07:33:02 +00:00