Home | History | Annotate | Download | only in kern
History log of /src/sys/kern/core_elf32.c
RevisionDateAuthorComments
 1.67  02-Jan-2021  rin Use <compat/netbsd32/netbsd32.h> instead of <machine/netbsd32_machdep.h>,
which is not intended for standalone use.

Compile tested for all ports with their own COMPAT_NETBSD32 codes:
aarch64, amd64, arm, mips64, sparc64, and algor64.

Should fix build failure for mips64 in netbsd-9, where netbsd32.h is not
included by other header files.
 1.66  19-Oct-2020  christos branches: 1.66.2;
Arrange so that no options COREDUMP and no options PTRACE work together.
Thanks to Paul Goyette for testing.
 1.65  10-Oct-2020  rin Use correct note types for register storage in 32-bit core files for
architecture on which 64- and 32-bit ABIs use different values for
PT_GET{,FP}REGS, i.e., aarch64{,eb}.

Now, 32-bit GDB works fine for core files generated by aarch64{,eb}
kernel.

Should be no functional changes for ports other than aarch64{,eb}.
 1.64  30-May-2020  thorpej coredump_note_elf{32,64}(): avoid allcating register state buffers on
the stack; they could be large.
 1.63  23-May-2020  ad Move proc_lock into the data segment. It was dynamically allocated because
at the time we had mutex_obj_alloc() but not __cacheline_aligned.
 1.62  08-Jan-2020  mgorny Include XSTATE note in x86 core dumps

Introduce a simple COREDUMP_MACHDEP_LWP_NOTES logic to provide machdep
API for injecting per-LWP notes into coredumps, and use it to append
PT_GETXSTATE note.

Since the XSTATE block uses the same format on i386 and amd64, the code
does not have to conditionalize between 32-bit and 64-bit ELF format
on that. However, it does need to distinguish between 32-bit and 64-bit
PT_* values. In order to do that, it reuses PT32_* constant already
present for ptrace(), and adds a matching PT64_GETXSTATE to satisfy
the cpp logic.
 1.61  24-Dec-2019  kamil branches: 1.61.2;
Introduce PT_LWPSTATUS + PT_LWPNEXT, obsolete PT_LWPINFO

PT_LWPINFO is a legacy ptrace(2) operation that was originally intended
to retrieve the thread (LWP) information inside a traced process.

It has a number of flaws and is confused with PT_LWPINFO from FreeBSD.

PT_LWPSTATUS and PT_LWPNEXT address the problems (shortly by: rename,
removal of pl_event) and introduces new features: signal context
(pl_sigpend, pl_sigmask), LWP name (pl_name), LWP TLS base address
(pl_private). The private pointer was so far missing information for
a debugger.

PT_LWPSTATUS@nnn is now shipped with core(5) files and contain LWP specific
information, so far missed in the core(5) files.

PT_LWPSTATUS retrieves LWP information for the prompted thread.
PT_LWPNEXT retrieves LWP information for the next thread, borrowing the
semantics from NetBSD specific PT_LWPINFO.

PT_LWPINFO is namespaced with __LEGACY_PT_LWPINFO and still available for
the foreseeable future, without plans of removing it.

Add ATF tests for PT_LWPSTATUS + PT_LWPNEXT.

Keep ATF tests for PT_LWPINFO.

Switch GDB to new API.

Proposed on tech-kern@.
 1.60  22-Nov-2019  pgoyette Use __diagused
 1.59  20-Nov-2019  pgoyette Move all non-emulation-specific coredump code into the coredump module,
and remove all #ifdef COREDUMP conditional compilation. Now, the
coredump module is completely separated from the emulation modules, and
they can all be independently loaded and unloaded.

Welcome to 9.99.18 !
 1.58  22-Jan-2019  kamil branches: 1.58.4;
Fix code generation for programs with a faulty process map

In case of any errors of scanning the segments reset
their content to a default value with zeros. This is
achieved with shortening the p_filesz parameter.

This allows to emit core(5) files for a process
regardless of its state of mappings, such as mapping
pages after EOF in a file.

Fixes PR lib/53343
 1.57  03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.56  21-Jan-2018  christos branches: 1.56.2; 1.56.4;
