Commit Graph

265525 Commits

Author SHA1 Message Date
rin 4708abfff3 Turn on DIAGNOSTIC by default for modules in HEAD.
Make us sure that it should be commented out for release branches in
a similar manner to kernel configuration files.

Discussed on tech-kern.
2019-02-17 03:57:31 +00:00
mrg 36422d2e0c regen mknative with symver no longer disabled. 2019-02-17 00:24:15 +00:00
mrg f1ac420a3d don't pass --disable-symver to mknative configure. this turns off
the checking for gcc 4.6 and some exception handling routines which
we need on several platforms.

this should fix missing symbol issues seen on current-users.
2019-02-17 00:22:53 +00:00
mrg 70e3d17cd2 apply -std=gnu++98 to some more files.
state that some hard coded stuff here should be pulled out with mknative.
2019-02-17 00:05:11 +00:00
tron 7becde12ff Fix cut & paste error in comment 2019-02-16 23:28:56 +00:00
martin 37df7b8973 Typo in member variable name 2019-02-16 19:09:07 +00:00
martin c8239d06af Document return values from menu items opt_action functions, add a
new variant: -1 when functions have fundamentally changed the menu
definition on the fly and the processing functions needs to restart
without looking at the old state (or stale cached pointers).
2019-02-16 18:57:21 +00:00
kre 63ba0d5a97 PR bin/53986 from Christian Weisgerber
Skip forward to tomorrow to run a command earlier in the current
hour than now (as well as during an earlier hour of the day).
2019-02-16 17:56:57 +00:00
jmcneill 5d72569b2f Fix HDMI output; only install cursor_set/cursor_move funcs if hardware cursor is available. 2019-02-16 16:20:50 +00:00
maxv b7adc52057 Ah no, adapt previous, on AMD RAX is in the VMCB. 2019-02-16 12:58:13 +00:00
maxv 3624fc8223 Improve the FPU detection: hide XSAVES because we're not allowing it, and
don't set CPUID2_OSXSAVE if the guest didn't first set CR4_OSXSAVE.

With these changes in place, I can boot Windows 10 on NVMM.
2019-02-16 12:40:31 +00:00
maxv bf06ffc94d Handle MSR_MISC_ENABLE on NVMM-Intel (Intel-specific). 2019-02-16 12:05:30 +00:00
gutteridge 1c2ba908cc make(1): minor grammar fixes in BUGS section 2019-02-16 07:41:12 +00:00
wiz 75d36790ae Mark up NULL with Dv. 2019-02-16 07:00:56 +00:00
isaki aef27bc2ab Two minor fixes.
- 0 -> NULL.
- avoid K&R and sync with reality.
2019-02-16 06:51:04 +00:00
isaki 617001bf79 Two minor fixes.
- Add missing AUDIO_PERROR (since 1996!)
- Sort AUDIO_GETFD.
2019-02-16 06:50:14 +00:00
christos 52b10dfde0 PR/53983: Jonathan Perkins: Fix types for readline compatibility 2019-02-15 23:20:35 +00:00
rmind b46d30012f nvpair_remove_nvlist_array: revert part of the rev 1.4 change (it was applied
by mistake because the libnv upsteam code on Github has deviated from FreeBSD,
i.e. it has a different nvlist_set_array_next() logic).
2019-02-15 22:49:24 +00:00
kamil 4228275315 Avoid UB in OsdHardware.c
UBSan: Undefined Behavior in src/sys/dev/acpi/acpica/OsdHardware.c:265:17,
left shift of 255 by 24 places cannot be represented in type 'int'

This file isn't part of upstream acpica so just fix it locally.

Reported and initial patch by <Akul Pillai>
2019-02-15 20:48:57 +00:00
mgorny f5c01693d5 Fix reporting EOF via kevent and add a test case
Fix the kernel pty driver to report closed slave via master's kevent
EVFILT_READ.  This behavior matches the behavior for pipes, is
consistent with how FreeBSD implements it and is relied upon by LLDB's
main loop implementation.

Includes feedback by kre and kamil (from tech-kern), commit approved
by kamil.
2019-02-15 18:57:15 +00:00
maxv 2fad18ce40 Remove the PSE check in the 32bit-PAE MMU. Setting CR4.PAE automatically
enables PSE regardless of whether CR4.PSE is set or not, so we should just
ignore it.

