Commit Graph

249061 Commits

Author SHA1 Message Date
christos 3e2605f3b9 refresh 2017-02-24 03:44:54 +00:00
khorben a3d226ca02 Revert "Remove a useless loop around getpass()"
getpass(3) may return NULL upon failures on Linux, and netpgp should remain
portable to other systems.
2017-02-24 01:26:17 +00:00
nat f5feab7514 Hold the intr_lock when broadcasting/waiting on sc_[rec]condvar. 2017-02-23 23:19:04 +00:00
nat f37c1195ee Update pad due to changes in audio. sc_bytes_count and BYTESTOSLEEP are
no longer required.
2017-02-23 23:13:27 +00:00
skrll 1ea652380c Typo in comment 2017-02-23 22:33:31 +00:00
macallan f2149cbd66 add MIPS-specific clang header file 2017-02-23 19:51:46 +00:00
christos 94c425fa3d provide ecoff 32 defines. 2017-02-23 18:56:12 +00:00
christos 1641b50601 Provided sized definitions for ecoff 32 bit headers. 2017-02-23 18:54:30 +00:00
christos c9ed210715 This only works with 32 bit Elf and COFF files, make it specific this way
and use sized types so that it works on 64 bit systems (so it can become
a tool).
2017-02-23 18:49:00 +00:00
chs 1f54905796 revert rev 1.2 (disabling split wide types) because it's no longer necessary
after rev 1.6 of m68k.md (which itself reverted a local patch that hadn't
been necessary for over a decade... see gcc bugzilla 12792).
discussed with christos and confirmed no regressions with the atf tests.
2017-02-23 18:43:01 +00:00
christos c78ee482d4 add accept4 2017-02-23 15:18:36 +00:00
christos 3fed35c1f4 add link for accept4. 2017-02-23 15:17:17 +00:00
kre 887a30551e Generate usage error for bad usage, before attempting any other operations.
This means that "mixerctl" (no args) will generate a usage msg, even when
/dev/mixer cannot be opened (or any other device given via -d or $MIXERDEVICE)

While here, get rid of "goto usage" replacing the usage: with a
static inline void __dead function...  The compiler ought to optimise
the calls into essentially the same code as existed with the goto version,
but this is much cleaner.

Also, mixerctl falls back on /dev/mixer0 if /dev/mixer cannot be opened.
(that is old code - probably from when /dev/mixer was first added)

It used to do that when called as mixerctl -d /dev/mixer or with
"MIXERDEVICE=/dev/mixer mixerctl...".   No longer.  Now the fallback (which
is probably obsolete now anyway) only happens when the user doesn't specify
any mixer device (by either method) and the default of /dev/mixer is used.
In other cases, only the device specified is tried.
2017-02-23 14:09:11 +00:00
kre 71b606ef4e Drop the test for QEMU and instead skip relevant tests when /dev/mixer
can't be opened (which more accurately reflects when mixerctl is going
to fail...)

Based upon an idea from Andreas Gustafsson (gson@) - except that using
/dev/audio0 for this purpose doesn't work, if the only audio device
configured is pad0 an open of audio fails with EIO (???)

While here, perpare for the updated mixerctl coming soon to a repository
near you...
	Use correct usage in the test of a bogus -d arg (otherwise the
		new mixerctl will complain about usage, and never even
		attempt to open the bogus device)
	Don't require /dev/mixer for the noargs -> generate usage msg
		test ... this will now generate a failing test with the
		old mixerctl if there is no working /dev/mixer, but
		that mixerctl won't be around much longer.