CID-1427760: While overrun can't happen, make it obvious that it can't
 1.55  04-May-2017  kamil Set clear comment about EI_OSABI and EI_ABIVERSION

/*
* NetBSD sets generic SYSV OSABI and ABI version 0
* Native ELF files are distinguishable with NetBSD specific notes
*/

No functional change.
 1.54  30-Mar-2017  christos branches: 1.54.4;
factor out getauxv code.
 1.53  29-Mar-2017  kamil Revert previous.

Pointed out by Christous Zoulas that ELF_AUX_ENTRIES * sizeof(AuxInfo)
assumption is incomplete. There is emulation code that can use different
values (smaller and larger).
 1.52  29-Mar-2017  kamil Generate ELF AUXV for core(5) and ptrace(2) limited to the vector TYPE x V

Previously PT_DUMPCORE and PIOD_READ_AUXV and regular core dumping retrieved
the vector of AuxInfo {a_type, a_v} + MAXPATHLEN + ALIGN(1).

The extra data is not actually needed in the returned chunk. It can be
retrieved with PT_READ_I operations and it's the preferred way to access
them as the AuxInfo fields contain pointers (void* format) to them.

This changes the behavior of the kernel, no stable releases are affected
with this move. Current software is not affected as other systems already
stop generating data on AT_NULL. This streamlines the NetBSD behavior with
other ELF format OSes. This move also simplifies determination if we got
all the needed data inside the debugger and we no longer need to eliminate
the unneeded chunk at the end.

Sponsored by <The NetBSD Foundation>
 1.51  25-Jan-2017  christos PR/51916: Kamil Rytarowski: Don't multiply es_arglen with ptrsz since it is
already in bytes and contains the maximum possible size:
ELF_AUX_ENTRIES * sizeof(auxv) + MAXPATHLEN + ALIGN
 1.50  06-Jan-2017  kamil branches: 1.50.2;
Introduce new ptrace(2) interface: PT_SET_SIGINFO and PT_GET_SIGINFO

This interface is designed to read signal information emited to tracee and
fake this signal with new value.

This functionality is required to distinguish types of events that occured
in the tracee and intercepted by a debugger.

These accessors introduce a new structure type ptrace_siginfo:
/*
* Signal Information structure
*/
typedef struct ptrace_siginfo {
siginfo_t psi_siginfo; /* signal information structure */
lwpid_t psi_lwpid; /* destination LWP of the signal
* value 0 means the whole process
* (route signal to all LWPs) */
} ptrace_siginfo_t;

Include <sys/siginfo.h> in <sys/ptrace.h> in order to not break existing
software due to unknown symbol siginfo_t.

This interface has been proposed to the tech-kern@ mailing list.

Sponsored by <The NetBSD Foundation>
 1.49  29-Sep-2016  christos Introduce and use PROC_PTRSZ() to handle differing pointer size 64->32
emulation.
 1.48  05-Sep-2016  dholland Build fix for when COREDUMP is turned off, from Ray Phillips in PR 51460.
 1.47  27-Jun-2016  christos branches: 1.47.2;
PR/51277: Fix compat32 coredumping that broke with the aux vector note
addition.
 1.46  24-May-2016  christos Add a note for the auxv array so we can find our load location from a
core file of a PIE binary.
 1.45  02-Apr-2014  matt branches: 1.45.6;
If we are writing PN_XNUM or more phdrs, include one section header and
encode the real # of sections in its sh_info.
 1.44  05-Jan-2014  dsl Fix previous slightly differently.
No need to have an extra variable and to write to the list head.
 1.43  05-Jan-2014  mrg avoid use-after-free in *coredump().
fixes kernel crashes during coredump on sparc64.
 1.42  04-Jan-2014  dsl Remove __HAVE_PROCESS_XFPREGS and add the extra parameter for the size
of the fp save area to all the process_read_fpregs() and
process_write_fpregs() functions.
None of the functions have been modified to use the new parameters.
The size is set for all the writes, but some of the arch-specific reads
just pass NULL.
The amd64 (and i386) need variable sized fp register save areas in order
to support AVX and other enhanced register areas.
These functions are rarely called - so the extra argument won't matter.
 1.41  03-Jan-2014  dsl Fix bug in previous (panic during process core dump).