With this in place I can boot Windows 8.1 on NVMM.
2019-02-15 16:42:27 +00:00
hannken 1cc92a5ea2 Add __diagused. 2019-02-15 16:37:54 +00:00
hannken 9d3d4465f5 Add /* FALLTHROUGH */ for DEBUG kernel. 2019-02-15 16:36:33 +00:00
rjs 786ba994fc This really was a missing break.
Spotted by Rin Okuyama.
2019-02-15 14:13:32 +00:00
maxv 5152d5aa1d Initialize the guest TSC to zero at VCPU creation time, and handle guest
writes to MSR_TSC at run time.

This is imprecise, because the hardware does not provide a way to preserve
the TSC during #VMEXITs, but that's fine enough.
2019-02-15 13:17:05 +00:00
nonaka 50517e577b Added Microsoft Hyper-V support. It ported from OpenBSD and FreeBSD.
graphical console is not work on Gen.2 VM yet. To use the serial console,
enter "consdev com,0x3f8,115200" on efiboot.
2019-02-15 08:54:01 +00:00
kamil 53cc2476a7 Add new ATF tests traceme_signal{ignored,masked}_crash* in t_ptrace_wait*
New tests verify that crashes (from trap signals) are delivered to tracer
regardless of the signal masking or signal ignoring option enabled in the
traced child.

All tests pass.

In close future these tests will obtain additional asserts.
2019-02-15 05:06:38 +00:00
kamil d5a7a3281b Add new ATF tests traceme_raisesignal_ignored in t_ptrace_wait*
Verify that ignoring (with SIG_IGN) in tracee
does not stop tracer from catching this raised signal.

Cover crash signals and already covered ones in other tests.

