Commit Graph

19785 Commits

Author SHA1 Message Date
msaitoh
ba5c90c4a4 s/sucess/success/ in comment. 2019-12-27 09:45:26 +00:00
msaitoh
a0403cde04 s/transfered/transferred/ 2019-12-27 09:41:48 +00:00
msaitoh
a5effc3ce9 s/inital/initial/ 2019-12-27 09:25:57 +00:00
msaitoh
40064e2457 s/lenght/length/ 2019-12-26 04:53:11 +00:00
joerg
8e5b2c30bd Since pthread_setspecific requires locks, ensure that they are acquired
before fork and dropped in both parent and child. At least Python
depends on TSD after fork, even though it is undefined behavior in
POSIX.
2019-12-25 00:44:45 +00:00
reed
030d4fb522 Simply Subsection headers
There was a formatting issue with mandoc showing the
literal "Ss" macros. I reported this bug to mandoc since groff
didn't have same formatting. It was recommended to simplify
the formatting due to the weird feature.
Note because of this for groff I didn't use the Ux macro but spelled
out UNIX literally for these subsection headers
(since the macro reset the subsection formatting which was why
the Ss macro was repeated before to reactivate it).
2019-12-23 17:51:57 +00:00
kamil
cd653c6e17 Explain in kevent(2) the semantics of EINTR
All changes contained in the changelist are applied before returning this
error.
2019-12-23 01:46:09 +00:00
kamil
e6ecafaf7d Document udata type switch in struct kevent in the kqueue(2) 2019-12-22 17:01:15 +00:00
leot
4bf7b66e0f tcgetsid() is defined in <termios.h>, not <sys/types.h> or <unistd.h>. 2019-12-19 16:12:21 +00:00
joerg
7ed25834ce Bump PTHREAD__UNPARK_MAX to 128 as bandaid for locking related hangs. 2019-12-18 15:11:57 +00:00
christos
8282cab4e4 move file/lib after xz 2019-12-18 02:46:21 +00:00
uwe
df1f230d9f pthread__rwlock_spin - clarify the test.
It's more pedantically correct to check RW_WRITE_LOCKED before
obtaining the thread id of the owner.  And since there must be an
owner annotate the guard NULL check as unlinkely.

No functional change intended.  Ok ad@.
2019-12-16 22:22:11 +00:00
uwe
ba77a23d10 G/c unused rwlock owner macros copy-pasted from the kernel.
They were brought along with the rwlock flags but never used and never
even adapted to the new home (the struct member name is different
here).  I looked at adapting and using them, but they don't really
help readability that much and there are cases where we need to deal
with "fused" owner values anyway and so can't use them.
2019-12-16 20:45:40 +00:00
uwe
067b84db7c _DIAGASSERT that RW_FLAGMASK bits are not set in a thread pointer.
rwlock uses lower bits of a thread pointer for flags in the lock owner
field.  Assert that the pointer is properly aligned and those bits are
actually free to use.  This may not be the case when a program uses
its own allocator that can return less aligned pointers.
2019-12-15 23:13:33 +00:00
uwe
68463fd203 Drop bogus _DIAGASSERT that don't even compile. 2019-12-15 22:32:29 +00:00
joerg
ae9905d569 PR 54619: Remove semaphore limit introduce as part of GSoC 2016 with
_SC_SEM_NSEMS_MAX. Report no limit for getconf(3). The ressource is
naturally limited by the backing file descriptor, so no separate limit
is necessary. Keep the accounting for debugging as it is part of the
sysctl ABI exposed by the kernel.
2019-12-15 20:25:25 +00:00
ad
5f087b6f0f Redo previous more conventionally. Requested by kre@. 2019-12-11 20:19:27 +00:00
christos
5e9cbb1173 When 'attempted_completion_function' non-NULL, with a 'single_match'
match, the expected space is not being added. Problem observed with
"chronyc" and "sqlite3" tab completion. That functionality got
moved to escape_filename() for the !attempted_completion_function
case, but the non-NULL 'attempted_completion_function' case must
also be handled. (Lonnie Abelbeck)
2019-12-10 19:42:09 +00:00
ad
c470496698 Mask out always zero bits off pg->phys_addr. 2019-12-10 18:13:07 +00:00
riastradh
1ec67535be Add missing MLINK for membar_datadep_consumer(3).
Detected by the indefatigable wizd.
2019-12-07 15:13:59 +00:00
wiz
ec6e765cf3 Remove trailing whitespace. 2019-12-07 12:47:07 +00:00
pgoyette
ac676e6637 Note also that the load address (if provided) is also for the module's
text segment.
2019-12-06 21:45:14 +00:00
christos
95fb71b3fc Correct the man page, and say that the printf(3) format characters need
to be uintmax_t.
2019-12-06 19:31:52 +00:00
nros
fe9bbf72d9 Fix manpage due to updated aligned_alloc behavior
Since aligned_alloc does not demand that size is to be multiple of alignment
anymore, don't make that claim in the man page.
2019-12-06 16:19:32 +00:00
pgoyette
c5b5c0a464 Note that the size returned by modctl(2) and displayed by modstat(8) is
only for the module's text section, not for the entire size of the module.