Change the interface to ELFNAMEEND(coredump_savenote) so that the caller
doesn't need to know the type of the elf note header.
Simplifies the calling code somewhat.
 1.40  03-Jan-2014  dsl There is no need for uvm_coredump_walkmap() to explicity pass the proc_t
pointer to the calller's function.
If the code needs the process its address can be placed in the caller's
cookie.
 1.39  03-Jan-2014  dsl Instead of generating all the 'note' sections twice (and hoping that the
'fast path' size on the first path matches the actual size on the second)
save all the notes (mostly the cpu registers for all the LWPs) in
malloced memory on the first pass.
Sanity check that the number of memory segments matches written matches
the count obtained earlier. If gcore() is used they could differ.
(Not sure that returning ENOMEM is ideal, but it is better than a crash.)
 1.38  03-Jan-2014  dsl Minor changes to the process coredump code.
- Add some extra comments.
- Add some XXX comments because the process state might not be stable,
- Add uvm_coredump_count_segs() to simplify the calling code.
- uvm code now only returns non-empty sections/segments.
- Put the 'iocookie' into the 'cookie' block passed to uvm_coredump_walkmap()
instead of passing it through as an additional parameter.
amd64 can still generate core dumps that gdb can read.
 1.37  01-Jan-2014  dsl Change the type of the 'cookie' that holds the state of the core dump file
from 'void *' to the actual type 'struct coredump_iostate *'.
In most of the code the contents of the structure are still unknown.
This just stops the wrong type of pointer being passed to the 'void *'
parameter.
I hope I've found everything, amd64 GENERIC and i386 GENERIC & ALL compile.
 1.36  27-Jan-2012  para branches: 1.36.6; 1.36.10;
extending vmem(9) to be able to allocated resources for it's own needs.
simplifying uvm_map handling (no special kernel entries anymore no relocking)
make malloc(9) a thin wrapper around kmem(9)
(with private interface for interrupt safety reasons)

releng@ acknowledged
 1.35  14-Dec-2009  matt branches: 1.35.12; 1.35.16;
Merge from matt-nb5-mips64
 1.34  21-Oct-2009  rmind Remove uarea swap-out functionality:

- Addresses the issue described in PR/38828.
- Some simplification in threading and sleepq subsystems.
- Eliminates pmap_collect() and, as a side note, allows pmap optimisations.
- Eliminates XS_CTL_DATA_ONSTACK in scsipi code.
- Avoids few scans on LWP list and thus potentially long holds of proc_lock.
- Cuts ~1.5k lines of code. Reduces amd64 kernel size by ~4k.
- Removes __SWAP_BROKEN cases.

Tested on x86, mips, acorn32 (thanks <mpumford>) and partly tested on
acorn26 (thanks to <bjh21>).

Discussed on <tech-kern>, reviewed by <ad>.
 1.33  19-Nov-2008  ad Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
 1.32  24-Apr-2008  ad branches: 1.32.2; 1.32.4; 1.32.8; 1.32.10; 1.32.16;
Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
be sent from a hardware interrupt handler. Signal activity must be
deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.
 1.31  09-Jul-2007  ad branches: 1.31.2; 1.31.30; 1.31.32;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.30  09-Mar-2007  ad branches: 1.30.2; 1.30.4;
- Make the proclist_lock a mutex. The write:read ratio is unfavourable,
and mutexes are cheaper use than RW locks.
- LOCK_ASSERT -> KASSERT in some places.
- Hold proclist_lock/kernel_lock longer in a couple of places.
 1.29  09-Feb-2007  ad branches: 1.29.2;
Merge newlock2 to head.
 1.28  01-Nov-2006  yamt remove some __unused from function parameters.
 1.27  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.26  23-Jul-2006  ad branches: 1.26.4; 1.26.6;
Use the LWP cached credentials where sane.
 1.25  14-May-2006  elad integrate kauth.
 1.24  17-Apr-2006  christos Make sure we clear cpi_name; reported by Aymeric Vincent.
 1.23  12-Mar-2006  cube branches: 1.23.2;
Support the generation of coredumps for 32-bits binaries under
COMPAT_NETBSD32. They haven't worked for 5 years.

Silently agreed by the tech-kern readers.