All tests pass.
2019-02-15 04:11:39 +00:00
macallan 6fe6c35acf move arch/iyonix into evbarm - it's got less machine specific code than most
evbarm/*...
does not quite work yet, but I don't want it to accumulate more differences
to what's in arch/iyonix
2019-02-14 21:47:52 +00:00
christos dcaaa9c384 get rid of binutils=227-specific files. 2019-02-14 20:42:40 +00:00
christos 88b70b62ed add breaks for done() since it might not be __dead. 2019-02-14 20:19:51 +00:00
palle 97adc61850 sun4v: add debug printout for ALIGN trap 2019-02-14 20:09:40 +00:00
christos ccbb6255be PR/53981: Jonathan Perkins: history_list should null-terminate 2019-02-14 20:09:12 +00:00
christos df2505e193 done is not always done (it returns, it is not dead) 2019-02-14 17:08:54 +00:00
prlw1 eb6ad6b651 libpthread isn't used 2019-02-14 14:40:07 +00:00
maxv 27a60aeb62 Harmonize the handling of the CPL between AMD and Intel.
AMD has a separate guest CPL field, because on AMD, the SYSCALL/SYSRET
instructions do not force SS.DPL to predefined values. On Intel they do,
so the CPL on Intel is just the guest's SS.DPL value.

Even though technically possible on AMD, there is no sane reason for a
guest kernel to set a non-three SS.DPL, doing that would mess up several
common segmentation practices and wouldn't be compatible with Intel.

So, force the Intel behavior on AMD, by always setting SS.DPL<=>CPL.
Remove the now unused CPL field from nvmm_x64_state::misc[]. This actually
increases performance on AMD: to detect interrupt windows the virtualizer
has to modify some fields of misc[], and because CPL was there, we had to
flush the SEG set of the VMCB cache. Now there is no flush necessary.

While here remove the CPL check for XSETBV on Intel, contrary to AMD
Intel checks the CPL before the intercept, so if we receive an XSETBV
VMEXIT, we are certain that it was executed at CPL=0 in the guest. By the
way my check was wrong in the first place, it was reading SS.RPL instead
of SS.DPL.
2019-02-14 14:30:20 +00:00
kre 2ec3f71485 DEBUG mode only change. When pretty-printing a word from a parse
tree, don't display a CTLESC which is there only to protect a CTL*
char (a data char that happens to have the same value).  No actual
CTL* chars are printed as data, so no escaping is needed to protect
data which just happens to look the same.  Dropping this avoids the
possibility of confusion/ambiguity in what the word actually contains.

NFC for any normal shell build (very little of this file gets compiled there)
2019-02-14 13:27:59 +00:00
wiz 721279f428 Sort, and add a couple obsolete files for binutils=231. 2019-02-14 12:49:28 +00:00
mrg d40c522149 remove the hack to remove .eh_frame -- gcc7 is fixed it seems. 2019-02-14 12:22:06 +00:00
kre 727a664bee Add the "specialvar" built-in command. Discussed (well, mentioned
anway) on tech-userlevel with no adverse response.

This allows the magic of vars like HOSTNAME SECONDS, ToD (etc) to be
restored should it be lost - perhaps by having a var of the same name
imported from the environment (which needs to remove the magic in case
a set of scripts are using the env to pass data, and the var name chosen
happens to be one of our magic ones).

No change to SMALL shells (or smaller) - none of the magic vars (except
LINENO, which is exempt from all of this) exist in those, hence such a
shell has no need for this command either.
2019-02-14 11:15:24 +00:00
mrg 2358f4548e implement return_one for hppa, mips, ppc64, and vax. 2019-02-14 10:36:33 +00:00
mrg 5b04a93ad5 put joerg's varasm.c patch back with additional upstream fixes. now
crtbegin.o has a read-only .eh_frame, and libstdc++ builds.


2017-09-01  Joerg Sonnenberger  <joerg@bec.de>
            Jeff Law  <law@redhat.com>

        * varasm.c (bss_initializer_p): Do not put constants into .bss
        (categorize_decl_for_section): Handle bss_initializer_p returning
        false when DECL_INITIAL is NULL.

2017-11-27  Jakub Jelinek  <jakub@redhat.com>

        PR target/83100
        * varasm.c (bss_initializer_p): Return true for DECL_COMMON
        TREE_READONLY decls.

2018-02-09  Jakub Jelinek  <jakub@redhat.com>

        PR middle-end/84237
        * output.h (bss_initializer_p): Add NAMED argument, defaulted to false.
        * varasm.c (bss_initializer_p): Add NAMED argument, if true, ignore
        TREE_READONLY bit.
        (get_variable_section): For decls in named .bss* sections pass true as
        second argument to bss_initializer_p.
2019-02-14 10:29:58 +00:00
maxv 72977a18e9 On AMD, the segments have a simple "present" bit. On Intel however there
is an extra "unusable" bit, which has a twisted meaning. We can't just
ignore this bit, because when unset, the CPU performs extra checks on the
other attributes, which may cause VMENTRY to fail and the guest to be
killed.

Typically, on Qemu, some guests like Windows XP trigger two consecutive
getstate+setstate calls, and while processing them, we end up wrongfully
removing the "unusable" bits that were previously set.

Fix that by forcing "unusable = !present". Each hypervisor I could check
does something different, but this seems to be the least problematic
solution for now.

While here, the fields of vmx_guest_segs are VMX indexes, so they should
be uint64_t (no functional change).
2019-02-14 09:37:31 +00:00
cherry 1e3d30b0e6 Welcome XENPVHVM mode.
It is UP only, has xbd(4) and xennet(4) as PV drivers.

The console is com0 at isa and the native portion is very
rudimentary AT architecture, so is probably suboptimal to
run without PV support.
2019-02-14 08:18:25 +00:00
cherry 8644947bb7 Fix NLAPIC, NISA and NIOAPIC related conditional compile errors.
This will allow us to now compile an amd64 kernel without PCI.

No functional changes.
2019-02-14 07:12:40 +00:00
cherry f3ad8a34c4 Snag the final bits of PV only code to conditionally compile under
-DXENPV

This completes the bifurcation.

The next step is to add -DXENPVHVM code.
2019-02-14 06:59:24 +00:00
kamil c26a89103c Replace signal2 in t_ptrace_wait* with new tests
Add new tests traceme_raisesignal_masked[1-8].

New tests to verify that masking (with SIG_BLOCK) signal in tracee
stops tracer from catching this raised signal. Masked crash signals are
invisible to tracer as well.

All tests pass.
2019-02-14 06:47:32 +00:00
kamil 0c1b4f39e5 Add new regression scenarios for crash signals in t_ptrace_wait*
Verify correct behavior of crash signals (SIGTRAP, SIGBUS, SIGILL, SIGFPE,
SIGSEGV) in existing test scenarios:
 - traceme_raise
 - traceme_sendsignal_handle
 - traceme_sendsignal_masked
 - traceme_sendsignal_ignored
 - traceme_sendsignal_simple
 - traceme_vfork_raise

These tests verify signals out of the context of CPU trap. These new tests
will help to retain expected behavior in future changes in semantics of
the trapsignals in the kernel.
2019-02-14 05:38:45 +00:00
msaitoh 05d6458099 Sort in alphebetical order a bit. 2019-02-14 04:34:37 +00:00
msaitoh f16620c10b Add KSZ8081 support from FreeBSD. 2019-02-14 04:13:40 +00:00