Addresses PR kern-54737
2019-12-04 23:35:36 +00:00
christos
da2b6a5521 Add cfi annotations so that gdb can unwind the stack through signal handlers. 2019-12-02 01:38:54 +00:00
nakayama
b7b6f4ad9a Fix PR/54074 and PR/54093 completely.
More similar to the ld.elf_so logic, it is necessary to align with
p_align first.  Also, invert the #ifdef condition for consistency.

Should fix regression for static linking binaries:
http://releng.netbsd.org/b5reports/sparc/commits-2019.11.html#2019.11.10.23.39.03
http://releng.netbsd.org/b5reports/sparc64/commits-2019.11.html#2019.11.16.04.10.33
2019-11-21 23:06:15 +00:00
christos
b9ecc063aa PR/54654: Soren Tempel: Make sure el_cursor.v < el_terminal.t_size.v when
moving around.
2019-11-12 20:59:46 +00:00
joerg
76c7fc5f6b Update LLVM to 10.0.0git (01f3a59fb3e2542fce74c768718f594d0debd0da) 2019-11-11 22:44:56 +00:00
joerg
8b42e4de60 Mirror the ld.elf_so logic for handling aligning the TLS size.
Most noticable, recompute the start of the TLS area for variant I
relative to the TCB. This makes a difference when the segment size and
base alignment don't agree.
2019-11-07 22:25:21 +00:00
joerg
336e4f812b Use alignof and not size_t for platforms with non-natural base
alignments.
2019-11-05 22:22:42 +00:00
joerg
a0e0f8b685 PR 54093: Align static TLS area to max_align_t. 2019-11-04 12:45:10 +00:00
isaki
5b3dd8b1b9 Use record field for recording even on
SNDCTL_DSP_STEREO, SNDCTL_DSP_SETFMT, and SNDCTL_DSP_CHANNELS.
2019-11-03 11:13:45 +00:00
tnn
3896b31418 puffs_null_node_fsync: don't leak directory handle
Directory handles returned by opendir must be closed by closedir.
Also directory(3) says we mustn't close(2) descriptors returned by dirfd(3)
2019-11-02 18:14:36 +00:00
isaki
d97643b742 Use record.sample_rate for recording on SNDCTL_DSP_SPEED.
Fix PR lib/54667.
2019-11-02 11:48:23 +00:00
joerg
fc0c7dc82c Always include soft-float compare and order logic in libc when using
compiler-rt.
2019-10-29 16:08:50 +00:00
joerg
7e53a6c032 Annotate a covering switch as such to avoid warnings about missing
returns.
2019-10-28 18:12:17 +00:00
maxv
3ed59424a4 should be fork(2), noticed by wiz 2019-10-28 14:20:28 +00:00
wiz
d1b0fb4965 Macro tidyness. 2019-10-28 13:43:42 +00:00
maxv
a5a9b7903f A few changes:
- Use smaller types in struct nvmm_capability.
 - Use smaller type for nvmm_io.port.
 - Switch exitstate to a compacted structure.
2019-10-28 08:30:49 +00:00
maxv
d2ac291e7d Change the way root_owner works: consider the calling process as root_owner
not if it has root privileges, but if the /dev/nvmm device was opened with
write permissions. Introduce the undocumented nvmm_root_init() function to
achieve that.

The goal is to simplify the logic and have more granularity, eg if we want
a monitoring agent to access VMs but don't want to give this agent real
root access on the system.
2019-10-27 20:17:36 +00:00
pgoyette
0c89d4ea55 accept() is a function, not an argument! 2019-10-27 12:28:13 +00:00
maxv
93f947bbaa Add a new VCPU conf option, that allows userland to request VMEXITs after a
TPR change. This is supported on all Intel CPUs, and not-too-old AMD CPUs.

The reason for wanting this option is that certain OSes (like Win10 64bit)
manage interrupt priority in hardware via CR8 directly, and for these OSes,
the emulator may want to sync its internal TPR state on each change.