XXX sparc64 MD glue still lacking.
XXX The FPU registers on i386 are not dumped correctly, according to my
XXX tests. It shouldn't be much work for someone who has the slightest
XXX idea of how that stuff is supposed to be laid out on i386.
 1.22  08-Dec-2005  thorpej branches: 1.22.4; 1.22.6; 1.22.8; 1.22.10;
Sprinkle static.
 1.21  06-Jul-2005  christos Make copy{in,out}_proc work on all processes (including curproc) by
special-casing the curproc case. Use copy{in,out}_proc directly instead
of checking for curproc each time. Discussed with thorpej.
 1.20  06-Jul-2005  kleink Addendum to previous: copyin_proc() must not be used on curproc.
 1.19  06-Jul-2005  kleink Use copyin_proc() to peek for trailing zeroes in sections, as we might be
running in a different context (i.e. a process tracing).
 1.18  10-Jun-2005  matt branches: 1.18.2;
Rework the coredump code to have no explicit knownledge of how coredump
i/o is done. Instead, pass an opaque cookie which is then passed to a
new routine, coredump_write, which does the actual i/o. This allows the
method of doing i/o to change without affecting any future MD code.
Also, make netbsd32_core.c [re]use core_netbsd.c (in a similar manner that
core_elf64.c uses core_elf32.c) and eliminate that code duplication.
cpu_coredump{,32} is now called twice, first with a NULL iocookie to fill
the core structure and a second to actually write md parts of the coredump.
All i/o is nolonger random access and is suitable for shipping over a stream.
 1.17  03-Jun-2005  he An Elf32_Addr can't be cast to caddr_t without first being cast to intptr_t
without causing a warning (turned into error). Fixes build problem for amd64.
 1.16  02-Jun-2005  matt When writing coredumps, don't write zero uninstantiated demand-zero pages.
Also, with ELF core dumps, trim trailing zeroes from sections. These two
changes can shrink coredumps by over 50% in size.
 1.15  29-May-2005  christos - add const.
- remove unnecessary casts.
- add __UNCONST casts and mark them with XXXUNCONST as necessary.
 1.14  17-Sep-2004  skrll There's no need to pass a proc value when using UIO_SYSSPACE with
vn_rdwr(9) and uiomove(9).

OK'd by Jason Thorpe
 1.13  21-Apr-2004  itojun kill sprintf, use snprintf
 1.12  14-Sep-2003  christos handle siginfo for deferred signals. Allocate a ksiginfo pool, and store
the information there.
TODO:
1. since timer stuff gets called from an interrupt context, we could
preallocate ksiginfo_t's from the pool, so we don't need a kmem
pool.
2. probably the sa signal delivery syscall can be changed to take
a ksiginfo_t so we can use only one pool.
3. maybe when we add realtime signal support, add a resource limit
on the number of ksiginfo_t's a process can allocate.
 1.11  06-Sep-2003  christos SA_SIGINFO changes.
 1.10  29-Jun-2003  fvdl branches: 1.10.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.9  28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.8  20-May-2003  nathanw Track the LWP ID of a synchronous (trap) signal, and report it in core dumps.
 1.7  16-May-2003  itojun use strlcpy. [fixed off-by-one in subr_prop.c]
 1.6  08-May-2003  matt Make we keep track of the file sizes in a size_t, not an int. Also break
out the writing of an lwp's registers to a separate function. XXX Although
not really the correct way to do this, make the thread that caused the
coredump has it's register set written first so GDB is happy. (this is a
bridge until TRT is done).
 1.5  25-Feb-2003  atatat Tweak some comments so that they match the other comments more properly.
 1.4  18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.3  10-Dec-2001  thorpej branches: 1.3.2; 1.3.4; 1.3.16;
Cast off_t to (long long) for printing.
 1.2  10-Dec-2001  thorpej Move the code that walks the process's VM map during a coredump
into uvm_coredump_walkmap(), and use callbacks into the coredump
routine to do something with each section.
 1.1  09-Dec-2001  thorpej Add support for dumping ELF-cormat core files.
 1.3.16.1  18-Dec-2002  gmcgarry Merge pcred and ucred, and poolify. TBD: check backward compatibility