2017-02-23 14:01:37 +00:00
roy 7457a06fbb Remove kLFT and kRIT from putty.
This allows left and right cursor key movement inside tmux on putty.
See https://github.com/tmux/tmux/issues/708.
2017-02-23 13:22:53 +00:00
nonaka fcf5cd9bd4 Avoid panic when amd64 kernel is booted from 32bit UEFI. 2017-02-23 12:17:36 +00:00
nonaka 148f109aa3 reset ri->ri_hwbits too if RI_CFGDONE is set.
prevent ri->ri_hwbits from moving to center every time rasops_reconfig() is
called when RI_CENTER is set.
2017-02-23 12:16:30 +00:00
nonaka 97ee5d1ac1 no need COUNT_KERNEL hack. 2017-02-23 12:14:53 +00:00
nonaka 15c3e657d9 update marks[MARK_DATA] with COUNT_DATA. 2017-02-23 12:13:59 +00:00
nonaka 3f166eb124 fix CTF section symbol size was not counted with COUNT_KERNEL. 2017-02-23 12:13:05 +00:00
martin 3745de3e82 Make it compilable in non-diagnostic kernels 2017-02-23 12:01:12 +00:00
hannken d0ef892c64 Test for fstrans support before trying to allocate per-thread info.
PR kern/51996 (kmem_alloc called from intr context in fstrans_get_lwp_info)
2017-02-23 11:23:22 +00:00
skrll 2fbf6a0bbf Fixup the compile time decisions around PMAP_{INCLUDE,NEEDS}_PTE_SYNC and
fix the options for xscale boards which require the code in
pmap_l2ptp_ctor marked as #ifndef PMAP_INCLUDE_PTE_SYNC.

Fix the typo (pte -> opte) in this code block and consistently use opte
elsewhere.

PR/51990: Regression data_abort_handler: data_aborts fsr=0x406 far=0xbfffeff5  on copyout in init
2017-02-23 08:22:20 +00:00
wiz 5de13b617d Formatting fix. 2017-02-23 08:11:09 +00:00
ozaki-r 00a9cf741d Remove mkludge stuffs
For unknown reasons, IPv6 multicast addresses are linked to a first
IPv6 address assigned to an interface. Due to the design, when removing
a first address having multicast addresses, we need to save them to
somewhere and later restore them once a new IPv6 address is activated.
mkludge stuffs support the operations.

This change links multicast addresses to an interface directly and
throws the kludge away.

Note that as usual some obsolete member variables remain for kvm(3)
users. And also sysctl net.inet6.multicast_kludge remains to avoid
breaking old ifmcstat.

TODO: currently ifnet has a list of in6_multi but obviously the list
should be protocol independent. Provide a common structure (if_multi
or something) to handle in6_multi and in_multi together as well as
ifaddr does for in_ifaddr and in6_ifaddr.
2017-02-23 07:57:09 +00:00
kamil 7250944257 Document PT_GETDBREGS and PT_SETDBRGS in ptrace(2)
Not this interface in MD part.
Explain design choices.

Sponsored by <The NetBSD Foundation>
2017-02-23 05:48:14 +00:00
kamil 04ccfb0ebb Add SSA to wtf(6)
SSA    static single assignment

Fix position of AMP.
2017-02-23 05:04:14 +00:00
kamil 5c4cff4517 Fix build of ports without PT_STEP
Fallout after PT_*DBREGS introduction.

Sponsored by <The NetBSD Foundation>
2017-02-23 04:48:36 +00:00
kamil ff361effc7 Welcome to 7.99.62!
New ptrace(2) operations:
 - PT_RESUME
 - PT_SUSPEND
 - PT_SETDBREGS
 - PT_GETDBREGS

Sponsored by <The NetBSD Foundation>
2017-02-23 03:48:20 +00:00
kamil 988eb7ed71 Introduce PT_GETDBREGS and PT_SETDBREGS in ptrace(2) on i386 and amd64
This interface is modeled after FreeBSD API with the usage.

This replaced previous watchpoint API. The previous one was introduced
recently in NetBSD-current and remove its spurs without any
backward-compatibility.

Design choices for Debug Register accessors:
 - exec() (TRAP_EXEC event) must remove debug registers from LWP
 - debug registers are only per-LWP, not per-process globally
 - debug registers must not be inherited after (v)forking a process
 - debug registers must not be inherited after forking a thread
 - a debugger is responsible to set global watchpoints/breakpoints with the
   debug registers, to achieve this PTRACE_LWP_CREATE/PTRACE_LWP_EXIT event
   monitoring function is designed to be used
 - debug register traps must generate SIGTRAP with si_code TRAP_DBREG
 - debugger is responsible to retrieve debug register state to distinguish
   the exact debug register trap (DR6 is Status Register on x86)
 - kernel must not remove debug register traps after triggering a trap event
   a debugger is responsible to detach this trap with appropriate PT_SETDBREGS
   call (DR7 is Control Register on x86)
 - debug registers must not be exposed in mcontext
 - userland must not be allowed to set a trap on the kernel

