Commit Graph

19760 Commits

Author SHA1 Message Date
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
wiz
a7c88536f5 Mark up argon2 description. Restore removed lines/text from previous
commit.
2019-10-21 05:16:51 +00:00
jhigh
b302373f87 adding argon2 support to libcrypt. argon2 user authentication now
available via MKARGON2=yes (3 variants supported; argon2id recommended)
before using, please read argon2 paper at
https://github.com/P-H-C/phc-winner-argon2
2019-10-21 02:36:48 +00:00
maxv
e1d43b1e6d Put back 'default', because llvm apparently doesn't realize that all cases
are covered in the switch.
2019-10-19 19:45:10 +00:00
maya
27d953155b Provide sysconf(_SC_RTSIG_MAX) = SIGRTMAX - SIGRTMIN
Thanks nros@ for the correct definition
2019-10-16 20:43:18 +00:00
maxv
fabc9bf218 Improve nvmm_vcpu_dump(). 2019-10-14 10:43:40 +00:00
maxv
c496a7b118 Implement XCHG, add associated tests, and add comments to explain. With
this in place the Windows 95 installer completes successfuly.

Part of PR/54611.
2019-10-14 10:39:24 +00:00
mrg
69f9039379 use GCC_NO_CAST_FUNCTION_TYPE. 2019-10-13 21:24:37 +00:00
maxv
416eaf02dc Fix incorrect parsing: the R/M field uses a special GPR map when the
address size is 16 bits, regardless of the actual operating mode. With
this special map there can be two registers referenced at once, and
also disp16-only.

Implement this special behavior, and add associated tests. While here
simplify a few things.

With this in place, the Windows 95 installer initializes correctly.

Part of PR/54611.
2019-10-13 17:32:15 +00:00
mrg
de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
nros
951054b00a Add manpage links for frexpf and frexpl.
Manpage links were missing for frexpf and frexpl even thogh they were
mentioned in the manpage for frexp.
2019-10-11 18:36:22 +00:00
kre
6b0ab5c5ab More cases to disable gcc-8 warnings only when we're using gcc>=8 2019-10-10 08:37:16 +00:00
kre
5dc161e026 Only exclude gcc-8 warnings if the gcc we're using is gcc>=8 2019-10-10 02:39:07 +00:00
kre
bab7747200 Only exclude gcc-8 warnings when the gcc we're using is gcc>=8 2019-10-10 02:35:45 +00:00
christos
c60bf2342e Add -Wno-error for gcc-8 warnings 2019-10-09 23:39:20 +00:00
christos
39877bf076 bump size 2019-10-09 23:23:41 +00:00
christos
b15dac3ccb don't warn for strncpy wtmp fields, they are not NUL terminated. 2019-10-09 22:05:35 +00:00
christos
cc33d2efa6 no error for function cast 2019-10-09 22:05:09 +00:00
christos
a47ebb18b3 add +1 to strlcpy's (Patrick Welche) 2019-10-09 14:31:07 +00:00
wiz
45ba2af5df Fix xref. 2019-10-09 14:20:47 +00:00
kamil
2dc9ce6014 Document PT_STOP, update PT_KILL in the ptrace(2) man-page
Formatting by <mgorny>
2019-10-09 13:42:37 +00:00
christos
cdd1ab83dc remove useless packed attributes 2019-10-08 19:38:38 +00:00
christos
39fd362275 use strlcpy (the buffer is already zeroed) 2019-10-08 19:38:27 +00:00
christos
3df2b62655 remore error(1) comment 2019-10-08 19:21:40 +00:00
christos
991f62167b Change strncpy to either memcpy (when we know the len), or strlcpy (when
we used to NUL terminate explicitly.
2019-10-08 19:17:57 +00:00
christos
bfdd69f658 -Wstringop-truncation is only gcc. 2019-10-08 18:50:34 +00:00