and factor-out some higher-level functionality.
 1.3.4.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.4.1  10-Dec-2001  thorpej file core_elf32.c was added on branch kqueue on 2002-01-10 19:59:37 +0000
 1.3.2.5  12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.3.2.4  08-May-2002  nathanw Wrap PHOLD()/PRELE() around calls to process_read_[fp]regs().
 1.3.2.3  09-Jan-2002  nathanw multi-LWP core dumps.
 1.3.2.2  08-Jan-2002  nathanw Catch up to -current.
 1.3.2.1  10-Dec-2001  nathanw file core_elf32.c was added on branch nathanw_sa on 2002-01-08 00:32:29 +0000
 1.10.2.7  11-Dec-2005  christos Sync with head.
 1.10.2.6  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.10.2.5  21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.2.4  18-Sep-2004  skrll Sync with HEAD.
 1.10.2.3  18-Aug-2004  skrll Correct an argument name in coredump_countsegs and don't overwrite an
argument in coredump_notes.
 1.10.2.2  03-Aug-2004  skrll Sync with HEAD
 1.10.2.1  02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.18.2.4  03-Sep-2007  yamt sync with head.
 1.18.2.3  26-Feb-2007  yamt sync with head.
 1.18.2.2  30-Dec-2006  yamt sync with head.
 1.18.2.1  21-Jun-2006  yamt sync with head.
 1.22.10.3  06-May-2006  christos - Move kauth_cred_t declaration to <sys/types.h>
- Cleanup struct ucred; forward declarations that are unused.
- Don't include <sys/kauth.h> in any header, but include it in the c files
that need it.

Approved by core.
 1.22.10.2  19-Apr-2006  elad sync with head.
 1.22.10.1  08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.22.8.3  11-Aug-2006  yamt sync with head
 1.22.8.2  24-May-2006  yamt sync with head.
 1.22.8.1  13-Mar-2006  yamt sync with head.
 1.22.6.2  01-Jun-2006  kardel Sync with head.
 1.22.6.1  22-Apr-2006  simonb Sync with head.
 1.22.4.1  09-Sep-2006  rpaulo sync with head
 1.23.2.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.26.6.2  10-Dec-2006  yamt sync with head.
 1.26.6.1  22-Oct-2006  yamt sync with head
 1.26.4.5  30-Jan-2007  ad Remove support for SA. Ok core@.
 1.26.4.4  29-Dec-2006  ad Checkpoint work in progress.
 1.26.4.3  24-Oct-2006  ad - Redo LWP locking slightly and fix some races.
- Fix some locking botches.
- Make signal mask / stack per-proc for SA processes.
- Add _lwp_kill().
 1.26.4.2  21-Oct-2006  ad Checkpoint work in progress on locking and per-LWP signals. Very much a
a work in progress and there is still a lot to do.
 1.26.4.1  11-Sep-2006  ad - Convert some lockmgr() locks to mutexes and RW locks.
- Acquire proclist_lock and p_crmutex in some obvious places.
 1.29.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.30.4.1  11-Jul-2007  mjf Sync with head.
 1.30.2.1  05-Apr-2007  ad - Make context switch counters 64-bit, and count the total number of
context switches + voluntary, instead of involuntary + voluntary.
- Add lwp::l_swaplock for uvm.
- PHOLD/PRELE are replaced.
 1.31.32.1  18-May-2008  yamt sync with head.
 1.31.30.2  17-Jan-2009  mjf Sync with HEAD.
 1.31.30.1  02-Jun-2008  mjf Sync with HEAD.
 1.31.2.1  18-Jul-2007  matt Add ELF core MD hooks and exec hooks to test ABI
 1.32.16.3  02-Apr-2014  matt Support coredumps with >= 65535 psections.
 1.32.16.2  23-Aug-2009  matt Change lazy fp load/save is done. fpcurlwp is never NULL.
If no current lwp has the FP, then fpcurlwp is set to lwp0.
this allows many check for NULL and avoids a few null-derefs.
Since savefpregs clear COP1, loadfpregs can be called to reload
fpregs. If it notices that situation, it just sets COP1 and returns
Save does not reset fpcurlwp, just clears COP1. load does set fpcurlwp.

If MIPS3_SR_FR is set, all 32 64-bit FP registers are saved/restored via Xdc1.
If MIPS3_SR_FR is clear, only 32 32-bit FP register are saved/restore via Xwc1.
This preserves the existing ABI.
 1.32.16.1  21-Aug-2009  matt Add support for ELF_MD_PROBE_FUNC and ELF_COREDUMP_SETUP so that more