Implementation notes on i386 and amd64:
 - the initial state of debug register is retrieved on boot and this value is
   stored in a local copy (initdbregs), this value is used to initialize dbreg
   context after PT_GETDBREGS
 - struct dbregs is stored in pcb as a pointer and by default not initialized
 - reserved registers (DR4-DR5, DR9-DR15) are ignored

Further ideas:
 - restrict this interface with securelevel

Tested on real hardware i386 (Intel Pentium IV) and amd64 (Intel i7).

This commit enables 390 debug register ATF tests in kernel/arch/x86.
All tests are passing.

This commit does not cover netbsd32 compat code. Currently other interface
PT_GET_SIGINFO/PT_SET_SIGINFO is required in netbsd32 compat code in order to
validate reliably PT_GETDBREGS/PT_SETDBREGS.

This implementation does not cover FreeBSD specific defines in their
<x86/reg.h>: DBREG_DR7_LOCAL_ENABLE, DBREG_DR7_GLOBAL_ENABLE, DBREG_DR7_LEN_1
etc. These values tend to be reinvented by each tracer on its own. GNU
Debugger (GDB) works with NetBSD debug registers after adding this patch:

--- gdb/amd64bsd-nat.c.orig	2016-02-10 03:19:39.000000000 +0000
+++ gdb/amd64bsd-nat.c
@@ -167,6 +167,10 @@ amd64bsd_target (void)

 #ifdef HAVE_PT_GETDBREGS

+#ifndef DBREG_DRX
+#define	DBREG_DRX(d,x)	((d)->dr[(x)])
+#endif
+
 static unsigned long
 amd64bsd_dr_get (ptid_t ptid, int regnum)
 {


Another reason to stop introducing unpopular defines covering machine
specific register macros is that these value varies across generations of
the same CPU family.

GDB demo:
  (gdb) c
  Continuing.

  Watchpoint 2: traceme

  Old value = 0
  New value = 16
  main (argc=1, argv=0x7f7fff79fe30) at test.c:8
  8               printf("traceme=%d\n", traceme);

(Currently the GDB interface is not reliable due to NetBSD support bugs)

Sponsored by <The NetBSD Foundation>
2017-02-23 03:34:22 +00:00
kre 700ea9d267 Limit previous to the i386 qemu kernels, the tests work on amd64 and sparc
(which have some audio configured.)
2017-02-23 02:28:10 +00:00
kre e4eeed67d9 Skip most of the mixerctl tests when running under QEMU (assumed to be for ATF)
as the kernel that runs them has no audio (and no mixers) configured.

The usage message test might be returned some day if /usr/bin/mixerctl
gets modified so it doesn't attempt to open the device (and error out)
in cases where the device isn't actually going to be used (and -d wasn't
given to set the device name explicitly).
2017-02-23 02:09:24 +00:00
scole e3edf3b621 Add fenv for ia64, imported from FreeBSD, compile tested only. 2017-02-23 02:05:30 +00:00
scole b7d844764d Add fenv.h for ia64, imported from FreeBSD, compile tested only. 2017-02-23 02:03:27 +00:00
kamil fb0af2ac33 Improve PT_SET_SIGMASK and PT_GET_SIGMASK API in ptrace(2)
Use proper check for LW_SYSTEM, don't depend on PT_GETREGS/PT_SETREGS.
Don't allow to mask SA_CANTMASK signals with PT_SET_SIGMASK (this covers
SIGSTOP and SIGKILL).

Add new ATF tests:
 - setsigmask5
   Verify that sigmask cannot be set to SIGKILL

 - setsigmask6
   Verify that sigmask cannot be set to SIGSTOP