Add two new fields in cap.arch, to report the conf capabilities. Report TPR
only on Intel for now, not AMD, because I don't have a recent AMD CPU on
which to test.
2019-10-27 10:28:55 +00:00
maxv
06a4f19afb Use the new PTE naming, and define CR3_FRAME_* separately. No functional
change.
2019-10-27 08:30:05 +00:00
maxv
a6418236ed Add the "nvmm" group, and make nvmm_init() public. Sent to tech-kern@ a few
days ago.
2019-10-27 07:08:15 +00:00
christos
f20a32fee4 Separate the NetBSD-specific fenv functions from the standard ones.
No functional change.
2019-10-26 17:57:20 +00:00
maxv
39beb8bb08 Update the libnvmm man page:
- Sync the naming with reality.

 - Replace "relevant" by "desired" and "virtualizer" by "emulator", closer
   to what I meant.

 - Add a "VCPU Configuration" section.

 - Add a "Machine Ownership" section.
2019-10-25 09:09:24 +00:00
kamil
77a1ad5f00 Switch the iconv(3) prototype to the POSIX conformant variation
Remove const from the 2nd argument.

const char ** and char ** are incompatible types and it was a cost to keep
the technically incompatible form for a more purist variation. NetBSD was
almost the last alive OS to still keep the const argument (known leftovers:
Minix and Illumos).

Keep the const form for the internal purposes inside citrus and rump.

Address the build breakage fallout in the same change.

There are no ABI changes.

Change accepted by core@.
2019-10-24 18:17:14 +00:00
maxv
e6f32a5866 Three changes in libnvmm:
- Add 'mach' and 'vcpu' backpointers in the nvmm_io and nvmm_mem
   structures.

 - Rename 'nvmm_callbacks' to 'nvmm_assist_callbacks'.

 - Rename and migrate NVMM_MACH_CONF_CALLBACKS to NVMM_VCPU_CONF_CALLBACKS,
   it now becomes per-VCPU.
2019-10-23 12:02:55 +00:00
maxv
f9fb7866ce Miscellaneous changes in NVMM, to address several inconsistencies and
issues in the libnvmm API.

 - Rename NVMM_CAPABILITY_VERSION to NVMM_KERN_VERSION, and check it in
   libnvmm. Introduce NVMM_USER_VERSION, for future use.

 - In libnvmm, open "/dev/nvmm" as read-only and with O_CLOEXEC. This is to
   avoid sharing the VMs with the children if the process forks. In the
   NVMM driver, force O_CLOEXEC on open().

 - Rename the following things for consistency:
       nvmm_exit*              -> nvmm_vcpu_exit*
       nvmm_event*             -> nvmm_vcpu_event*
       NVMM_EXIT_*             -> NVMM_VCPU_EXIT_*
       NVMM_EVENT_INTERRUPT_HW -> NVMM_VCPU_EVENT_INTR
       NVMM_EVENT_EXCEPTION    -> NVMM_VCPU_EVENT_EXCP
   Delete NVMM_EVENT_INTERRUPT_SW, unused already.

 - Slightly reorganize the MI/MD definitions, for internal clarity.

 - Split NVMM_VCPU_EXIT_MSR in two: NVMM_VCPU_EXIT_{RD,WR}MSR. Also provide
   separate u.rdmsr and u.wrmsr fields. This is more consistent with the
   other exit reasons.

 - Change the types of several variables:
       event.type                  enum -> u_int
       event.vector                uint64_t -> uint8_t
       exit.u.*msr.msr:            uint64_t -> uint32_t
       exit.u.io.type:             enum -> bool
       exit.u.io.seg:              int -> int8_t
       cap.arch.mxcsr_mask:        uint64_t -> uint32_t
       cap.arch.conf_cpuid_maxops: uint64_t -> uint32_t

 - Delete NVMM_VCPU_EXIT_MWAIT_COND, it is AMD-only and confusing, and we
   already intercept 'monitor' so it is never armed.

 - Introduce vmx_exit_insn() for NVMM-Intel, similar to svm_exit_insn().
   The 'npc' field wasn't getting filled properly during certain VMEXITs.

 - Introduce nvmm_vcpu_configure(). Similar to nvmm_machine_configure(),
   but as its name indicates, the configuration is per-VCPU and not per-VM.
   Migrate and rename NVMM_MACH_CONF_X86_CPUID to NVMM_VCPU_CONF_CPUID.
   This becomes per-VCPU, which makes more sense than per-VM.

 - Extend the NVMM_VCPU_CONF_CPUID conf to allow triggering VMEXITs on
   specific leaves. Until now we could only mask the leaves. An uint32_t
   is added in the structure:
	uint32_t mask:1;
	uint32_t exit:1;
	uint32_t rsvd:30;
   The two first bits select the desired behavior on the leaf. Specifying
   zero on both resets the leaf to the default behavior. The new
   NVMM_VCPU_EXIT_CPUID exit reason is added.
2019-10-23 07:01:11 +00:00