exact checks can be made before committing to execute or better info
about what's being dumped.
 1.32.10.1  19-Jan-2009  skrll Sync with HEAD.
 1.32.8.1  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.32.4.2  14-May-2008  wrstuden Per discussion with ad at n dot o, revert signal mask handling
changes.

The l_sigstk changes are most likely totally un-needed as SA will
never use a signal stack - we send an upcall (or will as other
diffs are brought in).

The l_sigmask changes were too controvertial. In all honesty, I
think it's probably best to revert them. The main reason they were
there is the fact that in an SA process, we don't mask signals per
kernel thread, we mask them per user thread. In the kernel, we want
them all to get turned into upcalls. Thus the normal state of
l_sigmask in an SA process is for it to always be empty.

While we are in the process of delivering a signal, we want to
temporarily mask a signal (so we don't recursively exhaust our
upcall stacks). However signal delivery is rare (important, but
rare), and delivering back-to-back signals is even rarer. So rather
than cause every user of a signal mask to be prepared for this very
rare case, we will just add a second check later in the signal
delivery code. Said change is not in this diff.

This also un-compensates all of our compatability code for dealing
with SA. SA is a NetBSD-specific thing, so there's no need for
Irix, Linux, Solaris, SVR4 and so on to cope with it.

As previously, everything other than kern_sa.c compiles in i386
GENERIC as of this checkin. I will switch to ALL soon for compile
testing.
 1.32.4.1  10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.32.2.2  11-Mar-2010  yamt sync with head
 1.32.2.1  04-May-2009  yamt sync with head.
 1.35.16.1  18-Feb-2012  mrg merge to -current.
 1.35.12.2  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.35.12.1  17-Apr-2012  yamt sync with head
 1.36.10.1  18-May-2014  rmind sync with head
 1.36.6.2  03-Dec-2017  jdolecek update from HEAD
 1.36.6.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.45.6.5  28-Aug-2017  skrll Sync with HEAD
 1.45.6.4  05-Feb-2017  skrll Sync with HEAD
 1.45.6.3  05-Oct-2016  skrll Sync with HEAD
 1.45.6.2  09-Jul-2016  skrll Sync with HEAD
 1.45.6.1  29-May-2016  skrll Sync with HEAD
 1.47.2.4  26-Apr-2017  pgoyette Sync with HEAD
 1.47.2.3  20-Mar-2017  pgoyette Sync with HEAD
 1.47.2.2  07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.47.2.1  04-Nov-2016  pgoyette Sync with HEAD
 1.50.2.1  21-Apr-2017  bouyer Sync with HEAD
 1.54.4.1  11-May-2017  pgoyette Sync with HEAD
 1.56.4.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.56.4.1  10-Jun-2019  christos Sync with HEAD
 1.56.2.2  26-Jan-2019  pgoyette Sync with HEAD
 1.56.2.1  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.58.4.2  02-Jan-2021  martin Additionally pull up following revision(s) (requested by rin in ticket #1173):

sys/kern/core_elf32.c: revision 1.67

Use <compat/netbsd32/netbsd32.h> instead of <machine/netbsd32_machdep.h>,
which is not intended for standalone use.

Compile tested for all ports with their own COMPAT_NETBSD32 codes:
aarch64, amd64, arm, mips64, sparc64, and algor64.

Should fix build failure for mips64 in netbsd-9, where netbsd32.h is not
included by other header files.
 1.58.4.1  01-Jan-2021  martin Pull up following revision(s) (requested by rin in ticket #1173):

sys/kern/core_elf32.c: revision 1.65 (patch)

Use correct note types for register storage in 32-bit core files for
architecture on which 64- and 32-bit ABIs use different values for
PT_GET{,FP}REGS, i.e., aarch64{,eb}.

Now, 32-bit GDB works fine for core files generated by aarch64{,eb}
kernel.

Should be no functional changes for ports other than aarch64{,eb}.
 1.61.2.1  17-Jan-2020  ad Sync with head.
 1.66.2.1  03-Jan-2021  thorpej Sync w/ HEAD.

RSS XML Feed