Sponsored by <The NetBSD Foundation>
2017-02-23 00:50:09 +00:00
kamil f9b2093d06 Introduce new ptrace(2) API to allow/prevent exection of LWP
Introduce new API for debuggers to allow/prevent execution of the specified
thread.

New ptrace(2) operations:

     PT_RESUME     Allow execution of a specified thread, change its state
                   from suspended to continued.  The addr argument is unused.
                   The data argument specifies the LWP ID.

                   This call is equivalent to _lwp_continue(2) called by a
                   traced process.  This call does not change the general
                   process state from stopped to continued.

     PT_SUSPEND    Prevent execution of a specified thread, change its state
                   from continued to suspended.  The addr argument is unused.
                   The data argument specifies the requested LWP ID.

                   This call is equivalent to _lwp_suspend(2) called by a
                   traced process.  This call does not change the general
                   process state from continued to stopped.

This interface is modeled after FreeBSD, however with NetBSD specific arguments
passed to ptrace(2) -- FreeBSD passes only thread id, NetBSD passes process and
thread id.

Extend PT_LWPINFO operation in ptrace(2) to report suspended threads. In the
ptrace_lwpinfo structure in pl_event next to PL_EVENT_NONE and PL_EVENT_SIGNAL
add new value PL_EVENT_SUSPENDED.

Add new errno(2) value EDEADLK that might be returned by ptrace(2). It prevents
dead-locking in a scenario of resuming a process or thread that is prevented
from execution. This fixes bug that old API was vulnerable to this scenario.

Kernel bump delayed till introduction of PT_GETDBREGS/PT_SETDBREGS soon.

Add new ATF tests:
 - resume1
   Verify that a thread can be suspended by a debugger and later
   resumed by the debugger

 - suspend1
   Verify that a thread can be suspended by a debugger and later
   resumed by a tracee

 - suspend2
   Verify that the while the only thread within a process is
   suspended, the whole process cannot be unstopped

Sponsored by <The NetBSD Foundation>
2017-02-22 23:43:43 +00:00
abhinav c56d982263 Add reference to flockfile(3) in SEE ALSO section. 2017-02-22 15:08:55 +00:00
abhinav 4acd25c1d4 Fix a sentence.
Add write(2) in SEE ALSO.
2017-02-22 14:58:33 +00:00
abhinav 8ab56b2aac Fix typo. 2017-02-22 14:15:15 +00:00
abhinav cb05c08df5 Use Nm to refer the program name. 2017-02-22 14:01:40 +00:00
abhinav 98ea63c468 Fix spelling of "discovered" 2017-02-22 13:43:15 +00:00
maya 1b3b22737e leave the part for GCC >= 5.3 in.
Was a little over-eager and accidentally removed the else case.
2017-02-22 13:34:39 +00:00
maya 37d7525b7f GC workaround for GCC 4.8 fixed in GCC 5+ 2017-02-22 13:17:29 +00:00
maya 1eca7e637c Get rid of more -mno-thumb -mno-thumb-interwork for GCC < 4.8 2017-02-22 13:14:45 +00:00
maya e022f76317 GC more logic that was intended for GCC <4.8 (or !LLVM)
Same as before (-marm implies -mno-thumb), but now the condition was flipped
2017-02-22 12:51:38 +00:00
maya 4b934fe6cc GC gcc < 4.8 logic.
-marm implies -mno-thumb, and -mno-thumb-interwork is a GCC default.
2017-02-22 12:44:21 +00:00
maya c3094abd94 GC more gcc 4.8 specific (dead) logic 2017-02-22 12:34:49 +00:00
maya b0f6bc04c6 GC some GCC 4.8 specific sh3 HACKS entries.
These existed to avoid compile errors, and haven't been effect
since gcc.old was removed.
2017-02-22 12:17:16 +00:00
hannken 8a83906a50 Add weak aliases for _fstrans_start() and fstrans_done(). 2017-02-22 11:20:59 +00:00
hannken a378d58ecb Enable fstrans on all file systems.
Welcome to 7.99.61
2017-02-22 09:50:13 +00:00